Browse Source

This gets rid of those error due to >=5 perl complaints about the unecessary use

of defined.
master
freesource 23 years ago
parent
commit
37d03ecaa5
  1. 14
      SWIM/Indexer.pm
  2. 64
      SWIM/Search.pm

14
SWIM/Indexer.pm

@ -113,7 +113,7 @@ sub noT_indexer {
menu(\%commands) if $commands->{"menu"} || $commands->{"m"}; menu(\%commands) if $commands->{"menu"} || $commands->{"m"};
copyright(\%commands) if $commands->{"copyright"}; copyright(\%commands) if $commands->{"copyright"};
changelog(\%commands) if $commands->{"changelog"}; changelog(\%commands) if $commands->{"changelog"};
if (defined $argument) { if ($argument) {
# should be o.k., almost everything has documentation # should be o.k., almost everything has documentation
print "$argument\n"; print "$argument\n";
} }
@ -240,9 +240,9 @@ sub c_indexer {
# everything. watch this..these are packages which don't have # everything. watch this..these are packages which don't have
# conf files # conf files
if ($commands->{"d"} || $commands->{"l"}) { if ($commands->{"d"} || $commands->{"l"}) {
if (defined $arg_save) { if ($arg_save) {
if ($argument ne $arg_save) { if ($argument ne $arg_save) {
#if (!defined $arg_save) { #if (!$arg_save) {
if (conf(\%commands) ne 0) { if (conf(\%commands) ne 0) {
shlibs(\%commands) if $commands->{"shlibs"}; shlibs(\%commands) if $commands->{"shlibs"};
file(\%commands); file(\%commands);
@ -339,14 +339,14 @@ sub indexer {
} }
} }
if (defined $argument) { if ($argument) {
dir(\%commands); dir(\%commands);
fir(\%commands); fir(\%commands);
if ($ib{"$argument"}){ if ($ib{"$argument"}){
my $package = $ib{"$argument"}; my $package = $ib{"$argument"};
$package =~ s/\s/\n/g; $package =~ s/\s/\n/g;
@alot = split(/\s/, $package); @alot = split(/\s/, $package);
if (defined @alot) { if (@alot) {
@PACKAGES = @alot; @PACKAGES = @alot;
} }
if ($commands->{"z"} || $commands->{"ftp"}|| if ($commands->{"z"} || $commands->{"ftp"}||
@ -465,7 +465,7 @@ sub indexer {
} }
else { else {
$argument =~ m,.*\/(.*$),; $argument =~ m,.*\/(.*$),;
if (defined $1) { if ($1) {
my $file = $1; my $file = $1;
if (!$commands->{"n"} && -e "/usr/sbin/update-alternatives") { if (!$commands->{"n"} && -e "/usr/sbin/update-alternatives") {
my $it = "update-alternatives --display $1|"; my $it = "update-alternatives --display $1|";
@ -488,7 +488,7 @@ sub indexer {
} }
untie %ib; untie %ib;
if (defined @alot) { if (@alot) {
@PACKAGES = @alot; @PACKAGES = @alot;
} }
if (!($commands->{"z"} || $commands->{"ftp"} || if (!($commands->{"z"} || $commands->{"ftp"} ||

64
SWIM/Search.pm

@ -87,7 +87,7 @@ sub search {
##### #####
else { else {
my $return = nib(\%commands); my $return = nib(\%commands);
if (!defined $return) { if (!$return) {
untie %ib; untie %ib;
nsb(\%commands); nsb(\%commands);
$ib{"/."} = $nsb{"/."}; $ib{"/."} = $nsb{"/."};
@ -147,7 +147,7 @@ sub search {
# not yet for -g # not yet for -g
if ($commands->{"search"} && !$commands->{"g"}) { if ($commands->{"search"} && !$commands->{"g"}) {
if (defined $argument) { if ($argument) {
if ($ib{"$argument"}){ if ($ib{"$argument"}){
foreach (split(/\s/, $ib{"$argument"})) { foreach (split(/\s/, $ib{"$argument"})) {
if ($keyword =~ /\/i$/) { if ($keyword =~ /\/i$/) {
@ -156,7 +156,7 @@ sub search {
if ($db{$_} =~ /$1/i) { if ($db{$_} =~ /$1/i) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -172,7 +172,7 @@ sub search {
if ($db{$_} =~ /$1/m ) { if ($db{$_} =~ /$1/m ) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -188,7 +188,7 @@ sub search {
if ($db{$_} =~ /$1/im ) { if ($db{$_} =~ /$1/im ) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -203,7 +203,7 @@ sub search {
if ($db{$_} =~ /$keyword/) { if ($db{$_} =~ /$keyword/) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -215,9 +215,9 @@ sub search {
} }
} }
print "swim: found $count package(s)\n"; print "swim: found $count package(s)\n";
#exit;
} }
if (!defined $line) { if (!$line) {
$line = ""; $line = "";
} }
else { else {
@ -229,7 +229,7 @@ sub search {
# ok -g # ok -g
elsif ($commands->{"search"} && $commands->{"g"}) { elsif ($commands->{"search"} && $commands->{"g"}) {
if (defined @stuff) { if (@stuff) {
#unlink("$search_mem"); #unlink("$search_mem");
foreach (@stuff) { foreach (@stuff) {
$argument = $_; $argument = $_;
@ -258,7 +258,7 @@ sub search {
if ($db{$argument} =~ /$1/m ) { if ($db{$argument} =~ /$1/m ) {
print "$db{$argument}\n" if !$commands->{"no"}; print "$db{$argument}\n" if !$commands->{"no"};
push(@PACKAGES,$argument); push(@PACKAGES,$argument);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -274,7 +274,7 @@ sub search {
if ($db{$argument} =~ /$1/im ) { if ($db{$argument} =~ /$1/im ) {
print "$db{$argument}\n" if !$commands->{"no"}; print "$db{$argument}\n" if !$commands->{"no"};
push(@PACKAGES,$argument); push(@PACKAGES,$argument);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -289,7 +289,7 @@ sub search {
if ($db{$argument} =~ /$keyword/) { if ($db{$argument} =~ /$keyword/) {
print "$db{$argument}\n" if !$commands->{"no"}; print "$db{$argument}\n" if !$commands->{"no"};
push(@PACKAGES,$argument); push(@PACKAGES,$argument);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -301,7 +301,7 @@ sub search {
} }
} }
print "swim: found $count package(s)\n"; print "swim: found $count package(s)\n";
if (!defined $line) { if (!$line) {
$line = ""; $line = "";
} }
else { else {
@ -332,7 +332,7 @@ sub search {
if ($db{$db{$_}} =~ /$1/i) { if ($db{$db{$_}} =~ /$1/i) {
print "$db{$db{$_}}\n" if !$commands->{"no"}; print "$db{$db{$_}}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -348,7 +348,7 @@ sub search {
if ($db{$db{$_}} =~ /$1/m ) { if ($db{$db{$_}} =~ /$1/m ) {
print "$db{$db{$_}}\n" if !$commands->{"no"}; print "$db{$db{$_}}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -364,7 +364,7 @@ sub search {
if ($db{$db{$_}} =~ /$1/im ) { if ($db{$db{$_}} =~ /$1/im ) {
print "$db{$db{$_}}\n" if !$commands->{"no"}; print "$db{$db{$_}}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -379,7 +379,7 @@ sub search {
if ($db{$db{$_}} =~ /$keyword/) { if ($db{$db{$_}} =~ /$keyword/) {
print "$db{$db{$_}}\n" if !$commands->{"no"}; print "$db{$db{$_}}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -391,7 +391,7 @@ sub search {
} }
} }
print "swim: found $count package(s)\n"; print "swim: found $count package(s)\n";
if (!defined $line) { if (!$line) {
$line = ""; $line = "";
} }
else { else {
@ -430,7 +430,7 @@ sub search {
if ($morethanone{$ib{$_}} == 1) { if ($morethanone{$ib{$_}} == 1) {
print "$db{$ib{$_}}\n" if !$commands->{"no"}; print "$db{$ib{$_}}\n" if !$commands->{"no"};
push(@PACKAGES,$ib{$_}); push(@PACKAGES,$ib{$_});
if (!defined $line) { if (!$line) {
$line = (split(/_/,$ib{$_}))[0]; $line = (split(/_/,$ib{$_}))[0];
} }
else { else {
@ -449,7 +449,7 @@ sub search {
if ($morethanone{$ib{$_}} == 1) { if ($morethanone{$ib{$_}} == 1) {
print "$db{$ib{$_}}\n" if !$commands->{"no"}; print "$db{$ib{$_}}\n" if !$commands->{"no"};
push(@PACKAGES,$ib{$_}); push(@PACKAGES,$ib{$_});
if (!defined $line) { if (!$line) {
$line = (split(/_/,$ib{$_}))[0]; $line = (split(/_/,$ib{$_}))[0];
} }
else { else {
@ -468,7 +468,7 @@ sub search {
if ($morethanone{$ib{$_}} == 1) { if ($morethanone{$ib{$_}} == 1) {
print "$db{$ib{$_}}\n" if !$commands->{"no"}; print "$db{$ib{$_}}\n" if !$commands->{"no"};
push(@PACKAGES,$ib{$_}); push(@PACKAGES,$ib{$_});
if (!defined $line) { if (!$line) {
$line = (split(/_/,$ib{$_}))[0]; $line = (split(/_/,$ib{$_}))[0];
} }
else { else {
@ -489,7 +489,7 @@ sub search {
#print "HUMM DIR $_ ", $ib{$_}, "\n"; #print "HUMM DIR $_ ", $ib{$_}, "\n";
print "$db{$ib{$_}}\n" if !$commands->{"no"}; print "$db{$ib{$_}}\n" if !$commands->{"no"};
push(@PACKAGES,$ib{$_}); push(@PACKAGES,$ib{$_});
if (!defined $line) { if (!$line) {
$line = (split(/_/,$ib{$_}))[0]; $line = (split(/_/,$ib{$_}))[0];
} }
else { else {
@ -526,7 +526,7 @@ sub search {
if ($morethanone{$_} == 1) { if ($morethanone{$_} == 1) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -553,7 +553,7 @@ sub search {
if ($morethanone{$_} == 1) { if ($morethanone{$_} == 1) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -580,7 +580,7 @@ sub search {
if ($morethanone{$_} == 1) { if ($morethanone{$_} == 1) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -608,7 +608,7 @@ sub search {
if ($morethanone{$_} == 1) { if ($morethanone{$_} == 1) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -630,7 +630,7 @@ sub search {
# NORMAL SEARCH # # NORMAL SEARCH #
################# #################
# now we can do a normal search for the powersearch # now we can do a normal search for the powersearch
if (defined $argument) { if ($argument) {
if ($ib{"$argument"}){ if ($ib{"$argument"}){
foreach (split(/\s/, $ib{$argument})) { foreach (split(/\s/, $ib{$argument})) {
if ($keyword =~ /\/i$/) { if ($keyword =~ /\/i$/) {
@ -641,7 +641,7 @@ sub search {
if ($db{$_} =~ /$1/i) { if ($db{$_} =~ /$1/i) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -660,7 +660,7 @@ sub search {
if ($db{$_} =~ /$1/m ) { if ($db{$_} =~ /$1/m ) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -679,7 +679,7 @@ sub search {
if ($db{$_} =~ /$1/im ) { if ($db{$_} =~ /$1/im ) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -697,7 +697,7 @@ sub search {
if ($db{$_} =~ /$keyword/) { if ($db{$_} =~ /$keyword/) {
print "$db{$_}\n" if !$commands->{"no"}; print "$db{$_}\n" if !$commands->{"no"};
push(@PACKAGES,$_); push(@PACKAGES,$_);
if (!defined $line) { if (!$line) {
$line = (split(/_/,$_))[0]; $line = (split(/_/,$_))[0];
} }
else { else {
@ -710,7 +710,7 @@ sub search {
} }
} }
print "swim: found $count package(s)\n"; print "swim: found $count package(s)\n";
if (!defined $line) { if (!$line) {
$line = ""; $line = "";
} }
else { else {

Loading…
Cancel
Save