# [PATCH] ci: use sudo when replacing dirname

3 messages from 2026-11-29 to 2026-11-29. Participants: Alessio Attilio via GitGitGadget, Todd Zullinger, ATTILIO ALESSIO.
Thread: https://gitlist.dev/t/66953

## Alessio Attilio via GitGitGadget, 2026-11-29 17:48

Subject: [PATCH] ci: use sudo when replacing dirname
Message-ID: <pull.2335.git.1795974509492.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.2335.git.1795974509492.gitgitgadget%40gmail.com

```
From: Alessio Attilio <attilio.alessio@protonmail.com>

Ubuntu 26.04 already provides /usr/bin/dirname. The dependency
installer replaces it with gnudirname to work around a bug in
uutils, but needs elevated privileges to replace the existing file.

Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
---
    ci: use sudo when replacing dirname

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2335%2Fkairosci%2Fattilio%2Fci-dirname-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2335/kairosci/attilio/ci-dirname-fix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2335

 ci/install-dependencies.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index 10c3530d1a..fc506c436d 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -84,7 +84,7 @@ ubuntu-*|i386/ubuntu-*|debian-*)
 	# See <https://github.com/uutils/coreutils/issues/10508>.
 	if test -x /usr/bin/gnudirname
 	then
-		ln -sfT /usr/bin/gnudirname /usr/bin/dirname
+		sudo ln -sfT /usr/bin/gnudirname /usr/bin/dirname
 	fi
 
 	case "$distro" in

base-commit: 1630431f326e15fcde608827b5ff38422528eb59
-- 
gitgitgadget


```

## Todd Zullinger, 2026-11-29 17:59

Subject: Re: [PATCH] ci: use sudo when replacing dirname
Message-ID: <20261129175910.bCTHswdq@teonanacatl.net>
URL: https://gitlist.dev/e/20261129175910.bCTHswdq%40teonanacatl.net
In-Reply-To: <pull.2335.git.1795974509492.gitgitgadget@gmail.com>

```
Alessio Attilio via GitGitGadget wrote:
> From: Alessio Attilio <attilio.alessio@protonmail.com>
> 
> Ubuntu 26.04 already provides /usr/bin/dirname. The dependency
> installer replaces it with gnudirname to work around a bug in
> uutils, but needs elevated privileges to replace the existing file.
> 
> Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
> ---
>     ci: use sudo when replacing dirname
> 
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2335%2Fkairosci%2Fattilio%2Fci-dirname-fix-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2335/kairosci/attilio/ci-dirname-fix-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/2335
> 
>  ci/install-dependencies.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
> index 10c3530d1a..fc506c436d 100755
> --- a/ci/install-dependencies.sh
> +++ b/ci/install-dependencies.sh
> @@ -84,7 +84,7 @@ ubuntu-*|i386/ubuntu-*|debian-*)
>  	# See <https://github.com/uutils/coreutils/issues/10508>.
>  	if test -x /usr/bin/gnudirname
>  	then
> -		ln -sfT /usr/bin/gnudirname /usr/bin/dirname
> +		sudo ln -sfT /usr/bin/gnudirname /usr/bin/dirname
>  	fi
>  
>  	case "$distro" in
> 
> base-commit: 1630431f326e15fcde608827b5ff38422528eb59

Wasn't this already done at the beginning of the month in
c9d34aed3f (install-dependencies: work around a permission
problem, 2026-11-01)?

-- 
Todd


```

## ATTILIO ALESSIO, 2026-11-29 18:32

Subject: Re: [PATCH] ci: use sudo when replacing dirname
Message-ID: <3M4_PTHt_xz18nUj6fYeFumshiA5K5YfRHTnbjkY_gMdGF0ggbJr95P-KrgYVUsw1GPUw10FfXRYeEqI0qRCZ7NknpBF-9c2iVD0UI7iedY=@protonmail.com>
URL: https://gitlist.dev/e/3M4_PTHt_xz18nUj6fYeFumshiA5K5YfRHTnbjkY_gMdGF0ggbJr95P-KrgYVUsw1GPUw10FfXRYeEqI0qRCZ7NknpBF-9c2iVD0UI7iedY%3D%40protonmail.com
In-Reply-To: <20261129175910.bCTHswdq@teonanacatl.net>

```

> Wasn't this already done at the beginning of the month in
> c9d34aed3f (install-dependencies: work around a permission
> problem, 2026-11-01)?
> 

> --
> Todd
> 


Oops, my branch was behind master and I missed that commit; sorry for the noise!

Alessio
```
