Allow switching of install dir after creation of preferences.

Changed some message to be clearer when presented by Package Manager.
This commit is contained in:
Jack Jansen 2003-04-16 12:15:34 +00:00
parent 5688b7ac3e
commit 20fa6754d1

View file

@ -160,6 +160,13 @@ class PimpPreferences:
buildDir = DEFAULT_BUILDDIR buildDir = DEFAULT_BUILDDIR
if not pimpDatabase: if not pimpDatabase:
pimpDatabase = DEFAULT_PIMPDATABASE pimpDatabase = DEFAULT_PIMPDATABASE
self.setInstallDir(installDir)
self.flavorOrder = flavorOrder
self.downloadDir = downloadDir
self.buildDir = buildDir
self.pimpDatabase = pimpDatabase
def setInstallDir(self, installDir=None):
if installDir: if installDir:
# Installing to non-standard location. # Installing to non-standard location.
self.installLocations = [ self.installLocations = [
@ -170,12 +177,8 @@ class PimpPreferences:
else: else:
installDir = DEFAULT_INSTALLDIR installDir = DEFAULT_INSTALLDIR
self.installLocations = [] self.installLocations = []
self.flavorOrder = flavorOrder
self.downloadDir = downloadDir
self.buildDir = buildDir
self.installDir = installDir self.installDir = installDir
self.pimpDatabase = pimpDatabase
def check(self): def check(self):
"""Check that the preferences make sense: directories exist and are """Check that the preferences make sense: directories exist and are
writable, the install directory is on sys.path, etc.""" writable, the install directory is on sys.path, etc."""
@ -465,7 +468,7 @@ class PimpPackage:
rv = [] rv = []
if not self._dict.get('Download-URL'): if not self._dict.get('Download-URL'):
return [(None, return [(None,
"%s: This package needs to be installed manually (no Download-URL field)" % "%s: This package cannot be installed automatically (no Download-URL field)" %
self.fullname())] self.fullname())]
if not self._dict.get('Prerequisites'): if not self._dict.get('Prerequisites'):
return [] return []
@ -755,7 +758,7 @@ class PimpInstaller:
if pkg: if pkg:
self._prepareInstall(pkg, force, recursive) self._prepareInstall(pkg, force, recursive)
else: else:
self._curmessages.append("Requires: %s" % descr) self._curmessages.append("Problem with dependency: %s" % descr)
def prepareInstall(self, package, force=0, recursive=1): def prepareInstall(self, package, force=0, recursive=1):
"""Prepare installation of a package. """Prepare installation of a package.