[VOL-5032] - Build and deploy voltha-system-tests for v2.12
VERSION
=======
o Bump version string to initiate a triage build for release.
makefiles/
==========
o https://github.com/opencord/onf-make
o Update to the latest version of onf-make library makefiles
to enable additional linting targets.
Change-Id: I4cdc959d616174573014bd6343825492b01e456b
diff --git a/makefiles/patches/README.md b/makefiles/patches/README.md
new file mode 100644
index 0000000..56455c1
--- /dev/null
+++ b/makefiles/patches/README.md
@@ -0,0 +1,21 @@
+# Howto create a python 3.10+ patch
+
+1) Checkout voltha-docs
+2) cd voltha-docs
+3) make venv
+4) make patch-init
+5) modify the file to be patched beneath staging/${relative_path_to_patch}
+6) make patch-create PATCH_PATH=${relative_path_to_patch}
+ o This will create patches/${relative_path_to_patch}/patch
+7) Verify
+ o make sterile
+ o make venv
+
+# Howto apply python 3.10+ patches
+
+See repo:voltha-docs for a working example.
+
+1) Modify Makefile
+2) Add target
+
+# [EOF]
\ No newline at end of file
diff --git a/makefiles/patches/help.mk b/makefiles/patches/help.mk
index 3eb387f..778c948 100644
--- a/makefiles/patches/help.mk
+++ b/makefiles/patches/help.mk
@@ -1,6 +1,6 @@
# -*- makefile -*-
# -----------------------------------------------------------------------
-# Copyright 2017-2022 Open Networking Foundation
+# Copyright 2017-2023 Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,10 +15,30 @@
# limitations under the License.
# -----------------------------------------------------------------------
-help ::
+ifdef VERBOSE
+ help :: help-patches
+else
+ help ::
@echo
@echo "[PATCHES] - helper on the road to python 3.10+ based testing"
- @echo " patch-gather Gather a list of potential patch sources"
+ @echo ' see also: help-patches'
+endif
+
+help-patches:
+ @echo
+ @echo "[PATCHES] - helper on the road to python 3.10+ based testing"
@echo " patch-apply Apply patches to the virtualenv directory"
+ @echo " patch-create"
+ @echo " patch-gather Gather a list of potential patch sources"
+ @echo " patch-init Clone the virtualenv directory for patch creation."
+
+
+
+
+help-trailer ::
+ @echo "[SEE ALSO] patches-help"
+
+help-verbose ::
+ $(HIDE)$(MAKE) --no-print-directory help VERBOSE=1
# [EOF]
diff --git a/makefiles/patches/include.mk b/makefiles/patches/include.mk
index 541f756..47e6612 100644
--- a/makefiles/patches/include.mk
+++ b/makefiles/patches/include.mk
@@ -15,7 +15,7 @@
# limitations under the License.
# -----------------------------------------------------------------------
-include $(MAKEDIR)/patches/help.mk
+include $(ONF_MAKEDIR)/patches/help.mk
patch-gather-args += --exclude=Makefile
patch-gather-args += --exclude-dir=vault
@@ -27,14 +27,39 @@
patch-gather-args += '-e' 'from collections import Mapping'
patch-gather-args += '-e' 'from collections import MutableMapping'
+# Defined by [Mm]akefile or makefiles/virtualenv.mk
+venv-name ?= $(error $(MAKE) venv-name= is required)
+
+PATCH_PATH ?= $(error $(MAKE) PATCH_PATH= is required)
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
patch-gather:
grep -r $(patch-gather-args)
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
patch-diff:
- $(HIDE)diff -qr staging vst_venv \
+ $(HIDE)diff -qr staging $(venv-name) \
| awk '{print "# diff -Naur "$$2" "$$4}' \
| tee $@.log
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+patch-create:
+ mkdir -p patches/$(PATCH_PATH)
+ diff -Naur staging/$(PATCH_PATH) $(venv-name)/$(PATCH_PATH) | tee patches/$(PATCH_PATH)/patch
+ exit 1
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+patch-init:
+ find "$(venv-name)" -name '__pycache__' -type d -print0 \
+ | xargs -I'{}' --null --no-run-if-empty $(RM) -r {}
+ mkdir -p staging
+ rsync -rv --checksum "$(venv-name)/." "staging/."
+ @echo "Modify files beneath staging/ to create a patch source"
+
# [SEE ALSO]
# ---------------------------------------------------------------------------
# https://bobbyhadz.com/blog/python-importerror-cannot-import-name-mapping-from-collections