Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package jgmenu for openSUSE:Factory checked in at 2021-09-17 23:26:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/jgmenu (Old) and /work/SRC/openSUSE:Factory/.jgmenu.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jgmenu" Fri Sep 17 23:26:05 2021 rev:18 rq:919742 version:4.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/jgmenu/jgmenu.changes 2021-01-04 19:09:07.327374108 +0100 +++ /work/SRC/openSUSE:Factory/.jgmenu.new.1899/jgmenu.changes 2021-09-17 23:26:30.721266168 +0200 @@ -1,0 +2,19 @@ +Fri Sep 17 12:38:33 UTC 2021 - Michael Vetter <[email protected]> + +- Update to 4.4.0: + * Make --simple force short-lived mode (the way it was always intended to be + an is described in documentation). Fixes issue #153. + * jgmenu-apps: + - Respect TryExec in .desktop files including the handling of absolute + paths. Fixes issues #146 and #151. + - Parse .desktop file 'Path' field and support working directory + - Make exec[] field bigger to allow long strings (as seen in for example + wine applications). + - Include .desktop files in $XDG_DATA_DIRS/applications/ sub-directories + For example, ~/.local/share/applications/wine/Programs/Games/ + * jgmenu-lx: escape C:\ in order to cope with libmenu-cache escaping the + backslash in 'C:\' in wine applications' .desktop file Exec= field + * gtktheme: call `jgmenu_run config` synchronously to avoid config file write + errors + +------------------------------------------------------------------- Old: ---- v4.3.0.tar.gz New: ---- v4.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ jgmenu.spec ++++++ --- /var/tmp/diff_new_pack.XuRjgK/_old 2021-09-17 23:26:31.101266507 +0200 +++ /var/tmp/diff_new_pack.XuRjgK/_new 2021-09-17 23:26:31.101266507 +0200 @@ -17,7 +17,7 @@ Name: jgmenu -Version: 4.3.0 +Version: 4.4.0 Release: 0 Summary: Small X11 menu intended to be used with openbox and tint2 License: GPL-2.0-only ++++++ v4.3.0.tar.gz -> v4.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/INSTALL.md new/jgmenu-4.4.0/INSTALL.md --- old/jgmenu-4.3.0/INSTALL.md 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/INSTALL.md 2021-09-16 19:36:13.000000000 +0200 @@ -13,15 +13,7 @@ [Repology](https://repology.org/metapackage/jgmenu/versions) -| Repo | command | Version | -| :------------------------------------------------------------------------------------------------ | :---------------------- | :------------------------------------------------------------------------------------------- | -| [Arch](https://www.archlinux.org/packages/community/x86_64/jgmenu/) | pacman -S jgmenu |  | -| [BunsenLabs](http://eu.pkg.bunsenlabs.org/debian/pool/main/j/jgmenu/) | apt-get install jgmenu |  | -| [Mageia Cauldron](http://madb.mageia.org/package/show/application/0/release/cauldron/name/jgmenu) | urpmi jgmenu |  | -| [Manjaro]() | pacman -S jgmenu |  | -| [OpenSUSE](https://build.opensuse.org/package/show/openSUSE:Factory/jgmenu) | |  | -| [Slackware](https://slackbuilds.org/repository/14.2/desktop/jgmenu/) | slackpkg install jgmenu |  | -| [Void](https://github.com/void-linux/void-packages/tree/master/srcpkgs/jgmenu) | xbps-install -S jgmenu |  | +[](https://repology.org/project/jgmenu/versions) Build and install in $HOME directory ------------------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/Makefile new/jgmenu-4.4.0/Makefile --- old/jgmenu-4.3.0/Makefile 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/Makefile 2021-09-16 19:36:13.000000000 +0200 @@ -62,7 +62,7 @@ jgmenu-i18n: jgmenu-i18n.o i18n.o hashmap.o util.o sbuf.o jgmenu-greeneye: jgmenu-greeneye.o compat.o util.o sbuf.o jgmenu-apps: jgmenu-apps.o compat.o util.o sbuf.o desktop.o charset.o \ - xdgdirs.o argv-buf.o dirs.o lang.o fmt.o i18n.o hashmap.o + xdgdirs.o argv-buf.o dirs.o lang.o fmt.o i18n.o hashmap.o isprog.o jgmenu-obtheme: jgmenu-obtheme.o util.o sbuf.o compat.o set.o jgmenu-config: jgmenu-config.o util.o sbuf.o compat.o set.o spawn.o diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/NEWS.md new/jgmenu-4.4.0/NEWS.md --- old/jgmenu-4.3.0/NEWS.md 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/NEWS.md 2021-09-16 19:36:13.000000000 +0200 @@ -8,10 +8,9 @@ | Date | Release Notes | |------------|-----------------------------------| +| 2021-09-16 | [v4.4.0](docs/relnotes/4.4.0.txt) | | 2021-01-02 | [v4.3.0](docs/relnotes/4.3.0.txt) | | 2020-05-19 | [v4.2.1](docs/relnotes/4.2.1.txt) | | 2020-05-06 | [v4.2.0](docs/relnotes/4.2.0.txt) | | 2020-03-02 | [v4.1.0](docs/relnotes/4.1.0.txt) | -| 2020-02-02 | [v4.0.2](docs/relnotes/4.0.2.txt) | -| 2020-01-19 | [v4.0.1](docs/relnotes/4.0.1.txt) | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/contrib/gtktheme/jgmenu-gtktheme.py new/jgmenu-4.4.0/contrib/gtktheme/jgmenu-gtktheme.py --- old/jgmenu-4.3.0/contrib/gtktheme/jgmenu-gtktheme.py 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/contrib/gtktheme/jgmenu-gtktheme.py 2021-09-16 19:36:13.000000000 +0200 @@ -20,7 +20,8 @@ def run(command): """ run a command """ - subprocess.Popen(shlex.split(command)) + proc = subprocess.Popen(shlex.split(command)) + proc.wait() def fmt(s): """ ensure string is at least two characters long """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/contrib/lx/jgmenu-lx.c new/jgmenu-4.4.0/contrib/lx/jgmenu-lx.c --- old/jgmenu-4.3.0/contrib/lx/jgmenu-lx.c 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/contrib/lx/jgmenu-lx.c 2021-09-16 19:36:13.000000000 +0200 @@ -96,10 +96,38 @@ } } +static void strip_exec_field_codes(char **exec) +{ + char *p; + + if (!**exec || !*exec) + return; + for (p = *exec; *p; p++) { + if (*p == '%') { + *p = ' '; + ++p; + if (*p == '\0') + break; + if (*p != '%') + *p = ' '; + } + } + rtrim(exec); +} + +/* + * For some reason libmenu-cache does not escape the backslack in 'C:\' + * so we have to manually intervene and esacpe it. + */ +static void ugly_hack(struct sbuf *exec) +{ + sbuf_replace(exec, ":\\", ":\\\\"); +} + static void process_app(MenuCacheApp *app) { /* TODO: Check visibility flag here too */ - char *exec; + struct sbuf exec; static struct sbuf s; static int inited; @@ -119,19 +147,22 @@ sbuf_addstr(&cur->buf, ","); /* command */ + sbuf_init(&exec); if (menu_cache_app_get_use_terminal(app)) sbuf_addstr(&cur->buf, "^term("); - exec = (char *)menu_cache_app_get_exec(MENU_CACHE_APP(app)); - if (strchr(exec, ',')) + sbuf_cpy(&exec, (char *)menu_cache_app_get_exec(MENU_CACHE_APP(app))); + if (strchr(exec.buf, ',')) sbuf_addstr(&cur->buf, "\"\"\""); - strip_exec_field_codes(&exec); - sbuf_addstr(&cur->buf, exec); - if (strchr(exec, ',')) + ugly_hack(&exec); + strip_exec_field_codes(&exec.buf); + sbuf_addstr(&cur->buf, exec.buf); + if (strchr(exec.buf, ',')) sbuf_addstr(&cur->buf, " \"\"\""); sbuf_rtrim(&cur->buf); if (menu_cache_app_get_use_terminal(app)) sbuf_addstr(&cur->buf, ")"); sbuf_addstr(&cur->buf, ","); + xfree(exec.buf); /* icon */ sbuf_addstr(&cur->buf, menu_cache_item_get_icon(MENU_CACHE_ITEM(app))); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/debian/changelog new/jgmenu-4.4.0/debian/changelog --- old/jgmenu-4.3.0/debian/changelog 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/debian/changelog 2021-09-16 19:36:13.000000000 +0200 @@ -1,3 +1,9 @@ +jgmenu (4.4.0-1) unstable; urgency=medium + + * New upstream release + + -- Johan Malm <[email protected]> Thu, 16 Sep 2021 18:33:07 +0100 + jgmenu (4.3.0-1) unstable; urgency=medium * New upstream release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/docs/relnotes/4.4.0.txt new/jgmenu-4.4.0/docs/relnotes/4.4.0.txt --- old/jgmenu-4.3.0/docs/relnotes/4.4.0.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/jgmenu-4.4.0/docs/relnotes/4.4.0.txt 2021-09-16 19:36:13.000000000 +0200 @@ -0,0 +1,28 @@ +jgmenu v4.4.0 release notes +=========================== + +Updates since v4.3.0 +-------------------- + + * Make --simple force short-lived mode (the way it was always intended to be + an is described in documentation). Fixes issue #153. + + * jgmenu-apps: + + - Respect TryExec in .desktop files including the handling of absolute + paths. Fixes issues #146 and #151. Suggested-by: @johnraff. + + - Parse .desktop file 'Path' field and support working directory + Written-by: @BitterlyIronic. + + - Make exec[] field bigger to allow long strings (as seen in for example + wine applications). + + - Include .desktop files in $XDG_DATA_DIRS/applications/ sub-directories + For example, ~/.local/share/applications/wine/Programs/Games/ + + * jgmenu-lx: escape C:\ in order to cope with libmenu-cache escaping the + backslash in 'C:\' in wine applications' .desktop file Exec= field + + * gtktheme: call `jgmenu_run config` synchronously to avoid config file write + errors diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/scripts/version-gen.sh new/jgmenu-4.4.0/scripts/version-gen.sh --- old/jgmenu-4.3.0/scripts/version-gen.sh 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/scripts/version-gen.sh 2021-09-16 19:36:13.000000000 +0200 @@ -8,7 +8,7 @@ # Change "default_version" before doing a `git tag -a ...` # -default_version="4.3.0" +default_version="4.4.0" v=$(git describe --dirty --abbrev=1 2>/dev/null) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/src/desktop.c new/jgmenu-4.4.0/src/desktop.c --- old/jgmenu-4.3.0/src/desktop.c 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/src/desktop.c 2021-09-16 19:36:13.000000000 +0200 @@ -18,6 +18,7 @@ #include "charset.h" #include "compat.h" #include "lang.h" +#include "isprog.h" #include "banned.h" static struct app *apps; @@ -45,6 +46,10 @@ strlcpy(app->generic_name, value, sizeof(app->generic_name)); } else if (!strcmp("Exec", key)) { strlcpy(app->exec, value, sizeof(app->exec)); + } else if (!strcmp("TryExec", key)) { + strlcpy(app->tryexec, value, sizeof(app->tryexec)); + } else if (!strcmp("Path", key)) { + strlcpy(app->working_dir, value, sizeof(app->working_dir)); } else if (!strcmp("Icon", key)) { strlcpy(app->icon, value, sizeof(app->icon)); } else if (!strcmp("Categories", key)) { @@ -90,6 +95,41 @@ return false; } +static void delchar(char *p) +{ + size_t len = strlen(p); + + memmove(p, p + 1, len + 1); + *(p + len) = '\0'; +} + + +/* + * Remove all %? fields from .desktop Exec= field + * Note: + * (a) %% which becomes % + * (b) backslash escaped characters are resolved + */ +static void strip_exec_field_codes(char **exec) +{ + if (!**exec || !*exec) + return; + for (char *p = *exec; *p; p++) { + if (*p == '\\') { + delchar(p); + continue; + } + if (*p == '%') { + delchar(p); + if (*p == '\0') + break; + if (*p != '%') + delchar(p); + } + } + rtrim(exec); +} + static struct app *grow_vector_by_one_app(void) { struct app *app; @@ -127,6 +167,10 @@ strlcpy(app->filename, filename, sizeof(app->filename)); p = &app->exec[0]; strip_exec_field_codes(&p); + + if (app->tryexec[0] != '\0' && !isprog(app->tryexec)) + app->tryexec_not_in_path = true; + return 0; } @@ -165,10 +209,17 @@ if (!dp) return; while ((entry = readdir(dp))) { - if (!strncmp(entry->d_name, ".", 1) || - !strncmp(entry->d_name, "..", 2)) - continue; - process_file(entry->d_name, path); + if (entry->d_type == DT_DIR) { + if (entry->d_name[0] != '.') { + char new_path[PATH_MAX]; + + snprintf(new_path, PATH_MAX, "%s%s/", path, + entry->d_name); + traverse_directory(new_path); + } + } else if (entry->d_type == DT_REG || entry->d_type == DT_LNK) { + process_file(entry->d_name, path); + } } closedir(dp); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/src/desktop.h new/jgmenu-4.4.0/src/desktop.h --- old/jgmenu-4.3.0/src/desktop.h 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/src/desktop.h 2021-09-16 19:36:13.000000000 +0200 @@ -10,9 +10,12 @@ char name_localized[128]; char generic_name[128]; char generic_name_localized[128]; - char exec[128]; + char exec[1024]; + char tryexec[1024]; + char working_dir[1024]; + bool tryexec_not_in_path; char icon[128]; - char categories[512]; + char categories[1024]; bool nodisplay; char filename[128]; bool terminal; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/src/isprog.c new/jgmenu-4.4.0/src/isprog.c --- old/jgmenu-4.3.0/src/isprog.c 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/src/isprog.c 2021-09-16 19:36:13.000000000 +0200 @@ -59,6 +59,11 @@ ++is_path_parsed; } + /* handle absolute path */ + if (filename[0] == '/') + return is_ixoth((char *)filename); + + /* handle relative path by iterating over $PATH */ list_for_each_entry(tmp, &head, list) { strlcpy(prog, tmp->path, sizeof(prog)); pos = strlen(tmp->path); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/src/jgmenu-apps.c new/jgmenu-4.4.0/src/jgmenu-apps.c --- old/jgmenu-4.3.0/src/jgmenu-apps.c 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/src/jgmenu-apps.c 2021-09-16 19:36:13.000000000 +0200 @@ -75,10 +75,11 @@ /* icon */ sbuf_addstr(buf, app->icon); - sbuf_addstr(buf, ",,"); + sbuf_addstr(buf, ","); /* working directory */ - /* TODO */ + sbuf_addstr(buf, app->working_dir); + sbuf_addstr(buf, ","); /* metadata */ replace_semicolons_with_hashes(app->categories); @@ -89,12 +90,17 @@ xfree(s.buf); } +static bool should_not_display(struct app *app) +{ + return app->nodisplay || app->tryexec_not_in_path; +} + static void print_apps_in_other_directory(struct app *apps, struct sbuf *buf) { struct app *app; for (app = apps; !app->end; app += 1) { - if (app->nodisplay) + if (should_not_display(app)) continue; if (app->has_been_mapped) continue; @@ -115,7 +121,7 @@ argv_parse(&categories); for (app = apps; !app->end; app += 1) { - if (app->nodisplay) + if (should_not_display(app)) continue; /* @@ -194,7 +200,7 @@ if (!no_prepend) cat("~/.config/jgmenu/prepend.csv"); for (app = apps; !app->end; app += 1) { - if (app->nodisplay) + if (should_not_display(app)) continue; print_app_to_buffer(app, &buf); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/src/jgmenu.c new/jgmenu-4.4.0/src/jgmenu.c --- old/jgmenu-4.3.0/src/jgmenu.c 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/src/jgmenu.c 2021-09-16 19:36:13.000000000 +0200 @@ -2655,6 +2655,8 @@ config_read_jgmenurc(arg_config_file); args_parse(argc, argv); + if (args_simple() || arg_vsimple) + set_simple_mode(); config_post_process(); /* config variables will not be changed after this point */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/src/util.c new/jgmenu-4.4.0/src/util.c --- old/jgmenu-4.3.0/src/util.c 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/src/util.c 2021-09-16 19:36:13.000000000 +0200 @@ -312,22 +312,3 @@ ts.tv_nsec = msec * 1000000; nanosleep(&ts, NULL); } - -void strip_exec_field_codes(char **exec) -{ - char *p; - - if (!**exec || !*exec) - return; - for (p = *exec; *p; p++) { - if (*p == '%') { - *p = ' '; - ++p; - if (*p == '\0') - break; - if (*p != '%') - *p = ' '; - } - } - rtrim(exec); -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-4.3.0/src/util.h new/jgmenu-4.4.0/src/util.h --- old/jgmenu-4.3.0/src/util.h 2021-01-02 15:49:48.000000000 +0100 +++ new/jgmenu-4.4.0/src/util.h 2021-09-16 19:36:13.000000000 +0200 @@ -44,11 +44,4 @@ void mkdir_p(const char *path); void msleep(unsigned int duration); -/** - * strip_exec_field_codes - remove field codes from .desktop file exec field - * @exec - pointer to exec string - * Remove all %? except %% which becomes % - */ -void strip_exec_field_codes(char **exec); - #endif /* UTIL_H */
