summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Steffens <jan.steffens@gmail.com>2011-03-13 18:09:52 +0100
committerJan Steffens <jan.steffens@gmail.com>2011-03-18 12:04:26 +0100
commit5434d3991cd51873f987bde49d55948341c09f3e (patch)
tree3c4f262f931fa9da4d3ef5c48be077d3007a9ffc
parent36dc5d8792599c547889fcaa30052b7c09e7add0 (diff)
downloaddevtools-5434d3991cd51873f987bde49d55948341c09f3e.tar.gz
devtools-5434d3991cd51873f987bde49d55948341c09f3e.tar.xz
Remove sudo from archbuild
Archbuild should be called via sudo.
-rwxr-xr-xarchbuild15
1 files 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}