summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-04-12 23:56:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-04-12 23:56:21 +0000
commit33876d96b93d796507af8dd46be3b9aba579d2b0 (patch)
tree2a6b030d080434295a126076b4727b891e5667e8 /perl-install/common.pm
parent66b03c87eb3e94bd4eb764d97cd7aaf3ca7f52f9 (diff)
downloaddrakx-backup-do-not-use-33876d96b93d796507af8dd46be3b9aba579d2b0.tar
drakx-backup-do-not-use-33876d96b93d796507af8dd46be3b9aba579d2b0.tar.gz
drakx-backup-do-not-use-33876d96b93d796507af8dd46be3b9aba579d2b0.tar.bz2
drakx-backup-do-not-use-33876d96b93d796507af8dd46be3b9aba579d2b0.tar.xz
drakx-backup-do-not-use-33876d96b93d796507af8dd46be3b9aba579d2b0.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 3d38e91a4..140067284 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -9,7 +9,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int
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 expand_symlinks) ],
- system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableRam availableMemory removeXiBSuffix template2file formatTime) ],
+ system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableRam availableMemory removeXiBSuffix template2file formatTime unix2dos) ],
constant => [ qw($printable_chars $sizeof_int $bitof_int $SECTORSIZE) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
@@ -91,6 +91,7 @@ sub set_add($@) { my $o = shift; foreach (@_) { exists $o->{hash}{$_} and next;
sub sync { syscall_('sync') }
sub gettimeofday { my $t = pack "LL"; syscall_('gettimeofday', $t, 0) or die "gettimeofday failed: $!\n"; unpack("LL", $t) }
+sub unix2dos { local $_ = $_[0]; s/\015$//mg; s/$/\015/mg; $_ }
sub remove_spaces { local $_ = shift; s/^ +//; s/ +$//; $_ }
sub mode { my @l = stat $_[0] or die "unable to get mode of file $_[0]: $!\n"; $l[2] }