From 9c28c606c12b244a1034fbc7693ffe7894d86d7b Mon Sep 17 00:00:00 2001
From: Alad Wenter <alad@mailbox.org>
Date: Fri, 6 Oct 2017 23:03:14 +0200
Subject: [PATCH 1/7] aurbuild: backport fix for #236

---
 bin/aurbuild | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/aurbuild b/bin/aurbuild
index 05df8b0..4672372 100755
--- a/bin/aurbuild
+++ b/bin/aurbuild
@@ -110,6 +110,7 @@ root=$(canonicalize_path "${root-$server}")
 if [[ -w $root/ && -r $root/ ]]; then
     # File: custom.db -> custom.db.tar
     db_path=$(readlink -f "$root/$database".db)
+    files_path=$(readlink -f "$root/$database".files)
 else
     error "$argv0: $root: permission denied"
     exit 13
@@ -168,8 +169,13 @@ while read -r -u "$fd" pkg _; do
 
     # https://github.com/vodik/repose/issues/46
     if ((sign_pkg)); then
-        gpg "${gpg_args[@]}" --output "$var_tmp/${db_path##*/}".sig "$db_path"
-        mv -bv "$var_tmp/${db_path##*/}".sig -t "$root"
+        for i in "$db_path" "$files_path"; do
+            # https://github.com/AladW/aurutils/issues/236
+            i_sig=$var_tmp/${i##*/}.sig
+
+            gpg "${gpg_args[@]}" --output "$i_sig" "$i"
+            mv -bv "$i_sig" -t "$root"
+        done
     fi
 
     if ((chroot)); then
-- 
2.11.0
