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

« back to all changes in this revision

Viewing changes to update-one-germinate

  • Committer: Steve Langasek
  • Date: 2023-12-19 06:16:57 UTC
  • Revision ID: steve.langasek@canonical.com-20231219061657-3vtta1sc7bxqirn5
Handle the rdepends/ALL subtree with rsync instead of diff.

This is a symlink tree and thus immune to patching.  germinate-output has
been out of date for some time as a result of non-zero exit codes from diff,
this should fix that.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
SEED_SOURCE="file://$HOME/public_html/seeds/"
13
13
 
14
 
NEWDIR="$HOME/germinate-output.new/$NAME"
15
 
FINALDIR="$HOME/public_html/germinate-output/$NAME"
16
 
rm -rf "$NEWDIR"
17
 
mkdir -p "$NEWDIR"
18
 
cd "$NEWDIR"
19
 
python3 "$HOME/germinate/bin/germinate" $GERMINATE_OPTIONS ${SEED_SOURCE:+-S "$SEED_SOURCE"} -m file:///home/ubuntu-archive/mirror/ubuntu -s "$NAME" -d "$DIST,$DIST-updates" ${COMPONENTS:+-c "$COMPONENTS"} > _germinate_output
 
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"
 
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
20
18
cd ..
21
 
if [ -e "$FINALDIR" ]; then
 
19
rm -rf "$NAME.old"
 
20
if [ -e "$NAME" ]; then
22
21
        # rdepends/ALL is a special case as it's a tree of symlinks and thus
23
22
        # immune to patching; sync it first before trying to diff.
24
 
        rsync -avz --delete "$NEWDIR/rdepends/ALL/" "$FINALDIR/rdepends/ALL"
25
 
        diff -uNr "$FINALDIR" "$NEWDIR" | filterdiff -x '**/rdepends/ALL/**' \
26
 
        | (cd "$FINALDIR" && patch -p5 -r - --no-backup-if-mismatch)
27
 
        rm -rf "$NEWDIR"
 
23
        rsync -avz --delete "$NAME.new/rdepends/ALL/" "$NAME/rdepends/ALL"
 
24
        diff -uNr "$NAME" "$NAME.new" \
 
25
        | (cd "$NAME" && patch -p1 -r - --no-backup-if-mismatch)
 
26
        rm -rf "$NAME.new"
28
27
else
29
 
        mv "$NEWDIR" "$FINALDIR"
 
28
        mv "$NAME.new" "$NAME"
30
29
fi