+2006-11-24 Guillem Jover <guillem@debian.org>
+
+ * scripts/dpkg-source.pl: Add lzma extracting support.
+ (checkdiff): Likewise.
+ (forkgzipread): Likewise.
+ * lib/dpkg.h (LZMA): New macro.
+ (compression_type): Add compress_type_lzma.
+ * lib/compression.c (decompress_cat): Handle compress_type_lzma
+ decompression.
+ * dpkg-deb/dpkg-deb.h (DATAMEMBER_LZMA): New macro.
+ (DATAMEMBER_COMPAT_LZMA): Likewise.
+ * dpkg-deb/extract.c (extracthalf): Handle DATAMEMBER_LZMA and
+ DATAMEMBER_COMPAT_LZMA members.
+
2006-11-24 Brendan O'Dea <bod@debian.org>
* scripts/controllib.pl (subprocerr): Require POSIX for WIFEXITED,
Thanks to Tomas Pospisek <tpo_deb@sourcepole.ch>.
* Require POSIX inside subprocerr in controllib.pl. Closes: #390636
Thanks to Brendan O'Dea <bod@debian.org>.
+ * Support extracting lzma compressed source and binary packages,
+ and add a Suggests on package lzma. Closes: #347715
[ Updated dpkg translations ]
* Chinese (Traditional, Asho Yeh)
dpkg-dev (<< 1.10)
Replaces: dpkg-doc-ja, dpkg-static, manpages-de (<= 0.4-3),
manpages-pl (<= 20051117-1)
-Suggests: apt
+Suggests: apt, lzma
Description: package maintenance system for Debian
This package contains the low-level commands for handling the installation
and removal of packages on your system.
#define DATAMEMBER_COMPAT_GZ "data.tar.gz/ "
#define DATAMEMBER_BZ2 "data.tar.bz2 "
#define DATAMEMBER_COMPAT_BZ2 "data.tar.bz2/ "
+#define DATAMEMBER_LZMA "data.tar.lzma "
+#define DATAMEMBER_COMPAT_LZMA "data.tar.lzma/ "
#define DATAMEMBER_CAT "data.tar "
#define DATAMEMBER_COMPAT_CAT "data.tar/ "
!memcmp(arh.ar_name,DATAMEMBER_COMPAT_BZ2,sizeof(arh.ar_name))) {
adminmember= 0;
compress_type= BZ2;
+ } else if (!memcmp(arh.ar_name, DATAMEMBER_LZMA, sizeof(arh.ar_name)) ||
+ !memcmp(arh.ar_name, DATAMEMBER_COMPAT_LZMA, sizeof(arh.ar_name))) {
+ adminmember = 0;
+ compress_type = compress_type_lzma;
} else if (!memcmp(arh.ar_name,DATAMEMBER_CAT,sizeof(arh.ar_name)) ||
!memcmp(arh.ar_name,DATAMEMBER_COMPAT_CAT,sizeof(arh.ar_name))) {
adminmember= 0;
}
execlp(BZIP2,"bzip2","-dc",(char*)0); ohshite(_("%s: failed to exec bzip2 -dc"), v.buf);
#endif
+ case compress_type_lzma:
+ if (fd_in != 0) {
+ m_dup2(fd_in, 0);
+ close(fd_in);
+ }
+ if (fd_out != 1) {
+ m_dup2(fd_out, 1);
+ close(fd_out);
+ }
+ execlp(LZMA, "lzma", "-dc", (char *)0);
+ ohshite(_("%s: failed to exec %s"), v.buf, "lzma -dc");
case CAT:
fd_fd_copy(fd_in, fd_out, -1, _("%s: decompression"), v.buf);
exit(0);
#define TAR "tar"
#define GZIP "gzip"
#define BZIP2 "bzip2"
+#define LZMA "lzma"
#define RM "rm"
#define FIND "find"
#define SHELL "sh"
/*** from compression.c ***/
-enum compression_type { CAT, GZ, BZ2 };
+enum compression_type { CAT, GZ, BZ2, compress_type_lzma };
void decompress_cat(enum compression_type type, int fd_in, int fd_out, char *desc, ...) NONRETURNING;
void compress_cat(enum compression_type type, int fd_in, int fd_out, const char *compression, char *desc, ...) NONRETURNING;
&error(sprintf(_g("Files field contains invalid filename `%s'"), $file))
unless s/^\Q$sourcepackage\E_\Q$baseversion\E(?=[.-])// and
- s/\.(gz|bz2)$//;
+ s/\.(gz|bz2|lzma)$//;
s/^-\Q$revision\E(?=\.)// if length $revision;
&error(sprintf(_g("repeated file type - files `%s' and `%s'"), $seen{$_}, $file)) if $seen{$_};
for my $patch (@patches) {
printf(_g("%s: applying %s")."\n", $progname, $patch);
- if ($patch =~ /\.(gz|bz2)$/) {
+ if ($patch =~ /\.(gz|bz2|lzma)$/) {
&forkgzipread($patch);
*DIFF = *GZIP;
} else {
$c2 == waitpid($c2,0) || &syserr(_g("wait for patch"));
$? && subprocerr("patch");
- &reapgzip if $patch =~ /\.(gz|bz2)$/;
+ &reapgzip if $patch =~ /\.(gz|bz2|lzma)$/;
}
my $now = time;
sub checkdiff
{
my $diff = shift;
- if ($diff =~ /\.(gz|bz2)$/) {
+ if ($diff =~ /\.(gz|bz2|lzma)$/) {
&forkgzipread($diff);
*DIFF = *GZIP;
} else {
}
close(DIFF);
- &reapgzip if $diff =~ /\.(gz|bz2)$/;
+ &reapgzip if $diff =~ /\.(gz|bz2|lzma)$/;
}
sub extracttar {
sub forkgzipread {
local $SIG{PIPE} = 'DEFAULT';
- my $prog = $_[0] =~ /\.gz$/ ? 'gunzip' : 'bunzip2';
+ my $prog;
+
+ if ($_[0] =~ /\.gz$/) {
+ $prog = 'gunzip';
+ } elsif ($_[0] =~ /\.bz2$/) {
+ $prog = 'bunzip2';
+ } elsif ($_[0] =~ /\.lzma$/) {
+ $prog = 'unlzma';
+ } else {
+ &error(sprintf(_g("unknown compression type on file %s"), $_[0]));
+ }
+
open(GZIPFILE,"< $_[0]") || &syserr(sprintf(_g("read file %s"), $_[0]));
pipe(GZIP,GZIPWRITE) || &syserr(sprintf(_g("pipe for %s"), $prog));
defined($cgz= fork) || &syserr(sprintf(_g("fork for %s"), $prog));