arch-detect.patch 713 B

12345678910111213141516171819202122
  1. diff --git a/debootstrap b/debootstrap
  2. index fcdb20f..184900d 100755
  3. --- a/debootstrap
  4. +++ b/debootstrap
  5. @@ -427,6 +427,16 @@ elif in_path udpkg && \
  6. HOST_ARCH=$(/usr/bin/udpkg --print-architecture)
  7. elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then
  8. HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch")
  9. +elif in_path pacman; then
  10. + # pacman 5.1 will have `pacman-conf Architecture`
  11. + CARCH="$(bash -c '. /etc/makepkg.conf && echo $CARCH')"
  12. + case "$CARCH" in
  13. + "i686") HOST_ARCH="i386" ;;
  14. + "x86_64") HOST_ARCH="amd64" ;;
  15. + "armv7h") HOST_ARCH="armhf" ;;
  16. + "aarch64") HOST_ARCH="arm64" ;;
  17. + *) echo "Unknown architecture: $CARCH" && exit 1
  18. + esac
  19. fi
  20. HOST_OS="$HOST_ARCH"
  21. # basic host OS guessing for non-Debian systems