aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SBO-Lib/lib/SBO/Lib.pm7
-rw-r--r--man1/sboupgrade.19
-rwxr-xr-xsboupgrade38
3 files changed, 35 insertions, 19 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm
index 2a7a338..eee6210 100644
--- a/SBO-Lib/lib/SBO/Lib.pm
+++ b/SBO-Lib/lib/SBO/Lib.pm
@@ -53,6 +53,7 @@ our @EXPORT = qw(
process_sbos
print_failures
usage_error
+ uniq
$tempdir
$conf_dir
$conf_file
@@ -988,7 +989,7 @@ sub get_requires {
return $$info[0] ne '' ? $info : undef;
}
-sub _uniq {
+sub uniq {
my %seen;
return grep { !$seen{$_}++ } @_;
}
@@ -1010,7 +1011,7 @@ sub _build_queue {
push @result, $sbo;
}
- return _uniq @result;
+ return uniq @result;
}
sub get_build_queue {
@@ -1023,7 +1024,7 @@ sub merge_queues {
# Results in queue_b being merged into queue_a (without duplicates)
exists $_[1] or script_error('merge_queues requires two arguments.');
- return [ _uniq @{$_[0]}, @{$_[1]} ];
+ return [ uniq @{$_[0]}, @{$_[1]} ];
}
sub get_readme_contents {
diff --git a/man1/sboupgrade.1 b/man1/sboupgrade.1
index e16b5d1..eedf711 100644
--- a/man1/sboupgrade.1
+++ b/man1/sboupgrade.1
@@ -4,10 +4,10 @@
sboupgrade - install or upgrade slackbuilds
.SH SYNAPSES
.P
-sboupgrade [-h|-v] [-c TRUE|FALSE] [-d TRUE|FALSE] [-j #|FALSE] [-fNrRiz] sbo_name (sbo_name)
+sboupgrade [-h|-v] [-c TRUE|FALSE] [-d TRUE|FALSE] [-j #|FALSE] [-fNrRiz] --all|sbo_name (sbo_name)
.SH DESCRIPTION
.P
-sboupgrade is used to upgrade packages installed from slackbuilds. If the -r flag is NOT specified, sboupgrade will pull the list of requirements from the .info file for any specified slackbuild. If such a list exists, sboupgrade will look to see whether or not those requirements are already installed, and if not, it will ask whether or not it should attempt to install them first. This is recursive, so that ordering happens correctly. sboupgrade will refuse to handle circular requirements. sboupgrade will also note groupadd and useradd commands in README files and offer to run those first. If the README documents options of the KEY=value form, sboupgrade will offer the opportunity to set options.
+sboupgrade is used to upgrade packages installed from slackbuilds. If the -r flag is NOT specified, sboupgrade will pull the list of requirements from the .info file for any specified slackbuild. If such a list exists, sboupgrade will look to see whether or not those requirements are already installed, and if not, it will ask whether or not it should attempt to install them first. This is recursive, so that ordering happens correctly. sboupgrade will refuse to handle circular requirements. sboupgrade will also note groupadd and useradd commands in README files and offer to run those first. If the README documents options of the KEY=value form, sboupgrade will offer the opportunity to set options. If --all is supplied it will try to upgrade everything that sbocheck(1) reports.
.SH OPTIONS
.P
-h|--help
@@ -54,6 +54,11 @@ Skip viewing of the README and the yes or no question which accompanies it. Anyt
.RS
When used in combination with the -f option, to force an update even if it would not constitute an update, this will cause sboupgrade to also rebuild all of that slackbuild's requirements. Normally with -f, only the slackbuild(s) specified, and any requirements not already installed, will be rebuilt. This allows for recursive upgrades, among other things.
.RE
+.P
+--all
+.RS
+You can specify --all instead of an sbo_name to upgrade all the packages sbocheck(1) reports.
+.RE
.SH EXIT CODES
.P
sboupgrade can exit with the following exit codes:
diff --git a/sboupgrade b/sboupgrade
index 269e3e0..28bc66d 100755
--- a/sboupgrade
+++ b/sboupgrade
@@ -42,6 +42,8 @@ Options (defaults shown first where applicable):
non-interactive; skips README and all prompts.
-z|--force-reqs:
when used with -f, will force rebuilding an SBo's requirements as well.
+ --all
+ this flag will upgrade everything reported by sbocheck(1).
EOF
}
@@ -49,27 +51,35 @@ EOF
my $noclean = $config{NOCLEAN};
my $distclean = $config{DISTCLEAN};
my $jobs = $config{JOBS};
-my ($help, $vers, $force, $no_install, $non_int, $force_reqs);
+my ($help, $vers, $force, $no_install, $non_int, $force_reqs, $all);
# backwards compatibility options
my ($install_new, $no_reqs, $compat32);
GetOptions(
- 'help|h' => \$help,
- 'version|v' => \$vers,
- 'noclean|c=s' => \$noclean,
- 'distclean|d=s' => \$distclean,
- 'force|f' => \$force,
- 'noinstall|i' => \$no_install,
- 'jobs|j=s' => \$jobs,
- 'installnew|N' => \$install_new,
- 'nointeractive|r' => \$non_int,
- 'norequirements|R' => \$no_reqs,
- 'force-reqs|z' => \$force_reqs,
- 'compat32|p' => \$compat32,
+ 'help|h' => \$help,
+ 'version|v' => \$vers,
+ 'noclean|c=s' => \$noclean,
+ 'distclean|d=s' => \$distclean,
+ 'force|f' => \$force,
+ 'noinstall|i' => \$no_install,
+ 'jobs|j=s' => \$jobs,
+ 'installnew|N' => \$install_new,
+ 'nointeractive|r' => \$non_int,
+ 'norequirements|R' => \$no_reqs,
+ 'force-reqs|z' => \$force_reqs,
+ 'compat32|p' => \$compat32,
+ 'all' => \$all,
);
show_usage() and exit 0 if $help;
show_version() and exit 0 if $vers;
+
+if ($all) {
+ print "Checking for updated SlackBuilds...\n";
+ my $updates = get_available_updates();
+ push @ARGV, map { $_->{name} } @$updates;
+}
+
show_usage() and exit 1 unless exists $ARGV[0];
$noclean = $noclean eq 'TRUE' ? 1 : 0;
@@ -90,7 +100,7 @@ usage_error("-p|--compat32 does not make sense without -N|--installnew")
# if we can't find SLACKBUILDS.TXT in $config{HOME}, prompt to fetch the tree
slackbuilds_or_fetch();
-my @sbos = @ARGV;
+my @sbos = uniq @ARGV;
# pull locations for everything specified on command line.
my %locations;