From: Stefano Lattarini Date: Sun, 1 Jan 2012 18:06:00 +0000 (+0100) Subject: tests: fix spurious failure of 'get-sysconf.test' X-Git-Tag: ng-0.5a~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=104f3027a7f0d0d4dc0f01e786f7deec9707a863;p=thirdparty%2Fautomake.git tests: fix spurious failure of 'get-sysconf.test' * tests/get-sysconf.test: Do not assume that a ChangeLog file exists in $(srcdir): now that the ChangeLog is autogenerated and not under version control anymore, this is not necessary true. Instead, if we are running from a git checkout, use "git log" to get information on the version of the automake snapshot being tested (and fall back on extracting the first ChangeLog entry otherwise). Reported by Jim Meyering in automake bug#10418. --- diff --git a/tests/get-sysconf.test b/tests/get-sysconf.test index fe78d7090..039a4369a 100755 --- a/tests/get-sysconf.test +++ b/tests/get-sysconf.test @@ -23,7 +23,19 @@ . ./defs || Exit 1 st=0 -sed 20q "$top_testsrcdir/ChangeLog" || st=1 +if test -d "$top_testsrcdir"/.git; then + # We are running from a git checkout. + git log -1 || st=1 +else + # We are probably running from a distribution tarball, so + # the ChangeLog file must be present. + awk ' + BEGIN { first = 1 } + (first == 1) { print; first = 0; next; } + /^[^\t]/ { exit(0); } + { print } + ' "$top_testsrcdir"/ChangeLog || st=1 +fi $PERL -V || st=1 cat "$top_testbuilddir/config.log" || st=1 cat "$testbuilddir/aclocal-$APIVERSION" || st=1