Hello community, here is the log from the commit of package jgmenu for openSUSE:Factory checked in at 2019-03-19 09:59:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/jgmenu (Old) and /work/SRC/openSUSE:Factory/.jgmenu.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "jgmenu" Tue Mar 19 09:59:15 2019 rev:4 rq:685948 version:2.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/jgmenu/jgmenu.changes 2019-03-13 16:41:45.174667628 +0100 +++ /work/SRC/openSUSE:Factory/.jgmenu.new.28833/jgmenu.changes 2019-03-19 09:59:16.876081545 +0100 @@ -1,0 +2,6 @@ +Mon Mar 18 08:32:11 UTC 2019 - [email protected] + +- Update to 2.2.1: + * Fix init module bug which prevents config file from being created + +------------------------------------------------------------------- Old: ---- v2.2.tar.gz New: ---- v2.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ jgmenu.spec ++++++ --- /var/tmp/diff_new_pack.ND3p8o/_old 2019-03-19 09:59:18.012081089 +0100 +++ /var/tmp/diff_new_pack.ND3p8o/_new 2019-03-19 09:59:18.016081087 +0100 @@ -17,7 +17,7 @@ Name: jgmenu -Version: 2.2 +Version: 2.2.1 Release: 0 Summary: Small X11 menu intended to be used with openbox and tint2 License: GPL-2.0-only ++++++ v2.2.tar.gz -> v2.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/.gitignore new/jgmenu-2.2.1/.gitignore --- old/jgmenu-2.2/.gitignore 2019-03-12 23:30:10.000000000 +0100 +++ new/jgmenu-2.2.1/.gitignore 2019-03-15 22:11:45.000000000 +0100 @@ -7,6 +7,7 @@ jgmenu-i18n jgmenu-greeneye jgmenu-obtheme +jgmenu-apps README.html config.mk valgrind.log diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/Makefile new/jgmenu-2.2.1/Makefile --- old/jgmenu-2.2/Makefile 2019-03-12 23:30:10.000000000 +0100 +++ new/jgmenu-2.2.1/Makefile 2019-03-15 22:11:45.000000000 +0100 @@ -90,6 +90,8 @@ endif 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 jgmenu-obtheme: jgmenu-obtheme.o util.o sbuf.o compat.o $(PROGS): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/NEWS.md new/jgmenu-2.2.1/NEWS.md --- old/jgmenu-2.2/NEWS.md 2019-03-12 23:30:10.000000000 +0100 +++ new/jgmenu-2.2.1/NEWS.md 2019-03-15 22:11:45.000000000 +0100 @@ -6,9 +6,8 @@ ## Recent releases +[v2.2.1](docs/relnotes/2.2.1.txt) [v2.2](docs/relnotes/2.2.txt) [v2.1](docs/relnotes/2.1.txt) [v2.0](docs/relnotes/2.0.txt) [v1.6](docs/relnotes/1.6.txt) -[v1.5](docs/relnotes/1.5.txt) - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/TODO.md new/jgmenu-2.2.1/TODO.md --- old/jgmenu-2.2/TODO.md 2019-03-12 23:30:10.000000000 +0100 +++ new/jgmenu-2.2.1/TODO.md 2019-03-15 22:11:45.000000000 +0100 @@ -4,7 +4,9 @@ -------------------------- - write a library (e.g. set.o) to set config variables in jgmenurc +- init: add obtheme to the interactive mode - init: move greeneye icon lines to the C code +- init: remove all margin_* settings from themes - tests/: xpm: put all tests within expect_success {} - lx: write unit test for lx - check that <layout> works properly - lx: cope with desktop-file without exec field @@ -13,7 +15,6 @@ - Trim argv-buf fields on parse - apps: keep track of filename - jgmenu - warn if unknown command line argument is given -- init: remove all margin_* settings from themes - ob: set ^tag() to command rather than name to reduce risk of duplication - Clear any Codacy and ASAN warnings. - Restructure variable diagram in jgmenu(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/debian/changelog new/jgmenu-2.2.1/debian/changelog --- old/jgmenu-2.2/debian/changelog 2019-03-12 23:30:10.000000000 +0100 +++ new/jgmenu-2.2.1/debian/changelog 2019-03-15 22:11:45.000000000 +0100 @@ -1,5 +1,5 @@ -jgmenu (2.2-1) UNRELEASED; urgency=medium +jgmenu (2.2.1-1) UNRELEASED; urgency=medium * New upstream release - -- Johan Malm <[email protected]> Tue, 12 Mar 2019 22:28:02 +0000 + -- Johan Malm <[email protected]> Fri, 15 Mar 2019 21:10:09 +0000 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/docs/relnotes/2.2.1.txt new/jgmenu-2.2.1/docs/relnotes/2.2.1.txt --- old/jgmenu-2.2/docs/relnotes/2.2.1.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/jgmenu-2.2.1/docs/relnotes/2.2.1.txt 2019-03-15 22:11:45.000000000 +0100 @@ -0,0 +1,7 @@ +jgmenu v2.2.1 release notes +=========================== + +Updates since v2.2 +------------------ + + * Fix init module bug which prevents config file from being created diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/scripts/version-gen.sh new/jgmenu-2.2.1/scripts/version-gen.sh --- old/jgmenu-2.2/scripts/version-gen.sh 2019-03-12 23:30:10.000000000 +0100 +++ new/jgmenu-2.2.1/scripts/version-gen.sh 2019-03-15 22:11:45.000000000 +0100 @@ -8,7 +8,7 @@ # Change "default_version" before doing a `git tag -a ...` # -default_version="2.2" +default_version="2.2.1" v=$(git describe --dirty --abbrev=1 2>/dev/null) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/src/desktop.c new/jgmenu-2.2.1/src/desktop.c --- old/jgmenu-2.2/src/desktop.c 1970-01-01 01:00:00.000000000 +0100 +++ new/jgmenu-2.2.1/src/desktop.c 2019-03-15 22:11:45.000000000 +0100 @@ -0,0 +1,172 @@ +/* + * desktop.c - read and process .desktop files + * + * Copyright (C) Johan Malm 2019 + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <dirent.h> + +#include "desktop.h" +#include "xdgdirs.h" +#include "util.h" +#include "sbuf.h" +#include "list.h" +#include "charset.h" +#include "compat.h" + +static struct app *apps; +static int nr_apps, alloc_apps; + +//static void format_exec(void) +//{ +// // FIXME: tidy up +// /* Remove %U, %f, etc at the end of Exec cmd */ +// if (desktop_file->exec) { +// p = strchr(desktop_file->exec, '%'); +// if (p) +// *p = '\0'; +// } +//} + +static void parse_line(char *line, struct app *app, int *is_desktop_entry) +{ + char *key, *value; + + /* We only read the [Desktop Entry] section of a .desktop file */ + if (line[0] == '[') { + if (!strncmp(line, "[Desktop Entry]", 15)) + *is_desktop_entry = 1; + else + *is_desktop_entry = 0; + } + if (!(*is_desktop_entry)) + return; + + if (!parse_config_line(line, &key, &value)) + return; + if (!strcmp("Name", key)) + app->name = strdup(value); + else if (!strcmp("Exec", key)) + app->exec = strdup(value); + else if (!strcmp("Icon", key)) + app->icon = strdup(value); + else if (!strcmp("Categories", key)) + app->categories = strdup(value); + else if (!strcmp("NoDisplay", key)) + if (!strcasecmp(value, "true")) + app->nodisplay = 1; +} + +static int add_app(FILE *fp) +{ + char line[4096]; + char *p; + struct app *app; + int is_desktop_entry; + + if (nr_apps == alloc_apps) { + alloc_apps = (alloc_apps + 16) * 2; + apps = xrealloc(apps, alloc_apps * sizeof(struct app)); + } + app = apps + nr_apps; + memset(app, 0, sizeof(*app)); + nr_apps++; + + is_desktop_entry = 0; + while (fgets(line, sizeof(line), fp)) { + if (line[0] == '\0') + continue; + p = strrchr(line, '\n'); + if (!p) + continue; + *p = '\0'; + if (!utf8_validate(line, p - &line[0])) + return -1; + parse_line(line, app, &is_desktop_entry); + } + if (app->nodisplay || !app->name) + --nr_apps; + if (app->nodisplay) + info("app %s is NoDisplay", app->name); + return 0; +} + +static void process_file(char *filename, const char *path) +{ + FILE *fp; + char fullname[4096]; + int ret; + size_t len; + + len = strlen(path); + strlcpy(fullname, path, sizeof(fullname)); + strlcpy(fullname + len, filename, sizeof(fullname) - len); + fp = fopen(fullname, "r"); + if (!fp) { + warn("could not open file %s", filename); + return; + } + ret = add_app(fp); + fclose(fp); + if (ret < 0) + warn("file '%s' is not utf-8 compatible", filename); +} + +static void traverse_directory(const char *path) +{ + struct dirent *entry; + DIR *dp; + + dp = opendir(path); + 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); + } + closedir(dp); +} + +static int compare_app_name(const void *a, const void *b) +{ + const struct app *aa = (struct app *)a; + const struct app *bb = (struct app *)b; + + BUG_ON(!aa->name || !bb->name); + return strcasecmp(aa->name, bb->name); +} + +int desktop_nr_apps(void) +{ + return nr_apps; +} + +struct app *desktop_read_files(void) +{ + struct list_head xdg_data_dirs; + struct sbuf *dir; + struct sbuf s; + static int run; + + BUG_ON(run); + run = 1; + + INIT_LIST_HEAD(&xdg_data_dirs); + xdgdirs_get_basedirs(&xdg_data_dirs); + + sbuf_init(&s); + list_for_each_entry(dir, &xdg_data_dirs, list) { + sbuf_cpy(&s, dir->buf); + sbuf_addstr(&s, "/applications/"); + /* populate *apps based on .desktop files */ + traverse_directory(s.buf); + } + qsort(apps, nr_apps, sizeof(struct app), compare_app_name); + xfree(s.buf); + return apps; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/src/desktop.h new/jgmenu-2.2.1/src/desktop.h --- old/jgmenu-2.2/src/desktop.h 1970-01-01 01:00:00.000000000 +0100 +++ new/jgmenu-2.2.1/src/desktop.h 2019-03-15 22:11:45.000000000 +0100 @@ -0,0 +1,17 @@ +#ifndef DESKTOP_H +#define DESKTOP_H + +#include "list.h" + +struct app { + char *name; + char *exec; + char *icon; + char *categories; + int nodisplay; +}; + +struct app *desktop_read_files(void); +int desktop_nr_apps(void); + +#endif /* DESKTOP_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/src/jgmenu-apps.c new/jgmenu-2.2.1/src/jgmenu-apps.c --- old/jgmenu-2.2/src/jgmenu-apps.c 1970-01-01 01:00:00.000000000 +0100 +++ new/jgmenu-2.2.1/src/jgmenu-apps.c 2019-03-15 22:11:45.000000000 +0100 @@ -0,0 +1,43 @@ +/* + * jgmenu-apps.c - replacement for pmenu + * + * Copyright (C) Johan Malm 2019 + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "desktop.h" +#include "util.h" +#include "sbuf.h" + +static void print_desktop_files(struct app *apps, int nr_apps) +{ + int i; + + cat("~/.config/jgmenu/prepend.csv"); + for (i = 0; i < nr_apps; i++) { + if (!apps[i].name) + continue; + printf("%s,%s,%s\n", apps[i].name, apps[i].exec, apps[i].icon); + } + cat("~/.config/jgmenu/append.csv"); +} + +int main(int argc, char **argv) +{ + int i = 1; + struct app *apps; + + while (i < argc) { + if (!strncmp(argv[i], "--help", 6)) + printf("usage: jgmenu_run apps [--help]"); + else + die("unknown option '%s'", argv[i]); + i++; + } + apps = desktop_read_files(); + print_desktop_files(apps, desktop_nr_apps()); + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jgmenu-2.2/src/jgmenu-init.sh new/jgmenu-2.2.1/src/jgmenu-init.sh --- old/jgmenu-2.2/src/jgmenu-init.sh 2019-03-12 23:30:10.000000000 +0100 +++ new/jgmenu-2.2.1/src/jgmenu-init.sh 2019-03-15 22:11:45.000000000 +0100 @@ -684,6 +684,7 @@ shift done +mkdir -p "${HOME}/.config/jgmenu" test -z "${theme}" || { set_theme "$theme" ; exit 0 ; } initial_checks if test "${interactive}" = "t"
