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

Bug#263757: a few comments about proposed readlink patch



On Wed, Dec 08, 2004 at 12:16:49PM +0100, Francesco Paolo Lovergine wrote:
> Basically the proposed patch needs one more hack:
> If $dir is not a symlink, readlink returns nothing, so:
> 
>     link=`/bin/readlink -f "$dir"`
>     if [ "x$link" != "x" ]; then
>     	dir="$link"
>     fi

Eh, it works fine. readlink returns nothing (and exits 1) if the link is
invalid or the path doesn't exist. If the path is already canonical,
it'll return it as-is.

By the way, you should probably drop the '/bin/' part, in Debian scripts
one does not qualify commands in general.

--Jeroen

-- 
Jeroen van Wolffelaar
Jeroen@wolffelaar.nl (also for Jabber & MSN; ICQ: 33944357)
http://Jeroen.A-Eskwadraat.nl



Reply to: