[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6293: git-version-gen: Add support for a git tag transformation sed
From: |
Jim Meyering |
Subject: |
bug#6293: git-version-gen: Add support for a git tag transformation sed script |
Date: |
Fri, 28 May 2010 17:05:30 +0200 |
Eric Blake wrote:
> On 05/28/2010 09:00 AM, Jim Meyering wrote:
>> Or better still, don't use echo at all, in case
>> some tag starts with "-":
>>
>> - && v=`echo $v | sed "$tag_sed_script"` \
>> + && v=`printf %s "$v" | sed "$tag_sed_script"` \
>
> Some sed required the trailing newline; you need to use:
>
> v=`printf %s\\n "$v" | sed "$tag_sed_script"`
Good point. Thanks.
Adjusted via this:
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 25753a3..9b821e0 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -98,7 +98,7 @@ then
elif test -d .git \
&& v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
|| git describe --abbrev=4 HEAD 2>/dev/null` \
- && v=`printf %s "$v" | sed "$tag_sed_script"` \
+ && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
&& case $v in
v[0-9]*) ;;
*) (exit 1) ;;