From 373ec26a8141e284388d761b218e4b64f4ce1305 Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Wed, 9 May 2012 12:27:51 -0500 Subject: cleanups following previous changes --- SBO-Lib/lib/SBO/Lib.pm | 5 ++--- sbofind | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 5656d37..31358f0 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -22,7 +22,6 @@ require Exporter; update_tree get_installed_sbos get_available_updates - check_sbo_name_validity do_slackbuild make_clean make_distclean @@ -184,12 +183,12 @@ sub clean_line { } sub get_available_updates { - check_slackbuilds_txt (); - my (@updates,$index); + my @updates; my @pkg_list = get_installed_sbos (); FIRST: for my $c (keys @pkg_list) { my $location = get_sbo_location ($pkg_list[$c]{name}); next FIRST unless defined $location; + my $regex = qr/^VERSION=/; open my $info,'<',"$location/$pkg_list[$c]{name}.info"; SECOND: while (my $line = <$info>) { diff --git a/sbofind b/sbofind index 458689c..9b885b0 100755 --- a/sbofind +++ b/sbofind @@ -15,7 +15,7 @@ use strict; use warnings FATAL => 'all'; my %config = %SBO::Lib::config; -my $self = basename($0); +my $self = basename ($0); sub show_usage { print <) { unless ($found eq 'TRUE') { if ($line =~ $regex) { $found = 'TRUE'; - my @split = split(' ',$line); - chomp($name = $split[2]); + my @split = split (' ',$line); + chomp ($name = $split[2]); next FIRST; } } else { if ($line =~ /LOCATION/) { $found = 'FALSE'; - my @split = split(' ',$line); - chomp(my $location = $split[2]); + my @split = split (' ',$line); + chomp (my $location = $split[2]); $location =~ s#^\.##; my %hash = ($name => $config{SBO_HOME} . $location); - push(@findings,\%hash); + push (@findings,\%hash); } } } @@ -70,16 +70,16 @@ if (exists $findings[0]) { my @listing; for my $hash (@findings) { while (my ($key,$value) = each %{$hash}) { - push(@listing,"SBo: $key\n"); - push(@listing,"Path: $value\n\n"); + push (@listing,"SBo: $key\n"); + push (@listing,"Path: $value\n\n"); } } my $tab = new Text::Tabulate(); - $tab->configure(tab => '\s'); - my $output = $tab->format(@listing); + $tab->configure (tab => '\s'); + my $output = $tab->format (@listing); print "\n". $output; } else { print "Nothing found for search term: $search\n"; } -exit(0); +exit 0; -- cgit v1.2.3