Making yum relocateable

Mike Hearn mike at navi.cx
Wed Dec 15 16:57:54 UTC 2004


On Tue, 14 Dec 2004 17:14:30 -0800, James Harrison wrote:
> Ive sucessfully installed yum-2.0.8 to /opt/yum-2.0.8/.
> 
> However, some paths inside certain files are still hardcoded in place:
> /etc/yum.conf, /usr/share/yum ....
> 
> Is there some compile option that sets these paths to be under the --prefix
> path?

Ideally you wouldn't need to be sedding the sources or having a file/env
var telling a program where it is. It'd just know. 

This is possible with ELF binaries because they can read /proc/self/exe or
parse /proc/self/maps, but with scripts I'm not sure it works. You can do
something like the Perl Findbin module which involves examining argv[0]
and possibly scanning the path, but this is a rather nasty hack.

I'd like the kernel to provide some way for scripts to locate their
absolute path when run using a shebang line but I have no idea how hard
that'd be to implement ...

thanks -mike




More information about the fedora-devel-list mailing list