diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-12-01 08:53:47 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-12-01 08:53:47 +0000 |
commit | 27968886bf2586682cb1a6f45eb8b485dc6a4257 (patch) | |
tree | 8ee761eb8c2fe9067af23fa2d38348284d84ea9f /perl-install/common.pm | |
parent | 11c086f6eb07e76fec02c5627072d52b4d6cd7d8 (diff) | |
download | drakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.tar drakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.tar.gz drakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.tar.bz2 drakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.tar.xz drakx-27968886bf2586682cb1a6f45eb8b485dc6a4257.zip |
no_comment
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index 927b863f7..11f5f9b97 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -54,8 +54,8 @@ sub uniq { my %l; @l{@_} = (); keys %l } sub to_int { $_[0] =~ /(\d*)/; $1 } sub to_float { $_[0] =~ /(\d*(\.\d*)?)/; $1 } sub ikeys { my %l = @_; sort { $a <=> $b } keys %l } -sub add2hash { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { $a->{$k} ||= $v } } -sub add2hash_ { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { exists $a->{$k} or $a->{$k} = $v } } +sub add2hash($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { $a->{$k} ||= $v } } +sub add2hash_($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { exists $a->{$k} or $a->{$k} = $v } } sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 } sub dirname { @_ == 1 or die "usage: dirname <name>\n"; local $_ = shift; s|[^/]*/*\s*$||; s|(.)/*$|$1|; $_ || '.' } sub basename { @_ == 1 or die "usage: basename <name>\n"; local $_ = shift; s|/*\s*$||; s|.*/||; $_ } @@ -446,7 +446,7 @@ sub removeXiBSuffix($) { sub formatTime($) { my ($s, $m, $h) = gmtime($_[0]); - sprintf "%02d:%02d:%02d", $h, $m, 10 * int (($s + 5) / 10); + sprintf "%02d:%02d:%02d", $h, $m, $s; } |