From 893af7fe1afac72f691cc3ad9f83a5b0f6d2831f Mon Sep 17 00:00:00 2001
From: Mathieu Courtois <mathieu.courtois@edf.fr>
Date: Sat, 1 Mar 2025 10:16:34 +0100
Subject: [PATCH] [#34412] use DEVTOOLS_ENV_SILENT=1 to disable infos loading
 environment

---
 bin/maint/close_issue             |  1 +
 bin/maint/close_issue_main        |  1 +
 bin/maint/create_histor           |  1 +
 bin/maint/create_histor_main      |  1 +
 bin/maint/list_expected           |  1 +
 bin/maint/list_expected_main      |  1 +
 bin/maint/list_issue              |  1 +
 bin/maint/list_issue_main         |  1 +
 bin/maint/valid_issue             |  1 +
 bin/maint/valid_issue_main        |  1 +
 etc/devtools_functions.sh         | 18 ++++++++++++------
 lib/aslint/python/diagr_import.py |  2 +-
 12 files changed, 23 insertions(+), 7 deletions(-)
 create mode 120000 bin/maint/close_issue
 create mode 120000 bin/maint/close_issue_main
 create mode 120000 bin/maint/create_histor
 create mode 120000 bin/maint/create_histor_main
 create mode 120000 bin/maint/list_expected
 create mode 120000 bin/maint/list_expected_main
 create mode 120000 bin/maint/list_issue
 create mode 120000 bin/maint/list_issue_main
 create mode 120000 bin/maint/valid_issue
 create mode 120000 bin/maint/valid_issue_main

diff --git a/bin/maint/close_issue b/bin/maint/close_issue
new file mode 120000
index 00000000..98848381
--- /dev/null
+++ b/bin/maint/close_issue
@@ -0,0 +1 @@
+../devtools_wrapper
\ No newline at end of file
diff --git a/bin/maint/close_issue_main b/bin/maint/close_issue_main
new file mode 120000
index 00000000..7cb20030
--- /dev/null
+++ b/bin/maint/close_issue_main
@@ -0,0 +1 @@
+close_issue.py
\ No newline at end of file
diff --git a/bin/maint/create_histor b/bin/maint/create_histor
new file mode 120000
index 00000000..98848381
--- /dev/null
+++ b/bin/maint/create_histor
@@ -0,0 +1 @@
+../devtools_wrapper
\ No newline at end of file
diff --git a/bin/maint/create_histor_main b/bin/maint/create_histor_main
new file mode 120000
index 00000000..75919cf3
--- /dev/null
+++ b/bin/maint/create_histor_main
@@ -0,0 +1 @@
+create_histor.py
\ No newline at end of file
diff --git a/bin/maint/list_expected b/bin/maint/list_expected
new file mode 120000
index 00000000..98848381
--- /dev/null
+++ b/bin/maint/list_expected
@@ -0,0 +1 @@
+../devtools_wrapper
\ No newline at end of file
diff --git a/bin/maint/list_expected_main b/bin/maint/list_expected_main
new file mode 120000
index 00000000..8c32768f
--- /dev/null
+++ b/bin/maint/list_expected_main
@@ -0,0 +1 @@
+list_expected.py
\ No newline at end of file
diff --git a/bin/maint/list_issue b/bin/maint/list_issue
new file mode 120000
index 00000000..98848381
--- /dev/null
+++ b/bin/maint/list_issue
@@ -0,0 +1 @@
+../devtools_wrapper
\ No newline at end of file
diff --git a/bin/maint/list_issue_main b/bin/maint/list_issue_main
new file mode 120000
index 00000000..e9e4c798
--- /dev/null
+++ b/bin/maint/list_issue_main
@@ -0,0 +1 @@
+list_issue.py
\ No newline at end of file
diff --git a/bin/maint/valid_issue b/bin/maint/valid_issue
new file mode 120000
index 00000000..98848381
--- /dev/null
+++ b/bin/maint/valid_issue
@@ -0,0 +1 @@
+../devtools_wrapper
\ No newline at end of file
diff --git a/bin/maint/valid_issue_main b/bin/maint/valid_issue_main
new file mode 120000
index 00000000..b9509c58
--- /dev/null
+++ b/bin/maint/valid_issue_main
@@ -0,0 +1 @@
+valid_issue.py
\ No newline at end of file
diff --git a/etc/devtools_functions.sh b/etc/devtools_functions.sh
index a11efdf8..3def18cc 100644
--- a/etc/devtools_functions.sh
+++ b/etc/devtools_functions.sh
@@ -8,6 +8,12 @@ _error()
     exit 1
 }
 
+env_printf()
+{
+    [ "${DEVTOOLS_ENV_SILENT}" = 1 ] && return
+    printf "$1"
+}
+
 source_codeaster_env()
 {
     # usage: source_codeaster_env PREFIX
@@ -15,7 +21,7 @@ source_codeaster_env()
     declare -a src=( "." "src" "../src" "${1}/src" "${HOME}/dev/codeaster/src" )
     WAF_SUFFIX="${WAF_SUFFIX:-mpi}"
     # source the environment only if DEVTOOLS_COMPUTER_ID is not already defined
-    printf "checking environment... "
+    env_printf "checking environment... "
     if [ -z "${DEVTOOLS_COMPUTER_ID}" ]; then
         host=$(detect_host)
         if [ ! -z "${host}" ]; then
@@ -25,25 +31,25 @@ source_codeaster_env()
                 export WAFBUILD_ENV="$(get_wafbuild_env ${host} "${path}")"
                 if [ -e "${WAFBUILD_ENV}" ]; then
                     . "${WAFBUILD_ENV}"
-                    echo "loading ${WAFBUILD_ENV}"
+                    env_printf "loading ${WAFBUILD_ENV}\n"
                     break
                 fi
             done
             if [ -z "${WAFBUILD_ENV}" ]; then
                 unset WAFBUILD_ENV
-                echo "no found"
+                env_printf "no found\n"
             fi
         else
-            echo "no found"
+            env_printf "no found\n"
         fi
     else
         if [ -z "${WAFBUILD_ENV}" ]; then
             export WAFBUILD_ENV="$(get_wafbuild_env ${DEVTOOLS_COMPUTER_ID} .)"
         fi
         if [ -e ${WAFBUILD_ENV} ]; then
-            echo "already set: ${WAFBUILD_ENV}"
+            env_printf "already set: ${WAFBUILD_ENV}\n"
         else
-            echo "no found: ${WAFBUILD_ENV}"
+            env_printf "no found: ${WAFBUILD_ENV}\n"
             unset WAFBUILD_ENV
         fi
     fi
diff --git a/lib/aslint/python/diagr_import.py b/lib/aslint/python/diagr_import.py
index d4c6904d..8e64cda1 100755
--- a/lib/aslint/python/diagr_import.py
+++ b/lib/aslint/python/diagr_import.py
@@ -244,7 +244,7 @@ def plot(imports, filename):
     lines.append("}")
 
     ext = osp.splitext(filename)[-1].replace(".", "")
-    assert ext in ("ps", "png")
+    assert ext in ("png", "svg", "ps"), ext
     ftmp = tempfile.NamedTemporaryFile("w", suffix=".dot", delete=False)
     ftmp.write(os.linesep.join(lines))
     ftmp.close()
-- 
GitLab