]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
build pbuilders without calling other scripts
authorAlfredo Deza <adeza@redhat.com>
Wed, 3 Jun 2015 15:38:11 +0000 (11:38 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 3 Jun 2015 15:38:11 +0000 (11:38 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-build/build/setup_debian [new file with mode: 0755]

diff --git a/ceph-build/build/setup_debian b/ceph-build/build/setup_debian
new file mode 100755 (executable)
index 0000000..02975aa
--- /dev/null
@@ -0,0 +1,58 @@
+#!/bin/sh -x
+# This file will set the tgz images needed for pbuilder on a given host. It has
+# some hard-coded values like `/srv/debian-base` because it gets built every
+# time this file is executed - completely ephemeral.  If a Debian host will use
+# pbuilder, then it will need this. Since it is not idempotent it makes
+# everything a bit slower. ## FIXME ##
+
+set -e
+
+basedir="/srv/debian-base"
+
+# This used to live in a *file* on /src/ceph-build. Now it lives here because
+# it doesn't make sense to have a file that lives in /srv/ that we then
+# concatenate to get its contents.  what.
+dists="sid wheezy squeeze raring quantal precise saucy trusty"
+
+
+for dist in $dists
+do
+    os="debian"
+    [ "$dist" = "raring" ] && os="ubuntu"
+    [ "$dist" = "saucy" ] && os="ubuntu"
+    [ "$dist" = "trusty" ] && os="ubuntu"
+    [ "$dist" = "precise" ] && os="ubuntu"
+    [ "$dist" = "quantal" ] && os="ubuntu"
+    [ "$dist" = "oneiric" ] && os="ubuntu"
+    [ "$dist" = "natty" ] && os="ubuntu"
+    [ "$dist" = "maverick" ] && os="ubuntu"
+    [ "$dist" = "lucid" ] && os="ubuntu"
+
+    if [ $os = "debian" ]; then
+        mirror="http://apt-mirror.sepia.ceph.com/ftp.us.debian.org/debian"
+        othermirror=""
+    else
+        mirror=""
+        othermirror="deb http://apt-mirror.sepia.ceph.com/archive.ubuntu.com/ubuntu $dist main restricted universe multiverse"
+    fi
+
+    pbuilder --clean
+
+    if [ -e $basedir/$dist.tgz ]; then
+        echo updating $dist base.tgz
+#        savelog -l -n  $basedir/$dist.tgz
+#        cp $basedir/$dist.tgz.0 $basedir/$dist.tgz
+        pbuilder update \
+           --basetgz $basedir/$dist.tgz \
+           --distribution $dist \
+           --mirror "$mirror" \
+           --othermirror "$othermirror"
+    else
+        echo building $dist base.tgz
+        pbuilder create \
+           --basetgz $basedir/$dist.tgz \
+           --distribution $dist \
+           --mirror "$mirror" \
+           --othermirror "$othermirror"
+    fi
+done