Skip to content

Commit

Permalink
fix not enough arguments for shift
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael_chicoli authored and joergsteffens committed Jan 8, 2016
1 parent f2cbdcb commit a040767
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
14 changes: 9 additions & 5 deletions debian/bareos-database-common.config.in
Expand Up @@ -30,12 +30,16 @@ if [ -r @scriptdir@/bareos-config-lib.sh ]; then
dbc_dbtypes=`echo ${dbc_dbtypes} | sed 's/, *$//'`

# action
param1="$1"
shift || true
if [ $# -gt 0 ]; then
param1="$1"
shift
fi
# $2: when action is "configure": most-recently-configured-version
param2="$1"
param2_orig=$param2
shift || true
if [ $# -gt 0 ]; then
param2="$1"
param2_orig=$param2
shift
fi

# When upgrading from an older version (param2),
# do not pass the version number of the old package.
Expand Down
12 changes: 8 additions & 4 deletions debian/bareos-database-common.postinst.in
Expand Up @@ -25,11 +25,15 @@ if [ -r @scriptdir@/bareos-config-lib.sh ]; then
. /usr/share/dbconfig-common/dpkg/postinst

# action
param1="$1"
shift || true
if [ $# -gt 0 ]; then
param1="$1"
shift
fi
# when action is "configure": most-recently-configured-version
param2="$1"
shift || true
if [ $# -gt 0 ]; then
param2="$1"
shift
fi
if [ "$param2" ]; then
case "$param1" in
configure|reconfigure)
Expand Down

0 comments on commit a040767

Please sign in to comment.