Skip to content

Commit

Permalink
WIP Make check-release-status script work for templates too
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Jun 4, 2018
1 parent 295c827 commit f9a265a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand All @@ -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
Expand Down
27 changes: 20 additions & 7 deletions scripts/check-release-status-for-component
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
}

Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit f9a265a

Please sign in to comment.