Browse Source

add direct dependencies

main
Nicolas Massé 2 weeks ago
parent
commit
0f9d7a932d
  1. 3
      scripts/common.mk
  2. 15
      scripts/generate-tarball.sh

3
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_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_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 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 &: build/$(PROJECT_NAME).tar.gz build/$(PROJECT_NAME).bu build/$(PROJECT_NAME)-examples.bu &:
@if [ -z "$(TARGET_CHROOT)" ]; then \ @if [ -z "$(TARGET_CHROOT)" ]; then \
echo "TARGET_CHROOT is not set!"; exit 1; \ 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 fi
@run() { echo $$*; "$$@"; }; \ @run() { echo $$*; "$$@"; }; \
run mkdir -p build; \ 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; \ set -Eeuo pipefail; \
if [ build/$(PROJECT_NAME).bu -ot "$(BUTANE_START_TS)" ] || [ build/$(PROJECT_NAME)-examples.bu -ot "$(BUTANE_START_TS)" ]; then \ 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 \ for dep in base $(DEPENDENCIES); do \

15
scripts/generate-tarball.sh

@ -9,7 +9,8 @@
# The tool takes its parameters from the environment variables defined in the Makefile: # The tool takes its parameters from the environment variables defined in the Makefile:
# #
# - PROJECT_NAME: the name of the project. # - 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. # - 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 # - 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 # (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 <<EOF > "$metadata_file" cat <<EOF > "$metadata_file"
name: $PROJECT_NAME name: $PROJECT_NAME
EOF EOF
if [ -n "${ALL_DEPS}" ]; then if [ -n "${ALL_DEPENDENCIES}" ]; then
echo "dependencies:" >> "$metadata_file" echo "dependencies:" >> "$metadata_file"
for dep in ${ALL_DEPS}; for dep in ${ALL_DEPENDENCIES};
do echo "- $dep" do echo "- $dep"
done >> "$metadata_file" done >> "$metadata_file"
else else
echo "dependencies: []" >> "$metadata_file" echo "dependencies: []" >> "$metadata_file"
fi 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 if [ "${#files_to_include[@]}" -gt 0 ]; then
echo "files:" >> "$metadata_file" echo "files:" >> "$metadata_file"
for file in "${files_to_include[@]}"; do for file in "${files_to_include[@]}"; do

Loading…
Cancel
Save