build.sh: better handling of CHROOT
Ximin Luo
4 years ago
36 | 36 | DEB_HOST_ARCH=$(dpkg-architecture -q DEB_HOST_ARCH) |
37 | 37 | SRCNAME="${DEBSRC}_${DEBVER}" |
38 | 38 | BUILDNAME="${DEBSRC}_${DEBVER}_${DEB_HOST_ARCH}" |
39 | if [ -z "$CHROOT" ] && schroot -i -c "debcargo-unstable-${DEB_HOST_ARCH}-sbuild" >/dev/null 2>&1; then | |
40 | CHROOT="debcargo-unstable-${DEB_HOST_ARCH}-sbuild" | |
39 | if [ -z "$CHROOT" ]; then | |
40 | #if schroot -i -c "debcargo-unstable-${DEB_HOST_ARCH}-sbuild" >/dev/null 2>&1; then | |
41 | CHROOT="debcargo-unstable-${DEB_HOST_ARCH}-sbuild" | |
42 | #el | |
43 | if schroot -i -c "unstable-${DEB_HOST_ARCH}-sbuild" >/dev/null 2>&1; then | |
44 | CHROOT="unstable-${DEB_HOST_ARCH}-sbuild" | |
45 | echo >&2 "Automatically using sbuild chroot unstable-${DEB_HOST_ARCH}-sbuild; however it's" | |
46 | echo >&2 "strongly recommended to create a separate chroot debcargo-unstable-${DEB_HOST_ARCH}-sbuild" | |
47 | echo >&2 "so your builds won't have to re-download & re-install cargo, rustc, and llvm every time." | |
48 | echo >&2 "See README.rst section \"Build environment\" for details." | |
49 | sleep 1 | |
50 | else | |
51 | abort 1 "could not automatically find a suitable chroot; set CHROOT" | |
52 | fi | |
41 | 53 | fi |
42 | 54 | |
43 | 55 | shouldbuild() { |