From 173467a1dceeff85f0499d035062f0c561b82a35 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Aug 28 2024 21:13:38 +0000 Subject: metadata archive: include labels in series file I went back to fedfind to try and rework it around the new archive stuff, and realized we're still missing a way to do cid_from_label - that is, if we know a compose's label and release, work out its compose ID. Here's a way to do that! For labelled composes, we write the label as well as the compose ID to the series file. So if you need to do cid_from_label you can just read the series file, find the line with the label you want on it, and read the first word in that line. If you just want the series of compose IDs, you just have to split each line and take only the first word. Signed-off-by: Adam Williamson --- diff --git a/cloud-nightly.sh b/cloud-nightly.sh index 7b41e1c..f638916 100755 --- a/cloud-nightly.sh +++ b/cloud-nightly.sh @@ -88,6 +88,6 @@ cp "${DESTDIR}"/compose/metadata/*.json "${MD_ARCHIVE_DIR}/${YEAR}/${NEWCOMPOSE_ # Add the compose ID to the 'series' file which records the # compose IDs for each SHORT name in order mkdir -p "${SERIES_DIR}" -echo "${NEWCOMPOSE_ID}" >> "${SERIES_DIR}/${SHORT}-${RELEASE}" +echo "${NEWCOMPOSE_ID} ${LABEL}" >> "${SERIES_DIR}/${SHORT}-${RELEASE}" find $TARGET_DIR -xdev -depth -maxdepth 2 -mtime +14 -exec rm -rf {} \; diff --git a/container-nightly.sh b/container-nightly.sh index ba161ad..7d08538 100755 --- a/container-nightly.sh +++ b/container-nightly.sh @@ -96,6 +96,6 @@ cp "${DESTDIR}"/compose/metadata/*.json "${MD_ARCHIVE_DIR}/${YEAR}/${NEWCOMPOSE_ # Add the compose ID to the 'series' file which records the # compose IDs for each SHORT name in order mkdir -p "${SERIES_DIR}" -echo "${NEWCOMPOSE_ID}" >> "${SERIES_DIR}/${SHORT}-${RELEASE}" +echo "${NEWCOMPOSE_ID} ${LABEL}" >> "${SERIES_DIR}/${SHORT}-${RELEASE}" find $TARGET_DIR -xdev -depth -maxdepth 2 -mtime +14 -exec rm -rf {} \; diff --git a/release-candidate.sh b/release-candidate.sh index 84b3ca9..2da0876 100755 --- a/release-candidate.sh +++ b/release-candidate.sh @@ -220,7 +220,7 @@ cp "${DESTDIR}"/compose/metadata/*.json "${MD_ARCHIVE_DIR}/${YEAR}/${COMPOSE_ID_ # Add the compose ID to the 'series' file which records the # compose IDs for each SHORT name in order mkdir -p "${SERIES_DIR}" -echo "${COMPOSE_ID_2}" >> "${SERIES_DIR}/${SHORT}-${RELEASE}" +echo "${COMPOSE_ID_2} ${LABEL}" >> "${SERIES_DIR}/${SHORT}-${RELEASE}" echo "========================================" echo "LET INTERESTED PERSONS KNOW THAT THE RSYNC IS COMPLETE."