changeset 256:e1d156c264bc

Ok, the non-sed -r version is noticeably uglier than my first guess at it.
author Rob Landley <rob@landley.net>
date Tue, 01 Jan 2008 17:53:33 -0600
parents c3e8c6662b58
children d37e39370d39
files include.sh
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/include.sh	Tue Jan 01 15:03:11 2008 -0600
+++ b/include.sh	Tue Jan 01 17:53:33 2008 -0600
@@ -4,7 +4,7 @@
 
 function noversion()
 {
-  echo "$1" | sed -e 's/-*\([0-9\.]|[_-]rc|-pre|[0-9][a-zA-Z]\)*\(\.tar\..z2*\)$/\2/'
+  echo "$1" | sed -e 's/-*\(\([0-9\.]\)*\([_-]rc\)*\(-pre\)*\([0-9][a-zA-Z]\)*\)*\(\.tar\..z2*\)$/\6/'
 }
 
 # output the sha1sum of a file
@@ -20,7 +20,7 @@
 function extract()
 {
   SRCTREE="${BUILD}/sources"
-  BASENAME=`noversion "$1"`
+  BASENAME="$(noversion "$1")"
   BASENAME="${BASENAME/%\.tar\.*/}"
   SHA1FILE="$(echo "${SRCTREE}/${BASENAME}/sha1-for-source.txt")"
   SHA1TAR="$(sha1file "${SRCDIR}/$1")"