Commit Graph

263 Commits

Author SHA1 Message Date
Thomas Haller
389197fa81 gitlab-ci: allow enabling/disabling building documentation in "nm-ci-run.sh"
g-ir-scanner does not support building with clang, due to [1], [2], [3].

It triggers

    checking if /usr/bin/g-ir-scanner works... no (compiler failure -- check config.log)
    configure: error: introspection enabled but can't be used

with

    clang-7: error: unknown argument: '-fstack-clash-protection'

See also commit 99b92fd992, which adds this configure
check.

Honor the environment variable WITH_DOCS to allow the caller to overwrite
the automatic detection that the script does.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=757934
[2] https://gitlab.gnome.org/GNOME/gobject-introspection/issues/150
[3] c14d037228
2019-02-07 17:31:31 +01:00
Thomas Haller
f1714b485d gitlab-ci: minor cleanup of "contrib/scripts/nm-ci-run.sh" script 2019-02-05 13:49:20 +01:00
Thomas Haller
cce3c0c63d contrib: adjust NM-log for changes to platform logging
Fixes: 8f107f5c00
2018-12-30 15:17:11 +01:00
Thomas Haller
e498f594bb checkpatch: warn if there is a file "TODO.txt"
This allows us to add a file "TODO.txt" in the top level directory.
This file is not intended to be merged to master, but keep track of
stuff that is still to do before merging a branch.

Let checkpatch.pl warn about the presence of such a file.
2018-12-30 15:17:11 +01:00
Thomas Haller
fc052494d1 checkpatch: warn about suspicious gtk-doc annotations
It's

    (allow-none):

and

    (transfer none):

That's confusing enough. Add a check.
2018-12-30 15:17:11 +01:00
Thomas Haller
122aa550d2 gitlab-ci: patch gtk-doc to generate valid documentation
We generate documentation for pages ([1], [2]), hence, we need to patch
gtk-doc [3].

[1] https://networkmanager.pages.freedesktop.org/NetworkManager/NetworkManager/
[2] https://networkmanager.pages.freedesktop.org/NetworkManager/libnm/
[3] https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2
2018-12-01 08:55:44 +01:00
Thomas Haller
763cb8d486 ci: use common script for tests on travis and gitlab
For one, it's not unreasonable that we want to run the same
tests both for gitlab and travis.

Move the actual tests into a script, which is called by both
CI environments.

We still can do something different, based on the environment.
The advantage here is, that the common part will be shared, and
the places where we differ can easily be spot.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/44
2018-11-12 11:29:37 +01:00
Thomas Haller
f8fed7dd52 checkpatch: complain about XXX markers in code
We have a few source code tags like "TODO" and "FIXME".
"XXX" is not intended to be merged, it is for marking
places in code while still working on it.
2018-10-25 11:20:10 +02:00
Thomas Haller
6978558e8c contrib: adjust NM-log for changes to platform logging
Fixes: 8f107f5c00
2018-10-23 12:03:59 +02:00
Thomas Haller
301d703bc3 checkpatch: quote variable in "checkpatch-feature-branch.sh" 2018-10-22 18:21:41 +02:00
Thomas Haller
924a895a1a checkpatch: support ranges for "checkpatch-feature-branch.sh"
Improve "checkpatch-feature-branch.sh" to support accepting
range as argument.
2018-10-22 14:09:47 +02:00
Thomas Haller
4543785438 checkpatch: fix "checkpatch-feature-branch.sh" for master branch
The main purpose of "checkpatch-feature-branch.sh" is to test all
patches of a feature branch. When we run the script against master
(or nm-1-*), then there is no feature branch.

Previously, the script would just error out.

That is not very useful, in particular as we call this from gitlab-ci,
which also runs on master.

Instead, in that case, test the HEAD.
2018-10-22 13:35:20 +02:00
Thomas Haller
369446eae6 checkpatch: add "contrib/scripts/checkpatch-feature-branch.sh" script
This takes current HEAD branch, and finds all the commits what
are not on master or one of the nm-1-* branches, and runs
checkpatch.pl on each.

The use is to run checkpatch.pl on all patches of a feature
branch.
2018-10-22 13:19:15 +02:00
Thomas Haller
8221f824f3 checkpatch: complain about Emacs file variables in source code 2018-10-18 12:16:55 +02:00
Lubomir Rintel
0d3c6072f5 contrib/checkpatch: remove the first character off a diff
Otherwise the leading whitespace checks won't work on patches.
2018-10-07 15:46:02 +02:00
Lubomir Rintel
587f006690 contrib/checkpatch: check some more whitespace trouble 2018-10-07 15:46:02 +02:00
Lubomir Rintel
1d57aefa41 contrib/checkpatch: correctly separate indentation across hunks 2018-10-07 15:46:02 +02:00
Lubomir Rintel
66ddc92135 checkpatch: detect some whitespace errors
Vim's trademark.
2018-09-24 13:21:12 +02:00
Thomas Haller
cf02b9c5df checkpatch.pl: complain about space in elvis operator ?: 2018-08-09 17:07:23 +02:00
Javier Arteaga
6c3174f6e0 checkpatch: fix perldoc heading
The script does not actually emulate a serial modem (yet).

https://github.com/NetworkManager/NetworkManager/pull/165
2018-07-12 07:40:02 +02:00
Lubomir Rintel
7e98b4cad2 checkpatch: skip foreign code 2018-07-11 12:02:06 +02:00
Lubomir Rintel
2b152a69c4 checkpatch: add a licensing hint 2018-07-11 12:02:06 +02:00
Lubomir Rintel
26910ebdd7 checkpatch: reset line counter on next file 2018-07-11 12:02:06 +02:00
Thomas Haller
24082ad09e checkpatch: check against using "unsigned int" and "$INT_TYPE unsigned|signed"
Don't use the integer type before signed/unsigned, but the
other way around. That is,

    unsigned long var;

instead of

    long unsigned var;

Also, just use "unsigned" instead of "unsigned int".
2018-07-11 12:02:06 +02:00
Thomas Haller
a9d81031f4 checkpatch: skip over generated files from glib-mkenums 2018-07-11 12:02:06 +02:00
Thomas Haller
2d28d5d5d4 checkpatch: warn about non-leading tabs
Tabs are not only wrong after a space, they are always
wrong if they don't appear at the beginning of a line.
That would happen usually, when trying to align multiple
lines like

  enum {
      VALUE1		= 1;
      OTHER_VALUE	= 2;
  };

When doing that, the alignment will only be correct, if the
reader later uses the same tab-width. Note that in NetworkManager
we recommend the tab-width to be 4 characters, but with our "smart
tab" indentation style, it wouldn't actually matter and the reader
is free to choose any other tab-width -- as long as we don't use
non-leading tabs.

Don't allow non-leading tabs.
2018-07-11 12:02:06 +02:00
Thomas Haller
e82e2ca730 checkpatch: warn about using glib typedefs like gchar or gint
We should not use glib typedefs for basic C types char, short, int,
long, float or double. We commonly do not use them, so enforce
consistency.

That is not true for typedefs like guint, which we commonly use
because it's shorter typing than "unsigned int" (or "int unsigned"
or "unsigned"). Whether or not to use guint is left undecided at this
point.
2018-07-11 12:02:06 +02:00
Lubomir Rintel
c866df7997 contrib/checkpatch: print the actual source name instead of patch name
This gives more relevant output in a commit check.

Include a couple of small fixes trivial enough not to deserve a separate
commit.
2018-07-10 13:32:04 +02:00
Lubomir Rintel
0f3f56695a contrib: add checkpatch.pl
A naive code compliance checker. Invoke directly:

  contrib/scripts/checkpatch.pl 0001-switch-comments-to-klingon.patch
  contrib/scripts/checkpatch.pl hello.[ch] world.c

Use from a commit hook:

  echo 'git format-patch --stdout -1 |contrib/scripts/checkpatch.pl || :>' \
      >.git/hooks/post-commit

Or view the documentation with "perldoc contrib/scripts/checkpatch.pl"
2018-07-10 12:41:37 +02:00
Thomas Haller
3d41812945 contrib: add -h option to NM-log
Pass "-h" to highlight individual words.
"-h" stands for "highlight".

  $ NM-log -h wlan0 j
2018-02-12 13:06:49 +01:00
Thomas Haller
28da0154fc all: drop trailing spaces 2018-02-07 13:32:04 +01:00
Thomas Haller
7573594a21 platform: merge nm_platform_*_delete() delete functions
It only makes sense to call delete() with NMPObjects that
we obtained from the platform cache. Otherwise, if we didn't
get it from the cache in the first place, we wouldn't know
what to delete.

Hence, the input argument is (almost) always an NMPObject
in the first place. That is different from add(), where
we might create a new specific NMPlatform* instance on the
stack. For add() it makes slightly more sense to have different
functions depending on the type. For delete(), it doesn't.
2017-12-11 10:30:26 +01:00
Thomas Haller
8649fcf02a contrib: use less in NM-log to pre-process input
GNU less supports filters. That makes it nice to use instead of cat.
Also, less is well suited for output to a pipe.

With this, `NM-log nm-log.txt.gz` works as you would expect
2017-11-21 15:14:32 +01:00
Thomas Haller
102a58bb62 contrib/scripts: fix coloring for platform messages in NM-log for old logs
Older logfiles contain

  platform: route: adding or updating IPv4 route: 10.1.0

Hightlight that too.
2017-10-03 15:35:56 +02:00
Thomas Haller
18f53a8b30 contrib/scripts: update coloring for platform messages in NM-log (2)
Fixes: 9344013977
2017-09-25 18:36:08 +02:00
Thomas Haller
9344013977 contrib/scripts: update coloring for platform messages in NM-log 2017-09-25 15:13:02 +02:00
Thomas Haller
66a09b2192 contrib/NM-log: don't use exec in bash functions
When sourcing the file, using exec inside NM-show-journal is a bad idea,
because it replaces the calling shell.
2017-09-08 17:18:32 +02:00
Thomas Haller
d4a5e2b1c8 contrib/NM-log: don't run less with --quit-on-intr argument
I find it annoying when ^C exits less and it prompts me to often
do `NM-log | less -R` instead.
2017-09-07 14:45:26 +02:00
Thomas Haller
83e2764050 contrib/NM-log: colorize warnings and errors in red (fix)
Must not colorize the trailing space, otherwise the following
" device" will no longer match.
2017-09-07 14:29:11 +02:00
Thomas Haller
b20fc58b3c contrib/NM-log: colorize warnings and errors in red
- remove "\r\n" line endings
- colorize <warn> and <error> in red
- extend matching the info levels to include the timestamp. This
  (intentionally) will no longer highlight messages from ModemManager,
  which don't include a timestamp.
2017-09-07 14:24:56 +02:00
Thomas Haller
cffde0101e contrib/NM-log: improve script and make it sourceable
- use "grep -a" so that grep doesn't refuse to work in binary input.
- make the script source-able to only define the NM-colorize and
  NM-show-journal
- In case the script is sourced, it also defines a NM-log function,
  which does the same as the script itself.
- rename internal functions so that they have names starting with "NM"
  in case of sourcing.
2017-09-07 14:04:13 +02:00
Thomas Haller
1fbd8c079c contrib/scripts: add NM-log helper
To pretty print and colorize NetworkManager logfiles.
2017-08-24 18:40:49 +02:00
Beniamino Galvani
c46627e1dc contrib: add macsec test script 2017-01-16 17:47:10 +01:00
Jiří Klimeš
c391fb299b nm-import-openvpn: sort the options alphabetically 2016-11-10 20:56:44 +01:00
Jiří Klimeš
3219bb3b76 nm-import-openvpn: remove old code for 'dev' option 2016-11-10 20:56:44 +01:00
Jiří Klimeš
79643ce28a nm-import-openvpn: parse quoted string as a single word
It is necessary, for example, for this to work:
verify-x509-name "C=US, L=Cambridge, CN=GNOME, emailAddress=networkmanager-list@gnome.org" subject
2016-11-10 20:56:44 +01:00
Jiří Klimeš
c4ed2483b2 nm-import-openvpn: import 'verify-x509-name' option
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=b51b3562ce079cc0be426e968fe1c90faadc0efd
2016-11-10 20:56:44 +01:00
Jiří Klimeš
bc446c3ab8 nm-import-openvpn: improve importing 'comp-lzo' option
https://bugzilla.gnome.org/show_bug.cgi?id=769177
https://bugzilla.redhat.com/show_bug.cgi?id=1355688
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833166
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=62bdd278d69cc396479af9d05a0b776d5ad386bf
2016-11-10 20:56:44 +01:00
Jiří Klimeš
e58cfa4fc1 nm-import-openvpn: improve parsing and checking 'route' option 2016-11-10 20:56:44 +01:00
Jiří Klimeš
f7e4b748e1 nm-import-openvpn: import 'ns-cert-type' option
https://bugzilla.gnome.org/show_bug.cgi?id=719430
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=644e55ed404edbc953e323d13c57297b53cc0f8b
2016-11-10 20:56:44 +01:00