From 4c5aa8fb4a043c1196cd2396f05a55ea47d32df5 Mon Sep 17 00:00:00 2001 From: Eric Richter Date: Thu, 7 Sep 2023 10:36:00 -0500 Subject: [PATCH] rename suse rpms so that have an identifiable name Signed-off-by: Eric Richter --- ci/build-rpm.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/ci/build-rpm.sh b/ci/build-rpm.sh index 310b53e9..ac73ade0 100755 --- a/ci/build-rpm.sh +++ b/ci/build-rpm.sh @@ -24,8 +24,30 @@ fi mkdir -p rpms cp ${RPMBUILD_ROOT}/RPMS/*/*.rpm rpms/ if [[ "x86_64" == $(uname -m) ]]; then - # Only the x86_64 build generates the srpm + # Only the x86_64 build generates the srpm, same for all arches cp ${RPMBUILD_ROOT}/SRPMS/*.rpm rpms/ fi -# Note: srpm s the same for all arches, so really only the first to complete needs to be done \ No newline at end of file +# SUSE rpms don't appear to insert a distro tag, so invent one +source /etc/os-release + +function rename_rpm { + cd rpms/ + for rpm in *.rpm; do + # This feels kind of fragile, if this ever breaks it should be updated + NEW="$(echo $rpm | cut -d . -f -2).$1.$(echo $rpm | cut -d . -f 3-)" + mv $rpm $NEW + done + cd - +} + +case $ID in + opensuse-tumbleweed) + rename_rpm stw + ;; + + opensuse-leap) + rename_rpm "s$(echo $VERSION | cut -d . -f 1)" + ;; + +esac \ No newline at end of file