[23502] in Source-Commits
/svn/athena r23147 - trunk/debathena/scripts/build-server
daemon@ATHENA.MIT.EDU (andersk@MIT.EDU)
Sat Aug 16 02:27:57 2008
Date: Sat, 16 Aug 2008 02:27:26 -0400 (EDT)
From: andersk@MIT.EDU
Message-Id: <200808160627.CAA22687@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: andersk
Date: 2008-08-16 02:27:25 -0400 (Sat, 16 Aug 2008)
New Revision: 23147
Modified:
trunk/debathena/scripts/build-server/make-chroot
Log:
Put schroot config in /etc/schroot/chroot.d if it exists.
Modified: trunk/debathena/scripts/build-server/make-chroot
===================================================================
--- trunk/debathena/scripts/build-server/make-chroot 2008-08-15 19:40:48 UTC (rev 23146)
+++ trunk/debathena/scripts/build-server/make-chroot 2008-08-16 06:27:25 UTC (rev 23147)
@@ -19,11 +19,17 @@
for sig in 1 2 13 15; do trap "exit $(($sig + 128))" $sig; done
trap 'exittrap' EXIT
-if fgrep -x "[$CHROOT]" /etc/schroot/schroot.conf; then
+if fgrep -qxRs "[$CHROOT]" /etc/schroot/schroot.conf /etc/schroot/chroot.d; then
echo "Chroot $CHROOT already exists." >&2
exit 1
fi
+if [ -d /etc/schroot/chroot.d ]; then
+ CONF=/etc/schroot/chroot.d/$CHROOT
+else
+ CONF=/etc/schroot/schroot.conf
+fi
+
if [ "$ARCH" = "i386" ]; then
PERSONALITY=linux32
elif [ "$ARCH" = "amd64" ]; then
@@ -64,8 +70,8 @@
rmdir "$TARGET"
exittrap() { :; }
-cat >> /etc/schroot/schroot.conf <<EOF
-
+! [ -s "$CONF" ] || echo >> "$CONF"
+cat >> "$CONF" <<EOF
[$CHROOT]
type=lvm-snapshot
description=$CHROOT