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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
- 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.

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

Ralf



-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux