Le 29 juil. 2012 à 13:24, Akim Demaille a écrit :

>> I prefer to write it this way, putting the less-likely code in the
>> indented clause:  (or testing $? != 0)
>> 
>>       $?
>>         and die "$ME: $qcmd had unexpected exit code or signal ($?)\n"
> 
> Hi Jim!
> 
> Yes, I was annoyed by that too.  Since you allowed the "or die" version,
> which I much prefer (so you can read consistently expected assertions
> rather than a mixture of "must be true" and "must be false"), I installed
> it as follows.

Of course I had to have it wrong in two different ways — I was too eager
to finally be able to release Bison 2.6.1 :(

I nicely misunderstood what you said to turn it into a way I like ("or die"
instead of "and die").  So, should I fix it as attached below, or "and die"?

commit 3f2667cf86d23284b3378ae2c38fd93adba5714f
Author: Akim Demaille <[email protected]>
Date:   Sun Jul 29 13:30:12 2012 +0200

    gitlog-to-changelog: fix previous change
    
    * build-aux/gitlog-to-changelog: Fix condition.
    Add missing ";".

diff --git a/ChangeLog b/ChangeLog
index 6806847..ddd205e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-07-29  Akim Demaille  <[email protected]>
 
+       gitlog-to-changelog: fix previous change
+       * build-aux/gitlog-to-changelog: Fix condition.
+       Add missing ";".
+
+2012-07-29  Akim Demaille  <[email protected]>
+
        gitlog-to-changelog: don't expect .git to be in $srcdir
        Reported by Bruno Haible.
        <http://lists.gnu.org/archive/html/bug-gnulib/2012-07/msg00265.html>
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 60e1c39..5184edc 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -210,8 +210,8 @@ sub git_dir_option($)
       my $git_dir = qx($cmd);
       defined $git_dir
         or die "$ME: cannot run $qcmd: $!\n";
-      $? != 0
-        or die "$ME: $qcmd had unexpected exit code or signal ($?)\n"
+      $? == 0
+        or die "$ME: $qcmd had unexpected exit code or signal ($?)\n";
       chomp $git_dir;
       push @res, "--git-dir=$git_dir/.git";
     }


Reply via email to