diff --git a/build-aux/jar-cf b/build-aux/jar-cf index bffd52141..7e5139e76 100755 --- a/build-aux/jar-cf +++ b/build-aux/jar-cf @@ -1,7 +1,7 @@ #!/bin/sh # Creating a Java archive (.jar). -# Copyright (C) 2024 Free Software Foundation, Inc. +# Copyright (C) 2024-2026 Free Software Foundation, Inc. # # This file is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published @@ -40,7 +40,7 @@ Send patches and bug reports to ." func_version () { echo "jar-cf (GNU gettext)" - echo "Copyright (C) 2024 Free Software Foundation, Inc. + echo "Copyright (C) 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law." @@ -94,13 +94,16 @@ top_srcdir="$2" shift shift +# Unset CDPATH. Otherwise, output from 'cd dir' can surprise callers. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + if $jar_program --help 2>&1 | grep '\--date=' >/dev/null; then # The JAR_PROGRAM supports the --date option. Its effect is to set the given # date as time stamp on all the ELEMENTs and also the META-INF/MANIFEST.MF. # Use it, for reproducibility (cf. ). if test -d "$top_srcdir/.git"; then # We are in a git checkout. Use the date of the latest commit. - date=`git log -n 1 --date=iso --format=fuller | sed -n -e 's/^CommitDate: //p' | sed -e 's/ /T/' -e 's/ \(...\)\(..\)$/\1:\2/'` + date=`cd "$top_srcdir" && git log -n 1 --date=iso --format=fuller | sed -n -e 's/^CommitDate: //p' | sed -e 's/ /T/' -e 's/ \(...\)\(..\)$/\1:\2/'` else # We are building from a tarball. # Use the date of the first entry of the ChangeLog file.