From 0f9d7a932da97797b741db36c9f7baf4e0c870a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Thu, 11 Jun 2026 13:27:08 +0000 Subject: [PATCH] add direct dependencies --- scripts/common.mk | 3 ++- scripts/generate-tarball.sh | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/common.mk b/scripts/common.mk index 4cbf0ad..185e2e5 100644 --- a/scripts/common.mk +++ b/scripts/common.mk @@ -372,6 +372,7 @@ build/$(PROJECT_NAME).tar.gz build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-exam build/$(PROJECT_NAME).tar.gz build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-examples.bu: export SYSTEMD_ENABLE_UNITS := $(SYSTEMD_ENABLE_UNITS) build/$(PROJECT_NAME).tar.gz build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-examples.bu: export SYSTEMD_START_UNITS := $(SYSTEMD_START_UNITS) build/$(PROJECT_NAME).tar.gz build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-examples.bu: export SYSTEMD_TIMER_NAMES := $(SYSTEMD_TIMER_NAMES) +build/$(PROJECT_NAME).tar.gz build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-examples.bu: export DIRECT_DEPENDENCIES := $(DEPENDENCIES) build/$(PROJECT_NAME).tar.gz build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-examples.bu &: @if [ -z "$(TARGET_CHROOT)" ]; then \ echo "TARGET_CHROOT is not set!"; exit 1; \ @@ -384,7 +385,7 @@ build/$(PROJECT_NAME).tar.gz build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-exam fi @run() { echo $$*; "$$@"; }; \ run mkdir -p build; \ - export ALL_DEPS="$(shell $(MAKE) -s list-dependencies 2>/dev/null)"; \ + export ALL_DEPENDENCIES="$(shell $(MAKE) -s list-dependencies 2>/dev/null)"; \ set -Eeuo pipefail; \ if [ build/$(PROJECT_NAME).bu -ot "$(BUTANE_START_TS)" ] || [ build/$(PROJECT_NAME)-examples.bu -ot "$(BUTANE_START_TS)" ]; then \ for dep in base $(DEPENDENCIES); do \ diff --git a/scripts/generate-tarball.sh b/scripts/generate-tarball.sh index 29d18f0..6f51994 100755 --- a/scripts/generate-tarball.sh +++ b/scripts/generate-tarball.sh @@ -9,7 +9,8 @@ # The tool takes its parameters from the environment variables defined in the Makefile: # # - PROJECT_NAME: the name of the project. -# - ALL_DEPS: the list of all (direct and transitive) dependencies of the project. +# - ALL_DEPENDENCIES: the list of all (direct and transitive) dependencies of the project. +# - DIRECT_DEPENDENCIES: the list of all direct dependencies of the project. # - TARGET_CHROOT: the target chroot directory containing the files to be included in the tarball. # - BUTANE_BLOCKLIST: the path to a file containing a list of files and directories (one per line) to ignore # (i.e., files and directories that are already part of the CoreOS default installation @@ -52,14 +53,22 @@ metadata_file="$tmp_dir/metadata.yaml" cat < "$metadata_file" name: $PROJECT_NAME EOF -if [ -n "${ALL_DEPS}" ]; then +if [ -n "${ALL_DEPENDENCIES}" ]; then echo "dependencies:" >> "$metadata_file" - for dep in ${ALL_DEPS}; + for dep in ${ALL_DEPENDENCIES}; do echo "- $dep" done >> "$metadata_file" else echo "dependencies: []" >> "$metadata_file" fi +if [ -n "${DIRECT_DEPENDENCIES}" ]; then + echo "direct_dependencies:" >> "$metadata_file" + for dep in ${DIRECT_DEPENDENCIES}; + do echo "- $dep" + done >> "$metadata_file" +else + echo "direct_dependencies: []" >> "$metadata_file" +fi if [ "${#files_to_include[@]}" -gt 0 ]; then echo "files:" >> "$metadata_file" for file in "${files_to_include[@]}"; do