From 83079c92df866f0eda09cfef6cf9d3d90782d2b5 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 20 Sep 2018 06:12:51 -0700 Subject: build-system: fix appdata creation on OBS Build systems that run from tar balls and not git fail to create valid .appdata.xml This solves the problem for tar balls that we create for OBS via our own make-package script. It doesn't solve the problem for Arch or Gentoo who I believe take our tar files created via git archive. One way to fix this would be to change the process by which I create those tar files, I guess. Signed-off-by: Dirk Hohndel --- scripts/add-version-to-appdata.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts/add-version-to-appdata.sh') 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|||" appdata/subsurface.appdata.xml.in > appdata/subsurface.appdata.xml -- cgit v1.2.3-70-g09d2