eclair: Remove no longer needed files.

These were either migrated to common repository tf-ci-scripts for reused
with TF-M implementation, or were refactored and replaced altogether.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: Ice2733e2ab7616cc9b65662e2b72316d2afb5ac5
diff --git a/eclair/analyze.sh b/eclair/analyze.sh
deleted file mode 100755
index 8931d5d..0000000
--- a/eclair/analyze.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2021-2022 BUGSENG srl. All rights reserved.
-# Copyright (c) 2022 Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-# Stop immediately if any executed command has exit status different from 0.
-set -ex
-
-usage() {
-    echo "Usage: analyze.sh CONF" 1>&2
-    echo "  where CONF is the build configuration id passed to build.sh" 1>&2
-}
-
-if [ $# -ne 1 ]
-then
-    usage
-    exit 1
-fi
-
-TF_CONFIG="$1"
-
-# Directory where this script resides.
-SCRIPT_DIR="$(cd "$(dirname "$0")" ; echo "${PWD}")"
-
-. ${SCRIPT_DIR}/analyze_common.sh
-
-# Directory where to put all ECLAIR output and temporary files.
-ECLAIR_OUTPUT_DIR="${WORKSPACE}/ECLAIR/out"
-
-# ECLAIR binary data directory and workspace.
-export ECLAIR_DATA_DIR="${ECLAIR_OUTPUT_DIR}/.data"
-# ECLAIR workspace.
-export ECLAIR_WORKSPACE="${ECLAIR_DATA_DIR}/eclair_workspace"
-# Destination file for the ECLAIR diagnostics.
-export ECLAIR_DIAGNOSTICS_OUTPUT="${ECLAIR_OUTPUT_DIR}/DIAGNOSTICS.txt"
-
-# Erase and recreate the output directory and the data directory.
-rm -rf "${ECLAIR_OUTPUT_DIR}"
-mkdir -p "${ECLAIR_DATA_DIR}"
-
-(
-  # Perform the build (from scratch) in an ECLAIR environment.
-  "${ECLAIR_BIN_DIR}/eclair_env"                   \
-      "-eval_file='${SCRIPT_DIR}/MISRA_C_2012_selection.ecl'" \
-      -- "${SCRIPT_DIR}/build-tfa.sh" "${TF_CONFIG}"
-)
-
-# Create the project database.
-PROJECT_ECD="${ECLAIR_OUTPUT_DIR}/PROJECT.ecd"
-find "${ECLAIR_DATA_DIR}" -maxdepth 1 -name "FRAME.*.ecb" \
-    | sort | xargs cat \
-    | "${ECLAIR_BIN_DIR}/eclair_report" \
-          "-create_db='${PROJECT_ECD}'" \
-          -load=/dev/stdin
-
-
-function make_self_contained() {
-    dir=$1
-    mkdir -p $dir/lib
-
-    cp -r /opt/bugseng/eclair-3.12.0/lib/html $dir/lib
-
-    ${SCRIPT_DIR}/relativize_urls.py $dir
-}
-
-${ECLAIR_BIN_DIR}/eclair_report -db=${PROJECT_ECD} \
-    -summary_txt=${ECLAIR_OUTPUT_DIR}/../summary_txt \
-    -full_txt=${ECLAIR_OUTPUT_DIR}/../full_txt \
-    -reports1_html=strictness,${ECLAIR_OUTPUT_DIR}/../full_html/by_strictness/@TAG@.html \
-    -full_html=${ECLAIR_OUTPUT_DIR}/../full_html
-
-# summary_txt contains just a single report file not present in full_txt, move it there and be done with it.
-mv ${ECLAIR_OUTPUT_DIR}/../summary_txt/by_service.txt ${ECLAIR_OUTPUT_DIR}/../full_txt/
-rm -rf ${ECLAIR_OUTPUT_DIR}/../summary_txt
-make_self_contained ${ECLAIR_OUTPUT_DIR}/../full_html
-
-# Compress database to take less disk space in Jenkins archive
-xz ${PROJECT_ECD}
diff --git a/eclair/analyze_delta.sh b/eclair/analyze_delta.sh
deleted file mode 100755
index 3617063..0000000
--- a/eclair/analyze_delta.sh
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2021-2022 BUGSENG srl. All rights reserved.
-# Copyright (c) 2022 Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-# Stop immediately if any executed command has exit status different from 0.
-set -ex
-
-usage() {
-    echo "Usage: analyze.sh CONF" 1>&2
-    echo "  where CONF is the build configuration id passed to build.sh" 1>&2
-}
-
-if [ $# -ne 1 ]
-then
-    usage
-    exit 1
-fi
-
-TF_CONFIG="$1"
-
-# Directory where this script resides.
-SCRIPT_DIR="$(cd "$(dirname "$0")" ; echo "${PWD}")"
-
-. ${SCRIPT_DIR}/analyze_common.sh
-
-function do_analyze() {
-
-    # ECLAIR binary data directory and workspace.
-    export ECLAIR_DATA_DIR="${ECLAIR_OUTPUT_DIR}/.data"
-    # ECLAIR workspace.
-    export ECLAIR_WORKSPACE="${ECLAIR_DATA_DIR}/eclair_workspace"
-    # Destination file for the ECLAIR diagnostics.
-    export ECLAIR_DIAGNOSTICS_OUTPUT="${ECLAIR_OUTPUT_DIR}/DIAGNOSTICS.txt"
-
-    # Erase and recreate the output directory and the data directory.
-    rm -rf "${ECLAIR_OUTPUT_DIR}"
-    mkdir -p "${ECLAIR_DATA_DIR}"
-
-    (
-      # Perform the build (from scratch) in an ECLAIR environment.
-      "${ECLAIR_BIN_DIR}/eclair_env"                   \
-          "-eval_file='${SCRIPT_DIR}/MISRA_C_2012_selection.ecl'" \
-          -- "${SCRIPT_DIR}/build-tfa.sh" "${TF_CONFIG}"
-    )
-
-    # Create the project database.
-    PROJECT_ECD="${ECLAIR_OUTPUT_DIR}/PROJECT.ecd"
-    find "${ECLAIR_DATA_DIR}" -maxdepth 1 -name "FRAME.*.ecb" \
-        | sort | xargs cat \
-        | "${ECLAIR_BIN_DIR}/eclair_report" \
-              "-create_db='${PROJECT_ECD}'" \
-              -load=/dev/stdin
-
-
-    function make_self_contained() {
-        dir=$1
-        mkdir -p $dir/lib
-
-        cp -r /opt/bugseng/eclair-3.12.0/lib/html $dir/lib
-
-        ${SCRIPT_DIR}/relativize_urls.py $dir
-    }
-
-    ${ECLAIR_BIN_DIR}/eclair_report -db=${PROJECT_ECD} \
-        -summary_txt=${ECLAIR_OUTPUT_DIR}/../summary_txt \
-        -full_txt=${ECLAIR_OUTPUT_DIR}/../full_txt \
-        -full_html=${ECLAIR_OUTPUT_DIR}/../full_html
-
-    # summary_txt contains just a single report file not present in full_txt, move it there and be done with it.
-    mv ${ECLAIR_OUTPUT_DIR}/../summary_txt/by_service.txt ${ECLAIR_OUTPUT_DIR}/../full_txt/
-    rm -rf ${ECLAIR_OUTPUT_DIR}/../summary_txt
-    make_self_contained ${ECLAIR_OUTPUT_DIR}/../full_html
-
-    # Create the Jenkins reports file.
-    JENKINS_XML="${ECLAIR_OUTPUT_DIR}/../jenkins.xml"
-    ${ECLAIR_BIN_DIR}/eclair_report -db=${PROJECT_ECD} -reports_jenkins=${JENKINS_XML}
-
-}
-
-# Directory where to put all ECLAIR output and temporary files.
-ECLAIR_OUTPUT_DIR="${WORKSPACE}/ECLAIR/out"
-
-do_analyze
-
-ECLAIR_OUTPUT_DIR="${WORKSPACE}/ECLAIR_BASE/out"
-
-(
-    cd ${ECLAIR_PROJECT_ROOT}
-    git checkout HEAD^
-    git log --oneline -n5
-)
-
-do_analyze
-
-diff -I '^Timestamp:' -x frames.txt -x files.txt -x explain.txt \
-    -ur ${WORKSPACE}/ECLAIR_BASE/summary_txt/ ${WORKSPACE}/ECLAIR/summary_txt/ > ${WORKSPACE}/ECLAIR/summary_txt.diff || true
-
-
-(
-${ECLAIR_BIN_DIR}/eclair_report -diff_criteria=fingerprint -diff_full_txt=ECLAIR_BASE/out/PROJECT.ecd,ECLAIR/out/PROJECT.ecd
-ls -l diff_output
-
-eclair_report -db=ECLAIR_BASE/out/PROJECT.ecd -sel_tag_glob=new,diff,missing -full_html=resolved_issues_html
-make_self_contained resolved_issues_html
-
-eclair_report -db=ECLAIR/out/PROJECT.ecd -sel_tag_glob=new,diff,missing -full_html=new_issues_html
-make_self_contained new_issues_html
-
-xz ECLAIR_BASE/out/PROJECT.ecd ECLAIR/out/PROJECT.ecd
-)
-
-${SCRIPT_DIR}/eclair_diff_report.py diff_output > misra_delta.txt
-
-
-cat <<EOF >index.html
-<html>
-<body>
-<h1>MISRA Delta reports for the patch</h1>
-
-<p>
-Patch: <a href="${GERRIT_CHANGE_URL}/${GERRIT_PATCHSET_NUMBER}">${GERRIT_CHANGE_URL}/${GERRIT_PATCHSET_NUMBER}</a><br />
-CI Build: <a href="${BUILD_URL}">${BUILD_URL}</a>
-</p>
-
-<li><a href="misra_delta.txt">Cumulative TXT report</a>
-<li><a href="diff_output/">Per MISRA rule TXT reports</a>
-<li><a href="new_issues_html/by_service.html#first_file/service&kind">New issues, groupped per file changed (HTML).</a>
-<li><a href="resolved_issues_html/by_service.html#first_file/service&kind">Resolved issues, groupped per file changed (HTML).</a>
-</body>
-</html>
-EOF
diff --git a/eclair/eclair_diff_report.py b/eclair/eclair_diff_report.py
deleted file mode 100755
index ef3c208..0000000
--- a/eclair/eclair_diff_report.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (c) 2022 Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-# Script to produce cumulative "diff" report from ECLAIR individual
-# per-service diff reports.
-
-import sys
-import glob
-import os
-from string import Template
-
-
-def lcut(l, prefix):
-    if l.startswith(prefix):
-        l = l[len(prefix):]
-    return l
-
-
-def process_file(fname, del_or_add):
-    with open(fname) as f:
-        for l in f:
-            l = l.rstrip()
-            if not l:
-                break
-        for l in f:
-            if l.startswith("service "):
-                l = lcut(l, "service ")
-                if del_or_add == "del":
-                    l = "Resolved for " + l
-                else:
-                    l = "Added for " + l
-            elif l.startswith("End of report"):
-                l = "---------------\n"
-            sys.stdout.write(l)
-
-
-path = "."
-if len(sys.argv) > 1:
-    path = sys.argv[1]
-
-files = sorted(glob.glob(path + "/*.etr"))
-#print(files)
-
-EMPTY_REPORT_HEADER = Template("""\
-No new MISRA issues detected, good work!
-${BUILD_URL}artifact/
-""").safe_substitute(os.environ)
-
-NONEMPTY_REPORT_HEADER = Template("""\
-MISRA delta report: ${BUILD_URL}artifact/
-
-= MISRA delta report for the patch (issues resolved and/or newly added) =
-""").safe_substitute(os.environ)
-
-header_done = False
-
-for f in files:
-    if "/B.EXPLAIN" in f:
-        continue
-    comp = f.rsplit(".", 2)
-#    print("*", f, comp)
-    if not header_done:
-        print(NONEMPTY_REPORT_HEADER)
-        header_done = True
-    process_file(f, comp[-2])
-
-if not header_done:
-    print(EMPTY_REPORT_HEADER)
diff --git a/eclair/relativize_urls.py b/eclair/relativize_urls.py
deleted file mode 100755
index 3e300b8..0000000
--- a/eclair/relativize_urls.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (c) 2022 Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-# Script to replace absolute paths in ECLAIR HTML reports, pointing to
-# "dependency" files like CSS & JS, to relative paths, pointing to
-# those files copied alongside the report.
-
-import sys
-import re
-import os
-import glob
-
-
-os.chdir(sys.argv[1])
-for fn in glob.iglob("**/*.html", recursive=True):
-    depth = fn.count("/")
-    relp = "/".join([".."] * depth)
-    if relp:
-        relp += "/"
-    #print(fn, relp)
-    with open(fn) as f:
-        txt = f.read()
-    txt = txt.replace("/opt/bugseng/eclair-3.12.0/", relp)
-    #os.rename(fn, fn + ".bak")
-    with open(fn, "w") as f:
-        f.write(txt)