diff options
| author | Jacob Pipkin <j@dawnrazor.net> | 2012-10-04 21:19:32 -0500 | 
|---|---|---|
| committer | Jacob Pipkin <j@dawnrazor.net> | 2012-10-04 21:19:32 -0500 | 
| commit | cc976e1f56f1feada2e69a3127fca2c195af1c46 (patch) | |
| tree | 1b66a1c1e5f7fb045f3f834698147e772900d57a | |
| parent | 55c308767feb1ec95d7588bc5bbe7c3c0803ffbb (diff) | |
| download | sbotools2-cc976e1f56f1feada2e69a3127fca2c195af1c46.tar.xz | |
consistency and cleanup fixes
| -rwxr-xr-x | sbocheck | 5 | ||||
| -rwxr-xr-x | sboclean | 10 | ||||
| -rwxr-xr-x | sboconfig | 5 | ||||
| -rwxr-xr-x | sbofind | 18 | ||||
| -rwxr-xr-x | sboinstall | 1 | ||||
| -rwxr-xr-x | sbosnap | 4 | ||||
| -rwxr-xr-x | sboupgrade | 22 | 
7 files changed, 25 insertions, 40 deletions
@@ -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.12.3; @@ -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; @@ -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.12.3; @@ -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'; @@ -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.12.3; @@ -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)$/; @@ -125,7 +124,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; @@ -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.12.3; @@ -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"; +			say "README: ". get_file_contents "$val/README"; +			say '';  		}  	} -	print $_ for @listing;  } else {  	say "Nothing found for search term: $search";  } @@ -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.12.3; @@ -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.12.3; @@ -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.12.3; @@ -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; @@ -225,9 +221,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"; @@ -248,7 +244,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: "; @@ -257,11 +253,11 @@ sub ask_opts ($) {  			return $opts;  		};  		my $kv_regex = qr/[A-Z0-9]+=[^\s]+(|\s([A-Z]+=[^\s]+){0,})/; -		my $opts = &$ask;  +		my $opts = &$ask;  		return unless $opts;  		FIRST: while ($opts !~ $kv_regex) {  			warn "Invalid input received.\n"; -			$opts = &$ask;  +			$opts = &$ask;  		}  		return $opts;  	} @@ -347,7 +343,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";  		} @@ -412,7 +408,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  | 
