Code

Removed more bashisms
[gosa.git] / gosa-core / contrib / make-gosa-package
index ffdf3c9ffbd3a64dda16652ecc58fc217de56948..f80e325885c16ecfc291b45d2fd8bfd7f074b381 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # This code is part of GOsa (http://www.gosa-project.org)
 # Copyright (C) 2008 GONICUS GmbH
 #
@@ -44,6 +44,11 @@ usage() {
        exit 1
 }
 
+if ! which dh-make-gosa >/dev/null; then
+       echo "Error: cannot find dh-make-gosa binary in path!";
+       exit 1
+fi
+
 # Import command line parameters
 PARMS=`getopt -o brscip:,h --long branch,changelog,plugins,section,si-section,release:,help -n "${0##*/}" -- "$@"`
 eval set -- "$PARMS"
@@ -57,7 +62,7 @@ while true; do
                 -c|--changelog)
                        RELEASE_REASON=$2; shift 2 ;;
                 -p|--plugins)
-                       MAKE_PLUGINS=${2//,/ }; shift 2 ;;
+                       MAKE_PLUGINS=$(echo $2 | tr ',' ' '); shift 2 ;;
                 -s|--section)
                        SECTION=$2; shift 2 ;;
                 -i|--si-section)
@@ -71,9 +76,6 @@ while true; do
         esac
 done
 
-echo $BRANCH
-exit 0
-
 [ $BRANCH = "trunk" ] || BRANCH="branches/$BRANCH"
 echo "Loading svn information for '${BRANCH}'..."
 svn co -N https://oss.gonicus.de/repositories/gosa/${BRANCH} gosa-info/ > /dev/null
@@ -161,7 +163,7 @@ for plugin in $MAKE_PLUGINS; do
 done
 for dir in $GOSA_DIR $GOSA_SI_DIR $GOSA_PLUGIN_DIRS; do
        echo "Adapting version in $dir"
-       (cd "$dir"; echo | debchange -v "${GOSA_VER}-1${TARGET_RELEASE}1" -D "$TARGET_RELEASE" "$RELEASE_REASON" &> /dev/null)
+       (cd "$dir"; echo | debchange -v "${GOSA_VER}-1${TARGET_RELEASE}1" -D "$TARGET_RELEASE" "$RELEASE_REASON" >/dev/null 2>&1)
        [ -d $dir/debian/patches ] || continue
        echo "Creating patch list for $dir"
        ls -1 $dir/debian/patches | grep -v 00list | sed 's%^.*/%%g' > $dir/debian/patches/00list