ppa-britney/run-ppa-britney

39 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/bash
for RELEASE in $RELEASES; do
export BRITNEY_TIMESTAMP=$(date +"%Y-%m-%d_%H:%M:%S")
2019-03-09 20:43:31 -06:00
echo "Release: $RELEASE";
echo "Timestamp: $BRITNEY_TIMESTAMP"
2019-03-09 20:43:31 -06:00
if [ $ARCHIVE_TYPE = "ppa" ]; then
export SOURCE_PPA_URL="http://ppa.launchpad.net/$LP_TEAM/$SOURCE_PPA/ubuntu/dists/$RELEASE/main";
export DEST_PPA_URL="http://ppa.launchpad.net/$LP_TEAM/$DEST_PPA/ubuntu/dists/$RELEASE/main";
fi
# This is the main script, fetching the archives and running Britney
2019-03-09 20:54:50 -06:00
./fetch-indexes $RELEASE;
2019-03-30 17:16:27 -05:00
# Britney outputs the candidates for testing migration, read the delta
# Removals from the release pocket start with "-" while additions have no
# prefix; this has to be accounted for in the archive commands seen below
egrep -v '^#' britney_output/$BRITNEY_TIMESTAMP/HeidiOutputDelta > candidates || echo "No candidates found.";
while read -r -a package; do
2019-03-30 17:42:38 -05:00
# This only acts on sources; binaries require manual cleanup
2019-03-30 17:43:39 -05:00
if [ ${#package[@]} = 2 ]; then
2019-03-30 17:42:38 -05:00
if [ $ARCHIVE_TYPE = "ppa" ]; then
COPY="./ubuntu-archive-tools/copy-package"
REMOVE="./ubuntu-archive-tools/remove-package"
if echo ${package[0]} | egrep -q "^-"; then
$COPY -y -b -s $RELEASE --from "ppa:$LP_TEAM/ubuntu/$DEST_PPA" --to "ppa:$LP_TEAM/ubuntu/$SOURCE_PPA" --version "${package[1]}" "`echo ${package[0]} | sed 's/-//'`";
$REMOVE -y -s $RELEASE --archive "ppa:$LP_TEAM/ubuntu/$DEST_PPA" --version "${package[1]}" --removal-comment="demoted to proposed" "`echo ${package[0]} | sed 's/-//'`";
else
$COPY -y -b -s $RELEASE --from "ppa:$LP_TEAM/ubuntu/$SOURCE_PPA" --to "ppa:$LP_TEAM/ubuntu/$DEST_PPA" --version "${package[1]}" "${package[0]}";
$REMOVE -y -s $RELEASE --archive "ppa:$LP_TEAM/ubuntu/$SOURCE_PPA" --version "${package[1]}" --removal-comment="moved to release" "${package[0]}";
fi
2019-03-30 17:16:27 -05:00
fi
fi
done < candidates;
done