Debianisation diffs. If no second argument is supplied then
.B dpkg\-source
will look for the original source tarfile
-.IB package _ upstream-version .orig.tar.gz
+.IB package _ upstream-version .orig.tar. extension
+(where \fIextension\fP is one of
+.BR gz ", " bz2 ", and " lzma )
or the original source directory
.IB directory .orig
depending on the \fB\-sX\fP arguments.
Specify the compression to use for created files (tarballs and diffs).
Note that this option will not cause existing tarballs to be recompressed,
it only affects new files. Supported values are:
-.IR gz ", " bz2 ", and " lzma .
-\fIgz\fP is the default.
+.IR gzip ", " bzip2 ", and " lzma .
+\fIgzip\fP is the default.
.TP
.BR \-z \fIlevel\fP
Compression level to use. As with \fB\-Z\fP it only affects newly created
This is very helpful in cutting out extraneous files that get included
-in the .diff.gz, e.g. if you maintain your source in a revision control
+in the diff, e.g. if you maintain your source in a revision control
system and want to use a checkout to build a source package without
including the additional files and directories that it will usually
contain (e.g. CVS/, .cvsignore, .svn/). The default regexp is already
If this option is specified, the pattern will be passed to
.BR tar (1)'s
\-\-exclude
-option when it is called to generate a .orig.tar.gz or .tar.gz file. For
+option when it is called to generate a .orig.tar or .tar file. For
example, \-ICVS will make tar skip over CVS directories when generating
a .tar.gz file. The option may be repeated multiple times to list multiple
patterns to exclude.
.TP
.BR \-sk
Specifies to expect the original source as a tarfile, by default
-.IB package _ upstream-version .orig.tar.gz\fR.
+.IB package _ upstream-version .orig.tar. extension \fR.
It will leave this original source in place as a tarfile, or copy it
to the current directory if it isn't already there.
.TP
my $def_dscformat = "1.0"; # default format for -b
my $expectprefix;
-my $compression = 'gz';
-my $comp_level = '9';
-my @comp_supported = qw(gz bz2 lzma);
+
+# Compression
+my @comp_supported = qw(gzip bzip2 lzma);
my %comp_supported = map { $_ => 1 } @comp_supported;
+my %comp_ext = ( gzip => 'gz', bzip2 => 'bz2', lzma => 'lzma' );
my $comp_regex = '(?:gz|bz2|lzma)';
+my $compression = 'gzip';
+my $comp_level = '9';
+my $comp_ext = $comp_ext{$compression};
# Packages
my %remove;
-ss trust packed & unpacked orig src are same.
-sn there is no diff, do main tarfile only.
-sA,-sK,-sP,-sU,-sR like -sa,-sk,-sp,-su,-sr but may overwrite.
- -Z<compression> select compression to use (defaults to 'gz',
+ -Z<compression> select compression to use (defaults to 'gzip',
supported are: %s).
-z<level> compression level to use (defaults to '9',
supported are: '1'-'9', 'best', 'fast')
&setopmode('extract');
} elsif (m/^-Z/) {
$compression = $POSTMATCH;
+ $comp_ext = $comp_ext{$compression};
usageerr(sprintf(_g("%s is not a supported compression"), $compression))
unless $comp_supported{$compression};
} elsif (m/^-z/) {
parsechangelog($changelogfile, $changelogformat);
parsecontrolfile($controlfile);
- $f{"Format"}= $compression eq 'gz' ? $def_dscformat : '2.0';
+ $f{"Format"}= $compression eq 'gzip' ? $def_dscformat : '2.0';
&init_substvars;
my @sourcearch;
" but source handling style -s%s wants something"), $sourcestyle));
}
} elsif ($sourcestyle =~ m/[aA]/) {
- my @origtargz = map { "$basename.orig.tar.$_" } ($compression, @comp_supported);
+ my @origtargz = map { "$basename.orig.tar.$comp_ext{$_}" } ($compression, @comp_supported);
foreach my $origtar (@origtargz) {
if (stat($origtar)) {
-f _ || &error(sprintf(_g("packed orig `%s' exists but is not a plain file"), $origtar));
$origdirname, "$basedirname.orig"));
$tardirbase= $origdirbase; $tardirname= $origdirname;
- $tarname= $origtargz || "$basename.orig.tar.$compression";
+ $tarname= $origtargz || "$basename.orig.tar.$comp_ext";
$tarname =~ /$basename.orig.tar.($comp_regex)/ ||
warning(sprintf(_g(".orig.tar name %s is not <package>_<upstreamversion>" .
".orig.tar (wanted %s)"), $tarname, "$basename.orig.tar.$comp_regex"));
if (($1 ne 'gz') && ($f{'Format'} < 2)) { $f{'Format'} = '2.0' };
} else {
$tardirbase= $dirbase; $tardirname= $dirname;
- $tarname= "$basenamerev.tar.$compression";
+ $tarname= "$basenamerev.tar.$comp_ext";
}
if ($sourcestyle =~ m/[nurUR]/) {
if ($sourcestyle =~ m/[kpursKPUR]/) {
- my $diffname = "$basenamerev.diff.$compression";
+ my $diffname = "$basenamerev.diff.$comp_ext";
printf(_g("%s: building %s in %s")."\n",
$progname, $sourcepackage, $diffname)
|| &syserr(_g("write building diff message"));