diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index b89d5d338f..9653cbec8b 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -1851,6 +1851,11 @@ class Packager: # Particularly useful on OSX to reference the universal SDK. self.systemRoot = None + # Set this true to treat setHost() the same as addHost(), thus + # ignoring any request to specify a particular download host, + # e.g. for testing and development. + self.ignoreSetHost = False + # The download URL at which these packages will eventually be # hosted. self.hosts = {} @@ -2065,7 +2070,9 @@ class Packager: """ Specifies the URL that will ultimately host these contents. """ - self.host = host + if not self.ignoreSetHost: + self.host = host + self.addHost(host, downloadUrl = downloadUrl, descriptiveName = descriptiveName, hostDir = hostDir, mirrors = mirrors) diff --git a/direct/src/p3d/ppackage.py b/direct/src/p3d/ppackage.py index 1c84f43b44..08740d3c9f 100755 --- a/direct/src/p3d/ppackage.py +++ b/direct/src/p3d/ppackage.py @@ -106,6 +106,12 @@ Options: instead of the system library. This is particularly useful for cross-compilation. At the moment, this is supported only on OSX. + -H + Treats a packager.setHost() call in the pdef file as if it were + merely a call to packager.addHost(). This allows producing a + package for an alternate host than its normally configured host, + which is sometimes useful in development. + -h Display this help """ @@ -129,10 +135,11 @@ signParams = [] allowPythonDev = False universalBinaries = False systemRoot = None +ignoreSetHost = False platforms = [] try: - opts, args = getopt.getopt(sys.argv[1:], 'i:ps:S:DuP:R:h') + opts, args = getopt.getopt(sys.argv[1:], 'i:ps:S:DuP:R:Hh') except getopt.error, msg: usage(1, msg) @@ -157,6 +164,8 @@ for opt, arg in opts: platforms.append(arg) elif opt == '-R': systemRoot = arg + elif opt == '-H': + ignoreSetHost = True elif opt == '-h': usage(0) @@ -200,6 +209,7 @@ for platform in platforms: packager.signParams = signParams packager.allowPythonDev = allowPythonDev packager.systemRoot = systemRoot + packager.ignoreSetHost = ignoreSetHost try: packager.setup()