# HG changeset patch # User Babis Nikolaou # Date 1426096522 -7200 # Node ID 485e825512e49e85d2ff6c46f92a243b575c2a3c # Parent ab5aa71b5d00dff0bf2c40a165a35203f9cd1d84 added license and comments to script update-debian-version.sh, and also made it portable for MacOS X, although one does not need a deb package in these systems diff -r ab5aa71b5d00 -r 485e825512e4 scripts/update-debian-version.sh --- a/scripts/update-debian-version.sh Wed Mar 11 17:29:40 2015 +0200 +++ b/scripts/update-debian-version.sh Wed Mar 11 19:55:22 2015 +0200 @@ -1,9 +1,42 @@ #!/bin/bash + # -# Should be run without arguments from inside the endpoint-exec directory. +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Pyravlos Team +# +# http://www.strabon.di.uoa.gr/ +# + +# +# Script for updating the version field in the control file that is needed +# by the jdeb plugin when generating the Strabon .deb file. It is run by maven +# when the jdeb goal is invoked. This is done mainly during the package phase. +# From command-line, it is done simply by executing command +# `mvn -Ddebian=true package'. +# +# It should be run without arguments from inside the `endpoint-exec' or +# `runtime' directories. See also the respective `pom.xml' files in these +# directories. +# +# Author: Charalampos (Babis) Nikolaou # VERSION=`grep version pom.xml | head -1 | sed 's/\(.*\)\(.*\)<\/version>/\2/'` +INPUT_FILE=./src/deb/control/control -sed -i "s/^Version.*$/Version: ${VERSION}/" ./src/deb/control/control +BAK= +# in Mac OS X, sed expects a suffix for the bak file (when done in place) +if test `uname` = "Darwin"; then + BAK='.bak' +fi + +sed -i ${BAK} "s/^Version.*$/Version: ${VERSION}/" "${INPUT_FILE}" + +# remove the backup file +if ! test -z "${BAK}"; then + rm -f "${INPUT_FILE}${BAK}" +fi