ceph/update_pbuilder.sh
Sage Weil 83d3fb2c91 debian: make update_pbuilder.sh a bit smarter
Signed-off-by: Sage Weil <sage@newdream.net>
2011-01-11 09:22:52 -08:00

33 lines
909 B
Bash
Executable File

#!/bin/sh -x
basedir=~/debian-base
dists=$1
[ -z "$dists" ] && dists="sid squeeze lenny maverick lucid"
for dist in $dists
do
os="debian"
[ "$dist" == "maverick" ] && os="ubuntu"
[ "$dist" == "lucid" ] && os="ubuntu"
if [ $os = "debian" ]; then
mirror="http://http.us.debian.org/debian"
othermirror=""
else
mirror=""
othermirror="deb http://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