diff options
author | Richard Kreuter <richard@10gen.com> | 2012-04-25 17:16:06 -0400 |
---|---|---|
committer | Richard Kreuter <richard@10gen.com> | 2012-04-25 17:28:01 -0400 |
commit | 3a0087aef01559874dc03a346b96e3d5592287e5 (patch) | |
tree | 56f3fe57de6a23a96cc74cbde0d0987503a5a2ad /buildscripts | |
parent | d8462a26b9089c5e58d1e340dcada83719ea4e47 (diff) | |
download | mongo-3a0087aef01559874dc03a346b96e3d5592287e5.tar.gz |
Complicate packager.py for when somebody leaves binaries out of tarballs.
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/packager.py | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/buildscripts/packager.py b/buildscripts/packager.py index ab0d15c1245..696002a347c 100644 --- a/buildscripts/packager.py +++ b/buildscripts/packager.py @@ -902,8 +902,10 @@ fi %{_bindir}/mongo %{_bindir}/mongodump %{_bindir}/mongoexport -%{_bindir}/mongofiles +#@@VERSION!=2.1.0@@%{_bindir}/mongofiles %{_bindir}/mongoimport +#@@VERSION>=2.1.0@@%{_bindir}/mongooplog +#@@VERSION>=2.1.0@@%{_bindir}/mongoperf %{_bindir}/mongorestore #@@VERSION>1.9@@%{_bindir}/mongotop %{_bindir}/mongostat @@ -966,9 +968,25 @@ fi lines=[] for line in s.split("\n"): - m = re.search("@@VERSION>(.*)@@(.*)", line) - if m and spec.version_better_than(m.group(1)): - lines.append(m.group(2)) + m = re.search("@@VERSION(>|>=|!=)(\d.*)@@(.*)", line) + if m: + op = m.group(1) + ver = m.group(2) + fn = m.group(3) + if op == '>': + if spec.version_better_than(ver): + lines.append(fn) + elif op == '>=': + if spec.version() == ver or spec.version_better_than(ver): + lines.append(fn) + elif op == '!=': + if spec.version() != ver: + lines.append(fn) + else: + # Since we're inventing our own template system for RPM + # specfiles here, we oughtn't use template syntax we don't + # support. + raise Exception("BUG: probable bug in packager script: %s, %s, %s" % (m.group(1), m.group(2), m.group(3))) else: lines.append(line) s="\n".join(lines) |