Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Rebuild the fedmsg-related packages for wheezy
#!/bin/sh
set -e
mount | awk '/result/{ print $3 }' | while read dir; do
if [ -f "$dir/Release" -a -f "$dir/Packages" ]; then
echo "deb file://$dir ./" >> /etc/apt/sources.list
fi
done
apt-get update
#!/bin/bash
# Build all the fedmsg related packages
set -e
BASEDIR=$(dirname $(readlink -f "$0"))
RESULT="$BASEDIR/result-wheezy"
if [ ! -d "$RESULT" ]; then
mkdir -p "$RESULT"
fi
if [ ! -f "$RESULT/Release" ]; then
cat > "$RESULT/Release" <<-EOF
Archive: stable
Component: main
Origin: Nicolas Dandrimont
Label: FedMsg packages
Architecture: amd64
EOF
fi
echo "Building all the fedmsg packages in $RESULT"
#kitchen bunch m2ext grapefruit txws txzmq stomper
#fabulous moksha.common moksha.hub
#fedmsg
PACKAGES=(kitchen bunch m2ext grapefruit txws txzmq stomper fabulous moksha.common moksha.hub fedmsg)
for package in "${PACKAGES[@]}"; do
PACKAGEDIR="$BASEDIR/$package"
echo "Fetching $package in $PACKAGEDIR/$package"
mkdir -p "$PACKAGEDIR/tarballs"
if [ -d "$PACKAGEDIR/$package" ]; then
echo "Updating $package"
cd "$PACKAGEDIR/$package"
svn revert --recursive .
svn up
else
echo "Fetching $package"
svn co "svn+ssh://svn.debian.org/svn/python-modules/packages/$package/trunk" "$PACKAGEDIR/$package"
cd "$PACKAGEDIR/$package"
fi
echo "Fetching the tarball for $package"
if [ ! "$package" = "fedmsg" ]; then
uscan --force-download --download-current-version --rename --destdir ../tarballs
fi
echo "Adding a backport changelog entry"
dch --bpo ""
echo "Invoking svn-buildpackage"
svn-buildpackage --svn-builder="env DIST=wheezy pdebuild --pbuilder cowbuilder --buildresult $RESULT -- --allow-untrusted --bindmounts $RESULT" --svn-ignore --svn-dont-clean
cd "$RESULT"
dpkg-scanpackages . > Packages
dpkg-scansources . > Sources
for file in Packages Sources; do
gzip -9c "$file" > "${file}.gz"
done
cd "$BASEDIR"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment