diff options
author | Thomas Haller <thaller@redhat.com> | 2021-02-03 15:25:56 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-02-04 09:45:55 +0100 |
commit | ac1a9e03e4d6674e1e60529b47b325a8f62e67b3 (patch) | |
tree | ef0445da3fd804e6cc5ee1e9c48a352dd348df1f /tools | |
parent | 97ed143e04e74323a59a0f24a965d36341233670 (diff) | |
download | NetworkManager-ac1a9e03e4d6674e1e60529b47b325a8f62e67b3.tar.gz |
all: move "src/" directory to "src/core/"
Currently "src/" mostly contains the source code of the daemon.
I say mostly, because that is not true, there are also the device,
settings, wwan, ppp plugins, the initrd generator, the pppd and dhcp
helper, and probably more.
Also we have source code under libnm-core/, libnm/, clients/, and
shared/ directories. That is all confusing.
We should have one "src" directory, that contains subdirectories. Those
subdirectories should contain individual parts (libraries or
applications), that possibly have dependencies on other subdirectories.
There should be a flat hierarchy of directories under src/, which
contains individual modules.
As the name "src/" is already taken, that prevents any sensible
restructuring of the code.
As a first step, move "src/" to "src/core/". This gives space to
reorganize the code better by moving individual components into "src/".
For inspiration, look at systemd's "src/" directory.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/743
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/check-config-options.sh | 6 | ||||
-rwxr-xr-x | tools/create-exports-NetworkManager.sh | 20 | ||||
-rwxr-xr-x | tools/run-nm-test.sh | 4 | ||||
-rwxr-xr-x | tools/test-build.sh | 10 |
4 files changed, 20 insertions, 20 deletions
diff --git a/tools/check-config-options.sh b/tools/check-config-options.sh index d9d4431ee8..4cbd485599 100755 --- a/tools/check-config-options.sh +++ b/tools/check-config-options.sh @@ -5,20 +5,20 @@ ret=0 get_supported_options() { - awk '/START OPTION LIST/{flag=1;next}/END OPTION LIST/{flag=0}flag' "$srcdir/src/nm-config.c" | + awk '/START OPTION LIST/{flag=1;next}/END OPTION LIST/{flag=0}flag' "$srcdir/src/core/nm-config.c" | grep -o 'NM_CONFIG_KEYFILE_KEY_\w*' } get_missing_options() { - grep -v '/\* check-config-options skip \*/' "$srcdir/src/nm-config.h" | + grep -v '/\* check-config-options skip \*/' "$srcdir/src/core/nm-config.h" | grep -o 'NM_CONFIG_KEYFILE_KEY_\w*' | grep -v -Fx -f <(get_supported_options) } get_src_con_defaults() { - sed -n 's/\<NM_CON_DEFAULT/\n\0/gp' $(find "$srcdir/src/" -name \*.c ! -name test\*.c) | + sed -n 's/\<NM_CON_DEFAULT/\n\0/gp' $(find "$srcdir/src/core/" -name \*.c ! -name test\*.c) | sed -n 's/.*\<NM_CON_DEFAULT\(_NOP\)\?\s*("\([^"]*\)").*/\2/p' } diff --git a/tools/create-exports-NetworkManager.sh b/tools/create-exports-NetworkManager.sh index 406e14cf16..f7fd3bab95 100755 --- a/tools/create-exports-NetworkManager.sh +++ b/tools/create-exports-NetworkManager.sh @@ -8,7 +8,7 @@ die() { exit 1 } -# generates the linker version script src/NetworkManager.ver +# generates the linker version script src/core/NetworkManager.ver # by looking at the symbols needed by the device and settings # plugins. Note that this depends on how NetworkManager and # the plugins are build. For example, compiling without @@ -40,9 +40,9 @@ call_nm() { } get_symbols_nm () { - base=./src/.libs/NetworkManager-all-sym + base=./src/core/.libs/NetworkManager-all-sym if ! test -f "$base"; then - base=./src/NetworkManager-all-sym + base=./src/core/NetworkManager-all-sym fi call_nm "$base" | sed -n 's/^[tTDGRBS] //p' | @@ -56,9 +56,9 @@ EOF } get_symbols_missing() { - (for f in $(find ./src/settings/plugins/*/${libs} \ - ./src/devices/*/${libs} \ - ./src/ppp/${libs} -name '*.so' 2>/dev/null); do + (for f in $(find ./src/core/settings/plugins/*/${libs} \ + ./src/core/devices/*/${libs} \ + ./src/core/ppp/${libs} -name '*.so' 2>/dev/null); do call_nm "$f" | sed -n 's/^\([U]\) \(\(nm_\|nmp_\|_nm\|NM\|_NM\|nmtst_\|c_siphash_\|c_list_\).*\)$/\2/p' done) | @@ -82,7 +82,7 @@ do_rebuild() { } do_update() { - do_generate > ./src/NetworkManager.ver + do_generate > ./src/core/NetworkManager.ver } SYMBOLS_MISSING="$(get_symbols_missing | pretty)" @@ -110,7 +110,7 @@ else libs=.libs/ fi -test -f ./src/${libs}libNetworkManager.a || die "must be called from NetworkManager top build dir after building the tree" +test -f ./src/core/${libs}libNetworkManager.a || die "must be called from NetworkManager top build dir after building the tree" case "$1" in rebuild) @@ -125,8 +125,8 @@ case "$1" in if test -z "${NM_BUILD_NO_CREATE_EXPORTS+x}"; then do_update else - if test -f "./src/NetworkManager.ver"; then - touch ./src/NetworkManager.ver + if test -f "./src/core/NetworkManager.ver"; then + touch ./src/core/NetworkManager.ver fi fi ;; diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh index ef9d4a61c7..6d835a8fb8 100755 --- a/tools/run-nm-test.sh +++ b/tools/run-nm-test.sh @@ -45,9 +45,9 @@ usage() { echo " With \"--test\" and \"--\" you can select the test and which arguments are" echo " passed to the test. You can omit these, in which case the first unknown parameter" echo " is the test and all other unknown parameters are passed to the test. For example" - echo " $0 -m --test src/tests/test-core -- -p /general/match-spec/device" + echo " $0 -m --test src/core/tests/test-core -- -p /general/match-spec/device" echo " can also be called as" - echo " $0 src/tests/test-core -p /general/match-spec/device -m" + echo " $0 src/core/tests/test-core -p /general/match-spec/device -m" echo "" echo " The following environment variables are honored:" echo " NMTST_USE_VALGRIND=0|1: enable/disable valgrind" diff --git a/tools/test-build.sh b/tools/test-build.sh index 17bcba7d1d..0ae9a58620 100755 --- a/tools/test-build.sh +++ b/tools/test-build.sh @@ -31,15 +31,15 @@ build_out_of_tree() { TARGETS=("$@") if [ "${#TARGETS}" -lt 1 ]; then TARGETS=( - src/NetworkManager - src/nm-iface-helper - src/dhcp/nm-dhcp-helper + src/core/NetworkManager + src/core/nm-iface-helper + src/core/dhcp/nm-dhcp-helper dispatcher/nm-dispatcher clients/nm-online clients/cli/nmcli clients/tui/nmtui - src/platform/tests/monitor - src/ndisc/tests/test-ndisc-linux + src/core/platform/tests/monitor + src/core/ndisc/tests/test-ndisc-linux $(git grep -h '\.l\?a\>' Makefile.am | sed 's/[a-zA-Z.0-9_-/]\+/\n\0\n/g' | sort -u | grep '\.l\?a$') ) fi |