Преглед изворни кода

dpkg-deb: Add support for “none” as a valid compression strategy value

This is needed to be able to reset the compression strategy if one had
been specified before, otherwise a different compressor would error out
on compressor specific invalid values.

Closes: #674711
Guillem Jover пре 14 година
родитељ
комит
41494c1356
4 измењених фајлова са 9 додато и 5 уклоњено
  1. 2 0
      debian/changelog
  2. 1 1
      dpkg-deb/main.c
  3. 2 0
      lib/dpkg/compress.c
  4. 4 4
      man/dpkg-deb.1

+ 2 - 0
debian/changelog

@@ -37,6 +37,8 @@ dpkg (1.16.4) UNRELEASED; urgency=low
   * Add support for Build-Depends-Arch and Build-Conflicts-Arch fields, and
     a new -A option to dpkg-checkbuilddeps. Closes: #629480
     Thanks to Roger Leigh <rleigh@debian.org>.
+  * Add support for “none” as a valid dpkg-deb compression strategy value.
+    Closes: #674711
 
   [ Updated man page translations ]
   * German (Helge Kreutzmann).

+ 1 - 1
dpkg-deb/main.c

@@ -109,7 +109,7 @@ usage(const struct cmdinfo *cip, const char *value)
 "  -Z<type>                         Set the compression type used when building.\n"
 "                                     Allowed types: gzip, xz, bzip2, none.\n"
 "  -S<strategy>                     Set the compression strategy when building.\n"
-"                                     Allowed values: extreme (xz).\n"
+"                                     Allowed values: none, extreme (xz).\n"
 "\n"));
 
   printf(_(

+ 2 - 0
lib/dpkg/compress.c

@@ -477,6 +477,8 @@ compressor_find_by_extension(const char *extension)
 enum compressor_strategy
 compressor_get_strategy(const char *name)
 {
+	if (strcmp(name, "none") == 0)
+		return compressor_strategy_none;
 	if (strcmp(name, "extreme") == 0)
 		return compressor_strategy_extreme;
 

+ 4 - 4
man/dpkg-deb.1

@@ -3,7 +3,7 @@
 .\" Copyright © 1995-1996 Ian Jackson <ian@chiark.chu.cam.ac.uk>
 .\" Copyright © 1999 Wichert Akkerman <wakkerma@debian.org>
 .\" Copyright © 2006 Frank Lichtenheld <djpig@debian.org>
-.\" Copyright © 2007-2011 Guillem Jover <guillem@debian.org>
+.\" Copyright © 2007-2012 Guillem Jover <guillem@debian.org>
 .\"
 .\" This is free software; you can redistribute it and/or modify
 .\" it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 .\" You should have received a copy of the GNU General Public License
 .\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .
-.TH dpkg\-deb 1 "2011-11-22" "Debian Project" "dpkg suite"
+.TH dpkg\-deb 1 "2012-05-27" "Debian Project" "dpkg suite"
 .SH NAME
 dpkg\-deb \- Debian package archive (.deb) manipulation tool
 .
@@ -223,8 +223,8 @@ equivalent to compressor none for all compressors.
 .TP
 .BI \-S compress-strategy
 Specify which compression strategy to use on the compressor backend, when
-building a package (since dpkg 1.16.2). Allowed value is \fIextreme\fP for
-xz.
+building a package (since dpkg 1.16.2). Allowed value are \fInone\fP (since
+dpkg 1.16.4) and \fIextreme\fP for xz.
 .TP
 .BI \-Z compress-type
 Specify which compression type to use when building a package. Allowed