On Fri, 29 Oct 2004 [EMAIL PROTECTED] wrote:

> How to use variables in postinst scripts?
> 
> Currently, I use a variable for the upstream version with these lines in
> debian/rules:
> 
>       [...]
>       # Get the upstream version from the changelog.
>       upstream := $(shell head -1 debian/changelog | sed
> 's/^.*(\(.*\)-.*).*$$/\1/')
>       [...]
>       install -o root -g root -m 755 unison
> $(CURDIR)/debian/unison/usr/bin/unison-$(upstream)
>       [...]
> 
> But I can't use it in postinst:
> 
>       [...]
>       update-alternatives \
>               --install /usr/bin/unison unison /usr/bin/unison-2.10.2 128
>       [...]
> 
> Must I regexp postinst manually, or is there some magic for this?
> 
> debian/control contains ${Source-Version}, which gets replaced, but I haven't
> figured out which part of the build system is responsible, or if it could be
> used on postinst.

A package I maintain does what you call "regexp postinst manually".
As it was simple, effective, and worked well enough, I didn't see the
need to find a "better" solution.

Reply via email to