[libvirt] [PATCH] build: Fix AUTHORS generation

Using s/#authorslist#/$$out/ makes perl eat @domain part of all email addresses from $out since it tries to interpret them as array variables. I'm not sure if we can escape those in s/// but I know we can use print: s/#authorslist#// and print '$$out' to tell perl not to even inside $out. This patch also fixes gen-AUTHORS so that it works in VPATH. --- Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9556b42..05301cd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -95,9 +95,9 @@ gen-ChangeLog: .PHONY: gen-AUTHORS gen-AUTHORS: - $(AM_V_GEN)if test -d .git; then \ - out="`git log --pretty=format:'%aN <%aE>' | sort -u`" && \ - cat $(srcdir)/AUTHORS.in | perl -p -e "s/#authorslist#/$$out/" > \ + $(AM_V_GEN)if test -d $(srcdir)/.git; then \ + out="`cd $(srcdir) && git log --pretty=format:'%aN <%aE>' | sort -u`" && \ + cat $(srcdir)/AUTHORS.in | perl -p -e "s/#authorslist#// and print '$$out'" > \ $(distdir)/AUTHORS-tmp && \ mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS ; \ fi -- 1.8.0.2

On 12/14/2012 08:19 AM, Jiri Denemark wrote:
Using s/#authorslist#/$$out/ makes perl eat @domain part of all email addresses from $out since it tries to interpret them as array variables. I'm not sure if we can escape those in s/// but I know we can use print:
s/#authorslist#// and print '$$out'
to tell perl not to even inside $out.
This patch also fixes gen-AUTHORS so that it works in VPATH. --- Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
gen-AUTHORS: - $(AM_V_GEN)if test -d .git; then \ - out="`git log --pretty=format:'%aN <%aE>' | sort -u`" && \ - cat $(srcdir)/AUTHORS.in | perl -p -e "s/#authorslist#/$$out/" > \ + $(AM_V_GEN)if test -d $(srcdir)/.git; then \ + out="`cd $(srcdir) && git log --pretty=format:'%aN <%aE>' | sort -u`" && \ + cat $(srcdir)/AUTHORS.in | perl -p -e "s/#authorslist#// and print '$$out'" > \
ACK, although this would be a nice time to fix the useless use of cat: perl -p -e "s/#authorslist#// and print '$$out'" \ < $(srcdir)/AUTHORS.in > $(distdir)/AUTHORS-tmp && \ -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Dec 14, 2012 at 09:41:44 -0700, Eric Blake wrote:
On 12/14/2012 08:19 AM, Jiri Denemark wrote:
Using s/#authorslist#/$$out/ makes perl eat @domain part of all email addresses from $out since it tries to interpret them as array variables. I'm not sure if we can escape those in s/// but I know we can use print:
s/#authorslist#// and print '$$out'
to tell perl not to even inside $out.
This patch also fixes gen-AUTHORS so that it works in VPATH. --- Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
gen-AUTHORS: - $(AM_V_GEN)if test -d .git; then \ - out="`git log --pretty=format:'%aN <%aE>' | sort -u`" && \ - cat $(srcdir)/AUTHORS.in | perl -p -e "s/#authorslist#/$$out/" > \ + $(AM_V_GEN)if test -d $(srcdir)/.git; then \ + out="`cd $(srcdir) && git log --pretty=format:'%aN <%aE>' | sort -u`" && \ + cat $(srcdir)/AUTHORS.in | perl -p -e "s/#authorslist#// and print '$$out'" > \
ACK, although this would be a nice time to fix the useless use of cat:
perl -p -e "s/#authorslist#// and print '$$out'" \ < $(srcdir)/AUTHORS.in > $(distdir)/AUTHORS-tmp && \
Yeah, I did that and pushed, thanks. I was too focused on fixing the perl part :-) Jirka
participants (2)
-
Eric Blake
-
Jiri Denemark