summaryrefslogtreecommitdiff
path: root/src/librefetch/librefetch-makepkg.conf.in
diff options
context:
space:
mode:
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