more bug fixes

This commit is contained in:
joey
2000-04-22 01:16:10 +00:00
parent d384a93c99
commit 07a81c8b5c
3 changed files with 24 additions and 20 deletions

View File

@@ -49,28 +49,28 @@ This is a list of all the fields in the order they appear in the footer.
=cut =cut
use constant footer_size => 3784, use constant footer_size => 3784;
footer_packstring => "A756IIIIA128A128A80A1536A512A512A30A30IA20A20III", use constant footer_packstring => "A756IIIIA128A128A80A1536A512A512A30A30IA20A20III";
footer_version => 5, use constant footer_version => 5;
archtrans => { use constant archtrans => {
0 => 'all', 0 => 'all',
1 => 'i386', 1 => 'i386',
2 => 'sparc', 2 => 'sparc',
3 => 'alpha', 3 => 'alpha',
4 => 'powerpc', 4 => 'powerpc',
5 => 'm68k', 5 => 'm68k',
}, };
copyrighttrans => { use constant copyrighttrans => {
0 => 'GPL', 0 => 'GPL',
1 => 'BSD', 1 => 'BSD',
2 => 'LGPL', 2 => 'LGPL',
3 => 'unknown', 3 => 'unknown',
254 => 'unknown', 254 => 'unknown',
}, };
fieldlist => [qw{conffiles priority compresstype release copyright use constant fieldlist => [qw{conffiles priority compresstype release copyright
conflicts setupscript summary description depends conflicts setupscript summary description depends
provides author date compiler version name arch provides maintainer date compiler version name
group slpkgversion}]; arch group slpkgversion}];
=back =back
@@ -192,11 +192,11 @@ sub unpack {
if ($compresstype == 0) { if ($compresstype == 0) {
system("bzip2 -d $file | (cd ".$this->unpacked_tree."; tar xpf -") && system("bzip2 -d $file | (cd ".$this->unpacked_tree."; tar xpf -") &&
die "unpack failed: $!"; die "unpack failed";
} }
elsif ($compresstype == 1) { elsif ($compresstype == 1) {
system("cat $file | (cd ".$this->unpacked_tree."; tar zxpf -") && system("cat $file | (cd ".$this->unpacked_tree."; tar zxpf -") &&
die "unpack failed: $!"; die "unpack failed";
} }
else { else {
die "package uses an unknown compression type, $compresstype (please file a bug report)"; die "package uses an unknown compression type, $compresstype (please file a bug report)";
@@ -230,10 +230,11 @@ sub build {
254, # Don't try to guess copyright, just use unknown. 254, # Don't try to guess copyright, just use unknown.
'', # Conflicts. '', # Conflicts.
'', # Set up script. TODO '', # Set up script. TODO
$this->summary,
$this->description, $this->description,
'', # Depends. '', # Depends.
'', # Provides. '', # Provides.
$this->author, $this->maintainer,
scalar localtime, # Use current date. scalar localtime, # Use current date.
252, # Unknown compiler. 252, # Unknown compiler.
$this->version, $this->version,
@@ -319,8 +320,9 @@ sub arch {
# set # set
if (@_) { if (@_) {
$this->{arch}=${archtrans()}{shift}; my $arch=shift;
die "unknown architecture" if ! $this->{arch}; $this->{arch}=${archtrans()}{$arch};
die "unknown architecture $arch" unless defined $this->{arch};
} }
# get # get
@@ -344,7 +346,7 @@ sub release {
my $this=shift; my $this=shift;
# set # set
$this->{release}=shift; $this->{release}=shift if @_;
# get # get
return unless defined wantarray; # optimization return unless defined wantarray; # optimization

View File

@@ -27,8 +27,7 @@ tgz's.
=cut =cut
use constant use constant scripttrans => {
scripttrans => {
postinst => 'doinst.sh', postinst => 'doinst.sh',
postrm => 'delete.sh', postrm => 'delete.sh',
prerm => 'predelete.sh', prerm => 'predelete.sh',

3
alien
View File

@@ -365,5 +365,8 @@ foreach my $file (@ARGV) {
# Note I don't unlink it. I figure that might annoy # Note I don't unlink it. I figure that might annoy
# people, since it was an input file. # people, since it was an input file.
} }
else {
print "$file already exists\n";
}
} }
} }