summaryrefslogtreecommitdiff
path: root/src/librefetch/librefetch-makepkg.conf.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-01-01 19:22:16 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-01-01 19:22:16 -0500
commit2c981bb6e7f5ddb1b71a2a4e314ba7cd523d857c (patch)
treebc3725cd9195e1157fce45aeddaa270567eab5ee /src/librefetch/librefetch-makepkg.conf.in
parent3ed991a0ab8adbc30e66771080d565668d8dd3a6 (diff)
Add a utility to add/remove librefetch from makepkg.conf
This script is formerly the install script for the bundled-up package.
Diffstat (limited to 'src/librefetch/librefetch-makepkg.conf.in')
-rw-r--r--src/librefetch/librefetch-makepkg.conf.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/librefetch/librefetch-makepkg.conf.in b/src/librefetch/librefetch-makepkg.conf.in
new file mode 100644
index 0000000..d6bc93e
--- /dev/null
+++ b/src/librefetch/librefetch-makepkg.conf.in
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash # non-executable, but put this there as a hint to text editors
+
+# This file should be 'source'd by makepkg.conf to enable librefetch
+edit_dlagents() {
+ local dlagent="@bindir@/librefetch -p $(printf %q "${BUILDFILE:-$BUILDSCRIPT}") -- %u %o"
+
+ local i
+ for i in "${!DLAGENTS[@]}"; do
+ if [[ "${DLAGENTS[$i]}" = https::* ]]; then
+ DLAGENTS[$i]="https::$dlagent"
+ fi
+ done
+ DLAGENTS+=("libre::$dlagent")
+}
+edit_dlagents
+unset -f edit_dlagents