aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2017-07-27 22:30:20 +0800
committerolgeni <olgeni@FreeBSD.org>2017-07-27 22:30:20 +0800
commit5a10c83348b2a3a72d029112a073d5f5284b0620 (patch)
treead58d7b893b5a6334e25a661d5474a6d13110349
parentdea6741fb9230e6e18c064b92b3c4d751a39b11d (diff)
downloadfreebsd-ports-gnome-5a10c83348b2a3a72d029112a073d5f5284b0620.tar.gz
freebsd-ports-gnome-5a10c83348b2a3a72d029112a073d5f5284b0620.tar.zst
freebsd-ports-gnome-5a10c83348b2a3a72d029112a073d5f5284b0620.zip
sysutils/restic: respect PREFIX in creation of bash completion script.
PR: 221046 Submitted by: olgeni Approved by: maintainer
-rw-r--r--sysutils/restic/Makefile4
-rw-r--r--sysutils/restic/files/patch-src_cmds_restic_cmd__autocomplete.go11
2 files changed, 15 insertions, 0 deletions
diff --git a/sysutils/restic/Makefile b/sysutils/restic/Makefile
index e8dfde2d0a16..7845278106b5 100644
--- a/sysutils/restic/Makefile
+++ b/sysutils/restic/Makefile
@@ -3,6 +3,7 @@
PORTNAME= restic
PORTVERSION= 0.7.1
DISTVERSIONPREFIX= v
+PORTREVISION= 1
CATEGORIES= sysutils
MAINTAINER= wg@FreeBSD.org
@@ -16,6 +17,9 @@ USE_GITHUB= yes
STRIP= # stripping can break go binaries
PLIST_FILES= bin/restic
+post-patch:
+ @${REINPLACE_CMD} -e "s@%%PREFIX%%@${PREFIX}@g" ${WRKSRC}/src/cmds/restic/cmd_autocomplete.go
+
do-build:
@(cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} run build.go)
diff --git a/sysutils/restic/files/patch-src_cmds_restic_cmd__autocomplete.go b/sysutils/restic/files/patch-src_cmds_restic_cmd__autocomplete.go
new file mode 100644
index 000000000000..26bac8725559
--- /dev/null
+++ b/sysutils/restic/files/patch-src_cmds_restic_cmd__autocomplete.go
@@ -0,0 +1,11 @@
+--- src/cmds/restic/cmd_autocomplete.go.orig 2017-07-27 13:03:30 UTC
++++ src/cmds/restic/cmd_autocomplete.go
+@@ -30,7 +30,7 @@ $ sudo restic autocomplete`,
+ func init() {
+ cmdRoot.AddCommand(cmdAutocomplete)
+
+- cmdAutocomplete.Flags().StringVarP(&autocompleteTarget, "completionfile", "", "/etc/bash_completion.d/restic.sh", "autocompletion file")
++ cmdAutocomplete.Flags().StringVarP(&autocompleteTarget, "completionfile", "", "%%PREFIX%%/etc/bash_completion.d/restic.sh", "autocompletion file")
+ // For bash-completion
+ cmdAutocomplete.Flags().SetAnnotation("completionfile", cobra.BashCompFilenameExt, []string{})
+ }