aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2024-03-23 14:18:12 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2024-03-23 14:30:40 +0000
commit881ef1a077b2fe77b8d94b5668f98afb10c6209c (patch)
tree6354adde7a36c1f4379d6f70e65e6144df40322b
parentce8ce767ba2e15391fc92440c7c38d79facde640 (diff)
downloadports-881ef1a077b2fe77b8d94b5668f98afb10c6209c.tar.gz
ports-881ef1a077b2fe77b8d94b5668f98afb10c6209c.zip
devel/github-backup-utils: Convert REINPLACE_CMD to patch file
-rw-r--r--devel/github-backup-utils/Makefile2
-rw-r--r--devel/github-backup-utils/files/patch-share-github-backup-utils-ghe-backup-config22
2 files changed, 23 insertions, 1 deletions
diff --git a/devel/github-backup-utils/Makefile b/devel/github-backup-utils/Makefile
index 23d149e33121..d94133d70b2a 100644
--- a/devel/github-backup-utils/Makefile
+++ b/devel/github-backup-utils/Makefile
@@ -25,7 +25,7 @@ SUB_FILES= pkg-message
SHEBANG_FILES= bin/* share/github-backup-utils/*
post-patch:
- @${REINPLACE_CMD} -e 's|/etc/github-backup-utils/backup.config|${PREFIX}/etc/github.backup.config|g' ${WRKSRC}/share/github-backup-utils/ghe-backup-config
+ @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/share/github-backup-utils/ghe-backup-config
do-install:
cd ${WRKSRC}/bin && ${COPYTREE_BIN} . ${STAGEDIR}${PREFIX}/bin
diff --git a/devel/github-backup-utils/files/patch-share-github-backup-utils-ghe-backup-config b/devel/github-backup-utils/files/patch-share-github-backup-utils-ghe-backup-config
new file mode 100644
index 000000000000..52111dc37e92
--- /dev/null
+++ b/devel/github-backup-utils/files/patch-share-github-backup-utils-ghe-backup-config
@@ -0,0 +1,22 @@
+% sed -i '' 's|/etc/github-backup-utils/backup.config|%%PREFIX%%/etc/github.backup.config|g' share/github-backup-utils/ghe-backup-config
+
+--- share/github-backup-utils/ghe-backup-config.orig 2024-02-15 22:08:04 UTC
++++ share/github-backup-utils/ghe-backup-config
+@@ -59,7 +59,7 @@ for f in "$GHE_BACKUP_CONFIG" "$GHE_BACKUP_ROOT/backup
+ # first and then fall back to the backup-utils root, home directory and system.
+ config_found=false
+ for f in "$GHE_BACKUP_CONFIG" "$GHE_BACKUP_ROOT/backup.config" \
+- "$HOME/.github-backup-utils/backup.config" "/etc/github-backup-utils/backup.config"; do
++ "$HOME/.github-backup-utils/backup.config" "%%PREFIX%%/etc/github.backup.config"; do
+ if [ -f "$f" ]; then
+ GHE_BACKUP_CONFIG="$f"
+ # shellcheck disable=SC1090 # This is a user-supplied value that can't be predicted
+@@ -259,7 +259,7 @@ if ! $config_found; then
+ [ -n "$GHE_BACKUP_CONFIG" ] && echo " - $GHE_BACKUP_CONFIG" 1>&2
+ echo " - $GHE_BACKUP_ROOT/backup.config" 1>&2
+ echo " - $HOME/.github-backup-utils/backup.config" 1>&2
+- echo " - /etc/github-backup-utils/backup.config" 1>&2
++ echo " - %%PREFIX%%/etc/github.backup.config" 1>&2
+ exit 2
+ fi
+