Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jul 2017 14:30:20 +0000 (UTC)
From:      Jimmy Olgeni <olgeni@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r446743 - in head/sysutils/restic: . files
Message-ID:  <201707271430.v6REUKRv014533@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: olgeni
Date: Thu Jul 27 14:30:20 2017
New Revision: 446743
URL: https://svnweb.freebsd.org/changeset/ports/446743

Log:
  sysutils/restic: respect PREFIX in creation of bash completion script.
  
  PR:		221046
  Submitted by:	olgeni
  Approved by:	maintainer

Added:
  head/sysutils/restic/files/
  head/sysutils/restic/files/patch-src_cmds_restic_cmd__autocomplete.go   (contents, props changed)
Modified:
  head/sysutils/restic/Makefile

Modified: head/sysutils/restic/Makefile
==============================================================================
--- head/sysutils/restic/Makefile	Thu Jul 27 14:23:17 2017	(r446742)
+++ head/sysutils/restic/Makefile	Thu Jul 27 14:30:20 2017	(r446743)
@@ -3,6 +3,7 @@
 PORTNAME=	restic
 PORTVERSION=	0.7.1
 DISTVERSIONPREFIX=	v
+PORTREVISION=	1
 CATEGORIES=	sysutils
 
 MAINTAINER=	wg@FreeBSD.org
@@ -15,6 +16,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)

Added: head/sysutils/restic/files/patch-src_cmds_restic_cmd__autocomplete.go
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/restic/files/patch-src_cmds_restic_cmd__autocomplete.go	Thu Jul 27 14:30:20 2017	(r446743)
@@ -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{})
+ }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707271430.v6REUKRv014533>