From aafcf707fd6abf5a1948dba6c1d0e077819418ae Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Tue, 24 Nov 2009 09:49:53 +0000 Subject: [PATCH] hack to make dependency expansion of --with and --without work for local builds --- osc/build.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/osc/build.py b/osc/build.py index 766ee0a8..86253c08 100644 --- a/osc/build.py +++ b/osc/build.py @@ -370,6 +370,21 @@ def main(opts, argv): prefer_pkgs = {} build_descr_data = open(build_descr).read() + + # XXX: dirty hack but there's no api to provide custom defines + if opts.without: + s = '' + for i in opts.without: + s += "%%define _without_%s 1\n" % i + s += "%%define _with_%s 0\n" % i + build_descr_data = s + build_descr_data + if opts._with: + s = '' + for i in opts._with: + s += "%%define _without_%s 0\n" % i + s += "%%define _with_%s 1\n" % i + build_descr_data = s + build_descr_data + if opts.prefer_pkgs: print 'Scanning the following dirs for local packages: %s' % ', '.join(opts.prefer_pkgs) prefer_pkgs, cpio = get_prefer_pkgs(opts.prefer_pkgs, arch, build_type)