[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: some buglet in gnulib-tool func_update_ignorelist
From: |
Bruno Haible |
Subject: |
Re: some buglet in gnulib-tool func_update_ignorelist |
Date: |
Mon, 29 Dec 2008 23:16:19 +0100 |
User-agent: |
KMail/1.9.9 |
Hello Ralf,
> bootstrap on the branch-1.4 branch of M4 showed this sed error
> during 'gnulib-tool --update', with a dirty gnulib tree from last week:
>
> Updating file build-aux/announce-gen (backup in build-aux/announce-gen~)
> Updating file build-aux/gnupload (backup in build-aux/gnupload~)
> Updating file lib/binary-io.h (backup in lib/binary-io.h~)
> [...]
> Updating file lib/sys_time.in.h (backup in lib/sys_time.in.h~)
> Updating file lib/unistd.in.h (backup in lib/unistd.in.h~)
> Updating file m4/assert.m4 (backup in m4/assert.m4~)
> [...]
> Updating file m4/stdlib_h.m4 (backup in m4/stdlib_h.m4~)
> Updating file tests/test-lock.c (backup in tests/test-lock.c~)
> Updating file tests/test-tls.c (backup in tests/test-tls.c~)
> Updating lib/Makefile.am (backup in lib/Makefile.am~)
> Updating m4/gnulib-comp.m4 (backup in m4/gnulib-comp.m4~)
> Updating tests/Makefile.am (backup in tests/Makefile.am~)
> Updating ./doc/.cvsignore (backup in ./doc/.cvsignore~)
> Updating ./doc/.gitignore (backup in ./doc/.gitignore~)
> sed: file /dev/shm/ralf/tmp/glZ19707/sed-ignore-removed line 2: unknown
> command: `f'
> Updating ./lib/.gitignore (backup in ./lib/.gitignore~)
The patch below should fix it.
> It looks to me like the creation of the "$tmp"/sed-ignore-removed script
> in func_update_ignorelist needs more escaping, e.g., all characters that
> are special within a sed '/BRE/' address specification: '[', ']', '/',
> '*', '\', '.', '{', '}', '^', '$'. I don't quite get how the above
> could have happened though, m4/doc doesn't seem to contain files with
> weird names
Probably the error message came from a file inside a subdirectory of doc,
whose name starts with an 'f'. sed-ignore-removed should not contain a line like
/^subdir/foobar$/d
but rather
/^subdir\/foobar$/d
2008-12-29 Bruno Haible <address@hidden>
* gnulib-tool (func_import): When generating sed-ignore-removed, handle
files in subdirectories correctly.
Reported by Ralf Wildenhues.
--- gnulib-tool.orig 2008-12-29 23:08:58.000000000 +0100
+++ gnulib-tool 2008-12-29 23:08:49.000000000 +0100
@@ -3464,8 +3464,8 @@
if $doit; then
echo "Updating $destdir/$dir$ignore (backup in
$destdir/$dir${ignore}~)"
mv -f "$destdir/$dir$ignore" "$destdir/$dir$ignore"~
- { sed -e 's,^,/^,' -e 's,$,\$/d,' < "$tmp"/ignore-removed
- if test -n "$anchor"; then sed -e
"s,^,/^${doubly_escaped_anchor}," -e 's,$,\$/d,' < "$tmp"/ignore-removed; fi
+ { sed -e 's,/,\\/,g' -e 's,^,/^,' -e 's,$,\$/d,' <
"$tmp"/ignore-removed
+ if test -n "$anchor"; then sed -e 's,/,\\/,g' -e
"s,^,/^${doubly_escaped_anchor}," -e 's,$,\$/d,' < "$tmp"/ignore-removed; fi
} > "$tmp"/sed-ignore-removed
{ cat "$destdir/$dir$ignore"~
sed -e "s|^|$anchor|" < "$tmp"/ignore-added