Skip to content
  • Thomas Petazzoni's avatar
    package/pkg-generic.mk: really make DL_SUBDIR inheritance work · a1c4d6c8
    Thomas Petazzoni authored and Yann E. MORIN's avatar Yann E. MORIN committed
    While bumping kodi, we figured out that the kodi-texturepacker and
    kodi-jsonschemabuilder were both re-downloading the main Kodi tarball,
    even though they contain:
    
    KODI_JSONSCHEMABUILDER_DL_SUBDIR = kodi
    KODI_TEXTUREPACKER_DL_SUBDIR = kodi
    
    Both are host packages, and turns out that changing those variables to
    HOST_ ones made the download sharing work.
    
    Commit efa7712b
    
     ("package/pkg-generic:
    host variant inherits target download settings") introduced
    inheritance of host variables from target variables from a number of
    variables, including DL_SUBDIR. But it missed the fact that earlier in
    pkg-generic.mk, the following line was defined:
    
      $(2)_DL_SUBDIR ?= $$($(2)_RAWNAME)
    
    So, when this later code kicked in:
    
     ifndef $(2)_DL_SUBDIR
      ifdef $(3)_DL_SUBDIR
       $(2)_DL_SUBDIR = $$($(3)_DL_SUBDIR)
      endif
     endif
    
    In fact it never did anything because $(2)_DL_SUBDIR would never be
    undefined. This commit fixes this issue by properly adjusting the
    logic to inherit the value of the target variable when it exists, or
    defaulting to $$($(2)_RAWNAME) otherwise.
    
    Cc: Yann E. MORIN <yann.morin.1998@free.fr>
    Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
    Signed-off-by: default avatarYann E. MORIN <yann.morin.1998@free.fr>
    a1c4d6c8