[NOT A SOLUTION] Fwd: automatically modifying scriptlets (included files) at package build time

Eddy Petrișor eddy.petrisor at gmail.com
Tue Mar 18 14:33:36 UTC 2008


On 18/03/2008, Ralf Corsepius <rc040203 at freenet.de> wrote:
>
>  On Tue, 2008-03-18 at 15:34 +0200, Eddy Petrișor wrote:
>  > Hello,
>  >
>  > I just want to let you know I discovered the solution to my problem.
>  >
>  >
>  > Is as simple as adding something after the %setup command in the %prep section:
>  >
>  > Index: SPECS/common.spec
>  > ===================================================================
>  > --- SPECS/common.spec   (revision 2033)
>  > +++ SPECS/common.spec   (revision 2034)
>  > @@ -29,6 +29,9 @@
>  >
>  >  %prep
>  >  %setup -n common
>  > +. common.inf && export THISVER="`echo "$VERS.$SUBVERS.$RELEASE" | tr -s '.'`"
>  > +sed -i "s#^THISVER=.*#THISVER=$THISVER#" %{SOURCE101}
>  > +sed -i "s#^THISVER=.*#THISVER=$THISVER#" %{SOURCE102}
>
> This way you are modifying your sources-files.
>
>  This is bad for 2 closely related reasons:

Make that 3. It doesn't work.

>  - Sources should be considered read-only in general.
>  - This is likely to break on "repeated runs": A previous run modified
>  your sources in such a way, your next rpmbuild run is not unlikely to
>  fail.

No, since the file I am sourcing is never changed during the build process.

>  You will want to work on copies of your SOURCEX's instead of SOURCEX
>  directly.

I will dig into this, since I really dislike having outside scripts doing this.

-- 
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein




More information about the devel mailing list