From ccbe6d256f993c306afb33830eadea3ec7fc1105 Mon Sep 17 00:00:00 2001 From: Murilo Belluzzo Date: Wed, 3 Oct 2018 13:09:56 -0700 Subject: [PATCH] [content] Handle the creation of the package list This is to allow the use of multiple content providers. This silly first version just concatenates all package lists found in a single file that will be published, but already stablishes a way for content providers to add this information. Each content provider should create a file on ${WORK_DIR}/${PKG_LIST_TMP} with the plain list of packages nvr's to be consumed by this process. In the future, we will need to address duplicates, sorting and version mismatch to reflect the final state found on the content repo used by mixer and published with the release. Signed-off-by: Murilo Belluzzo --- globals.sh | 1 + release/content.sh | 5 +++++ release/koji.sh | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/globals.sh b/globals.sh index 1d25ac0..9e4b050 100755 --- a/globals.sh +++ b/globals.sh @@ -14,4 +14,5 @@ MIX_INCREMENT=${MIX_INCREMENT:-10} BUILD_FILE=build-env PKG_LIST_FILE=packages-nvr +PKG_LIST_TMP=packages_ RELEASE_NOTES=release-notes diff --git a/release/content.sh b/release/content.sh index ab0b5f6..b8401b8 100755 --- a/release/content.sh +++ b/release/content.sh @@ -21,6 +21,11 @@ if [[ -z "$(ls -A ${PKGS_DIR})" ]]; then exit 0 fi +log_line "Building package list:" +# If no content providers fetched packages, this will act as 'touch' +cat ${WORK_DIR}/${PKG_LIST_TMP}* > ${WORK_DIR}/${PKG_LIST_FILE} 2>/dev/null || true +log_line "OK!" 1 + section "Creating Content Repository" pushd ${PKGS_DIR} > /dev/null log_line diff --git a/release/koji.sh b/release/koji.sh index 665cb42..7b3779d 100755 --- a/release/koji.sh +++ b/release/koji.sh @@ -16,9 +16,11 @@ SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) # ============================================================================== stage "Content Provider - Koji" +pkg_list="${WORK_DIR}/${PKG_LIST_TMP}koji" + log_line "Fetching Package List:" if result=$(koji_cmd list-tagged --latest --quiet ${KOJI_TAG}); then - awk '{print $1}' <<< ${result} > ${WORK_DIR}/${PKG_LIST_FILE} + awk '{print $1}' <<< ${result} > ${pkg_list} else log_line "No custom content was found." 1 exit 0 @@ -27,7 +29,7 @@ log_line "OK!" 1 section "Downloading RPMs" pushd ${PKGS_DIR} > /dev/null -for rpm in $(cat ${WORK_DIR}/${PKG_LIST_FILE}); do +for rpm in $(cat ${pkg_list}); do log_line "${rpm}:" koji_cmd download-build -a x86_64 --quiet ${rpm} log_line "OK!" 1