From 5434d3991cd51873f987bde49d55948341c09f3e Mon Sep 17 00:00:00 2001 From: Jan Steffens Date: Sun, 13 Mar 2011 18:09:52 +0100 Subject: Remove sudo from archbuild Archbuild should be called via sudo. --- archbuild | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/archbuild b/archbuild index 8d75e77..7e8c456 100755 --- a/archbuild +++ b/archbuild @@ -29,20 +29,25 @@ while getopts 'cr:' arg; do esac done +if [ "$EUID" != '0' ]; then + echo 'This script must be run as root.' + exit 1 +fi + if ${clean_first} || [ ! -d "${chroots}/${repo}-${arch}" ]; then echo "Creating chroot for [${repo}] (${arch})..." - sudo rm -rf ${chroots}/${repo}-${arch} - sudo mkdir -p ${chroots}/${repo}-${arch} - setarch ${arch} sudo mkarchroot \ + rm -rf ${chroots}/${repo}-${arch} + mkdir -p ${chroots}/${repo}-${arch} + setarch ${arch} mkarchroot \ -C /usr/share/devtools/pacman-${repo}.conf \ -M /usr/share/devtools/makepkg-${arch}.conf \ ${chroots}/${repo}-${arch}/root \ ${base_packages} else - setarch ${arch} sudo mkarchroot \ + setarch ${arch} mkarchroot \ -u \ ${chroots}/${repo}-${arch}/root fi echo "Building in chroot for [${repo}] (${arch})..." -setarch ${arch} sudo makechrootpkg -c -r ${chroots}/${repo}-${arch} +setarch ${arch} makechrootpkg -c -r ${chroots}/${repo}-${arch} -- cgit v1.2.3-70-g09d2