diff options
-rwxr-xr-x | bin/build-rpm-package | 16 |
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 ;; *) |