From MAILER-DAEMON Thu Mar 04 04:53:37 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nn7kP-0005D9-HC
	for mharc-bug-cppi@gnu.org; Thu, 04 Mar 2010 04:53:37 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NmuVn-00038W-Ru
	for bug-cppi@gnu.org; Wed, 03 Mar 2010 14:45:39 -0500
Received: from [140.186.70.92] (port=55849 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NmuVm-00036n-Lc
	for bug-cppi@gnu.org; Wed, 03 Mar 2010 14:45:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NmuVl-0005II-T0
	for bug-cppi@gnu.org; Wed, 03 Mar 2010 14:45:38 -0500
Received: from smtp3-g21.free.fr ([212.27.42.3]:44009)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>)
	id 1NmuVl-0005Hu-9t; Wed, 03 Mar 2010 14:45:37 -0500
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 9F55F81811F;
	Wed,  3 Mar 2010 20:45:32 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id AD9C481807F;
	Wed,  3 Mar 2010 20:45:29 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 91309C12; Wed,  3 Mar 2010 20:45:29 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-cppi@gnu.org, info-gnu@gnu.org
Date: Wed, 03 Mar 2010 20:45:18 +0100
Message-ID: <87zl2pyysx.fsf@meyering.net>
Lines: 102
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha256; protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Mailman-Approved-At: Thu, 04 Mar 2010 04:53:35 -0500
Subject: [Bug-cppi] cppi-1.14 released [stable]
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Mar 2010 19:45:40 -0000

--=-=-=

GNU cppi is a cpp directive indenter.
Its documentation is no more than its --help output (included below).

It converts unindented (or inconsistently indented) code like this:

    #ifdef ...
    #if defined ... || defined ...
    #define a b
    #else
    #define a c
    #endif
    #endif

to this, without modifying non-cpp lines.

    #ifdef ...
    # if defined ... || defined ...
    #  define a b
    # else
    #  define a c
    # endif
    #endif

It can also merely report improperly-indented lines,
be it the lines themselves or just the names of the containing files.
---------------------------------------------

Here are the compressed sources:
  http://ftp.gnu.org/gnu/cppi/cppi-1.14.tar.xz   (392KB)

Here are the GPG detached signatures[*]:
  http://ftp.gnu.org/gnu/cppi/cppi-1.14.tar.xz.sig
To reduce load on the main server, use a mirror listed at:
  http://www.gnu.org/order/ftp.html

[*] You can use either of the above signature files to verify that
the corresponding file (without the .sig suffix) is intact.  First,
be sure to download both the .sig file and the corresponding tarball.
Then, run a command like this:

  gpg --verify cppi-1.14.tar.xz.sig

If that command fails because you don't have the required public key,
then run this command to import it:

  gpg --keyserver keys.gnupg.net --recv-keys B9AB9A16

and rerun the `gpg --verify' command.

This release was bootstrapped with the following tools:
  Autoconf 2.65.48-d174a
  Automake 1.11a
  Gnulib v0.0-3483-gaadf332

./NEWS

* Noteworthy changes in release 1.14 (2010-03-03) [stable]
  infrastructure

---------------------------------------------
$ cppi --help
Usage: cppi [FILE]
  or:  cppi -c [OPTION] [FILE]...

Indent the C preprocessor directives in FILE to reflect their nesting
and ensure that there is exactly one space character between each #if,
#elif, #define directive and the following token, and write the result
to standard output.  The number of spaces between the `#' and the following
directive must correspond to the level of nesting of that directive.
With no FILE, or when FILE is -, read standard input.

  -a, --ansi             when checking, fail if text follows #else or #endif
  -c, --check            set exit code, but don't produce any output
  -l, --list-files-only  don't generate diagnostics about indentation;
                         print to stdout only the names of files that
                         are not properly indented
  -m, --max-string-length=LENGTH
                         fail if there is a double-quoted string longer
                         than LENGTH;  if LENGTH is 0 (the default),
                         then there is no limit
      --help     display this help and exit
      --version  output version information and exit

With the -c option, don't write to stdout.  Instead, check the
indentation of the specified files giving diagnostics for preprocessor
lines that aren't properly indented or are otherwise invalid.

Note that --ansi without --check does not correct the problem of
non-ANSI text following #else and #endif directives.

The exit code will be one of these:
  0  all directives properly indented
  1  some cpp directive(s) improperly indented, or
     if text follows #else/#endif (enabled with --check --ansi), or
     found a double-quoted string longer than the specified maximum
  2  #if/#endif mismatch, EOF in comment or string
  3  file (e.g. open/read/write) error

A pragma directive may have its `#' indented.

Report bugs to <bug-cppi@gnu.org>.

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10-svn4867 (GNU/Linux)

iQIcBAEBCAAGBQJLjrxZAAoJENd//eG5q5oWu0EP/0e1mTeyNtdFT/lpUotU1Bvk
tEjplTfRvw50U14yMohEQiXhuingJ1iTSCIdWjfEGEdPrmVvKEHK0P+mZmbc2AsF
60GJEJZk6Z7W2BbTB9sWDL2WhJsROGGUZk0SmozrnP/LnTVSwVA0TbUetJlo5YEU
xnYFhrivyllUbK6WcihW4UjGMd1lVsJwQJibMLKMs/PsJ2qeYtP4ucXO6fp53F5K
K/N2cXWi/amhoXaV8faMXWQB6EiKOjeMVYfgIfuhO8BRM7IKZ2CHR0D62h9Gio5I
CAb/eScXmx5wlyaiHKGhfmZ36F5PcONEaem1qm2NrTfTxDkXy+4WAhOwAOvoBkIe
WyO0Rh2pVate4wbKfSjM0dtGBlBCYBe1/9qb259MwQGG71/TD9/IjDzCPVdry0Co
+oWpfCaj0d5vxpakabMFeuxEaHqcjkn4bZF6q9sQSbUgpn8p02I+2tO33ZQr6neg
PivGbJxjIdhLwuhCEnt4W5Z96MFnp56QlaAHz+toAM3FY7wGOXCguH84kJCmv+K4
4RXGhGEHlUIrq8vATjE3Tx1V1iOTiM5fJOyqLK0L4qjiYhaZB65/8i5xdgupHuhj
qkeAwQrNdtVGGAOL25VlDcqruQa8ti4N0js+J+TTIQBerx9L/duWtgOSv/z43Bw7
mOloD85Xu5AX7NMWq1//
=+IB3
-----END PGP SIGNATURE-----
--=-=-=--



From MAILER-DAEMON Fri Mar 05 12:46:21 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NnbbR-0007k5-Oc
	for mharc-bug-cppi@gnu.org; Fri, 05 Mar 2010 12:46:21 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NnDpV-0001fW-H2
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 11:23:17 -0500
Received: from [140.186.70.92] (port=56859 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NnDpU-0001en-Jc
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 11:23:17 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <bfriesen@simple.dallas.tx.us>) id 1NnDpT-0002pc-JG
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 11:23:16 -0500
Received: from blade.simplesystems.org ([65.66.246.74]:64242)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <bfriesen@simple.dallas.tx.us>) id 1NnDpT-0002oL-CT
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 11:23:15 -0500
Received: from freddy.simplesystems.org (freddy.simplesystems.org
	[65.66.246.65])
	by blade.simplesystems.org (8.13.8+Sun/8.13.8) with ESMTP id
	o24GN7fZ026469
	for <bug-cppi@gnu.org>; Thu, 4 Mar 2010 10:23:07 -0600 (CST)
Date: Thu, 4 Mar 2010 10:23:07 -0600 (CST)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@freddy.simplesystems.org
To: bug-cppi@gnu.org
In-Reply-To: <87zl2pyysx.fsf@meyering.net>
Message-ID: <alpine.GSO.2.01.1003041011400.1592@freddy.simplesystems.org>
References: <87zl2pyysx.fsf@meyering.net>
User-Agent: Alpine 2.01 (GSO 1266 2009-07-14)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2
	(blade.simplesystems.org [65.66.246.90]);
	Thu, 04 Mar 2010 10:23:08 -0600 (CST)
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Mailman-Approved-At: Fri, 05 Mar 2010 12:46:19 -0500
Subject: [Bug-cppi] cppi-1.14 fails to compile on Solaris 10
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Mar 2010 16:23:17 -0000

With Solaris 10 (x86), GCC 4.4.3, flex 2.5.35, I am seeing this 
compilation failure:

gcc-4.4.3 -std=gnu99  -I. -I../lib  -I../lib    -O2 -MT cppi.o -MD -MP -MF .deps/cppi.Tpo -c -o cppi.o cppi.c
./cppi.l:48:21: error: obstack.h: No such file or directory
./cppi.l: In function 'kth_entry':
./cppi.l:200: warning: implicit declaration of function 'obstack_base'
./cppi.l:201: warning: implicit declaration of function 'obstack_object_size'
./cppi.l: In function 'pop':
./cppi.l:210: warning: implicit declaration of function 'obstack_blank'
./cppi.l: In function 'push':
./cppi.l:220: warning: implicit declaration of function 'obstack_grow'
./cppi.l: In function 'cpp_i':
./cppi.l:382: warning: implicit declaration of function 'obstack_init'
./cppi.l: In function 'cpp_indent':
./cppi.l:625: warning: implicit declaration of function 'obstack_free'
gmake[3]: *** [cppi.o] Error 1

I see that a header with the name obstack.h is part of GCC and 
coreutils, but is not included with cppi.  Maybe it was forgotten to 
be included?  If I bring in obstack.h from GCC, then this is the 
result:

   CC       cppi.o
   CCLD     cppi
Undefined                       first referenced
  symbol                             in file
_obstack_begin                      cppi.o
_obstack_newchunk                   cppi.o
obstack_free                        cppi.o

What is required for a successful compile?

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



From MAILER-DAEMON Fri Mar 05 12:46:22 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NnbbS-0007kV-2H
	for mharc-bug-cppi@gnu.org; Fri, 05 Mar 2010 12:46:22 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NnFW0-0000Zf-Dq
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 13:11:16 -0500
Received: from [140.186.70.92] (port=33160 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NnFVz-0000Xt-Cp
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 13:11:15 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NnFVy-0006Lz-8E
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 13:11:15 -0500
Received: from smtp3-g21.free.fr ([212.27.42.3]:55864)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>)
	id 1NnFVx-0006Kp-L1; Thu, 04 Mar 2010 13:11:14 -0500
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 435028181A9;
	Thu,  4 Mar 2010 19:11:07 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 59C7E8181D5;
	Thu,  4 Mar 2010 19:11:04 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 7F5895AB; Thu,  4 Mar 2010 19:11:04 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=)
Cc: bug-cppi@gnu.org
In-Reply-To: <87635cotk6.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?=
	=?utf-8?Q?s?= message of "Thu, 04 Mar 2010 19:00:57 +0100")
References: <mailman.2267.1267683169.14305.info-gnu@gnu.org>
	<87635cotk6.fsf@gnu.org>
Date: Thu, 04 Mar 2010 19:11:04 +0100
Message-ID: <87vddct0sn.fsf@meyering.net>
Lines: 38
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Mailman-Approved-At: Fri, 05 Mar 2010 12:46:19 -0500
Subject: [Bug-cppi] Re: cppi-1.14 released [stable]
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Mar 2010 18:11:16 -0000

Ludovic Court=C3=A8s wrote:
> cppi doesn=E2=80=99t build on non-GNU platforms because it uses obstacks =
and the
> =E2=80=98obstack=E2=80=99 Gnulib module is missing.  (See
> http://hydra.nixos.org/job/nixpkgs/trunk/cppi for details.)

Hi Ludovic,

Thank you!
Here's the likely patch, just pushed:

>From 5c9e6379367f4da8a32f70bff0224068a74d3e31 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 4 Mar 2010 19:08:27 +0100
Subject: [PATCH] build: avoid build failure on non-glibc systems
MIME-Version: 1.0
Content-Type: text/plain; charset=3DUTF-8
Content-Transfer-Encoding: 8bit

* bootstrap.conf (gnulib_modules): Add obstack.
Reported by Ludovic Court=C3=A8s.
---
 bootstrap.conf |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 0333079..131f358 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -41,6 +41,7 @@ gnulib_modules=3D"
   malloc
   maintainer-makefile
   manywarnings
+  obstack
   progname
   quote
   quotearg
--
1.7.0.1.475.gaf89b



From MAILER-DAEMON Fri Mar 05 12:46:22 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NnbbS-0007kd-6g
	for mharc-bug-cppi@gnu.org; Fri, 05 Mar 2010 12:46:22 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NnH5n-0002QN-2h
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 14:52:19 -0500
Received: from [140.186.70.92] (port=57888 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NnH5m-0002QB-CH
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 14:52:18 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NnH5l-00013V-Js
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 14:52:18 -0500
Received: from smtp3-g21.free.fr ([212.27.42.3]:55100)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NnH5l-000139-0b
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 14:52:17 -0500
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id DDDAA818147
	for <bug-cppi@gnu.org>; Thu,  4 Mar 2010 20:52:13 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 10A43818036
	for <bug-cppi@gnu.org>; Thu,  4 Mar 2010 20:52:11 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id E75089D3; Thu,  4 Mar 2010 20:52:10 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Cc: bug-cppi@gnu.org
In-Reply-To: <alpine.GSO.2.01.1003041320570.1592@freddy.simplesystems.org>
	(Bob Friesenhahn's message of "Thu, 4 Mar 2010 13:23:37 -0600 (CST)")
References: <alpine.GSO.2.01.1003041320570.1592@freddy.simplesystems.org>
Date: Thu, 04 Mar 2010 20:52:10 +0100
Message-ID: <874okvuaol.fsf@meyering.net>
Lines: 12
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Mailman-Approved-At: Fri, 05 Mar 2010 12:46:19 -0500
Subject: [Bug-cppi] Re: cppi missing indention feature
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Mar 2010 19:52:19 -0000

Bob Friesenhahn wrote:
> A basic feature that cppi lacks is the ability to specify the number
> of spaces to use for indentation.  While cppi uses one space, many
> projects use two, and some may even use a hard TAB character.

Too true.
This has been in TODO for many years, probably from the beginning.
Are you motivated?


  Currently, the indentation width is hard-coded
  at one space per nesting level.  Add an option to change that.



From MAILER-DAEMON Fri Mar 05 12:46:22 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NnbbS-0007ks-CT
	for mharc-bug-cppi@gnu.org; Fri, 05 Mar 2010 12:46:22 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NnK0i-0002Aa-TZ
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 17:59:16 -0500
Received: from [140.186.70.92] (port=43637 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NnK0i-0002AR-55
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 17:59:16 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <bfriesen@simple.dallas.tx.us>) id 1NnK0h-0000yQ-1x
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 17:59:16 -0500
Received: from blade.simplesystems.org ([65.66.246.74]:33155)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <bfriesen@simple.dallas.tx.us>) id 1NnK0g-0000yE-Rt
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 17:59:15 -0500
Received: from freddy.simplesystems.org (freddy.simplesystems.org
	[65.66.246.65])
	by blade.simplesystems.org (8.13.8+Sun/8.13.8) with ESMTP id
	o24MxCVF029104; Thu, 4 Mar 2010 16:59:13 -0600 (CST)
Date: Thu, 4 Mar 2010 16:59:12 -0600 (CST)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@freddy.simplesystems.org
To: Jim Meyering <jim@meyering.net>
cc: bug-cppi@gnu.org
In-Reply-To: <874okvuaol.fsf@meyering.net>
Message-ID: <alpine.GSO.2.01.1003041658480.1592@freddy.simplesystems.org>
References: <alpine.GSO.2.01.1003041320570.1592@freddy.simplesystems.org>
	<874okvuaol.fsf@meyering.net>
User-Agent: Alpine 2.01 (GSO 1266 2009-07-14)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2
	(blade.simplesystems.org [65.66.246.90]);
	Thu, 04 Mar 2010 16:59:13 -0600 (CST)
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Mailman-Approved-At: Fri, 05 Mar 2010 12:46:19 -0500
Subject: [Bug-cppi] Re: cppi missing indention feature
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Mar 2010 22:59:17 -0000

On Thu, 4 Mar 2010, Jim Meyering wrote:

> Bob Friesenhahn wrote:
>> A basic feature that cppi lacks is the ability to specify the number
>> of spaces to use for indentation.  While cppi uses one space, many
>> projects use two, and some may even use a hard TAB character.
>
> Too true.
> This has been in TODO for many years, probably from the beginning.
> Are you motivated?

Alas, I have too much already on my plate at the moment.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



From MAILER-DAEMON Fri Mar 05 12:46:22 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NnbbR-0007kE-U3
	for mharc-bug-cppi@gnu.org; Fri, 05 Mar 2010 12:46:21 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NnFMD-0003Ll-IT
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 13:01:09 -0500
Received: from [140.186.70.92] (port=60144 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NnFM6-0003FC-0H
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 13:01:09 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <ludo@gnu.org>) id 1NnFM3-0004pp-Uk
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 13:01:01 -0500
Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:44648)
	by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from <ludo@gnu.org>)
	id 1NnFM3-0004pk-QE
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 13:00:59 -0500
X-IronPort-AV: E=Sophos;i="4.49,582,1262559600"; d="scan'208";a="54038989"
Received: from reverse-83.fdn.fr (HELO nixey) ([80.67.176.83])
	by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA;
	04 Mar 2010 19:00:58 +0100
From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=)
To: Jim Meyering <jim@meyering.net>
Cc: bug-cppi@gnu.org
References: <mailman.2267.1267683169.14305.info-gnu@gnu.org>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 14 =?iso-8859-1?Q?Vent=F4se?= an 218 de la
	=?iso-8859-1?Q?R=E9volution?=
X-PGP-Key-ID: 0xEA52ECF4
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA  D15D 77DD 95E2 EA52 ECF4
X-OS: x86_64-unknown-linux-gnu
Date: Thu, 04 Mar 2010 19:00:57 +0100
In-Reply-To: <mailman.2267.1267683169.14305.info-gnu@gnu.org> (Jim Meyering's
	message of "Wed, 03 Mar 2010 20:45:18 +0100")
Message-ID: <87635cotk6.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Mailman-Approved-At: Fri, 05 Mar 2010 12:46:19 -0500
Subject: [Bug-cppi] Re: cppi-1.14 released [stable]
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Mar 2010 18:01:09 -0000

Hi Jim,

cppi doesn=E2=80=99t build on non-GNU platforms because it uses obstacks an=
d the
=E2=80=98obstack=E2=80=99 Gnulib module is missing.  (See
http://hydra.nixos.org/job/nixpkgs/trunk/cppi for details.)

Thanks,
Ludo=E2=80=99.



From MAILER-DAEMON Fri Mar 05 12:46:22 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NnbbS-0007kz-HY
	for mharc-bug-cppi@gnu.org; Fri, 05 Mar 2010 12:46:22 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NnMqG-0006NH-2h
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 21:00:40 -0500
Received: from [140.186.70.92] (port=40680 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NnMqA-0006N9-AA
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 21:00:38 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NnMq4-00020R-Lx
	for bug-cppi@gnu.org; Thu, 04 Mar 2010 21:00:33 -0500
Received: from jack.mail.tiscali.it ([213.205.33.53]:55410)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>)
	id 1NnMq4-00020M-9G; Thu, 04 Mar 2010 21:00:28 -0500
Received: from master.homenet (84.222.171.208) by jack.mail.tiscali.it
	(8.0.031) id 4B8CF1A900176BF1; Fri, 5 Mar 2010 03:00:26 +0100
Received: from gscrivano by master.homenet with local (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>)
	id 1NnMqX-00046G-2i; Fri, 05 Mar 2010 03:00:57 +0100
From: Giuseppe Scrivano <gscrivano@gnu.org>
To: bug-cppi@gnu.org
Date: Fri, 05 Mar 2010 03:00:56 +0100
Message-ID: <873a0fmsrq.fsf@master.homenet>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Mailman-Approved-At: Fri, 05 Mar 2010 12:46:19 -0500
Subject: [Bug-cppi] [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 05 Mar 2010 02:00:40 -0000

Hello,

what do you think about the following patch?  I was already using cppi
trough a shell script to write to a temporary file and after copy it on
the original file, looping on a collection of files.  The patch
simplifies the task and allow cppi to be used as "cppi -i *.c".

Cheers,
Giuseppe




>From 0cfeec83689e0b9f33f489aecef4d0b12cb20a7f Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 5 Mar 2010 02:19:19 +0100
Subject: [PATCH] Add new option --in-place

* bootstrap.conf (gnulib_modules): Add `full-write', `safe-read',
`tempname' and `unlink' gnulib modules.
* src/cppi.l: Include "full-write.h", "safe-read.h", "tempname.h".
(long_options): Add entry for --in-place.
(main): Handle --in-place.
* tests/test-common: Test the --in-place option.
---
 bootstrap.conf    |    4 +++
 src/cppi.l        |   73 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 tests/test-common |   13 ++++++++-
 3 files changed, 87 insertions(+), 3 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 131f358..dcd0ab0 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -31,6 +31,7 @@ gnulib_modules="
   do-release-commit-and-tag
   error
   exitfail
+  full-write
   getopt
   git-version-gen
   gitlog-to-changelog
@@ -46,10 +47,13 @@ gnulib_modules="
   quote
   quotearg
   realloc
+  safe-read
   stat-macros
   stdbool
   stpcpy
+  tempname
   timespec
+  unlink
   unlocked-io
   update-copyright
   useless-if-before-free
diff --git a/src/cppi.l b/src/cppi.l
index f46940a..9d1a165 100644
--- a/src/cppi.l
+++ b/src/cppi.l
@@ -45,8 +45,11 @@
 
 #include "cpp.h"
 #include "error.h"
+#include "full-write.h"
 #include "obstack.h"
+#include "safe-read.h"
 #include "xstrtol.h"
+#include "tempname.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "cppi"
@@ -129,6 +132,7 @@ static struct option const long_options[] =
 {
   {"ansi", no_argument, NULL, 'a'},
   {"check", no_argument, NULL, 'c'},
+  {"in-place", no_argument, NULL, 'i'},
   {"list-files-only", no_argument, NULL, 'l'},
   {"max-string-length", required_argument, NULL, 'm'},
   {GETOPT_HELP_OPTION_DECL},
@@ -659,6 +663,7 @@ With no FILE, or when FILE is -, read standard input.\n\
 \n\
   -a, --ansi             when checking, fail if text follows #else or #endif\n\
   -c, --check            set exit code, but don't produce any output\n\
+  -i, --in-place         edit files in place\n\
   -l, --list-files-only  don't generate diagnostics about indentation;\n\
                          print to stdout only the names of files that\n\
                          are not properly indented\n\
@@ -785,12 +790,13 @@ main (int argc, char** argv)
   char **file_list;
   int c;
   int fail = 0;
+  bool in_place = false;
 
   set_program_name (argv[0]);
 
   atexit (close_stdout);
 
-  while ((c = getopt_long (argc, argv, "aclm:", long_options, NULL)) != -1)
+  while ((c = getopt_long (argc, argv, "acilm:", long_options, NULL)) != -1)
     {
       switch (c)
         {
@@ -805,6 +811,10 @@ main (int argc, char** argv)
           inhibit_output = 1;
           break;
 
+        case 'i':
+          in_place = true;
+          break;
+
         case 'l':
           inhibit_output = 1;
           list_files_only = 1;
@@ -832,18 +842,41 @@ main (int argc, char** argv)
   if (fail)
     exit (EXIT_FAILURE);
 
-  if (!inhibit_output && argc - optind > 2)
+  if (!in_place && !inhibit_output && argc - optind > 2)
     {
       error (0, 0, _("too many arguments"));
       usage (EXIT_FAILURE);
     }
 
+  if (in_place && (inhibit_output || ansi_check || list_files_only))
+    {
+      error (0, 0, _("-i is ignored, it can't be used with -a, -c or -l"));
+      in_place = false;
+    }
+
   file_list = (optind == argc ? default_file_list : argv + optind);
 
   max_err = 0;
   for (i = 0; file_list[i]; i++)
     {
       int err;
+      /* Used when in_place is true.  */
+      char tmp_filename[16];
+
+      if (in_place)
+        {
+          int dest_fileno;
+          strcpy (tmp_filename, "./.cppiXXXXXX");
+
+          dest_fileno = gen_tempname (tmp_filename, 0, 0, GT_FILE);
+          if (dest_fileno < 0)
+            error (EXIT_FAILURE, errno, _("cannot create temporary file"));
+          close (dest_fileno);
+
+          yyout = fopen (tmp_filename, "wb");
+          if (yyout == NULL)
+            error (EXIT_FILE_ERROR, errno, "%s", tmp_filename);
+        }
 
       err = cpp_indent (file_list[i]);
       if (err > max_err)
@@ -851,7 +884,43 @@ main (int argc, char** argv)
 
       if (err && list_files_only)
         puts (file_list[i]);
+
+      if (in_place)
+        {
+          int src_fd, dest_fd;
+          char buf[2048];
+
+          fclose (yyout);
+
+          src_fd = open (tmp_filename, O_RDONLY | O_BINARY);
+          if (src_fd < 0)
+            error (EXIT_FAILURE, errno, _("cannot open source file"));
+
+          dest_fd = open (file_list[i], O_WRONLY | O_BINARY | O_TRUNC);
+          if (dest_fd < 0)
+            error (EXIT_FAILURE, errno, _("cannot open destination file"));
+
+          for (;;)
+            {
+              size_t n_read = safe_read (src_fd, buf, sizeof (buf));
+              if (n_read == SAFE_READ_ERROR)
+                error (EXIT_FAILURE, errno, _("error reading \"%s\""),
+                       tmp_filename);
+              if (n_read == 0)
+                break;
+
+              if (full_write (dest_fd, buf, n_read) < n_read)
+                error (EXIT_FAILURE, errno, _("error writing \"%s\""),
+                       file_list[i]);
+            }
+
+          close (src_fd);
+          close (dest_fd);
+
+          unlink (tmp_filename);
+        }
     }
 
+
   exit (max_err);
 }
diff --git a/tests/test-common b/tests/test-common
index e393eeb..37a1f4d 100644
--- a/tests/test-common
+++ b/tests/test-common
@@ -27,5 +27,16 @@ else
   fail=1
 fi
 
-test $fail = 0 && rm -f $t.I $t.O $t.e $t.EO $t.Ee $extra_temps
+cp $t.I $t.Ii
+cppi -i $t.Ii
+cppi $t.I > $t.Iio
+
+if cmp  $t.Ii $t.Iio ; then
+  :
+else
+  echo "the in-place option generated a different file"
+  fail=1
+fi
+
+test $fail = 0 && rm -f $t.I $t.O $t.e $t.EO $t.Ii $t.Iio $t.Ee $extra_temps
 exit $fail
-- 
1.7.0




From MAILER-DAEMON Fri Mar 12 11:42:29 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nq7wT-0008Or-9Q
	for mharc-bug-cppi@gnu.org; Fri, 12 Mar 2010 11:42:29 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nq7wR-0008Nx-NS
	for bug-cppi@gnu.org; Fri, 12 Mar 2010 11:42:27 -0500
Received: from [140.186.70.92] (port=44743 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nq7wM-00080M-MR
	for bug-cppi@gnu.org; Fri, 12 Mar 2010 11:42:27 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1Nq7h3-0000bf-2m
	for bug-cppi@gnu.org; Fri, 12 Mar 2010 11:26:34 -0500
Received: from smtp3-g21.free.fr ([212.27.42.3]:46565)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1Nq7h2-0000bP-Ef
	for bug-cppi@gnu.org; Fri, 12 Mar 2010 11:26:33 -0500
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 1CB08818062
	for <bug-cppi@gnu.org>; Fri, 12 Mar 2010 17:26:27 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 0F5F8818034
	for <bug-cppi@gnu.org>; Fri, 12 Mar 2010 17:26:25 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id E5DE3E548; Fri, 12 Mar 2010 17:26:24 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-cppi@gnu.org
Date: Fri, 12 Mar 2010 17:26:24 +0100
Message-ID: <877hph7bgv.fsf@meyering.net>
Lines: 47
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Subject: [bug-cppi] [PATCH 1/2] build: make bootstrap ensure that flex exists
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 12 Mar 2010 16:42:28 -0000

bootstrap did not test for "flex", which is required.
Now it does.  Also updated to latest gnulib.

>From 73cbdf3c07e0bf23ddb4fd209e294ab2e02bec6f Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 12 Mar 2010 17:15:46 +0100
Subject: [PATCH 1/2] build: make bootstrap ensure that flex exists

* bootstrap.conf (buildreq): Add flex to the list of required programs.
---
 bootstrap.conf |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 131f358..d1f76bc 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -111,6 +111,7 @@ buildreq="\
 autoconf   2.61
 automake   1.11
 autopoint  -
+flex       -
 gettext    -
 git        1.4.4
 gperf      -
--
1.7.0.2.393.gfb6b


>From 52b0e18754cd2982eea943ee4e45c601acb97ddb Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 12 Mar 2010 17:16:21 +0100
Subject: [PATCH 2/2] build: update gnulib submodule to latest

---
 gnulib |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gnulib b/gnulib
index aadf332..a6e4beb 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit aadf332a5c5f209affd38c35b4e9faaa8a0adecb
+Subproject commit a6e4beb00beb1baeea0f40278d22cacd9d377ed4
--
1.7.0.2.393.gfb6b



From MAILER-DAEMON Sun Mar 14 21:29:55 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nqz7z-00031o-1i
	for mharc-bug-cppi@gnu.org; Sun, 14 Mar 2010 21:29:55 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nqz7x-00031D-PP
	for bug-cppi@gnu.org; Sun, 14 Mar 2010 21:29:53 -0400
Received: from [140.186.70.92] (port=37183 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nqz7r-0002zl-9H
	for bug-cppi@gnu.org; Sun, 14 Mar 2010 21:29:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1Nqz7l-00072D-DO
	for bug-cppi@gnu.org; Sun, 14 Mar 2010 21:29:47 -0400
Received: from smtp.elevenwireless.com ([69.48.211.177]:60811)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>)
	id 1Nqz7e-00071l-JK; Sun, 14 Mar 2010 21:29:34 -0400
Received: from hotelmarlow-gw0.cust.expedient.net ([209.190.168.162]
	helo=black) by smtp.elevenwireless.com with esmtp (Exim 4.63)
	(envelope-from <gscrivano@gnu.org>)
	id 1Nqz4r-0000jZ-BT; Sun, 14 Mar 2010 18:26:41 -0700
Received: from localhost ([127.0.0.1] helo=black)
	by black with esmtp (Exim 4.71) (envelope-from <gscrivano@gnu.org>)
	id 1Nqz7u-0004Sr-0u; Mon, 15 Mar 2010 02:29:50 +0100
From: Giuseppe Scrivano <gscrivano@gnu.org>
To: bug-cppi@gnu.org
References: <873a0fmsrq.fsf@master.homenet>
Date: Mon, 15 Mar 2010 02:29:49 +0100
In-Reply-To: <873a0fmsrq.fsf@master.homenet> (Giuseppe Scrivano's message of
	"Fri, 05 Mar 2010 03:00:56 +0100")
Message-ID: <87eijm9xte.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 15 Mar 2010 01:29:54 -0000

Ping.



Giuseppe Scrivano <gscrivano@gnu.org> writes:

> Hello,
>
> what do you think about the following patch?  I was already using cppi
> trough a shell script to write to a temporary file and after copy it on
> the original file, looping on a collection of files.  The patch
> simplifies the task and allow cppi to be used as "cppi -i *.c".
>
> Cheers,
> Giuseppe
>
>
>
>
> From 0cfeec83689e0b9f33f489aecef4d0b12cb20a7f Mon Sep 17 00:00:00 2001
> From: Giuseppe Scrivano <gscrivano@gnu.org>
> Date: Fri, 5 Mar 2010 02:19:19 +0100
> Subject: [PATCH] Add new option --in-place
>
> * bootstrap.conf (gnulib_modules): Add `full-write', `safe-read',
> `tempname' and `unlink' gnulib modules.
> * src/cppi.l: Include "full-write.h", "safe-read.h", "tempname.h".
> (long_options): Add entry for --in-place.
> (main): Handle --in-place.
> * tests/test-common: Test the --in-place option.
> ---
>  bootstrap.conf    |    4 +++
>  src/cppi.l        |   73 +++++++++++++++++++++++++++++++++++++++++++++++++++-
>  tests/test-common |   13 ++++++++-
>  3 files changed, 87 insertions(+), 3 deletions(-)
>
> diff --git a/bootstrap.conf b/bootstrap.conf
> index 131f358..dcd0ab0 100644
> --- a/bootstrap.conf
> +++ b/bootstrap.conf
> @@ -31,6 +31,7 @@ gnulib_modules="
>    do-release-commit-and-tag
>    error
>    exitfail
> +  full-write
>    getopt
>    git-version-gen
>    gitlog-to-changelog
> @@ -46,10 +47,13 @@ gnulib_modules="
>    quote
>    quotearg
>    realloc
> +  safe-read
>    stat-macros
>    stdbool
>    stpcpy
> +  tempname
>    timespec
> +  unlink
>    unlocked-io
>    update-copyright
>    useless-if-before-free
> diff --git a/src/cppi.l b/src/cppi.l
> index f46940a..9d1a165 100644
> --- a/src/cppi.l
> +++ b/src/cppi.l
> @@ -45,8 +45,11 @@
>  
>  #include "cpp.h"
>  #include "error.h"
> +#include "full-write.h"
>  #include "obstack.h"
> +#include "safe-read.h"
>  #include "xstrtol.h"
> +#include "tempname.h"
>  
>  /* The official name of this program (e.g., no `g' prefix).  */
>  #define PROGRAM_NAME "cppi"
> @@ -129,6 +132,7 @@ static struct option const long_options[] =
>  {
>    {"ansi", no_argument, NULL, 'a'},
>    {"check", no_argument, NULL, 'c'},
> +  {"in-place", no_argument, NULL, 'i'},
>    {"list-files-only", no_argument, NULL, 'l'},
>    {"max-string-length", required_argument, NULL, 'm'},
>    {GETOPT_HELP_OPTION_DECL},
> @@ -659,6 +663,7 @@ With no FILE, or when FILE is -, read standard input.\n\
>  \n\
>    -a, --ansi             when checking, fail if text follows #else or #endif\n\
>    -c, --check            set exit code, but don't produce any output\n\
> +  -i, --in-place         edit files in place\n\
>    -l, --list-files-only  don't generate diagnostics about indentation;\n\
>                           print to stdout only the names of files that\n\
>                           are not properly indented\n\
> @@ -785,12 +790,13 @@ main (int argc, char** argv)
>    char **file_list;
>    int c;
>    int fail = 0;
> +  bool in_place = false;
>  
>    set_program_name (argv[0]);
>  
>    atexit (close_stdout);
>  
> -  while ((c = getopt_long (argc, argv, "aclm:", long_options, NULL)) != -1)
> +  while ((c = getopt_long (argc, argv, "acilm:", long_options, NULL)) != -1)
>      {
>        switch (c)
>          {
> @@ -805,6 +811,10 @@ main (int argc, char** argv)
>            inhibit_output = 1;
>            break;
>  
> +        case 'i':
> +          in_place = true;
> +          break;
> +
>          case 'l':
>            inhibit_output = 1;
>            list_files_only = 1;
> @@ -832,18 +842,41 @@ main (int argc, char** argv)
>    if (fail)
>      exit (EXIT_FAILURE);
>  
> -  if (!inhibit_output && argc - optind > 2)
> +  if (!in_place && !inhibit_output && argc - optind > 2)
>      {
>        error (0, 0, _("too many arguments"));
>        usage (EXIT_FAILURE);
>      }
>  
> +  if (in_place && (inhibit_output || ansi_check || list_files_only))
> +    {
> +      error (0, 0, _("-i is ignored, it can't be used with -a, -c or -l"));
> +      in_place = false;
> +    }
> +
>    file_list = (optind == argc ? default_file_list : argv + optind);
>  
>    max_err = 0;
>    for (i = 0; file_list[i]; i++)
>      {
>        int err;
> +      /* Used when in_place is true.  */
> +      char tmp_filename[16];
> +
> +      if (in_place)
> +        {
> +          int dest_fileno;
> +          strcpy (tmp_filename, "./.cppiXXXXXX");
> +
> +          dest_fileno = gen_tempname (tmp_filename, 0, 0, GT_FILE);
> +          if (dest_fileno < 0)
> +            error (EXIT_FAILURE, errno, _("cannot create temporary file"));
> +          close (dest_fileno);
> +
> +          yyout = fopen (tmp_filename, "wb");
> +          if (yyout == NULL)
> +            error (EXIT_FILE_ERROR, errno, "%s", tmp_filename);
> +        }
>  
>        err = cpp_indent (file_list[i]);
>        if (err > max_err)
> @@ -851,7 +884,43 @@ main (int argc, char** argv)
>  
>        if (err && list_files_only)
>          puts (file_list[i]);
> +
> +      if (in_place)
> +        {
> +          int src_fd, dest_fd;
> +          char buf[2048];
> +
> +          fclose (yyout);
> +
> +          src_fd = open (tmp_filename, O_RDONLY | O_BINARY);
> +          if (src_fd < 0)
> +            error (EXIT_FAILURE, errno, _("cannot open source file"));
> +
> +          dest_fd = open (file_list[i], O_WRONLY | O_BINARY | O_TRUNC);
> +          if (dest_fd < 0)
> +            error (EXIT_FAILURE, errno, _("cannot open destination file"));
> +
> +          for (;;)
> +            {
> +              size_t n_read = safe_read (src_fd, buf, sizeof (buf));
> +              if (n_read == SAFE_READ_ERROR)
> +                error (EXIT_FAILURE, errno, _("error reading \"%s\""),
> +                       tmp_filename);
> +              if (n_read == 0)
> +                break;
> +
> +              if (full_write (dest_fd, buf, n_read) < n_read)
> +                error (EXIT_FAILURE, errno, _("error writing \"%s\""),
> +                       file_list[i]);
> +            }
> +
> +          close (src_fd);
> +          close (dest_fd);
> +
> +          unlink (tmp_filename);
> +        }
>      }
>  
> +
>    exit (max_err);
>  }
> diff --git a/tests/test-common b/tests/test-common
> index e393eeb..37a1f4d 100644
> --- a/tests/test-common
> +++ b/tests/test-common
> @@ -27,5 +27,16 @@ else
>    fail=1
>  fi
>  
> -test $fail = 0 && rm -f $t.I $t.O $t.e $t.EO $t.Ee $extra_temps
> +cp $t.I $t.Ii
> +cppi -i $t.Ii
> +cppi $t.I > $t.Iio
> +
> +if cmp  $t.Ii $t.Iio ; then
> +  :
> +else
> +  echo "the in-place option generated a different file"
> +  fail=1
> +fi
> +
> +test $fail = 0 && rm -f $t.I $t.O $t.e $t.EO $t.Ii $t.Iio $t.Ee $extra_temps
>  exit $fail



From MAILER-DAEMON Wed Mar 17 17:33:12 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Ns0rY-00038K-6O
	for mharc-bug-cppi@gnu.org; Wed, 17 Mar 2010 17:33:12 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Ns0rW-00036c-Ph
	for bug-cppi@gnu.org; Wed, 17 Mar 2010 17:33:10 -0400
Received: from [140.186.70.92] (port=51946 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Ns0rV-00034v-Ad
	for bug-cppi@gnu.org; Wed, 17 Mar 2010 17:33:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1Ns0rT-0004le-3I
	for bug-cppi@gnu.org; Wed, 17 Mar 2010 17:33:09 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:60313)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1Ns0rS-0004lT-EE
	for bug-cppi@gnu.org; Wed, 17 Mar 2010 17:33:07 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id AEC138180B6
	for <bug-cppi@gnu.org>; Wed, 17 Mar 2010 22:33:02 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id C7548818015
	for <bug-cppi@gnu.org>; Wed, 17 Mar 2010 22:32:59 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 6A099979; Wed, 17 Mar 2010 22:32:59 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-cppi@gnu.org
Date: Wed, 17 Mar 2010 22:32:59 +0100
Message-ID: <871vfiy6pg.fsf@meyering.net>
Lines: 169
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Subject: [bug-cppi] cppi.pot, finally
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Mar 2010 21:33:11 -0000

FYI, now cppi generates a .pot file.

>From 537db2bb914946facb4439de2c279e17fa3c6147 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 17 Mar 2010 20:41:22 +0100
Subject: [PATCH 1/3] maint: use gettext 0.17

* configure.ac: Use gettext 0.17
---
 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index ae63560..3897672 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,7 +80,7 @@ AC_HEADER_DIRENT
 AC_HEADER_ASSERT

 AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.15])
+AM_GNU_GETTEXT_VERSION([0.17])

 AC_CONFIG_FILES(
   Makefile
--
1.7.0.2.451.g960ec


>From 1f2dfdf9469e585445bcf9d50fad7189b82d13cc Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 17 Mar 2010 22:16:30 +0100
Subject: [PATCH 2/3] maint: remove unused file: help2man

* man/help2man: Remove file.  It was never used.
---
 man/help2man |  637 ----------------------------------------------------------
 1 files changed, 0 insertions(+), 637 deletions(-)
 delete mode 100755 man/help2man

diff --git a/man/help2man b/man/help2man
deleted file mode 100755
index 6cb56ad..0000000
...
--
1.7.0.2.451.g960ec


>From 7109fdd83f27707331115ec044b90f149ca9da8d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 17 Mar 2010 20:50:07 +0100
Subject: [PATCH 3/3] maint: set up for message translations

* po/POTFILES.in: New file.
* po/Makefile.am: Remove file.
* configure.ac (AC_CONFIG_FILES): List po/Makefile.in,
not po/Makefile.
* .gitignore: Update.
* TODO: Remove the item, now that it's done.
* README-release: Now that we generate a .pot file, add
coordinator@translationproject.org to the announcement Cc: list.
---
 .gitignore     |    8 ++++++++
 README-release |    2 +-
 TODO           |    3 ---
 configure.ac   |    2 +-
 po/Makefile.am |    1 -
 po/POTFILES.in |   12 ++++++++++++
 6 files changed, 22 insertions(+), 6 deletions(-)
 delete mode 100644 po/Makefile.am
 create mode 100644 po/POTFILES.in

diff --git a/.gitignore b/.gitignore
index 852a202..0fd3f79 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 *.o
+*/.deps
 *~
 .tarball-version
 .version
@@ -21,12 +22,19 @@ cppi-*.tar.bz2
 cppi-*.tar.gz
 doc
 lib/.gitignore
+lib/arg-nonnull.h
+lib/c++defs.h
 lib/charset.alias
 lib/configmake.h
 lib/libcppi.a
+lib/link-warning.h
+lib/warn-on-use.h
 m4/.gitignore
 po/.gitignore
 po/LINGUAS
 po/Makevars
+po/POTFILES
+po/cppi.pot
+po/stamp-po
 stamp-h1
 tests/*.log
diff --git a/README-release b/README-release
index fe6e08a..e8bb4db 100644
--- a/README-release
+++ b/README-release
@@ -57,7 +57,7 @@ Once all the builds and tests have passed,
 * Send the gpg-signed announcement mail, e.g.,

     To: info-gnu@gnu.org
-    Cc: bug-cppi@gnu.org
+    Cc: bug-cppi@gnu.org, coordinator@translationproject.org
     Subject: cppi-1.14 released [stable]

 * Announce it on Savannah, too:
diff --git a/TODO b/TODO
index 6807dd5..1d1ccad 100644
--- a/TODO
+++ b/TODO
@@ -27,9 +27,6 @@ and flex is not available.

 Likewise with cpp.gp and gperf (do this via the `missing' script).

-
-Add gettext support.
-
 Currently, the indentation width is hard-coded
 at one space per nesting level.  Add an option to change that.

diff --git a/configure.ac b/configure.ac
index 3897672..de51232 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,7 @@ AM_GNU_GETTEXT_VERSION([0.17])
 AC_CONFIG_FILES(
   Makefile
   lib/Makefile
-  po/Makefile
+  po/Makefile.in
   src/Makefile
   tests/Makefile
   man/Makefile)
diff --git a/po/Makefile.am b/po/Makefile.am
deleted file mode 100644
index 05ab994..0000000
--- a/po/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-## Process this file with automake to produce Makefile.in.
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..bd58fd5
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,12 @@
+# List of source files which contain translatable strings.
+
+lib/closeout.c
+lib/error.c
+lib/getopt.c
+lib/obstack.c
+lib/quotearg.c
+lib/version-etc.c
+lib/xalloc-die.c
+lib/xstrtol-error.c
+src/cppi.l
+src/system.h
--
1.7.0.2.451.g960ec



From MAILER-DAEMON Thu Mar 18 02:48:54 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Ns9XK-00027D-9i
	for mharc-bug-cppi@gnu.org; Thu, 18 Mar 2010 02:48:54 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Ns9XJ-00026d-2y
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 02:48:53 -0400
Received: from [140.186.70.92] (port=39345 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Ns9XH-00025r-Iv
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 02:48:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1Ns9XG-00013n-3v
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 02:48:51 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:38803)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>)
	id 1Ns9XF-00013Y-G2; Thu, 18 Mar 2010 02:48:50 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id C45B2818089;
	Thu, 18 Mar 2010 07:48:44 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id A64EE818040;
	Thu, 18 Mar 2010 07:48:41 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 46757935; Thu, 18 Mar 2010 07:48:41 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: info-gnu@gnu.org
Date: Thu, 18 Mar 2010 07:48:35 +0100
Message-ID: <87pr32w2f0.fsf@meyering.net>
Lines: 29
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha256; protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Cc: coordinator@translationproject.org, bug-cppi@gnu.org
Subject: [bug-cppi] cppi-1.15 released [stable]
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 18 Mar 2010 06:48:53 -0000

--=-=-=

The only significant change didn't make it into NEWS:
cppi now generates a .pot file, so the next release
will ship with translated messages.

Here are the compressed sources:
  http://ftp.gnu.org/gnu/cppi/cppi-1.15.tar.xz   (412KB)

Here are the GPG detached signatures[*]:
  http://ftp.gnu.org/gnu/cppi/cppi-1.15.tar.xz.sig

[*] You can use either of the above signature files to verify that
the corresponding file (without the .sig suffix) is intact.  First,
be sure to download both the .sig file and the corresponding tarball.
Then, run a command like this:

  gpg --verify cppi-1.15.tar.xz.sig

If that command fails because you don't have the required public key,
then run this command to import it:

  gpg --keyserver keys.gnupg.net --recv-keys B9AB9A16

and rerun the `gpg --verify' command.

This release was bootstrapped with the following tools:
  Autoconf 2.65.54-80019
  Automake 1.11a
  Gnulib v0.0-3573-gd036981

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10-svn4867 (GNU/Linux)

iQIcBAEBCAAGBQJLoczJAAoJENd//eG5q5oW+iwP/R1NuZzWeVajosELBKT5/F8/
y2xhunrFkAkUUeQVaC7wSwJBSXaIWiFjwyO/H1UMuyvW3THPgGQCUWi3Fqd0TLJZ
HwNzBBzUXXPLlZ3vP6W5k8y4HVmIpQez0PMnI6espJZIZ72UVfsDlOrXPggpAK70
oD9QmruAc8prOyHSU/++YhdP5JFQyCmpOJgiZ6brlasZKmn3PQk16/EpqlTEUfhg
8U0/Dqo2rh51QUMlxZz2Iz8QdOknBURi67/Gbra7d7kePkhAmxZNSGkH6FSJ+xTm
YPFL/1fd3Os3uHH6+ZiykOYrsSlor81ktuT96AZ2n6eZNieR+MIzwkRlnIsBO+S9
Rk6N8imrn7RCAk0D0GNH3TVBudI2N6zWUtLnMfXqCNNwl5uqVsuSNZwV1G8VQDlj
5H78u7gUO9jp6rqod8IjXTBa5LaI+1EcCtRumkVPnWCTuYopsn5SUni8yo2iy5I0
kJwzLbbaM3/G5zxGeF0/pRi2CWvCt5aWHFfnoNl9Qsv5PWgCO0+NRFCHz/AV+LuN
iI+g5vFDqY91Cq9gELKGfEIrsoAkQUIEzxxItnMu2K2SRQ8w1Y5RkXsFDDBGANtX
R/a9A7ZQVPvMx9HWUZu7pkyDm++6kMefud8I+dCSFd+mNF2pyPSczTYXQd34o7ke
TrbQFDErPeoavOOE0e8o
=uATM
-----END PGP SIGNATURE-----
--=-=-=--



From MAILER-DAEMON Thu Mar 18 07:02:15 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NsDUV-0001pw-B0
	for mharc-bug-cppi@gnu.org; Thu, 18 Mar 2010 07:02:15 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NsDUT-0001o9-OE
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:02:13 -0400
Received: from [140.186.70.92] (port=41408 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NsDUS-0001lx-7u
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:02:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NsDUQ-0003IQ-P7
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:02:12 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:41466)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NsDUQ-0003IA-2X
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:02:10 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id EE4EA8181BB
	for <bug-cppi@gnu.org>; Thu, 18 Mar 2010 12:02:05 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 1B82C81819D
	for <bug-cppi@gnu.org>; Thu, 18 Mar 2010 12:02:02 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 3F2E5A87; Thu, 18 Mar 2010 12:02:02 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-cppi@gnu.org
Date: Thu, 18 Mar 2010 12:02:02 +0100
Message-ID: <87vdctuc45.fsf@meyering.net>
Lines: 42
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Subject: [bug-cppi] [PATCH] doc: update 1.15's NEWS, belatedly
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 18 Mar 2010 11:02:14 -0000

FYI

>From 438c7b3e90084f54b5277ffbaaa4eb14e300f3e0 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 18 Mar 2010 12:01:36 +0100
Subject: [PATCH] doc: update 1.15's NEWS, belatedly

* NEWS: Mention in 1.15's NEWS that we now ship a .pot file.
* cfg.mk (old_NEWS_hash): Update.
---
 NEWS   |    2 ++
 cfg.mk |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/NEWS b/NEWS
index 038fe7a..2f1cd98 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ GNU cppi NEWS                                               -*- outline -*-

 * Noteworthy changes in release 1.15 (2010-03-18) [stable]

+  This package now includes a .pot file, so the next release
+  should include translations for some diagnostics.

 * Noteworthy changes in release 1.14 (2010-03-03) [stable]
   infrastructure
diff --git a/cfg.mk b/cfg.mk
index cc9e440..525712d 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -28,7 +28,7 @@ gnulib_dir = /gnulib
 # Now that we have better (check.mk) tests, make this the default.
 export VERBOSE = yes

-old_NEWS_hash = 9833a8063f2490351c1e842d44176d29
+old_NEWS_hash = 33baa6cc170e88d0627ef86668414353

 # Indent only with spaces.
 sc_prohibit_tab_based_indentation:
--
1.7.0.2.451.g960ec



From MAILER-DAEMON Thu Mar 18 07:25:22 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NsDqs-0007S2-7A
	for mharc-bug-cppi@gnu.org; Thu, 18 Mar 2010 07:25:22 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NsDqq-0007RH-Dl
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:25:20 -0400
Received: from [140.186.70.92] (port=35849 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NsDqp-0007Qb-35
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:25:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NsDqn-0007D8-Ns
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:25:18 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:32962)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NsDqn-0007Bg-3L
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:25:17 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 658BB818104
	for <bug-cppi@gnu.org>; Thu, 18 Mar 2010 12:25:11 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 884BB818039
	for <bug-cppi@gnu.org>; Thu, 18 Mar 2010 12:25:09 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 71DCD9B7; Thu, 18 Mar 2010 12:25:09 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-cppi@gnu.org
Date: Thu, 18 Mar 2010 12:25:09 +0100
Message-ID: <87pr31ub1m.fsf@meyering.net>
Lines: 25
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Subject: [bug-cppi] [PATCH] doc: mention other bootstrap tools -- so they
	appear in announcement
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 18 Mar 2010 11:25:21 -0000

FYI,

>From 0f93650f457f1243bb74d8f1130a94c7dc26c601 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 18 Mar 2010 12:13:27 +0100
Subject: [PATCH] doc: mention other bootstrap tools -- so they appear in announcement

* cfg.mk (bootstrap-tools): Set it, to also mention flex, gperf and help2man.
---
 cfg.mk |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 525712d..f32a31d 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -42,4 +42,6 @@ sc_prohibit_emacs__indent_tabs_mode__setting:
 	msg='use of emacs indent-tabs-mode: setting'			\
 	  $(_prohibit_regexp)

+bootstrap-tools = autoconf,automake,flex,gnulib,gperf,help2man
+
 include $(srcdir)/dist-check.mk
--
1.7.0.2.451.g960ec



From MAILER-DAEMON Thu Mar 18 07:34:05 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NsDzJ-0002yh-G8
	for mharc-bug-cppi@gnu.org; Thu, 18 Mar 2010 07:34:05 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NsDzH-0002wh-QF
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:34:03 -0400
Received: from [140.186.70.92] (port=59157 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NsDzF-0002tr-MI
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:34:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NsDzE-0008U9-4q
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:34:01 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:49751)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NsDzD-0008Tl-I7
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 07:34:00 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id D7226818151
	for <bug-cppi@gnu.org>; Thu, 18 Mar 2010 12:33:55 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id F109B818098
	for <bug-cppi@gnu.org>; Thu, 18 Mar 2010 12:33:52 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id D51719B7; Thu, 18 Mar 2010 12:33:52 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-cppi@gnu.org
Date: Thu, 18 Mar 2010 12:33:52 +0100
Message-ID: <87k4t9uan3.fsf@meyering.net>
Lines: 83
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Subject: [bug-cppi] [PATCH] maint: use automake's $(AM_V_GEN) and $(AM_V_AT)
	to...
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 18 Mar 2010 11:34:04 -0000

One more:

>From 086985ab9b5ad94e0a6aedcf68848e36ec9a0f93 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 18 Mar 2010 12:33:13 +0100
Subject: [PATCH] maint: use automake's $(AM_V_GEN) and $(AM_V_AT) to...

* src/Makefile.am: ... make build rules print full details with V=1,
and to print only a summary with V=0.  That's better than always
printing full details or suppressing the the unconditionally with "@".
---
 src/Makefile.am |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index e63000d..1bbee54 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,21 +21,22 @@ GPERF_OPTIONS = \
   -C -N cpp_cond_lookup -n -t -s 6 -k '*' --language=ANSI-C

 cpp-cond.c: cpp.gp
-	rm -f $@ $@-tmp
-	$(GPERF) $(GPERF_OPTIONS) $< \
+	$(AM_V_GEN)rm -f $@ $@-tmp
+	$(AM_V_at)$(GPERF) $(GPERF_OPTIONS) $< \
 	  | perl -ne '/__GNUC_STDC_INLINE__/ and print "static\n"; print' \
 	  > $@-tmp
-	chmod a-w $@-tmp
-	mv $@-tmp $@
+	$(AM_V_at)chmod a-w $@-tmp
+	$(AM_V_at)mv $@-tmp $@

 localedir = $(datadir)/locale
 BUILT_SOURCES = localedir.h
 DISTCLEANFILES = localedir.h
 localedir.h: Makefile
-	@rm -f $@-t
-	echo '#define LOCALEDIR "$(localedir)"' >$@-t
-	@chmod a-w $@-t
-	cmp $@-t $@ > /dev/null 2>&1 && rm -f $@-t || { rm -f $@; mv $@-t $@; }
+	$(AM_V_GEN)rm -f $@-t
+	$(AM_V_at)echo '#define LOCALEDIR "$(localedir)"' >$@-t
+	$(AM_V_at)chmod a-w $@-t
+	$(AM_V_at)cmp $@-t $@ > /dev/null 2>&1 && rm -f $@-t \
+	  || { rm -f $@; mv $@-t $@; }

 # flex_debug = #-d
 flex_debug = # -L # suppress #line directives
@@ -51,14 +52,14 @@ AM_LFLAGS = $(flex_debug) $(flex_optimize) $(flex_8_bit)
 # Don't use automake's default .l.c rule.
 # I prefer to make generated .c files unwritable.
 cppi.c: cppi.l
-	rm -f $@
-	$(LEXCOMPILE) $(srcdir)/cppi.l
-	chmod a-w $(LEX_OUTPUT_ROOT).c
-	mv $(LEX_OUTPUT_ROOT).c $@
+	$(AM_V_GEN)rm -f $@
+	$(AM_V_at)$(LEXCOMPILE) $(srcdir)/cppi.l
+	$(AM_V_at)chmod a-w $(LEX_OUTPUT_ROOT).c
+	$(AM_V_at)mv $(LEX_OUTPUT_ROOT).c $@

 cpp.h: cpp.gp Makefile.am
-	@rm -f $@-tmp $@
-	@(								\
+	$(AM_V_GEN)rm -f $@-tmp $@
+	$(AM_V_at)(							\
 	 echo '/* This file is generated automatically from cpp.gp.  */'; \
 	 echo;								\
 	 echo 'enum Eic_type';						\
@@ -74,8 +75,8 @@ cpp.h: cpp.gp Makefile.am
 	 echo '};';							\
 	)								\
 	  > $@-tmp
-	@chmod -w $@-tmp
-	@mv $@-tmp $@
+	$(AM_V_at)chmod -w $@-tmp
+	$(AM_V_at)mv $@-tmp $@

 # This is required because we have broken inter-directory dependencies:
 # in order to generate all man pages, require that cppi be built at
--
1.7.0.2.451.g960ec



From MAILER-DAEMON Thu Mar 18 09:55:09 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NsGBp-0003cx-NL
	for mharc-bug-cppi@gnu.org; Thu, 18 Mar 2010 09:55:09 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NsGBo-0003c3-40
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 09:55:08 -0400
Received: from [140.186.70.92] (port=44378 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NsGBl-0003Zr-Bo
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 09:55:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NsGBj-0008VN-Ai
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 09:55:05 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:40322)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NsGBi-0008Uq-Kt
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 09:55:03 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id BAD1E818165
	for <bug-cppi@gnu.org>; Thu, 18 Mar 2010 14:54:57 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id DFEEF818068
	for <bug-cppi@gnu.org>; Thu, 18 Mar 2010 14:54:54 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id C3118D5A; Thu, 18 Mar 2010 14:54:54 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-cppi@gnu.org
Date: Thu, 18 Mar 2010 14:54:54 +0100
Message-ID: <8739zxspjl.fsf@meyering.net>
Lines: 28
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Subject: [bug-cppi] [PATCH] build: accommodate "make distdir" before "make
	all"
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 18 Mar 2010 13:55:08 -0000

"make distdir" now succeeds even when it's
run before an initial "make".

>From 49d4baaf363bc31b2a3e90bf2c7c446c04e0f9f9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 18 Mar 2010 14:50:55 +0100
Subject: [PATCH] build: accommodate "make distdir" before "make all"

* lib/Makefile.am (dist-hook): Depend on $(noinst_LIBRARIES),
so that "make distdir" can succeed before "make all" has run.
---
 lib/Makefile.am |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 5676549..65480b5 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -3,3 +3,7 @@
 include gnulib.mk

 AM_CFLAGS += $(WARNING_CFLAGS) $(WERROR_CFLAGS)
+
+# Allow "make distdir" to succeed before "make all" has run.
+dist-hook: $(noinst_LIBRARIES)
+.PHONY: dist-hook
--
1.7.0.2.455.g91132



From MAILER-DAEMON Thu Mar 18 15:38:56 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NsLYW-0004Gy-6j
	for mharc-bug-cppi@gnu.org; Thu, 18 Mar 2010 15:38:56 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NsLYU-0004F4-Ip
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 15:38:54 -0400
Received: from [140.186.70.92] (port=52931 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NsLYR-0004B8-8Z
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 15:38:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NsLYP-0006Y5-S0
	for bug-cppi@gnu.org; Thu, 18 Mar 2010 15:38:51 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:35937)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>)
	id 1NsLYP-0006Xq-80; Thu, 18 Mar 2010 15:38:49 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 2D83A8181F9;
	Thu, 18 Mar 2010 20:38:43 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 44E888180B5;
	Thu, 18 Mar 2010 20:38:41 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 27921C6E; Thu, 18 Mar 2010 20:38:41 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-cppi@gnu.org
Date: Thu, 18 Mar 2010 20:38:41 +0100
Message-ID: <87pr31o1xa.fsf@meyering.net>
Lines: 31
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Cc: Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 18 Mar 2010 19:38:54 -0000

Hi Giuseppe,

Thanks for the heads-up about your post.

  http://lists.gnu.org/archive/html/bug-cppi/2010-03/msg00006.html

You seem to have sent that before I subscribed to the list I'd created.
Sorry I missed it:

Quick comments:

I'm not sure this is worth doing, but if it is you'll have
to make a few changes:

  - detect any write failure (i.e, don't omit checks for close failure)
  - the replacement must be atomic, which means the temporary
      file must be on the same file system as the destination (usually
      in the same directory), and the final operation is a rename
      syscall.
  - upon interrupt, the temporary file must be removed
  - also report any unlink failure
  - handle fclose failure, too -- use gnulib's close_stream function

I hesitated to enumerate that list (may well be incomplete),
because I don't want to give the impression that once you fix
everything it will be acceptable.

I'm really doubtful that adding the required complexity
is worthwhile.  Besides, isn't there a simple utility
program that can turn any filter program into an
operate-on-target-file-in-place utility?



From MAILER-DAEMON Fri Mar 19 18:29:03 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nskgh-0004Rd-BO
	for mharc-bug-cppi@gnu.org; Fri, 19 Mar 2010 18:29:03 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nskgf-0004QE-C5
	for bug-cppi@gnu.org; Fri, 19 Mar 2010 18:29:01 -0400
Received: from [140.186.70.92] (port=42362 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nskgd-0004Oy-TQ
	for bug-cppi@gnu.org; Fri, 19 Mar 2010 18:29:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gmail.com>) id 1Nskgc-00056O-RN
	for bug-cppi@gnu.org; Fri, 19 Mar 2010 18:28:59 -0400
Received: from qw-out-1920.google.com ([74.125.92.145]:50398)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gmail.com>)
	id 1Nskgb-00055T-BS; Fri, 19 Mar 2010 18:28:57 -0400
Received: by qw-out-1920.google.com with SMTP id 4so435776qwk.24
	for <multiple recipients>; Fri, 19 Mar 2010 15:28:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:sender:received:from:to:cc
	:subject:references:date:in-reply-to:message-id:user-agent
	:mime-version:content-type;
	bh=6EdZZK0Z/lvQS3PvZSPfCfazhKxnJtI1+PcyMgD3Ob0=;
	b=FLPaDOTeET2HzMnkp1A1FDgAc7DOjtAI1Et8S36xnMSAKFkj1//W6qmXnHXiDriDKh
	pWDF66poD9R6qFiLnvjCP+ii66ke/9fGmR+uvnMLmEwPhJCaKfx4FNaC/k5AjQnlql7I
	FgwdjMbIf17olIdzCWLWAHz29O5iMCdADRb6Y=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type;
	b=BFm6Yz8CnEpzmJN/u8GFz1vmV5NiTfM/MLqgbwQIRVtougi+jEdC6u9u4ON4zGA4MF
	0tSNn9L+XalD2AH0cCp552xarMbp8QuJb1bZGXZVacPNY7Xd5oDPymHeab34NNsTIbTq
	NdTUWZpoQYaFxwmGBlBDSF7Jrg6cJn+nWpoFU=
Received: by 10.229.192.142 with SMTP id dq14mr278998qcb.81.1269037736760;
	Fri, 19 Mar 2010 15:28:56 -0700 (PDT)
Received: from black (dhcp-18-111-27-188.dyn.mit.edu [18.111.27.188])
	by mx.google.com with ESMTPS id 20sm505072qyk.8.2010.03.19.15.28.54
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Fri, 19 Mar 2010 15:28:55 -0700 (PDT)
Sender: Giuseppe Scrivano <gscrivano@gmail.com>
Received: from localhost ([127.0.0.1] helo=black)
	by black with esmtp (Exim 4.71) (envelope-from <gscrivano@gnu.org>)
	id 1NseLL-000417-KO; Fri, 19 Mar 2010 16:42:35 +0100
From: Giuseppe Scrivano <gscrivano@gnu.org>
To: Jim Meyering <jim@meyering.net>
References: <87pr31o1xa.fsf@meyering.net>
Date: Fri, 19 Mar 2010 16:42:35 +0100
In-Reply-To: <87pr31o1xa.fsf@meyering.net> (Jim Meyering's message of "Thu, 18
	Mar 2010 20:38:41 +0100")
Message-ID: <874okcwc5w.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Cc: bug-cppi@gnu.org
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 19 Mar 2010 22:29:01 -0000

Hi Jim,


Jim Meyering <jim@meyering.net> writes:

> I'm really doubtful that adding the required complexity
> is worthwhile.  Besides, isn't there a simple utility
> program that can turn any filter program into an
> operate-on-target-file-in-place utility?

I don't know of any program doing this.  I see that it would be a better
solution that can be used by other filters as well; does it worth to
write one?

Thanks,
Giuseppe



From MAILER-DAEMON Sat Mar 20 04:33:19 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nsu7S-00042S-UK
	for mharc-bug-cppi@gnu.org; Sat, 20 Mar 2010 04:33:18 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nsu7Q-00041F-MR
	for bug-cppi@gnu.org; Sat, 20 Mar 2010 04:33:16 -0400
Received: from [140.186.70.92] (port=32950 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nsu7O-0003zf-AL
	for bug-cppi@gnu.org; Sat, 20 Mar 2010 04:33:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1Nsu7N-0001Nm-4O
	for bug-cppi@gnu.org; Sat, 20 Mar 2010 04:33:14 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:55422)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>)
	id 1Nsu7H-0001La-6T; Sat, 20 Mar 2010 04:33:08 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 34096818145;
	Sat, 20 Mar 2010 09:33:00 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 1C15A818173;
	Sat, 20 Mar 2010 09:32:58 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 9416D9BA; Sat, 20 Mar 2010 09:32:57 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Giuseppe Scrivano <gscrivano@gnu.org>
In-Reply-To: <874okcwc5w.fsf@gnu.org> (Giuseppe Scrivano's message of "Fri, 19
	Mar 2010 16:42:35 +0100")
References: <87pr31o1xa.fsf@meyering.net> <874okcwc5w.fsf@gnu.org>
Date: Sat, 20 Mar 2010 09:32:57 +0100
Message-ID: <878w9n4cli.fsf@meyering.net>
Lines: 26
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Cc: bug-cppi@gnu.org, bug-coreutils@gnu.org
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 20 Mar 2010 08:33:16 -0000

Hello,

[Cc'ing bug-coreutils...]

Giuseppe proposed to add the --in-place option to GNU cppi,
(cppi is a small program that can act as a filter
  http://savannah.gnu.org/forum/forum.php?forum_id=6210
but cppi is so small that adding even that single, relatively
simple option would make it substantially more complicated.

I'm nearly certain I've seen a program (possibly a small
perl script) that can effectively add the --in-place
functionality to any filter program, but so far my searches
have been in vain.

I want a tool that works like this:

    in-place [--backup] 'cppi ...options' *.c

For each .c file, it would apply the filter program, and upon each
successful exit, it would update the .c file in place (atomically,
of course) with the output from the filter.

Can anyone point to existing code that does that?

Jim



From MAILER-DAEMON Sun Mar 21 07:15:16 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NtJ7k-0003TW-BC
	for mharc-bug-cppi@gnu.org; Sun, 21 Mar 2010 07:15:16 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NtJ7i-0003Rt-PR
	for bug-cppi@gnu.org; Sun, 21 Mar 2010 07:15:14 -0400
Received: from [140.186.70.92] (port=50511 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NtJ7g-0003QK-Lb
	for bug-cppi@gnu.org; Sun, 21 Mar 2010 07:15:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NtJ7f-0006Oj-Ee
	for bug-cppi@gnu.org; Sun, 21 Mar 2010 07:15:12 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:37462)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>)
	id 1NtJ7a-0006Nr-H6; Sun, 21 Mar 2010 07:15:07 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id E44848180A4;
	Sun, 21 Mar 2010 12:15:00 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 1128181805A;
	Sun, 21 Mar 2010 12:14:58 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id EA4AA6FF; Sun, 21 Mar 2010 12:14:57 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: =?utf-8?Q?P=C3=A1draig?= Brady <P@draigBrady.com>
In-Reply-To: <4BA56639.6080809@draigBrady.com> (=?utf-8?Q?=22P=C3=A1draig?=
	Brady"'s message of "Sun, 21 Mar 2010 00:20:09 +0000")
References: <87pr31o1xa.fsf@meyering.net> <874okcwc5w.fsf@gnu.org>
	<878w9n4cli.fsf@meyering.net> <4BA56639.6080809@draigBrady.com>
Date: Sun, 21 Mar 2010 12:14:57 +0100
Message-ID: <8739zux6xa.fsf@meyering.net>
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Cc: bug-cppi@gnu.org, bug-coreutils@gnu.org,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 21 Mar 2010 11:15:15 -0000

P=C3=A1draig Brady wrote:

> On 20/03/10 08:32, Jim Meyering wrote:
>> Hello,
>>
>> [Cc'ing bug-coreutils...]
>>
>> Giuseppe proposed to add the --in-place option to GNU cppi,
>> (cppi is a small program that can act as a filter
>>   http://savannah.gnu.org/forum/forum.php?forum_id=3D6210
>> but cppi is so small that adding even that single, relatively
>> simple option would make it substantially more complicated.
>>
>> I'm nearly certain I've seen a program (possibly a small
>> perl script) that can effectively add the --in-place
>> functionality to any filter program, but so far my searches
>> have been in vain.
>>
>> I want a tool that works like this:
>>
>>     in-place [--backup] 'cppi ...options' *.c
>>
>> For each .c file, it would apply the filter program, and upon each
>> successful exit, it would update the .c file in place (atomically,
>> of course) with the output from the filter.
>>
>> Can anyone point to existing code that does that?
>
> Well we were talking about a small "replace" or "inplace" script,
> in coreutils/contrib/ which would use the facilities of various coreutils
> http://lists.gnu.org/archive/html/bug-coreutils/2009-09/msg00327.html
> I didn't get any feedback on the new cp --attributes-only option
> though so was worried about adding this new interface.

Sorry I didn't reply.
Your --attributes-only option looks worthwhile.

However, I think the default behavior of an
update-via-filter-and-replace program should use
the temp-file-in-same-directory-and-rename technique
rather than the non-atomic alternative.
The case in which the destination directory is
unwritable is far less common, so if we support that
at all, it should be only as a fallback, or perhaps
only if some option is specified.



From MAILER-DAEMON Mon Mar 22 08:56:29 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NthBF-0002AV-Co
	for mharc-bug-cppi@gnu.org; Mon, 22 Mar 2010 08:56:29 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nt8y4-0002iJ-Ml
	for bug-cppi@gnu.org; Sat, 20 Mar 2010 20:24:36 -0400
Received: from [140.186.70.92] (port=42585 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nt8xz-0002he-HG
	for bug-cppi@gnu.org; Sat, 20 Mar 2010 20:24:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1Nt8xu-00005b-MA
	for bug-cppi@gnu.org; Sat, 20 Mar 2010 20:24:31 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:4846)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1Nt8xu-00005D-B7
	for bug-cppi@gnu.org; Sat, 20 Mar 2010 20:24:26 -0400
Received: (qmail 69982 invoked from network); 21 Mar 2010 00:24:21 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 21 Mar 2010 00:24:21 -0000
Message-ID: <4BA56639.6080809@draigBrady.com>
Date: Sun, 21 Mar 2010 00:20:09 +0000
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
References: <87pr31o1xa.fsf@meyering.net> <874okcwc5w.fsf@gnu.org>
	<878w9n4cli.fsf@meyering.net>
In-Reply-To: <878w9n4cli.fsf@meyering.net>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Mailman-Approved-At: Mon, 22 Mar 2010 08:56:28 -0400
Cc: bug-cppi@gnu.org, bug-coreutils@gnu.org,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 21 Mar 2010 00:24:36 -0000

On 20/03/10 08:32, Jim Meyering wrote:
> Hello,
> 
> [Cc'ing bug-coreutils...]
> 
> Giuseppe proposed to add the --in-place option to GNU cppi,
> (cppi is a small program that can act as a filter
>   http://savannah.gnu.org/forum/forum.php?forum_id=6210
> but cppi is so small that adding even that single, relatively
> simple option would make it substantially more complicated.
> 
> I'm nearly certain I've seen a program (possibly a small
> perl script) that can effectively add the --in-place
> functionality to any filter program, but so far my searches
> have been in vain.
> 
> I want a tool that works like this:
> 
>     in-place [--backup] 'cppi ...options' *.c
> 
> For each .c file, it would apply the filter program, and upon each
> successful exit, it would update the .c file in place (atomically,
> of course) with the output from the filter.
> 
> Can anyone point to existing code that does that?

Well we were talking about a small "replace" or "inplace" script,
in coreutils/contrib/ which would use the facilities of various coreutils
http://lists.gnu.org/archive/html/bug-coreutils/2009-09/msg00327.html
I didn't get any feedback on the new cp --attributes-only option
though so was worried about adding this new interface.

cheers,
Pįdraig.



From MAILER-DAEMON Mon Mar 22 08:56:30 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NthBG-0002BI-5E
	for mharc-bug-cppi@gnu.org; Mon, 22 Mar 2010 08:56:30 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NtYLv-00040z-Q7
	for bug-cppi@gnu.org; Sun, 21 Mar 2010 23:30:55 -0400
Received: from [140.186.70.92] (port=58856 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NtYLt-00040l-7U
	for bug-cppi@gnu.org; Sun, 21 Mar 2010 23:30:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1NtYLl-00087U-NP
	for bug-cppi@gnu.org; Sun, 21 Mar 2010 23:30:46 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:8570)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1NtYLl-000876-9b
	for bug-cppi@gnu.org; Sun, 21 Mar 2010 23:30:45 -0400
Received: (qmail 40317 invoked from network); 22 Mar 2010 03:30:43 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 22 Mar 2010 03:30:43 -0000
Message-ID: <4BA6E35C.8070205@draigBrady.com>
Date: Mon, 22 Mar 2010 03:26:20 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
References: <87pr31o1xa.fsf@meyering.net>
	<874okcwc5w.fsf@gnu.org>	<878w9n4cli.fsf@meyering.net>
	<4BA56639.6080809@draigBrady.com> <8739zux6xa.fsf@meyering.net>
In-Reply-To: <8739zux6xa.fsf@meyering.net>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Mailman-Approved-At: Mon, 22 Mar 2010 08:56:28 -0400
Cc: bug-cppi@gnu.org, bug-coreutils@gnu.org,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Mar 2010 03:30:55 -0000

On 21/03/10 11:14, Jim Meyering wrote:
> PĆ”draig Brady wrote:
> 
>> On 20/03/10 08:32, Jim Meyering wrote:
>>> Hello,
>>>
>>> [Cc'ing bug-coreutils...]
>>>
>>> Giuseppe proposed to add the --in-place option to GNU cppi,
>>> (cppi is a small program that can act as a filter
>>>   http://savannah.gnu.org/forum/forum.php?forum_id=6210
>>> but cppi is so small that adding even that single, relatively
>>> simple option would make it substantially more complicated.
>>>
>>> I'm nearly certain I've seen a program (possibly a small
>>> perl script) that can effectively add the --in-place
>>> functionality to any filter program, but so far my searches
>>> have been in vain.
>>>
>>> I want a tool that works like this:
>>>
>>>     in-place [--backup] 'cppi ...options' *.c
>>>
>>> For each .c file, it would apply the filter program, and upon each
>>> successful exit, it would update the .c file in place (atomically,
>>> of course) with the output from the filter.
>>>
>>> Can anyone point to existing code that does that?
>>
>> Well we were talking about a small "replace" or "inplace" script,
>> in coreutils/contrib/ which would use the facilities of various coreutils
>> http://lists.gnu.org/archive/html/bug-coreutils/2009-09/msg00327.html
>> I didn't get any feedback on the new cp --attributes-only option
>> though so was worried about adding this new interface.
> 
> Sorry I didn't reply.
> Your --attributes-only option looks worthwhile.

You had already expressed support for the idea in the thread,
and the patch is trivial.  I was more worried about not having
noticed other requests for this feature, which is now moot.

> However, I think the default behavior of an
> update-via-filter-and-replace program should use
> the temp-file-in-same-directory-and-rename technique
> rather than the non-atomic alternative.

Right. So the logic would be something like:

tf2=$(mktemp)
cleanup() { rm -f "$tf2"; } #TODO: tf1
trap "cleanup" EXIT
for file in *.whatever; do
  dir=$(dirname "$file")
  tf1=$(mktemp --tmpdir="$dir")
  if cp --attr "$file" "$tf1"; then
    # "$file" updated atomically
    # Should we `chmod u+rw` here to allow updating non rw files?
    $filter "$file" > "$tf1" &&
    mv "$tf1" "$file" #rename
  else
    # Note we don't use mv to unlink/copy as
    # /tmp might not support all attrs.
    # Also can't unlink in unwriteable dir.
    # Note won't be able to update non rw files here
    $filter "$file" > "$tf2" &&
    cp "$tf2" "$file" #truncate + copy
  fi
  rm -f "$tf1"
done

> The case in which the destination directory is
> unwritable is far less common, so if we support that
> at all, it should be only as a fallback, or perhaps
> only if some option is specified.

Auto fallback would be most appropriate I think.

cheers,
PĆ”draig.



From MAILER-DAEMON Mon Mar 22 08:56:30 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NthBG-0002CS-8I
	for mharc-bug-cppi@gnu.org; Mon, 22 Mar 2010 08:56:30 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Ntf50-0003L1-4I
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 06:41:54 -0400
Received: from [140.186.70.92] (port=57498 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Ntf4y-0003Jw-AM
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 06:41:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1Ntf4v-0002QJ-JT
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 06:41:51 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:5539)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1Ntf4v-0002Pf-B8
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 06:41:49 -0400
Received: (qmail 21153 invoked from network); 22 Mar 2010 10:41:46 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 22 Mar 2010 10:41:46 -0000
Message-ID: <4BA74860.1030305@draigBrady.com>
Date: Mon, 22 Mar 2010 10:37:20 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
References: <87pr31o1xa.fsf@meyering.net>	<874okcwc5w.fsf@gnu.org>	<878w9n4cli.fsf@meyering.net>	<4BA56639.6080809@draigBrady.com>
	<8739zux6xa.fsf@meyering.net> <4BA6E35C.8070205@draigBrady.com>
In-Reply-To: <4BA6E35C.8070205@draigBrady.com>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Mailman-Approved-At: Mon, 22 Mar 2010 08:56:28 -0400
Cc: bug-cppi@gnu.org, bug-coreutils@gnu.org,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Mar 2010 10:41:54 -0000

On 22/03/10 03:26, PĆ”draig Brady wrote:
> Right. So the logic would be something like:

Here is a tested `replace` script which is backwards
compatible (non atomically) with older coreutils.

#!/bin/sh

me=$(basename $0)

usage() {
  err=$1; out=2
  [ $err -eq 0 ] && out=1
  echo "$me 'filter' FILE..." >&$out
  exit $err
}

version() {
  Cmd=$1; Date=2010; Version=8.5 #TODO: auto update
  #TODO: translation
  printf "\
$Cmd (GNU coreutils) $Version
Copyright (C) $Date Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by PĆ”draig Brady.
"
  exit 0
}

# TODO: perhaps support the --compare like `install`
# so as to not cp/mv if ! cmp -s -- "$tf" "$file"

if test "$#" -lt 2; then
  test "$1" = "--help" && usage 0
  test "$1" = "--version" && version $me
  usage 1
fi

filter="$1"; shift

cleanup() { rm -f "$tf"; }
trap "cleanup" EXIT

fail=0
for file in "$@"; do
  dir=$(dirname -- "$file")
  tf=$(mktemp -q --tmpdir="$dir")
  if test -e "$tf" && cp --attr -- "$file" "$tf" 2>/dev/null; then
    # Modify file atomically.
    # We could `chmod u+rw` here to allow updating non rw files?
    $filter < "$file" > "$tf" &&
    { mv -- "$tf" "$file" || fail=1; } # rename
  else
    cleanup
    tf=$(mktemp)
    # cp doesn't support --attributes-only or
    # $dir is not writeable.  In this case we
    # use $TMPDIR, but don't use mv to unlink/copy
    # as $TMPDIR might not support all attrs of $dir.
    # Also we can't unlink in unwriteable dir.
    # Note we won't be able to update non rw files like this.
    $filter < "$file" > "$tf" &&
    { cp -- "$tf" "$file" || fail=1; } # truncate and copy
  fi
done

exit $fail



From MAILER-DAEMON Mon Mar 22 08:56:30 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NthBG-0002D2-Qy
	for mharc-bug-cppi@gnu.org; Mon, 22 Mar 2010 08:56:30 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nth1H-0007jg-Ul
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 08:46:11 -0400
Received: from [140.186.70.92] (port=38382 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nth1F-0007jE-K9
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 08:46:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1Nth1D-0005xx-6E
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 08:46:09 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:14277)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1Nth1C-0005xc-QY
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 08:46:07 -0400
Received: (qmail 54289 invoked from network); 22 Mar 2010 12:46:04 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 22 Mar 2010 12:46:04 -0000
Message-ID: <4BA76581.3030308@draigBrady.com>
Date: Mon, 22 Mar 2010 12:41:37 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
References: <87pr31o1xa.fsf@meyering.net>	<874okcwc5w.fsf@gnu.org>	<878w9n4cli.fsf@meyering.net>	<4BA56639.6080809@draigBrady.com>	<8739zux6xa.fsf@meyering.net>
	<4BA6E35C.8070205@draigBrady.com> <4BA74860.1030305@draigBrady.com>
In-Reply-To: <4BA74860.1030305@draigBrady.com>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Mailman-Approved-At: Mon, 22 Mar 2010 08:56:28 -0400
Cc: bug-cppi@gnu.org, bug-coreutils@gnu.org,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Mar 2010 12:46:12 -0000

On 22/03/10 10:37, PĆ”draig Brady wrote:
> On 22/03/10 03:26, PĆ”draig Brady wrote:
>> Right. So the logic would be something like:
> 
> Here is a tested `replace` script which is backwards
> compatible (non atomically) with older coreutils.

Grr, there is a replace util that comes with mysql-server :(
http://manpages.ubuntu.com/manpages/dapper/en/man1/replace.1.html

So that probably means we need to go with a different name.
`inplace` is the next best one I can think of which
at least mirrors the well known sed --in-place and perl -i options.

Also as Jim previously mentioned, the script would benefit from
passing --backup onto cp/mv.

cheers,
PĆ”draig.



From MAILER-DAEMON Mon Mar 22 12:11:11 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NtkDf-0006v6-A2
	for mharc-bug-cppi@gnu.org; Mon, 22 Mar 2010 12:11:11 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NtkDd-0006uZ-Uo
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 12:11:10 -0400
Received: from [140.186.70.92] (port=40195 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NtkDZ-0006t1-OH
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 12:11:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1NtkDX-00024u-0E
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 12:11:05 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:7624)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1NtkDW-00024g-Kd
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 12:11:02 -0400
Received: (qmail 6323 invoked from network); 22 Mar 2010 16:11:00 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 22 Mar 2010 16:11:00 -0000
Message-ID: <4BA79588.1070702@draigBrady.com>
Date: Mon, 22 Mar 2010 16:06:32 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Eric Blake <eblake@redhat.com>
References: <87pr31o1xa.fsf@meyering.net>	<874okcwc5w.fsf@gnu.org>	<878w9n4cli.fsf@meyering.net>	<4BA56639.6080809@draigBrady.com>	<8739zux6xa.fsf@meyering.net>	<4BA6E35C.8070205@draigBrady.com>
	<4BA74860.1030305@draigBrady.com>
	<4BA76581.3030308@draigBrady.com> <4BA78DD6.70809@redhat.com>
In-Reply-To: <4BA78DD6.70809@redhat.com>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
Cc: bug-cppi@gnu.org, bug-coreutils@gnu.org, Jim Meyering <jim@meyering.net>,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Mar 2010 16:11:10 -0000

On 22/03/10 15:33, Eric Blake wrote:
> On 03/22/2010 06:41 AM, PĆ”draig Brady wrote:
>> So that probably means we need to go with a different name.
>> `inplace` is the next best one I can think of which
>> at least mirrors the well known sed --in-place and perl -i options.
> 
> inplace sounds like a decent name to me.  Sounds like an interesting
> filter to add.

The name is not too bad, but it does annoy me a bit,
as commands are usually of the form
  verb --how
for e.g.
  sed --in-place

But if we used `inplace` we'd change to:
  how "what" file...

By using `replace` we would be back to the more normal form:
  replace "how" file...

However `replace` is used by mysql-server as previously mentioned.
And `repl` is used by nmh. How about keeping with the terse unix
tradition while alluding to the relationship with cp/mv/rm by using...

rp

cheers,
PĆ”draig.



From MAILER-DAEMON Tue Mar 23 02:15:43 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NtxOw-00021F-RH
	for mharc-bug-cppi@gnu.org; Tue, 23 Mar 2010 02:15:42 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NtxOu-00020c-Am
	for bug-cppi@gnu.org; Tue, 23 Mar 2010 02:15:40 -0400
Received: from [140.186.70.92] (port=43119 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NtxOs-00020O-Ra
	for bug-cppi@gnu.org; Tue, 23 Mar 2010 02:15:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NtxOr-0001BT-Qe
	for bug-cppi@gnu.org; Tue, 23 Mar 2010 02:15:38 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:58140)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>)
	id 1NtxOo-0001AF-5W; Tue, 23 Mar 2010 02:15:35 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 3D34E818028;
	Tue, 23 Mar 2010 07:15:27 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 61BEA81809C;
	Tue, 23 Mar 2010 07:15:25 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id EBFCAAC6; Tue, 23 Mar 2010 07:15:24 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: =?utf-8?Q?P=C3=A1draig?= Brady <P@draigBrady.com>
In-Reply-To: <4BA79588.1070702@draigBrady.com> (=?utf-8?Q?=22P=C3=A1draig?=
	Brady"'s message of "Mon, 22 Mar 2010 16:06:32 +0000")
References: <87pr31o1xa.fsf@meyering.net> <874okcwc5w.fsf@gnu.org>
	<878w9n4cli.fsf@meyering.net> <4BA56639.6080809@draigBrady.com>
	<8739zux6xa.fsf@meyering.net> <4BA6E35C.8070205@draigBrady.com>
	<4BA74860.1030305@draigBrady.com> <4BA76581.3030308@draigBrady.com>
	<4BA78DD6.70809@redhat.com> <4BA79588.1070702@draigBrady.com>
Date: Tue, 23 Mar 2010 07:15:24 +0100
Message-ID: <87k4t3o96r.fsf@meyering.net>
Lines: 32
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Cc: bug-coreutils@gnu.org, bug-cppi@gnu.org, Eric Blake <eblake@redhat.com>,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 23 Mar 2010 06:15:40 -0000

P=C3=A1draig Brady wrote:
> On 22/03/10 15:33, Eric Blake wrote:
>> On 03/22/2010 06:41 AM, P=C3=A1draig Brady wrote:
>>> So that probably means we need to go with a different name.
>>> `inplace` is the next best one I can think of which
>>> at least mirrors the well known sed --in-place and perl -i options.
>>
>> inplace sounds like a decent name to me.  Sounds like an interesting
>> filter to add.
>
> The name is not too bad, but it does annoy me a bit,
> as commands are usually of the form
>   verb --how
> for e.g.
>   sed --in-place
>
> But if we used `inplace` we'd change to:
>   how "what" file...
>
> By using `replace` we would be back to the more normal form:
>   replace "how" file...
>
> However `replace` is used by mysql-server as previously mentioned.
> And `repl` is used by nmh. How about keeping with the terse unix
> tradition while alluding to the relationship with cp/mv/rm by using...
>
> rp

I wouldn't object.

A possible bastardized compromise: re-place
It's sort of analogous to in-place.



From MAILER-DAEMON Tue Mar 23 08:26:54 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nu3CA-0006q0-Jm
	for mharc-bug-cppi@gnu.org; Tue, 23 Mar 2010 08:26:54 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nu3C8-0006p1-EZ
	for bug-cppi@gnu.org; Tue, 23 Mar 2010 08:26:52 -0400
Received: from [140.186.70.92] (port=41934 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nu3C2-0006nS-EX
	for bug-cppi@gnu.org; Tue, 23 Mar 2010 08:26:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1Nu3C0-0004gK-6k
	for bug-cppi@gnu.org; Tue, 23 Mar 2010 08:26:46 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:2875)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1Nu3Bz-0004fk-RM
	for bug-cppi@gnu.org; Tue, 23 Mar 2010 08:26:44 -0400
Received: (qmail 61982 invoked from network); 23 Mar 2010 12:26:41 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 23 Mar 2010 12:26:41 -0000
Message-ID: <4BA8B26C.3000505@draigBrady.com>
Date: Tue, 23 Mar 2010 12:22:04 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
References: <87pr31o1xa.fsf@meyering.net>
	<874okcwc5w.fsf@gnu.org>	<878w9n4cli.fsf@meyering.net>
	<4BA56639.6080809@draigBrady.com>	<8739zux6xa.fsf@meyering.net>
	<4BA6E35C.8070205@draigBrady.com>	<4BA74860.1030305@draigBrady.com>
	<4BA76581.3030308@draigBrady.com>	<4BA78DD6.70809@redhat.com>
	<4BA79588.1070702@draigBrady.com> <87k4t3o96r.fsf@meyering.net>
In-Reply-To: <87k4t3o96r.fsf@meyering.net>
X-Enigmail-Version: 1.0.1
Content-Type: multipart/mixed; boundary="------------040006050408080300040505"
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
Cc: bug-coreutils@gnu.org, bug-cppi@gnu.org, Eric Blake <eblake@redhat.com>,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 23 Mar 2010 12:26:52 -0000

This is a multi-part message in MIME format.
--------------040006050408080300040505
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 23/03/10 06:15, Jim Meyering wrote:
> PĆ”draig Brady wrote:
>>
>> However `replace` is used by mysql-server as previously mentioned.
>> And `repl` is used by nmh. How about keeping with the terse unix
>> tradition while alluding to the relationship with cp/mv/rm by using...
>>
>> rp
> 
> I wouldn't object.
> 
> A possible bastardized compromise: re-place
> It's sort of analogous to in-place.

None of rp, inplace, re-place are great TBH.
Anyway attached is the latest version.
It's getting a bit complicated, but I don't
think much more needs to go in (maybe translations?)

cheers,
PĆ”draig.

--------------040006050408080300040505
Content-Type: text/plain;
 name="rp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="rp"

IyEvYmluL3NoCgptZT0kKGJhc2VuYW1lICQwKQoKdXNhZ2UoKSB7CiAgZXJyPSQxOyBvdXQ9
MgogIFsgJGVyciAtZXEgMCBdICYmIG91dD0xCiAgcHJpbnRmICJcCiRtZSBbT1BUSU9OXSAn
RklMVEVSJyBGSUxFLi4uClJlcGxhY2UgdGhlIGNvbnRlbnRzIG9mIGVhY2ggRklMRSBhZnRl
ciBwcm9jZXNzaW5nIHdpdGggRklMVEVSCgogICAgICAtLWJhY2t1cFs9Q09OVFJPTF0gIG1h
a2UgYSBiYWNrdXAgb2YgZWFjaCBleGlzdGluZyBkZXN0aW5hdGlvbiBmaWxlCiAgLWIgICAg
ICAgICAgICAgICAgICAgICAgbGlrZSAtLWJhY2t1cCBidXQgZG9lcyBub3QgYWNjZXB0IGFu
IGFyZ3VtZW50CiAgLUMsIC0tY29tcGFyZSAgICAgICAgICAgY29tcGFyZSBlYWNoIHBhaXIg
b2Ygc291cmNlIGFuZCBkZXN0aW5hdGlvbiBmaWxlcywgYW5kCiAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBpbiBzb21lIGNhc2VzLCBkbyBub3QgbW9kaWZ5IHRoZSBkZXN0aW5hdGlv
biBhdCBhbGwuCiAgLXAsIC0tcHJlc2VydmUtdGltZXN0YW1wcyAgYXBwbHkgYWNjZXNzL21v
ZGlmaWNhdGlvbiB0aW1lcyBvZiBTT1VSQ0UgZmlsZXMKICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICB0byBjb3JyZXNwb25kaW5nIGRlc3RpbmF0aW9uIGZpbG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RpZnkgZmlsZSBhdG9taWNhbGx5LgogICAgIyBXZSBjb3VsZCBgY2htb2Qg
dStyd2AgaGVyZSB0byBhbGxvdyB1cGRhdGluZyBub24gcncgZmlsZXM/CiAgICBmaWx0ZXJf
ZmlsZSAmJgogICAgeyBtdiAkYmFja3VwIC0tICIkdGYiICIkZmlsZSIgfHwgZmFpbD0xOyB9
ICMgcmVuYW1lCiAgZWxzZQogICAgIyBjcCBkb2Vzbid0IHN1cHBvcnQgLS1hdHRyaWJ1dGVz
LW9ubHkgb3IKICAgICMgJGRpciBpcyBub3Qgd3JpdGVhYmxlLiAgSW4gdGhpcyBjYXNlIHdl
CiAgICAjIHVzZSAkVE1QRElSLCBidXQgZG9uJ3QgdXNlIG12IHRvIHVubGluay9jb3B5CiAg
ICAjIGFzICRUTVBESVIgbWlnaHQgbm90IHN1cHBvcnQgYWxsIGF0dHJzIG9mICRkaXIuCiAg
ICAjIEFsc28gd2UgY2FuJ3QgdW5saW5rIGluIHVud3JpdGVhYmxlIGRpci4KICAgICMgTm90
ZSB3ZSB3b24ndCBiZSBhYmxlIHRvIHVwZGF0ZSBub24gcncgZmlsZXMgbGlrZSB0aGlzLgog
ICAgY2xlYW51cCAjIGRpci9maWxlLnRtcAogICAgdGY9JChta3RlbXApCiAgICBmaWx0ZXJf
ZmlsZSAmJgogICAgeyBjcCAkYmFja3VwIC0tICIkdGYiICIkZmlsZSIgfHwgZmFpbD0xOyB9
ICMgdHJ1bmNhdGUgYW5kIGNvcHkKICAgIHRlc3QgIiRwcmVzZXJ2ZV90aW1lcyIgJiYgdG91
Y2ggIiRmaWxlIiAtLXJlZmVyZW5jZT0iJHRmIgogICAgY2xlYW51cCAjIHRtcC9maWxlLnRt
cAogIGZpCmRvbmUKCmV4aXQgJGZhaWwK
--------------040006050408080300040505--



From MAILER-DAEMON Tue Mar 23 10:18:16 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nu4vw-0002q9-Lj
	for mharc-bug-cppi@gnu.org; Tue, 23 Mar 2010 10:18:16 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NtjeW-0004qv-2a
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 11:34:52 -0400
Received: from [140.186.70.92] (port=58463 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NtjeU-0004pT-Kq
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 11:34:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <eblake@redhat.com>) id 1NtjeT-0005OA-2i
	for bug-cppi@gnu.org; Mon, 22 Mar 2010 11:34:50 -0400
Received: from mx1.redhat.com ([209.132.183.28]:46283)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <eblake@redhat.com>)
	id 1NtjeS-0005O2-R8; Mon, 22 Mar 2010 11:34:49 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2MFYk3h022462
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 22 Mar 2010 11:34:46 -0400
Received: from [10.3.251.74] (vpn-251-74.phx2.redhat.com [10.3.251.74])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id o2MFYjki030664; Mon, 22 Mar 2010 11:34:45 -0400
Message-ID: <4BA78DD6.70809@redhat.com>
Date: Mon, 22 Mar 2010 09:33:42 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1
	Thunderbird/3.0.3
MIME-Version: 1.0
To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
References: <87pr31o1xa.fsf@meyering.net>	<874okcwc5w.fsf@gnu.org>	<878w9n4cli.fsf@meyering.net>	<4BA56639.6080809@draigBrady.com>	<8739zux6xa.fsf@meyering.net>	<4BA6E35C.8070205@draigBrady.com>
	<4BA74860.1030305@draigBrady.com> <4BA76581.3030308@draigBrady.com>
In-Reply-To: <4BA76581.3030308@draigBrady.com>
X-Enigmail-Version: 1.0.1
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enigD8006A7F73AF9F4FC790FA33"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Mailman-Approved-At: Tue, 23 Mar 2010 10:18:14 -0400
Cc: bug-cppi@gnu.org, bug-coreutils@gnu.org, Jim Meyering <jim@meyering.net>,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Mar 2010 15:34:52 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigD8006A7F73AF9F4FC790FA33
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 03/22/2010 06:41 AM, P=C3=A1draig Brady wrote:
> So that probably means we need to go with a different name.
> `inplace` is the next best one I can think of which
> at least mirrors the well known sed --in-place and perl -i options.

inplace sounds like a decent name to me.  Sounds like an interesting
filter to add.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enigD8006A7F73AF9F4FC790FA33
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkunjdcACgkQ84KuGfSFAYDHLACfeDKMDjXnG2gHYBLzdKgZGrba
atMAnAlqYtbTq/m6UOtuH+GSG5NcWVwq
=lljt
-----END PGP SIGNATURE-----

--------------enigD8006A7F73AF9F4FC790FA33--



From MAILER-DAEMON Wed Mar 24 08:20:47 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NuPZn-0004CM-D3
	for mharc-bug-cppi@gnu.org; Wed, 24 Mar 2010 08:20:47 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NuPZl-0004BU-R2
	for bug-cppi@gnu.org; Wed, 24 Mar 2010 08:20:45 -0400
Received: from [140.186.70.92] (port=34613 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NuPZk-0004Af-4a
	for bug-cppi@gnu.org; Wed, 24 Mar 2010 08:20:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1NuPZg-0003nY-Cw
	for bug-cppi@gnu.org; Wed, 24 Mar 2010 08:20:44 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:10529)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1NuPZf-0003n0-Uw
	for bug-cppi@gnu.org; Wed, 24 Mar 2010 08:20:40 -0400
Received: (qmail 66846 invoked from network); 24 Mar 2010 12:20:38 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 24 Mar 2010 12:20:38 -0000
Message-ID: <4BAA0277.3030005@draigBrady.com>
Date: Wed, 24 Mar 2010 12:15:51 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
References: <87pr31o1xa.fsf@meyering.net>	<874okcwc5w.fsf@gnu.org>	<878w9n4cli.fsf@meyering.net>	<4BA56639.6080809@draigBrady.com>	<8739zux6xa.fsf@meyering.net>	<4BA6E35C.8070205@draigBrady.com>	<4BA74860.1030305@draigBrady.com>	<4BA76581.3030308@draigBrady.com>	<4BA78DD6.70809@redhat.com>	<4BA79588.1070702@draigBrady.com>
	<87k4t3o96r.fsf@meyering.net> <4BA8B26C.3000505@draigBrady.com>
In-Reply-To: <4BA8B26C.3000505@draigBrady.com>
X-Enigmail-Version: 1.0.1
Content-Type: multipart/mixed; boundary="------------030203000408020309060500"
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
Cc: Eric Blake <eblake@redhat.com>, bug-cppi@gnu.org, bug-coreutils@gnu.org,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 24 Mar 2010 12:20:46 -0000

This is a multi-part message in MIME format.
--------------030203000408020309060500
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 23/03/10 12:22, PĆ”draig Brady wrote:
> On 23/03/10 06:15, Jim Meyering wrote:
>> PĆ”draig Brady wrote:
>>>
>>> However `replace` is used by mysql-server as previously mentioned.
>>> And `repl` is used by nmh. How about keeping with the terse unix
>>> tradition while alluding to the relationship with cp/mv/rm by using...
>>>
>>> rp
>>
>> I wouldn't object.
>>
>> A possible bastardized compromise: re-place
>> It's sort of analogous to in-place.
> 
> None of rp, inplace, re-place are great TBH.
> Anyway attached is the latest version.
> It's getting a bit complicated, but I don't
> think much more needs to go in (maybe translations?)

Thinking more about it, atomicity would be required in many cases
so therefore we would need a --atomic option to stop the fall back
to the non atomic update.

Also I noticed that `mv -b ./file.tmp ./file` is not atomic
because the renames are done like: rename(file,bak); rename(tmp,file);

I've updated the attached script accordingly.
It's starting to get a bit complex and hacky though.

cheers,
PĆ”draig.


--------------030203000408020309060500
Content-Type: text/plain;
 name="rp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="rp"

IyEvYmluL3NoCgptZT0kKGJhc2VuYW1lICQwKQoKdXNhZ2UoKSB7CiAgZXJyPSQxOyBvdXQ9
MgogIFsgJGVyciAtZXEgMCBdICYmIG91dD0xCiAgcHJpbnRmICJcCiRtZSBbT1BUSU9OXSAn
RklMVEVSJyBGSUxFLi4uClJlcGxhY2UgdGhlIGNvbnRlbnRzIG9mIGVhY2ggRklMRSBhZnRl
ciBwcm9jZXNzaW5nIHdpdGggRklMVEVSCgogICAgICAtLWF0b21pYyAgICAgICAgICAgIGF0
IG5vIHBvaW50IGxlYXZlIGEgRklMRSB1bmF2YWlsYWJsZSBvciBpbmNvbnNpc3RlbnQKICAg
ICAgLS1iYWNrdXBbPUNPTlRST0xdICBtYWtlIGEgYmFja3VwIG9mIGVhY2ggZXhpc3Rpbmcg
ZGVzdGluYXRpb24gZmlsZQogIC1iICAgICAgICAgICAgICAgICAgICAgIGxpa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3QgdW5saW5rIGluIHVud3JpdGVhYmxlIGRpci4KICAgICMgV2UgY291bGQgKHBy
b21wdCB0bykgYGNobW9kIHUrcndgIGhlcmUgdG8gYWxsb3cgdXBkYXRpbmcgbm9uIHJ3IGZp
bGVzPwogICAgY2xlYW51cCAjIGRpci9maWxlLnRtcAogICAgdGY9JChta3RlbXApCiAgICBm
aWx0ZXJfZmlsZSAmJgogICAgeyBjcCAkYmFja3VwIC0tICIkdGYiICIkZmlsZSIgfHwgY3Bf
ZXJyPTE7IGZhaWw9MTsgfSAjIHRydW5jYXRlIGFuZCBjb3B5CiAgICB0ZXN0ICRjcF9lcnIg
PSAwICYmIHRlc3QgIiRwcmVzZXJ2ZV90aW1lcyIgJiYKICAgICAgeyB0b3VjaCAiJGZpbGUi
IC0tcmVmZXJlbmNlPSIkdGYiIHx8IGZhaWw9MTsgfQogICAgY2xlYW51cCAjIHRtcC9maWxl
LnRtcAogIGZpCmRvbmUKCmV4aXQgJGZhaWwK
--------------030203000408020309060500--



From MAILER-DAEMON Thu Mar 25 07:38:03 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NulNz-0005qR-Dk
	for mharc-bug-cppi@gnu.org; Thu, 25 Mar 2010 07:38:03 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NulNx-0005qM-SM
	for bug-cppi@gnu.org; Thu, 25 Mar 2010 07:38:01 -0400
Received: from [140.186.70.92] (port=54601 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NulNl-0005nM-6E
	for bug-cppi@gnu.org; Thu, 25 Mar 2010 07:38:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1NulLk-0006mG-0G
	for bug-cppi@gnu.org; Thu, 25 Mar 2010 07:35:47 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:17733)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <P@draigBrady.com>) id 1NulLj-0006lt-JT
	for bug-cppi@gnu.org; Thu, 25 Mar 2010 07:35:43 -0400
Received: (qmail 70205 invoked from network); 25 Mar 2010 11:35:41 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 25 Mar 2010 11:35:41 -0000
Message-ID: <4BAB4965.6050002@draigBrady.com>
Date: Thu, 25 Mar 2010 11:30:45 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
References: <87pr31o1xa.fsf@meyering.net>	<874okcwc5w.fsf@gnu.org>	<878w9n4cli.fsf@meyering.net>	<4BA56639.6080809@draigBrady.com>	<8739zux6xa.fsf@meyering.net>	<4BA6E35C.8070205@draigBrady.com>	<4BA74860.1030305@draigBrady.com>	<4BA76581.3030308@draigBrady.com>	<4BA78DD6.70809@redhat.com>	<4BA79588.1070702@draigBrady.com>	<87k4t3o96r.fsf@meyering.net>
	<4BA8B26C.3000505@draigBrady.com> <4BAA0277.3030005@draigBrady.com>
In-Reply-To: <4BAA0277.3030005@draigBrady.com>
X-Enigmail-Version: 1.0.1
Content-Type: multipart/mixed; boundary="------------020003020901010503030403"
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
Cc: bug-coreutils@gnu.org, bug-cppi@gnu.org, Eric Blake <eblake@redhat.com>,
	Giuseppe Scrivano <gscrivano@gnu.org>
Subject: [bug-cppi] Re: [PATCH] Add new option --in-place
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 25 Mar 2010 11:38:02 -0000

This is a multi-part message in MIME format.
--------------020003020901010503030403
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 24/03/10 12:15, PĆ”draig Brady wrote:
> Also I noticed that `mv -b ./file.tmp ./file` is not atomic
> because the renames are done like: rename(file,bak); rename(tmp,file);

I summarized the issues involved with replacing files and it was surprisingly popular:
http://www.reddit.com/r/programming/comments/bhnab/replacing_a_file_on_unix_is_hard/

It was indirectly suggested there to use hardlinks for atomic backups,
which I've amended the attached script to do.  Other changes include
falling back to cp -a if --attributes-only is not supported, and
correctly removing all temp files.

I wonder should `mv -b` (and sed -i) use the ln method to
try to be atomic and then fall back to the double rename?
I'll look into it at some stage.

cheers,
PĆ”draig.

--------------020003020901010503030403
Content-Type: text/plain;
 name="rp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="rp"

IyEvYmluL3NoCgptZT0kKGJhc2VuYW1lICQwKQoKdXNhZ2UoKSB7CiAgZXJyPSQxOyBvdXQ9
MgogIFsgJGVyciAtZXEgMCBdICYmIG91dD0xCiAgcHJpbnRmICJcCiRtZSBbT1BUSU9OXSAn
RklMVEVSJyBGSUxFLi4uClJlcGxhY2UgdGhlIGNvbnRlbnRzIG9mIGVhY2ggRklMRSBhZnRl
ciBwcm9jZXNzaW5nIHdpdGggRklMVEVSCgogICAgICAtLWF0b21pYyAgICAgICAgICAgIGF0
IG5vIHBvaW50IGxlYXZlIGEgRklMRSB1bmF2YWlsYWJsZSBvciBpbmNvbnNpc3RlbnQKICAg
ICAgLS1iYWNrdXBbPUNPTlRST0xdICBtYWtlIGEgYmFja3VwIG9mIGVhY2ggZXhpc3Rpbmcg
ZGVzdGluYXRpb24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GZpbGUiIHx8IGJhY2t1cF9lcnI9MTsgZmFpbD0xOyB9ICMgdHJ1
bmNhdGUgYW5kIGNvcHkKICAgIHRlc3QgJGJhY2t1cF9lcnIgPSAwICYmIHRlc3QgIiRwcmVz
ZXJ2ZV90aW1lcyIgJiYKICAgICAgeyB0b3VjaCAiJGZpbGUiIC0tcmVmZXJlbmNlPSIkdGYi
IHx8IGZhaWw9MTsgfQogIGZpCmRvbmUKCmV4aXQgJGZhaWwK
--------------020003020901010503030403--



From MAILER-DAEMON Wed Mar 31 09:38:04 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nwy7Q-0005Gg-CN
	for mharc-bug-cppi@gnu.org; Wed, 31 Mar 2010 09:38:04 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NwYpL-0008LF-2k
	for bug-cppi@gnu.org; Tue, 30 Mar 2010 06:37:43 -0400
Received: from [140.186.70.92] (port=35946 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NwYpJ-0008Jo-48
	for bug-cppi@gnu.org; Tue, 30 Mar 2010 06:37:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gray@gnu.org.ua>) id 1NwYpH-0002P0-V9
	for bug-cppi@gnu.org; Tue, 30 Mar 2010 06:37:41 -0400
Received: from pirx.gnu.org.ua ([213.130.31.41]:36438)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gray@gnu.org.ua>) id 1NwYpH-0002Oo-JJ
	for bug-cppi@gnu.org; Tue, 30 Mar 2010 06:37:39 -0400
X-Mailutils-Message-Id: o2UAb2sj016113
Organization: GNU.org.ua
Received: from Pirx.gnu.org.ua (localhost [127.0.0.1]) 
	by Pirx.gnu.org.ua with ESMTP id o2UAb2sj016113
	for <bug-cppi@gnu.org>; Tue, 30 Mar 2010 13:37:37 +0300
Received: (from gray@localhost)
	by Pirx.gnu.org.ua (8.14.3/8.12.10/Submit) id o2UAb1t8016112;
	Tue, 30 Mar 2010 13:37:01 +0300
Message-ID: <20100330133700.16111@Pirx.gnu.org.ua>
Date: Tue, 30 Mar 2010 13:37:00 +0300
From: Sergey Poznyakoff <gray@gnu.org.ua>
To: <bug-cppi@gnu.org>
cc: 
X-Mailer: MH-E 8.0.3; GNU Mailutils 2.1; GNU Emacs 22.1.1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Mailman-Approved-At: Wed, 31 Mar 2010 09:38:03 -0400
Subject: [bug-cppi] [PATCH] Enable L18N
X-BeenThere: bug-cppi@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: bug-cppi.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-cppi>
List-Post: <mailto:bug-cppi@gnu.org>
List-Help: <mailto:bug-cppi-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-cppi>,
	<mailto:bug-cppi-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Mar 2010 10:37:43 -0000

Hi Jim,

Cppi does not enable L18N support. The following patch fixes it:

diff --git a/src/cppi.l b/src/cppi.l
index f46940a..a8986bb 100644
--- a/src/cppi.l
+++ b/src/cppi.l
@@ -787,6 +787,11 @@ main (int argc, char** argv)
   int fail = 0;
 
   set_program_name (argv[0]);
+#ifdef ENABLE_NLS
+  setlocale (LC_ALL, "");
+  bindtextdomain (PACKAGE, LOCALEDIR);
+  textdomain (PACKAGE);
+#endif
 
   atexit (close_stdout);

Regards,
Sergey




