aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Pipkin <j@dawnrazor.net>2012-06-11 21:10:21 -0500
committerJacob Pipkin <j@dawnrazor.net>2012-06-11 21:10:21 -0500
commit3fe7112f8c96478a55eeebe0d63665c1435c5dda (patch)
treeb95d8dd689c7320331367f04e1bdd8855a91057d
parentd3db332c7d9bab3be5cbb04e1d9283627048ee05 (diff)
downloadsbotools2-3fe7112f8c96478a55eeebe0d63665c1435c5dda.tar.xz
code reductions
-rwxr-xr-xsbocheck2
-rwxr-xr-xsbofind21
2 files changed, 10 insertions, 13 deletions
diff --git a/sbocheck b/sbocheck
index 55209db..ae3bc42 100755
--- a/sbocheck
+++ b/sbocheck
@@ -32,7 +32,7 @@ my @listing;
for my $key (keys @updates) {
my $string = "$updates[$key]{name}-$updates[$key]{installed}";
$string .= " < needs updating (SBo has $updates[$key]{update})\n";
- push (@listing, $string);
+ push @listing, $string;
}
if (exists $listing[0]) {
diff --git a/sbofind b/sbofind
index f431e6c..089c4cd 100755
--- a/sbofind
+++ b/sbofind
@@ -54,16 +54,13 @@ my $name_regex = qr/NAME:\s+(.*\Q$search\E.*)$/i;
my $loc_regex = qr/LOCATION:\s+(.*)$/;
my $fh = open_read ("$config{SBO_HOME}/SLACKBUILDS.TXT");
FIRST: while (my $line = <$fh>) {
- unless ($found eq 'TRUE') {
- if ($name = ($line =~ $name_regex)[0]) {
- $found = 'TRUE';
- next FIRST;
- }
+ if ($found eq 'FALSE') {
+ $found eq 'TRUE', next FIRST if $name = ($line =~ $name_regex)[0];
} else {
if (my ($location) = ($line =~ $loc_regex)[0]) {
$found = 'FALSE';
$location =~ s#^\.##;
- push (@findings, {$name => $config{SBO_HOME} . $location} );
+ push @findings, {$name => $config{SBO_HOME} . $location};
}
}
}
@@ -83,13 +80,13 @@ 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 eq 'TRUE';
- push (@listing, "README: ". get_file_contents ("$value/README") )
+ push @listing, "SBo: $key\n";
+ push @listing, "Path: $value\n";
+ push @listing, "info: ". get_file_contents ("$value/$key.info")
+ if $show_info eq 'TRUE';
+ push @listing, "README: ". get_file_contents ("$value/README")
if $show_readme eq 'TRUE';
- push (@listing, "\n");
+ push @listing, "\n";
}
}
print $_ for @listing;