Skip to content

Commit b95268c

Browse files
jhadvigMichal Fojtik
authored and
Michal Fojtik
committed
Add architecture type to the os::build::rpm::format_nvr function
1 parent 18962de commit b95268c

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

hack/build-rpm-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ else
1717
fi
1818

1919
os::log::info 'Building Origin release RPMs with tito...'
20-
os::build::rpm::get_nvr_vars
20+
os::build::rpm::get_nvra_vars
2121
tito tag --use-version="${OS_RPM_VERSION}" \
2222
--use-release="${OS_RPM_RELEASE}" \
2323
--no-auto-changelog --offline

hack/lib/build/rpm.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
# - OS_RPM_NAME
1414
# - OS_RPM_VERSION
1515
# - OS_RPM_RELEASE
16-
function os::build::rpm::get_nvr_vars() {
16+
# - OS_RPM_ARCHITECTURE
17+
function os::build::rpm::get_nvra_vars() {
1718
# the package name can be overwritten but is normally 'origin'
1819
OS_RPM_NAME="${OS_RPM_NAME:-"origin"}"
20+
OS_RPM_ARCHITECTURE="$(uname -i)"
1921

2022
# we can extract the pacakge version from the build version
2123
os::build::get_version_vars
@@ -58,25 +60,26 @@ function os::build::rpm::get_nvr_vars() {
5860
os::log::fatal "Malformed git version metadata: ${metadata}"
5961
fi
6062

61-
export OS_RPM_NAME OS_RPM_VERSION OS_RPM_RELEASE
63+
export OS_RPM_NAME OS_RPM_VERSION OS_RPM_RELEASE OS_RPM_ARCHITECTURE
6264
}
6365

6466

65-
# os::build::rpm::format_nvr formats the rpm NVR vars generated by
66-
# os::build::rpm::get_nvr_vars and will generate them if necessary
67+
# os::build::rpm::format_nvra formats the rpm NVRA vars generated by
68+
# os::build::rpm::get_nvra_vars and will generate them if necessary
6769
#
6870
# Globals:
6971
# - OS_RPM_NAME
7072
# - OS_RPM_VERSION
7173
# - OS_RPM_RELEASE
74+
# - OS_RPM_ARCHITECTURE
7275
# Arguments:
7376
# None
7477
# Returns:
7578
# None
76-
function os::build::rpm::format_nvr() {
79+
function os::build::rpm::format_nvra() {
7780
if [[ -z "${OS_RPM_NAME:-}" || -z "${OS_RPM_VERSION:-}" || -z "${OS_RPM_RELEASE:-}" ]]; then
78-
os::build::rpm::get_nvr_vars
81+
os::build::rpm::get_nvra_vars
7982
fi
8083

81-
echo "${OS_RPM_NAME}-${OS_RPM_VERSION}-${OS_RPM_RELEASE}"
82-
}
84+
echo "${OS_RPM_NAME}-${OS_RPM_VERSION}-${OS_RPM_RELEASE}.${OS_RPM_ARCHITECTURE}"
85+
}

0 commit comments

Comments
 (0)