Hello Andreas,

On Mon, 07 Oct 2013, Andreas Luik wrote:
>   I'm trying to create a non-relocatable subpackage from a spec file, where 
> the
> main package is relocatable, i.e. has a Prefix: tag.  It is possible to use 
> Prefix:
> for subpackages, e.g. to use a different value as for the main package, but I
> have not been able to "clear" the main package's prefix setting.  Using the 
> following
> spec file:

I am very happy to be corrected by somebody, but I do not think that this
is currently implemented when reading

 - http://rpm5.org/cvs/fileview?f=rpm/build/parsePreamble.c
 - http://rpm.org/gitweb?p=rpm.git;a=blob;f=build/parsePreamble.c

If you search there for RPMTAG_PREFIXES, you will likely see why I come to
this conclusion. And as there is also no addMacro()/delMacro(), I am quite
certain there is no "hidden" macro for this that could be abused somehow.

You could use a path for Prefix: that is not used in %files but this should
fail (according to http://rpm5.org/docs/api/relocatable.html) - however it
does interestingly not fail with some RPM versions. Finally this doesn't do
the trick, because it does not prevent users from "--relocate /=/my" which
at least also works using some RPM versions (even RPM has "Prefix: /usr"; I
do not know if this behaviour is really expected).


Greetings,
  Robert

Attachment: pgp50pB65cIlz.pgp
Description: PGP signature

Reply via email to