Bug 230544 - sysutils/duply: Port broken after update to 2.1
Summary: sysutils/duply: Port broken after update to 2.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Danilo G. Baio
Depends on:
Reported: 2018-08-11 18:08 UTC by Peter Putzer
Modified: 2018-08-11 19:03 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (michael)


Note You need to log in before you can comment on or make changes to this bug.
Description Peter Putzer 2018-08-11 18:08:41 UTC
sysutils/duply is broken in version 2.1, due to the incorrect replacement of the python interpreter variable. The variable is called "python_binary" now, but only "python" is replaced. This results in "$(/usr/local/bin/python2.7_binary)" which of course does not work.

I'm not sure the replacement is actually needed anymore, as duply seems to work fine with this interim patch applied to the makefile:

--- Makefile.orig	2018-08-11 20:02:43.020810000 +0200
+++ Makefile	2018-08-11 20:03:02.549038000 +0200
@@ -28,7 +28,7 @@
 	${REINPLACE_CMD} -e "s,/etc/duply,${ETCDIR},g" ${WRKSRC}/duply
-	${REINPLACE_CMD} -e "s,(python,(${PYTHON_CMD},g" ${WRKSRC}/duply
+	#${REINPLACE_CMD} -e "s,(python,(${PYTHON_CMD},g" ${WRKSRC}/duply
 	${INSTALL_SCRIPT} ${WRKSRC}/duply ${STAGEDIR}${PREFIX}/bin/duply
Comment 1 Danilo G. Baio freebsd_committer 2018-08-11 18:45:48 UTC
We don't need that patch indeed, duply will use the same Python binary that duplicity uses.

I'll fix this, thanks.

# parse interpreter from duplicity shebang
function duplicity_python_binary_parse {
  # cached result
  ( var_isset 'PYTHON' || var_isset 'DUPL_PYTHON_BIN' ) && return

  # parse it or warn
  local DUPL_BIN=$(which duplicity)
  DUPL_PYTHON_BIN=$(awk 'NR==1&&/^#!/{sub(/^#!( *\/usr\/bin\/env *)?/,""); print}' < "$DUPL_BIN")
  if ! echo "$DUPL_PYTHON_BIN" | grep -q -i 'python'; then
    warning "Could not parse the python interpreter used from duplicity ($DUPL_BIN). Result was '$DUPL_PYTHON_BIN'.
Will assume it is '$DEFAULT_PYTHON'."
}(In reply to Peter Putzer from comment #0)
Comment 2 commit-hook freebsd_committer 2018-08-11 19:01:20 UTC
A commit references this bug:

Author: dbaio
Date: Sat Aug 11 19:01:16 UTC 2018
New revision: 476940
URL: https://svnweb.freebsd.org/changeset/ports/476940

  sysutils/duply: Fix Python interpreter

  After r476919, post-patch was changing incorrectly the Python
  interpreter that `duply` uses.
  Without this patch, `duply` will look for the same interpreter
  that `duplicity` uses.

  PR:		230544
  Submitted by:	Peter Putzer <freebsd@mnd.sc>
  Approved by:	just fix it

Comment 3 Danilo G. Baio freebsd_committer 2018-08-11 19:03:17 UTC
Thank you!