git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rpmbuild doesn't like '-' in version strings
@ 2005-12-30 17:29 John Ellson
  2006-01-06 22:37 ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: John Ellson @ 2005-12-30 17:29 UTC (permalink / raw)
  To: git

Problem:

	ellson@ellson:git> make rpm
	GIT_VERSION = 1.0.6-g58e3
	sed -e 's/@@VERSION@@/1.0.6-g58e3/g' < git.spec.in > git.spec
	./git-tar-tree HEAD git-1.0.6-g58e3 > git-1.0.6-g58e3.tar
	tar rf git-1.0.6-g58e3.tar git-1.0.6-g58e3/git.spec
	gzip -f -9 git-1.0.6-g58e3.tar
	rpmbuild -ta git-1.0.6-g58e3.tar.gz
	error: line 3: Illegal char '-' in version: Version:    1.0.6-g58e3
	make: *** [rpm] Error 1


Suggested fix:  Use '_' instead of '-'

There is probably a cleaner implementation of the fix, but this works for me.

----------------------------------------


diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 845b9dc..e4e0ab1 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -3,7 +3,9 @@
  GVF=GIT-VERSION-FILE

  VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT
-VN=$(expr "$VN" : v'\(.*\)')
+VN1=$(expr "$VN" : '[^-]*-\(.*\)')
+VN=$(expr "$VN" : v'\([^-]*\)')
+test "$VN1" = "" || VN="$VN"_"$VN1"
  if test -r $GVF
  then
         VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)


--------------------------------------------


Signed-off-by: John Ellson <ellson@research.att.com>

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-01-16  9:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-30 17:29 [PATCH] rpmbuild doesn't like '-' in version strings John Ellson
2006-01-06 22:37 ` Junio C Hamano
2006-01-07  0:04   ` Andreas Ericsson
2006-01-07  0:47     ` Johannes Schindelin
2006-01-07  1:22   ` Ryan Anderson
2006-01-14 15:39   ` John Ellson
2006-01-14 17:53     ` Linus Torvalds
2006-01-14 19:17     ` Junio C Hamano
2006-01-14 20:25       ` John Ellson
2006-01-14 20:35         ` Junio C Hamano
2006-01-16  9:15         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).