From 08891872607120602f2433eaeab08cfc12144442 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 1 Jun 2018 17:19:12 -0700 Subject: [PATCH] Fix GGO #1 (nm-c-e --keep-above fails with any other arg) Backport the MR I sent to fix this bug, so Rawhide is fixed on next compose - if a different fix is chosen upstream we can just back this out / replace it with that one. --- ...e-passed-through-to-editor_command_l.patch | 49 +++++++++++++++++++ network-manager-applet.spec | 11 ++++- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 0001-Handle-keep-above-passed-through-to-editor_command_l.patch diff --git a/0001-Handle-keep-above-passed-through-to-editor_command_l.patch b/0001-Handle-keep-above-passed-through-to-editor_command_l.patch new file mode 100644 index 0000000..c25d753 --- /dev/null +++ b/0001-Handle-keep-above-passed-through-to-editor_command_l.patch @@ -0,0 +1,49 @@ +From 19a00beed249cb5f261ff235781b961f4d3b5d1c Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Fri, 1 Jun 2018 16:20:34 -0700 +Subject: [PATCH] Handle --keep-above passed through to editor_command_line + +Handling of nm-connection-editor command line arguments was +changed in f3782da2. Since that commit, most args are handled +by `editor_command_line`, but one (`--keep-above`) is handled +by `main`. Unfortunately, if `--keep-above` appears with other +arguments, `main` does not strip it from argv and parsing in +`editor_command_line` fails with "Failed to parse options". + +To handle this, let's just have `editor_command_line` recognize +but ignore `--keep-above` if it encounters it. + +https://gitlab.gnome.org/GNOME/network-manager-applet/issues/1 + +Signed-off-by: Adam Williamson +--- + src/connection-editor/main.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/connection-editor/main.c b/src/connection-editor/main.c +index 29facda9..92fdbda7 100644 +--- a/src/connection-editor/main.c ++++ b/src/connection-editor/main.c +@@ -224,7 +224,7 @@ editor_command_line (GApplication *application, + GOptionContext *opt_ctx = NULL; + GError *error = NULL; + gs_free char *type = NULL, *uuid = NULL, *import = NULL; +- gboolean create = FALSE, show = FALSE; ++ gboolean create = FALSE, show = FALSE, keepabove = FALSE; + int ret = 1; + GOptionEntry entries[] = { + { "type", 't', 0, G_OPTION_ARG_STRING, &type, "Type of connection to show or create", NM_SETTING_WIRED_SETTING_NAME }, +@@ -232,6 +232,10 @@ editor_command_line (GApplication *application, + { "show", 's', 0, G_OPTION_ARG_NONE, &show, "Show a given connection type page", NULL }, + { "edit", 'e', 0, G_OPTION_ARG_STRING, &uuid, "Edit an existing connection with a given UUID", "UUID" }, + { "import", 'i', 0, G_OPTION_ARG_STRING, &import, "Import a VPN connection from given file", NULL }, ++ /* handled in main but may be passed through here, so we need ++ * to parse and ignore it ++ */ ++ { "keep-above", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &keepabove, NULL, NULL }, + { NULL } + }; + +-- +2.17.0 + diff --git a/network-manager-applet.spec b/network-manager-applet.spec index 76c9dda..3baea5f 100644 --- a/network-manager-applet.spec +++ b/network-manager-applet.spec @@ -5,7 +5,7 @@ %global rpm_version 1.8.12 %global real_version 1.8.12 -%global release_version 2 +%global release_version 3 %global real_version_major %(printf '%s' '%{real_version}' | sed -n 's/^\\([1-9][0-9]*\\.[1-9][0-9]*\\)\\.[1-9][0-9]*$/\\1/p') @@ -26,6 +26,9 @@ Obsoletes: NetworkManager-gnome < %{obsoletes_ver} Source: https://download.gnome.org/sources/network-manager-applet/%{real_version_major}/%{name}-%{real_version}.tar.xz Patch1: 0001-nm-applet-no-notifications.patch +# https://gitlab.gnome.org/GNOME/network-manager-applet/issues/1 +# https://gitlab.gnome.org/GNOME/network-manager-applet/merge_requests/3 +Patch2: 0001-Handle-keep-above-passed-through-to-editor_command_l.patch Requires: NetworkManager >= %{nm_version} Requires: libnotify >= 0.4.3 @@ -125,6 +128,7 @@ This package deprecates libnm-gtk. %prep %setup -q -n "%{name}-%{real_version}" %patch1 -p1 +%patch2 -p1 %build %meson \ @@ -218,7 +222,10 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/nm-connection-edit %changelog -* Mon May 28 2018 Lubomir Rintel - 1.8.12-1 +* Fri Jun 01 2018 Adam Williamson - 1.8.12-3 +- Fix GGO #1 (nm-connection-editor --keep-above fails with any other arg) + +* Mon May 28 2018 Lubomir Rintel - 1.8.12-2 - Update to 1.8.12 release * Fri Feb 09 2018 Igor Gnatenko - 1.8.10-2.2