Re: Does leading slash matter in install scriptlets?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Aug 7, 2013 at 8:51 PM, Allan McRae <allan@xxxxxxxxxxxxx> 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.


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux