I did:
> 2024-03-17  Bruno Haible  <br...@clisp.org>
> 
>       gnulib-tool: Add undocumented option --gnulib-dir.

Two more tweaks are needed for the test suite:


2024-03-19  Bruno Haible  <br...@clisp.org>

        gnulib-tool: Make it work in the test suite.
        * gnulib-tool.sh (gnulib_dir): Make absolute.
        (func_create_megatestdir): If .git/refs/heads/master does not exist, use
        ChangeLog instead.
        * pygnulib/main.py (main): Make gnulib_dir absolute.
        * pygnulib/GLTestDir.py (GLMegaTestDir.execute): If
        .git/refs/heads/master does not exist, use ChangeLog instead.

diff --git a/gnulib-tool.sh b/gnulib-tool.sh
index 96869f80d6..c4b9bc5909 100755
--- a/gnulib-tool.sh
+++ b/gnulib-tool.sh
@@ -1529,6 +1529,7 @@ func_determine_path_separator
       # Undocumented option. Only used for the gnulib-tool test suite.
       --gnulib-dir=* )
         gnulib_dir=`echo "X$1" | sed -e 's/^X--gnulib-dir=//'`
+        gnulib_dir=`cd "$gnulib_dir" && pwd`
         shift ;;
       -- )
         # Stop option processing
@@ -7098,6 +7099,7 @@ func_create_megatestdir ()
 
   # Create autobuild.
   cvsdate=`vc_witness="$gnulib_dir/.git/refs/heads/master"; \
+           test -f "$vc_witness" || vc_witness="$gnulib_dir/ChangeLog"
            sh "$gnulib_dir/build-aux/mdate-sh" "$vc_witness" \
              | sed -e 's,January,01,'   -e 's,Jan,01,' \
                    -e 's,February,02,'  -e 's,Feb,02,' \
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py
index 6c3aeceb58..c450f74099 100644
--- a/pygnulib/GLTestDir.py
+++ b/pygnulib/GLTestDir.py
@@ -960,6 +960,8 @@ class GLMegaTestDir(object):
         repdict['Nov'] = repdict['November'] = '11'
         repdict['Dec'] = repdict['December'] = '12'
         vc_witness = joinpath(DIRS['root'], '.git', 'refs', 'heads', 'master')
+        if not isfile(vc_witness):
+            vc_witness = joinpath(DIRS['root'], 'ChangeLog')
         mdate_sh = joinpath(DIRS['root'], 'build-aux', 'mdate-sh')
         args = ['sh', mdate_sh, vc_witness]
         cvsdate = sp.check_output(args).decode("UTF-8").strip()
diff --git a/pygnulib/main.py b/pygnulib/main.py
index 5042cd3c82..b893977f50 100644
--- a/pygnulib/main.py
+++ b/pygnulib/main.py
@@ -473,7 +473,7 @@ def main():
     # Handle --gnulib-dir and finalize DIRS.
     gnulib_dir = cmdargs.gnulib_dir
     if gnulib_dir != None:
-        gnulib_dir = gnulib_dir[0]
+        gnulib_dir = os.path.abspath(gnulib_dir[0])
     else:
         gnulib_dir = APP['root']
     constants.init_DIRS(gnulib_dir)




Reply via email to