From 3f746582eb24fccc145061019a179a683fef3bb9 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Tue, 28 Nov 2017 13:49:06 +0100 Subject: [PATCH] honor custom RPM %_sourcedir If the user redefines %_sourcedir in ~/.rpmmacros, `mbs-build local` will fail trying to build module-build-macros otherwise because rpmbuild will look for sources -- macros.modules -- in the wrong place. --- module_build_service/builder/KojiModuleBuilder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module_build_service/builder/KojiModuleBuilder.py b/module_build_service/builder/KojiModuleBuilder.py index 17ac614b..7fbcd3d1 100644 --- a/module_build_service/builder/KojiModuleBuilder.py +++ b/module_build_service/builder/KojiModuleBuilder.py @@ -241,8 +241,10 @@ chmod 644 %buildroot/%_sysconfdir/rpm/macros.zz-modules # We are not interested in the rpmbuild stdout... null_fd = open(os.devnull, 'w') - execute_cmd(['rpmbuild', '-bs', '%s.spec' % name, '--define', - '_topdir %s' % td], cwd=td, stdout=null_fd) + execute_cmd(['rpmbuild', '-bs', '%s.spec' % name, + '--define', '_topdir %s' % td, + '--define', '_sourcedir %s' % sources_dir], + cwd=td, stdout=null_fd) null_fd.close() sdir = os.path.join(td, "SRPMS") srpm_paths = glob.glob("%s/*.src.rpm" % sdir)