Package: alien
Version: 8.89
Severity: normal
Tags: patch

Hi,

alien cannot cope with RPMs whem their path contains whitespace due to missing 
quotes
in the invoced shell commands.
I think I fixed all invocations (cf. patch) and then alien runs without 
producing error 
messages.

This problem my apply to other package formats as well, but I was only 
interessted in
RPMs for now.

Cheers,
        Christopher

-- System Information:
Debian Release: 7.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages alien depends on:
ii  cpio       2.11+dfsg-0.1
ii  debhelper  9.20120909
ii  dpkg-dev   1.16.10
ii  make       3.81-8.2
ii  perl       5.14.2-21
ii  rpm        4.10.0-5+deb7u1
ii  rpm2cpio   4.10.0-5+deb7u1

alien recommends no packages.

Versions of packages alien suggests:
ii  bzip2            1.0.6-4
ii  lintian          2.5.10.4
pn  lsb-rpm          <none>
ii  patch            2.6.1-3
ii  xz-utils [lzma]  5.1.1alpha+20120614-2

-- no debconf information
>From c51017904c32666ebbfcaef7be1c9c5f63d7ad87 Mon Sep 17 00:00:00 2001
From: Christopher Huhn <c.h...@gsi.de>
Date: Thu, 15 Aug 2013 10:32:20 +0200
Subject: [PATCH] Correctly handle RPMs with whitespace in their path

---
 Alien/Package/Rpm.pm |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Alien/Package/Rpm.pm b/Alien/Package/Rpm.pm
index 97af9e0..2c02e6f 100644
--- a/Alien/Package/Rpm.pm
+++ b/Alien/Package/Rpm.pm
@@ -161,11 +161,11 @@ sub unpack {
 	
 	# Check if we need to use lzma to uncompress the cpio archive
 	my $decomp='';
-	if ($this->do("rpm2cpio ".$this->filename." | lzma -t -q > /dev/null 2>&1")) {
+	if ($this->do("rpm2cpio '".$this->filename."' | lzma -t -q > /dev/null 2>&1")) {
 		$decomp = 'lzma -d -q |';
 	}
 
-	$this->do("rpm2cpio ".$this->filename." | (cd $workdir; $decomp cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>&1")
+	$this->do("rpm2cpio '".$this->filename."' | (cd $workdir; $decomp cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>&1")
 		or die "Unpacking of '".$this->filename."' failed";
 	
 	# cpio does not necessarily store all parent directories in an
@@ -174,7 +174,7 @@ sub unpack {
 	# Find those directories and make them mode 755, which is more
 	# reasonable.
 	my %seenfiles;
-	open (RPMLIST, "rpm2cpio ".$this->filename." | $decomp cpio -it --quiet |")
+	open (RPMLIST, "rpm2cpio '".$this->filename."' | $decomp cpio -it --quiet |")
 		or die "File list of '".$this->filename."' failed";
 	while (<RPMLIST>) {
 		chomp;
@@ -184,7 +184,7 @@ sub unpack {
 	foreach my $file (`cd $workdir; find ./`) {
 		chomp $file;
 		if (! $seenfiles{$file} && -d "$workdir/$file" && ! -l "$workdir/$file") {
-			$this->do("chmod 755 $workdir/$file");
+			$this->do("chmod 755 '$workdir/$file'");
 		}
 	}
 
@@ -248,7 +248,7 @@ sub unpack {
 	# postinst.
 	my %owninfo = ();
 	my %modeinfo = ();
-	open (GETPERMS, 'rpm --queryformat \'[%{FILEMODES} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILENAMES}\n]\' -qp '.$this->filename.' |');
+	open (GETPERMS, 'rpm --queryformat \'[%{FILEMODES} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILENAMES}\n]\' -qp \''.$this->filename.'\' |');
 	while (<GETPERMS>) {
 		chomp;
 		my ($mode, $owner, $group, $file) = split(/ /, $_, 4);
-- 
1.7.10.4

Reply via email to