aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys/rpmutil.py
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-01-29 18:14:56 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-01-29 18:14:56 +0000
commita493be252f25b57767023930d4ed927b37816e71 (patch)
treee25eb71eba2146cac6dd8dc4bbb4b7c043d65076 /RepSys/rpmutil.py
parentd4d9914ec004a9ad1b767bc177d45af6694080be (diff)
downloadmgarepo-a493be252f25b57767023930d4ed927b37816e71.tar
mgarepo-a493be252f25b57767023930d4ed927b37816e71.tar.gz
mgarepo-a493be252f25b57767023930d4ed927b37816e71.tar.bz2
mgarepo-a493be252f25b57767023930d4ed927b37816e71.tar.xz
mgarepo-a493be252f25b57767023930d4ed927b37816e71.zip
Removed bogus macros files and added [macros ..] sections to repsys.conf.
These sections are referenced by the "rpm-macros" option in [submit ..] sections and contain the RPM macros to be used with the target of the package being generated. These macros are defined using --define option of rpm.
Diffstat (limited to 'RepSys/rpmutil.py')
-rw-r--r--RepSys/rpmutil.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/RepSys/rpmutil.py b/RepSys/rpmutil.py
index 968470c..367fd45 100644
--- a/RepSys/rpmutil.py
+++ b/RepSys/rpmutil.py
@@ -25,6 +25,11 @@ def get_spec(pkgdirurl, targetdir=".", submit=False):
if os.path.isdir(tmpdir):
shutil.rmtree(tmpdir)
+def rpm_macros_defs(macros):
+ defs = ("--define \"%s %s\"" % macro for macro in macros)
+ args = " ".join(defs)
+ return args
+
def get_srpm(pkgdirurl,
mode = "current",
targetdirs = None,
@@ -37,6 +42,7 @@ def get_srpm(pkgdirurl,
scripts = [],
submit = False,
template = None,
+ macros = [],
verbose = 0):
svn = SVN(baseurl=pkgdirurl)
tmpdir = tempfile.mktemp()
@@ -68,7 +74,7 @@ def get_srpm(pkgdirurl,
if svnlog:
submit = not not revision
specfile_svn2rpm(pkgdirurl, spec, revision, submit=submit,
- template=template)
+ template=template, macros=macros)
revisionreal = svn.revision(pkgdirurl)
for script in scripts:
status, output = execcmd(script, tmpdir, spec, str(revision),
@@ -78,9 +84,10 @@ def get_srpm(pkgdirurl,
if packager:
packager = " --define 'packager %s'" % packager
- execcmd("rpm -bs --nodeps %s %s %s %s %s %s %s %s %s" %
+ defs = rpm_macros_defs(macros)
+ execcmd("rpm -bs --nodeps %s %s %s %s %s %s %s %s %s %s" %
(topdir, builddir, rpmdir, sourcedir, specdir,
- srcrpmdir, patchdir, packager, spec))
+ srcrpmdir, patchdir, packager, spec, defs))
if revision and revisionreal:
srpm = glob.glob(os.path.join(srpmsdir, "*.src.rpm"))[0]