summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2000-09-29 16:04:48 +0000
committerdamien <damien@mandriva.com>2000-09-29 16:04:48 +0000
commit7e1daf4c42b0deeb294c46a4b46e72c0857d4718 (patch)
tree711401a1d5e8b45d962f646903b14ef47e1a0a2c /perl-install/common.pm
parent5e8ddae3ad270e359310b6e289ea1adde9b3a637 (diff)
downloaddrakx-backup-do-not-use-7e1daf4c42b0deeb294c46a4b46e72c0857d4718.tar
drakx-backup-do-not-use-7e1daf4c42b0deeb294c46a4b46e72c0857d4718.tar.gz
drakx-backup-do-not-use-7e1daf4c42b0deeb294c46a4b46e72c0857d4718.tar.bz2
drakx-backup-do-not-use-7e1daf4c42b0deeb294c46a4b46e72c0857d4718.tar.xz
drakx-backup-do-not-use-7e1daf4c42b0deeb294c46a4b46e72c0857d4718.zip
stc
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index bac1d5129..d54eb9a2f 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 better_arch compat_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 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) ],
- system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableMemory availableRamMB removeXiBSuffix template2file template2userfile update_userkderc list_skels formatTime formatTimeRaw unix2dos setVirtual) ],
+ system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInShMode setVarsInCsh substInFile availableMemory availableRamMB removeXiBSuffix template2file template2userfile update_userkderc list_skels formatTime formatTimeRaw unix2dos setVirtual) ],
constant => [ qw($printable_chars $sizeof_int $bitof_int $SECTORSIZE %compat_arch) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
@@ -435,6 +435,17 @@ sub setVarsInSh {
open F, "> $_[0]" or die "cannot create config file $file";
$l->{$_} and print F "$_=$l->{$_}\n" foreach @fields;
}
+
+sub setVarsInShMode {
+ my ($file, $mod, $l, @fields) = @_;
+ @fields = keys %$l unless @fields;
+
+ local *F;
+ open F, "> $_[0]" or die "cannot create config file $file";
+ chmod $mod, $file;
+ $l->{$_} and print F "$_=$l->{$_}\n" foreach @fields;
+}
+
sub setVarsInCsh {
my ($file, $l, @fields) = @_;
@fields = keys %$l unless @fields;