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

Re: dpkg 1.16.8



Hi!

On Fri, 2012-08-24 at 03:43:13 +0200, Guillem Jover wrote:
> On Thu, 2012-08-23 at 11:27:44 -0600, TheSin wrote:
> > I was hoping someone might be able to help shed some
> > light on this cause I can not figure out why it's failing and it seems
> > like it's one line behind on every fail.  If there is any more info
> > I can provide pleas let me know I'd like to resolve this ASAP.
> 
> The problem is in the test case which is bogus, now that the test
> suite takes into account the correct paths for some of the executables
> depending on the system, previously they were just hardcoded to match
> the paths on Debian systems, so they sort incorrectly. I've started
> fixing this locally but I'm too tired to finish it up right now, I'll
> post a patch tomorrow so that you can apply it before a release with
> it is made, but for now if it's really urgent I'd recomment just
> commenting the «is()» call inside the “# verify that the administrative
> file is sorted properly“ code block (currently line 263 on git master).

Here's the tentative patch, which I'll probably be applying after
some minor polishing, and once you confirm it works for you. I now
realized there's some other failures due to choice mismatch and mode
mismatch. And I'm guessing those will not be fixed with this patch,
but if you could repost the possible failing «make check» logs, I'll
be looking into them after that.

thanks,
guillem
diff --git a/utils/t/100_update_alternatives.t b/utils/t/100_update_alternatives.t
index 40a5990..4a78677 100644
--- a/utils/t/100_update_alternatives.t
+++ b/utils/t/100_update_alternatives.t
@@ -260,7 +260,8 @@ check_choice(0, "auto", "initial install 3");
     open(FILE, "<", "$admindir/generic-test") or die $!;
     my $content = <FILE>;
     close(FILE);
-    is($content,
+
+    my $expected =
 "auto
 $bindir/generic-test
 slave1
@@ -272,26 +273,28 @@ $bindir/slave3
 slave4
 $bindir/slave4
 
-$paths{false}
-10
-$paths{date}
-
-
-
-$paths{sleep}
-5
-
+";
 
+    my %slaves;
 
+    # Store slaves in a hash to easily retrieve present and missing ones.
+    foreach my $alt (@choices) {
+        foreach my $slave (@{$alt->{slaves}}) {
+            $slaves{$slave->{name}}{$alt->{path}} = $slave;
+        }
+    }
 
-$paths{true}
-20
-$paths{yes}
-$paths{cat}
-$paths{cat}
-$paths{cat}
+    foreach my $alt (sort { $a->{path} cmp $b->{path} } @choices) {
+        $expected .= $alt->{path} . "\n";
+        $expected .= $alt->{priority} . "\n";
+        foreach my $slave_name (sort keys %slaves) {
+            $expected .= $slaves{$slave_name}{$alt->{path}}{path} || "";
+            $expected .= "\n";
+        }
+    }
+    $expected .= "\n";
 
-", "administrative file is as expected");
+    is($content, $expected, "administrative file is as expected");
 }
 
 # manual change with --set-selections

Reply to: