summaryrefslogtreecommitdiff
path: root/php/makedist.py
diff options
context:
space:
mode:
authorBrent Eagles <brent@zeroc.com>2007-09-04 07:19:40 -0230
committerBrent Eagles <brent@zeroc.com>2007-09-04 07:19:40 -0230
commit9865706797a1a9237e0818a21d354da4eefce58f (patch)
tree79515b4c021a29844fd931f8d5bbb8901cf51bf5 /php/makedist.py
parentUpdate Ruby CHANGES file for http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?... (diff)
downloadice-9865706797a1a9237e0818a21d354da4eefce58f.tar.bz2
ice-9865706797a1a9237e0818a21d354da4eefce58f.tar.xz
ice-9865706797a1a9237e0818a21d354da4eefce58f.zip
-Updating the makedist.py scripts for the various language mappings to support the root makedist script.
-Adding the new makedist tool. Merging fixes from R3_2_branch. Specifically: - bzip2 DLL library naming problem for .dotnet - EOLN character translation for RELEASE_NOTES file. - Remove exclusion of backup demo from Windows installers. - Remove obsoleted files from Ruby - Remove unused and obsolete iceproject.xml file. - Modify makewindist.py to use distfiles archive instead of trying to guess versions, etc.
Diffstat (limited to 'php/makedist.py')
-rwxr-xr-xphp/makedist.py82
1 files changed, 43 insertions, 39 deletions
diff --git a/php/makedist.py b/php/makedist.py
index 00930c3c2f2..bee7bf31b6e 100755
--- a/php/makedist.py
+++ b/php/makedist.py
@@ -14,13 +14,11 @@ import os, sys, shutil, fnmatch, re, glob
# Program usage.
#
def usage():
- print "Usage: " + sys.argv[0] + " [options] [tag]"
+ print "Usage: " + sys.argv[0] + " [options]"
print
print "Options:"
print "-h Show this message."
print "-v Be verbose."
- print
- print "If no tag is specified, HEAD is used."
#
# Find files matching a pattern.
@@ -51,22 +49,27 @@ def fixVersion(files, version):
oldFile.close()
os.remove(origfile)
+if os.path.exists("../.git"):
+ print "Unable to run in repository! Exiting..."
+ sys.exit(1)
+
+verbose = False
+
#
# Check arguments
#
-tag = "HEAD"
for x in sys.argv[1:]:
if x == "-h":
usage()
sys.exit(0)
+ elif x == "-v":
+ verbose = True
elif x.startswith("-"):
print sys.argv[0] + ": unknown option `" + x + "'"
print
usage()
sys.exit(1)
- else:
- tag = x
-
+
#
# Remove any existing "dist" directory and create a new one.
#
@@ -74,62 +77,64 @@ distdir = "dist"
if os.path.exists(distdir):
shutil.rmtree(distdir)
os.mkdir(distdir)
-os.mkdir(os.path.join(distdir, "icephp"))
-os.mkdir(os.path.join(distdir, "ice"))
-
-#
-# Export sources from git.
-#
-os.system("git archive " + tag + " . | (cd dist/icephp && tar xf -)")
-os.chdir(os.path.join("..", "cpp"))
-os.system("git archive " + tag + " . | (cd ../php/dist/ice && tar xf -)")
-os.chdir(os.path.join("..", "php"))
-
-os.chdir(distdir)
+icedir = os.path.join(os.getcwd(), "..", "cpp")
#
-# Copy Make.rules.Linux and Make.rules.msvc
+# Get Ice version.
#
-shutil.copyfile(os.path.join("ice", "config", "Make.rules.Linux"),
- os.path.join("icephp", "config", "Make.rules.Linux"))
+config = open(os.path.join(icedir, "include", "IceUtil", "Config.h"), "r")
+version = re.search("ICE_STRING_VERSION \"([0-9\.b]*)\"", config.read()).group(1)
+icephpver = "IcePHP-" + version
+
+os.mkdir(os.path.join(distdir, icephpver))
-shutil.copyfile(os.path.join("ice", "config", "Make.rules.msvc"),
- os.path.join("icephp", "config", "Make.rules.msvc"))
+if verbose:
+ quiet = "v"
+else:
+ quiet = ""
#
# Remove files.
#
-filesToRemove = [ \
- os.path.join("icephp", "makedist.py"), \
- ]
-filesToRemove.extend(find("icephp", ".gitignore"))
+filesToRemove = [ "makedist.py", "exclusions", "dist", "allDemos.py" ]
+filesToRemove.extend(find(".", ".gitignore"))
+filesToRemove.extend(find(".", "expect.py"))
+
+exclusionFile = open("exclusions", "w")
for x in filesToRemove:
- os.remove(x)
+ exclusionFile.write("%s\n" % x)
+exclusionFile.close()
+
+os.system("tar c" + quiet + " -X exclusions . | ( cd " + os.path.join(distdir, icephpver) + " && tar xf - )")
+
+os.chdir(distdir)
#
-# Get Ice version.
+# Copy Make.rules.Linux and Make.rules.msvc
#
-config = open(os.path.join("ice", "include", "IceUtil", "Config.h"), "r")
-version = re.search("ICE_STRING_VERSION \"([0-9\.b]*)\"", config.read()).group(1)
+shutil.copyfile(os.path.join(icedir, "config", "Make.rules.Linux"),
+ os.path.join(icephpver, "config", "Make.rules.Linux"))
+
+shutil.copyfile(os.path.join(icedir, "config", "Make.rules.msvc"),
+ os.path.join(icephpver, "config", "Make.rules.msvc"))
+
print "Fixing version in README and INSTALL files..."
-fixVersion(find("icephp", "README*"), version)
-fixVersion(find("icephp", "INSTALL*"), version)
+fixVersion(find(icephpver, "README*"), version)
+fixVersion(find(icephpver, "INSTALL*"), version)
#
# Create archives.
#
-icephpver = "IcePHP-" + version
-os.rename("icephp", icephpver)
os.system("chmod -R u+rw,go+r-w . " + icephpver)
os.system("find " + icephpver + " \\( -name \"*.php\" -or -name \"*.ice\" \\) -exec chmod a-x {} \\;")
os.system("find " + icephpver + " \\( -name \"README*\" -or -name \"INSTALL*\" \\) -exec chmod a-x {} \\;")
os.system("find " + icephpver + " -type d -exec chmod a+x {} \\;")
os.system("find " + icephpver + " -perm +111 -exec chmod a+x {} \\;")
-os.system("tar cvf " + icephpver + ".tar " + icephpver)
+os.system("tar cf " + icephpver + ".tar " + icephpver)
os.system("gzip -9 " + icephpver + ".tar")
-os.system("zip -9r " + icephpver + ".zip " + icephpver)
+os.system("zip -9rq " + icephpver + ".zip " + icephpver)
#
# Copy files (README, etc.).
@@ -140,4 +145,3 @@ shutil.copyfile(os.path.join(icephpver, "CHANGES"), "IcePHP-" + version + "-CHAN
# Done.
#
shutil.rmtree(icephpver)
-shutil.rmtree("ice")