]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
scripts: organize into subdirs and clean up unused docs-develop-mana-ba8ewy/deployments/4964
authorOto Šťáva <oto.stava@nic.cz>
Fri, 23 Aug 2024 12:57:31 +0000 (14:57 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Mon, 26 Aug 2024 12:28:10 +0000 (14:28 +0200)
40 files changed:
.gitlab-ci.yml
bench/meson.build
daemon/lua/kres-gen.sh
distro/config/apkg.toml
doc/meson.build
meson.build
scripts/README.md [new file with mode: 0644]
scripts/ci/build-in-obs.sh [moved from scripts/build-in-obs.sh with 86% similarity]
scripts/ci/enable-repo-cznic-labs.sh [moved from scripts/enable-repo-cznic-labs.sh with 100% similarity]
scripts/ci/make-obs.sh [moved from scripts/make-obs.sh with 94% similarity]
scripts/coverage_c_combine.sh [deleted file]
scripts/coverage_env.sh [deleted file]
scripts/lib/get-date.sh [moved from scripts/get-date.sh with 93% similarity]
scripts/lib/upstream-version.sh [moved from scripts/upstream-version.sh with 100% similarity]
scripts/luacov_gen_empty.sh [deleted file]
scripts/luacov_to_info.lua [deleted file]
scripts/make-package.sh [deleted file]
scripts/map_install_src.lua [deleted file]
scripts/meson/bench.sh [moved from scripts/bench.sh with 100% similarity]
scripts/meson/gen-cdefs.sh [moved from scripts/gen-cdefs.sh with 100% similarity]
scripts/meson/make-doc.sh [moved from scripts/make-doc.sh with 96% similarity]
scripts/meson/run-pylint.sh [moved from scripts/run-pylint.sh with 92% similarity]
scripts/meson/test-config.sh [moved from scripts/test-config.sh with 100% similarity]
scripts/meson/test-integration-prepare.sh [moved from scripts/test-integration-prepare.sh with 100% similarity]
scripts/poe-tasks/check
scripts/poe-tasks/configure
scripts/poe-tasks/docs
scripts/poe-tasks/examples
scripts/poe-tasks/format
scripts/poe-tasks/gen-setuppy
scripts/poe-tasks/kresctl
scripts/poe-tasks/man
scripts/poe-tasks/run
scripts/poe-tasks/run-debug
scripts/poe-tasks/test
scripts/poe-tasks/utils/_env.sh [moved from scripts/poe-tasks/_env.sh with 100% similarity]
scripts/poe-tasks/utils/create_setup.py [moved from scripts/create_setup.py with 100% similarity]
scripts/run-scanbuild-with-args.sh [deleted file]
tests/config/meson.build
tests/integration/meson.build

index 832a85f229b81c19522a1538e88d5328a7a92513..945a9c503196a98093d1ff163713802e8616b8cb 100644 (file)
@@ -569,7 +569,7 @@ obs:trigger: &obs_trigger
     - pip install --upgrade pip
     - pip install apkg
     - scripts/make-obs.sh
-    - echo y | scripts/build-in-obs.sh $OBS_REPO
+    - echo y | scripts/ci/build-in-obs.sh $OBS_REPO
 
 obs:release:
   <<: *obs_trigger
@@ -596,7 +596,7 @@ obs:odvr:
 
 .enable_repo_build: &enable_repo_build
   before_script:
-    - ./scripts/enable-repo-cznic-labs.sh knot-dns
+    - ./scripts/ci/enable-repo-cznic-labs.sh knot-dns
 
 .pkg_test: &pkg_test
   stage: pkg
index b15dd0f7cd9b51d1a57cf51c81bc805117dc9ef7..a44bf7cc1c5fe856fb757c2a1341be6d03a5a45f 100644 (file)
@@ -20,5 +20,5 @@ bench_lru = executable(
 
 run_target(
   'bench',
-  command: '../scripts/bench.sh',
+  command: '../scripts/meson/bench.sh',
 )
index d14c028621345b42c6e55beb9d57e20b221e7550..8d0b91c041247c1cca4302e3e05308a78fb22c32 100755 (executable)
@@ -6,7 +6,7 @@ set -o pipefail -o errexit -o nounset
 
 cd "$(dirname ${0})"
 OUTNAME="$1"
-CDEFS="../../scripts/gen-cdefs.sh"
+CDEFS="../../scripts/meson/gen-cdefs.sh"
 LIBKRES="${MESON_BUILD_ROOT}/lib/libkres.so"
 KRESD="${MESON_BUILD_ROOT}/daemon/kresd"
 if [ ! -e "$LIBKRES" ]; then
index 19d4d8bead2a232912e9c94429ed4980d71e6537..43a2467165f36147b54488e7199003755fa2068b 100644 (file)
@@ -7,7 +7,7 @@ make_archive_script = "scripts/make-archive.sh"
 # needed for get-archive
 archive_url = "https://secure.nic.cz/files/knot-resolver/knot-resolver-{{ version }}.tar.xz"
 signature_url = "https://secure.nic.cz/files/knot-resolver/knot-resolver-{{ version }}.tar.xz.asc"
-version_script = "scripts/upstream-version.sh"
+version_script = "scripts/lib/upstream-version.sh"
 
 [apkg]
 compat = 4
index 0dfa3cb3e8f5d8ca01d09927bf55cccaa440365c..ad6a0f9a947012414380d988043a3ec2128481c9 100644 (file)
@@ -4,7 +4,7 @@
 # man page
 man_config = configuration_data()
 man_config.set('version', meson.project_version())
-man_config.set('date', run_command('../scripts/get-date.sh', check: true).stdout())
+man_config.set('date', run_command('../scripts/lib/get-date.sh', check: true).stdout())
 
 man_config.set('man_seealso_systemd', '')
 if systemd_legacy_units == 'enabled'
@@ -72,7 +72,7 @@ if get_option('doc') == 'enabled'
 endif
 
 
-make_doc = find_program('../scripts/make-doc.sh')
+make_doc = find_program('../scripts/meson/make-doc.sh')
 run_target(
   'doc',
   command: make_doc
index 251991dda703b0f2039deffbadd987f44d7755c4..d2e85b0be4ea9def36e23ee3766f9517a1d02dbc 100644 (file)
@@ -303,7 +303,7 @@ message('--- lint dependencies ---')
 clangtidy = find_program('clang-tidy', required: false)
 luacheck = find_program('luacheck', required: false)
 flake8 = find_program('flake8', required: false)
-pylint_run = find_program('scripts/run-pylint.sh')
+pylint_run = find_program('scripts/meson/run-pylint.sh')
 message('-------------------------')
 
 if clangtidy.found()
diff --git a/scripts/README.md b/scripts/README.md
new file mode 100644 (file)
index 0000000..dcfe8c6
--- /dev/null
@@ -0,0 +1,18 @@
+# Knot Resolver scripts
+
+These are auxillary scripts used for Knot Resolver development.
+
+The scripts in the root of this directory are meant to be executed directly by
+developers.  Some may also be run by automated tools.
+
+There are also the following subdirectories.  The scripts in these are *only
+ever* meant to be run by automated tools:
+
+- `ci`: specific to the CI/CD pipeline
+- `lib`: (potentially) generally useful scripts to be called by other scripts
+- `meson`: specific to the build system
+- `poe-tasks`: run by the `poe` script in the repository root
+  - `utils`: scripts additionally called by the `poe` tasks
+
+For more information about each script, see its content for explanatory
+comments.
similarity index 86%
rename from scripts/build-in-obs.sh
rename to scripts/ci/build-in-obs.sh
index 176b9ad4ddb059c6081d1f7c88c2617190d9ec8d..eaa54671ef6dd2043923277c4ec8698be05ee1ab 100755 (executable)
@@ -4,8 +4,8 @@
 # Push packaging files to OBS
 #
 # Example usage:
-# 1. ./scripts/make-obs.sh
-# 2. ./scripts/build-in-obs.sh knot-resolver-latest
+# 1. ./scripts/ci/make-obs.sh
+# 2. ./scripts/ci/build-in-obs.sh knot-resolver-latest
 set -o errexit -o nounset -o xtrace
 
 pkgdir='pkg/obs'
similarity index 94%
rename from scripts/make-obs.sh
rename to scripts/ci/make-obs.sh
index cc0aab73a47e5d66e33b93e11964186c68356ddf..4d0666cbfbff4863653418aaae33fcdbdbd584b9 100755 (executable)
@@ -9,7 +9,7 @@
 # * dpkg-buildpackage
 #
 # usage:
-#   ./scripts/make-obs.sh [path.to.archive.xz] [1]
+#   ./scripts/ci/make-obs.sh [path.to.archive.xz] [1]
 #
 # supply archives as optional arguments to build from,
 # otherwise archive will be built from sources by apkg
@@ -18,7 +18,7 @@
 # output at pkg/obs/ (removed on each run)
 set -o errexit -o nounset
 
-pushd "$(dirname ${0})/.."
+pushd "$(dirname ${0})/../.."
 
 OUTDIR="pkg/obs"
 APKG_OPTS="-O $OUTDIR"
diff --git a/scripts/coverage_c_combine.sh b/scripts/coverage_c_combine.sh
deleted file mode 100755 (executable)
index 4618111..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: GPL-3.0-or-later
-
-# $1 = top source directory
-# $2 = coverage data directory path
-# $3 = output directory for *.info files
-
-set -o errexit -o nounset
-shopt -s nullglob
-IFS=$'\n'
-
-TOPSRCDIR="$1"
-DATAROOT="$2"
-OUTDIR="$3"
-
-cd "${TOPSRCDIR}"
-for COVNAME in $(find "${DATAROOT}" -name .topdir_kresd_coverage)
-do
-       find "${DATAROOT}" -name '*.gcda' -not -path "${DATAROOT}/*" -delete
-       COVDIR="$(dirname "${COVNAME}")"
-       COVDATA_FILENAMES=("${COVDIR}"/*)  # filenames in BASH array
-       (( ${#COVDATA_FILENAMES[*]} )) || continue  # skip empty dirs
-
-       cp -r -t ${TOPSRCDIR} "${COVDIR}"/*
-       ${LCOV} -q --no-external --capture -d lib -d daemon -d modules -o "$(mktemp -p "${OUTDIR}" -t XXXXXXXX.c.info)" > /dev/null
-done
diff --git a/scripts/coverage_env.sh b/scripts/coverage_env.sh
deleted file mode 100755 (executable)
index 4f55d85..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: GPL-3.0-or-later
-
-# generate variables for coverage testing
-# $1 = top source directory
-# $2 = coverage data directory path
-# $3 = name of test/new subdirectory name
-# $4 = [optional] --export to generate export commands
-
-set -o errexit -o nounset
-shopt -s nullglob
-
-test -z "${COVERAGE:-}" && exit 0  # not enabled, do nothing
-test ! -z "${V:-}" && set -o xtrace  # verbose mode
-
-EXPORT=""
-test "${4:-}" == "--export" && EXPORT="export "
-TOPSRCDIR="$1"
-DATAROOT="$2"
-OUTPATH="$2/$3"
-
-# check that output directory is empty
-# beware: Makefile will always call coverage_env.sh for all targets
-# so directories get created but not populated
-# i.e. test -d is not sufficient check
-OUTPATH_FILENAMES=("${OUTPATH}"/*)  # filenames in BASH array
-(( ${#OUTPATH_FILENAMES[*]} )) && echo "false" && >&2 echo "fatal: output directory ${OUTPATH} must be empty (or non-existent)" && exit 1
-
-mkdir -p "${OUTPATH}"
-# convert paths to absolute
-pushd "${OUTPATH}" &> /dev/null
-touch .topdir_kresd_coverage
-OUTPATH="$(pwd -P)"
-popd &> /dev/null
-
-# determine GCOV_PREFIX_STRIP value for current source directory
-TOPSRCDIR_SLASHES="${TOPSRCDIR//[^\/]/}" # remove everything except /
-GCOV_PREFIX_STRIP="${#TOPSRCDIR_SLASHES}" # number of / == number of components
-
-KRESD_COVERAGE_STATS="${OUTPATH}/luacov.stats.out"
-GCOV_PREFIX="${OUTPATH}"
-echo "${EXPORT}KRESD_COVERAGE_STATS=\"${KRESD_COVERAGE_STATS}\" ${EXPORT}GCOV_PREFIX=\"${GCOV_PREFIX}\" ${EXPORT}GCOV_PREFIX_STRIP=\"${GCOV_PREFIX_STRIP}\""
similarity index 93%
rename from scripts/get-date.sh
rename to scripts/lib/get-date.sh
index fed100484947ffe4bfc5d093a32cec77518d274e..1480f9847cf9f86c5dbd0d5fa3218ceccb6b09d0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-3.0-or-later
 set -o nounset
-cd "$(dirname $0)/.."
+cd "$(dirname $0)/../.."
 
 # Get date from NEWS if possible (regular release)
 DATE=$(head -n1 < NEWS | sed 's/.*(\(.*\)).*/\1/' | grep -E '^[0-9]{4}-[0-9]{2}-[0-9]{2}$$')
diff --git a/scripts/luacov_gen_empty.sh b/scripts/luacov_gen_empty.sh
deleted file mode 100755 (executable)
index a953d91..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: GPL-3.0-or-later
-# Generate stats file in luacov format indicating that files named on stdin
-# were not processed.
-#
-# Normally luacov does not know about files which were not loaded so
-# without this manual addition the files are missing in coverage report.
-
-# Usage:
-# $ luacov_gen_empty.sh < list_of_lua_files > luacov.empty_stats.out
-
-set -o errexit -o nounset
-IFS=$'\n'
-
-while read FILENAME
-do
-       echo -e "0:${FILENAME}\n "
-done
diff --git a/scripts/luacov_to_info.lua b/scripts/luacov_to_info.lua
deleted file mode 100755 (executable)
index b27ba99..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env luajit
--- SPDX-License-Identifier: GPL-3.0-or-later
-
-local luacov = require('luacov')
-local ReporterBase = require('luacov.reporter').ReporterBase
-local LcovReporter = setmetatable({}, ReporterBase)
-LcovReporter.__index = LcovReporter
-
-function LcovReporter:on_new_file(filename)
-       self.finfo = self.current_files[filename] or {name=filename, coverage={}}
-end
-
-function LcovReporter:on_mis_line(_, lineno, _)
-       self.finfo.coverage[lineno] = self.finfo.coverage[lineno] or 0
-end
-
-function LcovReporter:on_hit_line(_, lineno, _, hits)
-       self.finfo.coverage[lineno] = (self.finfo.coverage[lineno] or 0) + hits
-end
-
-function LcovReporter:on_end_file()
-       self.current_files[self.finfo.name] = self.finfo
-       self.finfo = nil
-end
-
--- Write out results in lcov format
-local function write_lcov_info(files)
-       for fname, finfo in pairs(files) do
-               local instrumented, nonzero = 0, 0
-               print('TN:')
-               print(string.format('SF:%s', fname))
-               for i, hits in pairs(finfo.coverage) do
-                       print(string.format('DA:%d,%d', i, hits))
-                       instrumented = instrumented + 1
-                       if hits > 0 then
-                               nonzero = nonzero + 1
-                       end
-               end
-               print(string.format('LH:%d', nonzero))
-               print(string.format('LF:%d', instrumented))
-               print('end_of_record')
-       end
-end
-
--- Accumulate total coverage
-local all_files = {}
-for _, fname in ipairs(arg) do
-       local conf = luacov.load_config()
-       conf.statsfile = fname
-       local reporter = assert(LcovReporter:new(conf))
-       reporter.current_files = all_files
-       reporter:run()
-       reporter:close()
-end
-
--- Write results
-write_lcov_info(all_files)
diff --git a/scripts/make-package.sh b/scripts/make-package.sh
deleted file mode 100755 (executable)
index 8b0ba95..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/env bash
-
-set -o errexit
-set -o nounset
-
-function install_pipx {
-       python3 -m pip install --user pipx
-       python3 -m pipx ensurepath
-       export PATH="$PATH:/root/.local/bin"  # hack to make binaries installed with pipx work
-}
-
-function pipx {
-       python3 -m pipx ${@}
-}
-
-function init_debian {
-    export DEBIAN_FRONTEND=noninteractive
-
-    # upgrade system to latest
-    apt-get update -qqq
-    apt-get upgrade -y -qqq
-
-    # configure repository with Knot Resolver dependencies
-    apt-get -y -qqq install apt-transport-https lsb-release ca-certificates wget curl gnupg2
-    sh -c 'echo "deb http://download.opensuse.org/repositories/home:/CZ-NIC:/knot-resolver-build/Debian_10/ /" > /etc/apt/sources.list.d/home:CZ-NIC:knot-resolver-build.list'
-    sh -c 'curl -fsSL https://download.opensuse.org/repositories/home:CZ-NIC:knot-resolver-build/Debian_10/Release.key | gpg --dearmor > /etc/apt/trusted.gpg.d/home_CZ-NIC_knot-resolver-build.gpg'
-    apt-get update -qqq
-
-    # apkg
-    apt-get install -y python3-pip meson git python3-venv
-}
-
-function init_fedora {
-    # upgrade system to latest and install pip
-    dnf upgrade -y
-    dnf install -y python3-pip
-}
-
-
-# system setup
-if command -v dnf; then
-    init_fedora
-elif command -v apt-get; then
-    init_debian
-else
-    echo "System not supported."
-    exit 1
-fi
-
-# install apkg
-install_pipx
-pipx install apkg
-
-# prepare the repo
-#git clone https://gitlab.nic.cz/knot/knot-resolver
-cd /repo
-git config --global user.email "automated-script"
-git config --global user.name "Automated Script"
-git checkout manager-integration-without-submodule
-git submodule update --init --recursive
-
-# build the package
-apkg system-setup
-apkg build -b
-apkg srcpkg
-
-
-
-
-
-
diff --git a/scripts/map_install_src.lua b/scripts/map_install_src.lua
deleted file mode 100755 (executable)
index ffc9a30..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/usr/bin/env luajit
--- SPDX-License-Identifier: GPL-3.0-or-later
-
--- parse install commands from stdin
--- input: PREFIX=... make install --dry-run --always-make
--- output: <install path> <source path>
--- (or sed commands if --sed was specified)
-
-output = 'list'
-if #arg > 1 or arg[1] == '-h' or arg[1] == '--help' then
-       print(string.format([[
-Read install commands and map install paths to paths in source directory.
-
-Usage:
-$ PREFIX=... make install --dry-run --always-make | %s
-
-Example output:
-/kresd/git/.local/lib/kdns_modules/policy.lua  modules/policy/policy.lua
-
-Option --sed will produce output suitable as input suitable for sed.]],
-                               arg[0]))
-       os.exit(1)
-elseif #arg == 0 then
-       output = 'list'
-elseif arg[1] == '--sed' then
-       output = 'sed'
-else
-       print('Invalid arguments. See --help.')
-       os.exit(2)
-end
-
--- remove double // from paths and remove trailing /
-function normalize_path(path)
-       assert(path)
-       repeat
-               path, changes = path:gsub('//', '/')
-       until changes == 0
-       return path:gsub('/$', '')
-end
-
-function is_opt(word)
-       return word:match('^-')
-end
-
--- opts requiring additional argument to be skipped
-local ignored_opts_with_arg = {
-       ['--backup'] = true,
-       ['-g'] = true,
-       ['--group'] = true,
-       ['-m'] = true,
-       ['--mode'] = true,
-       ['-o'] = true,
-       ['--owner'] = true,
-       ['--strip-program'] = true,
-       ['--suffix'] = true,
-}
-
--- state machine junctions caused by --opts
--- returns: new state (expect, mode) and target name if any
-function parse_opts(word, expect, mode)
-       if word == '--' then
-               return 'names', mode, nil -- no options anymore
-       elseif word == '-d' or word == '--directory' then
-               return 'opt_or_name', 'newdir', nil
-       elseif word == '-t' or word == '--target-directory' then
-               return 'targetdir', mode, nil
-       elseif word:match('^--target-directory=') then
-               return 'opt_or_name', mode, string.sub(word, 20)
-       elseif ignored_opts_with_arg[word] then
-               return 'ignore', mode, nil -- ignore next word
-       else
-               return expect, mode, nil -- unhandled opt
-       end
-end
-
-
--- cmd: complete install command line: install -m 0644 -t dest src1 src2
--- dirs: names known to be directories: name => true
--- returns: updated dirs
-function process_cmd(cmd, dirs)
-       -- print('# ' .. cmd)
-       sanity_check(cmd)
-       local expect = 'install'
-       local mode = 'copy' -- copy or newdir
-       local target -- last argument or argument for install -t
-       local names = {} -- non-option arguments
-
-       for word in cmd:gmatch('%S+') do
-               if expect == 'install' then -- parsing 'install'
-                       assert(word == 'install')
-                       expect = 'opt_or_name'
-               elseif expect == 'opt_or_name' then
-                       if is_opt(word) then
-                               expect, mode, newtarget = parse_opts(word, expect, mode)
-                               target = newtarget or target
-                       else
-                               if mode == 'copy' then
-                                       table.insert(names, word)
-                               elseif mode == 'newdir' then
-                                       local path = normalize_path(word)
-                                       dirs[path] = true
-                               else
-                                       assert(false, 'bad mode')
-                               end
-                       end
-               elseif expect == 'targetdir' then
-                       local path = normalize_path(word)
-                       dirs[path] = true
-                       target = word
-                       expect = 'opt_or_name'
-               elseif expect == 'names' then
-                       table.insert(names, word)
-               elseif expect == 'ignore' then
-                       expect = 'opt_or_name'
-               else
-                       assert(false, 'bad expect')
-               end
-       end
-       if mode == 'newdir' then
-               -- no mapping to print, this cmd just created directory
-               return dirs
-       end
-
-       if not target then -- last argument is the target
-               target = table.remove(names)
-       end
-       assert(target, 'fatal: no target in install cmd')
-       target = normalize_path(target)
-
-       for _, name in pairs(names) do
-               basename = string.gsub(name, "(.*/)(.*)", "%2")
-               if not dirs[target] then
-                       print('fatal: target directory "' .. target .. '" was not created yet!')
-                       os.exit(2)
-               end
-               -- mapping installed name -> source name
-               if output == 'list' then
-                       print(target .. '/' .. basename, name)
-               elseif output == 'sed' then
-                       print(string.format([[s`%s`%s`g]],
-                                           target .. '/' .. basename, name))
-               else
-                       assert(false, 'unsupported output')
-               end
-       end
-       return dirs
-end
-
-function sanity_check(cmd)
-       -- shell quotation is not supported
-       assert(not cmd:match('"'), 'quotes " are not supported')
-       assert(not cmd:match("'"), "quotes ' are not supported")
-       assert(not cmd:match('\\'), "escapes like \\ are not supported")
-       assert(cmd:match('^install%s'), 'not an install command')
-end
-
--- remember directories created by install -d so we can expand relative paths
-local dirs = {}
-while true do
-       local cmd = io.read("*line")
-       if not cmd then
-               break
-       end
-       local isinstall = cmd:match('^install%s')
-       if isinstall then
-               dirs = process_cmd(cmd, dirs)
-       end
-end
similarity index 100%
rename from scripts/bench.sh
rename to scripts/meson/bench.sh
similarity index 96%
rename from scripts/make-doc.sh
rename to scripts/meson/make-doc.sh
index 503d7943ff6764facd4abe89d571b07d7479942c..aecf041078c68a344bc5eb42b9418858f947bac0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-3.0-or-later
 set -o errexit -o nounset
-cd "$(dirname "${0}")/.."
+cd "$(dirname "${0}")/../.."
 
 # generate JSON schema for the manager's declarative config
 pushd manager
similarity index 92%
rename from scripts/run-pylint.sh
rename to scripts/meson/run-pylint.sh
index 653d54bd6b44fa8d8e63fdd9fa8629675989e24a..ac23f5c41d7b0360ff974c1b8a61b47e89830d9b 100755 (executable)
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 set -o errexit -o nounset
 
-cd "$(dirname ${0})/.."
+cd "$(dirname ${0})/../.."
 
 # Find Python modules and standalone Python scripts
 FILES=$(find ./tests/pytests \
index 5563a9de73b18ab4c5cb343548ce7bf475b72fdd..ff7bdf9fd62437ebb177c4232c9284288b4415ad 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 aggregate_rv=0
 function check_rv {
@@ -32,7 +32,7 @@ fi
 
 # check formatting using black
 echo -e "${yellow}Checking formatting using black...${reset}"
-black manager/knot_resolver_manager tests/manager scripts/create_setup.py --check --diff
+black manager/knot_resolver_manager tests/manager scripts/poe-tasks/utils/create_setup.py --check --diff
 check_rv $?
 echo
 
@@ -56,7 +56,7 @@ echo
 
 # check that setup.py is not behind pyproject.toml
 echo -e "${yellow}Checking setup.py${reset}"
-python scripts/create_setup.py | diff - setup.py
+python scripts/poe-tasks/utils/create_setup.py | diff - setup.py
 check_rv $?
 python setup.py --help > /dev/null
 check_rv $?
index 1ca961a702ad7096e7b98baeef2b5446aa5d834b..d205a6dec2067000d274033c2a39d2f13a46166c 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 reconfigure=''
 if [ -f .build_kresd/ninja.build ]; then
index 6a62eb78598606d5525e47c37721eee773526dd7..0364cf72507d4d3fe5036fe4225595adc49c56ca 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 echo Building Knot Resolver documentation
 echo ------------------------------------
index c214167aa47092692b6dffbcd27bdd40ec209a73..8b0be2c42a23d852abe520fe55bbed1fbc6c1b0b 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 # validate all configuration examples
 for example in $PWD/etc/config/config.example.*.yaml;
index 0a83e3c2b27e04eed5bc87200c946566df566ca6..80b2da0d740567a8b78cf42446bb3fca91d3162c 100755 (executable)
@@ -2,9 +2,9 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
-dirs="manager/knot_resolver_manager/ tests/manager scripts/create_setup.py build_c_extensions.py"
+dirs="manager/knot_resolver_manager/ tests/manager scripts/poe-tasks/utils/create_setup.py build_c_extensions.py"
 
 # run black code formater
 black $dirs
index 3f337b3907a9dbbad3c30587d287fb7a87f0d40e..8a6d543edd8bb3997beb065c7e5b0b5b1ec0a761 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 # create setup.py
-python scripts/create_setup.py > setup.py
+python scripts/poe-tasks/utils/create_setup.py > setup.py
index e46ad3c13931d9271b2f8fbdc8d38ed4087c598b..38a8b4ea9d89dee0710018ac9b2be88c3fd66f5e 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 # run knot-resolver client
 python3 -m knot_resolver_manager.cli $@
index 9b06b3602712ad6b84b50a4b188d2b02fd70e13f..3cdafb34d60879cf162e0ccdb262f46efac4a5f5 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 build_kresd
 
index 907f94c10ec5b1758287116cf06020ed91b2120f..23a3395953ae74625f6b0a89cbbe72994bdebcf7 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 build_kresd
 
index 661b7fe2b1470339d8e9582cd3836072f2fc78e1..f577681bc29af1b0b53b72b764ae392c33642a8f 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 echo The debug server will be listening on port localhost:5678
 echo Use VSCode remote attach feature to connect to the debug server
index 3c1d7a9ccbf42714e2f5d9c890c46d3beacdfcbd..43aa403acb06c5e6de876fc8db539dd5f287ea86 100755 (executable)
@@ -2,7 +2,7 @@
 
 # ensure consistent behaviour
 src_dir="$(dirname "$(realpath "$0")")"
-source $src_dir/_env.sh
+source $src_dir/utils/_env.sh
 
 # run pytest
 env PYTHONPATH=. pytest --junitxml=unit.junit.xml --cov=manager/knot_resolver_manager --show-capture=all tests/manager
diff --git a/scripts/run-scanbuild-with-args.sh b/scripts/run-scanbuild-with-args.sh
deleted file mode 100755 (executable)
index fa4a98c..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: GPL-3.0-or-later
-set -o errexit -o nounset
-
-# following checkers are disabled on purpose:
-# Clang does not support attribute cleanup and this is causing false positives in following checkers:
-# unix.Malloc
-# alpha.unix.SimpleStream
-# alpha.unix.Stream
-# https://bugs.llvm.org/show_bug.cgi?id=3888
-
-# These are disabled for other reasons:
-# alpha.clone.CloneChecker # way too many false positives
-# alpha.core.CastToStruct # we use this pattern too much, hard to avoid in many cases
-# alpha.deadcode.UnreachableCode # false positives/flags sanity checks depending on implementation details
-# alpha.security.MallocOverflow # not smart enough to infer max values from data types
-
-exec scan-build --status-bugs -no-failure-reports \
--analyzer-config  aggressive-binary-operation-simplification=true \
--disable-checker  unix.Malloc \
--enable-checker   alpha.core.BoolAssignment \
--enable-checker   alpha.core.CastSize \
--enable-checker   alpha.core.Conversion \
--enable-checker   alpha.core.DynamicTypeChecker \
--enable-checker   alpha.core.FixedAddr \
--enable-checker   alpha.core.IdenticalExpr \
--enable-checker   alpha.core.PointerArithm \
--enable-checker   alpha.core.PointerSub \
--enable-checker   alpha.core.SizeofPtr \
--enable-checker   alpha.core.TestAfterDivZero \
--enable-checker   alpha.cplusplus.IteratorRange \
--enable-checker   alpha.security.ArrayBound \
--enable-checker   alpha.security.ArrayBoundV2 \
--enable-checker   alpha.security.ReturnPtrRange \
--enable-checker   alpha.security.taint.TaintPropagation \
--enable-checker   alpha.unix.BlockInCriticalSection \
--enable-checker   alpha.unix.Chroot \
--enable-checker   alpha.unix.PthreadLock \
--enable-checker   alpha.unix.cstring.BufferOverlap \
--enable-checker   alpha.unix.cstring.NotNullTerminated \
--enable-checker   alpha.unix.cstring.OutOfBounds \
--enable-checker   nullability.NullableDereferenced \
--enable-checker   nullability.NullablePassedToNonnull \
--enable-checker   nullability.NullableReturnedFromNonnull \
--enable-checker   optin.performance.Padding \
--enable-checker   optin.portability.UnixAPI \
--enable-checker   security.FloatLoopCounter \
--enable-checker   valist.CopyToSelf \
--enable-checker   valist.Uninitialized \
--enable-checker   valist.Unterminated \
-"$@"
index 2a9e2487c9eed8081e6841349c72393e9b57a393..681f2cc23615645636a93b15b1528566ecc8cb0e 100644 (file)
@@ -10,7 +10,7 @@ config_tests += [
 ]
 
 
-run_configtest = find_program('../../scripts/test-config.sh')
+run_configtest = find_program('../../scripts/meson/test-config.sh')
 
 
 foreach config_test : config_tests
index 98b661f41a0855514bcd96958837f9a77beac186..e9ab9e0fb5bdeea7312f379dc357af207184e3c1 100644 (file)
@@ -19,7 +19,7 @@ py3_deps += [
   ['yaml', 'PyYAML (for deckard)'],
 ]
 
-prepare_deckard = find_program('../../scripts/test-integration-prepare.sh')
+prepare_deckard = find_program('../../scripts/meson/test-integration-prepare.sh')
 
 deckard_env = environment()
 deckard_env.prepend('PATH', sbin_dir)