瀏覽代碼

Use xz-utils instead of lzma for the lzma compression format

We avoid unneeded dependencies on lzma in dpkg and dpk-dev.
Guillem Jover 16 年之前
父節點
當前提交
54be54799f
共有 5 個文件被更改,包括 8 次插入7 次删除
  1. 2 0
      debian/changelog
  2. 2 2
      debian/control
  3. 2 2
      lib/dpkg/compress.c
  4. 0 1
      lib/dpkg/compress.h
  5. 2 2
      scripts/Dpkg/Compression.pm

+ 2 - 0
debian/changelog

@@ -118,6 +118,8 @@ dpkg (1.15.6) UNRELEASED; urgency=low
   * Add support for xz compressed data.tar member of binary packages. Add
     xz-utils to dpkg's Pre-Depends. Closes: #542160
     Thanks to Jonathan Nieder for the initial patch.
+  * Use xz command to handle lzma compressed files in dpkg and dpkg-dev.
+    This removes the lzma package from both dpkg and dpkg-dev dependencies.
 
   [ Modestas Vainius ]
   * Implement symbol patterns (Closes: #563752). From now on, it is possible to

+ 2 - 2
debian/control

@@ -17,7 +17,7 @@ Build-Depends: debhelper (>= 6.0.7), pkg-config, po4a (>= 0.33.1),
 Package: dpkg
 Architecture: any
 Essential: yes
-Pre-Depends: ${shlibs:Depends}, coreutils (>= 5.93-1), lzma, xz-utils
+Pre-Depends: ${shlibs:Depends}, coreutils (>= 5.93-1), xz-utils
 Depends: ${misc:Depends}
 Conflicts: sysvinit (<< 2.82-1), dpkg-iasearch (<< 0.11),
  dpkg-dev (<< 1.14.16), apt (<< 0.7.7), aptitude (<< 0.4.7-1)
@@ -40,7 +40,7 @@ Package: dpkg-dev
 Section: utils
 Priority: optional
 Architecture: all
-Depends: dpkg (>= 1.15.4), perl, bzip2, lzma, xz-utils,
+Depends: dpkg (>= 1.15.4), perl, bzip2, xz-utils,
  patch (>= 2.2-1), make, binutils, libtimedate-perl,
  base-files (>= 5.0.0), ${misc:Depends}
 Recommends: gcc | c-compiler, build-essential, fakeroot, gnupg, gpgv

+ 2 - 2
lib/dpkg/compress.c

@@ -355,7 +355,7 @@ struct compressor compressor_xz = {
 static void DPKG_ATTR_NORET
 decompress_lzma(int fd_in, int fd_out, const char *desc)
 {
-	fd_fd_filter(fd_in, fd_out, desc, LZMA, "-dc", NULL);
+	fd_fd_filter(fd_in, fd_out, desc, XZ, "-dc", "--format=lzma", NULL);
 }
 
 static void DPKG_ATTR_NORET
@@ -364,7 +364,7 @@ compress_lzma(int fd_in, int fd_out, int compress_level, const char *desc)
 	char combuf[6];
 
 	snprintf(combuf, sizeof(combuf), "-c%d", compress_level);
-	fd_fd_filter(fd_in, fd_out, desc, LZMA, combuf, NULL);
+	fd_fd_filter(fd_in, fd_out, desc, XZ, combuf, "--format=lzma", NULL);
 }
 
 struct compressor compressor_lzma = {

+ 0 - 1
lib/dpkg/compress.h

@@ -29,7 +29,6 @@ DPKG_BEGIN_DECLS
 #define GZIP		"gzip"
 #define XZ		"xz"
 #define BZIP2		"bzip2"
-#define LZMA		"lzma"
 
 struct compressor {
 	const char *name;

+ 2 - 2
scripts/Dpkg/Compression.pm

@@ -60,8 +60,8 @@ my $COMP = {
     },
     "lzma" => {
 	"file_ext" => "lzma",
-	"comp_prog" => [ "lzma" ],
-	"decomp_prog" => [ "unlzma" ],
+	"comp_prog" => [ 'xz', '--format=lzma' ],
+	"decomp_prog" => [ 'unxz', '--format=lzma' ],
     },
     "xz" => {
 	"file_ext" => "xz",