mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
* Munge in #!/bin/sh entries at the top of rpm maintainer
scripts that appear to be shell scripts. Closes: #76124
This commit is contained in:
@@ -395,6 +395,11 @@ debian/slackware scripts can be anything -- perl programs or binary files
|
||||
-- and rpm is limited to only shell scripts, we need to encode the files
|
||||
and add a scrap of shell script to make it unextract and run on the fly.
|
||||
|
||||
When setting a value, we do some mangling too. Rpm maitainer scripts
|
||||
are typically shell scripts, but often lack the leading #!/bin/sh
|
||||
This can confuse dpkg, so add the #!/bin/sh if it looks like there
|
||||
is no shebang magic already in place.
|
||||
|
||||
=cut
|
||||
|
||||
# This helper function deals with all the scripts.
|
||||
@@ -403,6 +408,13 @@ sub _script_helper {
|
||||
my $script=shift;
|
||||
|
||||
# set
|
||||
if (@_) {
|
||||
my $value=shift;
|
||||
if (length $value and $value !~ m/#!\s*\//) {
|
||||
$value="#!/bin/sh\n$value";
|
||||
}
|
||||
$this->{$script} = $value;
|
||||
}
|
||||
$this->{$script} = shift if @_;
|
||||
|
||||
# get
|
||||
@@ -410,9 +422,11 @@ sub _script_helper {
|
||||
$_=$this->{$script};
|
||||
return '' unless defined $_;
|
||||
return $_ if m/^\s*$/;
|
||||
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 "set -e\n".
|
||||
return "#!/bin/sh\n".
|
||||
"set -e\n".
|
||||
"mkdir /tmp/alien.\$\$\n".
|
||||
qq{perl -pe '\$_=unpack("u",\$_)' << '__EOF__' > /tmp/alien.\$\$/script\n}.
|
||||
$f."__EOF__\n".
|
||||
|
||||
7
debian/changelog
vendored
7
debian/changelog
vendored
@@ -1,3 +1,10 @@
|
||||
alien (7.17) unstable; urgency=low
|
||||
|
||||
* Munge in #!/bin/sh entries at the top of rpm maintainer
|
||||
scripts that appear to be shell scripts. Closes: #76124
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Wed, 7 Feb 2001 18:58:56 -0800
|
||||
|
||||
alien (7.16) unstable; urgency=low
|
||||
|
||||
* Updated motif patches again.
|
||||
|
||||
2
debian/control
vendored
2
debian/control
vendored
@@ -3,7 +3,7 @@ Section: admin
|
||||
Priority: optional
|
||||
Build-Depends-Indep: debhelper
|
||||
Maintainer: Joey Hess <joeyh@debian.org>
|
||||
Standards-Version: 3.2.1.0
|
||||
Standards-Version: 3.5.0.0
|
||||
|
||||
Package: alien
|
||||
Architecture: all
|
||||
|
||||
Reference in New Issue
Block a user