Implement removal support.

master
Simon Quigley 6 years ago
parent 4fb6d26bc6
commit 8e1671d90d

@ -11,14 +11,22 @@ for RELEASE in $RELEASES; do
# This is the main script, fetching the archives and running Britney # This is the main script, fetching the archives and running Britney
./fetch-indexes $RELEASE; ./fetch-indexes $RELEASE;
# Britney outputs the candidates for testing migration, read the additions # Britney outputs the candidates for testing migration, read the delta
egrep -v '^(#|-)' britney_output/$BRITNEY_TIMESTAMP/HeidiOutputDelta > candidates || echo "No candidates found."; # 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 while read -r -a package; do
# This can eventually be extendable to different archive types
if [ $ARCHIVE_TYPE = "ppa" ]; then if [ $ARCHIVE_TYPE = "ppa" ]; then
./ubuntu-archive-tools/copy-package -y -b -s $RELEASE --from "ppa:$LP_TEAM/ubuntu/$SOURCE_PPA" --to "ppa:$LP_TEAM/ubuntu/$DEST_PPA" --version "${package[1]}" "${package[0]}"; COPY="./ubuntu-archive-tools/copy-package"
./ubuntu-archive-tools/remove-package -y -s $RELEASE --archive "ppa:$LP_TEAM/ubuntu/$SOURCE_PPA" --version "${package[1]}" --removal-comment="moved to release" "${package[0]}"; 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]}" "${package[0]}";
$REMOVE -y -s $RELEASE --archive "ppa:$LP_TEAM/ubuntu/$DEST_PPA" --version "${package[1]}" --removal-comment="demoted to proposed" "${package[0]}";
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
fi fi
done < candidates; done < candidates;
rm -rf britney_output/; rm -rf britney_output/;

Loading…
Cancel
Save