[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
coreutils readlink 5.2.1 with DVL patch seems to work properly
From: |
Thomas Hood |
Subject: |
coreutils readlink 5.2.1 with DVL patch seems to work properly |
Date: |
Fri, 04 Jun 2004 16:16:07 +0200 |
In April Dmitry V. Levin mentioned[1] that he was making available[2]
a patch for the readlink program in coreutils 5.2.1 that implements
the behavior we have discussed.
1] http://lists.gnu.org/archive/html/bug-coreutils/2004-04/msg00036.html
2] ftp://ftp.altlinux.org/pub/people/ldv/coreutils/
I tested DVL's patch quickly today and found that it works properly.
coreutils-5.2.1.dmitry readlink -e = coreutils-5.0.91 readlink -f
coreutils-5.2.1.dmitry readlink -f = sysvinit-2.85-18 readlink -f
coreutils-5.2.1.dmitry readlink -m = sysvinit-2.85-18 readlink -ff
except that the former never returns nonzero whereas the latter does
(which is good).
Here are the details of my tests. I downloaded coreutils 5.21 from
a GNU mirror and applied DVL's patch to it. I build it on a sid
system.
Then I created a directory /tmp/oo with four symlinks in it:
yestarg -> targ
notarg -> xyzzy
notarg_nodir -> xyzzy/xyzzy
notarg_yesdir -> subdir/xyzzy
plus the file:
targ
and the directory:
subdir
I ran the following script:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/sh
test()
{
OPT="$1"
for ARG in nosuch yestarg notarg notarg_yesdir notarg_nodir ; do
echo "$R -$OPT $ARG:"
$R -$OPT $ARG && echo OK || echo fail
echo
done
echo "------------------------------"
echo
}
R=/bin/readlink
test f
R=/lib/init/readlink
test f
test ff
R=/usr/src/coreutils-5.2.1/src/readlink
test e
test f
test m
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and it generated the following output. Note that /bin/readlink
is the readlink that currently ships with Debian: it is from
coreutils 5.0.91-2. /usr/src/coreutils-5.2.1 is the directory
where I built the DVL-patched readlink program.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/bin/readlink -f nosuch:
fail
/bin/readlink -f yestarg:
/tmp/oo/targ
OK
/bin/readlink -f notarg:
fail
/bin/readlink -f notarg_yesdir:
fail
/bin/readlink -f notarg_nodir:
fail
------------------------------
/lib/init/readlink -f nosuch:
/tmp/oo/nosuch
OK
/lib/init/readlink -f yestarg:
/tmp/oo/targ
OK
/lib/init/readlink -f notarg:
/tmp/oo/xyzzy
OK
/lib/init/readlink -f notarg_yesdir:
/tmp/oo/subdir/xyzzy
OK
/lib/init/readlink -f notarg_nodir:
fail
------------------------------
/lib/init/readlink -ff nosuch:
/tmp/oo/nosuch
OK
/lib/init/readlink -ff yestarg:
/tmp/oo/targ
OK
/lib/init/readlink -ff notarg:
/tmp/oo/xyzzy
OK
/lib/init/readlink -ff notarg_yesdir:
/tmp/oo/subdir/xyzzy
OK
/lib/init/readlink -ff notarg_nodir:
/tmp/oo/xyzzy/xyzzy
fail
------------------------------
/usr/src/coreutils-5.2.1/src/readlink -e nosuch:
fail
/usr/src/coreutils-5.2.1/src/readlink -e yestarg:
/tmp/oo/targ
OK
/usr/src/coreutils-5.2.1/src/readlink -e notarg:
fail
/usr/src/coreutils-5.2.1/src/readlink -e notarg_yesdir:
fail
/usr/src/coreutils-5.2.1/src/readlink -e notarg_nodir:
fail
------------------------------
/usr/src/coreutils-5.2.1/src/readlink -f nosuch:
/tmp/oo/nosuch
OK
/usr/src/coreutils-5.2.1/src/readlink -f yestarg:
/tmp/oo/targ
OK
/usr/src/coreutils-5.2.1/src/readlink -f notarg:
/tmp/oo/xyzzy
OK
/usr/src/coreutils-5.2.1/src/readlink -f notarg_yesdir:
/tmp/oo/subdir/xyzzy
OK
/usr/src/coreutils-5.2.1/src/readlink -f notarg_nodir:
fail
------------------------------
/usr/src/coreutils-5.2.1/src/readlink -m nosuch:
/tmp/oo/nosuch
OK
/usr/src/coreutils-5.2.1/src/readlink -m yestarg:
/tmp/oo/targ
OK
/usr/src/coreutils-5.2.1/src/readlink -m notarg:
/tmp/oo/xyzzy
OK
/usr/src/coreutils-5.2.1/src/readlink -m notarg_yesdir:
/tmp/oo/subdir/xyzzy
OK
/usr/src/coreutils-5.2.1/src/readlink -m notarg_nodir:
/tmp/oo/xyzzy/xyzzy
OK
------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- coreutils readlink 5.2.1 with DVL patch seems to work properly,
Thomas Hood <=