Browse Source

deduplicate local.ign along with the other ignition files

default-butane-spec.sh appended "local.ign" to the merge list outside of
the duplicate detection. An empty local.bu (as written by packaging
scripts) compiles to the same content as an empty "-examples" ignition
file, and butane rejects the duplicate entry: "make package" failed on
base/build/fcos-dev.ign since the coreos split.

local.ign is now passed as the last argument, so it keeps its place at
the end of the merge list and is skipped when its content duplicates a
previous file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KuHAbQsFqabSuCuzQ1PrRK
main
Nicolas Massé 2 weeks ago
parent
commit
e6ece70620
  1. 4
      scripts/common.mk
  2. 7
      scripts/default-butane-spec.sh

4
scripts/common.mk

@ -495,8 +495,8 @@ build/fcos-dev.bu: SELF := $(PROJECT_NAME) $(PROJECT_NAME)-examples
# The ignition files are needed to detect duplicates (see default-butane-spec.sh). # The ignition files are needed to detect duplicates (see default-butane-spec.sh).
build/fcos-dev.bu: build/$(PROJECT_NAME).ign build/$(PROJECT_NAME)-examples.ign $(DEPENDENCIES_IGNITION_EXAMPLES_FILES) build/fcos-dev.bu: build/$(PROJECT_NAME).ign build/$(PROJECT_NAME)-examples.ign $(DEPENDENCIES_IGNITION_EXAMPLES_FILES)
build/fcos-test.bu: build/$(PROJECT_NAME).ign $(DEPENDENCIES_IGNITION_FILES) build/fcos-test.bu: build/$(PROJECT_NAME).ign $(DEPENDENCIES_IGNITION_FILES)
build/fcos-dev.bu build/fcos-test.bu: %.bu: Makefile $(SCRIPTS_DIR)/default-butane-spec.sh build build/fcos-dev.bu build/fcos-test.bu: %.bu: Makefile $(SCRIPTS_DIR)/default-butane-spec.sh build $(TOP_LEVEL_DIR)/build/local.ign
$(SCRIPTS_DIR)/default-butane-spec.sh $(foreach name,$(SELF) $(DEPS),$(call ignition_path,$(name))) > $@ $(SCRIPTS_DIR)/default-butane-spec.sh $(foreach name,$(SELF) $(DEPS),$(call ignition_path,$(name))) $(TOP_LEVEL_DIR)/build/local.ign > $@
# Path of the ignition file of the current project or of one of its dependencies (with or without the "-examples" suffix). # Path of the ignition file of the current project or of one of its dependencies (with or without the "-examples" suffix).
ignition_path = $(if $(filter $(PROJECT_NAME) $(PROJECT_NAME)-examples,$(1)),build/$(1).ign,$(COOKBOOKS_DIR)/$(patsubst %-examples,%,$(1))/build/$(1).ign) ignition_path = $(if $(filter $(PROJECT_NAME) $(PROJECT_NAME)-examples,$(1)),build/$(1).ign,$(COOKBOOKS_DIR)/$(patsubst %-examples,%,$(1))/build/$(1).ign)

7
scripts/default-butane-spec.sh

@ -2,12 +2,12 @@
set -Eeuo pipefail set -Eeuo pipefail
# Usage: default-butane-spec.sh <ignition file>... # Usage: default-butane-spec.sh <ignition file>... <local.ign>
# #
# Butane inlines the "local" files as data URLs and rejects duplicate entries. # Butane inlines the "local" files as data URLs and rejects duplicate entries.
# So, ignition files whose content is identical to a previous one (typically # So, ignition files whose content is identical to a previous one (typically
# the empty "-examples" ignition files) are skipped. Merging the same config # the empty "-examples" ignition files, or an empty local.ign) are skipped.
# twice would be a no-op anyway. # Merging the same config twice would be a no-op anyway.
cat <<'EOF' cat <<'EOF'
variant: fcos variant: fcos
@ -26,4 +26,3 @@ for ign in "$@"; do
seen[$checksum]="$(basename "$ign")" seen[$checksum]="$(basename "$ign")"
echo " - local: $(basename "$ign")" echo " - local: $(basename "$ign")"
done done
echo " - local: local.ign"

Loading…
Cancel
Save