~ubuntu-archive/ubuntu-archive-scripts/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /bin/sh

if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
	echo "Usage: $0 NAME DIST COMPONENTS" >&2
	exit 1
fi

NAME="$1"
DIST="$2"
COMPONENTS="$3"

SEED_SOURCE="file://$HOME/public_html/seeds/"

rm -rf "$HOME/public_html/germinate-output/$NAME.new"
mkdir -p "$HOME/public_html/germinate-output/$NAME.new"
cd "$HOME/public_html/germinate-output/$NAME.new"
python3 "$HOME/germinate/bin/germinate" $GERMINATE_OPTIONS ${SEED_SOURCE:+-S "$SEED_SOURCE"} -m file:///home/ubuntu-archive/mirror/ubuntu -s "$NAME" -d "$DIST" ${COMPONENTS:+-c "$COMPONENTS"} > _germinate_output
cd ..
rm -rf "$NAME.old"
if [ -e "$NAME" ]; then
	# rdepends/ALL is a special case as it's a tree of symlinks and thus
	# immune to patching; sync it first before trying to diff.
	rsync -avz --delete "$NAME.new/rdepends/ALL/" "$NAME/rdepends/ALL"
	diff -uNr "$NAME" "$NAME.new" | filterdiff -x '**/rdepends/ALL/**' \
	| (cd "$NAME" && patch -p1 -r - --no-backup-if-mismatch)
	rm -rf "$NAME.new"
else
	mv "$NAME.new" "$NAME"
fi