Commit Graph

260 Commits

Author SHA1 Message Date
Thomas Haller
f27b11dd3f contrib: install Polish translation in "nm-in-container.sh"
It's needed for the unit tests to test translations too.
2022-08-23 15:42:42 +02:00
Thomas Haller
305f02a912 contrib: set short DHCP lifetime in "nm-env-prepare.sh" script 2022-08-10 15:34:43 +02:00
Thomas Haller
540112e36f contrib: install tcpdump with "nm-in-container.sh"
It's useful for testing, which is what "nm-in-container.sh" is supposed
to provide. It's also only half a megabyte, so reasonably small to
install.
2022-08-10 15:26:41 +02:00
Thomas Haller
f14bb2d7b6 contrib: set fixed MAC address in "nm-env-prepare.sh" script 2022-08-10 15:22:11 +02:00
Thomas Haller
0a26320c09 contrib: update bash history in nm-in-container.sh 2022-08-08 20:45:18 +02:00
Thomas Haller
341c46de84 contrib: improve motd for nm-in-container.sh script
Leave a hint about core-dumps.

Also, now we have `contrib/fedora/rpm/configure-for-system.sh` script,
which can configure the build in a way similar to what we get
when doing an RPM build.

That means, inside "contrib/scripts/nm-in-container.sh" we
can just type `make install`, and it will replace the pre-installed
NetworkManager.

The main advantage is that it becomes convenient to run NetworkManager
as a systemd service. Previously, the suggested was to to install
NetworkManager inside another prefix, and run it in the terminal.

Running NetworkManager as systemd service is also necessary for NM-ci,
which restarts the NetworkManager service, and you couldn't run a test,
if you just started NetworkManager in a terminal.

Previously, you had to build a complete RPM, which takes a lot of time.
2022-08-08 11:54:27 +02:00
Thomas Haller
d966c2ac4c contrib: install "qt-devel" in nm-in-container.sh script
Yes, it's a large dependency. But on your outer host you
probably configured NetworkManager with QT enabled (for the
example scripts). We want to compile the same work tree inside
the container. So install qt-devel.
2022-08-08 11:54:27 +02:00
Thomas Haller
05825b0348 contrib: make nm-env-prepare.sh script executable 2022-07-29 17:26:58 +02:00
Thomas Haller
1c389445da contrib: install /usr/bin/python for "nm-in-container.sh" 2022-07-29 17:23:20 +02:00
Thomas Haller
0f1cc3e954 contrib: show diff of git subtrees in "git-subtree-reimport.sh" script 2022-07-25 10:27:33 +02:00
Thomas Haller
8b20d2a856 contrib: add "git-subtree-reimport.sh" script 2022-07-19 08:53:47 +02:00
Thomas Haller
d8a4b3bec2 all: reformat with clang-format (clang-tools-extra-14.0.0-1.fc36) and update gitlab-ci to f36 2022-07-06 11:06:53 +02:00
Thomas Haller
30d89a121d contrib: fix "nm-python-black-format.sh" script to ignore systemd,c-util,nettools files
Otherwise, the path "src/c-stdaux/src/docs/conf.py" matches for
formatting. But this file is imported via git-subtree, we don't
want to format it.

Filter out such paths.
2022-07-06 10:44:18 +02:00
Lubomir Rintel
9fdb6bea44 ci: drop Ubuntu 16.04
It's sad, old and unsupported. Also its gettext is old and smells of
elderberries.
2022-06-27 13:40:09 +02:00
Thomas Haller
d15f5420c7 contrib: use less -f in NM-log to avoid prompt for non-text input 2022-06-10 08:24:58 +02:00
Thomas Haller
c6228a5815 contrib: install iproute-tc in "nm-in-container.sh" 2022-06-09 21:11:08 +02:00
Thomas Haller
058af5fd07 contrib: enable DHCPv6 in "m-in-container.sh"'s "nm-env-prepare.sh" 2022-06-09 12:08:18 +02:00
Thomas Haller
b93750d4c5 contrib: set git-blame options in "nm-setup-git.sh" 2022-06-08 21:27:57 +02:00
Thomas Haller
12ea3bb425 contrib: don't use :Z for bind mounts in "nm-in-container.sh"
I am not sure why I added this. I think it's not necessary or
useful. Drop it.
2022-06-03 15:03:13 +02:00
Thomas Haller
65992349d0 contrib: install black/clang-format in nm-in-container.sh
It's just convenient to have some tools around, not only
for testing, but also for (some limited) development.

In particular, because we bind-mount .vimrc inside the container, and
if I use vim, black/clang-format is just one key binding away.
2022-05-31 18:32:33 +02:00
Thomas Haller
a6b8f050a0 contrib: add "journal" command to "nm-in-container.sh" for showing logs 2022-05-31 18:32:33 +02:00
Thomas Haller
a55d2a5035 contrib: improve bashrc for nm-in-container.sh 2022-05-31 18:13:29 +02:00
Thomas Haller
3a478b3ec1 contrib: add script "nm-setup-git.sh" for setting up NetworkManager git repository
You can of course just clone NetworkManager repository and start hacking
as you like. However, there are a few things like git-notest which are
interesting to setup.

Add a script to do this.

The script is supposed to be idempotent and do nothing, unless
necessary. By default it also only prints what it would do.
2022-05-31 18:04:03 +02:00
Thomas Haller
a859cee560 contrib: fix /etc/motd for "nm-in-container.sh" 2022-05-16 16:32:21 +02:00
Thomas Haller
0ca6aaab32 contrib: don't use "Z" specifier for mounting base directory in "nm-in-container.sh"
It seems unnecessary, and can cause failure.
2022-05-16 16:32:21 +02:00
Thomas Haller
56e1f0d290 contrib: ignore error installing behave_html_formatter in container
Yes, this is currently broken. *sigh*. Ignore any failure.
2022-05-16 16:32:08 +02:00
Thomas Haller
e766ca4e7c contrib: improve nm-in-container.d scripts
Get `ip netns exec` to work. Now we can start stuff in their
own namespace, which is much cleaner.
2022-04-28 19:33:14 +02:00
Thomas Haller
a1ff31db3b contrib: install nmstate+nispor in "nm-in-container.sh" 2022-04-19 11:15:08 +02:00
Thomas Haller
e9340c792c contrib: fail "find-backports" script if we have no "refs/notes/bugs" notes
"find-backports" script parses the commit messages to figure out which
patches to backport. We use "refs/notes/bugs" notes to extend the
meta data after the commit was merged. If you don't setup the
notes, the output is likely incomplete or wrong.

Yes, this is annoying. It requires you to setup the notes as described
in "CONTRIBUTING.md". Also because the "release.sh" script runs "find-backports",
so that means you cannot do releases without setting up the notes
(unless you manually disable running "find-backports"). But you really shouldn't
make a release based on incomplete information.
2022-04-06 13:23:37 +02:00
Thomas Haller
f3be419719 contrib: better autotect python files to format for "nm-python-black-format.sh" script 2022-04-05 09:45:20 +02:00
Thomas Haller
4e28bd5a94 find-backports: support "Ignore-Fixes:" tag to ignore "Fixes:" commit
"Ignore-Backport:" is already in use. For the find-backports script it
has the same meaning as a "cherry picked from" line, that means, we
assume that the referenced patch was backported already and the fix
applied.

This is of course useful to make the script shut up about backports that
we don't want to do. However, it requires us to tag the old branch
with this, so that the script thinks that the patch is already there.

Imaging we have a wrong commit on "next" branch with a Fixes line. We
don't want to backport it, so we would have to tag the "old" branch with
"Ignore-Backport:". That is cumbersome.

Instead, now also support that if a commit contains a "Fixes:" line any
an "Ignore-Fixes:" for the same fixed commit, then this let's the
"Fixes:" line be ignored.
2022-04-05 09:18:22 +02:00
Thomas Haller
49b0a92b5a contrib: add "nm-python-black-format.sh" script
This is more for completeness, to go along "nm-code-format.sh"
script.

Usually it's very simple to run black directly (you may still do that).
However, black by default only reformats files with ".py" extension.
So to get all our python files, you'd need to know and explicitly
select them... or use this script.

Also, `black .` scans the entire source tree, and is rather slow.
This script knows which files to select and is thus faster.
2022-04-01 14:00:30 +02:00
Thomas Haller
670894b667 contrib: fix wrong usage text for "nm-code-format.sh" 2022-04-01 13:51:56 +02:00
Thomas Haller
a628a35e80 contrib/checkpatch: try to warn about uninitialized GError variables
When we have a GError* variable on the stack, we usually want to pass
it on to function that can fail. In that case, the variable MUST be
initialized to NULL. This is an easy mistake to make.

Note that this check still can have lots of false positives, for
example, if you have a struct with an GError field. In that case, you
would need to ensure that the entire struct is initialized. Ignore the
warning then.

Also, the check misses if you declare multiple variables on one line.
But that is already discouraged by our style.
2022-03-09 23:14:37 +01:00
Thomas Haller
5a5d9573e1 contrib: colorize releasing slave in NM-log 2022-02-23 17:07:16 +01:00
Lubomir Rintel
f15fb5ecaa contrib/modemu: extend PDP support
Improve it just a bit to make ModemManager 1.18 happy.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1087
2022-02-04 15:54:15 +01:00
Lubomir Rintel
ea37c42b16 contrib/modemu: respond to AT+COPS?
This queries the operator code. If NetworkManager got one, it can
connect the modem device automatically without setting the APN.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1086
2022-02-04 15:54:15 +01:00
Thomas Haller
b2f507cab6 contrib/scripts: fix package list for Fedora 35 in "nm-in-container.sh" script
"grc" got removed/orphaned in Fedora 35.

Also, "vala-tool" is gone and (for a long time) replaced by "vala".
2022-01-13 20:05:14 +01:00
Thomas Haller
2b449694e5 checkpatch: complain about tabs in source file
There are very few places left where we would accept tabs in a source
file. Warn about that, even if it might cause some false positives.

I think this line was commented out due to a mistake.
2022-01-07 07:32:04 +01:00
Thomas Haller
866e3a2b51 contrib/scripts: update "nm-copr-build.sh" script to use new nm-git-bundle 2022-01-06 10:03:57 +01:00
Thomas Haller
34c59c96c5 contrib/scripts: better explain the purpose of nm-git-bundle 2022-01-06 10:01:51 +01:00
Thomas Haller
99f82b4b84 contrib: fix "find-backports" script to properly handle "Ignore-Backport" tag
The "Ignore-Backport" tag can be used to mark a commit that should not
be backported. Similar to the "cherry picked from" line, which indicates
that the patch was backported.

Anyway, this didn't work correctly, because we first pre-filter the
commits we search (as a performance optimization) by using `git-log` to
get a subset of the commits we want to investigate.

So if you had a commit with an "Ignore-Backport" tag, but without "cherry
picked from" line, then it wasn't found.

Fix that.
2022-01-05 09:30:16 +01:00
Thomas Haller
a6ff5ee448 contrib/scripts: add Fedora version to podmain container name for "nm-code-format-container.sh"
Older branches, like "nm-1-32" will always be formatted with a
different, older clang-format version. Luckily we also have on "nm-1-32"
branch the "nm-code-format-container.sh" script, so we can still
reformat the sources using the container.

However, as the name of the container was always "nm-code-format",
we would have to re-generate the container when we switch between
branches. As the container really only depends on the Fedora version
(as the clang-format version is tied to the corresponding Fedora
version), let's include the Fedora version in the name of the container.
2022-01-04 21:17:19 +01:00
Thomas Haller
081510ed94 gitlab-ci: use Fedora 35 as default build target 2021-11-29 09:31:09 +00:00
Thomas Haller
3e6c18e9af checkpatch: suggest to use _nm_setting_property_define_direct_*() for setting properties
We have multiple ways to define properties (like, GVariant based
nm_setting_option_*() or GObject based properties). For the latter,
they nowadays should all be implemented via _nm_setting_property_define_direct_*()
API.
2021-11-04 20:25:19 +01:00
Lubomir Rintel
ae4412b2fc contrib/checkpatch: recognize git subtree merges
Make checkpatch.pl identify subtree merges in "git am"-formatted
patches and reconstruct the full path names based in the subtree root.

This fixes some spurious warnings for parts of the tree that use
different coding style from what we usually do.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/989
2021-10-12 15:13:44 +02:00
Thomas Haller
34410c9c3e contrib: fix motd comment in "nm-in-container.sh" 2021-10-08 12:35:15 +02:00
Thomas Haller
82260cc5c2 contrib: add "contrib/scripts/test-ppp.sh" test script 2021-10-04 15:40:15 +02:00
Thomas Haller
1b488fe34c contrib: make it easy to test PPPoE in container script
It doesn't actually work inside the root-less container...
Well, it works as far as starting to activate, before it
fails. That is still somewhat useful. So have it there...
2021-10-04 15:40:15 +02:00
Thomas Haller
b9ff90c87d checkpatch: discourage use of g_clear_pointer()
We have nm_clear_pointer() instead, which does not cast the function
argument, and thus the compiler is better at checking the arguments.
2021-09-22 17:26:02 +02:00