Re: getting the version of a package in the rules file.
Charles Plessy <email@example.com> writes:
> When ran in the shell or in a $$() construct,
> dpkg-parsechangelog | grep Ver | perl -ne '/\s(.*?)\-/ ; print $1'
> gives me the upstream version number of my package.
> Howerver, the following expression does not work as expected in
> VERSION=$(shell (dpkg-parsechangelog | grep Ver | perl -ne '/\s(.*?)\-/ ; print $1'))
> Apparently, the perl oneliner returns the whole string. Is there a
> cleaner method to get the upstream version number in debian/rules ?
version := $(shell dpkg-parsechangelog | grep ^Version: \
| cut -d' ' -f2 | cut -d- -f1)
I'm guessing the problem with the Perl one-liner is that you need to
double the $ in $1 since you're inside make.
Russ Allbery (firstname.lastname@example.org) <http://www.eyrie.org/~eagle/>