View | Details | Raw Unified | Return to bug 44561
Collapse All | Expand All

(-)a/image.in/functions.mk (-18 / +41 lines)
Lines 12-39 ARCH ?= $(shell arch | sed 's/i686/i586/; s/armv.*/arm/') Link Here
12
DATE ?= $(shell date +%Y%m%d)
12
DATE ?= $(shell date +%Y%m%d)
13
13
14
# prefix pkglist name with its directory to form a path (relative/absolute)
14
# prefix pkglist name with its directory to form a path (relative/absolute)
15
rlist = $(1:%=lists/%)
15
define rlist
16
list  = $(addprefix $(PKGDIR)/,$(call rlist,$(1)))
16
$(if $(filter rlist,$(0)),$(1:%=lists/%))
17
endef
18
19
define list
20
$(if $(filter list,$(0)),$(addprefix $(PKGDIR)/,$(call rlist,$(1))))
21
endef
17
22
18
# prefix/suffix group name to form a path (relative/absolute)
23
# prefix/suffix group name to form a path (relative/absolute)
19
rgroup = $(1:%=groups/%.directory)
24
define rgroup
20
group  = $(addprefix $(PKGDIR)/,$(call rgroup,$(1)))
25
$(if $(filter rgroup,$(0)),$(1:%=groups/%.directory))
26
endef
27
28
define group
29
$(if $(filter group,$(0)),$(addprefix $(PKGDIR)/,$(call rgroup,$(1))))
30
endef
21
31
22
# prefix/suffix pkg profile name to form a path (relative/absolute)
32
# prefix/suffix pkg profile name to form a path (relative/absolute)
23
rprofile = $(1:%=profiles/%.directory)
33
define rprofile
24
profile  = $(addprefix $(PKGDIR)/,$(call rprofile,$(1)))
34
$(if $(filter rprofile,$(0)),$(1:%=profiles/%.directory))
35
endef
36
37
define profile
38
$(if $(filter profile,$(0)),$(addprefix $(PKGDIR)/,$(call rprofile,$(1))))
39
endef
25
40
26
# map first argument (a function) onto second one (an argument list)
41
# map first argument (a function) onto second one (an argument list)
27
map = $(foreach a,$(2),$(call $(1),$(a)))
42
define map
43
$(if $(filter map,$(0)),$(foreach a,$(2),$(call $(1),$(a))))
44
endef
28
45
29
# happens at least twice, and variables are the same by design
46
# happens at least twice, and variables are the same by design
30
groups2lists = $(shell $(groups2lists_body))
47
define groups2lists
31
define groups2lists_body
48
$(if $(filter groups2lists,$(0)),$(shell \
32
{ if [ -n "$(THE_GROUPS)$(MAIN_GROUPS)" ]; then \
49
	  if [ -n "$(THE_GROUPS)$(MAIN_GROUPS)" ]; then \
33
	  sed -rn 's,^X-Alterator-PackageList=(.*)$$,\1,p' \
50
	    sed -rn 's,^X-Alterator-PackageList=(.*)$$,\1,p' \
34
		$(call map,group,$(THE_GROUPS) $(MAIN_GROUPS)) | \
51
	    $(call map,group,$(THE_GROUPS) $(MAIN_GROUPS)) | \
35
		sed 's/;/\n/g'; \
52
	    sed 's/;/\n/g'; \
36
fi; }
53
	  fi; \
54
))
37
endef
55
endef
38
56
39
# kernel package list generation; see also #24669
57
# kernel package list generation; see also #24669
Lines 41-55 NULL := Link Here
41
SPACE := $(NULL) # the officially documented way of getting a space
59
SPACE := $(NULL) # the officially documented way of getting a space
42
COMMA := ,
60
COMMA := ,
43
61
44
list2re = $(subst $(SPACE),|,$(strip $(1)))
62
define list2re
63
$(if $(filter list2re,$(0)),$(subst $(SPACE),|,$(strip $(1))))
64
endef
45
65
46
# args: KFLAVOURS, KMODULES
66
# args: KFLAVOURS, KMODULES
47
# NB: $(2) could be empty
67
# NB: $(2) could be empty
48
kpackages = $(and $(1), \
68
define kpackages
69
$(if $(filter kpackages,$(0)),$(and $(1), \
49
	^kernel-(image|modules-($(call list2re,$(2))))-($(call list2re,$(1)))$$)
70
	^kernel-(image|modules-($(call list2re,$(2))))-($(call list2re,$(1)))$$)
71
endef
50
72
51
# arg: branding subpackages
73
# arg: branding subpackages
52
branding = $(and $(1),^branding-$(BRANDING)-($(call list2re,$(1)))$$)
74
define branding
75
$(if $(filter branding,$(0)),$(and $(1),^branding-$(BRANDING)-($(call list2re,$(1)))$$))
76
endef
53
77
54
endif
78
endif
55
endif
79
endif
56
- 

Return to bug 44561