Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package wl-clipboard for openSUSE:Factory 
checked in at 2022-03-30 20:35:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/wl-clipboard (Old)
 and      /work/SRC/openSUSE:Factory/.wl-clipboard.new.1900 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "wl-clipboard"

Wed Mar 30 20:35:47 2022 rev:2 rq:965830 version:2.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/wl-clipboard/wl-clipboard.changes        
2020-07-06 16:37:08.484610223 +0200
+++ /work/SRC/openSUSE:Factory/.wl-clipboard.new.1900/wl-clipboard.changes      
2022-03-30 20:35:50.325311745 +0200
@@ -1,0 +2,9 @@
+Tue Mar 29 12:57:53 UTC 2022 - Timothy Brown <[email protected]>
+
+- Update to version 2.1.0:
+  * fixed wl-copy hang when followed by a pipe
+    (e.g. echo "text to copy" | wl-copy | cat)
+  * fixed an occasional crash
+  * added fish completions
+
+-------------------------------------------------------------------

Old:
----
  v2.0.0.tar.gz

New:
----
  v2.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ wl-clipboard.spec ++++++
--- /var/tmp/diff_new_pack.qcmXUl/_old  2022-03-30 20:35:50.857312183 +0200
+++ /var/tmp/diff_new_pack.qcmXUl/_new  2022-03-30 20:35:50.869312193 +0200
@@ -1,7 +1,7 @@
 #
-# spec file for package slurp
+# spec file for package wl-clipboard
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,26 +12,27 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 Name:           wl-clipboard
-Version:        2.0.0
+Version:        2.1.0
 Release:        0
 License:        GPL-3.0-only
 Summary:        Wayland Clipboard Utilities
-Url:            https://github.com/bugaevc/wl-clipboard
+URL:            https://github.com/bugaevc/wl-clipboard
 Group:          Productivity/Graphics/Other
 Source:         https://github.com/bugaevc/%{name}/archive/v%{version}.tar.gz
-BuildRequires:  meson >= 0.43.0
-BuildRequires:  wayland-devel
+BuildRequires:  meson >= 0.44.0
 BuildRequires:  pkgconfig
+BuildRequires:  wayland-devel
 BuildRequires:  pkgconfig(wayland-client)
 BuildRequires:  pkgconfig(wayland-cursor)
 BuildRequires:  pkgconfig(wayland-protocols) >= 1.17
 BuildRequires:  pkgconfig(wayland-server) >= 1.16
-Recommends:     xdg-utils
 Recommends:     mailcap
+Recommends:     xdg-utils
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
@@ -47,6 +48,15 @@
 %description bash-completion
 Bash command line completion support for %{name}.
 
+%package fish-completion
+Summary:        Fish completion for %{name}
+Requires:       %{name} = %{version}
+Supplements:    (%{name} and fish)
+BuildArch:      noarch
+
+%description fish-completion
+Fish command line completion support for %{name}.
+
 %package zsh-completion
 Summary:        Zsh completion for %{name}
 Requires:       %{name} = %{version}
@@ -82,6 +92,12 @@
 %{_datadir}/zsh/site-functions/_wl-copy
 %{_datadir}/zsh/site-functions/_wl-paste
 
+%files fish-completion
+%dir %{_datadir}/fish
+%dir %{_datadir}/fish/vendor_completions.d
+%{_datadir}/fish/vendor_completions.d/wl-copy.fish
+%{_datadir}/fish/vendor_completions.d/wl-paste.fish
+
 %files bash-completion
 %{_datadir}/bash-completion/completions/wl-copy
 %{_datadir}/bash-completion/completions/wl-paste

++++++ v2.0.0.tar.gz -> v2.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/completions/fish/meson.build 
new/wl-clipboard-2.1.0/completions/fish/meson.build
--- old/wl-clipboard-2.0.0/completions/fish/meson.build 1970-01-01 
01:00:00.000000000 +0100
+++ new/wl-clipboard-2.1.0/completions/fish/meson.build 2022-03-19 
13:12:00.000000000 +0100
@@ -0,0 +1,18 @@
+fish_completion_dir = get_option('fishcompletiondir')
+fish = dependency('fish', required : false)
+
+if fish_completion_dir == '' and fish.found()
+    fish_completion_dir = fish.get_pkgconfig_variable('completionsdir')
+elif fish_completion_dir == ''
+    # Fish does not look in /usr/local/, which is the default prefix,
+    # so we cannot use get_option("datadir"). Instead, they recommend
+    # custom completions to be installed into 
/usr/share/fish/vendor_completions.d,
+    # so we use that. Note that this is a fallback in case you neither
+    # have fish installed, nor have specified a path explicitly
+    fish_completion_dir = '/usr/share/fish/vendor_completions.d'
+endif
+
+if fish_completion_dir != 'no'
+    install_data('wl-copy.fish', install_dir: fish_completion_dir)
+    install_data('wl-paste.fish', install_dir: fish_completion_dir)
+endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/completions/fish/wl-copy.fish 
new/wl-clipboard-2.1.0/completions/fish/wl-copy.fish
--- old/wl-clipboard-2.0.0/completions/fish/wl-copy.fish        1970-01-01 
01:00:00.000000000 +0100
+++ new/wl-clipboard-2.1.0/completions/fish/wl-copy.fish        2022-03-19 
13:12:00.000000000 +0100
@@ -0,0 +1,21 @@
+function __wayland_seats --description 'Print all wayland seats'
+    if type -q weston-info
+        weston-info 2>/dev/null | sed -n '/wl_seat/{n;s/\s*name: //;p}'
+    else if type -q loginctl
+        loginctl --no-legend --no-pager list-seats 2>/dev/null
+    else
+        # Fallback seat
+        echo "seat0"
+    end
+
+end
+
+complete -c wl-copy -x
+complete -c wl-copy -s h -l help -d 'Display a help message'
+complete -c wl-copy -s v -l version -d 'Display version info'
+complete -c wl-copy -s o -l paste-once -d 'Only serve one paste request and 
then exit'
+complete -c wl-copy -s c -l clear -d 'Instead of copying anything, clear the 
clipboard'
+complete -c wl-copy -s p -l primary -d 'Use the "primary" clipboard'
+complete -c wl-copy -s n -l trim-newline -d 'Do not copy the trailing newline 
character'
+complete -c wl-copy -s t -l type -x -d 'Override the inferred MIME type for 
the content' -a "(__fish_print_xdg_mimetypes)"
+complete -c wl-copy -s s -l seat -x -d 'Pick the seat to work with' -a 
"(__wayland_seats)"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/completions/fish/wl-paste.fish 
new/wl-clipboard-2.1.0/completions/fish/wl-paste.fish
--- old/wl-clipboard-2.0.0/completions/fish/wl-paste.fish       1970-01-01 
01:00:00.000000000 +0100
+++ new/wl-clipboard-2.1.0/completions/fish/wl-paste.fish       2022-03-19 
13:12:00.000000000 +0100
@@ -0,0 +1,46 @@
+function __wayland_seats --description 'Print all wayland seats'
+    if type -q weston-info
+        weston-info 2>/dev/null | sed -n '/wl_seat/{n;s/\s*name: //;p}'
+    else if type -q loginctl
+        loginctl --no-legend --no-pager list-seats 2>/dev/null
+    else
+        # Fallback seat
+        echo "seat0"
+    end
+end
+
+function __wl_paste_types --description 'Print types with context'
+    set -l type (commandline -o)
+
+    for i in (seq (count $type))
+        if [ "$type[$i]" = '--primary' ]; or [ "$type[$i]" = '-p' ]
+            set clip "primary"
+        else if [ "$type[$i]" = '--seat' ]; or [ "$type[$i]" = '-s' ]
+            set seat $type[(math $i + 1)]
+        end
+    end
+
+    # Note fish does not handle passing unset variables
+    # to commands well, thus setting clip to "--primary" and passing
+    # that to wl-paste wont work, so if statements are used instead
+    if test -n "$seat"; and test -n "$clip"
+        wl-paste 2>/dev/null --seat "$seat" -p -l
+    else if test -n "$seat"
+        wl-paste 2>/dev/null --seat "$seat" -l
+    else if test -n "$clip"
+        wl-paste 2>/dev/null -p -l
+    else
+        wl-paste 2>/dev/null -l
+    end
+end
+
+complete -c wl-paste -f
+complete -c wl-paste -f -n '__fish_contains_opt -s w watch' -a 
"(__fish_complete_subcommand -- -s --seat -t --type)"
+complete -c wl-paste -n '__fish_not_contain_opt -s w watch' -s h -l help -d 
'Display a help message'
+complete -c wl-paste -n '__fish_not_contain_opt -s w watch' -s v -l version -d 
'Display version info'
+complete -c wl-paste -n '__fish_not_contain_opt -s w watch' -s n -l no-newline 
-d 'Do not append a newline character'
+complete -c wl-paste -n '__fish_not_contain_opt -s w watch' -s l -l list-types 
-d 'Instead of pasting, list the offered types'
+complete -c wl-paste -n '__fish_not_contain_opt -s w watch' -s p -l primary -d 
'Use the "primary" clipboard'
+complete -c wl-paste -n '__fish_not_contain_opt -s w watch' -s w -l watch -d 
'Run a command each time the selection changes'
+complete -c wl-paste -n '__fish_not_contain_opt -s w watch' -s t -l type -x -d 
'Override the inferred MIME type for the content' -a "(__wl_paste_types)"
+complete -c wl-paste -n '__fish_not_contain_opt -s w watch' -s s -l seat -x -d 
'Pick the seat to work with' -a "(__wayland_seats)"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/completions/meson.build 
new/wl-clipboard-2.1.0/completions/meson.build
--- old/wl-clipboard-2.0.0/completions/meson.build      2019-10-03 
14:16:09.000000000 +0200
+++ new/wl-clipboard-2.1.0/completions/meson.build      2022-03-19 
13:12:00.000000000 +0100
@@ -1,2 +1,3 @@
 subdir('bash')
 subdir('zsh')
+subdir('fish')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/meson.build 
new/wl-clipboard-2.1.0/meson.build
--- old/wl-clipboard-2.0.0/meson.build  2019-10-03 14:16:09.000000000 +0200
+++ new/wl-clipboard-2.1.0/meson.build  2022-03-19 13:12:00.000000000 +0100
@@ -1,5 +1,5 @@
 project('wl-clipboard', 'c',
-    version: '2.0.0',
+    version: '2.1.0',
     license: 'GPL3+',
     meson_version: '>= 0.44.0',
     default_options: 'c_std=gnu99'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/meson_options.txt 
new/wl-clipboard-2.1.0/meson_options.txt
--- old/wl-clipboard-2.0.0/meson_options.txt    2019-10-03 14:16:09.000000000 
+0200
+++ new/wl-clipboard-2.1.0/meson_options.txt    2022-03-19 13:12:00.000000000 
+0100
@@ -3,3 +3,8 @@
     value: '',
     description: 'Directory for zsh completions. Set "no" to disable.'
 )
+option('fishcompletiondir',
+    type: 'string',
+    value: '',
+    description: 'Directory for fish completions. Set "no" to disable.'
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/src/types/copy-action.c 
new/wl-clipboard-2.1.0/src/types/copy-action.c
--- old/wl-clipboard-2.0.0/src/types/copy-action.c      2019-10-03 
14:16:09.000000000 +0200
+++ new/wl-clipboard-2.1.0/src/types/copy-action.c      2022-03-19 
13:12:00.000000000 +0100
@@ -35,12 +35,18 @@
     /* Set the selection and make sure it reaches
      * the display before we do anything else,
      * such as destroying the surface or exiting.
+     * Make sure to unset the callback to prevent
+     * reentrancy issues.
      */
+    if (self->popup_surface != NULL) {
+        self->popup_surface->on_focus = NULL;
+        self->popup_surface->data = NULL;
+    }
     device_set_selection(self->device, self->source, serial, self->primary);
     wl_display_roundtrip(self->device->wl_display);
 
     /* Now, if we have used a popup surface, destroy it */
-    if (self->device->needs_popup_surface) {
+    if (self->popup_surface != NULL) {
         popup_surface_destroy(self->popup_surface);
         self->popup_surface = NULL;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/src/types/offer.h 
new/wl-clipboard-2.1.0/src/types/offer.h
--- old/wl-clipboard-2.0.0/src/types/offer.h    2019-10-03 14:16:09.000000000 
+0200
+++ new/wl-clipboard-2.1.0/src/types/offer.h    2022-03-19 13:12:00.000000000 
+0100
@@ -37,12 +37,11 @@
 #define offer_for_each_mime_type(offer, mime_type) \
 for ( \
     const char *mime_type = offer->offered_mime_types.data; \
-    mime_type != offer->offered_mime_types.data + \
-                 offer->offered_mime_types.size; \
+    mime_type != (const char *) offer->offered_mime_types.data + \
+                                offer->offered_mime_types.size; \
     mime_type += strlen(mime_type) + 1 \
 )
 
-
 void offer_receive(struct offer *self, const char *mime_type, int fd);
 void offer_destroy(struct offer *self);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/src/util/files.c 
new/wl-clipboard-2.1.0/src/util/files.c
--- old/wl-clipboard-2.0.0/src/util/files.c     2019-10-03 14:16:09.000000000 
+0200
+++ new/wl-clipboard-2.1.0/src/util/files.c     2022-03-19 13:12:00.000000000 
+0100
@@ -123,8 +123,13 @@
         close(pipefd[0]);
         close(pipefd[1]);
         int devnull = open("/dev/null", O_RDONLY);
-        dup2(devnull, STDIN_FILENO);
-        close(devnull);
+        if (devnull >= 0) {
+            dup2(devnull, STDIN_FILENO);
+            close(devnull);
+        } else {
+            /* If we cannot open /dev/null, just close stdin */
+            close(STDIN_FILENO);
+        }
         execlp("xdg-mime", "xdg-mime", "query", "filetype", file_path, NULL);
         exit(1);
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wl-clipboard-2.0.0/src/wl-copy.c 
new/wl-clipboard-2.1.0/src/wl-copy.c
--- old/wl-clipboard-2.0.0/src/wl-copy.c        2019-10-03 14:16:09.000000000 
+0200
+++ new/wl-clipboard-2.1.0/src/wl-copy.c        2022-03-19 13:12:00.000000000 
+0100
@@ -30,8 +30,10 @@
 #include <wayland-client.h>
 #include <unistd.h>
 #include <string.h>
+#include <fcntl.h> // open
 #include <libgen.h>
 #include <getopt.h>
+#include <signal.h>
 
 static struct {
     int stay_in_foreground;
@@ -53,7 +55,21 @@
          * We fork our process and leave the
          * child running in the background,
          * while exiting in the parent.
+         * Also replace stdin/stdout with
+         * /dev/null so the stdout file
+         * descriptor isn't kept alive.
          */
+        int devnull = open("/dev/null", O_RDWR);
+        if (devnull >= 0) {
+            dup2(devnull, STDOUT_FILENO);
+            dup2(devnull, STDIN_FILENO);
+            close(devnull);
+        } else {
+            /* If we cannot open /dev/null, just close stdin/stdout */
+            close(STDIN_FILENO);
+            close(STDOUT_FILENO);
+        }
+        signal(SIGHUP, SIG_IGN);
         pid_t pid = fork();
         if (pid < 0) {
             perror("fork");

Reply via email to