--- /dev/null
+#!/bin/bash
+
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+# Copyright (c) 2013 Peter Palfrader
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+DPKGARCH=$(dpkg --print-architecture)
+UNAMEARCH=$(uname -m)
+
+get_suites() {
+ case "$1" in
+ armel|s390x)
+ echo "sid jessie wheezy"
+ ;;
+ *)
+ echo "sid jessie wheezy squeeze"
+ ;;
+ esac
+}
+
+archs="$DPKGARCH"
+case "$DPKGARCH" in
+ amd64)
+ archs="$archs i386"
+ ;;
+ armhf)
+ archs="$archs armel"
+ ;;
+ s390|s390x)
+ archs="s390 s390x"
+ ;;
+esac
+
+err=0
+
+for a in $archs; do
+ for s in `get_suites "$a"`; do
+ setup-dchroot -f -a "$a" "$s" || err=1
+ done
+done
+
+exit $err
esac
}
+do_config() {
+ local tmpschrootconf=$(tempfile)
+ cleanup+=("rm -f $tmpschrootconf")
+ genschrootconf "$suite" "$arch" "$target" > "$tmpschrootconf"
+ if ! [ -e "$schrootconfig" ] || ! diff "$schrootconfig" "$tmpschrootconf" > /dev/null; then
+ mv "$tmpschrootconf" "$schrootconfig"
+ chmod 644 "$schrootconfig"
+ fi
+}
+
set -e
set -u
#
# let's go
#
-genschrootconf "$suite" "$arch" "$target" | tee "$schrootconfig"
-if [ -n "$configonly" ]; then exit 0; fi
+if [ -n "$configonly" ]; then
+ do_config
+ exit 0
+fi
rootdir=$(mktemp -d "$builddir/create-$suite-XXXXXX")
cleanup+=("rm -r $rootdir")
tartmp=$(tempfile --directory "$basedir" --suffix=".tar.gz")
cleanup+=("rm -f $tartmp")
(cd "$rootdir" && tar caf "$tartmp" . && mv "$tartmp" "$target")
+
+do_config
mode => 555,
source => 'puppet:///modules/porterbox/setup-dchroot',
}
+ file { '/usr/local/sbin/setup-all-dchroots':
+ mode => 555,
+ source => 'puppet:///modules/porterbox/setup-all-dchroots',
+ }
+ file { '/etc/cron.d/puppet-update-dchroots':
+ content => '0 3 * * 0 root PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin chronic setup-all-dchroots',
+ }
}