about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2021-01-11 18:07:03 +0100
committerSebastien Bacher <seb128@ubuntu.com>2021-01-11 18:15:57 +0100
commit2567f558da3eb9911678227d4aeb15162e707d89 (patch)
tree13c80b0e091c8ba585b14b966cda998f95f1936d /tools
parent02d99ffd62ede29cffcb45fcbe33d044b7406d3a (diff)
parentf54032b30e1ddd84f10a339e0caf493772e049a7 (diff)
Merge branch 'debian/master' into ubuntu/master
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-config-options.sh8
-rwxr-xr-xtools/create-exports-NetworkManager.sh11
-rwxr-xr-xtools/enums-to-docbook.pl25
-rwxr-xr-xtools/generate-docs-nm-settings-docs-gir.py8
-rwxr-xr-xtools/run-nm-test.sh13
5 files changed, 47 insertions, 18 deletions
diff --git a/tools/check-config-options.sh b/tools/check-config-options.sh
index 659f5490..7a775955 100755
--- a/tools/check-config-options.sh
+++ b/tools/check-config-options.sh
@@ -6,14 +6,14 @@ ret=0
 get_supported_options()
 {
     awk '/START OPTION LIST/{flag=1;next}/END OPTION LIST/{flag=0}flag' "$srcdir/src/nm-config.c" |
-	grep -o 'NM_CONFIG_KEYFILE_KEY_\w*'
+    grep -o 'NM_CONFIG_KEYFILE_KEY_\w*'
 }
 
 get_missing_options()
 {
     grep -v '/\* check-config-options skip \*/' "$srcdir/src/nm-config.h" |
-	grep -o 'NM_CONFIG_KEYFILE_KEY_\w*' |
-	grep -v -Fx -f <(get_supported_options)
+    grep -o 'NM_CONFIG_KEYFILE_KEY_\w*' |
+    grep -v -Fx -f <(get_supported_options)
 }
 
 get_src_con_defaults()
@@ -25,7 +25,7 @@ get_src_con_defaults()
 get_man_con_defaults()
 {
     awk '/start connection defaults/{flag=1;next}/end connection defaults/{flag=0}flag' "$srcdir/man/NetworkManager.conf.xml" |
-	sed -ne 's#.*<varname>\([^<]*\)</varname>.*#\1#p'
+    sed -ne 's#.*<varname>\([^<]*\)</varname>.*#\1#p'
 }
 
 get_missing_con_defaults()
diff --git a/tools/create-exports-NetworkManager.sh b/tools/create-exports-NetworkManager.sh
index f439bd31..6cb7c2e7 100755
--- a/tools/create-exports-NetworkManager.sh
+++ b/tools/create-exports-NetworkManager.sh
@@ -46,7 +46,7 @@ get_symbols_nm () {
         _sort
 }
 
-get_symbols_explict() {
+get_symbols_explicit() {
     cat <<EOF | _sort
 _IO_stdin_used
 EOF
@@ -60,7 +60,7 @@ get_symbols_missing() {
             sed -n 's/^\([U]\) \(\(nm_\|nmp_\|_nm\|NM\|_NM\|nmtst_\|c_siphash_\|c_list_\).*\)$/\2/p'
     done) |
         _sort |
-        grep -Fx -f <(get_symbols_explict) -v |
+        grep -Fx -f <(get_symbols_explicit) -v |
         grep -Fx -f <(get_symbols_nm)
 }
 
@@ -82,14 +82,17 @@ do_update() {
     do_generate > ./src/NetworkManager.ver
 }
 
+SYMBOLS_MISSING="$(get_symbols_missing | pretty)"
+SYMBOLS_EXPLICIT="$(get_symbols_explicit | pretty)"
+
 do_generate() {
     cat <<EOF
 # this file is generated by $0
 {
 global:
-$(get_symbols_missing | pretty)
+$SYMBOLS_MISSING
 
-$(get_symbols_explict | pretty)
+$SYMBOLS_EXPLICIT
 local:
 	*;
 };
diff --git a/tools/enums-to-docbook.pl b/tools/enums-to-docbook.pl
index 697cb631..f422acbd 100755
--- a/tools/enums-to-docbook.pl
+++ b/tools/enums-to-docbook.pl
@@ -14,6 +14,7 @@
 use strict;
 use warnings;
 
+our $enum_name;
 our $name;
 our $desc;
 our $choice;
@@ -75,6 +76,7 @@ chomp;
 
 if (/^\/\*\*$/) {
 	# Start of a documentation comment
+	$enum_name = undef;
 	$name = '';
 	$desc = '';
 	$choice = undef;
@@ -118,11 +120,24 @@ if (/^\/\*\*$/) {
 } elsif (/^\s+([^,\s]+),?$/) {
 	# A choice without a literal value
 	next unless @choices;
-	die "Saw enum value '$1', but didn't see start of enum before" unless defined $val;
-	my ($this) = grep { $_->[0] eq $1 } @choices;
-	die "Documentation for value '$1' missing" unless $this;
-	$val = inc $val;
-	$this->[2] = "= <literal>$val</literal>";
+
+	if (defined $enum_name) {
+		next unless $enum_name;
+		$val = $1;
+		my ($this) = grep { $_->[0] eq $enum_name } @choices;
+		die "Documentation for value '$1' missing" unless $this;
+		$this->[2] = "= <literal>$val</literal>";
+		$enum_name = undef;
+	} else {
+		die "Saw enum value '$1', but didn't see start of enum before" unless defined $val;
+		my ($this) = grep { $_->[0] eq $1 } @choices;
+		die "Documentation for value '$1' missing" unless $this;
+		$val = inc $val;
+		$this->[2] = "= <literal>$val</literal>";
+	}
+} elsif (/^\s+(\S+)\s+=$/) {
+	next unless @choices;
+	$enum_name = $1
 } elsif (/^\} ([^;]+);/) {
 	# End of an enum
 	next unless defined $name;
diff --git a/tools/generate-docs-nm-settings-docs-gir.py b/tools/generate-docs-nm-settings-docs-gir.py
index ebda9956..317b3297 100755
--- a/tools/generate-docs-nm-settings-docs-gir.py
+++ b/tools/generate-docs-nm-settings-docs-gir.py
@@ -244,8 +244,12 @@ for settingxml in settings:
             "%s needs a gtk-doc block with one-line description" % setting.props.name
         )
     outfile.write(
-        '  <setting name="%s" description="%s" name_upper="%s" >\n'
-        % (setting.props.name, class_desc, get_setting_name_define(settingxml))
+        '  <setting name="%s" description=%s name_upper="%s" >\n'
+        % (
+            setting.props.name,
+            xml_quoteattr(class_desc),
+            get_setting_name_define(settingxml),
+        )
     )
 
     setting_properties = {
diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh
index 4df3ab96..f452d9d4 100755
--- a/tools/run-nm-test.sh
+++ b/tools/run-nm-test.sh
@@ -310,13 +310,20 @@ if [ $HAS_ERRORS -eq 0 ]; then
     # valgrind doesn't support setns syscall and spams the logfile.
     # hack around it...
     case "$TEST_NAME" in
+        'test-acd' | \
+        'test-address-linux' | \
+        'test-cleanup-linux' | \
         'test-config' | \
+        'test-l3cfg' | \
         'test-link-linux' | \
-        'test-acd' | \
-        'test-service-providers' | \
+        'test-lldp' | \
+        'test-nm-client' | \
+        'test-platform-general' | \
         'test-remote-settings-client' | \
+        'test-route-linux' | \
         'test-secret-agent' | \
-        'test-nm-client' )
+        'test-service-providers' | \
+        'test-tc-linux' )
             if [ -z "$(sed -e '/^--[0-9]\+-- WARNING: unhandled .* syscall: /,/^--[0-9]\+-- it at http.*\.$/d' "$LOGFILE")" ]; then
                 HAS_ERRORS=1
             fi