VOL-4840 - docs.voltha.org edits
Makefile
patches/python_310_migration.sh
-------------------------------
o Change log message to note venv patching by version.
o Original message could be interpreted as explict patching of wrong version.
makefiles/lint/include.mk
-------------------------
o Document lint targets: usage, commands, makefiles, etc.
Change-Id: I895a0a032f856632c9adf31aa634b6cbf0328cdb
diff --git a/patches/python_310_migration.sh b/patches/python_310_migration.sh
index 12d7ca8..e324146 100755
--- a/patches/python_310_migration.sh
+++ b/patches/python_310_migration.sh
@@ -15,15 +15,44 @@
# limitations under the License.
# -----------------------------------------------------------------------
+##-------------------##
+##---] GLOBALS [---##
+##-------------------##
set -euo pipefail
-dst="vst_venv"
-src="staging"
-pat="patches"
+## -----------------------------------------------------------------------
+## Intent: Display script documentation.
+## -----------------------------------------------------------------------
+function show_help()
+{
+ cat <<EOH
+Usage: $0
+ apply Patch virtualenv python modules by version (3.10+).
+ backup Create a tarball for work-in-progress.
+ gather Display a list of potential source files to patch.
-declare -a fyls=()
+ --venv Installed venv directory to patch (override default)
+ --help This message
+
+See Also
+ patches/README.md Howto create a patch file.
+
+EOH
+ exit 0
+}
+
+##----------------##
+##---] MAIN [---##
+##----------------##
+declare dst="vst_venv"
+declare src="staging"
+declare pat="patches"
+
+## -----------------------
+## Slurp available patches
+## -----------------------
pushd "$pat" >/dev/null
-fyls+=( $(find . -name 'patch' -print) )
+readarray -t fyls < <(find . -name 'patch' -print)
popd >/dev/null
if [ $# -eq 0 ]; then set -- apply; fi
@@ -32,16 +61,9 @@
opt="$1"; shift
case "$opt" in
+ -*help) show_help ;;
-*venv) dst="$1"; shift ;;
- help)
- cat <<EOH
-apply - generate patches from vault source.
-backup - Archive patch directory
-gather - collect potential python files to edit.
-EOH
- ;;
-
apply)
pushd "$dst" >/dev/null || { echo "pushd $dst failed"; exit 1; }
for fyl in "${fyls[@]}";
@@ -76,7 +98,9 @@
done
find "$pat" -print
;;
-
+
+ help) show_help ;;
+
*)
echo "ERROR: Unknown action [$opt]"
exit 1