[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: more m4 quoting
From: |
Jim Meyering |
Subject: |
Re: more m4 quoting |
Date: |
Tue, 13 Jan 2009 10:17:27 +0100 |
Jim Meyering <address@hidden> wrote:
> FYI, now I'm looking at the changes induced by the following:
>
> git ls-files | grep '\.m4$' | xargs perl -pi \
> -e 's/(AC_[A-Z_]+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
> -e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){1})([^,[()]+?)([,)])/$1\[$2]$3/g;' \
> -e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g;' \
> -e 's/(AC_[A-Z_]+\((?:\[[^,]+?\], ){3})([^,[()]+?)([,)])/$1\[$2]$3/g'
> # [note that the above is not equivalent to using {0,3} ]
>
> # This is the sole unwanted change (to onceonly.m4):
> # -# AC_CHECK_DECLS([DECL1], [DECL2], ...).
> # +# AC_CHECK_DECLS([DECL1], [DECL2], [...]).
>
> # Undo it:
> perl -pi -e 's/\[\.\.\.\]/.../' m4/onceonly.m4
>
>
> FYI, adding the 4-arg transform induced only two new changes,
> both in comments:
>
> +# _AC_FUNC_FNMATCH_IF([STANDARD = GNU | POSIX], [CACHE_VAR], [IF-TRUE],
> [IF-FALSE])
> +dnl AC_LIB_HAVE_LINKFLAGS([name], [dependencies], [includes], [testcode])
I'm about to apply the changes induced by the above commands.
I ran all tests on an Fedora 10 system, like this:
./gnulib-tool --create-testdir --with-tests --dir=/tmp/testdir
./configure CFLAGS='-O -g -Wformat -Wformat-security \
-Winit-self -Wall -Wpointer-arith -Wshadow -Wcast-align
-Wwrite-strings -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -Dlint' \
&& make && make check
There was only one unrelated failure, due to test-copy-file.
More details below.
I also tested it through coreutils builds, and cross-checked its
before/after changes induced in these files: configure config.status
config.log lib/config.h{,in} aclocal.m4
I'll push this change today, so speak now if you don't like some part
of it. [BTW, no .m4 file is listed in config/srclist.txt, so I didn't
even try to exclude any that might belong to some other project. ]
I've taken the unusual step of attaching the compressed diff below.
Here's the diffstat output for the resulting 5000+-line patch:
acl.m4 | 6 +--
afs.m4 | 4 +-
alloca.m4 | 2 -
argp.m4 | 26 +++++++--------
argz.m4 | 2 -
atexit.m4 | 2 -
bison-i18n.m4 | 2 -
bison.m4 | 4 +-
byteswap.m4 | 2 -
c-stack.m4 | 2 -
c-strtod.m4 | 2 -
calloc.m4 | 10 ++---
canonicalize-lgpl.m4 | 14 ++++----
chown.m4 | 8 ++--
clock_time.m4 | 4 +-
codeset.m4 | 2 -
copy-file.m4 | 4 +-
csharp.m4 | 8 ++--
csharpcomp.m4 | 14 ++++----
csharpexec.m4 | 22 ++++++-------
d-ino.m4 | 2 -
d-type.m4 | 2 -
dirfd.m4 | 4 +-
double-slash-root.m4 | 2 -
eaccess.m4 | 4 +-
eealloc.m4 | 4 +-
environ.m4 | 4 +-
errno_h.m4 | 8 ++--
euidaccess.m4 | 12 +++----
execute.m4 | 4 +-
fatal-signal.m4 | 2 -
fchdir.m4 | 2 -
fcntl_h.m4 | 2 -
fileblocks.m4 | 4 +-
filenamecat.m4 | 2 -
findprog.m4 | 2 -
flexmember.m4 | 2 -
fnmatch.m4 | 2 -
fopen.m4 | 2 -
fpending.m4 | 4 +-
fprintf-posix.m4 | 2 -
free.m4 | 4 +-
frexp.m4 | 4 +-
frexpl.m4 | 4 +-
fsusage.m4 | 54 ++++++++++++++++----------------
ftruncate.m4 | 2 -
gc-camellia.m4 | 2 -
gc-random.m4 | 24 +++++++-------
gc.m4 | 2 -
getaddrinfo.m4 | 10 ++---
getcwd-abort-bug.m4 | 4 +-
getcwd-path-max.m4 | 4 +-
getdate.m4 | 4 +-
getdomainname.m4 | 2 -
getgroups.m4 | 4 +-
gethostname.m4 | 4 +-
gethrxtime.m4 | 6 +--
getline.m4 | 6 +--
getloadavg.m4 | 58 +++++++++++++++++-----------------
getndelim2.m4 | 2 -
getpass.m4 | 12 +++----
gettext.m4 | 8 ++--
gettime.m4 | 2 -
gettimeofday.m4 | 6 +--
gnulib-common.m4 | 2 -
group-member.m4 | 4 +-
host-os.m4 | 2 -
iconv.m4 | 2 -
iconv_open.m4 | 2 -
inet_ntop.m4 | 2 -
inet_pton.m4 | 2 -
inline.m4 | 2 -
intl.m4 | 10 ++---
intldir.m4 | 2 -
intlmacosx.m4 | 4 +-
intmax.m4 | 2 -
intmax_t.m4 | 12 +++----
inttypes-pri.m4 | 4 +-
inttypes.m4 | 4 +-
inttypes_h.m4 | 2 -
isapipe.m4 | 6 +--
isnand.m4 | 2 -
isnanf.m4 | 2 -
isnanl.m4 | 2 -
javacomp.m4 | 22 ++++++-------
javaexec.m4 | 26 +++++++--------
jm-winsz1.m4 | 2 -
jm-winsz2.m4 | 2 -
lchown.m4 | 2 -
lcmessage.m4 | 2 -
ldexpl.m4 | 2 -
lib-ld.m4 | 10 ++---
lib-link.m4 | 12 +++----
libsigsegv.m4 | 8 ++--
link-follow.m4 | 2 -
localcharset.m4 | 2 -
locale-fr.m4 | 4 +-
locale-ja.m4 | 2 -
locale-tr.m4 | 2 -
locale-zh.m4 | 2 -
lock.m4 | 4 +-
longlong.m4 | 4 +-
ls-mntd-fs.m4 | 86 +++++++++++++++++++++++++--------------------------
lstat.m4 | 2 -
malloc.m4 | 2 -
mathl.m4 | 2 -
mbrtowc.m4 | 2 -
mbstate_t.m4 | 6 +--
mbswidth.m4 | 2 -
memchr.m4 | 4 +-
memcmp.m4 | 4 +-
memcpy.m4 | 2 -
memmem.m4 | 4 +-
memmove.m4 | 2 -
mempcpy.m4 | 2 -
memrchr.m4 | 2 -
memset.m4 | 2 -
minmax.m4 | 2 -
mkdir-slash.m4 | 4 +-
mkdtemp.m4 | 2 -
mktime.m4 | 10 ++---
mmap-anon.m4 | 6 +--
mountlist.m4 | 4 +-
nanosleep.m4 | 8 ++--
nls.m4 | 6 +--
nocrash.m4 | 2 -
onceonly.m4 | 12 +++----
open.m4 | 2 -
openat.m4 | 4 +-
openmp.m4 | 18 +++++-----
pathmax.m4 | 2 -
perl.m4 | 4 +-
physmem.m4 | 6 +--
pipe.m4 | 4 +-
po.m4 | 2 -
poll.m4 | 12 +++----
posixtm.m4 | 2 -
posixver.m4 | 4 +-
printf-frexp.m4 | 4 +-
printf-frexpl.m4 | 4 +-
printf-posix-rpl.m4 | 2 -
printf-posix.m4 | 4 +-
printf.m4 | 2 -
progtest.m4 | 4 +-
putenv.m4 | 2 -
readline.m4 | 12 +++----
readlink.m4 | 2 -
readutmp.m4 | 6 +--
realloc.m4 | 2 -
regex.m4 | 2 -
relocatable-lib.m4 | 6 +--
relocatable.m4 | 2 -
rename-dest-slash.m4 | 4 +-
rename.m4 | 6 +--
rmdir-errno.m4 | 2 -
rmdir.m4 | 2 -
roundf.m4 | 2 -
roundl.m4 | 2 -
rpmatch.m4 | 6 +--
save-cwd.m4 | 2 -
selinux-selinux-h.m4 | 2 -
setenv.m4 | 10 ++---
settime.m4 | 2 -
sig2str.m4 | 2 -
sig_atomic_t.m4 | 4 +-
signalblocking.m4 | 4 +-
signbit.m4 | 6 +--
sigpipe.m4 | 4 +-
sockets.m4 | 2 -
sockpfaf.m4 | 16 ++++-----
st_dm_mode.m4 | 4 +-
stat-time.m4 | 2 -
stdbool.m4 | 2 -
stdint.m4 | 8 ++--
stdint_h.m4 | 2 -
stpcpy.m4 | 2 -
stpncpy.m4 | 4 +-
strcase.m4 | 6 +--
strchrnul.m4 | 2 -
strcspn.m4 | 2 -
strdup.m4 | 8 ++--
strftime.m4 | 4 +-
strndup.m4 | 4 +-
strnlen.m4 | 4 +-
strpbrk.m4 | 2 -
strptime.m4 | 2 -
strsep.m4 | 2 -
strtod.m4 | 2 -
strtoimax.m4 | 4 +-
strtok_r.m4 | 4 +-
strtol.m4 | 2 -
strtoll.m4 | 2 -
strtoul.m4 | 2 -
strtoull.m4 | 2 -
strtoumax.m4 | 4 +-
strverscmp.m4 | 2 -
threadlib.m4 | 18 +++++-----
timegm.m4 | 4 +-
tm_gmtoff.m4 | 2 -
tmpdir.m4 | 2 -
tmpfile.m4 | 4 +-
tzset.m4 | 6 +--
uintmax_t.m4 | 4 +-
unlinkdir.m4 | 4 +-
unlocked-io.m4 | 2 -
uptime.m4 | 6 +--
userspec.m4 | 2 -
utimbuf.m4 | 4 +-
utime.m4 | 6 +--
utimes-null.m4 | 4 +-
utimes.m4 | 2 -
vararrays.m4 | 2 -
vasnprintf.m4 | 32 +++++++++---------
vfprintf-posix.m4 | 2 -
vprintf-posix.m4 | 2 -
wait-process.m4 | 2 -
wchar_t.m4 | 2 -
wint_t.m4 | 2 -
write-any-file.m4 | 2 -
yield.m4 | 4 +-
220 files changed, 598 insertions(+), 598 deletions(-)
Here's more detail for the test-copy-file failure:
[Bruno, the output you see below is slightly different that you might
expect because I modified the script to use diff -c rather than cmp. ]
+ /tmp/testdir/gltests/test-copy-file tmpfile0 tmpfile1
+ /tmp/testdir/gltests/test-sameacls tmpfile0 tmpfile1
+ func_test_same_acls tmpfile0 tmpfile1
+ getfacl tmpfile0
+ sed -e s/tmpfile0/FILENAME/g
+ getfacl tmpfile1
+ sed -e s/tmpfile1/FILENAME/g
+ diff -c tmpaclout1 tmpaclout2
+ test linux '!=' none
++ id -u
+ myuid=500
++ id -g
+ mygid=500
+ auid=1
+ test 1 = 500
+ agid=1
+ test 1 = 500
+ case $acl_flavor in
+ setfacl -m user:1:1 tmpfile0
+ func_test_copy tmpfile0 tmpfile2
+ /tmp/testdir/gltests/test-copy-file tmpfile0 tmpfile2
+ /tmp/testdir/gltests/test-sameacls tmpfile0 tmpfile2
+ func_test_same_acls tmpfile0 tmpfile2
+ getfacl tmpfile0
+ sed -e s/tmpfile0/FILENAME/g
+ getfacl tmpfile2
+ sed -e s/tmpfile2/FILENAME/g
+ diff -c tmpaclout1 tmpaclout2
*** tmpaclout1 2009-01-13 09:53:52.769123471 +0100
--- tmpaclout2 2009-01-13 09:53:52.770123229 +0100
***************
*** 2,9 ****
# owner: meyering
# group: meyering
user::rw-
! user:bin:--x
! group::---
! mask::--x
other::---
--- 2,7 ----
# owner: meyering
# group: meyering
user::rw-
! group::--x
other::---
+ exit 1
+ exit 1
FAIL: test-copy-file.sh
diff.bz2
Description: Binary data
- Re: more m4 quoting,
Jim Meyering <=