diff options
-rw-r--r-- | packaging/ubuntu/make-package.sh | 2 | ||||
-rwxr-xr-x | scripts/add-version-to-appdata.sh | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/packaging/ubuntu/make-package.sh b/packaging/ubuntu/make-package.sh index 56a0e16d9..2dbf45f5b 100644 --- a/packaging/ubuntu/make-package.sh +++ b/packaging/ubuntu/make-package.sh @@ -16,6 +16,7 @@ fi GITVERSION=$(cd subsurface ; git describe --abbrev=12 | sed -e 's/-g.*$// ; s/^v//') GITREVISION=$(echo $GITVERSION | sed -e 's/.*-// ; s/.*\..*//') VERSION=$(echo $GITVERSION | sed -e 's/-/./') +GITDATE=$(cd subsurface ; git log -1 --format="%at" | xargs -I{} date -d @{} +%Y-%m-%d) LIBDCREVISION=$(cd subsurface/libdivecomputer ; git rev-parse --verify HEAD) # @@ -40,6 +41,7 @@ if [[ ! -d subsurface_$VERSION ]]; then cd subsurface_$VERSION; rm -rf .git libdivecomputer/.git libgit2/.git echo $GITVERSION > .gitversion + echo $GITDATE > .gitdate echo $LIBDCREVISION > libdivecomputer/revision # dh_make --email dirk@hohndel.org -c gpl2 --createorig --single --yes -p subsurface_$VERSION # rm debian/*.ex debian/*.EX debian/README.* diff --git a/scripts/add-version-to-appdata.sh b/scripts/add-version-to-appdata.sh index a0d8e1f5d..7d48e840a 100755 --- a/scripts/add-version-to-appdata.sh +++ b/scripts/add-version-to-appdata.sh @@ -1,4 +1,10 @@ -#!/bin/sh -version=$(git describe --abbrev=12) -date=$(git log -1 --format="%at" | xargs -I{} date -d @{} +%Y-%m-%d) +#!/bin/bash +# +# work either when building from git or when building from our hand +# crafted tar balls for OBS +# this will, however, fail for plain tar balls create via git archive + +SCRIPT_DIR="$( cd "${BASH_SOURCE%/*}" ; pwd )" +version=$(git describe --abbrev=12) || version=$(cat "$SCRIPT_DIR"/../.gitversion) +date=$(git log -1 --format="%ct" | xargs -I{} date -d @{} +%Y-%m-%d) || date=$(cat "$SCRIPT_DIR"/../.gitdate) sed -e "s|<release version=\"\" date=\"\" />|<release version=\"$version\" date=\"$date\" />|" appdata/subsurface.appdata.xml.in > appdata/subsurface.appdata.xml |