summaryrefslogtreecommitdiff
path: root/archbuild.in
diff options
context:
space:
mode:
Diffstat (limited to 'archbuild.in')
-rw-r--r--archbuild.in69
1 files changed, 0 insertions, 69 deletions
diff --git a/archbuild.in b/archbuild.in
deleted file mode 100644
index a41d490..0000000
--- a/archbuild.in
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-
-m4_include(lib/common.sh)
-
-base_packages=(base base-devel sudo)
-
-cmd="${0##*/}"
-if [[ "${cmd%%-*}" == 'multilib' ]]; then
- repo="${cmd%-build}"
- arch='x86_64'
- base_packages+=(multilib-devel)
-else
- tag="${cmd%-build}"
- repo=${tag%-*}
- arch=${tag##*-}
-fi
-chroots='/var/lib/archbuild'
-clean_first=false
-
-usage() {
- echo "Usage: $cmd"
- echo ' -c Recreate the chroot before building'
- echo ' -r <dir> Create chroots in this directory'
- exit 1
-}
-
-while getopts 'cr:' arg; do
- case "${arg}" in
- c) clean_first=true ;;
- r) chroots="$OPTARG" ;;
- *) usage ;;
- esac
-done
-
-if [[ "$EUID" != '0' ]]; then
- die 'This script must be run as root.'
-fi
-
-if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
- msg "Creating chroot for [${repo}] (${arch})..."
-
- for copy in "${chroots}/${repo}-${arch}"/*; do
- [[ -d $copy ]] || continue
- msg2 "Deleting chroot copy '$(basename "${copy}")'..."
-
- lock_open_write 9 "$copy.lock" "Locking chroot copy '$copy'"
-
- { type -P btrfs && btrfs subvolume delete "${copy}"; } &>/dev/null
- rm -rf --one-file-system "${copy}"
- done
- lock_close 9
-
- rm -rf --one-file-system "${chroots}/${repo}-${arch}"
- mkdir -p "${chroots}/${repo}-${arch}"
- setarch "${arch}" mkarchroot \
- -C "@pkgdatadir@/pacman-${repo}.conf" \
- -M "@pkgdatadir@/makepkg-${arch}.conf" \
- "${chroots}/${repo}-${arch}/root" \
- "${base_packages[@]}" || abort
-else
- setarch ${arch} mkarchroot \
- -u \
- -C "@pkgdatadir@/pacman-${repo}.conf" \
- -M "@pkgdatadir@/makepkg-${arch}.conf" \
- "${chroots}/${repo}-${arch}/root" || abort
-fi
-
-msg "Building in chroot for [${repo}] (${arch})..."
-exec setarch "${arch}" makechrootpkg -c -n -r "${chroots}/${repo}-${arch}"