Date: Wednesday, January 24, 2018 @ 19:25:33
  Author: bgyorgy
Revision: 286651

upgpkg: ristretto 0.8.2-2

Fix opening symlinks and urls (FS#54705)

Added:
  ristretto/trunk/upstream-fixes.patch
Modified:
  ristretto/trunk/PKGBUILD

----------------------+
 PKGBUILD             |   14 +++-
 upstream-fixes.patch |  154 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 165 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2018-01-24 19:25:31 UTC (rev 286650)
+++ PKGBUILD    2018-01-24 19:25:33 UTC (rev 286651)
@@ -6,7 +6,7 @@
 
 pkgname=ristretto
 pkgver=0.8.2
-pkgrel=1
+pkgrel=2
 pkgdesc='Fast and lightweight picture-viewer for Xfce4'
 arch=('x86_64')
 url='http://docs.xfce.org/apps/ristretto/start'
@@ -16,9 +16,17 @@
 optdepends=('librsvg: SVG support'
             'tumbler: thumbnailing support')
 groups=('xfce4-goodies')
-source=("https://archive.xfce.org/src/apps/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.bz2";)
-md5sums=('a8d8bb6b8fa7f868cfa3ae778630946e')
+source=("https://archive.xfce.org/src/apps/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.bz2";
+        upstream-fixes.patch)
+md5sums=('a8d8bb6b8fa7f868cfa3ae778630946e'
+         '6d8eb1cd430de4b4d8227cb12a8bb063')
 
+prepare() {
+  cd "$pkgname-$pkgver"
+  # Fix opening symlinks and urls (FS#54705)
+  patch -Np1 -i ../upstream-fixes.patch
+}
+
 build() {
   cd "$pkgname-$pkgver"
 

Added: upstream-fixes.patch
===================================================================
--- upstream-fixes.patch                                (rev 0)
+++ upstream-fixes.patch        2018-01-24 19:25:33 UTC (rev 286651)
@@ -0,0 +1,154 @@
+From 19e709c4885204be640ccb053de8006e10edb12f Mon Sep 17 00:00:00 2001
+From: Igor <f2...@yandex.ru>
+Date: Sun, 5 Feb 2017 20:12:46 +0300
+Subject: Fix GLib-GObject-CRITICAL in directory monitoring code
+
+---
+ src/image_list.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/src/image_list.c b/src/image_list.c
+index 427d7c3..f37dd8c 100644
+--- a/src/image_list.c
++++ b/src/image_list.c
+@@ -836,11 +836,14 @@ rstto_image_list_monitor_dir (
+                 NULL,
+                 NULL);
+ 
+-        g_signal_connect (
+-                G_OBJECT(monitor),
+-                "changed",
+-                G_CALLBACK (cb_file_monitor_changed),
+-                image_list);
++        if ( monitor != NULL )
++        {
++            g_signal_connect (
++                    G_OBJECT (monitor),
++                    "changed",
++                    G_CALLBACK (cb_file_monitor_changed),
++                    image_list);
++        }
+     }
+ 
+     if (image_list->priv->image_monitors)
+-- 
+cgit v1.1
+
+From dc632fd6669222a93dae45d039f33b537c78ac99 Mon Sep 17 00:00:00 2001
+From: Igor <f2...@yandex.ru>
+Date: Sun, 5 Feb 2017 20:29:48 +0300
+Subject: Fix loading image from an URL
+
+---
+ src/file.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/src/file.c b/src/file.c
+index d915340..00a19bd 100644
+--- a/src/file.c
++++ b/src/file.c
+@@ -398,20 +398,24 @@ rstto_file_get_collate_key ( RsttoFile *r_file )
+ const gchar *
+ rstto_file_get_content_type ( RsttoFile *r_file )
+ {
+-    const gchar *content_type = NULL;
++    const gchar *file_path, *content_type = NULL;
+ 
+     if ( NULL == r_file->priv->content_type )
+     {
+ #if HAVE_MAGIC_H
+-        magic_t magic = magic_open(MAGIC_MIME_TYPE);
++        magic_t magic = magic_open (MAGIC_MIME_TYPE);
+         if ( magic != NULL )
+         {
+-            if ( magic_load(magic, NULL) == 0 )
++            if ( magic_load (magic, NULL) == 0 )
+             {
+-                content_type = magic_file(magic, rstto_file_get_path(r_file));
+-                if ( NULL != content_type )
++                file_path = rstto_file_get_path (r_file);
++                if ( file_path != NULL )
+                 {
+-                    r_file->priv->content_type = g_strdup (content_type);
++                    content_type = magic_file (magic, file_path);
++                    if ( NULL != content_type )
++                    {
++                        r_file->priv->content_type = g_strdup (content_type);
++                    }
+                 }
+             }
+             magic_close(magic);
+-- 
+cgit v1.1
+
+From 6cc891de661ead1359ac83bda22e4de880185b47 Mon Sep 17 00:00:00 2001
+From: Igor <f2...@yandex.ru>
+Date: Sun, 5 Feb 2017 20:40:45 +0300
+Subject: Simplify the code
+
+---
+ src/file.c | 17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/src/file.c b/src/file.c
+index 00a19bd..fd2ff19 100644
+--- a/src/file.c
++++ b/src/file.c
+@@ -404,21 +404,18 @@ rstto_file_get_content_type ( RsttoFile *r_file )
+     {
+ #if HAVE_MAGIC_H
+         magic_t magic = magic_open (MAGIC_MIME_TYPE);
+-        if ( magic != NULL )
++        if ( NULL != magic )
+         {
+-            if ( magic_load (magic, NULL) == 0 )
++            file_path = rstto_file_get_path (r_file);
++            if ( NULL != file_path && magic_load (magic, NULL) == 0 )
+             {
+-                file_path = rstto_file_get_path (r_file);
+-                if ( file_path != NULL )
++                content_type = magic_file (magic, file_path);
++                if ( NULL != content_type )
+                 {
+-                    content_type = magic_file (magic, file_path);
+-                    if ( NULL != content_type )
+-                    {
+-                        r_file->priv->content_type = g_strdup (content_type);
+-                    }
++                    r_file->priv->content_type = g_strdup (content_type);
+                 }
+             }
+-            magic_close(magic);
++            magic_close (magic);
+         }
+ #endif
+ 
+-- 
+cgit v1.1
+
+From 12515dccb354ffc4ffcc0cdd7a14d58e3b2628de Mon Sep 17 00:00:00 2001
+From: Igor <f2...@yandex.ru>
+Date: Mon, 5 Jun 2017 19:02:03 -0400
+Subject: Fix opening image files that are symlinks
+
+https://bugzilla.xfce.org/show_bug.cgi?id=13576
+---
+ src/file.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/file.c b/src/file.c
+index fd2ff19..cf23b85 100644
+--- a/src/file.c
++++ b/src/file.c
+@@ -403,7 +403,7 @@ rstto_file_get_content_type ( RsttoFile *r_file )
+     if ( NULL == r_file->priv->content_type )
+     {
+ #if HAVE_MAGIC_H
+-        magic_t magic = magic_open (MAGIC_MIME_TYPE);
++        magic_t magic = magic_open (MAGIC_MIME_TYPE | MAGIC_SYMLINK);
+         if ( NULL != magic )
+         {
+             file_path = rstto_file_get_path (r_file);
+-- 
+cgit v1.1
+

Reply via email to