diff --git a/.gitattributes b/.gitattributes index 5abe905..20c0b64 100644 --- a/.gitattributes +++ b/.gitattributes @@ -20,3 +20,4 @@ README.* text Makefile text ChangeLog text ChangeLog.* text +/download_and_compile.sh text ident diff --git a/download_and_compile.sh b/download_and_compile.sh index 5b71432..03919f6 100755 --- a/download_and_compile.sh +++ b/download_and_compile.sh @@ -17,7 +17,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -VERSION="2.34" +script_blob_id='$Id$' +# Slightly tricky substitution to avoid our regexp being wildly replaced with +# the blob name (id) when the script is checked out: +# +# First extract the hexadecimal blob object name followed by a '$' +VERSION="$(echo "$script_blob_id" | sed 's@\$Id: *\([0-9a-f]\+\) *@\1@')" +# Then remove the trailing '$' +VERSION="${VERSION%\$}" + FGVERSION="release/$(git ls-remote --heads https://git.code.sf.net/p/flightgear/flightgear|grep '\/release\/'|cut -f4 -d'/'|sort -t . -k 1,1n -k2,2n -k3,3n|tail -1)" #######################################################