RPM Community Forums

Mailing List Message of <rpm-users>

Re: Question about "rpmbuild --root"

From: Eric MSP Veith <eveith@wwweb-library.net>
Date: Mon 14 Feb 2011 - 15:39:20 CET
Message-Id: <201102141539.25116.eveith@wwweb-library.net>
Am Montag, 14. Februar 2011, 14:41:42 schrieb Jeff Johnson:
> > The latter one I solved by calling "sudo rpmbuild".
> So no figger where rpmbuild is supposed to read its configuration from.
> That's a bit harder than using sudo to get uid == 0.

I don't understand. :-/ There are hardcoded macro file paths like 
/usr/lib/rpm/macros:~/.rpmmacros. "~" resolves to ~root or ~myuser based on 
what variables sudo sets. I don't expect RPM to add some extra magic 
dowhatIwant(). Or should I?

> Depends on context.
> Traditionally, RPM implicitly added --root to --dbpath when opening
> an rpmdb and expected the user to "know" when to add the chroot
> prefix to the --dbpath argument for non-root execution.
> But PLD wanted --rebuilddb --root instead of --rebuildb --dbpath
> (where one had to manually insert the root prefix in the --dbpath
> argument).
> So --root and --dbpath behavior was changed.

I don't quite get the implications. But I guess that when I encounter a 
problem related to this, I'll remember this part and hopefully be able to use 
this particular information. :-)

> > Ok, off trying... :-)
> Good luck!

TA! I hoped that I could do the config file reading and loading .so files into 
memory and do the chroot() just before doing the actual call to build(). So 
everything should already reside in memory and the only thing that needs to be 
in the chroot is the rpmdb. Well, I'll see.

> FYI: --root takes a /string which is used to construct a command that looks
> like rsh -c "chroot /string ..."
> that isn't what anyone is expecting but is exactly what was intended.

You mean via %_remchroot, %_remroot & Co? These are never filled here. I 
already tried to manually add -D '%_remroot /my/chroot' and so on, but that 
didn't work, too. What am I missing?


Received on Mon Feb 14 15:39:28 2011
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.