Commit graph

18 commits

Author SHA1 Message Date
Thomas Haller 3b69f02164 all: unify format of our Copyright source code comments
```bash

readarray -d '' FILES < <(
  git ls-files -z \
    ':(exclude)po' \
    ':(exclude)shared/c-rbtree' \
    ':(exclude)shared/c-list' \
    ':(exclude)shared/c-siphash' \
    ':(exclude)shared/c-stdaux' \
    ':(exclude)shared/n-acd' \
    ':(exclude)shared/n-dhcp4' \
    ':(exclude)src/systemd/src' \
    ':(exclude)shared/systemd/src' \
    ':(exclude)m4' \
    ':(exclude)COPYING*'
  )

sed \
  -e 's/^\(--\|#\| \*\) *\(([cC]) *\)\?Copyright \+\(\(([cC])\) \+\)\?\(\(20\|19\)[0-9][0-9]\) *[-–] *\(\(20\|19\)[0-9][0-9]\) \+\([^ ].*\)$/\1 C1pyright#\5 - \7#\9/' \
  -e 's/^\(--\|#\| \*\) *\(([cC]) *\)\?Copyright \+\(\(([cC])\) \+\)\?\(\(20\|19\)[0-9][0-9]\) *[,] *\(\(20\|19\)[0-9][0-9]\) \+\([^ ].*\)$/\1 C2pyright#\5, \7#\9/' \
  -e 's/^\(--\|#\| \*\) *\(([cC]) *\)\?Copyright \+\(\(([cC])\) \+\)\?\(\(20\|19\)[0-9][0-9]\) \+\([^ ].*\)$/\1 C3pyright#\5#\7/' \
  -e 's/^Copyright \(\(20\|19\)[0-9][0-9]\) \+\([^ ].*\)$/C4pyright#\1#\3/' \
  -i \
  "${FILES[@]}"

echo ">>> untouched Copyright lines"
git grep Copyright "${FILES[@]}"

echo ">>> Copyright lines with unusual extra"
git grep '\<C[0-9]pyright#' "${FILES[@]}" | grep -i reserved

sed \
  -e 's/\<C[0-9]pyright#\([^#]*\)#\(.*\)$/Copyright (C) \1 \2/' \
  -i \
  "${FILES[@]}"

```

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/298
2019-10-02 17:03:52 +02:00
Lubomir Rintel 24028a2246 all: SPDX header conversion
$ find * -type f |xargs perl contrib/scripts/spdx.pl
  $ git rm contrib/scripts/spdx.pl
2019-09-10 11:19:56 +02:00
Thomas Haller c0e075c902 all: drop emacs file variables from source files
We no longer add these. If you use Emacs, configure it yourself.

Also, due to our "smart-tab" usage the editor anyway does a subpar
job handling our tabs. However, on the upside every user can choose
whatever tab-width he/she prefers. If "smart-tabs" are used properly
(like we do), every tab-width will work.

No manual changes, just ran commands:

    F=($(git grep -l -e '-\*-'))
    sed '1 { /\/\* *-\*-  *[mM]ode.*\*\/$/d }'     -i "${F[@]}"
    sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}"

Check remaining lines with:

    git grep -e '-\*-'

The ultimate purpose of this is to cleanup our files and eventually use
SPDX license identifiers. For that, first get rid of the boilerplate lines.
2019-06-11 10:04:00 +02:00
Corentin Noël 468a019333 gobject-introspection: made several fixes to the annotations
https://bugzilla.gnome.org/show_bug.cgi?id=794658
2018-03-26 12:45:49 +02:00
Thomas Haller 1c42375efb libnm/vpn: pass NMVpnPluginInfo to the NMVpnEditorPlugin instance
The NMVpnPluginInfo is essentially the .name file, that is, a
configuration file about the plugin itself. Via NMVpnPluginInfo
instance, the NMVpnEditorPlugin can be created.

Usually, one would create a NMVpnPluginInfo (that is, reading the
.name file) and then create a NMVpnEditorPlugin instance from there.
In this case, usually the editor-plugin is owned by the plugin-info
instance (although the API allows for creating the editor-plugin
independently).

Now, pass the  NMVpnPluginInfo to the editor-plugin too.
This is useful, because then the editor-plugin can look at the .name
file.

The .name file is not user configuration. Instead it is configuration
about the plugin itself. Although the .name file is part of the plugin
build artefacts, it is useful to allow the plugin to access the .name
file. The reason is, that this can allow the user to easily change a
configuration knob of the plugin without requiring to patch or the
plugin.
2016-06-15 10:32:32 +02:00
Thomas Haller 46665898bb libnm/vpn: add nm_vpn_plugin_info_list_find_service_name() function 2016-06-15 10:32:32 +02:00
Thomas Haller 10445bedb8 libnm/vpn: add nm_vpn_plugin_info_get_aliases 2016-06-15 10:32:32 +02:00
Beniamino Galvani f1d23c32c3 docs: libnm: add doc comment to types
This is required to add objects in the "Types and Values" section and
in the API index. Later, we may want to add useful content in those
empty comments.
2016-05-05 17:01:57 +02:00
Thomas Haller 4271c9650c libnm/vpn: add nm_vpn_plugin_info_new_search_file() 2016-04-22 14:17:02 +02:00
Thomas Haller 67415f0c5e libnm/vpn: add nm_vpn_plugin_info_supports_hints() 2016-04-22 14:17:02 +02:00
Thomas Haller a3f94f451b libnm/vpn: add nm_vpn_plugin_info_get_auth_dialog() 2016-04-22 14:17:02 +02:00
Thomas Haller 0d95ed3bb8 libnm/vpn: add nm_vpn_plugin_info_get_service()
Re-add nm_vpn_plugin_info_get_service(). This function *is* useful
and could be used by nm-applet.

This reverts commit 3517084b92.
2016-04-22 14:17:02 +02:00
Lubomir Rintel 3517084b92 vpn-plugin-info: drop nm_vpn_plugin_info_get_service()
It is not used externally and its use might be confusing and undesired when we
add plugin aliases. The external users should only use the name when idenfiying
the plugin and nm_vpn_plugin_info_list_find_by_service() when matchin the plugin.
2015-11-02 16:01:21 +01:00
Lubomir Rintel 6c213e3cb4 libnm-core/vpn-plugin-info: add nm_vpn_plugin_info_supports_multiple() 2015-10-13 18:20:56 +02:00
Thomas Haller e0bded93f3 libnm: avoid deprecated warning for NMVpnPluginInfo
When merely including "nm-vpn-plugin-info.h" (or "NetworkManager.h")
gcc raises warnings like:
  "Not available before 1.2 [-Werror=deprecated-declarations]"

The problem is that the NMVpnPluginInfo typedef itself is marked as
deprecated but also used by other functions like nm_vpn_plugin_info_get_name().

    typedef struct {
        int field;
    } Foo G_UNAVAILABLE(1,2);

    G_UNAVAILABLE(1,2)
    void deprecated_function (Foo *foo);

    warning: ‘Foo’ is deprecated: Not available before 1.2 [-Wdeprecated-declarations]

I think that when a function is itself deprecated, gcc should not warn about
the use of a deprecated typedef.
Gcc's documentation states: "Note that the warnings only occur for
uses and then only if the type is being applied to an identifier
that itself is not being declared as deprecated.".
Apparently, this only works for structs, but not for typedef of structs.

Anyway. Remove the deprecation from NMVpnPluginInfo to avoid the compiler
warning.

https://bugzilla.gnome.org/show_bug.cgi?id=753098

Fixes: d6226bd987
2015-08-04 15:59:32 +02:00
Dan Williams 3a7db0dd9e introspection: fix some annotations
Fixes: eafa6c3584
Fixes: eed0d0c58f
Fixes: b5cc017ba4
Fixes: bce040daa2
2015-07-31 14:19:14 -05:00
Thomas Haller eafa6c3584 libnm: add load method to NMVpnPluginInfo
https://bugzilla.gnome.org/show_bug.cgi?id=749877
2015-07-29 22:34:35 +02:00
Thomas Haller d6226bd987 libnm: add NMVpnPluginInfo class
NMVpnPluginInfo is little more then a wrapper around
the GKeyFile that describes the VPN plugin settings,
i.e. the name files under "/etc/NetworkManager/VPN/".

Add this class to make the VPN API more explicit. Clients
now can use NMVpnPluginInfo instead of concerning themselves
with loading the keyfile and the meaning of its properties.

Also add support for a new VPN plugins directory
"/usr/lib/NetworkManager/VPN", which should replace
"/etc/NetworkManager/VPN" in the future. But we have to
consider both locations for backward compatibility.

The content of the VPN directory is not user configuration,
hence it should not be under "/etc". See related bug 738853.
2015-07-29 22:34:35 +02:00