summaryrefslogtreecommitdiff
path: root/core/pkgutils/PKGMK_FULL_SOURCE_MIRRORS.patch.new
blob: ee38b212c8d943a34e455fa99716fd15ba0fc44c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
diff --git a/pkgmk.conf b/pkgmk.conf
index b29e3ad..5762735 100644
--- a/pkgmk.conf
+++ b/pkgmk.conf
@@ -22,6 +22,7 @@ case ${PKGMK_ARCH} in
 		;;
 esac
 
+# PKGMK_FULL_SOURCE_MIRRORS=()
 # PKGMK_SOURCE_MIRRORS=()
 # PKGMK_SOURCE_DIR="$PWD"
 # PKGMK_PACKAGE_DIR="$PWD"
diff --git a/pkgmk.conf.5.in b/pkgmk.conf.5.in
index 0af5900..dfadd9d 100644
--- a/pkgmk.conf.5.in
+++ b/pkgmk.conf.5.in
@@ -24,8 +24,15 @@ Set make options.
 .br
 Default: none
 .TP
+\fBPKGMK_FULL_SOURCE_MIRRORS=('STRING')\fP
+Set mirrors to check and download source archives from.
+Those mirrors should accept full url's.
+.br
+Default: none
+.TP
 \fBPKGMK_SOURCE_MIRRORS=('STRING')\fP
 Set mirrors to check and download source archives from.
+Those mirrors should accept filenames only.
 .br
 Default: none
 .TP
diff --git a/pkgmk.in b/pkgmk.in
index 6789eae..13996ef 100755
--- a/pkgmk.in
+++ b/pkgmk.in
@@ -127,10 +127,9 @@ download_file() {
 
 	error=1
 
-	BASENAME=`get_basename $1`
-	for REPO in ${PKGMK_SOURCE_MIRRORS[@]}; do
+	for REPO in ${PKGMK_FULL_SOURCE_MIRRORS[@]}; do
 		REPO="`echo $REPO | sed 's|/$||'`"
-		$PKGMK_DOWNLOAD_PROG $DOWNLOAD_OPTS $RESUME_OPTS $REPO/$BASENAME
+		$PKGMK_DOWNLOAD_PROG $DOWNLOAD_OPTS $RESUME_OPTS $REPO/$1
 		error=$?
 		if [ $error == 0 ]; then
 			break
@@ -138,6 +137,18 @@ download_file() {
 	done
 
 	if [ $error != 0 ]; then
+		BASENAME=`get_basename $1`
+		for REPO in ${PKGMK_SOURCE_MIRRORS[@]}; do
+			REPO="`echo $REPO | sed 's|/$||'`"
+			$PKGMK_DOWNLOAD_PROG $DOWNLOAD_OPTS $RESUME_OPTS $REPO/$BASENAME
+			error=$?
+			if [ $error == 0 ]; then
+				break
+			fi
+		done
+	fi
+
+	if [ $error != 0 ]; then
 		while true; do
 			$PKGMK_DOWNLOAD_PROG $DOWNLOAD_OPTS $RESUME_OPTS $1
 			error=$?