summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-08-04 05:54:56 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-08-04 05:54:56 +0000
commitf7571319b3d693059705b5d20682bea44cb7d195 (patch)
tree12b62f5fc5d49a63cc543f011fd214673a9bce0f
parent658c477f1ea4b2f6e6b2370561dbde383a33bdb7 (diff)
downloadperl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.tar
perl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.tar.gz
perl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.tar.bz2
perl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.tar.xz
perl-MDK-Common-f7571319b3d693059705b5d20682bea44cb7d195.zip
setVarsInSh() now tries to use quoting only when really needed,
otherwise it breaks program parsing the generated file (eg: /usr/sbin/autologin)
-rw-r--r--MDK/Common.pm.pl2
-rw-r--r--MDK/Common/System.pm14
-rw-r--r--perl-MDK-Common.spec4
3 files changed, 11 insertions, 9 deletions
diff --git a/MDK/Common.pm.pl b/MDK/Common.pm.pl
index ba7a989..62dcb51 100644
--- a/MDK/Common.pm.pl
+++ b/MDK/Common.pm.pl
@@ -74,7 +74,7 @@ use vars qw(@ISA @EXPORT $VERSION); #);
# perl_checker: RE-EXPORT-ALL
@EXPORT = map { @$_ } map { values %{'MDK::Common::' . $_ . 'EXPORT_TAGS'} } grep { /::$/ } keys %MDK::Common::;
-$VERSION = "1.1.16";
+$VERSION = "1.1.17";
1;
EOF
diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm
index 3b21a9d..427a9e5 100644
--- a/MDK/Common/System.pm
+++ b/MDK/Common/System.pm
@@ -327,14 +327,12 @@ sub setVarsInShMode {
MDK::Common::File::output($file,
map {
my $val = $l->{$_};
- if ($val =~ /\W/) {
- if ($val =~ /["\$]/) {
- $val =~ s/(')/\\$1/;
- $val = qq('$val');
- } else {
- $val =~ s/(")/\\$1/;
- $val = qq("$val");
- }
+ if ($val =~ /["`\$]/) {
+ $val =~ s/(')/\\$1/g;
+ $val = qq('$val');
+ } elsif ($val =~ /['\s\\]/) {
+ $val =~ s/(["\\])/\\$1/g;
+ $val = qq("$val");
}
"$_=$val\n";
} grep { $l->{$_} } @fields
diff --git a/perl-MDK-Common.spec b/perl-MDK-Common.spec
index 456585b..5b2b02c 100644
--- a/perl-MDK-Common.spec
+++ b/perl-MDK-Common.spec
@@ -72,6 +72,10 @@ rm -rf $RPM_BUILD_ROOT
# MODIFY IN THE CVS: cvs.mandrakesoft.com:/cooker soft/perl-MDK-Common
%changelog
+* Wed Aug 4 2004 Pixel <pixel@mandrakesoft.com> 1.1.17-1mdk
+- setVarsInSh() now tries to use quoting only when really needed,
+ otherwise it breaks program parsing the generated file (eg: /usr/sbin/autologin)
+
* Mon Aug 2 2004 Pixel <pixel@mandrakesoft.com> 1.1.16-1mdk
- MDK::Common::System: whereis_binary() can now handle prefix