[Installit-dev] "package manager " becomes "InstallIt"

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Wed Aug 24 21:13:20 CEST 2005


Jannis Pohlmann wrote:
>>>The backend API might need something like a flag which tells us there's
>>>no default installation path. For RPM, DEB etc. there is (/usr) but
>>>maybe on other systems there isn't (source for example). If there is
>>>*one* we can just head on. If not, we'll have to let the user decide
>>>(maybe only on the first run, too).
>>
>>The way I meant this was that there are get_bin_path, get_data_path,... 
>>functions in the plugin for getting the paths. Plugin either gets the 
>>path from system or has some hardcoded default. Then the gui would show 
>>that path with a possibility to change it. If we would like to tell 
>>there is no default then plugin could just return empty string.
> 
> Yeah, something like this. Both solutions are very similar. I let Benny
> decide which way to go since he seems to be the one with the best
> knowledge about different platforms.

The backend API needs accessors for atleast sysconfdir, localstatedir 
and prefix. The "source-only" backend will just return the previously 
selected prefix (and $prefix/etc for sysconfdir, $prefix/var for 
localstatedir).

What we need is a way to ask the backend whether the prefix is 
configurable (for atleast "source-only" and "solaris"), and also a way 
to query the backend for a sane default, e.g.:

class Backend:
  def has_configurable_prefix(self):
   return False
  def has_selected_prefix(self):
   return False
  def get_selected_prefix(self):
   return ""
  def set_selected_prefix(self, prefix):
   pass


def SolarisBackend(Backend):
  def has_configurable_prefix(self):
   return True
  def has_selected_prefix(self):
   return self.__prefix_set
  def get_selected_prefix(self):
   if self.__prefix_set:
    return self.__prefix
   else:
    return "/usr/local"
  def set_selected_prefix(self, prefix):
   self.__prefix = prefix
   self.__prefix_set = True


def SourceBackend(Backend):
  def has_configurable_prefix(self):
   return True
  def has_selected_prefix(self):
   return self.__prefix_set
  def get_selected_prefix(self):
   if self.__prefix_set:
    return self.__prefix
   elif is_writable("/usr/local"):
    return "/usr/local"
   else:
    return "$HOME/local"
  def set_selected_prefix(self, prefix):
   self.__prefix = prefix
   self.__prefix_set = True


And so on... of course the backends will need to save their prefix 
information.

> - Jannis

Benedikt



More information about the Installit-dev mailing list