diff options
author | Adrian Szyndela <adrian.s@samsung.com> | 2020-02-26 14:44:20 +0100 |
---|---|---|
committer | Adrian Szyndela <adrian.s@samsung.com> | 2020-02-26 14:44:20 +0100 |
commit | 1fbcb85d720b101a8f58809c965c6e21774e0413 (patch) | |
tree | edacc8801bc03d9c6b136b0683164a1715cad873 /tools | |
parent | 90932a624e2c56acc064a6a25fa18c30f2ca1678 (diff) | |
parent | 46659f7deb962f55c728e70597e37c2a3ab6326d (diff) | |
download | systemd-1fbcb85d720b101a8f58809c965c6e21774e0413.tar.gz systemd-1fbcb85d720b101a8f58809c965c6e21774e0413.tar.bz2 systemd-1fbcb85d720b101a8f58809c965c6e21774e0413.zip |
Merge v237 into tizen
systemd 237
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/add-git-hook.sh | 3 | ||||
-rwxr-xr-x | tools/check-includes.pl | 2 | ||||
-rwxr-xr-x | tools/find-build-dir.sh | 3 | ||||
-rw-r--r-- | tools/gdb-sd_dump_hashmaps.py | 14 | ||||
-rwxr-xr-x | tools/meson-build.sh | 10 | ||||
-rwxr-xr-x | tools/meson-check-api-docs.sh | 11 | ||||
-rwxr-xr-x | tools/meson-check-compilation.sh | 3 | ||||
-rwxr-xr-x | tools/meson-check-help.sh | 3 | ||||
-rwxr-xr-x | tools/meson-git-contrib.sh | 3 | ||||
-rwxr-xr-x | tools/meson-hwdb-update.sh | 3 | ||||
-rwxr-xr-x | tools/meson-make-symlink.sh | 3 |
11 files changed, 43 insertions, 15 deletions
diff --git a/tools/add-git-hook.sh b/tools/add-git-hook.sh index 4ee919faf4..c1db99b18a 100755 --- a/tools/add-git-hook.sh +++ b/tools/add-git-hook.sh @@ -1,4 +1,5 @@ -#!/bin/sh -eu +#!/bin/sh +set -eu cd "$MESON_SOURCE_ROOT" diff --git a/tools/check-includes.pl b/tools/check-includes.pl index bf23929d47..6aae7c1534 100755 --- a/tools/check-includes.pl +++ b/tools/check-includes.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # checkincludes: Find files included more than once in (other) files. # Copyright abandoned, 2000, Niels Kristian Bech Jensen <nkbj@image.dk>. diff --git a/tools/find-build-dir.sh b/tools/find-build-dir.sh index 33b40f93f7..06b6297ea5 100755 --- a/tools/find-build-dir.sh +++ b/tools/find-build-dir.sh @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -e # Try to guess the build directory: # we look for subdirectories of the parent directory that look like ninja build dirs. diff --git a/tools/gdb-sd_dump_hashmaps.py b/tools/gdb-sd_dump_hashmaps.py index b3c356b579..7f5d31eca6 100644 --- a/tools/gdb-sd_dump_hashmaps.py +++ b/tools/gdb-sd_dump_hashmaps.py @@ -51,7 +51,7 @@ class sd_dump_hashmaps(gdb.Command): t = ["plain", "ordered", "set"][int(h["type"])] - print "%s, %s, %s, %d, %d, %d, %s (%s:%d)" % (t, h["hash_ops"], bool(h["has_indirect"]), n_entries, d["max_entries"], n_buckets, d["func"], d["file"], d["line"]) + print "{}, {}, {}, {}, {}, {}, {} ({}:{})".format(t, h["hash_ops"], bool(h["has_indirect"]), n_entries, d["max_entries"], n_buckets, d["func"], d["file"], d["line"]) if arg != "" and n_entries > 0: dib_raw_addr = storage_ptr + (all_entry_sizes[h["type"]] * n_buckets) @@ -63,10 +63,10 @@ class sd_dump_hashmaps(gdb.Command): for dib in sorted(iter(histogram)): if dib != 255: - print "%3d %8d %f%% of entries" % (dib, histogram[dib], 100.0*histogram[dib]/n_entries) + print "{:>3} {:>8} {} of entries".format(dib, histogram[dib], 100.0*histogram[dib]/n_entries) else: - print "%3d %8d %f%% of slots" % (dib, histogram[dib], 100.0*histogram[dib]/n_buckets) - print "mean DIB of entries: %f" % (sum([dib*histogram[dib] for dib in iter(histogram) if dib != 255])*1.0/n_entries) + print "{:>3} {:>8} {} of slots".format(dib, histogram[dib], 100.0*histogram[dib]/n_buckets) + print "mean DIB of entries: {}".format(sum([dib*histogram[dib] for dib in iter(histogram) if dib != 255])*1.0/n_entries) blocks = [] current_len = 1 @@ -87,9 +87,9 @@ class sd_dump_hashmaps(gdb.Command): if len(blocks) > 1 and blocks[0][0] == blocks[0][1] and blocks[-1][0] == n_buckets - 1: blocks[0][1] += blocks[-1][1] blocks = blocks[0:-1] - print "max block: %s" % max(blocks, key=lambda a: a[1]) - print "sum block lens: %d" % sum(b[1] for b in blocks) - print "mean block len: %f" % (1.0 * sum(b[1] for b in blocks) / len(blocks)) + print "max block: {}".format(max(blocks, key=lambda a: a[1])) + print "sum block lens: {}".format(sum(b[1] for b in blocks)) + print "mean block len: {}".format((1.0 * sum(b[1] for b in blocks) / len(blocks))) d = d["debug_list_next"] diff --git a/tools/meson-build.sh b/tools/meson-build.sh new file mode 100755 index 0000000000..302749d8ed --- /dev/null +++ b/tools/meson-build.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -eux + +src="$1" +dst="$2" +target="$3" +options="$4" + +[ -d "$dst" ] || meson "$src" "$dst" $options +ninja -C "$dst" "$target" diff --git a/tools/meson-check-api-docs.sh b/tools/meson-check-api-docs.sh new file mode 100755 index 0000000000..5bc808c1e4 --- /dev/null +++ b/tools/meson-check-api-docs.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -eu + +for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | sort -u` ; do + if test -f ${MESON_BUILD_ROOT}/man/$symbol.3 ; then + echo "✓ Symbol $symbol() is documented." + else + printf " \x1b[1;31mSymbol $symbol() lacks documentation.\x1b[0m\n" + fi +done diff --git a/tools/meson-check-compilation.sh b/tools/meson-check-compilation.sh index d3b2a312fd..ce39e1684b 100755 --- a/tools/meson-check-compilation.sh +++ b/tools/meson-check-compilation.sh @@ -1,3 +1,4 @@ -#!/bin/sh -eu +#!/bin/sh +set -eu "$@" '-' -o/dev/null </dev/null diff --git a/tools/meson-check-help.sh b/tools/meson-check-help.sh index 4210491a98..69157105f2 100755 --- a/tools/meson-check-help.sh +++ b/tools/meson-check-help.sh @@ -1,4 +1,5 @@ -#!/bin/sh -eu +#!/bin/sh +set -eu export SYSTEMD_LOG_LEVEL=info diff --git a/tools/meson-git-contrib.sh b/tools/meson-git-contrib.sh index c543b3a5fa..514daa0949 100755 --- a/tools/meson-git-contrib.sh +++ b/tools/meson-git-contrib.sh @@ -1,4 +1,5 @@ -#!/bin/sh -eu +#!/bin/sh +set -eu git shortlog -s `git describe --abbrev=0`.. | \ cut -c8- | \ diff --git a/tools/meson-hwdb-update.sh b/tools/meson-hwdb-update.sh index e9a78c647f..275d54cd17 100755 --- a/tools/meson-hwdb-update.sh +++ b/tools/meson-hwdb-update.sh @@ -1,4 +1,5 @@ -#!/bin/sh -eu +#!/bin/sh +set -eu cd "$1" diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh index 4c2190961b..cf35793e33 100755 --- a/tools/meson-make-symlink.sh +++ b/tools/meson-make-symlink.sh @@ -1,4 +1,5 @@ -#!/bin/sh -eu +#!/bin/sh +set -eu relpath() { python -c 'import os.path, sys;\ |