Re: [PATCH] Add new program: zargs

2008-04-15 Thread Bo Borgerson
Hi,

I noticed that the name of the --files0-from option description macro
in doc/coreutils.texi changed, so I updated the call in this patch.

I also replaced the polling reaper with a SIGCHLD sigaction handler.

Thanks,

Bo

On Fri, Apr 11, 2008 at 11:24 AM, Bo Borgerson <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  This is a much trimmed-back version of the program I previously
>  submitted as `magic'.
>
>  Thanks to Bob Proulx for the feedback.
>
>  The zargs program automatically decompresses inputs to a program.
>
>  $ zargs wc input/*
> 177 9766908 /tmp/zargsE0oy5L/TODO.bz2
> 177 9766908 /tmp/zargsE0oy5L/TODO.gz
> 177 9766908 input/TODO.txt
> 5312928   20724 total
>
>  Thanks,
>
>  Bo
>
From edfec1729e6e042ff0af8ed09070a74540eeccb7 Mon Sep 17 00:00:00 2001
From: Bo Borgerson <[EMAIL PROTECTED]>
Date: Sun, 6 Apr 2008 17:54:08 -0400
Subject: [PATCH] Add new program: zargs

* AUTHORS: Register as the author.
* NEWS: Advertise new program.
* README: List new program.
* doc/coreutils.texi: Describe new program.
* man/Makefile.am: Add new program.
* man/zargs.x: Add new man page template.
* po/POTFILES.in: Add new program.
* src/Makefile.am: Add new program.
* src/zargs.c: Add new program.
* tests/misc/Makefile.am: Add new test.
* tests/misc/help-version: Accomodate new program.
* tests/misc/zargs: Test new program.

Signed-off-by: Bo Borgerson <[EMAIL PROTECTED]>
---
 AUTHORS |1 +
 NEWS|3 +
 README  |1 +
 doc/coreutils.texi  |   74 -
 man/Makefile.am |1 +
 man/zargs.x |4 +
 po/POTFILES.in  |1 +
 src/Makefile.am |2 +-
 src/zargs.c |  901 +++
 tests/misc/Makefile.am  |3 +-
 tests/misc/help-version |1 +
 tests/misc/zargs|   82 +
 12 files changed, 1070 insertions(+), 4 deletions(-)
 create mode 100644 man/zargs.x
 create mode 100644 src/zargs.c
 create mode 100755 tests/misc/zargs

diff --git a/AUTHORS b/AUTHORS
index 807857f..5c1c6d1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -100,3 +100,4 @@ wc: Paul Rubin, David MacKenzie
 who: Joseph Arceneaux, David MacKenzie, Michael Stone
 whoami: Richard Mlynarik
 yes: David MacKenzie
+zargs: Bo Borgerson
diff --git a/NEWS b/NEWS
index 3a584e9..5ade4d2 100644
--- a/NEWS
+++ b/NEWS
@@ -87,6 +87,9 @@ GNU coreutils NEWS-*- outline -*-
   Fix a non-portable use of sed in configure.ac.
   [bug introduced in coreutils-6.9.92]
 
+** New programs
+
+zargs: run a program with automatically decompressed inputs
 
 * Noteworthy changes in release 6.9.92 (2008-01-12) [beta]
 
diff --git a/README b/README
index 7a608f4..4092411 100644
--- a/README
+++ b/README
@@ -15,6 +15,7 @@ The programs that can be built with this package are:
   runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
   sleep sort split stat stty su sum sync tac tail tee test touch tr true
   tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes
+  zargs
 
 See the file NEWS for a list of major changes in the current release.
 
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index f42e736..df0875b 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -126,6 +126,7 @@
 * who: (coreutils)who invocation.   Print who is logged in.
 * whoami: (coreutils)whoami invocation. Print effective user ID.
 * yes: (coreutils)yes invocation.   Print a string indefinitely.
+* zargs: (coreutils)zargs invocation.   Run with decompressed inputs.
 @end direntry
 
 @copying
@@ -190,7 +191,7 @@ Free Documentation License''.
 * Working context::pwd stty printenv tty
 * User information::   id logname whoami groups users who
 * System context:: date uname hostname hostid
-* Modified command invocation::chroot env nice nohup su
+* Modified command invocation::chroot env nice nohup su zargs
 * Process control::kill
 * Delaying::   sleep
 * Numeric operations:: factor seq
@@ -421,6 +422,7 @@ Modified command invocation
 * nice invocation::  Run a command with modified niceness
 * nohup invocation:: Run a command immune to hangups
 * su invocation::Run a command with substitute user and group ID
+* zargs invocation:: Run a command with decompressed inputs
 
 Process control
 
@@ -680,7 +682,8 @@ meanings with the values @samp{0} and @samp{1}.
 Here are some of the exceptions:
 @command{chroot}, @command{env}, @command{expr},
 @command{nice}, @command{nohup}, @command{printenv},
[EMAIL PROTECTED], @command{su}, @command{test}, @command{tty}.
[EMAIL PROTECTED], @command{su}, @command{test}, @command{tty},
[EMAIL PROTECTED]
 
 
 @node Backup options
@@ -13361,6 +13364,7 @@ user, etc.
 * nice invocation::   

Re: [PATCH] Add new program: zargs

2008-04-15 Thread Bo Borgerson
On Tue, Apr 15, 2008 at 9:01 AM, Pádraig Brady <[EMAIL PROTECTED]> wrote:
>  How does this compare with `zrun` from moreutils?
>  Would it be more appropriate to merge zargs into moreutils?

Hi Pádraig,

Yes, it looks like zrun attempts to perform a similar task.

>From a quick peek I notice a few things:

1. It checks file extensions, rather than `magic' bytes.  I think in
Perl there is a File::Type module that might help here.
2. It opens temporary files instead of FIFOs.  This is a potential
storage issue.  It also means that zrun waits for all decompression to
complete before invoking its COMMAND.
3. It opens files before forking, so is potentially rlimited beyond
what the child could handle.
4. It doesn't appear to clean up temporary files if killed with a signal.
5. It doesn't support false-positives (eg: `file.gz' that's not
actually compressed).
6. It doesn't support the --files0-from=F calling convention.

The major reason I'd prefer to submit this tool here is that I hope to
make it as robust as possible.  The coreutils package is attended to
by world-class developers.  Any tool that has undergone the scrutiny
of the subscribers to this list is likely to come out better as a
result, even if it's ultimately rejected -- though I hope it's not ;).

Thanks,

Bo


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils