diff mbox series

[2/8] pkg-generic: introduce _DL_SUBDIR

Message ID 20180402145802.17611-2-maxime.hadjinlian@gmail.com
State Accepted
Commit ddf3feb1047da7e728f89329f2eed6529bcf8636
Headers show
Series None | expand

Commit Message

Maxime Hadjinlian April 2, 2018, 2:57 p.m. UTC
This per package variable can be used to specify the download
subdirectory used by that package.

The use case here is for example linux-headers and linux, which share
the same sources (because they are the same upstream project), so we
don't want to download twice the kernel, nor store it multiple times
either.

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
v4 -> v5:
    - Change SAME_SOURCE_AS into DL_SUBDIR (Thomas Petazzonni)
---
 package/pkg-generic.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Peter Korsgaard April 2, 2018, 3:45 p.m. UTC | #1
>>>>> "Maxime" == Maxime Hadjinlian <maxime.hadjinlian@gmail.com> writes:

 > This per package variable can be used to specify the download
 > subdirectory used by that package.

 > The use case here is for example linux-headers and linux, which share
 > the same sources (because they are the same upstream project), so we
 > don't want to download twice the kernel, nor store it multiple times
 > either.

 > Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
 > Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > ---
 > v4 -> v5:
 >     - Change SAME_SOURCE_AS into DL_SUBDIR (Thomas Petazzonni)

Committed, thanks.
diff mbox series

Patch

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 20ee73d438..3c6a1839ff 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -432,7 +432,8 @@  endif
 
 $(2)_BASENAME	= $$(if $$($(2)_VERSION),$(1)-$$($(2)_VERSION),$(1))
 $(2)_BASENAME_RAW = $$(if $$($(2)_VERSION),$$($(2)_RAWNAME)-$$($(2)_VERSION),$$($(2)_RAWNAME))
-$(2)_DL_DIR 	=  $$(DL_DIR)/$$($(2)_RAWNAME)
+$(2)_DL_SUBDIR ?= $$($(2)_RAWNAME)
+$(2)_DL_DIR = $$(DL_DIR)/$$($(2)_DL_SUBDIR)
 $(2)_DIR	=  $$(BUILD_DIR)/$$($(2)_BASENAME)
 
 ifndef $(2)_SUBDIR