comparison include.sh @ 255:c3e8c6662b58

Fix include.sh to consistently use noversion, and rephrase the sed invocation in noversion to not need -r (which makes building on MacOS X easier).
author Rob Landley <rob@landley.net>
date Tue, 01 Jan 2008 15:03:11 -0600
parents aa03feec947a
children e1d156c264bc
comparison
equal deleted inserted replaced
254:e005f4279b36 255:c3e8c6662b58
2 2
3 # Strip the version number off a tarball 3 # Strip the version number off a tarball
4 4
5 function noversion() 5 function noversion()
6 { 6 {
7 echo "$1" | sed -r -e 's/-*([0-9\.]|[_-]rc|-pre|[0-9][a-zA-Z])*(\.tar\..z2*)$/\2/' 7 echo "$1" | sed -e 's/-*\([0-9\.]|[_-]rc|-pre|[0-9][a-zA-Z]\)*\(\.tar\..z2*\)$/\2/'
8 } 8 }
9 9
10 # output the sha1sum of a file 10 # output the sha1sum of a file
11 function sha1file() 11 function sha1file()
12 { 12 {
85 } 85 }
86 86
87 function download() 87 function download()
88 { 88 {
89 FILENAME=`echo "$URL" | sed 's .*/ '` 89 FILENAME=`echo "$URL" | sed 's .*/ '`
90 BASENAME=`echo "$FILENAME" | sed -r -e 's/-*([0-9\.]|[_-]rc|-pre|[0-9][a-zA-Z])*(\.tar\..z2*)$/\2/'` 90 BASENAME=`noversion "$FILENAME"`
91 91
92 # The extra "" is so we test the sha1sum after the last download. 92 # The extra "" is so we test the sha1sum after the last download.
93 93
94 for i in "$URL" http://www.landley.net/code/firmware/mirror/"$FILENAME" "" 94 for i in "$URL" http://www.landley.net/code/firmware/mirror/"$FILENAME" ""
95 do 95 do