summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-07-25 10:28:04 +0200
committerThomas Haller <thaller@redhat.com>2022-07-25 10:28:07 +0200
commit7450daa6092e9d9feb2200b33ef92a2c9f88051c (patch)
tree47756d8d6a51c32e84903c1e17a09511f2578a60
parent37db1323208dd17200d04597f15f5bf3b4b93a21 (diff)
parentbde99436aaae35c20a5b792ced4b1b2ef7d8484a (diff)
downloadNetworkManager-7450daa6092e9d9feb2200b33ef92a2c9f88051c.tar.gz
c-util,nettools: merge branch 'th/gitlab-ci-subtrees'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1303
-rwxr-xr-x.gitlab-ci/run-test.sh36
-rwxr-xr-xcontrib/scripts/git-subtree-reimport.sh31
l---------src/c-rbtree/subprojects/libcstdaux-11
-rw-r--r--src/c-rbtree/subprojects/libcstdaux-1.wrap3
l---------src/c-siphash/subprojects/libcstdaux-11
-rw-r--r--src/c-siphash/subprojects/libcstdaux-1.wrap3
-rw-r--r--src/n-acd/meson.build2
l---------[m---------]src/n-acd/subprojects/c-list1
l---------[m---------]src/n-acd/subprojects/c-rbtree1
l---------[m---------]src/n-acd/subprojects/c-siphash1
m---------src/n-acd/subprojects/c-stdaux0
l---------src/n-acd/subprojects/libcstdaux-11
-rw-r--r--src/n-dhcp4/meson.build2
l---------[m---------]src/n-dhcp4/subprojects/c-list1
l---------[m---------]src/n-dhcp4/subprojects/c-siphash1
m---------src/n-dhcp4/subprojects/c-stdaux0
16 files changed, 72 insertions, 13 deletions
diff --git a/.gitlab-ci/run-test.sh b/.gitlab-ci/run-test.sh
index 0e2f3f52ef..dfaee99ba8 100755
--- a/.gitlab-ci/run-test.sh
+++ b/.gitlab-ci/run-test.sh
@@ -23,6 +23,9 @@ do_clean() {
# "make -C update-po", run on "make dist" has a silly habit of
# modifying files in-tree. Lets undo that.
git checkout -- po/
+
+ git status
+ git diff
}
uname -a
@@ -61,4 +64,37 @@ if [ "$NM_BUILD_TARBALL" = 1 ]; then
mv /tmp/NetworkManager-1*.tar.xz /tmp/NetworkManager-1*.src.rpm ./
fi
+###############################################################################
+
+test_subtree() {
+ local d="$1"
+ local cc="$2"
+
+ if meson --version | grep -q '^0\.[0-5][0-9]\.' ; then
+ # These subprojects require a newer meson than NetworkManager. Skip the test.
+ return 0
+ fi
+
+ do_clean
+ pushd ./src/$d
+
+ ARGS=()
+ if [ "$d" = n-acd ]; then
+ ARGS+=('-Debpf=false')
+ fi
+
+ CC="$cc" CFLAGS="-Werror -Wall" meson build "${ARGS[@]}"
+ ninja -v -C build test
+
+ popd
+}
+
+for d in c-list c-rbtree c-siphash c-stdaux n-acd n-dhcp4 ; do
+ for cc in gcc clang; do
+ test_subtree "$d" "$cc"
+ done
+done
+
+###############################################################################
+
echo "BUILD SUCCESSFUL!!"
diff --git a/contrib/scripts/git-subtree-reimport.sh b/contrib/scripts/git-subtree-reimport.sh
index 7de3436adb..d580780caa 100755
--- a/contrib/scripts/git-subtree-reimport.sh
+++ b/contrib/scripts/git-subtree-reimport.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-set -ex
+set -e
cd "$(dirname "$(readlink -f "$0")")/../.."
@@ -17,17 +17,38 @@ reimport() {
branch=master
fi
- git subtree pull --prefix "src/$d" "git@github.com:$project/$d.git" "$branch" --squash -m \
+ CMD=( git subtree pull --prefix "src/$d" "git@github.com:$project/$d.git" "$branch" --squash -m \
"$d: re-import git-subtree for 'src/$d'
git subtree pull --prefix src/$d git@github.com:$project/$d.git $branch --squash
-"
+" )
+
+ printf '\n>>>> %s >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n' "$d"
+ printf '>>>'
+ for c in "${CMD[@]}"; do
+ printf ' %q' "$c"
+ done
+ printf '\n'
+
+ "${CMD[@]}" 2>&1
+
+ local REMOTE_COMMIT="$(git rev-parse FETCH_HEAD)"
+
+ echo ">>>>> RESULT:"
+ printf ">>> git diff %s: HEAD:src/%s\n" "$REMOTE_COMMIT" "$d"
+ GIT_PAGER=cat git diff --color=always "$REMOTE_COMMIT:" "HEAD:src/$d"
}
reimport_all() {
- for d in c-list c-rbtree c-siphash c-stdaux n-acd n-dhcp4 ; do
+ local ARGS
+
+ ARGS=( "$@" )
+ if [ "${#ARGS[@]}" = 0 ]; then
+ ARGS=( c-list c-rbtree c-siphash c-stdaux n-acd n-dhcp4 )
+ fi
+ for d in "${ARGS[@]}" ; do
reimport "$d"
done
}
-reimport_all
+reimport_all "$@"
diff --git a/src/c-rbtree/subprojects/libcstdaux-1 b/src/c-rbtree/subprojects/libcstdaux-1
new file mode 120000
index 0000000000..589984f3ad
--- /dev/null
+++ b/src/c-rbtree/subprojects/libcstdaux-1
@@ -0,0 +1 @@
+../../c-stdaux \ No newline at end of file
diff --git a/src/c-rbtree/subprojects/libcstdaux-1.wrap b/src/c-rbtree/subprojects/libcstdaux-1.wrap
deleted file mode 100644
index 036020aafe..0000000000
--- a/src/c-rbtree/subprojects/libcstdaux-1.wrap
+++ /dev/null
@@ -1,3 +0,0 @@
-[wrap-git]
-url = https://github.com/c-util/c-stdaux.git
-revision = v1
diff --git a/src/c-siphash/subprojects/libcstdaux-1 b/src/c-siphash/subprojects/libcstdaux-1
new file mode 120000
index 0000000000..589984f3ad
--- /dev/null
+++ b/src/c-siphash/subprojects/libcstdaux-1
@@ -0,0 +1 @@
+../../c-stdaux \ No newline at end of file
diff --git a/src/c-siphash/subprojects/libcstdaux-1.wrap b/src/c-siphash/subprojects/libcstdaux-1.wrap
deleted file mode 100644
index 036020aafe..0000000000
--- a/src/c-siphash/subprojects/libcstdaux-1.wrap
+++ /dev/null
@@ -1,3 +0,0 @@
-[wrap-git]
-url = https://github.com/c-util/c-stdaux.git
-revision = v1
diff --git a/src/n-acd/meson.build b/src/n-acd/meson.build
index 017dec5669..6479eb1a77 100644
--- a/src/n-acd/meson.build
+++ b/src/n-acd/meson.build
@@ -15,7 +15,7 @@ mod_pkgconfig = import('pkgconfig')
sub_clist = subproject('c-list')
sub_crbtree = subproject('c-rbtree')
sub_csiphash = subproject('c-siphash')
-sub_cstdaux = subproject('c-stdaux')
+sub_cstdaux = subproject('libcstdaux-1')
dep_clist = sub_clist.get_variable('libclist_dep')
dep_crbtree = sub_crbtree.get_variable('libcrbtree_dep')
diff --git a/src/n-acd/subprojects/c-list b/src/n-acd/subprojects/c-list
-Subproject 6c53ef1c0066a3b0d82e9e181e90114eacb7c4a
diff --git a/src/n-acd/subprojects/c-rbtree b/src/n-acd/subprojects/c-rbtree
-Subproject c8cf175278452686cc5993e154d472d0a64d7fa
diff --git a/src/n-acd/subprojects/c-siphash b/src/n-acd/subprojects/c-siphash
-Subproject 2d159c7da1d542f2b1fcbbefea6931bce242b94
diff --git a/src/n-acd/subprojects/c-stdaux b/src/n-acd/subprojects/c-stdaux
deleted file mode 160000
-Subproject 8b8f941c57a790c277f49b099e73ed9f8ea141a
diff --git a/src/n-acd/subprojects/libcstdaux-1 b/src/n-acd/subprojects/libcstdaux-1
new file mode 120000
index 0000000000..589984f3ad
--- /dev/null
+++ b/src/n-acd/subprojects/libcstdaux-1
@@ -0,0 +1 @@
+../../c-stdaux \ No newline at end of file
diff --git a/src/n-dhcp4/meson.build b/src/n-dhcp4/meson.build
index 1dddfe4f0d..8cdcb36865 100644
--- a/src/n-dhcp4/meson.build
+++ b/src/n-dhcp4/meson.build
@@ -14,7 +14,7 @@ mod_pkgconfig = import('pkgconfig')
sub_clist = subproject('c-list')
sub_csiphash = subproject('c-siphash')
-sub_cstdaux = subproject('c-stdaux')
+sub_cstdaux = subproject('libcstdaux-1')
dep_clist = sub_clist.get_variable('libclist_dep')
dep_csiphash = sub_csiphash.get_variable('libcsiphash_dep')
diff --git a/src/n-dhcp4/subprojects/c-list b/src/n-dhcp4/subprojects/c-list
-Subproject 6c53ef1c0066a3b0d82e9e181e90114eacb7c4a
diff --git a/src/n-dhcp4/subprojects/c-siphash b/src/n-dhcp4/subprojects/c-siphash
-Subproject 2d159c7da1d542f2b1fcbbefea6931bce242b94
diff --git a/src/n-dhcp4/subprojects/c-stdaux b/src/n-dhcp4/subprojects/c-stdaux
deleted file mode 160000
-Subproject 8b8f941c57a790c277f49b099e73ed9f8ea141a