mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
* Patch from Michael Barabanov <baraban@fsmlabs.com> to make -n work by
preventing rpm from expanding stuff like %S in the uuencoded scripts.
This commit is contained in:
@@ -13,16 +13,19 @@ sub FixFields { my ($self,%fields)=@_;
|
||||
|
||||
# Fix up the scripts. Since debian/slackware scripts can be anything, even
|
||||
# perl programs or binary files, and redhat is limited to only shell scripts,
|
||||
# we need to encode the files and add a scrap of shell script to make it
|
||||
# we need to encode the files and add a scrap of shell script to make it
|
||||
# unextract and run on the fly.
|
||||
my $field;
|
||||
foreach $field ('POSTINST', 'POSTRM', 'PREINST', 'PRERM') {
|
||||
if ($fields{$field}) {
|
||||
# Rpm expands %S, so escape such things.
|
||||
` my $f = pack("u",$fields{$field});
|
||||
$f =~ s/%/%%/g;
|
||||
$fields{$field}=
|
||||
"set -e\n".
|
||||
"mkdir /tmp/alien.\$\$\n".
|
||||
qq{perl -pe '\$_=unpack("u",\$_)' << '__EOF__' > /tmp/alien.\$\$/script\n}.
|
||||
pack("u",$fields{$field}).
|
||||
$f.
|
||||
"__EOF__\n".
|
||||
"chmod 755 /tmp/alien.\$\$/script\n".
|
||||
"/tmp/alien.\$\$/script \"\$@\"\n".
|
||||
|
||||
Reference in New Issue
Block a user