Re: [PATCH] tests: initial SMACK tests

2014-05-05 Thread Jarkko Sakkinen
On Sat, May 03, 2014 at 09:18:23PM +0200, Bernhard Voelker wrote:
 On 05/02/2014 09:31 PM, Pádraig Brady wrote:
  I've ameneded as follows and will push later.
 
 Thanks, LGTM.

Alright, thanks guys for the review and fixing my mistakes!

 Have a nice day,
 Berny

/Jarkko



Re: Work-around for bootstrap failure with gettext 0.18.3.1

2014-05-05 Thread Assaf Gordon

On 05/03/2014 05:52 AM, Pádraig Brady wrote:


We wouldn't be wanting the cu-progs.m4 in other projects though,
so we should probably conditionalize that to just $package = coreutils.
It wouldn't be worth adding new hooks for this to generalize.



To clarify: do you mean conditionalize just the cu-progs.m4 part, or the entire 
work-around with $package = coreutils ?




Re: Work-around for bootstrap failure with gettext 0.18.3.1

2014-05-05 Thread Pádraig Brady
On 05/05/2014 06:34 PM, Assaf Gordon wrote:
 On 05/03/2014 05:52 AM, Pádraig Brady wrote:

 We wouldn't be wanting the cu-progs.m4 in other projects though,
 so we should probably conditionalize that to just $package = coreutils.
 It wouldn't be worth adding new hooks for this to generalize.

 
 To clarify: do you mean conditionalize just the cu-progs.m4 part, or the 
 entire work-around with $package = coreutils ?

Just the cu-progs.m4 bit




Re: [PATCH] rename: move command from util-linux to coreutils

2014-05-05 Thread Sami Kerola
On 24 December 2013 22:29, Sami Kerola kerol...@iki.fi wrote:
 This is a resubmission[1][2] of the rename(1), with attempt to move it
 from util-linux package to coreutils.  Various compiler warnings are
 removed, make syntax-check passes, --test option is renamed to --dry-run,
 file list can be wrote to stdin but only if --files0-from is in use.
 AFAIK most of the issues mentioned earlier are sorted, and it is either
 time to get more advice what could be improved, or final reject for the
 proposal to move the command to this project.

 [1] http://lists.gnu.org/archive/html/coreutils/2012-06/threads.html#00021
 [2] http://lists.gnu.org/archive/html/coreutils/2012-07/threads.html#00014

Hello coreutils maintainer(s),

It's been a while since change submission, and I guess no review is the
same thing as final reject.  Getting a formal confirmation reject would
be good to avoid any uncertainty which project hosts the code of the
rename(1).

-- 
Sami Kerola
http://www.iki.fi/kerolasa/



Re: [PATCH] rename: move command from util-linux to coreutils

2014-05-05 Thread Pádraig Brady
On 05/05/2014 08:29 PM, Sami Kerola wrote:
 On 24 December 2013 22:29, Sami Kerola kerol...@iki.fi wrote:
 This is a resubmission[1][2] of the rename(1), with attempt to move it
 from util-linux package to coreutils.  Various compiler warnings are
 removed, make syntax-check passes, --test option is renamed to --dry-run,
 file list can be wrote to stdin but only if --files0-from is in use.
 AFAIK most of the issues mentioned earlier are sorted, and it is either
 time to get more advice what could be improved, or final reject for the
 proposal to move the command to this project.

 [1] http://lists.gnu.org/archive/html/coreutils/2012-06/threads.html#00021
 [2] http://lists.gnu.org/archive/html/coreutils/2012-07/threads.html#00014
 
 Hello coreutils maintainer(s),
 
 It's been a while since change submission, and I guess no review is the
 same thing as final reject.  Getting a formal confirmation reject would
 be good to avoid any uncertainty which project hosts the code of the
 rename(1).

Hi Sami.

So this was first proposed nearly 3 years ago:
http://lists.gnu.org/archive/html/coreutils/2011-06/msg00080.html
There was reluctance then, which for me at least hasn't changed.
The main issue I have is that there are currently 2 existing utils
(prename and rename.ul) presented as the rename command.
Also there is the separate mmv command to provide this functionality.
So I'm not sure that adding another is worth the confusion.
Batch renaming is not really mainstream functionality anyway and
there is also the option of using find | sed | sh as mentioned previously.

If there were no existing tools for this, then we could
consider incorporating into coreutils. However given the current state
of things, I don't think it's appropriate to add to coreutils.
I'm 60:40 against.

sorry,
Pádraig.

p.s. BTW on the interface, --files0-from is used in coreutils
only when we need to process all input in a single invocation,
which is not the case here.  Also the --exec option is run
per file and thus doesn't offer a performance benefit over
separately processing the file list.




[PATCH] tests: improve diagnostics when asserting empty files

2014-05-05 Thread Pádraig Brady
* tests/chmod/c-option.sh: Use `compare /dev/null ... || fail=1`
rather than `test -s ...  fail=1`, so that the file contents
are output, thus improving diagnostics for failing tests.
* tests/cp/cp-a-selinux.sh: Likewise.
* tests/cp/cp-mv-enotsup-xattr.sh: Likewise.
* tests/dd/misc.sh: Likewise.
* tests/misc/nice.sh: Likewise.
* tests/misc/xattr.sh: Likewise.
* tests/mv/update.sh: Likewise.
* tests/rm/deep-2.sh: Likewise.
* tests/rm/read-only.sh: Likewise.
* tests/split/r-chunk.sh: Likewise.
* tests/tail-2/follow-stdin.sh: Likewise.
* tests/tail-2/wait.sh: Likewise.
* tests/touch/no-dereference.sh: Likewise.
---
 tests/chmod/c-option.sh |2 +-
 tests/cp/cp-a-selinux.sh|5 +++--
 tests/cp/cp-mv-enotsup-xattr.sh |8 
 tests/dd/misc.sh|6 +++---
 tests/misc/nice.sh  |2 +-
 tests/misc/xattr.sh |2 +-
 tests/mv/update.sh  |2 +-
 tests/rm/deep-2.sh  |2 +-
 tests/rm/read-only.sh   |2 +-
 tests/split/r-chunk.sh  |2 +-
 tests/tail-2/follow-stdin.sh|2 +-
 tests/tail-2/wait.sh|2 +-
 tests/touch/no-dereference.sh   |4 ++--
 13 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/tests/chmod/c-option.sh b/tests/chmod/c-option.sh
index a1782c3..03e1db9 100755
--- a/tests/chmod/c-option.sh
+++ b/tests/chmod/c-option.sh
@@ -31,7 +31,7 @@ chmod u=rwx $file || fail=1
 chmod -c g=rwx $file  out || fail=1
 chmod -c g=rwx $file  empty || fail=1
 
-test -s empty  fail=1
+compare /dev/null empty || fail=1
 case $(cat out) in
   mode of 'f' changed from 0744 ?rwxr--r--? to 0774 ?rwxrwxr--?) ;;
   *) cat out; fail=1 ;;
diff --git a/tests/cp/cp-a-selinux.sh b/tests/cp/cp-a-selinux.sh
index 3ab7e0e..ca4e8f6 100755
--- a/tests/cp/cp-a-selinux.sh
+++ b/tests/cp/cp-a-selinux.sh
@@ -37,7 +37,8 @@ cp -a c d 2err || framework_failure_
 cp --preserve=context c e || framework_failure_
 cp --preserve=all c f || framework_failure_
 ls -Z d | grep $ctx || fail=1
-test -s err  fail=1   #there must be no stderr output for -a
+# there must be no stderr output for -a
+compare /dev/null err || fail=1
 ls -Z e | grep $ctx || fail=1
 ls -Z f | grep $ctx || fail=1
 
@@ -116,7 +117,7 @@ echo  g || 
framework_failure_
 # succeed (giving no diagnostics), yet leaving the destination file empty.
 cp -a f g 2err || fail=1
 test -s g   || fail=1 # The destination file must not be empty.
-test -s err  fail=1 # There must be no stderr output.
+compare /dev/null err || fail=1
 
 # =
 # Here, we expect cp to succeed and not warn with Operation not supported
diff --git a/tests/cp/cp-mv-enotsup-xattr.sh b/tests/cp/cp-mv-enotsup-xattr.sh
index d711683..6c8fa83 100755
--- a/tests/cp/cp-mv-enotsup-xattr.sh
+++ b/tests/cp/cp-mv-enotsup-xattr.sh
@@ -69,19 +69,19 @@ grep -F $xattr_pair out_a /dev/null \
 # This should pass without diagnostics
 cp -a xattr/a noxattr/ 2err || fail=1
 test -s noxattr/a   || fail=1  # destination file must not be empty
-test -s err  fail=1  # there must be no stderr output
+compare /dev/null err || fail=1
 
 rm -f err noxattr/a
 
 # This should pass without diagnostics (new file)
 cp --preserve=all xattr/a noxattr/ 2err || fail=1
 test -s noxattr/a   || fail=1  # destination file must not be empty
-test -s err  fail=1  # there must be no stderr output
+compare /dev/null err || fail=1
 
 # This should pass without diagnostics (existing file)
 cp --preserve=all xattr/a noxattr/ 2err || fail=1
 test -s noxattr/a   || fail=1  # destination file must not be empty
-test -s err  fail=1  # there must be no stderr output
+compare /dev/null err || fail=1
 
 rm -f err noxattr/a
 
@@ -104,7 +104,7 @@ rm -f err noxattr/a
 # This should pass without diagnostics
 mv xattr/a noxattr/ 2err || fail=1
 test -s noxattr/a || fail=1  # destination file must not be empty
-test -s errfail=1  # there must be no stderr output
+compare /dev/null err || fail=1
 
 # This should pass and copy xattrs of the symlink
 # since they're not in the 'user.' namespace.
diff --git a/tests/dd/misc.sh b/tests/dd/misc.sh
index bb4748c..f877fdd 100755
--- a/tests/dd/misc.sh
+++ b/tests/dd/misc.sh
@@ -32,12 +32,12 @@ ln -s $tmp_in $tmp_sym || framework_failure_
 
 # check status=none suppresses all output to stderr
 dd status=none if=$tmp_in of=/dev/null 2 err || fail=1
-test -s err  { cat err; fail=1; }
+compare /dev/null err || fail=1
 dd status=none if=$tmp_in skip=2 of=/dev/null 2 err || fail=1
-test -s err  { cat err; fail=1; }
+compare /dev/null err || fail=1
 # check status=none is cumulative with status=noxfer
 dd status=none status=noxfer if=$tmp_in of=/dev/null 2 err || fail=1
-test -s err  { cat err; fail=1; }
+compare /dev/null err || fail=1
 
 dd if=$tmp_in of=$tmp_out 2 /dev/null || fail=1
 compare $tmp_in $tmp_out || fail=1
diff --git