From aaa68e49e8e5a68950a63b9aa4a8c1f6aed2e2d2 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 1 Nov 2011 15:33:08 +0100 Subject: Move common functions to a shared file * common.sh is included on build time * most functions are copied from makepkg --- archbuild.in | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'archbuild.in') diff --git a/archbuild.in b/archbuild.in index 5b5ab21..e3e5f13 100644 --- a/archbuild.in +++ b/archbuild.in @@ -1,6 +1,9 @@ #!/bin/bash -base_packages=(base base-devel sudo) +m4_include(lib/common.sh) + +# FIXME: temporary added curl until pacman 4.0 moves to [core] +base_packages=(base base-devel sudo curl) cmd="${0##*/}" if [[ "${cmd%%-*}" == 'multilib' ]]; then @@ -31,16 +34,15 @@ while getopts 'cr:' arg; do done if [[ "$EUID" != '0' ]]; then - echo 'This script must be run as root.' - exit 1 + die 'This script must be run as root.' fi if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then - echo "Creating chroot for [${repo}] (${arch})..." + msg "Creating chroot for [${repo}] (${arch})..." for copy in "${chroots}/${repo}-${arch}"/*; do [[ -d $copy ]] || continue - echo "Deleting chroot copy '$(basename "${copy}")'..." + msg2 "Deleting chroot copy '$(basename "${copy}")'..." # Lock the copy exec 9>"${copy}.lock" @@ -71,5 +73,5 @@ else "${chroots}/${repo}-${arch}/root" fi -echo "Building in chroot for [${repo}] (${arch})..." +msg "Building in chroot for [${repo}] (${arch})..." setarch "${arch}" makechrootpkg -c -r "${chroots}/${repo}-${arch}" -- cgit v1.2.3-70-g09d2