diff --git a/Alien/Package/Deb.pm b/Alien/Package/Deb.pm index 3d52b83..bf09058 100644 --- a/Alien/Package/Deb.pm +++ b/Alien/Package/Deb.pm @@ -110,7 +110,7 @@ sub test { return map { s/\n//; $_ } grep { ! /unknown-section alien/ - } $this->runpipe(1, "lintian $deb"); + } $this->runpipe(1, "lintian '$deb'"); } else { return "lintian not available, so not testing"; @@ -130,7 +130,7 @@ sub getcontrolfile { my $file=$this->filename; if ($this->have_dpkg_deb) { - return $this->runpipe(1, "dpkg-deb --info $file $controlfile 2>/dev/null"); + return $this->runpipe(1, "dpkg-deb --info '$file' $controlfile 2>/dev/null"); } else { # Solaris tar doesn't support O @@ -139,10 +139,10 @@ sub getcontrolfile { return "(mkdir /tmp/tar_out.$$ &&". " cd /tmp/tar_out.$$ &&". - " tar xf - ./$file &&". - " cat $file; cd /; rm -rf /tmp/tar_out.$$)"; + " tar xf - './$file' &&". + " cat '$file'; cd /; rm -rf /tmp/tar_out.$$)"; } - my $getcontrol = "ar -p $file control.tar.gz | gzip -dc | ".tar_out($controlfile)." 2>/dev/null"; + my $getcontrol = "ar -p '$file' control.tar.gz | gzip -dc | ".tar_out($controlfile)." 2>/dev/null"; return $this->runpipe(1, $getcontrol); } } @@ -212,11 +212,11 @@ sub scan { my @filelist; if ($this->have_dpkg_deb) { @filelist=map { chomp; s:\./::; "/$_" } - $this->runpipe(0, "dpkg-deb --fsys-tarfile $file | tar tf -"); + $this->runpipe(0, "dpkg-deb --fsys-tarfile '$file' | tar tf -"); } else { @filelist=map { chomp; s:\./::; "/$_" } - $this->runpipe(0, "ar -p $file data.tar.gz | gzip -dc | tar tf -"); + $this->runpipe(0, "ar -p '$file' data.tar.gz | gzip -dc | tar tf -"); } $this->filelist(\@filelist); @@ -307,7 +307,7 @@ sub prep { or die "patch error: $!"; # Look for .rej files. die "patch failed with .rej files; giving up" - if $this->runpipe(1, "find $dir -name \"*.rej\""); + if $this->runpipe(1, "find '$dir' -name \"*.rej\""); $this->do('find', '.', '-name', '*.orig', '-exec', 'rm', '{}', ';'); $this->do("chmod", 755, "$dir/debian/rules"); diff --git a/Alien/Package/Lsb.pm b/Alien/Package/Lsb.pm index a214588..dbca7ba 100644 --- a/Alien/Package/Lsb.pm +++ b/Alien/Package/Lsb.pm @@ -30,7 +30,7 @@ sub checkfile { my $this=shift; my $file=shift; return unless $file =~ m/^lsb-.*\.rpm$/; - my @deps=$this->runpipe(1, "LANG=C rpm -qp -R $file"); + my @deps=$this->runpipe(1, "LANG=C rpm -qp -R '$file'"); return 1 if grep { s/\s+//g; $_ eq 'lsb' } @deps; return; } diff --git a/Alien/Package/Rpm.pm b/Alien/Package/Rpm.pm index c56a8ca..371eff0 100644 --- a/Alien/Package/Rpm.pm +++ b/Alien/Package/Rpm.pm @@ -83,7 +83,7 @@ sub scan { foreach my $field (qw{NAME VERSION RELEASE ARCH CHANGELOGTEXT SUMMARY DESCRIPTION PREFIXES}, keys(%fieldtrans)) { - my $value=$this->runpipe(0, "LANG=C rpm -qp --queryformat \%{$field} $file"); + my $value=$this->runpipe(0, "LANG=C rpm -qp --queryformat \%{$field} '$file'"); next if $? || $value eq '(none)'; my $key; if (exists $fieldtrans{$field}) { @@ -96,16 +96,16 @@ sub scan { } # Get the conffiles list. - $this->conffiles([map { chomp; $_ } $this->runpipe(0, "LANG=C rpm -qcp $file")]); + $this->conffiles([map { chomp; $_ } $this->runpipe(0, "LANG=C rpm -qcp '$file'")]); if (defined $this->conffiles->[0] && $this->conffiles->[0] eq '(contains no files)') { $this->conffiles([]); } - $this->binary_info(scalar $this->runpipe(0, "rpm -qpi $file")); + $this->binary_info(scalar $this->runpipe(0, "rpm -qpi '$file'")); # Get the filelist. - $this->filelist([map { chomp; $_ } $this->runpipe(0, "LANG=C rpm -qpl $file")]); + $this->filelist([map { chomp; $_ } $this->runpipe(0, "LANG=C rpm -qpl '$file'")]); if (defined $this->filelist->[0] && $this->filelist->[0] eq '(contains no files)') { $this->filelist([]); @@ -128,7 +128,7 @@ sub scan { } unless (defined $this->copyright) { # Older rpms have no licence tag, but have a copyright. - $this->copyright($this->runpipe(0, "LANG=C rpm -qp --queryformat \%{COPYRIGHT} $file")); + $this->copyright($this->runpipe(0, "LANG=C rpm -qp --queryformat \%{COPYRIGHT} '$file'")); # Fallback. if (! $this->copyright) { @@ -439,7 +439,7 @@ sub build { $opts.=" $ENV{RPMBUILDOPT}" if exists $ENV{RPMBUILDOPT}; my $pwd=`pwd`; chomp $pwd; - my $command="cd $dir; $buildcmd --buildroot=$pwd/$dir -bb $opts ".$this->name."-".$this->version."-".$this->release.".spec"; + my $command="cd $dir; $buildcmd --buildroot='$pwd/$dir' -bb $opts '".$this->name."-".$this->version."-".$this->release.".spec'"; my $log=$this->runpipe(1, "$command 2>&1"); if ($?) { die "Package build failed. Here's the log of the command ($command):\n", $log; diff --git a/Alien/Package/Slp.pm b/Alien/Package/Slp.pm index 4c5409f..ec19e18 100644 --- a/Alien/Package/Slp.pm +++ b/Alien/Package/Slp.pm @@ -166,7 +166,7 @@ sub scan { # Read in the file list. my @filelist; # FIXME: support gzip files too! - foreach ($this->runpipe(0, "bzip2 -d < $file | tar -tf -")) { + foreach ($this->runpipe(0, "bzip2 -d < '$file' | tar -tf -")) { chomp; s:^\./:/:; $_="/$_" unless m:^/:; @@ -179,7 +179,7 @@ sub scan { $this->distribution('Stampede'); $this->origformat('slp'); $this->changelogtext(''); - $this->binary_info($this->runpipe(0, "ls -l $file")); + $this->binary_info($this->runpipe(0, "ls -l '$file'")); return 1; } diff --git a/Alien/Package/Tgz.pm b/Alien/Package/Tgz.pm index 3118ba8..7ab6e8b 100644 --- a/Alien/Package/Tgz.pm +++ b/Alien/Package/Tgz.pm @@ -118,7 +118,7 @@ sub scan { $this->group("unknown"); $this->origformat('tgz'); $this->changelogtext(''); - $this->binary_info($this->runpipe(0, "ls -l $file")); + $this->binary_info($this->runpipe(0, "ls -l '$file'")); # Now figure out the conffiles. Assume anything in etc/ is a # conffile. @@ -152,7 +152,7 @@ sub scan { # Now get the scripts. foreach my $script (keys %{scripttrans()}) { - $this->$script(scalar $this->runpipe(1, "tar Oxf $file install/${scripttrans()}{$script} 2>/dev/null")); + $this->$script(scalar $this->runpipe(1, "tar Oxf '$file' install/${scripttrans()}{$script} 2>/dev/null")); } return 1; diff --git a/debian/changelog b/debian/changelog index 353ac50..a5bfdc2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +alien (8.85) UNRELEASED; urgency=low + + * Avoid breaking on spaces in filenames. Closes: #618636 + + -- Joey Hess Sat, 11 Jun 2011 12:58:29 -0400 + alien (8.84) unstable; urgency=low * Silence error message when deleting build tree after making an rpm,