33
33
# - remove url_encode, test for invalid chars n throw error instead
34
34
#
35
35
# 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)
37
41
# - bugfix #142: batch cmds with consecutive '_' fail, (hx Dominik Sommer
38
42
# - allow undocumented space separated batch cmd list e.g. "pre bkp post"
39
43
# - fix mawk incompatibility in gpg version detection
@@ -569,7 +573,7 @@ function lookup {
569
573
ME_LONG=" $0 "
570
574
ME=" $( basename " $0 " ) "
571
575
ME_NAME=" ${ME%% .* } "
572
- ME_VERSION=" 2.5.4 "
576
+ ME_VERSION=" 2.5.5 "
573
577
ME_WEBSITE=" https://duply.net"
574
578
575
579
# default config values
@@ -1203,8 +1207,9 @@ function duplicity_version_get {
1203
1207
[ -n " $PYTHON " ] && \
1204
1208
CMD=" $PYTHON $( qw " $( which duplicity) " ) "
1205
1209
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;}' )
1208
1213
# DUPL_VERSION='1.2.3' #'0.7.03' #'0.6.08b' #,0.4.4.RC4,0.6.08b
1209
1214
DUPL_VERSION_VALUE=0
1210
1215
DUPL_VERSION_AWK=$( awk -v v=" $DUPL_VERSION " ' BEGIN{
@@ -1224,7 +1229,7 @@ function duplicity_version_get {
1224
1229
if [ $DUPL_VERSION_VALUE -eq 0 ]; then
1225
1230
inform " duplicity version check failed (please report, this is a bug)
1226
1231
the command
1227
- $CMD
1232
+ $CMD --version
1228
1233
resulted in
1229
1234
$DUPL_VERSION_OUT
1230
1235
"
@@ -1239,12 +1244,16 @@ use the older $ME_NAME version 2.4.3 from $ME_WEBSITE."
1239
1244
fi
1240
1245
}
1241
1246
1247
+ function duplicity_version_isvalid {
1248
+ awk ' !/^[0-9]+$/{exit 1}' <<< " $DUPL_VERSION_VALUE" && [ " $DUPL_VERSION_VALUE " -gt 0 ]
1249
+ }
1250
+
1242
1251
function duplicity_version_ge {
1243
- [ " $DUPL_VERSION_VALUE " -ge " $1 " ]
1252
+ duplicity_version_isvalid && [ " $DUPL_VERSION_VALUE " -ge " $1 " ]
1244
1253
}
1245
1254
1246
1255
function duplicity_version_lt {
1247
- ! duplicity_version_ge " $1 "
1256
+ duplicity_version_isvalid && ! duplicity_version_ge " $1 "
1248
1257
}
1249
1258
1250
1259
# parse interpreter from duplicity shebang
@@ -1363,26 +1372,24 @@ function duplicity_params_global {
1363
1372
local GPG_OPTS=${GPG_OPTS: +" --gpg-options=$( qw " ${GPG_OPTS} " ) " }
1364
1373
1365
1374
# 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} " ) "
1376
1381
else
1377
- DUPL_ARCHDIR=" --name $( qw " duply_ ${PROFILE} " ) "
1382
+ DUPL_ARCHDIR=" ${DUPL_ARCHDIR} --name $( qw " ${PROFILE} " ) "
1378
1383
fi
1384
+ else
1385
+ DUPL_ARCHDIR=" --name $( qw " duply_${PROFILE} " ) "
1379
1386
fi
1380
1387
1381
- DUPL_PARAMS_GLOBAL=" ${DUPL_ARCHDIR} ${DUPL_PARAM_ENC} \
1388
+ DUPL_PARAMS_GLOBAL=" ${DUPL_ARCHDIR} ${DUPL_PARAM_ENC} \
1382
1389
${DUPL_PARAM_SIGN} ${VERBOSITY: +--verbosity $VERBOSITY } \
1383
1390
${GPG_OPTS} "
1384
1391
1385
- DUPL_VARS_GLOBAL=" TMPDIR='$TEMP_DIR '\
1392
+ DUPL_VARS_GLOBAL=" TMPDIR='$TEMP_DIR '\
1386
1393
${DUPL_ARG_ENC} "
1387
1394
}
1388
1395
@@ -2520,16 +2527,6 @@ Will use default which is probably rackspace."
2520
2527
warning " \
2521
2528
Swift will probably fail because the conf var SWIFT_AUTHURL was not exported!"
2522
2529
;;
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
- ;;
2533
2530
esac
2534
2531
2535
2532
2559
2556
SOURCE=" $SOURCE "
2560
2557
BACKEND_URL=" $BACKEND_URL "
2561
2558
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"
2564
2560
2565
2561
# replace
2566
2562
# - magic separators to command equivalents (+=and,-=or,[=groupIn,]=groupOut)
0 commit comments