aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsbocheck5
-rwxr-xr-xsboclean10
-rwxr-xr-xsboconfig8
-rwxr-xr-xsbofind18
-rwxr-xr-xsboinstall1
-rwxr-xr-xsbosnap4
-rwxr-xr-xsboupgrade18
7 files changed, 26 insertions, 38 deletions
diff --git a/sbocheck b/sbocheck
index ccbbe24..091164a 100755
--- a/sbocheck
+++ b/sbocheck
@@ -6,7 +6,6 @@
# script to update the local sbo tree and check for updates
#
# author: Jacob Pipkin <j@dawnrazor.net>
-# date: Sweetmorn, the 38th day of Discord in the YOLD 3178
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
use 5.16.0;
@@ -36,8 +35,8 @@ my ($help, $vers);
GetOptions ('help|h' => \$help, 'version|v' => \$vers);
-show_usage && exit 0 if $help;
-show_version && exit 0 if $vers;
+show_usage and exit 0 if $help;
+show_version and exit 0 if $vers;
update_tree;
diff --git a/sboclean b/sboclean
index 3244412..e9aedd8 100755
--- a/sboclean
+++ b/sboclean
@@ -6,7 +6,6 @@
# script to clean stuff left around from sbotools.
#
# author: Jacob Pipkin <j@dawnrazor.net>
-# date: Boomtime, the 6th day of Confusion in the YOLD 3178
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
use 5.16.0;
@@ -48,12 +47,11 @@ GetOptions (
'interactive|i' => \$interactive,
);
-show_usage && exit 0 if $help;
-show_version && exit 0 if $vers;
+show_usage and exit 0 if $help;
+show_version and exit 0 if $vers;
-unless ($clean_dist || $clean_work) {
- show_usage, die "You must specify at least one of -d or -w.\n";
-}
+show_usage, die "You must specify at least one of -d or -w.\n" unless
+ ($clean_dist || $clean_work);
sub remove_stuff ($) {
exists $_[0] or script_error 'remove_stuff requires an argument';
diff --git a/sboconfig b/sboconfig
index f07b589..892279c 100755
--- a/sboconfig
+++ b/sboconfig
@@ -6,7 +6,6 @@
# script to handle sbotools configuration
#
# author: Jacob Pipkin <j@dawnrazor.net>
-# date: Pungenday, the 40th day of Discord in the YOLD 3178
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
use 5.16.0;
@@ -83,7 +82,7 @@ while (my ($key, $value) = each %valid_confs) {
$changes{$value} = $options{$key} if exists $options{$key};
}
-my $die = "You have provided an invalid parameter for";
+my $die = 'You have provided an invalid parameter for';
if (exists $changes{NOCLEAN}) {
die "$die -c\n" unless $changes{NOCLEAN} =~ /^(TRUE|FALSE)$/;
@@ -103,6 +102,9 @@ if (exists $changes{SBO_HOME}) {
# safely modify our conf file; write its contents to a temp file, modify the
# temp file, write the contents of the temp file back to the conf file
+# TODO: if multiple options are provided to this script, this sub should write
+# them all at once, instead of only a single one and having to call it once for
+# each option specified to the script.
sub config_write ($$) {
exists $_[1] or script_error 'config_write requires two arguments.';
my ($key, $val) = @_;
@@ -125,7 +127,7 @@ sub config_write ($$) {
untie @temp;
# otherwise, append our new $key=$value pair
print {$tempfh} "$key=$val\n" unless $has;
- # then over write the conf file with the contents of the temp file
+ # then overwrite the conf file with the contents of the temp file
seek $tempfh, 0, 0;
my $contents = do {local $/; <$tempfh>};
close $conffh;
diff --git a/sbofind b/sbofind
index a2f731d..61fbd48 100755
--- a/sbofind
+++ b/sbofind
@@ -6,7 +6,6 @@
# script to locate something in a local SlackBuilds tree.
#
# author: Jacob Pipkin <j@dawnrazor.net>
-# date: Boomtime, the 39th day of Discord in the YOLD 3178
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
use 5.16.0;
@@ -86,7 +85,7 @@ sub get_file_contents ($) {
my $contents = do {local $/; <$fh>};
for ($contents) {
s/\n/\n /g;
- s/ $//g;
+ s/\n $//g;
}
return $contents;
}
@@ -97,17 +96,14 @@ my $findings = perform_search $search;
if (exists $$findings[0]) {
my @listing = ("\n");
for my $hash (@$findings) {
- while (my ($key, $value) = each %$hash) {
- push @listing, "SBo: $key\n";
- push @listing, "Path: $value\n";
- push @listing, "info: ". get_file_contents "$value/$key.info"
- if $show_info;
- push @listing, "README: ". get_file_contents "$value/README"
- if $show_readme;
- push @listing, "\n";
+ while (my ($key, $val) = each %$hash) {
+ say "SBo: $key";
+ say "Path: $val";
+ say "info: ". get_file_contents "$val/$key.info" if $show_info;
+ say "README: ". get_file_contents "$val/README" if $show_readme;
+ say '';
}
}
- print $_ for @listing;
} else {
say "Nothing found for search term: $search";
}
diff --git a/sboinstall b/sboinstall
index 3e251ca..624d188 100755
--- a/sboinstall
+++ b/sboinstall
@@ -6,7 +6,6 @@
# script to install a SlackBuild by name
#
# author: Jacob Pipkin <j@dawnrazor.net>
-# date: Pungenday, the 40th day of Discord in the YOLD 3178
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
use 5.16.0;
diff --git a/sbosnap b/sbosnap
index 2562356..6e61e14 100755
--- a/sbosnap
+++ b/sbosnap
@@ -3,11 +3,9 @@
# vim: set ts=4:noet
#
# sbosnap
-# script to pull down / update a local copy of the
-# slackbuilds.org tree.
+# script to pull down / update a local copy of the slackbuilds.org tree.
#
# author: Jacob Pipkin <j@dawnrazor.net>
-# date: Setting Orange, the 37th day of Discord in the YOLD 3178
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
use 5.16.0;
diff --git a/sboupgrade b/sboupgrade
index 64650d7..04d9732 100755
--- a/sboupgrade
+++ b/sboupgrade
@@ -6,7 +6,6 @@
# script to update an installed SlackBuild.
#
# author: Jacob Pipkin <j@dawnrazor.net>
-# date: Boomtime, the 39th day of Discord in the YOLD 3178
# license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
use 5.16.0;
@@ -47,9 +46,6 @@ Options (defaults shown first where applicable):
-z|--force-reqs:
when used with -f, will force rebuilding an SBo's requirements as well.
-Example:
- $self -d libsexy
-
EOF
}
@@ -75,8 +71,8 @@ GetOptions (
'compat32|p' => \$compat32,
);
-show_usage && exit 0 if $help;
-show_version && exit 0 if $vers;
+show_usage and exit 0 if $help;
+show_version and exit 0 if $vers;
$noclean = $noclean eq 'TRUE' ? 1 : 0;
$distclean = $distclean eq 'TRUE' ? 1 : 0;
@@ -205,9 +201,9 @@ sub ask_user_group ($$) {
my ($cmds, $readme) = @_;
say "\n". $readme;
print "\nIt looks like this slackbuild requires the following";
- say " command(s) to be run first:";
+ say ' command(s) to be run first:';
say " # $_" for @$cmds;
- print "Shall I run it/them now? [y] ";
+ print 'Shall I run it/them now? [y] ';
if (<STDIN> =~ /^[Yy\n]/) {
for my $cmd (@$cmds) {
system ($cmd) == 0 or warn "\"$cmd\" exited non-zero\n";
@@ -228,7 +224,7 @@ sub ask_opts ($) {
my $readme = shift;
say "\n". $readme;
print "\nIt looks this slackbuilds has options; would you like to set any";
- print " when the slackbuild is run? [n] ";
+ print ' when the slackbuild is run? [n] ';
if (<STDIN> =~ /^[Yy]/) {
my $ask = sub () {
print "\nPlease supply any options here, or enter to skip: ";
@@ -327,7 +323,7 @@ sub process_sbos ($) {
sub print_failures (;%) {
if (exists $_[0]) {
my %failures = @_;
- say "Failures:";
+ say 'Failures:';
while (my ($key, $val) = each %failures) {
say " $key: $val";
}
@@ -392,7 +388,7 @@ FIRST: for my $sbo (@ARGV) {
my $inst_names = get_inst_names $inst;
unless ($sbo ~~ @$inst_names) {
print "\nYou are attempting to install $name, however, $sbo is not";
- print " yet installed. Shall I install it first? [y] ";
+ print ' yet installed. Shall I install it first? [y] ';
if (<STDIN> =~ /^[Yy\n]/) {
my @args = ('/usr/sbin/sboupgrade', '-oN');
# populate args so that they carry over correctly