Skip to content

Commit 8f513b9

Browse files
committed
Explicitly specify destination path
1 parent cd5b4a3 commit 8f513b9

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

common.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ clean() {
107107
rm -rf $DEST
108108
}
109109

110+
# filename cachepath downloadpath url
110111
download() {
111112
file=`echo $1 | tr ".-" "_"`
112113
eval "expected_cksum=\$SHA256_${file}"
@@ -115,15 +116,15 @@ download() {
115116
exit 1
116117
fi
117118

118-
if [ -f /usr/distfiles/$1 ]; then
119-
echo "$1 exists in /usr/distfiles"
120-
cp /usr/distfiles/$1 .
119+
if [ -f $2/$1 ]; then
120+
echo "$1 exists in $2"
121+
cp $2/$1 $3/$1
121122
else
122-
echo "download: $1 from $2"
123-
fetch -o $1 $2/$1
123+
echo "download: $1 from $4 and store into $3"
124+
fetch -o $3/$1 $4/$1
124125
fi
125126

126-
cksum=`sha256 -q $1`
127+
cksum=`sha256 -q $3/$1`
127128

128129
if [ "${cksum}" = "${expected_cksum}" ]; then
129130
echo "checksum ok for $1"
@@ -147,18 +148,16 @@ fixup-vendor-patch() {
147148

148149
extract() {
149150
mkdir -p $DEST/tmp $DEST/bootstrap
150-
cd $DEST
151+
152+
download rustc-$RUST_VERSION-src.tar.gz /usr/distfiles $DEST ${RUST_DIST_SERVER}/dist || exit 1
153+
tar xvzf $DEST/rustc-$RUST_VERSION-src.tar.gz -C ${DEST} 2>&1 | wc -l
151154

152155
for component in ${COMPONENTS}; do
153156
echo "INSTALL COMPONENT: ${component}"
154157
tar xvzf ${BOOTSTRAP_DIR}/$component-${TARGET}.tar.xz -C $DEST/tmp
155158
# install.sh needs bash, but used !/bin/bash which does not exist on DragonFly
156159
${BASH} $DEST/tmp/$component-${TARGET}/install.sh --prefix=$DEST/bootstrap
157160
done
158-
159-
160-
(cd $DEST && download rustc-$RUST_VERSION-src.tar.gz ${RUST_DIST_SERVER}/dist) || exit 1
161-
tar xvzf $DEST/rustc-$RUST_VERSION-src.tar.gz 2>&1 | wc -l
162161
}
163162

164163
prepatch() {

0 commit comments

Comments
 (0)