You are not logged in.

#1 2025-11-18 11:30:07

Wateir
Member
Registered: 2024-12-28
Posts: 27

Add package who need /bin/sh to depency of dash after remake symlink

Hello,
https://wiki.archlinux.org/title/Dash i follow this, and make dash the symlink to /bin/sh rather than bash.

The problem is that pacman -R dash let me unsintall it without any issue, where pacman -R bash make me wheel understand that a really bad idea.
How can i had manualy all package who have a script #!/bin/sh script on one of my bin requieres dash as a dependencie.

Something like reinstall them with --asdenpof like discute on this thread https://bbs.archlinux.org/viewtopic.php?id=79026


Btw the command

IFS=:; grep -Irl '#!/bin/sh' $PATH |xargs -r checkbashisms

return some script, but nothing to worry because this same package are use on debian where dash is /bin/sh by default for a bunch of years now, maybe some tips to add ?

Offline

#2 2025-11-18 14:48:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,086

Re: Add package who need /bin/sh to depency of dash after remake symlink

/tmp/PGKBUILD.dash-keeper

pkgname=dash-keeper
pkgver=1
pkgrel=1
pkgdesc='keep dash'
arch=('any')
license=('dwtfyw')
provides=('dash-keeper')
depends=('dash')
PKGEXT=".pkg.tar" makepkg -p /tmp/PGKBUILD.dash-keeper
rm /tmp/PGKBUILD.dash-keeper

Offline

#3 2025-11-19 02:25:59

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Add package who need /bin/sh to depency of dash after remake symlink

Wateir wrote:

How can i had manualy all package who have a script #!/bin/sh script on one of my bin requieres dash as a dependencie

And I bet you have a lot of scripts that think /bin/sh is bash!  Replacing the symlink will be reverted on every bash update.

The simple fix would be to edit the #! in the one script that requires dash.

Offline

#4 2025-11-19 07:58:28

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,086

Re: Add package who need /bin/sh to depency of dash after remake symlink

Allan is mostly right wrote:

Replacing the symlink will be reverted on every bash update.

This is actually addressed in https://wiki.archlinux.org/title/Dash#Relinking_/bin/sh and afaiu the OP they just wants to use dash as default sh; it's not so much that some script would specifically depend on dash (what'd be weird anyway, bash would typically superset dash)

Whether wrt

The OP wrote:

return some script, but nothing to worry because

that's a good idea at all and worth the hassle performance-wise is a fair but different question.

Offline

#5 2025-11-19 10:00:31

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Add package who need /bin/sh to depency of dash after remake symlink

seth wrote:
Allan is mostly right wrote:

Replacing the symlink will be reverted on every bash update.

This is actually addressed in https://wiki.archlinux.org/title/Dash#Relinking_/bin/sh

That is an interesting solution....   A 10 line hook instead of adding one entry to pacman.conf!

I still have concerns about software using /bin/sh but having bashisms, but maybe I am just old and the situation has improved since I last investigated.

Offline

#6 2025-11-19 13:47:30

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,086

Re: Add package who need /bin/sh to depency of dash after remake symlink

I guess it depends on what you're investigating.
There're relevant certainly scripts outside $PATH and checkbashism's will not necessarily figure all non POSIX-compliant stanzas but "performs basic checks on /bin/sh shell scripts for the possible presence of bashisms"
(and otoh dash also has some extensions over POSIX)

But as long as this isn't presenting itself as an xy-problem and the OP deliberately wants to pursue this (for whatever reason) and is ready to accept a false premise and then in doubt shy away, that's not wrong™ to do.
¯\_(ツ)_/¯

Offline

#7 2025-11-19 23:12:43

Wateir
Member
Registered: 2024-12-28
Posts: 27

Re: Add package who need /bin/sh to depency of dash after remake symlink

Sorry for late respond

seth wrote:

/tmp/PGKBUILD.dash-keeper

Already have think about that, but i'm was not quite a fan of this, so i just gonna remember to not remove dash

Allanb wrote:

I still have concerns about software using /bin/sh but having bashisms, but maybe I am just old and the situation has improved since I last investigated.

It's okay, this laptop is use to experiment on the linux word, and it's just some script who have some issue i can always change the shellbang, and on the end gonna learn thing into the journey.

Allanb wrote:

That is an interesting solution....   A 10 line hook instead of adding one entry to pacman.conf!

I'm interrest into this simple line i can add into pacman.conf, for the hook it's okay i learn what a pacman hook is with that.

seth wrote:

that's a good idea at all and worth the hassle performance-wise is a fair but different question.

I'm sorry but i have not understand what you mean here, but i guess my suggestion find a ears to listen to it so it's okay.

Thanks for you're time anyways, always enjoy learn new thing here smile

Offline

#8 2025-11-20 01:28:03

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: Add package who need /bin/sh to depency of dash after remake symlink

Wateir wrote:
Allanb wrote:

That is an interesting solution....   A 10 line hook instead of adding one entry to pacman.conf!

I'm interrest into this simple line i can add into pacman.conf, for the hook it's okay i learn what a pacman hook is with that.

I should have given the line.   This should do the job.

NoExtract = bin/sh

Offline

Board footer

Powered by FluxBB