1a525c89fb
This is a workaround for presumably alterator-pkg's misbehaviour given a pkglist with a line ending with a space character; my particular case grew from @E2K suffix resulting in "%name@e2k %name@e2kv4" which, in its turn, became "%name " in e2k-arch build. Installer complained about being unable to install in selected configuration with /tmp/install2.log "clarifying" the problem to be %name being unavailable (while %name package was there in both RPMS.main and metadata)... not obvious at all! So while downstream should be hardened either, let's do what we can do here.
61 lines
1.6 KiB
Makefile
61 lines
1.6 KiB
Makefile
# step 3: copy package lists referenced in distro configuration
|
|
# (and only those!) over to $(BUILDDIR)
|
|
|
|
ifndef BUILDDIR
|
|
|
|
pkgdups:
|
|
@find -type f ! -name README ! -name Makefile \
|
|
| grep -v '~$$' \
|
|
| sed 's,^\./,,g' \
|
|
| xargs ../../bin/pkgdups
|
|
|
|
%:
|
|
$(error BUILDDIR not defined)
|
|
|
|
else
|
|
|
|
include $(BUILDDIR)/distcfg.mk
|
|
include $(BUILDDIR)/functions.mk
|
|
|
|
SUFFIX := pkg/lists
|
|
TARGET := $(BUILDDIR)/$(SUFFIX)
|
|
|
|
all: | $(TARGET) $(GLOBAL_DEBUG) copy-lists copy-groups grep-archdep
|
|
@mp-commit "$(TARGET)" "requested $(SUFFIX) copied over"
|
|
|
|
# env | sort -u | grep _LISTS | xargs -r cp -t
|
|
copy-lists:
|
|
@echo $(foreach V, \
|
|
$(filter %_LISTS,$(sort $(.VARIABLES))), \
|
|
$(if $(filter environment% file,$(origin $V)),$($V))) \
|
|
| xargs -r -- cp --parents -at $(TARGET) --
|
|
|
|
copy-groups: PKGDIR = ..
|
|
copy-groups:
|
|
@echo $(call groups2lists) \
|
|
| xargs -r -- cp --parents -at $(TARGET) --
|
|
|
|
grep-archdep: a = $(ARCH)
|
|
grep-archdep:
|
|
@# xargs -L 1024 -n 1024 ? -- breaks -I
|
|
@find $(TARGET) -type f \
|
|
| xargs -I '__' sh -c '\
|
|
sed -ri "s/\\<([^@ ]*)@X86\\>/\\1@i586 \\1@x86_64/g" __; \
|
|
sed -ri "s/\\<([^@ ]*)@IA32\\>/\\1@i586 i586-\\1@x86_64/g" __;\
|
|
sed -rni "s/\\<([^@ ]*)\\>|\\<([^@ ]*)@$a\\>/\\1\\2/pg" __; \
|
|
sed -ri "s/\\<([^@ ]*)@[^@ ]+\\> *//g" __; \
|
|
sed -ri "s/^ +//;s/ +$$//" __'
|
|
|
|
# do beforehand as foreach gets expanded before recipe execution
|
|
$(TARGET):
|
|
@mkdir -p $(TARGET)
|
|
|
|
# figure out *_LISTS variables and print them out nicely
|
|
debug:
|
|
@echo -e $(foreach V, \
|
|
$(filter %_LISTS,$(sort $(.VARIABLES))), \
|
|
$(if $(filter environment% file,$(origin $V)),\
|
|
$(shell echo '\\n"**"' $V: $($V)))) '\n'
|
|
|
|
endif
|