1 |
commit: dedba266af11afd99be69dd29eb0bd1b4e9a3ad0 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 3 07:12:17 2020 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 3 07:12:17 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=dedba266 |
7 |
|
8 |
scripts/bootstrap-prefix: try to avoid downloading files which don't exist |
9 |
|
10 |
libressl only has a .gz tarball, so it's pointless to try .xz and bz2. |
11 |
|
12 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
13 |
|
14 |
scripts/bootstrap-prefix.sh | 97 +++++++++++++++++++-------------------------- |
15 |
1 file changed, 40 insertions(+), 57 deletions(-) |
16 |
|
17 |
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh |
18 |
index e70bc57311..99b405f406 100755 |
19 |
--- a/scripts/bootstrap-prefix.sh |
20 |
+++ b/scripts/bootstrap-prefix.sh |
21 |
@@ -91,33 +91,6 @@ efetch() { |
22 |
return 0 |
23 |
} |
24 |
|
25 |
-# template |
26 |
-# bootstrap_() { |
27 |
-# PV= |
28 |
-# A= |
29 |
-# einfo "Bootstrapping ${A%-*}" |
30 |
- |
31 |
-# efetch ${A} || return 1 |
32 |
- |
33 |
-# einfo "Unpacking ${A%-*}" |
34 |
-# export S="${PORTAGE_TMPDIR}/${PN}" |
35 |
-# rm -rf ${S} |
36 |
-# mkdir -p ${S} |
37 |
-# cd ${S} |
38 |
-# tar -zxf ${DISTDIR}/${A} || return 1 |
39 |
-# S=${S}/${PN}-${PV} |
40 |
-# cd ${S} |
41 |
- |
42 |
-# einfo "Compiling ${A%-*}" |
43 |
-# econf || return 1 |
44 |
-# $MAKE ${MAKEOPTS} || return 1 |
45 |
- |
46 |
-# einfo "Installing ${A%-*}" |
47 |
-# $MAKE install || return 1 |
48 |
- |
49 |
-# einfo "${A%-*} successfully bootstrapped" |
50 |
-# } |
51 |
- |
52 |
configure_cflags() { |
53 |
export CPPFLAGS="-I${ROOT}/tmp/usr/include" |
54 |
|
55 |
@@ -735,6 +708,40 @@ bootstrap_portage() { |
56 |
einfo "${A%-*} successfully bootstrapped" |
57 |
} |
58 |
|
59 |
+bootstrap_simple() { |
60 |
+ local PN PV A S |
61 |
+ PN=$1 |
62 |
+ PV=$2 |
63 |
+ A=${PN}-${PV}.tar.${3:-gz} |
64 |
+ einfo "Bootstrapping ${A%-*}" |
65 |
+ |
66 |
+ efetch ${4:-${DISTFILES_G_O}/distfiles}/${A} || return 1 |
67 |
+ |
68 |
+ einfo "Unpacking ${A%-*}" |
69 |
+ S="${PORTAGE_TMPDIR}/${PN}-${PV}" |
70 |
+ rm -rf "${S}" |
71 |
+ mkdir -p "${S}" |
72 |
+ cd "${S}" |
73 |
+ case $3 in |
74 |
+ xz) decomp=xz ;; |
75 |
+ bz2) decomp=bzip2 ;; |
76 |
+ gz|) decomp=gzip ;; |
77 |
+ esac |
78 |
+ ${decomp} -dc "${DISTDIR}"/${A} | tar -xf - || return 1 |
79 |
+ S="${S}"/${PN}-${PV} |
80 |
+ cd "${S}" |
81 |
+ |
82 |
+ einfo "Compiling ${A%-*}" |
83 |
+ v $MAKE || return 1 |
84 |
+ |
85 |
+ einfo "Installing ${A%-*}" |
86 |
+ v $MAKE PREFIX="${ROOT}"/tmp/usr install || return 1 |
87 |
+ |
88 |
+ cd "${ROOT}" |
89 |
+ rm -Rf "${S}" |
90 |
+ einfo "${PN}-${PV} successfully bootstrapped" |
91 |
+} |
92 |
+ |
93 |
bootstrap_gnu() { |
94 |
local PN PV A S |
95 |
PN=$1 |
96 |
@@ -1279,42 +1286,18 @@ bootstrap_gzip() { |
97 |
} |
98 |
|
99 |
bootstrap_xz() { |
100 |
- GNU_URL=${XZ_URL:-http://tukaani.org} bootstrap_gnu xz 5.2.4 || \ |
101 |
- GNU_URL=${XZ_URL:-http://tukaani.org} bootstrap_gnu xz 5.2.3 |
102 |
+ GNU_URL=http://tukaani.org/xz bootstrap_gnu xz 5.2.4 || \ |
103 |
+ GNU_URL=http://tukaani.org/xz bootstrap_gnu xz 5.2.3 |
104 |
} |
105 |
|
106 |
bootstrap_bzip2() { |
107 |
- local PN PV A S |
108 |
- PN=bzip2 |
109 |
- PV=1.0.6 |
110 |
- A=${PN}-${PV}.tar.gz |
111 |
- einfo "Bootstrapping ${A%-*}" |
112 |
- |
113 |
- efetch ${DISTFILES_G_O}/distfiles/${A} || return 1 |
114 |
- |
115 |
- einfo "Unpacking ${A%-*}" |
116 |
- S="${PORTAGE_TMPDIR}/${PN}-${PV}" |
117 |
- rm -rf "${S}" |
118 |
- mkdir -p "${S}" |
119 |
- cd "${S}" |
120 |
- gzip -dc "${DISTDIR}"/${A} | tar -xf - || return 1 |
121 |
- S="${S}"/${PN}-${PV} |
122 |
- cd "${S}" |
123 |
- |
124 |
- einfo "Compiling ${A%-*}" |
125 |
- $MAKE || return 1 |
126 |
- |
127 |
- einfo "Installing ${A%-*}" |
128 |
- $MAKE PREFIX="${ROOT}"/tmp/usr install || return 1 |
129 |
- |
130 |
- cd "${ROOT}" |
131 |
- rm -Rf "${S}" |
132 |
- einfo "${A%-*} successfully bootstrapped" |
133 |
+ bootstrap_simple bzip2 1.0.6 gz \ |
134 |
+ https://sourceware.org/pub/bzip2 |
135 |
} |
136 |
|
137 |
bootstrap_libressl() { |
138 |
- GNU_URL="https://ftp.openbsd.org/pub/OpenBSD/LibreSSL" \ |
139 |
- bootstrap_gnu libressl 2.8.3 |
140 |
+ bootstrap_simple libressl 2.8.3 gz \ |
141 |
+ https://ftp.openbsd.org/pub/OpenBSD/LibreSSL |
142 |
} |
143 |
|
144 |
bootstrap_stage_host_gentoo() { |