From f9a265a3fb2b7ec568b744e7c9bc37069a6b2b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 28 May 2018 01:38:15 +0200 Subject: [PATCH] WIP Make check-release-status script work for templates too QubesOS/qubes-issues#3935 --- Makefile | 21 +++++++++++++---- scripts/check-release-status-for-component | 27 ++++++++++++++++------ 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index ea9de5586..5a3a6ec65 100644 --- a/Makefile +++ b/Makefile @@ -825,16 +825,29 @@ template-name: check-release-status: $(DISTS_VM_NO_FLAVOR:%=check-release-status-vm-%) ifneq (,$(DIST_DOM0)) -check-release-status: check-release-status-dom0-$(DIST_DOM0) +check-release-status: check-release-status-dom0-$(DIST_DOM0) check-release-status-templates @true endif +check-release-status-templates: + @echo "-> Checking $(c.bold)templates$(c.normal)" + for DIST in $(DISTS_VM); do \ + if ! [ -e $(SRC_DIR)/linux-template-builder/Makefile.builder ]; then \ + # Old style components not supported + continue; \ + fi; \ + TEMPLATE_NAME=$$(DISTS_VM=$$DIST make -s template-name); \ + echo -n "$$TEMPLATE_NAME: "; \ + $(BUILDER_DIR)/scripts/check-release-status-for-component --color \ + "linux-template-builder" "vm" "$$DIST" + done + check-release-status-%: PACKAGE_SET = $(word 1, $(subst -, ,$*)) -check-release-status-%: DIST = $(word 2, $(subst -, ,$*)) +check-release-status-%: DIST = $(subst $(null) $(null),-,$(wordlist 2, 10, $(subst -, ,$*))) check-release-status-%: MAKE_ARGS = PACKAGE_SET=$(PACKAGE_SET) DIST=$(DIST) COMPONENT=$$C check-release-status-%: @echo "-> Checking packages for $(c.bold)$(DIST) $(PACKAGE_SET)$(c.normal)" - for C in $(COMPONENTS_NO_BUILDER); do \ + for C in $(COMPONENTS_NO_TPL_BUILDER); do \ if ! [ -e $(SRC_DIR)/$$C/Makefile.builder ]; then \ # Old style components not supported continue; \ @@ -848,7 +861,7 @@ check-release-status-%: fi echo -n "$$C: "; \ $(BUILDER_DIR)/scripts/check-release-status-for-component --color "$$C" "$(PACKAGE_SET)" "$(DIST)" - done; \ + done windows-image: ./win-mksrcimg.sh diff --git a/scripts/check-release-status-for-component b/scripts/check-release-status-for-component index 5697f599d..1ecbd5c33 100755 --- a/scripts/check-release-status-for-component +++ b/scripts/check-release-status-for-component @@ -35,20 +35,23 @@ COMPONENT="$1" PACKAGE_SET="$2" DIST="$3" +ALL_REPOSITORIES="current current-testing security-testing unstable" +UPDATE_REPO_SUBDIR="${PACKAGE_SET}/${DIST}" + # # import required builder.conf settings if not already present # cd "$(dirname $0)/.." -repo_dist_basedir=$(make -s get-var GET_VAR=LINUX_REPO_${DIST}_BASEDIR) +repo_dist_basedir=$(make -s get-var GET_VAR=LINUX_REPO_${DIST%%+*}_BASEDIR) if [ -n "${repo_dist_basedir}" ]; then repo_basedir="${repo_dist_basedir}" else repo_basedir=$(make -s get-var GET_VAR=LINUX_REPO_BASEDIR) fi -for var in TESTING_DAYS SRC_DIR BUILDER_PLUGINS BUILDER_PLUGINS_${DIST}; do +for var in TESTING_DAYS SRC_DIR BUILDER_PLUGINS BUILDER_PLUGINS_${DIST%%+*}; do if [ -n "${!var}" ]; then continue fi @@ -68,11 +71,12 @@ color() { fi case "$1" in current) tput setaf 2 || tput AF 2 ;; # green - current-testing) tput setaf 3 || tput AF 3 ;; # yellow - security-testing) tput setaf 3 || tput AF 3 ;; # yellow + *-testing) tput setaf 3 || tput AF 3 ;; # yellow unstable) tput setaf 4 || tput AF 4 ;; # blue unreleased) tput setaf 1 || tput AF 1 ;; # red built,unreleased) tput setaf 7 || tput AF 7 ;; # white + templates-itl) tput setaf 2 || tput AF 2 ;; # green + templates-community) tput setaf 2 || tput AF 2 ;; # green days-testing) tput setaf 3 || tput AF 3 ;; # yellow days-stable) tput setaf 2 || tput AF 2 ;; # green no-version) @@ -90,16 +94,25 @@ reset_color() { tput sgr0 || tput me } +# a little more settings needed for templates +if [ "$COMPONENT" = "linux-template-builder" ]; then + TEMPLATE_NAME=$(MAKEFLAGS= MFLAGS= DISTS_VM=$DIST \ + make -s template-name) + export TEMPLATE_NAME DIST + UPDATE_REPO_SUBDIR="" + ALL_REPOSITORIES="templates-itl templates-itl-testing templates-community templates-community-testing" +fi + MAKE_ARGS=("PACKAGE_SET=${PACKAGE_SET}" "DIST=${DIST}" "COMPONENT=${COMPONENT}") if [ -z "$BUILDER_DIR" ]; then # if called from outside of main Makefile, need to load builder.conf - MAKE_ARGS+=("--eval=include ${BUILDERCONF:-builder.conf}") + MAKE_ARGS+=("--eval=include ${BUILDERCONF:-${PWD}/builder.conf}") fi check_single_repo() { make -s -f Makefile.generic "${MAKE_ARGS[@]}" \ - UPDATE_REPO=${PWD}/${repo_basedir}/$1/${PACKAGE_SET}/${DIST} \ + UPDATE_REPO=${PWD}/${repo_basedir}/$1/${UPDATE_REPO_SUBDIR} \ check-repo >/dev/null 2>&1 } @@ -132,7 +145,7 @@ else fi found=0 -for repo in current current-testing security-testing unstable; do +for repo in $ALL_REPOSITORIES; do if check_single_repo $repo; then echo -n "$(color ${repo})${repo}$(reset_color)" snap_file="${PWD}/repo-latest-snapshot/${repo}-${PACKAGE_SET}-${DIST}-${COMPONENT}"