From 649fb6374ae5b0581c0d02c78e1feb78ee1c3ad6 Mon Sep 17 00:00:00 2001
From: Max Rees <maxcrees@me.com>
Date: Fri, 1 May 2020 02:06:56 -0500
Subject: checkapk: avoid downloading -dbg and -dev multiple times

---
 checkapk.in | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/checkapk.in b/checkapk.in
index 0150568..5841a37 100644
--- a/checkapk.in
+++ b/checkapk.in
@@ -271,10 +271,20 @@ for i in $pkgname $subpackages; do
 
 	newapk="$(fetch_new "$_pkgname")"
 
-	oldapk=old.apk
-	if ! fetch_old "$_pkgname"; then
-		oldapk=
-	fi
+	case "$newapk" in
+	"$dbg2")
+		oldapk="$dbg1"
+		;;
+	"$dev2")
+		oldapk="$dev1"
+		;;
+	*)
+		oldapk=old.apk
+		if ! fetch_old "$_pkgname"; then
+			oldapk=
+		fi
+		;;
+	esac
 
 	if [ -n "$oldapk" ]; then
 		pkginfo "$oldapk" "pkginfo-$_pkgname-old"
-- 
cgit v1.2.3-70-g09d2