package: fix <pkg>_DL_VERSION value

993e51bc22 introduced a <pkg>_DL_VERSION
in addition to <pkg>_VERSION. This variable, purely internal to the
package infrastructure, allows to store the *raw* version name, as
defined in the package .mk file. However, as this version string can
contain slashes, it is not appropriate to be part of the build
directory name of the package. This is why <pkg>_VERSION is defined to
be the same thing as <pkg>_DL_VERSION, except that slashes are
replaced by underscores.

However, the initial implementation didn't take into account the case
of host packages. So 763822e874 was
committed to fix this. But unfortunately, this commit got it wrong
again: it forgot the case where <pkg>_VERSION is set, but not
HOST_<pkg>_VERSION. In this case, HOST_<pkg>_DL_VERSION remained
empty. This can be seen for example by building host-sstrip.

This problem has been noticed by Julien Boibessot
<julien.boibessot@free.fr>, who also helped in fixing the
issue. Thanks!

The fix is simply to ensure that <pkg>_DL_VERSION is properly set in
all cases: when HOST_<pkg>_VERSION is defined, when only <pkg>_VERSION
is defined, and when no version is defined.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
Thomas Petazzoni 2011-08-04 21:34:24 +02:00 committed by Peter Korsgaard
parent b0d0e06077
commit f940d7602c

View File

@ -366,15 +366,17 @@ $(2)_NAME = $(1)
# sanitize the package version that is used in paths, directory and file names.
# Forward slashes may appear in the package's version when pointing to a
# version control system branch or tag, for example remotes/origin/1_10_stable.
$(2)_DL_VERSION = $($(2)_VERSION)
ifndef $(2)_VERSION
ifdef $(3)_VERSION
$(2)_VERSION = $($(3)_VERSION)
$(2)_DL_VERSION = $($(3)_VERSION)
$(2)_VERSION = $(subst /,_,$($(3)_VERSION))
else
$(2)_VERSION = undefined
$(2)_DL_VERSION = undefined
endif
else
$(2)_VERSION = $(subst /,_,$($(2)_VERSION))
$(2)_DL_VERSION = $($(2)_VERSION)
$(2)_VERSION = $(subst /,_,$($(2)_VERSION))
endif
$(2)_BASE_NAME = $(1)-$$($(2)_VERSION)