diff options
Diffstat (limited to 'cpp/config/makegitignore.py')
-rwxr-xr-x | cpp/config/makegitignore.py | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/cpp/config/makegitignore.py b/cpp/config/makegitignore.py index e0e8db24274..255e78f12ae 100755 --- a/cpp/config/makegitignore.py +++ b/cpp/config/makegitignore.py @@ -1,14 +1,14 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # ********************************************************************** -import os, sys, shutil, fnmatch, re, time +import os, sys, shutil, fnmatch, re, time, getopt # # NOTE: This scripts generates .gitignore files in directories @@ -81,6 +81,31 @@ def createGitIgnore(filename, gitIgnoreFiles): file.close() +def usage(): + print "Usage: " + sys.argv[0] + " [options]" + print + print "Options:" + print "-e Run for Ice-E." + print "-h Show this message." + print + +icee = False +try: + opts, args = getopt.getopt(sys.argv[1:], "he") +except getopt.GetoptError: + usage() + sys.exit(1) +for o, a in opts: + if o == "-h": + usage() + sys.exit(0) + elif o == "-e": + icee = True +if len(args) != 0: + usage() + sys.exit(1) + + # # Find where the root of the tree is. # @@ -92,8 +117,10 @@ else: print("cannot find top-level directory") sys.exit(1) -makefiles = find(os.path.join(toplevel, "cpp"), "Makefile") -makefiles = makefiles + find(os.path.join(toplevel, "cppe"), "Makefile") +if icee: + makefiles = find(os.path.join(toplevel, "cppe"), "Makefile") +else: + makefiles = find(os.path.join(toplevel, "cpp"), "Makefile") cwd = os.getcwd() gitIgnoreFiles = { } for i in makefiles: @@ -112,7 +139,6 @@ os.chdir(cwd) excludePath = [ os.path.join(toplevel, "cpp", "bin"), os.path.join(toplevel, "cpp", "lib"), \ os.path.join(toplevel, "cppe", "bin"), os.path.join(toplevel, "cppe", "lib") ] -print excludePath for (path, files) in gitIgnoreFiles.iteritems(): if os.path.dirname(path) in excludePath: continue |