aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/0006-abuild-rename-distfile-copy-when-checksum-does-not-m.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/abuild/0006-abuild-rename-distfile-copy-when-checksum-does-not-m.patch')
-rw-r--r--main/abuild/0006-abuild-rename-distfile-copy-when-checksum-does-not-m.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/main/abuild/0006-abuild-rename-distfile-copy-when-checksum-does-not-m.patch b/main/abuild/0006-abuild-rename-distfile-copy-when-checksum-does-not-m.patch
new file mode 100644
index 0000000000..84c560e7b8
--- /dev/null
+++ b/main/abuild/0006-abuild-rename-distfile-copy-when-checksum-does-not-m.patch
@@ -0,0 +1,39 @@
+From 90899669c2da9cce4b54851c45fb482e6950a876 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Fri, 8 Jul 2016 13:44:31 +0300
+Subject: [PATCH 6/6] abuild: rename distfile copy when checksum does not match
+
+The previous deletion of file did not work properly at all. Fix
+this instead to rename the file, so we keep the previous download.
+This allows builders to redownload upstream file if the checksum
+has been changed in aports.
+---
+ abuild.in | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/abuild.in b/abuild.in
+index 49e2630..d4614d1 100644
+--- a/abuild.in
++++ b/abuild.in
+@@ -247,11 +247,14 @@ sumcheck() {
+ if [ $? -ne 0 ]; then
+ endreturnval=1
+ is_remote $origin || continue
+- echo "Because the remote file above failed the ${algo}sum check it will be deleted."
++
++ local csum="${src:0:8}"
++ local file="$SRCDEST/$(filename_from_uri $origin)"
++
++ echo "Because the remote file above failed the ${algo}sum check it will be renamed."
+ echo "Rebuilding will cause it to re-download which in some cases may fix the problem."
+- file=`echo "$src" | sed 's/.*[ \t\n]\(.*\)/\1/'`
+- echo "Deleting: $file"
+- rm $file
++ echo "Renaming: ${file##*/} to ${file##*/}.$csum"
++ mv "$file" "$file.$csum"
+ fi
+ done
+ unset IFS
+--
+2.9.0
+