diff options
author | Matthew Newhook <matthew@zeroc.com> | 2008-04-09 17:25:23 +0800 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2008-04-09 17:25:23 +0800 |
commit | a0ce2c16ee6afd424da0069c05c7ce838bbda2e6 (patch) | |
tree | 5b39dc751cb6e6233810d58ad3da25b8fbf43f69 /makesldist.py | |
parent | Merged SL 0.1.1 3.3 refresh. (diff) | |
download | ice-a0ce2c16ee6afd424da0069c05c7ce838bbda2e6.tar.bz2 ice-a0ce2c16ee6afd424da0069c05c7ce838bbda2e6.tar.xz ice-a0ce2c16ee6afd424da0069c05c7ce838bbda2e6.zip |
Squashed commit of the following:
commit 6c89bb620178da1fada690619a1d5071f719d310
Author: Matthew Newhook <matthew@zeroc.com>
Date: Wed Apr 9 17:24:48 2008 +0800
Fixes to the makedlsdist.
commit ca4ae84cf8fb77f118398782d7ce6a1b3131efb2
Author: Matthew Newhook <matthew@zeroc.com>
Date: Wed Apr 9 16:36:18 2008 +0800
Get rid of Make.common.rules.mak.icesl
Diffstat (limited to 'makesldist.py')
-rwxr-xr-x | makesldist.py | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/makesldist.py b/makesldist.py index 1d1210d64a3..5cc25d5271f 100755 --- a/makesldist.py +++ b/makesldist.py @@ -29,7 +29,7 @@ filesToRemove = [ # List of files & subdirectories to keep, all others are removed. filesToKeep = [ - "./config/Make.common.rules.mak.icesl", + "./config/Make.common.rules.mak", "./cpp/Makefile.mak", "./cpp/config/Make.rules.mak.icesl", "./cpp/config/Make.rules.msvc", @@ -279,26 +279,6 @@ def fixMakeRules(file): # # Fix version in README, INSTALL files # -def fixVersion(file): - - global version - - origfile = file + ".orig" - os.rename(file, origfile) - oldFile = open(origfile, "r") - newFile = open(file, "w") - line = oldFile.read(); - line = re.sub("@ver@", version, line) - newFile.write(line) - newFile.close() - oldFile.close() - - # Preserve the executable permission - st = os.stat(origfile) - if st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH): - os.chmod(file, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) # rwxr-xr-x - os.remove(origfile) - def fixFilePermission(file): patterns = [ \ @@ -415,6 +395,8 @@ def regexpEscape(expr): def substitute(file, regexps): for line in fileinput.input(file, True): for (expr, text) in regexps: + if not expr is re: + expr = re.compile(expr) line = expr.sub(text, line) print line, @@ -543,7 +525,7 @@ for root, dirnames, filesnames in os.walk('.'): # Fix version of README/INSTALL files and keep track of bison/flex files for later processing if fnmatch.fnmatch(f, "README*") or fnmatch.fnmatch(f, "INSTALL*"): - fixVersion(filepath) + substitute(filepath, [("@ver@", version)]) elif fnmatch.fnmatch(f, "*.y"): bisonFiles.append(filepath) elif fnmatch.fnmatch(f, "*.l"): @@ -559,17 +541,9 @@ for root, dirnames, filesnames in os.walk('.'): # Note that this "fixes" ICE_STRING_VERSION, but not ICE_INT_VERSION # since that is only used by the C++ code generators. # -configFile = "cpp/include/IceUtil/Config.h" -origConfigFile = configFile + ".orig" -os.rename(configFile, origConfigFile) -oldConfigFile = open(origConfigFile, "r") -newConfigFile = open(configFile, "w") -line = oldConfigFile.read(); -line = re.sub('ICE_STRING_VERSION "([0-9a-z\.]+)"', 'ICE_STRING_VERSION "%s"' % version, line) -newConfigFile.write(line) -newConfigFile.close() -oldConfigFile.close() -os.remove(origConfigFile) +substitute("cpp/include/IceUtil/Config.h", + [('ICE_STRING_VERSION "([0-9a-z\.]+)"', 'ICE_STRING_VERSION "%s"' % version)]) +substitute("config/Make.common.rules.mak", [('^VERSION\s+=\s*[a-z0-9\.]+', 'VERSION = %s' % version)]) print "ok" @@ -614,7 +588,6 @@ shutil.move(os.path.join("sl", "INSTALL.txt"), os.path.join("INSTALL.txt")) # Move *.icesl to the correct names. # shutil.move(os.path.join("cpp", "config", "Make.rules.mak.icesl"), os.path.join("cpp", "config", "Make.rules.mak")) -shutil.move(os.path.join("config", "Make.common.rules.mak.icesl"), os.path.join("config", "Make.common.rules.mak")) print "ok" |