Package: devscripts
Version: 2.15.1
Severity: normal

Prior to this patch, the output of debdiff is like this:

    $ debdiff first.deb second.deb
    [The following lists of changes regard files as different if they have
    different names, permissions or owners.]

    Files in second .deb but not in first
    -------------------------------------
    .....

    Files in first .deb but not in second
    -------------------------------------
    .....

    Control files: lines which differ (wdiff format)
    ------------------------------------------------
    Installed-Size: [-1557-] {+1441+}
    Provides: [-provides_first,-] {+provides_second,+}

Here we list (in order)

- files present in the 2nd package
- files present in the 1st package
- (in a wdiff) the fields in the 1st package
- (in a wdiff) the fields in the 2nd package

This swap of data ordering is confusing. It would make much more sense to output
1st,2nd,1st,2nd instead of 2nd,1st,1st,2nd. This patch makes this switch


>From 43c67b546121ecb40950ad2e8d95648fccf7d61f Mon Sep 17 00:00:00 2001
From: Dima Kogan <[email protected]>
Date: Fri, 30 Oct 2015 21:17:43 -0700
Subject: [PATCH] debdiff: print files in the FIRST package before the SECOND
 package

Prior to this patch, the output of debdiff is like this:

    $ debdiff first.deb second.deb
    [The following lists of changes regard files as different if they have
    different names, permissions or owners.]

    Files in second .deb but not in first
    -------------------------------------
    .....

    Files in first .deb but not in second
    -------------------------------------
    .....

    Control files: lines which differ (wdiff format)
    ------------------------------------------------
    Installed-Size: [-1557-] {+1441+}
    Provides: [-provides_first,-] {+provides_second,+}

Here we list (in order)

- files present in the 2nd package
- files present in the 1st package
- (in a wdiff) the fields in the 1st package
- (in a wdiff) the fields in the 2nd package

This swap of data ordering is confusing. It would make much more sense to output
1st,2nd,1st,2nd instead of 2nd,1st,1st,2nd. This patch makes this switch
---
 scripts/debdiff.pl | 39 +++++++++++++++++++--------------------
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/scripts/debdiff.pl b/scripts/debdiff.pl
index a39b594..6873a87 100755
--- a/scripts/debdiff.pl
+++ b/scripts/debdiff.pl
@@ -770,12 +770,6 @@ my (@deblosses, @debgains);
 }
 
 if ($show_moved and $type ne 'deb') {
-    if (@debgains) {
-	my $msg = "Warning: these package names were in the second list but not in the first:";
-	print $msg, "\n", '-' x length $msg, "\n";
-	print join("\n",@debgains), "\n\n";
-    }
-
     if (@deblosses) {
 	print "\n" if @debgains;
 	my $msg = "Warning: these package names were in the first list but not in the second:";
@@ -783,6 +777,12 @@ if ($show_moved and $type ne 'deb') {
 	print join("\n",@deblosses), "\n\n";
     }
 
+    if (@debgains) {
+	my $msg = "Warning: these package names were in the second list but not in the first:";
+	print $msg, "\n", '-' x length $msg, "\n";
+	print join("\n",@debgains), "\n\n";
+    }
+
     # We start by determining which files are in the first set of debs, the
     # second set of debs or both.
     my %files;
@@ -892,19 +892,6 @@ if ($show_moved and $type ne 'deb') {
 	print "[The following lists of changes regard files as different if they have\ndifferent names, permissions or owners.]\n\n";
     }
 
-    if (@gains) {
-	my $msg;
-	if ($type eq 'debs') {
-	    $msg = "Files in second set of .debs but not in first";
-	} else {
-	    $msg = sprintf "Files in second .%s but not in first",
-		    $type eq 'deb' ? 'deb' : 'changes';
-	}
-	print $msg, "\n", '-' x length $msg, "\n";
-	print join("\n",@gains), "\n";
-	$exit_status = 1;
-    }
-
     if (@losses) {
 	print "\n" if @gains;
 	my $msg;
@@ -918,7 +905,19 @@ if ($show_moved and $type ne 'deb') {
 	print join("\n",@losses), "\n";
 	$exit_status = 1;
     }
-}
+
+    if (@gains) {
+	my $msg;
+	if ($type eq 'debs') {
+	    $msg = "Files in second set of .debs but not in first";
+	} else {
+	    $msg = sprintf "Files in second .%s but not in first",
+		    $type eq 'deb' ? 'deb' : 'changes';
+	}
+	print $msg, "\n", '-' x length $msg, "\n";
+	print join("\n",@gains), "\n";
+	$exit_status = 1;
+    }}
 
 # We compare the control files (at least the dependency fields)
 if (defined $singledeb[1] and defined $singledeb[2]) {
-- 
2.1.4

_______________________________________________
devscripts-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel

Reply via email to