]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: ubuntu: use GNU coreutils for dirname
authorColin Stagner <ask+git@howdoi.land>
Sat, 7 Feb 2026 04:27:03 +0000 (22:27 -0600)
committerJunio C Hamano <gitster@pobox.com>
Sat, 7 Feb 2026 04:58:44 +0000 (20:58 -0800)
The uutils version of `dirname` has output that is inconsistent
with GNU coreutils. Prefer the GNU implementation of this command.

Signed-off-by: Colin Stagner <ask+git@howdoi.land>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ci/install-dependencies.sh

index 6ee8216a05e1276cf8fb81f95cc99336aab559d9..c55441d9df91fd57a8252f44baf391b08681ec1f 100755 (executable)
@@ -76,6 +76,17 @@ ubuntu-*|i386/ubuntu-*|debian-*)
                sudo update-alternatives --set sudo /usr/bin/sudo.ws
        fi
 
+       # on uutils v0.2.2 from rust-coreutils,
+       #     dirname "foo/."
+       # outputs "." instead of "foo" like it should.
+       # Use GNU coreutils to provide dirname instead.
+       #
+       # See <https://github.com/uutils/coreutils/issues/10508>.
+       if test -x /usr/bin/gnudirname
+       then
+               ln -sfT /usr/bin/gnudirname /usr/bin/dirname
+       fi
+
        case "$distro" in
        ubuntu-*)
                mkdir --parents "$CUSTOM_PATH"