diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-03-13 00:05:51 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-03-13 00:05:51 +0000 |
commit | d39a2a6574b0506ada086f096b05b80e9b156ec2 (patch) | |
tree | 49c34ed68d626c98c788cc4b66aaa62f1009c34b /perl-install/common.pm | |
parent | d500c7d827531b45bf5520162866930d3cac9ea8 (diff) | |
download | drakx-backup-do-not-use-d39a2a6574b0506ada086f096b05b80e9b156ec2.tar drakx-backup-do-not-use-d39a2a6574b0506ada086f096b05b80e9b156ec2.tar.gz drakx-backup-do-not-use-d39a2a6574b0506ada086f096b05b80e9b156ec2.tar.bz2 drakx-backup-do-not-use-d39a2a6574b0506ada086f096b05b80e9b156ec2.tar.xz drakx-backup-do-not-use-d39a2a6574b0506ada086f096b05b80e9b156ec2.zip |
renamef created and used
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index 043c30de6..9fa9e620a 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -8,7 +8,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int %EXPORT_TAGS = ( common => [ qw(__ may_apply even odd arch better_arch compat_arch min max sqr sum and_ or_ if_ if__ 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_ put_in_hash set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines deref next_val_in_array) ], functional => [ qw(fold_left compose mapgrep map_index grep_index find_index map_each grep_each list2kv map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie combine) ], - file => [ qw(dirname basename touch all glob_ cat_ cat__ output symlinkf chop_ mode typeFromMagic expand_symlinks) ], + file => [ qw(dirname basename touch all glob_ cat_ cat__ output symlinkf renamef chop_ mode typeFromMagic expand_symlinks) ], system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInShMode setVarsInCsh substInFile availableMemory availableRamMB removeXiBSuffix formatXiB template2file template2userfile update_userkderc list_skels formatTime formatTimeRaw unix2dos setVirtual isCdNotEjectable) ], constant => [ qw($printable_chars $sizeof_int $bitof_int $SECTORSIZE %compat_arch) ], ); @@ -94,6 +94,7 @@ sub output { my $f = shift; local *F; open F, ">$f" or die "output in file $f fa sub deref { ref $_[0] eq "ARRAY" ? @{$_[0]} : ref $_[0] eq "HASH" ? %{$_[0]} : $_[0] } sub linkf { unlink $_[1]; link $_[0], $_[1] } sub symlinkf { unlink $_[1]; symlink $_[0], $_[1] } +sub renamef { unlink $_[1]; rename $_[0], $_[1] } sub chop_ { map { my $l = $_; chomp $l; $l } @_ } sub divide { my $d = int $_[0] / $_[1]; wantarray ? ($d, $_[0] % $_[1]) : $d } sub round { int ($_[0] + 0.5) } |