Strabon

changeset 1486:485e825512e4

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
author Babis Nikolaou <charnik@di.uoa.gr>
date Wed Mar 11 19:55:22 2015 +0200 (2015-03-11)
parents ab5aa71b5d00
children 0397b9f4b68f
files scripts/update-debian-version.sh
line diff
     1.1 --- a/scripts/update-debian-version.sh	Wed Mar 11 17:29:40 2015 +0200
     1.2 +++ b/scripts/update-debian-version.sh	Wed Mar 11 19:55:22 2015 +0200
     1.3 @@ -1,9 +1,42 @@
     1.4  #!/bin/bash
     1.5 +
     1.6  #
     1.7 -# Should be run without arguments from inside the endpoint-exec directory.
     1.8 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.9 +# License, v. 2.0. If a copy of the MPL was not distributed with this
    1.10 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
    1.11 +#
    1.12 +# Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015 Pyravlos Team
    1.13 +#
    1.14 +# http://www.strabon.di.uoa.gr/
    1.15 +#
    1.16 +
    1.17 +#
    1.18 +# Script for updating the version field in the control file that is needed
    1.19 +# by the jdeb plugin when generating the Strabon .deb file. It is run by maven
    1.20 +# when the jdeb goal is invoked. This is done mainly during the package phase.
    1.21 +# From command-line, it is done simply by executing command
    1.22 +# `mvn -Ddebian=true package'.
    1.23 +#
    1.24 +# It should be run without arguments from inside the `endpoint-exec' or
    1.25 +# `runtime' directories. See also the respective `pom.xml' files in these
    1.26 +# directories.
    1.27 +#
    1.28 +# Author: Charalampos (Babis) Nikolaou <charnik@di.uoa.gr>
    1.29  #
    1.30  
    1.31  VERSION=`grep version pom.xml | head -1 | sed 's/\(.*\)<version>\(.*\)<\/version>/\2/'`
    1.32 +INPUT_FILE=./src/deb/control/control
    1.33  
    1.34 -sed -i "s/^Version.*$/Version: ${VERSION}/" ./src/deb/control/control
    1.35 +BAK=
    1.36  
    1.37 +# in Mac OS X, sed expects a suffix for the bak file (when done in place)
    1.38 +if test `uname` = "Darwin"; then
    1.39 +	BAK='.bak'
    1.40 +fi
    1.41 +
    1.42 +sed -i ${BAK} "s/^Version.*$/Version: ${VERSION}/" "${INPUT_FILE}"
    1.43 +
    1.44 +# remove the backup file
    1.45 +if ! test -z "${BAK}"; then
    1.46 +	rm -f "${INPUT_FILE}${BAK}"
    1.47 +fi