summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-03-05 22:43:46 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-03-05 22:43:46 +0000
commit26a387d5919bba9ccdb8a8447daa114204a997c4 (patch)
treec76ed77468ddcf8ff471514aa3b0eb2b0ee300c4 /perl-install/common.pm
parent0bb6afa215fff585416bc88aa967c7e1eb61672e (diff)
downloaddrakx-26a387d5919bba9ccdb8a8447daa114204a997c4.tar
drakx-26a387d5919bba9ccdb8a8447daa114204a997c4.tar.gz
drakx-26a387d5919bba9ccdb8a8447daa114204a997c4.tar.bz2
drakx-26a387d5919bba9ccdb8a8447daa114204a997c4.tar.xz
drakx-26a387d5919bba9ccdb8a8447daa114204a997c4.zip
no_comment
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 9f4716b8c..bd8413788 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- common => [ qw(__ even odd arch min max sqr sum and_ or_ sign product bool invbool listlength bool2text text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines deref) ],
+ common => [ qw(__ even odd arch min max sqr sum and_ or_ sign product bool invbool listlength bool2text bool2yesno text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines deref) ],
functional => [ qw(fold_left compose map_index grep_index map_each grep_each list2kv map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie) ],
file => [ qw(dirname basename touch all glob_ cat_ output symlinkf chop_ mode typeFromMagic) ],
system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableRam availableMemory removeXiBSuffix template2file formatTime) ],
@@ -68,6 +68,7 @@ sub bool($) { $_[0] ? 1 : 0 }
sub invbool { my $a = shift; $$a = !$$a; $$a }
sub listlength { scalar @_ }
sub bool2text { $_[0] ? "true" : "false" }
+sub bool2yesno { $_[0] ? "yes" : "no" }
sub text2bool { my $t = lc($_[0]); $t eq "true" || $t eq "yes" ? 1 : 0 }
sub strcpy { substr($_[0], $_[2] || 0, length $_[1]) = $_[1] }
sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = <F>; wantarray ? @l : join '', @l }