mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
* 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:
@@ -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".
|
||||
|
||||
Reference in New Issue
Block a user