summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2015-03-24 05:11:42 +0100
committerMihai Moldovan <ionic@ionic.de>2015-03-24 05:11:42 +0100
commit67e67118efe85bd7cb977a81615a0bf3bf9074e2 (patch)
treed7b685c1271ed4d4683bae9e7c9f24a4ee45b16b
parent3f90efdcc56b1d758c1636c29ec5846b5158f992 (diff)
downloadbuildscripts-67e67118efe85bd7cb977a81615a0bf3bf9074e2.tar.gz
buildscripts-67e67118efe85bd7cb977a81615a0bf3bf9074e2.tar.bz2
buildscripts-67e67118efe85bd7cb977a81615a0bf3bf9074e2.zip
bin/build-rpm-package: work around buggy mock versions.
-rwxr-xr-xbin/build-rpm-package16
1 files changed, 13 insertions, 3 deletions
diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index 979605e..afc8f4e 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -187,10 +187,20 @@ get_extra_repository () {
;;
"redhat")
# Always use -r.
- ret="-r"
+ ret="-r "
if [ -n "${RPM_MOCK_CONFIG_DIR}" ]; then
# FIXME: these files should probably be autogenerated to lessen maintenance load.
+ # Itsy-bitsy problem here: mock versions prior to 1.2.0 are buggy in the sense that
+ # they *always* prepend /etc/mock/ and append .cfg to any chroot file specified
+ # via -r, even if the argument is an absolute path.
+ # We have to work around that by specifying ../..//PATH/TO/MOCK-CONFIG and leaving
+ # out the ".cfg" part.
+ # Find out if we're using a buggy version.
+ check_mock_version_atleast "1" "2" "0" && MOCK_BUGGY="0" || MOCK_BUGGY="1"
+
+ [ "${MOCK_BUGGY}" -eq "1" ] && ret="${ret}../../"
+
# Add config base dir if specified.
ret="${ret} ${RPM_MOCK_CONFIG_DIR}/"
@@ -211,11 +221,11 @@ get_extra_repository () {
fi
# Add .cfg extension.
- ret="${ret}.cfg"
+ [ "${MOCK_BUGGY}" -eq "0" ] && ret="${ret}.cfg"
else
# As the default directory /etc/mock is non-writable, assume we don't have
# special mock configs.
- ret="${ret} ${DIST}-${CODENAME}-${ARCH}"
+ ret="${ret}${DIST}-${CODENAME}-${ARCH}"
fi
;;
*)