Package: debhelper
Version: 9.20120608
Severity: wishlist
Tags: patch

Hi,

 To apply xz compression, this patch make checking easier which option is
 appropriate by generate package with each option - 1, 6, 9, 1e, 6e and 9e.

 Its concept implementation, I'm perl beginner, so probably code is something
 wrong ;) However you'll understand my intention...

 Anyway, check it, thanks.



diff -Nru debhelper-9.20120608/Debian/Debhelper/Dh_Lib.pm 
debhelper-9.20120608+nmu1/Debian/Debhelper/Dh_Lib.pm
--- debhelper-9.20120608/Debian/Debhelper/Dh_Lib.pm     2012-03-27 
01:34:26.000000000 +0900
+++ debhelper-9.20120608+nmu1/Debian/Debhelper/Dh_Lib.pm        2012-08-16 
21:10:03.000000000 +0900
@@ -96,6 +96,14 @@
        if (! exists $dh{ERROR_HANDLER} || ! defined $dh{ERROR_HANDLER}) {
                $dh{ERROR_HANDLER}='exit \$?';
        }
+       
+       # Check to see if DH_COMPRESS_COMPARE environment variable was set, if 
so,
+       # make sure verbose is on.
+       # This DH_COMPRESS_COMPARE environment variable makes several packages 
with
+       # different parameter from same source.
+       if (defined $ENV{DH_COMPRESS_COMPARE} && $ENV{DH_COMPRESS_COMPARE} ne 
"") {
+               $dh{COMPRESS_COMPARE}=1;
+       }
 }
 
 # Run at exit. Add the command to the log files for the packages it acted
diff -Nru debhelper-9.20120608/debian/changelog 
debhelper-9.20120608+nmu1/debian/changelog
--- debhelper-9.20120608/debian/changelog       2012-06-09 02:15:58.000000000 
+0900
+++ debhelper-9.20120608+nmu1/debian/changelog  2012-08-16 21:11:12.000000000 
+0900
@@ -1,3 +1,12 @@
+debhelper (9.20120608+nmu1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Debian/Debhelper/Dh_Lib.pm, dh_builddeb
+    - add DH_COMPRESS_COMPARE option. It will generate packages with several
+      compress option.
+
+ -- Hideki Yamane <[email protected]>  Wed, 08 Aug 2012 21:22:29 +0900
+
 debhelper (9.20120608) unstable; urgency=low
 
   * dh: When there's an -indep override target without -arch, or vice versa,
diff -Nru debhelper-9.20120608/dh_builddeb debhelper-9.20120608+nmu1/dh_builddeb
--- debhelper-9.20120608/dh_builddeb    2012-05-14 02:29:05.000000000 +0900
+++ debhelper-9.20120608+nmu1/dh_builddeb       2012-08-16 21:46:37.000000000 
+0900
@@ -66,6 +66,11 @@
        $dh{FILENAME}="/$dh{FILENAME}";
 }
 
+if (! defined $dh{COMPRESS_COMPARE}) {
+       $dh{COMPRESS_COMPARE}='';
+}
+
+
 my $max_procs=get_buildoption("parallel") || 1;
 
 my $processes=1;
@@ -104,16 +109,31 @@
                                foreach split(":", $ENV{DH_ALWAYS_EXCLUDE});
                }
        }
-       if (! is_udeb($package)) {
+       if (! is_udeb($package) && ! $dh{COMPRESS_COMPARE}) {
                doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, 
$dh{DESTDIR}.$dh{FILENAME});
        }
+       elsif (! is_udeb($package)) {
+               my @compress_list=("xz1", "xz6", "xz9", "xz1_e", "xz6_e", 
"xz9_e");
+               foreach (@compress_list) {
+                       if (! -d $dh{DESTDIR}."/".$_) {
+                               mkdir ($dh{DESTDIR}."/".$_,);
+                       }
+               }
+               doit("dpkg-deb", "-z9", "--build", $tmp, 
$dh{DESTDIR}.$dh{FILENAME});
+               doit("dpkg-deb", "-z1", "-Zxz", "--build", $tmp, 
$dh{DESTDIR}."/xz1".$dh{FILENAME});
+               doit("dpkg-deb", "-z6", "-Zxz", "--build", $tmp, 
$dh{DESTDIR}."/xz6".$dh{FILENAME});
+               doit("dpkg-deb", "-z9", "-Zxz", "--build", $tmp, 
$dh{DESTDIR}."/xz9".$dh{FILENAME});
+               doit("dpkg-deb", "-z1", "-Zxz", "-Sextreme", "--build", $tmp, 
$dh{DESTDIR}."/xz1_e".$dh{FILENAME});
+               doit("dpkg-deb", "-z6", "-Zxz", "-Sextreme", "--build", $tmp, 
$dh{DESTDIR}."/xz6_e".$dh{FILENAME});
+               doit("dpkg-deb", "-z9", "-Zxz", "-Sextreme", "--build", $tmp, 
$dh{DESTDIR}."/xz9_e".$dh{FILENAME});
+       }
        else {
                my $filename=$dh{FILENAME};
                if (! $filename) {
                        $filename="/".udeb_filename($package);


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to