mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
Modify maintainer scripts from rpm files to use /bin/bash rather than /bin/sh. Many such scripts are only tested on systems where /bin/sh is bash, and contain bashisms, which can cause trouble when converting the rpm to be used on eg, the Debian family of distributions, where /bin/sh can legitimatly be dash. Closes: #495971
This commit is contained in:
@@ -463,11 +463,16 @@ 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 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.
|
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
|
When setting a value, we do some mangling too. Rpm maintainer scripts
|
||||||
are typically shell scripts, but often lack the leading #!/bin/sh
|
are typically shell scripts, but often lack the leading shebang line.
|
||||||
This can confuse dpkg, so add the #!/bin/sh if it looks like there
|
This can confuse dpkg, so add the shebang if it looks like there
|
||||||
is no shebang magic already in place.
|
is no shebang magic already in place.
|
||||||
|
|
||||||
|
Additionally, it's not uncommon for rpm maintainer scripts to contain
|
||||||
|
bashisms, which can be triggered when they are ran on systems where /bin/sh
|
||||||
|
is not bash. To work around this, the shebang line of the scripts is
|
||||||
|
changed to use bash.
|
||||||
|
|
||||||
Also, if the rpm is relocatable, the script could refer to
|
Also, if the rpm is relocatable, the script could refer to
|
||||||
RPM_INSTALL_PREFIX, which is set by rpm at run time. Deal with this by
|
RPM_INSTALL_PREFIX, which is set by rpm at run time. Deal with this by
|
||||||
adding code to the script to set RPM_INSTALL_PREFIX.
|
adding code to the script to set RPM_INSTALL_PREFIX.
|
||||||
@@ -489,9 +494,10 @@ sub _script_helper {
|
|||||||
|
|
||||||
my $value=shift;
|
my $value=shift;
|
||||||
if (length $value and $value !~ m/^#!\s*\//) {
|
if (length $value and $value !~ m/^#!\s*\//) {
|
||||||
$value="#!/bin/sh\n$prefixcode$value";
|
$value="#!/bin/bash\n$prefixcode$value";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$value=~s@^#!\s*/bin/sh(\s)@#/bin/bash$1@;
|
||||||
$value=~s/\n/\n$prefixcode/s;
|
$value=~s/\n/\n$prefixcode/s;
|
||||||
}
|
}
|
||||||
$this->{$script} = $value;
|
$this->{$script} = $value;
|
||||||
|
|||||||
5
debian/changelog
vendored
5
debian/changelog
vendored
@@ -1,6 +1,11 @@
|
|||||||
alien (8.75) UNRELEASED; urgency=low
|
alien (8.75) UNRELEASED; urgency=low
|
||||||
|
|
||||||
* Simplified rules file.
|
* Simplified rules file.
|
||||||
|
* Modify maintainer scripts from rpm files to use /bin/bash rather
|
||||||
|
than /bin/sh. Many such scripts are only tested on systems where /bin/sh
|
||||||
|
is bash, and contain bashisms, which can cause trouble when converting
|
||||||
|
the rpm to be used on eg, the Debian family of distributions, where
|
||||||
|
/bin/sh can legitimatly be dash. Closes: #495971
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Fri, 27 Feb 2009 20:18:52 -0500
|
-- Joey Hess <joeyh@debian.org> Fri, 27 Feb 2009 20:18:52 -0500
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user