[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dpkg 1.13.24 hint and next upload



Hi,

I'd like to request a hint for dpkg 1.13.24, given that 36 days have
passed, 1.13.23 was an approved upload by the RMs, and .24 was an
upload to fix a regression in .23.

Regarding the next and supposedly last dpkg upload before the release,
I'd like to ask for permission to include two patches, in addition to
the l10n and documentation fixes.


The first patch is the one from Brendan O'Dea, that I reverted prior
to uploading .23.

  * Require POSIX inside subprocerr in controllib.pl. Closes: #390636


The other one is to add lzma uncompressing support to dpkg and dpkg-dev,
so that the archive can start accepting this kind of packages for lenny,
otherwise we'd have to wait until lenny+1. I've been reluctant to
add this, as the lzma's CLI was not compatible with gzip, which is now
fixed and because supposedly the file format was going to change and
it was not clear if backwards compatibility would be preserved,
upstream clarified to me that the new versions are going to be able
to extract the old format.

  * Support extracting lzma compressed source and binary packages,
    and add a Suggests on package lzma. Closes: #347715

I've produced a patch for apt as well. Michael, would you accept it?
and RMs would an apt upload be fine as well for this?


There was another patch I wanted to push for etch (the armel arch
support), but it's too intrusive and modifies the ostable, something
I don't want to do right now, and armel is not really needed in etch,
so I'm postponing that one for lenny, I may just include some comment
on the file itself, noting that the format will change in the future.


The detailed ChangeLog entries and the patches themselves can be found
attached, also a small script to test the lzma compressed .deb:s.


Translators: About the new strings, there's one for dpkg-dev, which
could be translated, given that we have just two translations, and
another one for dpkg, for which I think I'm just not going to update
its master pot file, and delay that for lenny.

regards,
guillem
debian/changelog:
  * Require POSIX inside subprocerr in controllib.pl. Closes: #390636

ChangeLog:
2006-10-03  Brendan O'Dea  <bod@debian.org>

        * scripts/controllib.pl (subprocerr): Require POSIX for WIFEXITED,
        WEXITSTATUS, WIFSIGNALED and WTERMSIG.


Index: scripts/controllib.pl
===================================================================
--- scripts/controllib.pl	(revision 540)
+++ scripts/controllib.pl	(revision 541)
@@ -430,12 +430,13 @@
 
 sub subprocerr {
     local ($p) = @_;
-    if (WIFEXITED($?)) {
+    require POSIX;
+    if (POSIX::WIFEXITED($?)) {
         die sprintf(_g("%s: failure: %s gave error exit status %s"),
-                    $progname, $p, WEXITSTATUS($?))."\n";
-    } elsif (WIFSIGNALED($?)) {
+                    $progname, $p, POSIX::WEXITSTATUS($?))."\n";
+    } elsif (POSIX::WIFSIGNALED($?)) {
         die sprintf(_g("%s: failure: %s died from signal %s"),
-                    $progname, $p, WTERMSIG($?))."\n";
+                    $progname, $p, POSIX::WTERMSIG($?))."\n";
     } else {
         die sprintf(_g("%s: failure: %s failed with unknown exit code %d"),
                     $progname, $p, $?)."\n";
debian/changelog:
  * Support extracting lzma compressed source and binary packages,
    and add a Suggests on package lzma. Closes: #347715

ChangeLog:
2006-11-17  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.



Index: debian/control
===================================================================
--- debian/control	(revision 596)
+++ debian/control	(working copy)
@@ -18,7 +18,7 @@
  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.
Index: scripts/dpkg-source.pl
===================================================================
--- scripts/dpkg-source.pl	(revision 596)
+++ scripts/dpkg-source.pl	(working copy)
@@ -680,7 +680,7 @@
 
 	&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{$_};
@@ -835,7 +835,7 @@
 
     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 {
@@ -855,7 +855,7 @@
         $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;
@@ -1138,7 +1138,7 @@
 sub checkdiff
 {
     my $diff = shift;
-    if ($diff =~ /\.(gz|bz2)$/) {
+    if ($diff =~ /\.(gz|bz2|lzma)$/) {
 	&forkgzipread($diff);
 	*DIFF = *GZIP;
     } else {
@@ -1212,7 +1212,7 @@
     }
     close(DIFF);
     
-    &reapgzip if $diff =~ /\.(gz|bz2)$/;
+    &reapgzip if $diff =~ /\.(gz|bz2|lzma)$/;
 }
 
 sub extracttar {
@@ -1307,7 +1307,18 @@
 
 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));
Index: lib/compression.c
===================================================================
--- lib/compression.c	(revision 596)
+++ lib/compression.c	(working copy)
@@ -90,6 +90,17 @@
       }
       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);
Index: lib/dpkg.h
===================================================================
--- lib/dpkg.h	(revision 596)
+++ lib/dpkg.h	(working copy)
@@ -139,6 +139,7 @@
 #define TAR		"tar"
 #define GZIP		"gzip"
 #define BZIP2		"bzip2"
+#define LZMA		"lzma"
 #define RM		"rm"
 #define FIND		"find"
 #define SHELL		"sh"
@@ -373,7 +374,7 @@
 
 /*** 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;
Index: dpkg-deb/dpkg-deb.h
===================================================================
--- dpkg-deb/dpkg-deb.h	(revision 596)
+++ dpkg-deb/dpkg-deb.h	(working copy)
@@ -45,6 +45,8 @@
 #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/       "
 
Index: dpkg-deb/extract.c
===================================================================
--- dpkg-deb/extract.c	(revision 596)
+++ dpkg-deb/extract.c	(working copy)
@@ -157,6 +157,10 @@
 		     !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;
#!/bin/sh

deb=$1
comp=${2:-lzma}

d=data.tar

if ! [ -r "$deb" ]; then
  echo "error: cannot find .deb '$deb'"
  exit 1
fi

ar x $deb $d.gz
gunzip $d.gz
$comp -9 $d
ar ra $d.gz $deb $d.lzma
ar d $deb $d.gz

rm -f $d.lzma

--- apt-inst/deb/debfile.cc	2006-03-02 16:06:31.000000000 +0200
+++ apt-inst/deb/debfile.cc	2006-11-03 05:29:03.000000000 +0200
@@ -48,8 +48,10 @@ debDebFile::debDebFile(FileFd &File) : F
       return;
    }
 
-   if (!CheckMember("data.tar.gz") && !CheckMember("data.tar.bz2")) {
-      _error->Error(_("This is not a valid DEB archive, it has no '%s' or '%s' member"), "data.tar.gz", "data.tar.bz2");
+   if (!CheckMember("data.tar.gz") &&
+       !CheckMember("data.tar.bz2") &&
+       !CheckMember("data.tar.lzma")) {
+      _error->Error(_("This is not a valid DEB archive, it has no '%s', '%s' or '%s' member"), "data.tar.gz", "data.tar.bz2", "data.tar.lzma");
       return;
    }
 }
@@ -134,6 +136,10 @@ bool debDebFile::ExtractArchive(pkgDirSt
       Member = AR.FindMember("data.tar.bz2");
       Compressor = "bzip2";
    }
+   if (Member == 0) {
+      Member = AR.FindMember("data.tar.lzma");
+      Compressor = "lzma";
+   }
    if (Member == 0)
       return _error->Error(_("Internal error, could not locate member"));   
    if (File.Seek(Member->Start) == false)
--- apt-pkg/deb/debsrcrecords.cc	2006-03-02 15:44:28.000000000 +0200
+++ apt-pkg/deb/debsrcrecords.cc	2006-11-03 05:34:32.000000000 +0200
@@ -151,7 +151,7 @@ bool debSrcRecordParser::Files(vector<pk
 	    break;
 	 F.Type = string(F.Path,Tmp+1,Pos-Tmp);
 	 
-	 if (F.Type == "gz" || F.Type == "bz2")
+	 if (F.Type == "gz" || F.Type == "bz2" || F.Type == "lzma")
 	 {
 	    Pos = Tmp-1;
 	    continue;

Reply to: