31 |
31 |
32 parser = optparse.OptionParser() |
32 parser = optparse.OptionParser() |
33 parser.add_option("-s", "--sbs-home", dest="sbshome", |
33 parser.add_option("-s", "--sbs-home", dest="sbshome", |
34 help="Path to use as SBS_HOME environment variable. If not present the script exits.") |
34 help="Path to use as SBS_HOME environment variable. If not present the script exits.") |
35 parser.add_option("-w", "--win32-support", dest="win32support", |
35 parser.add_option("-w", "--win32-support", dest="win32support", |
36 help="Path to use as SBS_HOME environment variable. If not present the script exits.") |
36 help="Path to Win32 support directory. If not present the script exits.") |
37 |
37 |
38 (options, args) = parser.parse_args() |
38 (options, args) = parser.parse_args() |
39 |
39 |
40 if options.sbshome == None: |
40 if options.sbshome == None: |
41 print "ERROR: no SBS_HOME passed in. Exiting..." |
41 print "ERROR: no SBS_HOME passed in. Exiting..." |
47 else: |
47 else: |
48 # Required irectories inside the win32-support repository |
48 # Required irectories inside the win32-support repository |
49 win32supportdirs = ["bv", "cygwin", "mingw", "python264"] |
49 win32supportdirs = ["bv", "cygwin", "mingw", "python264"] |
50 for dir in win32supportdirs: |
50 for dir in win32supportdirs: |
51 if not os.path.isdir(os.path.join(options.win32support, dir)): |
51 if not os.path.isdir(os.path.join(options.win32support, dir)): |
52 print "ERROR: directory %s does not exist. Cannot build installer. Exiting..." |
52 print "ERROR: directory %s does not exist. Cannot build installer. Exiting..." % dir |
53 sys.exit(2) |
53 sys.exit(2) |
54 |
54 |
55 def parseconfig(xmlFile="raptorinstallermaker.xml"): |
55 def parseconfig(xmlFile="raptorinstallermaker.xml"): |
56 pass |
56 pass |
57 |
57 |
58 def generateinstallerversionheader(sbshome = None): |
58 def generateinstallerversionheader(sbshome = None): |
59 shellenv = os.environ.copy() |
59 shellenv = os.environ.copy() |
60 shellenv["PYTHONPATH"] = os.path.join(os.environ["SBS_HOME"], "python") |
60 shellenv["PYTHONPATH"] = os.path.join(sbshome, "python") |
61 |
61 |
62 raptorversioncommand = "python -c \"import raptor_version; print raptor_version.numericversion()\"" |
62 raptorversioncommand = "python -c \"import raptor_version; print raptor_version.numericversion()\"" |
63 |
63 |
64 # Raptor version is obtained from raptor_version module's numericversion function. |
64 # Raptor version is obtained from raptor_version module's numericversion function. |
65 sbs_version_matcher = re.compile(".*(\d+\.\d+\.\d+).*", re.I) |
65 sbs_version_matcher = re.compile(".*(\d+\.\d+\.\d+).*", re.I) |