use Dpkg::Compression;
use Dpkg::Source::Archive;
use Dpkg::Source::Patch;
-use Dpkg::Version qw(check_version parseversion);
+use Dpkg::Version qw(check_version);
use Dpkg::Exit;
use Dpkg::Source::Functions qw(erasedir);
usageerr(_g("source handling style -s%s not allowed with -x"),
$sourcestyle);
- my $dsc = $self->get_filename();
my $dscdir = $self->{'basedir'};
- my $sourcepackage = $fields->{'Source'};
-
check_version($fields->{'Version'});
- my %v = parseversion($fields->{'Version'});
- my $baseversion = $v{'version'};
- my $revision = ($version =~ m/-/) ? $v{'revision'} : '';
- my $version = $baseversion . ($revision ? "-$revision" : "");
my $basename = $self->get_basename();
my $basenamerev = $self->get_basename(1);
} elsif ($file =~ /^\Q$basenamerev\E\.diff\.gz$/) {
$difffile = $file;
} else {
- error(_g("unrecognized file for a v1.0 source package: %s"), $file);
+ error(_g("unrecognized file for a %s source package: %s"),
+ "v1.0", $file);
}
}
unless defined $tarfile;
}
- $newdirectory = $sourcepackage.'-'.$baseversion unless defined($newdirectory);
my $expectprefix = $newdirectory;
$expectprefix .= '.orig' if $difffile;
erasedir($newdirectory);
- if (-e "$expectprefix") {
- rename("$expectprefix","$newdirectory.tmp-keep") ||
+ if (-e $expectprefix) {
+ rename($expectprefix, "$newdirectory.tmp-keep") ||
syserr(_g("unable to rename `%s' to `%s'"), $expectprefix,
"$newdirectory.tmp-keep");
}
}
if ($copy_required) {
- system('cp','--',"$dscdir$tarfile", $tarfile);
+ system('cp', '--', "$dscdir$tarfile", $tarfile);
subprocerr("cp $dscdir$tarfile to $tarfile") if $?;
}
}
if (-e "$newdirectory.tmp-keep") {
error(_g("unable to keep orig directory (already exists)"));
}
- system('cp','-ar','--',$expectprefix,"$newdirectory.tmp-keep");
+ system('cp', '-ar', '--', $expectprefix, "$newdirectory.tmp-keep");
subprocerr("cp $expectprefix to $newdirectory.tmp-keep") if $?;
}
}
if ($newdirectory ne $expectprefix)
{
- rename($expectprefix,$newdirectory) ||
+ rename($expectprefix, $newdirectory) ||
syserr(_g("failed to rename newly-extracted %s to %s"),
$expectprefix, $newdirectory);
# rename the copied .orig directory
if (-e "$newdirectory.tmp-keep") {
- rename("$newdirectory.tmp-keep",$expectprefix) ||
+ rename("$newdirectory.tmp-keep", $expectprefix) ||
syserr(_g("failed to rename saved %s to %s"),
"$newdirectory.tmp-keep", $expectprefix);
}