Hello community,

here is the log from the commit of package feh for openSUSE:Factory checked in 
at 2017-06-19 13:23:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/feh (Old)
 and      /work/SRC/openSUSE:Factory/.feh.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "feh"

Mon Jun 19 13:23:39 2017 rev:13 rq:504474 version:2.19

Changes:
--------
--- /work/SRC/openSUSE:Factory/feh/feh.changes  2017-04-19 18:11:24.652875748 
+0200
+++ /work/SRC/openSUSE:Factory/.feh.new/feh.changes     2017-06-19 
13:23:42.309774241 +0200
@@ -1,0 +2,10 @@
+Sun Jun 18 14:23:59 UTC 2017 - mimi...@gmail.com
+
+- update to 2.19
+ * Follow the freedesktop.org Thumbnail Managing Standard by saving thumbnails
+    in ${XDG_CACHE_HOME}/thumbnails (defaulting to ~/.cache/thumbnails)
+    instead of ~/.thumbnails
+ * Install app icons with the correct permissions of 644
+ * Documentation improvements
+
+-------------------------------------------------------------------

Old:
----
  feh-2.18.3.tar.bz2
  feh-2.18.3.tar.bz2.asc

New:
----
  feh-2.19.tar.bz2
  feh-2.19.tar.bz2.asc

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

Other differences:
------------------
++++++ feh.spec ++++++
--- /var/tmp/diff_new_pack.gmEIZt/_old  2017-06-19 13:23:43.089664287 +0200
+++ /var/tmp/diff_new_pack.gmEIZt/_new  2017-06-19 13:23:43.089664287 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           feh
-Version:        2.18.3
+Version:        2.19
 Release:        0
 Summary:        Fast and Lightweight Image Viewer
 License:        MIT and LGPL-2.0+

++++++ feh-2.18.3.tar.bz2 -> feh-2.19.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/feh-2.18.3/ChangeLog new/feh-2.19/ChangeLog
--- old/feh-2.18.3/ChangeLog    2017-04-04 21:26:38.000000000 +0200
+++ new/feh-2.19/ChangeLog      2017-06-06 20:50:36.000000000 +0200
@@ -1,3 +1,13 @@
+Tue, 06 Jun 2017 20:40:00 +0200  Daniel Friesel <derf+...@finalrewind.org>
+
+* Release v2.19
+    * Follow the freedesktop.org Thumbnail Managing Standard by saving
+      thumbnails in ${XDG_CACHE_HOME}/thumbnails (defaulting to
+      ~/.cache/thumbnails) instead of ~/.thumbnails
+      (patch by Olof-Joachim Frahm)
+    * Install app icons with the correct permissions of 644
+    * Documentation improvements
+
 Tue, 04 Apr 2017 21:22:16 +0200  Daniel Friesel <derf+...@finalrewind.org>
 
 * Release v2.18.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/feh-2.18.3/Makefile new/feh-2.19/Makefile
--- old/feh-2.18.3/Makefile     2017-04-04 21:26:38.000000000 +0200
+++ new/feh-2.19/Makefile       2017-06-06 20:50:36.000000000 +0200
@@ -77,9 +77,11 @@
        @echo installing icon to ${48_icon_dir}
        @mkdir -p ${48_icon_dir}
        @cp share/images/feh.png ${48_icon_dir}
+       @chmod 644 ${48_icon_dir}/feh.png
        @echo installing icon to ${scalable_icon_dir}
        @mkdir -p ${scalable_icon_dir}
        @cp share/images/feh.svg ${scalable_icon_dir}
+       @chmod 644 ${scalable_icon_dir}/feh.svg
        @if test "${app}" = 1 && which gtk-update-icon-cache > /dev/null 2>&1; 
then \
                gtk-update-icon-cache ${icon_dir}; \
        fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/feh-2.18.3/config.mk new/feh-2.19/config.mk
--- old/feh-2.18.3/config.mk    2017-04-04 21:26:38.000000000 +0200
+++ new/feh-2.19/config.mk      2017-06-06 20:50:36.000000000 +0200
@@ -1,5 +1,5 @@
 PACKAGE ?= feh
-VERSION ?= 2.18.3
+VERSION ?= 2.19
 
 app ?= 0
 cam ?= 0
@@ -73,7 +73,7 @@
        MAN_EXIF = disabled
 endif
 
-MAN_DATE ?= April 04, 2017
+MAN_DATE ?= June 06, 2017
 
 # Uncomment this to use dmalloc
 #CFLAGS += -DWITH_DMALLOC
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/feh-2.18.3/man/feh.pre new/feh-2.19/man/feh.pre
--- old/feh-2.18.3/man/feh.pre  2017-04-04 21:26:38.000000000 +0200
+++ new/feh-2.19/man/feh.pre    2017-06-06 20:50:36.000000000 +0200
@@ -341,6 +341,13 @@
 of 100, in which case images will always be shown at 100% zoom, no matter
 their dimensions.
 .
+.Pp
+.
+When combined with
+.Cm --thumbnails ,
+this option only affects images opened from the thumbnail overview. The
+thumbnail list itself will still be windowed.
+.
 .It Cm -g , --geometry Oo Ar width No x Ar height Oc Op + Ar x No + Ar y
 .
 Limit (and don't change) the window size.  Takes an X-style geometry
@@ -394,12 +401,10 @@
 When viewing files using HTTP,
 .Nm
 normally deletes the local copies after viewing, or, if caching, on exit.
-This option prevents this so that you get to keep the local copies.
-They will be in
-.Pa /tmp
-with
-.Qq Nm
-in the name.
+This option permanently stores them on disk, either in the directory
+specified by
+.Cm --output-dir ,
+or in the current working directory.
 .
 .It Cm --insecure
 .
@@ -494,7 +499,8 @@
 .
 Save files to
 .Ar directory
-.Pq only useful with -k
+.Pq only useful with -k .
+By default, files are saved in the current working directory.
 .
 .It Cm -p , --preload
 .
@@ -554,7 +560,7 @@
 was specified). Note that the window geometry is not updated when changing
 images at the moment. This option is recommended for tiling window managers.
 .
-This option is ignored when in fullscreen mode.
+This option is ignored when in fullscreen and thumbnail list mode.
 .
 .Pp
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/feh-2.18.3/src/feh_png.c new/feh-2.19/src/feh_png.c
--- old/feh-2.18.3/src/feh_png.c        2017-04-04 21:26:38.000000000 +0200
+++ new/feh-2.19/src/feh_png.c  2017-06-06 20:50:36.000000000 +0200
@@ -94,7 +94,7 @@
 }
 
 /* grab image data from image and write info file with comments ... */
-int feh_png_write_png(Imlib_Image image, char *file, ...)
+int feh_png_write_png_fd(Imlib_Image image, int fd, ...)
 {
        FILE *fp;
        int i, w, h;
@@ -111,7 +111,7 @@
        char *pair_key, *pair_text;
 #endif                         /* PNG_TEXT_SUPPORTED */
 
-       if (!(fp = fopen(file, "wb")))
+       if (!(fp = fdopen(fd, "wb")))
                return 0;
 
        png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, 
NULL);
@@ -155,7 +155,7 @@
        png_set_sBIT(png_ptr, info_ptr, &sig_bit);
 
 #ifdef PNG_TEXT_SUPPORTED
-       va_start(args, file);
+       va_start(args, fd);
        for (i = 0; i < FEH_PNG_NUM_COMMENTS; i++) {
                if ((pair_key = va_arg(args, char *))
                    && (pair_text = va_arg(args, char *))) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/feh-2.18.3/src/feh_png.h new/feh-2.19/src/feh_png.h
--- old/feh-2.18.3/src/feh_png.h        2017-04-04 21:26:38.000000000 +0200
+++ new/feh-2.19/src/feh_png.h  2017-06-06 20:50:36.000000000 +0200
@@ -32,7 +32,7 @@
 #include <stdarg.h>
 
 gib_hash *feh_png_read_comments(char *file);
-int feh_png_write_png(Imlib_Image image, char *file, ...);
+int feh_png_write_png_fd(Imlib_Image image, int fd, ...);
 
 int feh_png_file_is_png(FILE * fp);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/feh-2.18.3/src/thumbnail.c 
new/feh-2.19/src/thumbnail.c
--- old/feh-2.18.3/src/thumbnail.c      2017-04-04 21:26:38.000000000 +0200
+++ new/feh-2.19/src/thumbnail.c        2017-06-06 20:50:36.000000000 +0200
@@ -566,6 +566,12 @@
        if (td.cache_thumbnails) {
                uri = feh_thumbnail_get_name_uri(file->filename);
                thumb_file = feh_thumbnail_get_name(uri);
+
+               if (thumb_file == NULL) {
+                       free(uri);
+                       return feh_load_image(image, file);
+               }
+
                status = feh_thumbnail_get_generated(image, file, thumb_file,
                        orig_w, orig_h);
 
@@ -582,21 +588,39 @@
        return status;
 }
 
+static char *feh_thumbnail_get_prefix()
+{
+       char *dir = NULL, *home, *xdg_cache_home;
+
+       // TODO: perhaps make sure that either of those paths aren't 
/-terminated
+
+       xdg_cache_home = getenv("XDG_CACHE_HOME");
+       if (xdg_cache_home && xdg_cache_home[0] == '/') {
+               dir = estrjoin("/", xdg_cache_home, "thumbnails", td.cache_dir, 
NULL);
+       } else {
+               home = getenv("HOME");
+               if (home && home[0] == '/') {
+                       dir = estrjoin("/", home, ".cache/thumbnails", 
td.cache_dir, NULL);
+               }
+       }
+
+       return dir;
+}
+
 char *feh_thumbnail_get_name(char *uri)
 {
-       char *home = NULL, *thumb_file = NULL, *md5_name = NULL;
+       char *prefix, *thumb_file = NULL, *md5_name;
 
        /* FIXME: make sure original file isn't under ~/.thumbnails */
 
-       md5_name = feh_thumbnail_get_name_md5(uri);
-
-       home = getenv("HOME");
-       if (home) {
-               thumb_file = estrjoin("/", home, ".thumbnails", td.cache_dir, 
md5_name, NULL);
+       prefix = feh_thumbnail_get_prefix();
+       if (prefix) {
+               md5_name = feh_thumbnail_get_name_md5(uri);
+               thumb_file = estrjoin("/", prefix, md5_name, NULL);
+               free(md5_name);
+               free(prefix);
        }
 
-       free(md5_name);
-
        return thumb_file;
 }
 
@@ -639,7 +663,7 @@
        md5_finish(&pms, digest);
 
        /* print the md5 as hex to a string */
-       md5_name = emalloc(32 + 4 + 1 * sizeof(char));  /* md5 + .png + '\0' */
+       md5_name = emalloc(32 + 4 + 1); /* md5 + .png + '\0' */
        for (i = 0, pos = md5_name; i < 16; i++, pos += 2) {
                sprintf(pos, "%02x", digest[i]);
        }
@@ -655,6 +679,8 @@
        Imlib_Image im_temp;
        struct stat sb;
        char c_width[8], c_height[8];
+       char *tmp_thumb_file, *prefix;
+       int tmp_fd;
 
        if (feh_load_image(&im_temp, file) != 0) {
                *orig_w = w = gib_imlib_image_get_width(im_temp);
@@ -678,18 +704,32 @@
                        sprintf(c_mtime, "%d", (int)sb.st_mtime);
                        snprintf(c_width, 8, "%d", w);
                        snprintf(c_height, 8, "%d", h);
-                       feh_png_write_png(*image, thumb_file, "Thumb::URI", uri,
+                       prefix = feh_thumbnail_get_prefix();
+                       if (prefix == NULL) {
+                               gib_imlib_free_image_and_decache(im_temp);
+                               return 0;
+                       }
+                       tmp_thumb_file = estrjoin("/", prefix, 
".feh_thumbnail_XXXXXX", NULL);
+                       free(prefix);
+                       tmp_fd = mkstemp(tmp_thumb_file);
+                       if (!feh_png_write_png_fd(*image, tmp_fd, "Thumb::URI", 
uri,
                                        "Thumb::MTime", c_mtime,
                                        "Thumb::Image::Width", c_width,
-                                       "Thumb::Image::Height", c_height);
+                                       "Thumb::Image::Height", c_height)) {
+                               rename(tmp_thumb_file, thumb_file);
+                       } else {
+                               unlink(tmp_thumb_file);
+                       }
+                       close(tmp_fd);
+                       free(tmp_thumb_file);
                }
 
                gib_imlib_free_image_and_decache(im_temp);
 
-               return (1);
+               return 1;
        }
 
-       return (0);
+       return 0;
 }
 
 int feh_thumbnail_get_generated(Imlib_Image * image, feh_file * file,
@@ -847,31 +887,36 @@
 {
        int status = 0;
        struct stat sb;
-       char *dir, *dir_thumbnails, *home;
+       char *dir, *p;
 
-       home = getenv("HOME");
-       if (home != NULL) {
-               dir = estrjoin("/", home, ".thumbnails", td.cache_dir, NULL);
+       dir = feh_thumbnail_get_prefix();
 
+       if (dir) {
                if (!stat(dir, &sb)) {
                        if (S_ISDIR(sb.st_mode))
                                status = 1;
                        else
                                weprintf("%s should be a directory", dir);
                } else {
-                       dir_thumbnails = estrjoin("/", home, ".thumbnails", 
NULL);
-
-                       if (stat(dir_thumbnails, &sb) != 0) {
-                               if (mkdir(dir_thumbnails, 0700) == -1)
-                                       weprintf("unable to create directory 
%s", dir_thumbnails);
+                       for (p = dir + 1; *p; p++) {
+                               if (*p != '/') {
+                                       continue;
+                               }
+
+                               *p = 0;
+                               if (stat(dir, &sb) != 0) {
+                                       if (mkdir(dir, 0700) == -1) {
+                                               weprintf("unable to create 
directory %s", dir);
+                                       }
+                               }
+                               *p = '/';
                        }
 
-                       free(dir_thumbnails);
-
-                       if (mkdir(dir, 0700) == -1)
-                               weprintf("unable to create directory %s", dir);
-                       else
-                               status = 1;
+                       if (stat(dir, &sb) != 0) {
+                               if (mkdir(dir, 0700) == -1) {
+                                       weprintf("unable to create directory 
%s", dir);
+                               }
+                       }
                }
                free(dir);
        }


Reply via email to