make, scripts: Flip some more switches from pathon 2 to 3 (untested!)

This commit flips some more switches from Python 2 to Python 3 in makefiles and
Python code. Build runs through, but it's still likely to break things.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-06-02 12:28:13 +00:00
commit 13fa28e23f
6 changed files with 27 additions and 17 deletions

View file

@ -17,7 +17,7 @@
-include local.mk
SHELL = /bin/bash -o pipefail
SHELL = /bin/bash -o pipefail +H
PROJECTS_TXT ?= projects.txt
JW_BUILD_VERBOSE ?= false
BASE_PKGS = git cvs make sudo time time xdg-utils
@ -97,6 +97,11 @@ ifneq ($(EXCLUDE_FROM_BUILD),)
PROJECTS_PY_EXTRA_BUILD_OPTS += --exclude "$(EXCLUDE_FROM_BUILD)"
endif
# non-interactive mode
ifeq ($(shell echo $$PS1),)
DASH_Y := -y
endif
# ------------ external programs II
BROWSER ?= xdg-open
@ -104,7 +109,7 @@ EDITOR ?= xdg-open
ifeq ($(TIME),)
TIME = $(shell which time) -p
endif
PROJECTS_PY = python2 $(MOD_SCRIPT_DIR)/projects.py --prefix $(shell pwd) $(PROJECTS_PY_EXTRA_OPTS)
PROJECTS_PY = python3 $(MOD_SCRIPT_DIR)/projects.py --prefix $(shell pwd) $(PROJECTS_PY_EXTRA_OPTS)
PROJECTS_PY_BUILD = $(PROJECTS_PY) build $(PROJECTS_PY_EXTRA_BUILD_OPTS)
PGIT_SH = /bin/bash $(MOD_SCRIPT_DIR)/pgit.sh
PURGE_SH = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/purge-stale-projects.sh /opt/jw-build/bin/purge-stale-projects.sh) purge-not-found)
@ -205,15 +210,14 @@ cloc:
cloc --exclude-list-file=cloc-ignore.txt $(BUILD_PROJECTS)
# --- package-related targets
pkg-manager-refresh:
$(PKG_MANAGER_SH) refresh -y
$(PKG_MANAGER_SH) refresh $(DASH_Y)
pkg-install-prereq-build:
$(PKG_MANAGER_SH) install -y $(BASE_PKGS) $(shell $(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS))
$(PKG_MANAGER_SH) install $(DASH_Y) $(BASE_PKGS) $(shell $(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS))
pkg-install-prereq-release:
$(PKG_MANAGER_SH) install -y $(BASE_PKGS) $(shell $(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS))
$(PKG_MANAGER_SH) install $(DASH_Y) $(BASE_PKGS) $(shell $(PROJECTS_PY) requires-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS))
pkg-exclude-built-today:
touch $(EXCLUDES_FILE)