Use pacman, not apt, when on Arch Linux
[dev-env-setup.git] / mk-deb-chroot
index 7325377ce8a67ddb9874b8bff093613e33955182..680f024a3a8d773de235c942a17715d06d2b5222 100755 (executable)
@@ -12,8 +12,16 @@ echo "creating chroot '$chrootdir'"
 
 # Create coriolis chroot dir in /opt
 mkdir -p /opt/chroot/$chrootdir
-# Install debootstrap and schroot via apt
-apt install -y debootstrap schroot
+
+# Install debootstrap and schroot
+if [ -e /etc/debian_version ]; then
+    # Debian detected: use apt
+    apt install -y debootstrap schroot
+elif [ -e /etc/arch-release ]; then
+    # Arch Linux detected: use pacman
+    pacman -S --needed debootstrap schroot
+fi
+
 # Install debian/buster chroot using debootstrap
 /usr/sbin/debootstrap buster /opt/chroot/$chrootdir \
                       http://ftp.uk.debian.org/debian