summaryrefslogtreecommitdiff
path: root/cpp/makebindist.py
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-09-27 13:38:22 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-09-27 13:38:22 +0000
commited1ad58848d0b0b48baba7bc283ec553ad9623ba (patch)
treed32b06f32be55684786c0459752b1f0ddd4a8cea /cpp/makebindist.py
parentFix to look for transformdb in /usr/bin and ICE_HOME/bin (diff)
downloadice-ed1ad58848d0b0b48baba7bc283ec553ad9623ba.tar.bz2
ice-ed1ad58848d0b0b48baba7bc283ec553ad9623ba.tar.xz
ice-ed1ad58848d0b0b48baba7bc283ec553ad9623ba.zip
Added support for @mmver@
Diffstat (limited to 'cpp/makebindist.py')
-rwxr-xr-xcpp/makebindist.py34
1 files changed, 23 insertions, 11 deletions
diff --git a/cpp/makebindist.py b/cpp/makebindist.py
index 00b1dc8df02..97b080c964d 100755
--- a/cpp/makebindist.py
+++ b/cpp/makebindist.py
@@ -69,6 +69,11 @@ def getIceVersion(file):
config = open(file, 'r')
return re.search('ICE_STRING_VERSION \"([0-9\.]*)\"', config.read()).group(1)
+def getIceMMVersion(file):
+ """Extract the ICE major.minor version string from a file."""
+ config = open(file, 'r')
+ return re.search('ICE_STRING_VERSION \"([0-9]*\.[0-9]*)\.[0-9]*\"', config.read()).group(1)
+
def getIceSoVersion(file):
"""Extract the ICE version ordinal from a file."""
config = open(file, 'r')
@@ -143,19 +148,25 @@ def getVersion(cvsTag, buildDir):
os.environ['LIBPATH'] = ''
runprog('cvs -d cvs.zeroc.com:/home/cvsroot export -r ' + cvsTag + ' ice/include/IceUtil/Config.h')
- result = [ getIceVersion('ice/include/IceUtil/Config.h'), getIceSoVersion('ice/include/IceUtil/Config.h')]
+ result = [ getIceVersion('ice/include/IceUtil/Config.h'), \
+ getIceSoVersion('ice/include/IceUtil/Config.h'), \
+ getIceMMVersion('ice/include/IceUtil/Config.h') ]
+
os.remove('ice/include/IceUtil/Config.h')
os.removedirs('ice/include/IceUtil')
os.chdir(cwd)
return result
-def fixVersion(filename, version):
+def fixVersion(filename, version, mmVersion):
f = fileinput.input(filename, True)
for line in f:
- print line.rstrip('\n').replace('@ver@', version)
+ l = line.rstrip('\n')
+ l = l.replace('@ver@', version)
+ l = l.replace('@mmver@', mmVersion)
+ print l
f.close()
-def getInstallFiles(cvsTag, buildDir, version):
+def getInstallFiles(cvsTag, buildDir, version, mmVersion):
"""Gets the install sources for this revision"""
cwd = os.getcwd()
try:
@@ -168,12 +179,12 @@ def getInstallFiles(cvsTag, buildDir, version):
snapshot = os.walk('./ice/install/unix')
for dirInfo in snapshot:
for f in dirInfo[2]:
- fixVersion(os.path.join(dirInfo[0], f), version)
+ fixVersion(os.path.join(dirInfo[0], f), version, mmVersion)
finally:
os.chdir(cwd)
return buildDir + '/ice/install'
-def getInstallFilesFromLocalDirectory(cvsTag, buildDir, version):
+def getInstallFilesFromLocalDirectory(cvsTag, buildDir, version, mmVersion):
'''Gets the install files from an existing CVS directory, has the
advantage of working even if CVS is down allowing the install-O to
continue working!'''
@@ -190,7 +201,7 @@ def getInstallFilesFromLocalDirectory(cvsTag, buildDir, version):
snapshot = os.walk('./ice/install/unix')
for dirInfo in snapshot:
for f in dirInfo[2]:
- fixVersion(os.path.join(dirInfo[0], f), version)
+ fixVersion(os.path.join(dirInfo[0], f), version, mmVersion)
finally:
os.chdir(cwd)
return buildDir + '/ice/install'
@@ -1095,7 +1106,7 @@ def main():
# Primarily for debugging spec file creation.
#
if printSpecFile:
- version, soVersion = getVersion(cvsTag, buildDir)
+ version, soVersion, mmVersion = getVersion(cvsTag, buildDir)
RPMTools.createFullSpecFile(sys.stdout, installDir, version, soVersion)
sys.exit(0)
@@ -1133,10 +1144,11 @@ def main():
elif offline:
version = getIceVersion('include/IceUtil/Config.h')
soVersion = getIceSoVersion('include/IceUtil/Config.h')
- installFiles = getInstallFilesFromLocalDirectory(cvsTag, buildDir, version)
+ mmVersion = getIceMMVersion('include/IceUtil/Config.h')
+ installFiles = getInstallFilesFromLocalDirectory(cvsTag, buildDir, version, mmVersion)
else:
- version, soVersion = getVersion(cvsTag, buildDir)
- installFiles = getInstallFiles(cvsTag, buildDir, version)
+ version, soVersion, mmVersion = getVersion(cvsTag, buildDir)
+ installFiles = getInstallFiles(cvsTag, buildDir, version, mmVersion)
if verbose:
print 'Building binary distributions for Ice-' + version + ' on ' + getPlatform()