Jim Meyering <jim <at> meyering.net> writes: > Once most of your infrastructure improvements are in gnulib, > would you please write a brief summary to go in NEWS > for the upcoming coreutils-7.7 release? >
How about the following? I still want to get my symlink module in first, but that should happen within the next 24 hours. >From 6a3f1d2c746f9520f25ff07fb9f4c7387fbb0978 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Tue, 22 Sep 2009 15:03:02 -0600 Subject: [PATCH 1/2] readlink: pick up gnulib changes to readlink -f * bootstrap.conf (obsolete_gnulib_modules): Move rename... (gnulib_modules): ...here. Add symlink. * NEWS: Document the change in readlink. * doc/coreutils.texi (readlink invocation): Likewise. * tests/readlink/can-f: Update test to new semantics, and add test of loop. --- NEWS | 4 ++++ bootstrap.conf | 3 ++- doc/coreutils.texi | 6 ++++-- gnulib | 2 +- tests/readlink/can-f | 36 ++++++++++++++++++++++++++---------- 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index 270aa85..35c4966 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,10 @@ GNU coreutils NEWS -*- outline -*- ** Changes in behavior + canonicalize -f now ignores a trailing slash when deciding if the + last component (possibly via a dangling symlink) can be created, + since mkdir will succeed in that case. + id no longer prints SELinux " context=..." when the POSIXLY_CORRECT environment variable is set. diff --git a/bootstrap.conf b/bootstrap.conf index fb5ed15..d1dc128 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -31,7 +31,6 @@ obsolete_gnulib_modules=' memcpy memmove memset - rename strcspn strtod strtol @@ -177,6 +176,7 @@ gnulib_modules=" readutmp realloc regex + rename rename-dest-slash rmdir root-dev-ino @@ -203,6 +203,7 @@ gnulib_modules=" strtoimax strtoumax strverscmp + symlink sys_stat timespec tzset diff --git a/doc/coreutils.texi b/doc/coreutils.texi index fa05626..0bfbd56 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -9204,7 +9204,8 @@ readlink invocation @opindex --canonicalize Activate canonicalize mode. If any component of the file name except the last one is missing or unavailable, -...@command{readlink} produces no output and exits with a nonzero exit code. +...@command{readlink} produces no output and exits with a nonzero exit +code. A trailing slash is ignored. @item -e @itemx --canonicalize-existing @@ -9212,7 +9213,8 @@ readlink invocation @opindex --canonicalize-existing Activate canonicalize mode. If any component is missing or unavailable, @command{readlink} produces -no output and exits with a nonzero exit code. +no output and exits with a nonzero exit code. A trailing slash +requires that the name resolve to a directory. @item -m @itemx --canonicalize-missing diff --git a/gnulib b/gnulib index 6c9f1e8..d34f1e7 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 6c9f1e88ada406b65f6b10098b8c9e60c973e614 +Subproject commit d34f1e73508874213f8ac588f7a7d6d8f62854c3 diff --git a/tests/readlink/can-f b/tests/readlink/can-f index 8a000f8..a702ba9 100755 --- a/tests/readlink/can-f +++ b/tests/readlink/can-f @@ -38,6 +38,7 @@ ln -s regfile link1 || framework_failure ln -s subdir link2 || framework_failure ln -s missing link3 || framework_failure ln -s subdir/missing link4 || framework_failure +ln -s link5 link5 || framework_failure cd "$pwd/$tmp/removed" || framework_failure @@ -73,14 +74,14 @@ for p in "" "$pwd/$tmp/"; do v=`readlink -f "${p}subdir/more"` || fail=1 test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1 - v=`readlink -f "${p}./subdir/more/"` && fail=1 - test -z "$v" || fail=1 + v=`readlink -f "${p}./subdir/more/"` || fail=1 + test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1 v=`readlink -f "${p}missing"` || fail=1 test "$v" = "$my_pwd/$tmp/missing" || fail=1 - v=`readlink -f "${p}./missing/"` && fail=1 - test -z "$v" || fail=1 + v=`readlink -f "${p}./missing/"` || fail=1 + test "$v" = "$my_pwd/$tmp/missing" || fail=1 v=`readlink -f "${p}missing/more"` && fail=1 test -z "$v" || fail=1 @@ -109,8 +110,8 @@ for p in "" "$pwd/$tmp/"; do v=`readlink -f "${p}link2/more"` || fail=1 test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1 - v=`readlink -f "${p}./link2/more/"` && fail=1 - test -z "$v" || fail=1 + v=`readlink -f "${p}./link2/more/"` || fail=1 + test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1 v=`readlink -f "${p}link2/more/more2"` && fail=1 test -z "$v" || fail=1 @@ -121,8 +122,8 @@ for p in "" "$pwd/$tmp/"; do v=`readlink -f "${p}link3"` || fail=1 test "$v" = "$my_pwd/$tmp/missing" || fail=1 - v=`readlink -f "${p}./link3/"` && fail=1 - test -z "$v" || fail=1 + v=`readlink -f "${p}./link3/"` || fail=1 + test "$v" = "$my_pwd/$tmp/missing" || fail=1 v=`readlink -f "${p}link3/more"` && fail=1 test -z "$v" || fail=1 @@ -133,11 +134,26 @@ for p in "" "$pwd/$tmp/"; do v=`readlink -f "${p}link4"` || fail=1 test "$v" = "$my_pwd/$tmp/subdir/missing" || fail=1 - v=`readlink -f "${p}./link4/"` && fail=1 - test -z "$v" || fail=1 + v=`readlink -f "${p}./link4/"` || fail=1 + test "$v" = "$my_pwd/$tmp/subdir/missing" || fail=1 v=`readlink -f "${p}link4/more"` && fail=1 test -z "$v" || fail=1 + + v=`readlink -f "${p}./link4/more"` && fail=1 + test -z "$v" || fail=1 + + v=`readlink -f "${p}link5"` && fail=1 + test -z "$v" || fail=1 + + v=`readlink -f "${p}./link5/"` && fail=1 + test -z "$v" || fail=1 + + v=`readlink -f "${p}link5/more"` && fail=1 + test -z "$v" || fail=1 + + v=`readlink -f "${p}./link5/more"` && fail=1 + test -z "$v" || fail=1 done Exit $fail -- 1.6.1.2 >From fe1d1fa75c45c00ae4d2422b3cbb83ed9d97e6c9 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Tue, 22 Sep 2009 15:07:50 -0600 Subject: [PATCH 2/2] maint: summarize gnulib changes * NEWS: Provide a blurb about recent gnulib improvements. --- NEWS | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index 35c4966..a5f057b 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,13 @@ GNU coreutils NEWS -*- outline -*- when the color of a more specific type is disabled. [bug introduced in coreutils-5.90] +** Portability + + On Solaris 9, many commands would mistakenly treat file/ the same as + file. Now, even on such a system, path resolution obeys the POSIX + rules that a trailing slash ensures that the preceeding name is a + directory or a symlink to a directory. + ** Changes in behavior canonicalize -f now ignores a trailing slash when deciding if the -- 1.6.1.2