summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-01-28 22:49:17 +0100
committerMichael Biebl <biebl@debian.org>2018-01-28 22:49:17 +0100
commit1d42b86df9052528a8f56b2f52d8bc2faf87b2da (patch)
tree0d80f37a1ad6f02067261ee3e7ee62e1869fcd56 /tools
parent52ad194e0b816b8273dd8d0fea3e6d467f6ca34e (diff)
downloadsystemd-1d42b86df9052528a8f56b2f52d8bc2faf87b2da.tar.gz
New upstream version 237
Diffstat (limited to 'tools')
-rwxr-xr-xtools/add-git-hook.sh3
-rwxr-xr-xtools/check-includes.pl2
-rwxr-xr-xtools/find-build-dir.sh3
-rw-r--r--tools/gdb-sd_dump_hashmaps.py14
-rwxr-xr-xtools/meson-build.sh10
-rwxr-xr-xtools/meson-check-api-docs.sh11
-rwxr-xr-xtools/meson-check-compilation.sh3
-rwxr-xr-xtools/meson-check-help.sh3
-rwxr-xr-xtools/meson-git-contrib.sh3
-rwxr-xr-xtools/meson-hwdb-update.sh3
-rwxr-xr-xtools/meson-make-symlink.sh3
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 47a5e70ae5..501cd43d47 100755
--- a/tools/meson-make-symlink.sh
+++ b/tools/meson-make-symlink.sh
@@ -1,4 +1,5 @@
-#!/bin/sh -eu
+#!/bin/sh
+set -eu
# this is needed mostly because $DESTDIR is provided as a variable,
# and we need to create the target directory...