Re: Relocatable packages
On Wed, Jan 30, 2002 at 03:05:28PM -0500, H. S. Teoh wrote:
> [relocation at compile-time, not build-time]
>
> I don't think we want dpkg to re-build the package upon installation just
> so it can be relocated :-)
>
> Of course, it can be argued that such paths shouldn't be hard-compiled
> into the program -- and I'd tend to agree with that -- unfortunately, this
> convention is too widespread and likely isn't going to change anytime
> soon.
When a program is run, it has only the data within the executable to start
with. This has to be enough for it to find everything that it needs.
Can you think of another way that it can work? Before you suggest "read a
configuration file", consider that a configuration file must be found before
it can be read. Please don't say "environment variables", as one variable
per installed program is not workable. Determining the installation prefix
dynamically from the path to the executable is evil, and breaks many useful
constructs. You could create a global "registry" mapping package name ->
installation prefix, but that makes it impossible to have more than one
version installed under different prefixes (which in my opinion would be
half the point of relocation). You could have each executable hard-code a
magic string which would be patched at installation time to the real
installation prefix, but this also breaks very useful functionality (like
being able to unpack a package by hand and use it).
--
- mdz
Reply to: