diff options
author | Florian Pritz <bluewind@xinu.at> | 2016-08-26 19:13:08 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2016-08-26 19:13:08 +0200 |
commit | c763f7d9fd680b5f3e785043dd0058b9dc17bb1f (patch) | |
tree | 8baccee84542f1e1e3bac5f3e6f3e0065ab43ca4 | |
parent | f1dbb24d1b93adb9b76f1bfed2c619a4e71c447b (diff) | |
download | bin-c763f7d9fd680b5f3e785043dd0058b9dc17bb1f.tar.gz bin-c763f7d9fd680b5f3e785043dd0058b9dc17bb1f.tar.xz |
ch: Inline chroot creation code
This removes a confusing error message from archbuild which was caused
by it being run in an empty directory.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | ch | 28 |
1 files changed, 20 insertions, 8 deletions
@@ -86,16 +86,28 @@ __chrootalias_resolve() { __chrootalias_resolve_create() { __chrootalias_resolve "$1" + local -a packages=(base-devel) + local chroot_repo=${chroot%-*} + + if [[ $chroot = multilib* ]]; then + packages+=(multilib-devel) + fi + + local arch + case "$chroot_arch" in + 32) arch=i686;; + 64) arch=x86_64;; + esac + # create chroot if necessary if [[ ! -d "$chrootdir/root" ]]; then - # fix command for multilib - case $chroot in - multilib*) chroot_cmd="${chroot%%-x86_64}";; - *) chroot_cmd="$chroot";; - esac - cd /var/empty - sudo "${chroot_cmd}-build" -c -r "$CHROOTS" || true - cd - + # from archbuild (devtools) + sudo mkdir -p "$chrootdir" + setarch "${arch}" mkarchroot \ + -C "/usr/share/devtools/pacman-${chroot_repo}.conf" \ + -M "/usr/share/devtools/makepkg-${arch}.conf" \ + "$chrootdir/root" \ + "${packages[@]}" fi } |