summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ob-gencontrol.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ob-gencontrol.sh b/src/ob-gencontrol.sh
index d13c991..4a6e943 100644
--- a/src/ob-gencontrol.sh
+++ b/src/ob-gencontrol.sh
@@ -169,10 +169,18 @@ gen_md5sums()
{
local binary="${1}"
shift 1
+ local sum=
+ local file=
+
+ exec 3>"${binary}.control/md5sums"
+ while read -r sum file; do
+ file="${file#${binary}.data}"
+ printf '%s %s\n' "${sum}" "${file}" >&3
+ done <<-EOF
+ $(find "${binary}.data" -type f | sort | xargs md5sum)
+ EOF
+ exec 3>&-
- find "${binary}.data" -type f | sort | xargs md5sum | \
- sed "s@ ${binary}.data@ @" \
- >"${binary}.control/md5sums"
if [ -z "$(head -n 1 "${binary}.control/md5sums")" ]; then
rm -f -- "${binary}.control/md5sums"
else