[arch-general] Does leading slash matter in install scriptlets?
Many install scriptlets include the leading slash in file paths, e.g. post_install() { update-desktop-database -q gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor } while some strip the leading slash, post_install() { update-desktop-database -q gtk-update-icon-cache -q -t -f usr/share/icons/hicolor } Would this make a difference with `pacman -S --root <path> <pkg>`? If not, is there any case in which it would make a difference?
On 07/08/13 18:35, lolilolicon wrote:
Many install scriptlets include the leading slash in file paths, e.g.
post_install() { update-desktop-database -q gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor }
while some strip the leading slash,
post_install() { update-desktop-database -q gtk-update-icon-cache -q -t -f usr/share/icons/hicolor }
Would this make a difference with `pacman -S --root <path> <pkg>`? If not, is there any case in which it would make a difference?
I believe it possibly did in the past, but pacman chroots into the --root directory before running any scripts so it makes no difference. Allan
On Wed, Aug 7, 2013 at 6:19 PM, Allan McRae <allan@archlinux.org> wrote:
I believe it possibly did in the past, but pacman chroots into the --root directory before running any scripts so it makes no difference.
That's great, seeing that there're so many packages on both sides. Is a leading slash preferred, then?
Allan
On 07/08/13 20:46, lolilolicon wrote:
On Wed, Aug 7, 2013 at 6:19 PM, Allan McRae <allan@archlinux.org> wrote:
I believe it possibly did in the past, but pacman chroots into the --root directory before running any scripts so it makes no difference.
That's great, seeing that there're so many packages on both sides. Is a leading slash preferred, then?
Given it does not matter, there is no preference (at least from me).
On Wed, Aug 7, 2013 at 8:51 PM, Allan McRae <allan@archlinux.org> wrote:
Given it does not matter, there is no preference (at least from me).
Effectively true, but conceptually I think I would prefer an explicit slash, which does not rely on the implicit $PWD == /. Take again the example from my original email, post_install() { update-desktop-database -q gtk-update-icon-cache -q -t -f usr/share/icons/hicolor } Since `update-desktop-database` without a directory specified defaults to /usr/share/applications, the above is equivalent to, post_install() { update-desktop-database -q /usr/share/applications gtk-update-icon-cache -q -t -f usr/share/icons/hicolor } which is not consistent. Therefore, it should be: post_install() { update-desktop-database -q gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor } or, alternatively, consistently remove the leading slash, post_install() { update-desktop-database -q usr/share/applications gtk-update-icon-cache -q -t -f usr/share/icons/hicolor } But since a leading slash doesn't sacrifice any flexibility, I prefer an explicit slash everywhere.
wasn't there going to be a uniform single place for such things happen? Hint: hooks awesomeness. cheers! mar77i
participants (3)
-
Allan McRae
-
lolilolicon
-
Martti Kühne