1 |
Both programs need to exit with status 0. |
2 |
|
3 |
Signed-off-by: Anna Vyalkova <cyber+gentoo@×××××.in> |
4 |
--- |
5 |
I encountered a situation when bzip2 failed but tar didn't return error |
6 |
code. This patch fixes it. |
7 |
|
8 |
Tested with stage1 (can't get past it). |
9 |
|
10 |
scripts/bootstrap-prefix.sh | 51 +++++++++++++++++++++---------------- |
11 |
1 file changed, 29 insertions(+), 22 deletions(-) |
12 |
|
13 |
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh |
14 |
index 76383c0210..b8ad960e6d 100755 |
15 |
--- a/scripts/bootstrap-prefix.sh |
16 |
+++ b/scripts/bootstrap-prefix.sh |
17 |
@@ -602,8 +602,8 @@ do_tree() { |
18 |
fi |
19 |
einfo "Unpacking, this may take a while" |
20 |
estatus "stage1: unpacking Portage tree" |
21 |
- bzip2 -dc ${DISTDIR}/$2 | \ |
22 |
- tar -xf - -C ${PORTDIR} --strip-components=1 || return 1 |
23 |
+ bzip2 -dc ${DISTDIR}/$2 | tar -xf - -C ${PORTDIR} --strip-components=1 |
24 |
+ [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 |
25 |
touch ${PORTDIR}/.unpacked |
26 |
fi |
27 |
} |
28 |
@@ -692,7 +692,8 @@ bootstrap_portage() { |
29 |
rm -rf "${S}" >& /dev/null |
30 |
mkdir -p "${S}" >& /dev/null |
31 |
cd "${S}" |
32 |
- bzip2 -dc "${DISTDIR}/${A}" | tar -xf - || return 1 |
33 |
+ bzip2 -dc "${DISTDIR}/${A}" | tar -xf - |
34 |
+ [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 |
35 |
S="${S}/prefix-portage-${PV}" |
36 |
cd "${S}" |
37 |
|
38 |
@@ -787,7 +788,8 @@ bootstrap_simple() { |
39 |
bz2) decomp=bzip2 ;; |
40 |
gz|"") decomp=gzip ;; |
41 |
esac |
42 |
- ${decomp} -dc "${DISTDIR}"/${A} | tar -xf - || return 1 |
43 |
+ ${decomp} -dc "${DISTDIR}"/${A} | tar -xf - |
44 |
+ [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 |
45 |
S="${S}"/${PN}-${PV} |
46 |
cd "${S}" |
47 |
|
48 |
@@ -842,18 +844,21 @@ bootstrap_gnu() { |
49 |
rm -rf "${S}" |
50 |
mkdir -p "${S}" |
51 |
cd "${S}" |
52 |
- if [[ ${t} == "tar.gz" ]] ; then |
53 |
- gzip -dc "${DISTDIR}"/${URL##*/} | tar -xf - || continue |
54 |
- elif [[ ${t} == "tar.xz" ]] ; then |
55 |
- xz -dc "${DISTDIR}"/${URL##*/} | tar -xf - || continue |
56 |
- elif [[ ${t} == "tar.bz2" ]] ; then |
57 |
- bzip2 -dc "${DISTDIR}"/${URL##*/} | tar -xf - || continue |
58 |
- elif [[ ${t} == "tar" ]] ; then |
59 |
- tar -xf "${DISTDIR}"/${A} || continue |
60 |
- else |
61 |
- einfo "unhandled extension: $t" |
62 |
- return 1 |
63 |
- fi |
64 |
+ case ${t} in |
65 |
+ tar.xz) decomp=xz ;; |
66 |
+ tar.bz2) decomp=bzip2 ;; |
67 |
+ tar.gz) decomp=gzip ;; |
68 |
+ tar) |
69 |
+ tar -xf "${DISTDIR}"/${A} || continue |
70 |
+ break |
71 |
+ ;; |
72 |
+ *) |
73 |
+ einfo "unhandled extension: $t" |
74 |
+ return 1 |
75 |
+ ;; |
76 |
+ esac |
77 |
+ ${decomp} -dc "${DISTDIR}"/${URL##*/} | tar -xf - |
78 |
+ [[ ${PIPESTATUS[*]} == '0 0' ]] || continue |
79 |
break |
80 |
done |
81 |
S="${S}"/${PN}-${PV} |
82 |
@@ -1202,7 +1207,8 @@ bootstrap_cmake_core() { |
83 |
rm -rf "${S}" |
84 |
mkdir -p "${S}" |
85 |
cd "${S}" |
86 |
- gzip -dc "${DISTDIR}"/${A} | tar -xf - || return 1 |
87 |
+ gzip -dc "${DISTDIR}"/${A} | tar -xf - |
88 |
+ [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 |
89 |
S="${S}"/cmake-${PV} |
90 |
cd "${S}" |
91 |
|
92 |
@@ -1253,11 +1259,12 @@ bootstrap_zlib_core() { |
93 |
rm -rf "${S}" |
94 |
mkdir -p "${S}" |
95 |
cd "${S}" |
96 |
- if [[ ${A} == *.tar.gz ]] ; then |
97 |
- gzip -dc "${DISTDIR}"/${A} | tar -xf - || return 1 |
98 |
- else |
99 |
- bzip2 -dc "${DISTDIR}"/${A} | tar -xf - || return 1 |
100 |
- fi |
101 |
+ case ${A} in |
102 |
+ *.tar.gz) decomp=gzip ;; |
103 |
+ *) decomp=bzip2 ;; |
104 |
+ esac |
105 |
+ ${decomp} -dc "${DISTDIR}"/${A} | tar -xf - |
106 |
+ [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 |
107 |
S="${S}"/zlib-${PV} |
108 |
cd "${S}" |
109 |
|
110 |
-- |
111 |
2.35.1 |