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

1 by Ubuntu Archive
add update-germinate, update-one-germinate, and update-seeds
1
#! /bin/sh
2
3
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
4
	echo "Usage: $0 NAME DIST COMPONENTS" >&2
5
	exit 1
6
fi
7
8
NAME="$1"
9
DIST="$2"
10
COMPONENTS="$3"
11
116 by Colin Watson
update-one-germinate: fetch seeds from the mirror on the local filesystem
12
SEED_SOURCE="file://$HOME/public_html/seeds/"
1 by Ubuntu Archive
add update-germinate, update-one-germinate, and update-seeds
13
14
rm -rf "$HOME/public_html/germinate-output/$NAME.new"
15
mkdir -p "$HOME/public_html/germinate-output/$NAME.new"
16
cd "$HOME/public_html/germinate-output/$NAME.new"
352 by Steve Langasek
python is python3
17
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
1 by Ubuntu Archive
add update-germinate, update-one-germinate, and update-seeds
18
cd ..
92 by Colin Watson
update-one-germinate: make old directory handling more robust
19
rm -rf "$NAME.old"
345 by Steve Langasek
Don't move the new germinate-output dir over, but diff and patch
20
if [ -e "$NAME" ]; then
371 by Steve Langasek
Handle the rdepends/ALL subtree with rsync instead of diff.
21
	# rdepends/ALL is a special case as it's a tree of symlinks and thus
22
	# immune to patching; sync it first before trying to diff.
23
	rsync -avz --delete "$NAME.new/rdepends/ALL/" "$NAME/rdepends/ALL"
374 by Steve Langasek
Fix update-one-germinate to hopefully not fail going forward.
24
	diff -uNr "$NAME" "$NAME.new" | filterdiff -x '**/rdepends/ALL/**' \
370 by Steve Langasek
Don't let patch create .orig, .rej files
25
	| (cd "$NAME" && patch -p1 -r - --no-backup-if-mismatch)
345 by Steve Langasek
Don't move the new germinate-output dir over, but diff and patch
26
	rm -rf "$NAME.new"
27
else
28
	mv "$NAME.new" "$NAME"
29
fi