From 8d8a9fae5133b5fa1c5bc4156e1d6be238f2989f Mon Sep 17 00:00:00 2001
From: Reiner Hauser <reiner.hauser@cern.ch>
Date: Thu, 4 Apr 2024 16:58:11 +0200
Subject: [PATCH 1/2] Copy noarch and src RPMs only for default config

---
 .gitlab-ci.yml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 100bfda0..73704f04 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -156,6 +156,10 @@ variables:
     # Show test output if it failed
     CTEST_OUTPUT_ON_FAILURE: "ON"
 
+    # This version is considered the production configuration
+    # For patches we take the noarch and src RPMs from this build.
+    DEFAULT_CMTCONFIG: "x86_64-el9-gcc13-opt"
+    
 #
 # The common build template, extended once per CMTCONFIG
 # below.
@@ -436,7 +440,8 @@ continuous/x86_64-el9-gcc13-dbg:
         - rm -f ${CMTCONFIG}/${CI_COMMIT_REF_NAME}-${CMTCONFIG}.rpm
         - rm -f ${CMTCONFIG}/${CI_COMMIT_REF_NAME}-noarch.rpm
         - rm -f ${CMTCONFIG}/${CI_COMMIT_REF_NAME}-src.rpm
-        - rm -f ${CMTCONFIG}/${CI_COMMIT_REF_NAME}-LCGdeps_${CMTCONFIG}.rpm
+        - rm -f ${CMTCONFIG}/${CI_COMMIT_REF_NAME}-WithoutLCG_${CMTCONFIG}.rpm
+        - test "${CMTCONFIG}" != "${DEFAULT_CMTCONFIG}" && rm -f ${CMTCONFIG}/*_noarch-*.rpm ${CMTCONFIG}/*_src-*.rpm || /bin/true
         - echo ${OPTIONS} | grep -q -- '--rpm' || exit 0
         - mkdir deploy
         - find ${CMTCONFIG} -name *.rpm -exec mv '{}' deploy/ ';'
-- 
GitLab


From bb15f9d9e8dd43a86559edb3ca57d3b4594b5ad3 Mon Sep 17 00:00:00 2001
From: Reiner Hauser <Reiner.Hauser@cern.ch>
Date: Thu, 4 Apr 2024 17:39:24 +0200
Subject: [PATCH 2/2] Only copy files in top level build dir

There is usually another copy of each RPM in _CPackages/ which
was also found by the existing find command.
---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 73704f04..b540b324 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -444,7 +444,7 @@ continuous/x86_64-el9-gcc13-dbg:
         - test "${CMTCONFIG}" != "${DEFAULT_CMTCONFIG}" && rm -f ${CMTCONFIG}/*_noarch-*.rpm ${CMTCONFIG}/*_src-*.rpm || /bin/true
         - echo ${OPTIONS} | grep -q -- '--rpm' || exit 0
         - mkdir deploy
-        - find ${CMTCONFIG} -name *.rpm -exec mv '{}' deploy/ ';'
+        - find ${CMTCONFIG} -maxdepth 1 -name *.rpm -exec mv '{}' deploy/ ';'
         - cd deploy
         - env -u LD_LIBRARY_PATH deploy-eos
     tags:
-- 
GitLab