diff options
author | Francois Pons <fpons@mandriva.com> | 1999-11-06 09:10:11 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 1999-11-06 09:10:11 +0000 |
commit | 152b0b998e117a4a79dd77d401df8cfc234574a5 (patch) | |
tree | 142ed19b54273ede98330a2b878e8e9a27567120 /perl-install/install_any.pm | |
parent | 07021694c8d96ab2205c9398a68d177e2d185f2a (diff) | |
download | drakx-152b0b998e117a4a79dd77d401df8cfc234574a5.tar drakx-152b0b998e117a4a79dd77d401df8cfc234574a5.tar.gz drakx-152b0b998e117a4a79dd77d401df8cfc234574a5.tar.bz2 drakx-152b0b998e117a4a79dd77d401df8cfc234574a5.tar.xz drakx-152b0b998e117a4a79dd77d401df8cfc234574a5.zip |
*** empty log message ***
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r-- | perl-install/install_any.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 654e703b3..633e9d6c6 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -422,3 +422,23 @@ sub fsck_option() { my $y = $::o->{security} < 3 && $::beginner && "-y "; substInFile { s/^(\s*fsckoptions=)(-y )?/$1$y/ } "$::o->{prefix}/etc/rc.d/rc.sysinit"; } + +sub translate_file($$%) { + my ($inputfile, $outputfile, %toreplace) = @_; + local *OUT; local *IN; + + open IN , $inputfile or die "Can't open $inputfile $!"; + if ($::testing) { + *OUT = *STDOUT; + } else { + open OUT, ">$outputfile" or die "Can't open $outputfile $!"; + } + + while (<IN>) { + if (/@@@(.*)@@@/) { + my $r = $toreplace{$1}; + s/@@@(.*)@@@/$r/g; + } + print OUT; + } +} |