Fix bash shebang and recognise bash scripts as editable shell scripts when converting to deb. Closes: #532330 (Thanks, Bruce Stephens)

This commit is contained in:
Joey Hess
2009-06-08 13:22:30 -04:00
parent cbf330f982
commit 5b605e1960
3 changed files with 5 additions and 2 deletions

View File

@@ -738,7 +738,7 @@ sub postinst {
return $postinst unless %$owninfo; return $postinst unless %$owninfo;
my ($firstline, $rest)=split(/\n/, $postinst, 2); my ($firstline, $rest)=split(/\n/, $postinst, 2);
if ($firstline !~ m/^#!\s*\/bin\/sh/) { if ($firstline !~ m/^#!\s*\/bin\/(ba)?sh/) {
print STDERR "warning: unable to add ownership fixup code to postinst as the postinst is not a shell script!\n"; print STDERR "warning: unable to add ownership fixup code to postinst as the postinst is not a shell script!\n";
return $postinst; return $postinst;
} }

View File

@@ -497,7 +497,7 @@ sub _script_helper {
$value="#!/bin/bash\n$prefixcode$value"; $value="#!/bin/bash\n$prefixcode$value";
} }
else { else {
$value=~s@^#!\s*/bin/sh(\s)@#/bin/bash$1@; $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;

3
debian/changelog vendored
View File

@@ -2,6 +2,9 @@ alien (8.76) UNRELEASED; urgency=low
* Avoid using hostname -f for portability to unix systems, * Avoid using hostname -f for portability to unix systems,
such as Solaris, where any options _set_ the hostname. such as Solaris, where any options _set_ the hostname.
* Fix bash shebang and recognise bash scripts as editable
shell scripts when converting to deb. Closes: #532330
(Thanks, Bruce Stephens)
-- Joey Hess <joeyh@debian.org> Fri, 29 May 2009 13:02:54 -0400 -- Joey Hess <joeyh@debian.org> Fri, 29 May 2009 13:02:54 -0400