Hello community, here is the log from the commit of package duply for openSUSE:Factory checked in at 2017-08-16 16:18:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/duply (Old) and /work/SRC/openSUSE:Factory/.duply.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "duply" Wed Aug 16 16:18:30 2017 rev:18 rq:516912 version:2.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/duply/duply.changes 2016-09-30 15:33:15.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.duply.new/duply.changes 2017-08-16 16:18:35.480303469 +0200 @@ -1,0 +2,29 @@ +Tue Aug 8 20:09:42 UTC 2017 - [email protected] + +- Update to version 2.0.2: + * Bugfix: never insert creds into file:// targets. + * Bugfix: avail profiles hint sometimes shortend the names by one + char. + * Bugfix 108: CMD_NEXT variable should ignore conditional commands + (and, or). + * Export condition before/after next/prev command as + CND_PREV,CND_NEXT now. + * Bugfix 97: Unknown command should be ERROR, not WARNING. +- Changes from version 2.0.1: + * Bugfix 104: Duply 2.0 sets wrong archive dir, --name was always + 'duply_'. +- Changes from version 2.0: + * Made this a major version change, as we broke backward + compatibility anyway. If your backend stops working w/ this + version create a new profile and export the env vars needed as + described in the comments of the conf file directly above the + SOURCE setting. + * Making sure multi spaces in TARGET survive awk processing. + * New env var PROFILE exported to scripts. + * Fix 102: expose a unique timestamp variable for pre/post scripts + actually a featreq. exporting RUN_START nanosec unix timestamp. + * Fix 101: GPG_AGENT_INFO is 'bogus'. + * Fix 96: duply cannot handle two consecutive spaces in paths. +- Update Copyright year. + +------------------------------------------------------------------- Old: ---- duply_1.11.3.tgz New: ---- duply_2.0.2.tgz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ duply.spec ++++++ --- /var/tmp/diff_new_pack.JNDIXW/_old 2017-08-16 16:18:36.716129998 +0200 +++ /var/tmp/diff_new_pack.JNDIXW/_new 2017-08-16 16:18:36.720129437 +0200 @@ -1,8 +1,8 @@ # # spec file for package duply # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. -# Copyright (c) 2011-2016 Malcolm J Lewis <[email protected]> +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2011-2017 Malcolm J Lewis <[email protected]> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,13 +18,13 @@ Name: duply -Version: 1.11.3 +Version: 2.0.2 Release: 0 Summary: A frontend for the mighty duplicity magic License: GPL-2.0 Group: Productivity/Archiving/Compression Url: http://duply.net/ -Source0: http://downloads.sourceforge.net/ftplicity/duply%20%28simple%20duplicity%29/1.11.x/%{name}_%{version}.tgz +Source0: https://svwh.dl.sourceforge.net/project/ftplicity/duply%20%28simple%20duplicity%29/2.0.x/%{name}_%{version}.tgz # MANUAL BEGIN Requires: duplicity # MANUAL END @@ -47,7 +47,13 @@ %files %defattr(-,root,root,-) -%doc CHANGELOG.txt gpl-2.0.txt +%doc CHANGELOG.txt +%if ( 0%{?suse_version} == 1315 && 0%{?sle_version} == 120100 ) || ! 0%{?is_opensuse} +# Needed if Leap 42.1 or SLE build targets +%doc gpl-2.0.txt +%else +%license gpl-2.0.txt +%endif %{_bindir}/%{name} %changelog ++++++ duply_1.11.3.tgz -> duply_2.0.2.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duply_1.11.3/CHANGELOG.txt new/duply_2.0.2/CHANGELOG.txt --- old/duply_1.11.3/CHANGELOG.txt 2016-05-29 13:16:04.000000000 +0200 +++ new/duply_2.0.2/CHANGELOG.txt 2017-05-23 14:51:09.000000000 +0200 @@ -17,6 +17,31 @@ - import/export profile from/to .tgz function !!! CHANGELOG: +2.0.2 (23.05.2017) +- bugfix: never insert creds into file:// targets +- bugfix: avail profiles hint sometimes shortend the names by one char +- bugfix 108: CMD_NEXT variable should ignore conditional commands (and, or) +- export condition before/after next/prev command as CND_PREV,CND_NEXT now +- bugfix 97: Unknown command should be ERROR, not WARNING + +2.0.1 (16.11.2016) +- bugfix 104: Duply 2.0 sets wrong archive dir, --name was always 'duply_' + +2.0 (27.10.2016) +made this a major version change, as we broke backward compatibility anyway +(see last change in v1.10). got complaints that rightfully pointed out +that should only come w/ a major version change. so, here we go ;) +if your backend stops working w/ this version create a new profile and +export the env vars needed as described in the comments of the conf file +directly above the SOURCE setting. +Changes: +- making sure multi spaces in TARGET survive awk processing +- new env var PROFILE exported to scripts +- fix 102: expose a unique timestamp variable for pre/post scripts + actually a featreq. exporting RUN_START nanosec unix timestamp +- fix 101: GPG_AGENT_INFO is 'bogus' (thx Thomas Harning Jr.) +- fix 96: duply cannot handle two consecutive spaces in paths + 1.11.3 (29.5.2016) - fix wrong "WARNING: No running gpg-agent ..." when sign key was not set diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duply_1.11.3/duply new/duply_2.0.2/duply --- old/duply_1.11.3/duply 2016-05-29 13:16:04.000000000 +0200 +++ new/duply_2.0.2/duply 2017-05-23 14:51:09.000000000 +0200 @@ -33,6 +33,31 @@ # - import/export profile from/to .tgz function !!! # # CHANGELOG: +# 2.0.2 (23.05.2017) +# - bugfix: never insert creds into file:// targets +# - bugfix: avail profiles hint sometimes shortend the names by one char +# - bugfix 108: CMD_NEXT variable should ignore conditional commands (and, or) +# - export condition before/after next/prev command as CND_PREV,CND_NEXT now +# - bugfix 97: Unknown command should be ERROR, not WARNING +# +# 2.0.1 (16.11.2016) +# - bugfix 104: Duply 2.0 sets wrong archive dir, --name was always 'duply_' +# +# 2.0 (27.10.2016) +# made this a major version change, as we broke backward compatibility anyway +# (see last change in v1.10). got complaints that rightfully pointed out +# that should only come w/ a major version change. so, here we go ;) +# if your backend stops working w/ this version create a new profile and +# export the env vars needed as described in the comments of the conf file +# directly above the SOURCE setting. +# Changes: +# - making sure multi spaces in TARGET survive awk processing +# - new env var PROFILE exported to scripts +# - fix 102: expose a unique timestamp variable for pre/post scripts +# actually a featreq. exporting RUN_START nanosec unix timestamp +# - fix 101: GPG_AGENT_INFO is 'bogus' (thx Thomas Harning Jr.) +# - fix 96: duply cannot handle two consecutive spaces in paths +# # 1.11.3 (29.5.2016) # - fix wrong "WARNING: No running gpg-agent ..." when sign key was not set # @@ -419,7 +444,8 @@ # implement basename in plain bash function basename { - echo "${1##*/}" + local stripped="${1%/}" + echo "${stripped##*/}" } # implement dirname in plain bash @@ -445,7 +471,7 @@ ME_LONG="$0" ME="$(basename $0)" ME_NAME="${ME%%.*}" -ME_VERSION="1.11.3" +ME_VERSION="2.0.2" ME_WEBSITE="http://duply.net" # default config values @@ -493,13 +519,12 @@ # remove trailing slash, get profile name etc. CONFDIR="${CONFDIR%/}" - NAME="${CONFDIR##*/}" + PROFILE="${CONFDIR##*/}" CONF="$CONFDIR/conf" PRE="$CONFDIR/pre" POST="$CONFDIR/post" EXCLUDE="$CONFDIR/exclude" KEYFILE="$CONFDIR/gpgkey.asc" - } function version_info { # print version information @@ -668,11 +693,11 @@ 1h78m (interval, 1 hour 78 minutes ago) PRE/POST SCRIPTS: - Useful internal duply variables will be readable in the scripts. - Some of interest may be + Some useful internal duply variables are exported to the scripts. - CONFDIR, SOURCE, TARGET_URL_<PROT|HOSTPATH|USER|PASS>, - GPG_<KEYS_ENC|KEY_SIGN|PW>, CMD_<PREV|NEXT>, CMD_ERR + PROFILE, CONFDIR, SOURCE, TARGET_URL_<PROT|HOSTPATH|USER|PASS>, + GPG_<KEYS_ENC|KEY_SIGN|PW>, CMD_<PREV|NEXT>, CMD_ERR, RUN_START, + CND_<PREV|NEXT> (condition before/after next/prev command) The CMD_* variables were introduced to allow different actions according to the command the scripts were attached to e.g. 'pre_bkp_post_pre_verify_post' @@ -1154,7 +1179,7 @@ if var_isset 'ARCH_DIR'; then DUPL_ARCHDIR="--archive-dir $(qw "${ARCH_DIR}")" fi - DUPL_ARCHDIR="${DUPL_ARCHDIR} --name $(qw "duply_${NAME}")" +DUPL_ARCHDIR="${DUPL_ARCHDIR} --name $(qw "duply_${PROFILE}")" fi DUPL_PARAMS_GLOBAL="${DUPL_ARCHDIR} ${DUPL_PARAM_ENC} \ @@ -1190,9 +1215,9 @@ else # wrap in quotes to protect from spaces [ ! $PARAMSNOW ] && \ - DUPL_CMD="$DUPL_CMD $(qw $param)" \ + DUPL_CMD="$DUPL_CMD $(qw "$param")" \ || \ - DUPL_CMD_PARAMS="$DUPL_CMD_PARAMS $(qw $param)" + DUPL_CMD_PARAMS="$DUPL_CMD_PARAMS $(qw "$param")" fi done @@ -1209,9 +1234,9 @@ [ -n "$PYTHON" ] && [ "$PYTHON" != "$DEFAULT_PYTHON" ] &&\ BIN="$(qw "$(python_binary)") $(qw "$DUPL_BIN")" -$RUN ${DUPL_VARS_GLOBAL} ${BACKEND_PARAMS} \ +$RUN "${DUPL_VARS_GLOBAL} ${BACKEND_PARAMS} \ ${DUPL_PRECMD} $BIN $DUPL_CMD $DUPL_PARAMS_GLOBAL $(duplicity_params_conf)\ - $GPG_USEAGENT $(gpg_custom_binary) $DUPL_CMD_PARAMS ${PREVIEW:+} + $GPG_USEAGENT $(gpg_custom_binary) $DUPL_CMD_PARAMS" local ERR=$? return $ERR @@ -1286,6 +1311,11 @@ return 1 } +function is_condition { + local CMD=$(tolower "$@") + [ "$CMD" == 'and' ] || [ "$CMD" == 'or' ] +} + function url_encode { # utilize python, silently do nothing on error - because no python no duplicity OUT=$("$(python_binary)" -c " @@ -1557,18 +1587,22 @@ # checks if gpg-agent is available, returns error code # 0 on success -# 1 if GPG_AGENT_INFO is not set +# 1 if GPG_AGENT_INFO is not set (unused, should probably be merged w/ 3) # 2 if GPG_AGENT_INFO is stale # 3 cannot connect to gpg-agent function gpg_agent_avail { - local ERR=1 + # GPG_AGENT_INFO is deprecated in gpg2.1, + # first try to connect to a possibly running agent here + local ERR=3 + gpg-agent > /dev/null 2>&1 && return 0 + + # detect stale pid in legacy GPG_AGENT_INFO env var if var_isset GPG_AGENT_INFO; then - ps -p $(echo $GPG_AGENT_INFO|awk -F: '{print $2}') > /dev/null 2>&1 && \ - ERR=0 || ERR=2 - else - # GPG_AGENT_INFO is deprecated in gpg2.1, - # so we try to connect to a possibly running agent here - gpg-agent > /dev/null 2>&1 && ERR=0 || ERR=3 + # check if a pid matching process is running at all + local GPG_AGENT_PID=$(echo $GPG_AGENT_INFO|awk -F: '{print $2}') + if isnumber "$GPG_AGENT_PID"; then + ps -p "$GPG_AGENT_PID" > /dev/null 2>&1 || ERR=2 + fi fi return $ERR @@ -1695,7 +1729,7 @@ '$CONFDIR'. Hints: - Select one of the available profiles: $(ls -1p $(dirname "$CONFDIR")| awk 'BEGIN{ORS="";OFS=""}/\/$/&&!/^\.+\/$/{print sep"\047"substr($0,0,length($0)-1)"\047";sep=","}'). +Select one of the available profiles: $(for d in "$(dirname "$CONFDIR")"/*/; do [ -e "$d" ] || [ -L "$d" ] || continue; printf "$sep'$(basename "$d")'"; sep=",";done) Use '$ME <name> create' to create a new profile. Use '$ME usage' to get usage help." elif [ ! -x "$CONFDIR" ]; then @@ -1723,7 +1757,7 @@ secureconf # split TARGET in handy variables -TARGET_SPLIT_URL=$(echo $TARGET | awk '{ \ +TARGET_SPLIT_URL=$(echo "$TARGET" | awk '{ \ target=$0; match(target,/^([^\/:]+):\/\//); \ prot=substr(target,RSTART,RLENGTH);\ rest=substr(target,RSTART+RLENGTH); \ @@ -1750,7 +1784,7 @@ gsub(/[\047]/,"\047\\\047\047",pass);\ print "TARGET_URL_PASS=$(url_decode \047"pass"\047)\n"}\ }') -eval ${TARGET_SPLIT_URL} +eval "${TARGET_SPLIT_URL}" # fetch commmand from parameters ######################################################## # Hint: cmds is also used to check if authentification info sufficient in the next step @@ -2080,8 +2114,10 @@ var_isset 'TARGET_USER' && TARGET_URL_USER="$TARGET_USER" var_isset 'TARGET_PASS' && TARGET_URL_PASS="$TARGET_PASS" +TARGET_URL_PROT_lowercase="$(tolower "${TARGET_URL_PROT%%:*}")" + # issue some warnings -case "$(tolower "${TARGET_URL_PROT%%:*}")" in +case "$TARGET_URL_PROT_lowercase" in 'cf+http') # info on missing AUTH_URL if ! var_isset 'CLOUDFILES_AUTHURL'; then @@ -2111,7 +2147,7 @@ # for all protocols we put username in url and pass into env var # for sec�rity reasons, we url_encode username to protect special chars # first sortout backends with special ways to handle password -case "$(tolower "${TARGET_URL_PROT%%:*}")" in +case "$TARGET_URL_PROT_lowercase" in 'imap'|'imaps') var_isset 'TARGET_URL_PASS' && BACKEND_PARAMS="IMAP_PASSWORD=$(qw "${TARGET_URL_PASS}")" ;; @@ -2122,7 +2158,7 @@ ;; esac # insert url encoded username into target url if needed -if var_isset 'TARGET_URL_USER'; then +if var_isset 'TARGET_URL_USER' && [ "$TARGET_URL_PROT_lowercase" != "file" ]; then BACKEND_URL="${TARGET_URL_PROT}$(url_encode "${TARGET_URL_USER}")@${TARGET_URL_HOSTPATH}" else BACKEND_URL="$TARGET" @@ -2142,6 +2178,8 @@ # convert cmds to array, lowercase for safety CMDS=( $(awk "BEGIN{ cmds=tolower(\"$cmds\"); gsub(/_/,\" \",cmds); print cmds }") ) +unset FTPL_ERR + # run cmds for cmd in ${CMDS[*]}; do @@ -2173,21 +2211,49 @@ continue fi -# get prev/nextcmd vars +unset CMD_VALUE CMD_NEXT CMD_PREV CND_NEXT CND_PREV + +# get next cmd,cnd vars nextno=$(($CMD_NO+1)) -[ "$nextno" -lt "${#CMDS[@]}" ] && CMD_NEXT=${CMDS[$nextno]} || CMD_NEXT='END' -# get previous command minus skipped commands +while ! var_isset 'CMD_NEXT' +do + if [ "$nextno" -lt "${#CMDS[@]}" ]; then + CMD_VALUE=${CMDS[$nextno]} + is_condition "$CMD_VALUE" && CND_NEXT="$CMD_VALUE" || CMD_NEXT="$CMD_VALUE" + else + CMD_NEXT='END' + fi + nextno=$(($nextno+1)) +done + +# get prev cnd, cnd are skipped pseudocmds +prevno=$(( $CMD_NO - 1 )) +CMD_VALUE=${CMDS[$prevno]} +is_condition "$CMD_VALUE" && [ "$prevno" -ge 0 ] && CND_PREV=${CMDS[$prevno]} + +# get prev cmd command minus skipped commands, only executed prevno=$(( $CMD_NO - ${CMD_SKIPPED-0} - 1 )); unset CMD_SKIPPED -[ "$prevno" -ge 0 ] && CMD_PREV=${CMDS[$prevno]} || CMD_PREV='START' +while ! var_isset 'CMD_PREV' +do + if [ "$prevno" -ge 0 ]; then + CMD_VALUE=${CMDS[$prevno]} + is_condition "$CMD_VALUE" || CMD_PREV="$CMD_VALUE" + else + CMD_PREV='START' + fi + prevno=$(($prevno-1)) +done + +# save start time +RUN_START=$(date_fix %s)$(nsecs) # export some useful env vars for external scripts/programs to use -export CONFDIR SOURCE TARGET_URL_PROT TARGET_URL_HOSTPATH \ +export PROFILE CONFDIR SOURCE TARGET_URL_PROT TARGET_URL_HOSTPATH \ TARGET_URL_USER TARGET_URL_PASS \ GPG_KEYS_ENC=$(join "\n" "${GPG_KEYS_ENC_ARRAY[@]}") GPG_KEY_SIGN \ - GPG_PW CMD_PREV CMD_NEXT CMD_ERR + GPG_PW CMD_PREV CMD_NEXT CMD_ERR CND_PREV CND_NEXT\ + RUN_START -# save start time -RUN_START=$(date_fix %s)$(nsecs) # user info echo; separator "Start running command $(toupper $cmd) at $(date_from_nsecs $RUN_START)" @@ -2283,7 +2349,10 @@ duplify collection-status -- "${dupl_opts[@]}" "$BACKEND_URL" ;; *) - warning "Unknown command '$cmd'." + error " Unknown command '$cmd'. + + Hint: + Use '$ME usage' to get usage help." ;; esac
