summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2004-09-30 09:31:50 +0000
committerDaouda Lo <daouda@mandriva.com>2004-09-30 09:31:50 +0000
commit886a67fbfc2f3a8bb0a480cad917c0c8bf5593ee (patch)
tree6001cd73218dc2d95356a4157aaf7172ad4f8fea
parent3d9b4f613054c162f114086c3d9e062e3bbe9e12 (diff)
downloadmgaonline-886a67fbfc2f3a8bb0a480cad917c0c8bf5593ee.tar
mgaonline-886a67fbfc2f3a8bb0a480cad917c0c8bf5593ee.tar.gz
mgaonline-886a67fbfc2f3a8bb0a480cad917c0c8bf5593ee.tar.bz2
mgaonline-886a67fbfc2f3a8bb0a480cad917c0c8bf5593ee.tar.xz
mgaonline-886a67fbfc2f3a8bb0a480cad917c0c8bf5593ee.zip
- fix functions name changes
-rw-r--r--mdkonline.pm42
1 files changed, 19 insertions, 23 deletions
diff --git a/mdkonline.pm b/mdkonline.pm
index ee17c12b..fbd17fb4 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -37,14 +37,14 @@ sub get_site {
system("$b " . $link . "&")
}
-sub browser {
+sub browser() {
require any;
my $wm = any::running_window_manager();
- member ($wm, 'kwin', 'gnome-session') or $wm = 'other';
+ member($wm, 'kwin', 'gnome-session') or $wm = 'other';
my %Br = (
'kwin' => 'webclient-kde',
'gnome-session' => 'webclient-gnome',
- 'other' => $ENV{BROWSER} || find { -x "/usr/bin/$_"} qw(epiphany mozilla konqueror galeon)
+ 'other' => $ENV{BROWSER} || find { -x "/usr/bin/$_" } qw(epiphany mozilla konqueror galeon)
);
$Br{$wm}
}
@@ -77,17 +77,15 @@ sub check_valid_email {
sub rpm_ver_parse {
my ($ver) = @_;
- my @verparts = ();
- while ( $ver ne "" ) {
- if ( $ver =~ /^([A-Za-z]+)/ ) { # leading letters
- push ( @verparts, $1 );
+ my @verparts;
+ while ($ver ne "") {
+ if ($ver =~ /^([A-Za-z]+)/) { # leading letters
+ push(@verparts, $1);
$ver =~ s/^[A-Za-z]+//;
- }
- elsif ( $ver =~ /^(\d+)/ ) { # leading digits
- push ( @verparts, $1 );
+ } elsif ($ver =~ /^(\d+)/) { # leading digits
+ push(@verparts, $1);
$ver =~ s/^\d+//;
- }
- else { # remove non-letter, non-digit
+ } else { # remove non-letter, non-digit
$ver =~ s/^.//;
}
}
@@ -101,25 +99,23 @@ sub rpm_ver_cmp {
my @bparts;
# individual token from array
my ($apart, $bpart, $result);
- if ( $a eq $b ) {
+ if ($a eq $b) {
return 0;
}
- @aparts = rpmverparse($a);
- @bparts = rpmverparse($b);
- while ( @aparts && @bparts ) {
+ @aparts = rpm_ver_parse($a);
+ @bparts = rpm_ver_parse($b);
+ while (@aparts && @bparts) {
$apart = shift (@aparts);
$bpart = shift (@bparts);
- if ( $apart =~ /^\d+$/ && $bpart =~ /^\d+$/ ) { # numeric
- if ( $result = ( $apart <=> $bpart ) ) {
+ if ($apart =~ /^\d+$/ && $bpart =~ /^\d+$/) { # numeric
+ if ($result = $apart <=> $bpart) {
return $result;
}
- }
- elsif ( $apart =~ /^[A-Za-z]+/ && $bpart =~ /^[A-Za-z]+/ ) { # alpha
- if ( $result = ( $apart cmp $bpart ) ) {
+ } elsif ($apart =~ /^[A-Za-z]+/ && $bpart =~ /^[A-Za-z]+/) { # alpha
+ if ($result = $apart cmp $bpart) {
return $result;
}
- }
- else { # "arbitrary" in original code
+ } else { # "arbitrary" in original code
my $rema = shift(@aparts);
my $remb = shift(@bparts);
if ($rema && !$remb) { return 1 } elsif (!$rema && $remb) { return -1 }