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] rename: move command from util-linux to coreutils

2013-12-24 Thread Sami Kerola
The implementation is completely rewrote without chaning existing
command line syntax.  This implementation adds --exec option, which
will allow use of a string manipulation command, such as 'tr' or 'sed'
to determine target names or rename operations.

* AUTHORS: Add my name.
* NEWS: Mention the new program.
* README: Reference the new program.
* build-aux/gen-lists-of-programs.sh: Update.
* doc/coreutils.texi: Document the new command.
* man/.gitignore: Ignore the new man page.
* man/local.mk: Reference the new man page.
* man/rename.x: A new template.
* po/POTFILES.in: Add new c file.
* scripts/git-hooks/commit-msg: Allow rename: commit prefix.
* src/.gitignore: Ignore the new binary.
* src/local.mk: Reference the new command.
* src/rename.c: New file.
* tests/local.mk: Reference the new tests.
* tests/misc/rename-exec: Test new command exec option.
* tests/misc/rename-foobar: Basic test for the new command.
---
 AUTHORS|   1 +
 NEWS   |   5 +
 README |   8 +-
 build-aux/gen-lists-of-programs.sh |   1 +
 doc/coreutils.texi | 117 ++-
 man/.gitignore |   1 +
 man/local.mk   |   1 +
 man/rename.x   |  10 +
 po/POTFILES.in |   1 +
 scripts/git-hooks/commit-msg   |  13 +-
 src/.gitignore |   1 +
 src/local.mk   |   3 +
 src/rename.c   | 659 +
 tests/local.mk |   2 +
 tests/misc/rename-exec.sh  |  30 ++
 tests/misc/rename-foo2bar.sh   |  30 ++
 16 files changed, 872 insertions(+), 11 deletions(-)
 create mode 100644 man/rename.x
 create mode 100644 src/rename.c
 create mode 100755 tests/misc/rename-exec.sh
 create mode 100755 tests/misc/rename-foo2bar.sh

diff --git a/AUTHORS b/AUTHORS
index df21e90..e2ae037 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -64,6 +64,7 @@ ptx: François Pinard
 pwd: Jim Meyering
 readlink: Dmitry V. Levin
 realpath: Pádraig Brady
+rename: Sami Kerola
 rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
 rmdir: David MacKenzie
 runcon: Russell Coker
diff --git a/NEWS b/NEWS
index cbac480..212b697 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,11 @@ GNU coreutils NEWS-*- 
outline -*-
 
 * Noteworthy changes in release ?.? (-??-??) [?]
 
+** New programs
+
+  rename: Rename multiple files using a pattern.  This command will replace
+  an utility with same name in util-linux package.
+
 
 * Noteworthy changes in release 8.22 (2013-12-13) [stable]
 
diff --git a/README b/README
index b81897e..4f65819 100644
--- a/README
+++ b/README
@@ -12,10 +12,10 @@ The programs that can be built with this package are:
   factor false fmt fold groups head hostid hostname id install join kill
   link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
   nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd readlink
-  realpath rm rmdir runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum
-  shred shuf sleep sort split stat stdbuf stty sum sync tac tail tee test
-  timeout touch tr true truncate tsort tty uname unexpand uniq unlink
-  uptime users vdir wc who whoami yes
+  realpath rename rm rmdir runcon seq sha1sum sha224sum sha256sum
+  sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty sum
+  sync tac tail tee test timeout touch tr true truncate tsort tty uname
+  unexpand uniq unlink uptime users vdir wc who whoami yes
 
 See the file NEWS for a list of major changes in the current release.
 
diff --git a/build-aux/gen-lists-of-programs.sh 
b/build-aux/gen-lists-of-programs.sh
index bf63ee3..2962a82 100755
--- a/build-aux/gen-lists-of-programs.sh
+++ b/build-aux/gen-lists-of-programs.sh
@@ -96,6 +96,7 @@ normal_progs='
 pwd
 readlink
 realpath
+rename
 rm
 rmdir
 runcon
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 9c2b79c..27a3602 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -96,6 +96,7 @@
 * pwd: (coreutils)pwd invocation.   Print working directory.
 * readlink: (coreutils)readlink invocation. Print referent of a symlink.
 * realpath: (coreutils)readpath invocation. Print resolved file names.
+* rename: (coreutils)rename invocation. Rename multiple files.
 * rm: (coreutils)rm invocation. Remove files.
 * rmdir: (coreutils)rmdir invocation.   Remove empty directories.
 * runcon: (coreutils)runcon invocation. Run in specified SELinux CTX.
@@ -195,7 +196,7 @@ Free Documentation License''.
 * Printing text::echo printf yes
 * Conditions::   false true test expr
 * Redirection::  tee
-* File name manipulation::   dirname basename pathchk mktemp realpath
+* File name manipulation::   dirname basename pathchk rename mktemp 
realpath
 * 

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

2013-12-24 Thread Sami Kerola
Seasons greetings,

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

On 24 December 2013 22:28, Sami Kerola kerol...@iki.fi wrote:
 The implementation is completely rewrote without chaning existing
 command line syntax.  This implementation adds --exec option, which
 will allow use of a string manipulation command, such as 'tr' or 'sed'
 to determine target names or rename operations.

 * AUTHORS: Add my name.
 * NEWS: Mention the new program.
 * README: Reference the new program.
 * build-aux/gen-lists-of-programs.sh: Update.
 * doc/coreutils.texi: Document the new command.
 * man/.gitignore: Ignore the new man page.
 * man/local.mk: Reference the new man page.
 * man/rename.x: A new template.
 * po/POTFILES.in: Add new c file.
 * scripts/git-hooks/commit-msg: Allow rename: commit prefix.
 * src/.gitignore: Ignore the new binary.
 * src/local.mk: Reference the new command.
 * src/rename.c: New file.
 * tests/local.mk: Reference the new tests.
 * tests/misc/rename-exec: Test new command exec option.
 * tests/misc/rename-foobar: Basic test for the new command.
 ---
  AUTHORS|   1 +
  NEWS   |   5 +
  README |   8 +-
  build-aux/gen-lists-of-programs.sh |   1 +
  doc/coreutils.texi | 117 ++-
  man/.gitignore |   1 +
  man/local.mk   |   1 +
  man/rename.x   |  10 +
  po/POTFILES.in |   1 +
  scripts/git-hooks/commit-msg   |  13 +-
  src/.gitignore |   1 +
  src/local.mk   |   3 +
  src/rename.c   | 659 
 +
  tests/local.mk |   2 +
  tests/misc/rename-exec.sh  |  30 ++
  tests/misc/rename-foo2bar.sh   |  30 ++
  16 files changed, 872 insertions(+), 11 deletions(-)
  create mode 100644 man/rename.x
  create mode 100644 src/rename.c
  create mode 100755 tests/misc/rename-exec.sh
  create mode 100755 tests/misc/rename-foo2bar.sh

 diff --git a/AUTHORS b/AUTHORS
 index df21e90..e2ae037 100644
 --- a/AUTHORS
 +++ b/AUTHORS
 @@ -64,6 +64,7 @@ ptx: François Pinard
  pwd: Jim Meyering
  readlink: Dmitry V. Levin
  realpath: Pádraig Brady
 +rename: Sami Kerola
  rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
  rmdir: David MacKenzie
  runcon: Russell Coker
 diff --git a/NEWS b/NEWS
 index cbac480..212b697 100644
 --- a/NEWS
 +++ b/NEWS
 @@ -2,6 +2,11 @@ GNU coreutils NEWS-*- 
 outline -*-

  * Noteworthy changes in release ?.? (-??-??) [?]

 +** New programs
 +
 +  rename: Rename multiple files using a pattern.  This command will replace
 +  an utility with same name in util-linux package.
 +

  * Noteworthy changes in release 8.22 (2013-12-13) [stable]

 diff --git a/README b/README
 index b81897e..4f65819 100644
 --- a/README
 +++ b/README
 @@ -12,10 +12,10 @@ The programs that can be built with this package are:
factor false fmt fold groups head hostid hostname id install join kill
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd readlink
 -  realpath rm rmdir runcon seq sha1sum sha224sum sha256sum sha384sum 
 sha512sum
 -  shred shuf sleep sort split stat stdbuf stty sum sync tac tail tee test
 -  timeout touch tr true truncate tsort tty uname unexpand uniq unlink
 -  uptime users vdir wc who whoami yes
 +  realpath rename rm rmdir runcon seq sha1sum sha224sum sha256sum
 +  sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty sum
 +  sync tac tail tee test timeout touch tr true truncate tsort tty uname
 +  unexpand uniq unlink uptime users vdir wc who whoami yes

  See the file NEWS for a list of major changes in the current release.

 diff --git a/build-aux/gen-lists-of-programs.sh 
 b/build-aux/gen-lists-of-programs.sh
 index bf63ee3..2962a82 100755
 --- a/build-aux/gen-lists-of-programs.sh
 +++ b/build-aux/gen-lists-of-programs.sh
 @@ -96,6 +96,7 @@ normal_progs='
  pwd
  readlink
  realpath
 +rename
  rm
  rmdir
  runcon
 diff --git a/doc/coreutils.texi b/doc/coreutils.texi
 index 9c2b79c..27a3602 100644
 --- a/doc/coreutils.texi
 +++ b/doc/coreutils.texi
 @@ -96,6 +96,7 @@
  * pwd: (coreutils)pwd invocation.   Print working