From 5541054c0fe8281e821137cde356b88125e49f10 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 13 Nov 2010 14:57:00 +0000 Subject: [PATCH] let pdeploy respect the super-mirror --- direct/src/p3d/DeploymentTools.py | 32 ++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/direct/src/p3d/DeploymentTools.py b/direct/src/p3d/DeploymentTools.py index 34f2f029dd..6f3ebfcbb0 100644 --- a/direct/src/p3d/DeploymentTools.py +++ b/direct/src/p3d/DeploymentTools.py @@ -212,11 +212,24 @@ class Installer: if not host.hasContentsFile: if not host.readContentsFile(): if not host.downloadContentsFile(self.http): - Installer.notify.error("couldn't read host") + Installer.notify.error("couldn't read host %s" % host.hostUrl) return + superHost = None + if appRunner.superMirrorUrl: + superHost = HostInfo(appRunner.superMirrorUrl, appRunner = appRunner, hostDir = hostDir, asMirror = False, perPlatform = False) + if not superHost.hasContentsFile: + if not superHost.readContentsFile(): + if not superHost.downloadContentsFile(self.http): + Installer.notify.warning("couldn't read supermirror host %s" % superHost.hostUrl) + superHost = None + for name, version in self.requirements: - package = host.getPackage(name, version, platform) + package = None + if superHost: + package = superHost.getPackage(name, version, platform) + if not package: + package = host.getPackage(name, version, platform) if not package: Installer.notify.error("Package %s %s for %s not known on %s" % ( name, version, platform, host.hostUrl)) @@ -231,14 +244,15 @@ class Installer: continue # Also install the 'images' package from the same host that p3dembed was downloaded from. - host = HostInfo(self.standalone.host.hostUrl, appRunner = appRunner, hostDir = hostDir, asMirror = False, perPlatform = False) - if not host.hasContentsFile: - if not host.readContentsFile(): - if not host.downloadContentsFile(self.http): - Installer.notify.error("couldn't read host") - return + if host.hostUrl != self.standalone.host.hostUrl: + host = HostInfo(self.standalone.host.hostUrl, appRunner = appRunner, hostDir = hostDir, asMirror = False, perPlatform = False) + if not host.hasContentsFile: + if not host.readContentsFile(): + if not host.downloadContentsFile(self.http): + Installer.notify.error("couldn't read host %s" % host.hostUrl) + return - for package in host.getPackages(name = "images"): + for package in superHost.getPackages(name = "images") + host.getPackages(name = "images"): package.installed = True # Hack not to let it unnecessarily install itself packages.append(package) if not package.downloadDescFile(self.http):