From c6bdb70f242fa39d5f692d15720d44b11518aec9 Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Wed, 2 Oct 2019 13:38:15 -0700 Subject: [PATCH] Add definiton of $CREATEREPO The CREATEREPO variable was not getting set causing the script to fail, additionally, use the variable consistently instead of calling createrepo directly. Closes-Bug: 1846387 Change-Id: If42d5ca14aa9d7ace1d0d6d9daf846a9e51ab559 Signed-off-by: Saul Wold --- toCOPY/generate-cgcs-tis-repo | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/toCOPY/generate-cgcs-tis-repo b/toCOPY/generate-cgcs-tis-repo index 6505d11f..39520ea3 100755 --- a/toCOPY/generate-cgcs-tis-repo +++ b/toCOPY/generate-cgcs-tis-repo @@ -34,6 +34,11 @@ TIS_CACHE_DIR="${TIS_REPO_DIR}/dependancy-cache" TIS_CACHE_ORIGIN="${TIS_REPO_DIR}/origin" ORIGIN="/import/mirrors/CentOS/${SRC_BUILD_ENVIRONMENT}/CentOS/pike" +CREATEREPO=$(which createrepo_c) +if [ $? -ne 0 ]; then + CREATEREPO="createrepo" +fi + # Create directories for d in "$DEST_RPM" "$DEST_SRPM" "$TIS_CACHE_DIR"; do if [ ! -d "$d" ]; then @@ -63,7 +68,7 @@ for f in $(find "$RT_PKG_DIR" "$STD_PKG_DIR" -name '*.rpm' \ done # Make a repo out of it -( cd "$DEST_RPM_ROOT_NEW"; createrepo $PWD; exit $? ) +( cd "$DEST_RPM_ROOT_NEW"; $CREATEREPO $PWD; exit $? ) # copy standard and rt build of src.rpm packages for f in $(find "$STD_PKG_DIR" "$RT_PKG_DIR" -name '*.src.rpm'); do @@ -74,7 +79,7 @@ for f in $(find "$STD_PKG_DIR" "$RT_PKG_DIR" -name '*.src.rpm'); do done # Make a repo out of it -( cd "$DEST_SRPM_ROOT_NEW"; createrepo $PWD; exit $? ) +( cd "$DEST_SRPM_ROOT_NEW"; $CREATEREPO $PWD; exit $? ) date > "${DEST_SRPM_ROOT_NEW}/last_updated" date > "${DEST_RPM_ROOT_NEW}/last_updated" @@ -138,9 +143,9 @@ for d in $(find -L . -type d -name repodata); do rm -rf repodata fi if [ -f "comps.xml" ]; then - createrepo -g comps.xml "$PWD" + $CREATEREPO -g comps.xml "$PWD" else - createrepo "$PWD" + $CREATEREPO "$PWD" fi popd done