From da98291614f83c50f9257f1d13a88382b22b5829 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 24 Mar 2002 02:35:58 +0000 Subject: [PATCH] * Made more robust in the face of empty rpms. Closes: #138969 --- Alien/Package/Deb.pm | 12 +++++++++--- Alien/Package/Rpm.pm | 15 +++++++++++---- Alien/Package/Tgz.pm | 2 +- debian/changelog | 6 ++++++ debian/control | 2 +- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/Alien/Package/Deb.pm b/Alien/Package/Deb.pm index 07f3750..51a48fc 100644 --- a/Alien/Package/Deb.pm +++ b/Alien/Package/Deb.pm @@ -343,6 +343,7 @@ sub prep { export DH_COMPAT=3 PACKAGE=$(shell dh_listpackages) +PKGFILES=$(shell ls -1 |grep -v debian) build: dh_testdir @@ -359,7 +360,12 @@ binary-arch: build dh_testroot dh_clean -k dh_installdirs - cp -a `ls -1 |grep -v debian` debian/$(PACKAGE) + +# Copy the packages's files, if any. +ifneq "$(PKGFILES)" "" + cp -a $(PKGFILES) debian/$(PACKAGE) +endif + # # If you need to move files around in debian/$(PACKAGE) or do some # binary patching, do it here @@ -369,7 +375,7 @@ binary-arch: build # This has been known to break on some wacky binaries. # dh_strip dh_compress -# This is too paramoid to be generally useful to alien. +# This is too paranoid to be generally useful to alien. # dh_fixperms dh_makeshlibs dh_installdeb @@ -397,7 +403,7 @@ EOF } } - my %dirtrans=( # Note: no trailing slahshes on these directory names! + my %dirtrans=( # Note: no trailing slashes on these directory names! # Move files to FHS-compliant locations, if possible. '/usr/man' => '/usr/share/man', '/usr/info' => '/usr/share/info', diff --git a/Alien/Package/Rpm.pm b/Alien/Package/Rpm.pm index f43ed52..88c776a 100644 --- a/Alien/Package/Rpm.pm +++ b/Alien/Package/Rpm.pm @@ -88,12 +88,18 @@ sub scan { } # Get the conffiles list. - $this->conffiles([map { chomp; $_ } `rpm -qcp $file`]); + $this->conffiles([map { chomp; $_ } `LANG=C rpm -qcp $file`]); + if ($this->conffiles->[0] eq '(contains no files)') { + $this->conffiles([]); + } $this->binary_info(scalar `rpm -qpi $file`); # Get the filelist. - $this->filelist([map { chomp; $_ } `rpm -qpl $file`]); + $this->filelist([map { chomp; $_ } `LANG=C rpm -qpl $file`]); + if ($this->filelist->[0] eq '(contains no files)') { + $this->filelist([]); + } # Sanity check and sanitize fields. unless (defined $this->summary) { @@ -246,7 +252,8 @@ sub prep { print OUT "Name: ".$this->name."\n"; print OUT "Version: ".$this->version."\n"; print OUT "Release: ".$this->release."\n"; - print OUT "Requires: ".$this->depends."\n" if length $this->depends; + print OUT "Requires: ".$this->depends."\n" + if defined $this->depends && length $this->depends; print OUT "Summary: ".$this->summary."\n"; print OUT "Copyright: ".$this->copyright."\n"; print OUT "Distribution: ".$this->distribution."\n"; @@ -283,7 +290,7 @@ sub prep { print OUT "(Converted from a ".$this->origformat." package by alien.)\n"; print OUT "\n"; print OUT "%files\n"; - print OUT $filelist; + print OUT $filelist if defined $filelist; close OUT; } diff --git a/Alien/Package/Tgz.pm b/Alien/Package/Tgz.pm index 1e94369..dc4604f 100644 --- a/Alien/Package/Tgz.pm +++ b/Alien/Package/Tgz.pm @@ -92,7 +92,7 @@ sub scan { # Strip out any tar extentions. $basename=~s/\.(tgz|tar\.(gz|Z))$//; - if ($basename=~m/(.*)-(.*)/) { + if ($basename=~m/(.*)-(.*?[0-9]+.*?)/) { $this->name($1); $this->version($2); } diff --git a/debian/changelog b/debian/changelog index cdbaf23..575ab7e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +alien (8.02) unstable; urgency=low + + * Made more robust in the face of empty rpms. Closes: #138969 + + -- Joey Hess Tue, 19 Mar 2002 11:29:23 -0500 + alien (8.01) unstable; urgency=low * The "vmware and dpkg on drugs" release. diff --git a/debian/control b/debian/control index f772400..e9a8f7a 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: admin Priority: optional Build-Depends-Indep: debhelper (>= 3) Maintainer: Joey Hess -Standards-Version: 3.5.6.0 +Standards-Version: 3.5.6.1 Package: alien Architecture: all