Skip to content

Commit

Permalink
let build_release-N900.sh extract the version number from CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
DerDakon committed Jun 17, 2017
1 parent abd32ef commit 2eb3eed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions build_release-N900.sh
@@ -1,22 +1,22 @@
#!/bin/sh

if [ $# -eq 0 -o $# -gt 2 ]; then
echo "Usage: $(basename ${0}) version [icons.tar]" >&2
if [ $# -gt 1 ]; then
echo "Usage: $(basename ${0}) [icons.tar]" >&2
exit 1
fi

set -ex

VERSION=${1}
VERSION=$(sed -rn '/^project/s/.* VERSION +([^ ]+).*/\1/p' "$(dirname ${0})/CMakeLists.txt")
TMPDIR=$(mktemp -d)

mkdir ${TMPDIR}/osm2go-${VERSION}

# create a copy of the source dir, as we need to run CMake inside it
git archive --prefix=osm2go-${VERSION}/ ${VERSION} | tar x -C ${TMPDIR}

if [ $# -eq 2 ]; then
tar -x -C ${TMPDIR}/osm2go-${VERSION} -f "${2}"
if [ $# -eq 1 ]; then
tar -x -C ${TMPDIR}/osm2go-${VERSION} -f "${1}"
find ${TMPDIR}/osm2go-${VERSION}/data -name '*.png' -exec touch {} +
fi

Expand Down

0 comments on commit 2eb3eed

Please sign in to comment.