From c56f1ebaf9fadcdc83cc11cbdb75172bbffc9c3b Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 3 Jun 2015 11:38:11 -0400 Subject: [PATCH] build pbuilders without calling other scripts Signed-off-by: Alfredo Deza --- ceph-build/build/setup_debian | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 ceph-build/build/setup_debian diff --git a/ceph-build/build/setup_debian b/ceph-build/build/setup_debian new file mode 100755 index 00000000..02975aa5 --- /dev/null +++ b/ceph-build/build/setup_debian @@ -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 -- 2.39.5