Skip to content

Commit 227e5db

Browse files
edetersmitten
ede
authored andcommitted
release 2.5.5
1 parent dc4a31c commit 227e5db

File tree

1 file changed

+28
-32
lines changed

1 file changed

+28
-32
lines changed

duply.sh

+28-32
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
# - remove url_encode, test for invalid chars n throw error instead
3434
#
3535
# CHANGELOG:
36-
# 2.5.4 (1.1.2025)
36+
# 2.5.5 (2025-02-11)
37+
# - bugfix #143: parse duplicity 3.0.4 version fails (thx Mischa ter Smitten)
38+
# - clean out some compatibility code with ancient duplicity versions
39+
#
40+
# 2.5.4 (2025-01-01)
3741
# - bugfix #142: batch cmds with consecutive '_' fail, (hx Dominik Sommer
3842
# - allow undocumented space separated batch cmd list e.g. "pre bkp post"
3943
# - fix mawk incompatibility in gpg version detection
@@ -569,7 +573,7 @@ function lookup {
569573
ME_LONG="$0"
570574
ME="$(basename "$0")"
571575
ME_NAME="${ME%%.*}"
572-
ME_VERSION="2.5.4"
576+
ME_VERSION="2.5.5"
573577
ME_WEBSITE="https://duply.net"
574578

575579
# default config values
@@ -1203,8 +1207,9 @@ function duplicity_version_get {
12031207
[ -n "$PYTHON" ] &&\
12041208
CMD="$PYTHON $(qw "$(which duplicity)")"
12051209

1206-
DUPL_VERSION_OUT=$($CMD --version | tail -1)
1207-
DUPL_VERSION=$(echo $DUPL_VERSION_OUT | awk '/^duplicity/{print $2; exit;}')
1210+
DUPL_VERSION_OUT=$($CMD --version)
1211+
# keep "$DUPL_VERSION_OUT" in quotes to maintain line breaks of output
1212+
DUPL_VERSION=$(echo "$DUPL_VERSION_OUT" | awk '/^duplicity +/{print $2; exit;}')
12081213
#DUPL_VERSION='1.2.3' #'0.7.03' #'0.6.08b' #,0.4.4.RC4,0.6.08b
12091214
DUPL_VERSION_VALUE=0
12101215
DUPL_VERSION_AWK=$(awk -v v="$DUPL_VERSION" 'BEGIN{
@@ -1224,7 +1229,7 @@ function duplicity_version_get {
12241229
if [ $DUPL_VERSION_VALUE -eq 0 ]; then
12251230
inform "duplicity version check failed (please report, this is a bug)
12261231
the command
1227-
$CMD
1232+
$CMD --version
12281233
resulted in
12291234
$DUPL_VERSION_OUT
12301235
"
@@ -1239,12 +1244,16 @@ use the older $ME_NAME version 2.4.3 from $ME_WEBSITE."
12391244
fi
12401245
}
12411246

1247+
function duplicity_version_isvalid {
1248+
awk '!/^[0-9]+$/{exit 1}' <<< "$DUPL_VERSION_VALUE" && [ "$DUPL_VERSION_VALUE" -gt 0 ]
1249+
}
1250+
12421251
function duplicity_version_ge {
1243-
[ "$DUPL_VERSION_VALUE" -ge "$1" ]
1252+
duplicity_version_isvalid && [ "$DUPL_VERSION_VALUE" -ge "$1" ]
12441253
}
12451254

12461255
function duplicity_version_lt {
1247-
! duplicity_version_ge "$1"
1256+
duplicity_version_isvalid && ! duplicity_version_ge "$1"
12481257
}
12491258

12501259
# parse interpreter from duplicity shebang
@@ -1363,26 +1372,24 @@ function duplicity_params_global {
13631372
local GPG_OPTS=${GPG_OPTS:+"--gpg-options=$(qw "${GPG_OPTS}")"}
13641373

13651374
# set name for dupl archive folder, since 0.6.0
1366-
if duplicity_version_ge 601; then
1367-
local DUPL_ARCHDIR=''
1368-
if var_isset 'ARCH_DIR'; then
1369-
DUPL_ARCHDIR="--archive-dir $(qw "${ARCH_DIR}")"
1370-
# reuse erronously duply_ prefixed folders from bug #117
1371-
if [ -d "$ARCH_DIR/duply_${PROFILE}" ]; then
1372-
DUPL_ARCHDIR="${DUPL_ARCHDIR} --name $(qw "duply_${PROFILE}")"
1373-
else
1374-
DUPL_ARCHDIR="${DUPL_ARCHDIR} --name $(qw "${PROFILE}")"
1375-
fi
1375+
local DUPL_ARCHDIR=''
1376+
if var_isset 'ARCH_DIR'; then
1377+
DUPL_ARCHDIR="--archive-dir $(qw "${ARCH_DIR}")"
1378+
# reuse erronously duply_ prefixed folders from bug #117
1379+
if [ -d "$ARCH_DIR/duply_${PROFILE}" ]; then
1380+
DUPL_ARCHDIR="${DUPL_ARCHDIR} --name $(qw "duply_${PROFILE}")"
13761381
else
1377-
DUPL_ARCHDIR="--name $(qw "duply_${PROFILE}")"
1382+
DUPL_ARCHDIR="${DUPL_ARCHDIR} --name $(qw "${PROFILE}")"
13781383
fi
1384+
else
1385+
DUPL_ARCHDIR="--name $(qw "duply_${PROFILE}")"
13791386
fi
13801387

1381-
DUPL_PARAMS_GLOBAL="${DUPL_ARCHDIR} ${DUPL_PARAM_ENC}\
1388+
DUPL_PARAMS_GLOBAL="${DUPL_ARCHDIR} ${DUPL_PARAM_ENC}\
13821389
${DUPL_PARAM_SIGN} ${VERBOSITY:+--verbosity $VERBOSITY}\
13831390
${GPG_OPTS}"
13841391

1385-
DUPL_VARS_GLOBAL="TMPDIR='$TEMP_DIR'\
1392+
DUPL_VARS_GLOBAL="TMPDIR='$TEMP_DIR'\
13861393
${DUPL_ARG_ENC}"
13871394
}
13881395

@@ -2520,16 +2527,6 @@ Will use default which is probably rackspace."
25202527
warning "\
25212528
Swift will probably fail because the conf var SWIFT_AUTHURL was not exported!"
25222529
;;
2523-
'rsync')
2524-
# everything in url (this backend does not support pass in env var)
2525-
# this is obsolete from version 0.6.10 (buggy), hopefully fixed in 0.6.11
2526-
# print warning older version is detected
2527-
duplicity_version_lt 610 &&
2528-
warning "\
2529-
Duplicity version '$DUPL_VERSION' does not support providing the password as
2530-
env var for rsync backend. For security reasons you should consider to
2531-
update to a version greater than '0.6.10' of duplicity."
2532-
;;
25332530
esac
25342531

25352532

@@ -2559,8 +2556,7 @@ fi
25592556
SOURCE="$SOURCE"
25602557
BACKEND_URL="$BACKEND_URL"
25612558
EXCLUDE="$EXCLUDE"
2562-
# since 0.7.03 --exclude-globbing-filelist is deprecated
2563-
EXCLUDE_PARAM="--exclude$(duplicity_version_lt 703 && echo -globbing)-filelist"
2559+
EXCLUDE_PARAM="--exclude-filelist"
25642560

25652561
# replace
25662562
# - magic separators to command equivalents (+=and,-=or,[=groupIn,]=groupOut)

0 commit comments

Comments
 (0)