mirror of
https://github.com/Project-OSS-Revival/alien.git
synced 2026-04-24 14:00:17 +00:00
* Made more robust in the face of empty rpms. Closes: #138969
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user