[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rpm-users
Subject:    Re: rpm spec: clearing Prefix: to create a non-relocatable subpackage (of a relocatable package)?
From:       Jeffrey Johnson <n3npq () me ! com>
Date:       2013-10-09 17:46:21
Message-ID: CB5E4387-4A4D-4AF5-91DF-24632E761EB0 () me ! com
[Download RAW message or body]

On Oct 7, 2013, at 8:02 AM, Andreas Luik wrote:

> Hello,
>  
>   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:
>  
> 
> Name: xxx
> Version: 1.0
> ...
> Prefix: /usr/local
> %description
> test
>  
> %package sub
> Summary: subpackage
> Prefix:
> %description sub
> subpackage test
> ...
>  
>  
> (Prefix: without a value) generates the error message
>  
> error: line xx: Empty tag: Prefix:
>  
> Thanks in advance for any suggestions.
>  
> 

The real problem here is in the assumed goal of "create a non-relocatable subpackage".

Every path in every package can be relocated by --relocate /old/path=/newpath. The
only restriction is that only full directory/file paths, not partial paths, can be relocated.
E.g. given a path like /A/B/C/abc, one cannot relocate with a file prefix (or pattern) like
	--relocate /A/B/C/a=/somewhere/else

The only current usage for a Prefix: (and multiple Prefix:'s or Prefixes: are permitted) is
to automatically disable a warning/error message that can be overridden by another option.

If you want to use Prefix:, then specify all relocations in all subpackages. The behavior
for a "non-relocateable" subpackage will always depend on what options were used
to install that package, and there is no way (nor should there be: only the end-user,
not the builder, can determine what paths are useful/needed in general) to prevent
--relocate from being used with appropriate overrides.

Note that the modestly serious design flaw with relocateable paths in *.rpm packages is that
the relocations are not remembered persistently. So if you decide to relocate some
path, then you also need to add --relocate on every future install.

The other flaw is that relocations are per-transaction (or CLI invocation), not per-package.
This means that if you have two packages with an identical path which you want to
relocate in one package but not the other, then the 2 package installations MUST be
in in different transactions and installed separately.

hth

73 de Jeff

> Kind regards,
> -- 
> i. A. Andreas Luik
> in - innovative navigation GmbH
> phone: +49 7154 807171
> fax: +49 7154 807154
> email: Andreas.Luik@innovative-navigation.de
> 
> in - innovative navigation GmbH, Leibnizstrasse 11, D-70806 Kornwestheim
> Geschäftsführer/Managing Directors:
> Dr. Thomas Gern, Dr. Martin Sandler, Dr. Reinhard Zimmermann, Uwe Vögele
> Handelsregister: Stuttgart HRB 205770
> 
> in - innovative navigation GmbH is ISO 9001:2008 certified. 


[Attachment #3 (unknown)]

<html><head><base href="x-msg://2126/"></head><body style="word-wrap: break-word; \
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On \
Oct 7, 2013, at 8:02 AM, Andreas Luik wrote:</div><br \
class="Apple-interchange-newline"><blockquote type="cite"><span \
class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; \
font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: \
normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; \
text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; \
-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; \
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; \
-webkit-text-stroke-width: 0px; font-size: medium; "><div style="font-family: Arial, \
Verdana, sans-serif !important; font-size: 12px; padding-top: 5px; padding-right: \
5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; \
margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: \
none; border-bottom-style: none; border-left-style: none; background-color: rgb(255, \
255, 255); position: static; z-index: auto; "><div style="margin-top: 0px; \
margin-bottom: 0px; ">Hello,</div><p style="margin-top: 0px; margin-bottom: 0px; \
">&nbsp;</p><div style="margin-top: 0px; margin-bottom: 0px; ">&nbsp; I'm trying to \
create a non-relocatable subpackage from a spec file, where the</div><div \
style="margin-top: 0px; margin-bottom: 0px; ">main package is relocatable, i.e. has a \
Prefix: tag.&nbsp; It is possible to use Prefix:</div><div style="margin-top: 0px; \
margin-bottom: 0px; ">for subpackages, e.g. to use a different value as for the main \
package, but I</div><div style="margin-top: 0px; margin-bottom: 0px; ">have not been \
able to "clear" the main package's prefix setting.&nbsp; Using the \
following</div><div style="margin-top: 0px; margin-bottom: 0px; ">spec file:</div><p \
style="margin-top: 0px; margin-bottom: 0px; ">&nbsp;</p><div><br></div><div \
style="margin-top: 0px; margin-bottom: 0px; ">Name: xxx</div><div style="margin-top: \
0px; margin-bottom: 0px; ">Version: 1.0</div><div style="margin-top: 0px; \
margin-bottom: 0px; ">...</div><div style="margin-top: 0px; margin-bottom: 0px; \
">Prefix: /usr/local</div><div style="margin-top: 0px; margin-bottom: 0px; \
">%description</div><div style="margin-top: 0px; margin-bottom: 0px; ">test</div><p \
style="margin-top: 0px; margin-bottom: 0px; ">&nbsp;</p><div style="margin-top: 0px; \
margin-bottom: 0px; ">%package sub</div><div style="margin-top: 0px; margin-bottom: \
0px; ">Summary: subpackage</div><div style="margin-top: 0px; margin-bottom: 0px; \
">Prefix:</div><div style="margin-top: 0px; margin-bottom: 0px; ">%description \
sub</div><div style="margin-top: 0px; margin-bottom: 0px; ">subpackage test</div><div \
style="margin-top: 0px; margin-bottom: 0px; ">...</div><p style="margin-top: 0px; \
margin-bottom: 0px; ">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px; \
">&nbsp;</p><div style="margin-top: 0px; margin-bottom: 0px; ">(Prefix: without a \
value) generates the error message</div><p style="margin-top: 0px; margin-bottom: \
0px; ">&nbsp;</p><div style="margin-top: 0px; margin-bottom: 0px; ">error: line xx: \
Empty tag: Prefix:<br>&nbsp;</div><div style="margin-top: 0px; margin-bottom: 0px; \
">Thanks in advance for any suggestions.</div><p style="margin-top: 0px; \
margin-bottom: 0px; ">&nbsp;</p><div><br></div></div></span></blockquote><div><br></div>The \
real problem here is in the assumed goal of "<span class="Apple-style-span" \
style="font-family: Arial, Verdana, sans-serif; font-size: 12px; ">create a \
non-relocatable subpackage".</span></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif"><br></font></div><div><font \
class="Apple-style-span" face="Arial, Verdana, sans-serif">Every path in every \
package can be relocated by --relocate /old/path=/newpath. The</font></div><div><font \
class="Apple-style-span" face="Arial, Verdana, sans-serif">only restriction is that \
only full directory/file paths, not partial paths, can be \
relocated.</font></div><div><font class="Apple-style-span" face="Arial, Verdana, \
sans-serif">E.g. given a path like /A/B/C/abc, one cannot relocate with a file prefix \
(or pattern) like</font></div><div><font class="Apple-style-span" face="Arial, \
Verdana, sans-serif"><span class="Apple-tab-span" \
style="white-space:pre">	</span>--relocate \
/A/B/C/a=/somewhere/else</font></div><div><font class="Apple-style-span" face="Arial, \
Verdana, sans-serif"><br></font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">The only current usage for a Prefix: (and multiple \
Prefix:'s or Prefixes: are permitted) is</font></div><div><font \
class="Apple-style-span" face="Arial, Verdana, sans-serif">to automatically disable a \
warning/error message that can be overridden by another \
option.</font></div><div><font class="Apple-style-span" face="Arial, Verdana, \
sans-serif"><br></font></div><div><font class="Apple-style-span" face="Arial, \
Verdana, sans-serif">If you want to use Prefix:, then specify all relocations in all \
subpackages. The behavior</font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">for a "non-relocateable" subpackage will always \
depend on what options were used</font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">to install that package, and there is no way (nor \
should there be: only the end-user,</font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">not the builder, can determine what paths are \
useful/needed in general) to prevent</font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">--relocate from being used with appropriate \
overrides.</font></div><div><font class="Apple-style-span" face="Arial, Verdana, \
sans-serif"><br></font></div><div><font class="Apple-style-span" face="Arial, \
Verdana, sans-serif">Note that the modestly serious design flaw with relocateable \
paths in *.rpm packages is that</font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">the relocations are not remembered persistently. So \
if you decide to relocate some</font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">path, then you also need to add --relocate on every \
future install.</font></div><div><font class="Apple-style-span" face="Arial, Verdana, \
sans-serif"><br></font></div><div><font class="Apple-style-span" face="Arial, \
Verdana, sans-serif">The other flaw is that relocations are per-transaction (or CLI \
invocation), not per-package.</font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">This means that if you have two packages with an \
identical path which you want to</font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">relocate in one package but not the other, then the \
2 package installations MUST be</font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">in in different transactions and installed \
separately.</font></div><div><font class="Apple-style-span" face="Arial, Verdana, \
sans-serif"><br></font></div><div><font class="Apple-style-span" face="Arial, \
Verdana, sans-serif">hth</font></div><div><font class="Apple-style-span" face="Arial, \
Verdana, sans-serif"><br></font></div><div><font class="Apple-style-span" \
face="Arial, Verdana, sans-serif">73 de Jeff</font></div><div><font \
class="Apple-style-span" face="Arial, Verdana, \
sans-serif"><br></font></div><div><blockquote type="cite"><span \
class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; \
font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: \
normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; \
text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; \
-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; \
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; \
-webkit-text-stroke-width: 0px; font-size: medium; "><div style="font-family: Arial, \
Verdana, sans-serif !important; font-size: 12px; padding-top: 5px; padding-right: \
5px; padding-bottom: 5px; padding-left: 5px; margin-top: 0px; margin-right: 0px; \
margin-bottom: 0px; margin-left: 0px; border-top-style: none; border-right-style: \
none; border-bottom-style: none; border-left-style: none; background-color: rgb(255, \
255, 255); position: static; z-index: auto; "><div style="margin-top: 0px; \
margin-bottom: 0px; ">Kind regards,<br>--<span \
class="Apple-converted-space">&nbsp;</span><br>i. A. Andreas Luik<br>in - innovative \
navigation GmbH<br>phone: +49 7154 807171<br>fax: +49 7154 807154<br>email:<span \
class="Apple-converted-space">&nbsp;</span><a \
href="mailto:Andreas.Luik@innovative-navigation.de" \
onclick="parent.eventReadmailClickEmail(false,this,'click');return \
false;">Andreas.Luik@innovative-navigation.de</a><br><br>in - innovative navigation \
GmbH, Leibnizstrasse 11, D-70806 Kornwestheim<br>Geschäftsführer/Managing \
Directors:<br>Dr. Thomas Gern, Dr. Martin Sandler, Dr. Reinhard Zimmermann, Uwe \
Vögele<br>Handelsregister: Stuttgart HRB 205770<br><br>in - innovative navigation \
GmbH is ISO 9001:2008 \
certified.&nbsp;</div></div></span></blockquote></div><br></body></html>


______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
User Communication List                             rpm-users@rpm5.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic