* The "vmware and dpkg on drugs" release.

* If a preinstall script in a rpm starts like this:
     # BEGINNING_OF_POST_DOT_SH
     #!/bin/sh
     Add anther hashbang at the top, so dpkg doesn't croak on it.
     Closes: #137032
This commit is contained in:
joey
2002-03-06 17:59:15 +00:00
parent ea30cb70c6
commit a38606b975
2 changed files with 13 additions and 2 deletions

View File

@@ -419,7 +419,7 @@ sub _script_helper {
# set
if (@_) {
my $value=shift;
if (length $value and $value !~ m/#!\s*\//) {
if (length $value and $value !~ m/^#!\s*\//) {
$value="#!/bin/sh\n$value";
}
$this->{$script} = $value;
@@ -431,7 +431,7 @@ sub _script_helper {
$_=$this->{$script};
return '' unless defined $_;
return $_ if m/^\s*$/;
return $_ if m/#!\s*\/bin\/sh/; # looks like a shell script already
return $_ if m/^#!\s*\/bin\/sh/; # looks like a shell script already
my $f = pack("u",$_);
$f =~ s/%/%%/g; # Rpm expands %S, so escape such things.
return "#!/bin/sh\n".