Hello community, here is the log from the commit of package glyr for openSUSE:Factory checked in at 2015-01-12 09:50:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/glyr (Old) and /work/SRC/openSUSE:Factory/.glyr.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "glyr" Changes: -------- --- /work/SRC/openSUSE:Factory/glyr/glyr.changes 2014-02-19 06:55:17.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.glyr.new/glyr.changes 2015-01-12 09:50:10.000000000 +0100 @@ -1,0 +2,18 @@ +Thu Jan 8 18:32:25 UTC 2015 - [email protected] + +- Update to 1.0.7. + * lyricswiki fixed. +- Changes in 1.0.6. + * Fixed faulty sha-1 versioning in cmakelists. + * Make glyrc return EXIT_SUCESS on success or EXIT_FAILURE in + case of any failure. + * Made the -c (--cache) option have an optional argument. Without + argument the path is ~/.cache/glyrc (will be created if + necessary). + * Clamp the timeout of select to the user-set timeout. + * Fix for cache getter: Print like normal getters and also call + appropiate programs. +- Refresh glyr-date-n-time.patch. +- Update glyr-version.patch. + +------------------------------------------------------------------- Old: ---- 1.0.5.tar.gz New: ---- 1.0.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ glyr.spec ++++++ --- /var/tmp/diff_new_pack.Lyq7y1/_old 2015-01-12 09:50:11.000000000 +0100 +++ /var/tmp/diff_new_pack.Lyq7y1/_new 2015-01-12 09:50:11.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package glyr # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define major 1 Name: glyr -Version: 1.0.5 +Version: 1.0.7 Release: 0 Summary: Searcheninge for Musicrelated Metadata License: GPL-3.0+ @@ -27,13 +27,13 @@ Url: https://github.com/sahib/glyr Source0: https://github.com/sahib/%{name}/archive/%{version}.tar.gz Source100: baselibs.conf -# PATCH-FIX-OPENSUSE glyr-date-n-time.patch [email protected] -- remove __DATE and __TIME__ that causes the package to rebuild when not needed +# PATCH-FIX-OPENSUSE glyr-date-n-time.patch [email protected] -- remove __DATE__ and __TIME__ that causes the package to rebuild when not needed Patch0: glyr-date-n-time.patch # PATCH-FIX-OPENSUSE glyr-optflags.patch [email protected] -- use default openSUSE optimization flags. Patch1: glyr-optflags.patch # PATCH-FIX-OPENSUSE glyr-pkgconfig.patch [email protected] -- do not inject bogus dependencies into other packages. Patch2: glyr-pkgconfig.patch -# PATCH-FIX-UPSTREAM glyr-version.patch https://github.com/sahib/glyr/commit/0417d80c43c1e5292367c05aa814dce6f0a44005 [email protected] -- pushed version to 1.0.5 in CMakeLists.txt +# PATCH-FIX-UPSTREAM glyr-version.patch [email protected] -- correct program version Patch3: glyr-version.patch BuildRequires: cmake BuildRequires: pkgconfig(glib-2.0) >= 2.32 @@ -138,7 +138,7 @@ %prep %setup -q -%patch0 +%patch0 -p1 %patch1 -p1 %patch2 %patch3 -p1 ++++++ 1.0.5.tar.gz -> 1.0.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glyr-1.0.5/CMakeLists.txt new/glyr-1.0.7/CMakeLists.txt --- old/glyr-1.0.5/CMakeLists.txt 2014-02-08 12:06:45.000000000 +0100 +++ new/glyr-1.0.7/CMakeLists.txt 2014-12-19 14:09:31.000000000 +0100 @@ -38,10 +38,19 @@ # ------------------------------------------------ SET(GLYR_VERSION_MAJOR "1") SET(GLYR_VERSION_MINOR "0") -SET(GLYR_VERSION_MICRO "2") +SET(GLYR_VERSION_MICRO "6") SET(GLYR_VERSION_NAME "Raving Raven") # ------------------------------------------------ +exec_program( + "git" + ${CMAKE_CURRENT_SOURCE_DIR} + ARGS "describe" + OUTPUT_VARIABLE VERSION +) + +# string(REGEX MATCH "-g.*$" VERSION_SHA1 ${VERSION}) +# string(REGEX REPLACE "[-g]" "" VERSION_SHA1 ${VERSION_SHA1}) # ------------------------------------------------ # CFlags and warnlevel / build config Files old/glyr-1.0.5/doc/screenshot.png and new/glyr-1.0.7/doc/screenshot.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glyr-1.0.5/lib/config.h new/glyr-1.0.7/lib/config.h --- old/glyr-1.0.5/lib/config.h 2014-02-08 12:06:45.000000000 +0100 +++ new/glyr-1.0.7/lib/config.h 2014-12-19 14:09:31.000000000 +0100 @@ -12,11 +12,11 @@ #define GLYR_VERSION_MAJOR "1" #define GLYR_VERSION_MINOR "0" -#define GLYR_VERSION_MICRO "2" +#define GLYR_VERSION_MICRO "6" #define GLYR_VERSION_MAJOR_INT 1 #define GLYR_VERSION_MINOR_INT 0 -#define GLYR_VERSION_MICRO_INT 2 +#define GLYR_VERSION_MICRO_INT 6 /** * GLYR_CHECK_VERSION: @@ -37,7 +37,7 @@ #define GLYR_CHECK_VERSION(X,Y,Z) (X <= GLYR_VERSION_MAJOR_INT || Y <= GLYR_VERSION_MINOR_INT || Z <= GLYR_VERSION_MICRO_INT) #define GLYR_VERSION_NAME "Raving Raven" -#define GLYR_DEBUG TRUE +#define GLYR_DEBUG FALSE /* Message output */ #define GLYR_OUTPUT stderr diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glyr-1.0.5/lib/core.c new/glyr-1.0.7/lib/core.c --- old/glyr-1.0.5/lib/core.c 2014-02-08 12:06:45.000000000 +0100 +++ new/glyr-1.0.7/lib/core.c 2014-12-19 14:09:31.000000000 +0100 @@ -811,6 +811,9 @@ if (wait_time == -1) wait_time = 100; + if (wait_time >= s->timeout * 1000) + wait_time = s->timeout * 1000; + /* Nothing happens.. */ if (max_fd == -1) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glyr-1.0.5/lib/intern/lyrics/lyricswiki.c new/glyr-1.0.7/lib/intern/lyrics/lyricswiki.c --- old/glyr-1.0.5/lib/intern/lyrics/lyricswiki.c 2014-02-08 12:06:45.000000000 +0100 +++ new/glyr-1.0.7/lib/intern/lyrics/lyricswiki.c 2014-12-19 14:09:31.000000000 +0100 @@ -64,9 +64,10 @@ ///////////////////////////////// #define LYR_NODE "<div class='lyricbox'>" -#define LYR_BEGIN "</div>" +#define LYR_BEGIN ">" #define LYR_ENDIN "<!--" #define LYR_INSTRUMENTAL "/Category:Instrumental" +#define LYR_SCRIPT_TAG "</script" GList * parse_result_page (GlyrQuery * query, GlyrMemCache * to_parse) { @@ -75,6 +76,10 @@ while (continue_search (g_list_length (result_list),query) && (node = strstr (node,LYR_NODE) ) ) { node += (sizeof LYR_NODE); + char *script_tag = strstr(node, LYR_SCRIPT_TAG); + if(script_tag) { + node = script_tag + sizeof(LYR_SCRIPT_TAG) - 1; + } bool is_instrumental = strstr(node, LYR_INSTRUMENTAL) != NULL; gchar * lyr = get_search_value (node,LYR_BEGIN,LYR_ENDIN); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glyr-1.0.5/pkg/PKGBUILD new/glyr-1.0.7/pkg/PKGBUILD --- old/glyr-1.0.5/pkg/PKGBUILD 2014-02-08 12:06:45.000000000 +0100 +++ new/glyr-1.0.7/pkg/PKGBUILD 2014-12-19 14:09:31.000000000 +0100 @@ -1,7 +1,7 @@ # Maintainer: Christopher Pahl <[email protected]> # glyr PKGBUILD for ArchLinux pkgname=glyr-git -pkgver=20130304 +pkgver=1.0.6 pkgrel=1 pkgdesc="A music metadata searchengine utility and library written in C" arch=('i686' 'x86_64') @@ -11,31 +11,21 @@ makedepends=('git' 'cmake') license=('GPL3') url=("https://github.com/sahib/glyr") +source=('git+https://github.com/sahib/glyr.git#branch=master') +md5sums=('SKIP') -_gitroot="git://github.com/sahib/glyr.git" -_gitname="glyr" - -build() -{ - cd ${srcdir}/ - - msg "Connecting to the Git server...." - if [[ -d ${srcdir}/${_gitname} ]] ; then - cd ${_gitname} - git pull origin master - msg "Updating existing repo..." - else - git clone --depth 1 ${_gitroot} - fi - - msg "Git checkout done." - cd ${srcdir}/${_gitname} - +build() { + cd "$srcdir/glyr" cmake . -DCMAKE_INSTALL_PREFIX=/usr make glyrc -j4 || return 1 } package() { - cd "$srcdir/${_gitname}" + cd "$srcdir/glyr" make DESTDIR=$pkgdir install || return 1 } + +pkgver() { + cd "$srcdir/glyr" + git tag --sort="-v:refname" | grep '^[0-9]' | head -1 +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/glyr-1.0.5/src/glyrc/glyrc.c new/glyr-1.0.7/src/glyrc/glyrc.c --- old/glyr-1.0.5/src/glyrc/glyrc.c 2014-02-08 12:06:45.000000000 +0100 +++ new/glyr-1.0.7/src/glyrc/glyrc.c 2014-12-19 14:09:31.000000000 +0100 @@ -22,6 +22,7 @@ #include <stdio.h> #include <getopt.h> #include <glib.h> +#include <glib/gstdio.h> #ifdef __linux__ /* Backtrace*/ @@ -78,12 +79,12 @@ ////////////////////////// #define INIT_CALLBACK_DATA \ - { \ - .output_path = NULL, \ - .exec_on_call = NULL, \ - .as_one = false, \ - .append_format= false \ - } \ +{ \ + .output_path = NULL, \ + .exec_on_call = NULL, \ + .as_one = false, \ + .append_format= false \ +} \ ////////////////////////// @@ -173,6 +174,43 @@ //////////////////////////////////////////////////////////////// +static char * create_cache_directory (void) +{ + char * xdg_cache_dir = g_strdup(g_getenv("XDG_CACHE_HOME")); + if(xdg_cache_dir == NULL) { + xdg_cache_dir = (char *)g_getenv("HOME"); + if(xdg_cache_dir == NULL) { + xdg_cache_dir = g_strdup("/tmp"); + } else { + xdg_cache_dir = g_strdup_printf("%s%c.cache", + xdg_cache_dir, + G_DIR_SEPARATOR + ); + } + } + + char * full_path = g_strdup_printf("%s%cglyrc", + xdg_cache_dir, + G_DIR_SEPARATOR + ); + + if(!g_file_test(full_path, G_FILE_TEST_IS_DIR)) { + g_printerr("<%s> does not exist yet. Creating...", full_path); + if(g_mkdir_with_parents(full_path, 0777) != 0) { + g_printerr("Could not mkdir cache directory at %s\n", full_path); + exit(EXIT_FAILURE); + } else { + g_printerr("done.\n"); + } + + } + + g_free(xdg_cache_dir); + return full_path; +} + +//////////////////////////////////////////////////////////////// + static void init_cancel_handler (GlyrQuery * p_lastQuery) { glob_lastQuery = p_lastQuery; @@ -181,7 +219,7 @@ //////////////////////////////////////////////////////////////// // --------------------------------------------------------- // -// --------------------------------------------------------- // +/////////////////////////////////////////////////////////////// static void print_version (GlyrQuery * s) { @@ -283,6 +321,8 @@ IN" glyrc cache list --cache /tmp # List all in the cache\n" IN" glyrc cache delete cover -a Equilibrium -b Sagas --cache /tmp # Delete artist/album\n" IN" glyrc cache select lyrics -a Knorkator -t 'A' -n 2 --cache /tmp # Search for two items in cache and print them\n" + IN"\n" + IN"The return code will be 0 on success, 1 on any failure. No distinction is made which error happened.\n" IN"\n\n" "With each item received you get a link to the original source, please refer to the individual terms of use,\n" "copying and distributing of this data might be not allowed.\n" @@ -358,7 +398,7 @@ {"verbosity", required_argument, 0, 'v'}, {"qsratio", required_argument, 0, 'q'}, {"formats", required_argument, 0, 'F'}, - {"cache", required_argument, 0, 'c'}, + {"cache", optional_argument, 0, 'c'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, {"download", no_argument, 0, 'd'}, @@ -389,7 +429,7 @@ { gint c; gint option_index = 0; - if ( (c = getopt_long (argc, argv, "N:f:W:w:p:r:m:x:u:v:q:c:F:hVodDLa:b:t:i:e:s:n:l:z:j:k:8gGyY",long_options, &option_index) ) == -1) + if ( (c = getopt_long (argc, argv, "N:f:W:w:p:r:m:x:u:v:q:c::F:hVodDLa:b:t:i:e:s:n:l:z:j:k:8gGyY",long_options, &option_index) ) == -1) { break; } @@ -401,9 +441,9 @@ char * dirname = g_path_get_dirname (optarg); gsize opt_len = strlen (optarg); if (g_ascii_strncasecmp (optarg,"stdout",opt_len) == 0 || - g_ascii_strncasecmp (optarg,"stderr",opt_len) == 0 || - g_ascii_strncasecmp (optarg,"null", opt_len) == 0 || - g_file_test (dirname,G_FILE_TEST_IS_DIR | G_FILE_TEST_EXISTS) == TRUE) + g_ascii_strncasecmp (optarg,"stderr",opt_len) == 0 || + g_ascii_strncasecmp (optarg,"null", opt_len) == 0 || + g_file_test (dirname,G_FILE_TEST_IS_DIR | G_FILE_TEST_EXISTS) == TRUE) { CBData->output_path = optarg; g_free (dirname); @@ -472,7 +512,12 @@ break; case 'c': { - GlyrDatabase * new_db = glyr_db_init (optarg); + char * path = g_strdup(optarg); + if(path == NULL) { + path = create_cache_directory(); + } + + GlyrDatabase * new_db = glyr_db_init (path); if (db == NULL) { cprint (DEFAULT,-1,NULL,"Unable to open or create a database at specified path.\n"); @@ -481,6 +526,7 @@ *db = new_db; glyr_opt_db_autowrite (glyrs,TRUE); glyr_opt_lookup_db (glyrs,new_db); + g_free(path); } break; case 'l': @@ -552,16 +598,6 @@ exit (-1); } // end switch() } // end while() - - if (optind < argc && glyrs->verbosity >= 2) - { - cprint (DEFAULT,2,glyrs,"Note: You have unused arguments:\n"); - for (int i = optind; i < argc; ++i) - { - cprint (DEFAULT,2,glyrs," * %s\n",argv[optind]); - } - cprint (DEFAULT,2,glyrs,"\n\n"); - } } //////////////////////////////////////////////////////////////// @@ -582,8 +618,8 @@ { gsize write_len = strlen (CBQueryData->output_path); if (g_ascii_strncasecmp (CBQueryData->output_path,"stdout",write_len) == 0 || - g_ascii_strncasecmp (CBQueryData->output_path,"stderr",write_len) == 0 || - g_ascii_strncasecmp (CBQueryData->output_path,"null", write_len) == 0) + g_ascii_strncasecmp (CBQueryData->output_path,"stderr",write_len) == 0 || + g_ascii_strncasecmp (CBQueryData->output_path,"null", write_len) == 0) { glyr_cache_write (c,CBQueryData->output_path); } @@ -704,7 +740,7 @@ ////////////////////////////////////// -static void do_cache_interface (const char * operation, GlyrQuery * q, GlyrDatabase * db) +static int do_cache_interface (const char * operation, GlyrQuery * q, GlyrDatabase * db, callback_data_t * cbdata) { const char list_op[] = "list"; const char slct_op[] = "select"; @@ -715,7 +751,7 @@ if (db == NULL) { cvprint (RED,"No database specified. Use --cache.\n"); - return; + return EXIT_FAILURE; } //////////////////////////////// @@ -723,8 +759,7 @@ if (g_ascii_strncasecmp (operation,list_op,sizeof (list_op) - 1) == 0) { do_iterate_over_db (db); - - return; + return EXIT_SUCCESS; } //////////////////////////////// @@ -733,8 +768,7 @@ { int killed_items = glyr_db_delete (db,q); cvprint (BLUE,"Deleted %d items from the db.",killed_items); - - return; + return killed_items > 0; } //////////////////////////////// @@ -744,15 +778,20 @@ GlyrMemCache * list = glyr_db_lookup (db,q); GlyrMemCache * iter = list; - while (iter != NULL) - { - glyr_cache_print (iter); - cvprint (BLUE,"//////////////////////\n"); + if(iter == NULL) { + return EXIT_FAILURE; + } + + q->callback.user_pointer = cbdata; + while (iter != NULL) { + callback(iter, q); iter = iter->next; } - return; + return EXIT_SUCCESS; } + + return EXIT_FAILURE; } @@ -846,8 +885,8 @@ atexit (global_cleanup); init_signals(); - /* Assume success */ - gint exit_code = EXIT_SUCCESS; + /* Assume failure, as always in life */ + gint exit_code = EXIT_FAILURE; /* Init / Destroy of libglyr. * You _have_ to call this before making any calls @@ -885,6 +924,8 @@ if (my_list != NULL) { + exit_code = EXIT_SUCCESS; + if (CBQueryData.as_one && glyr_type_is_image (my_query.type) == false) { GlyrMemCache * concat = concatenate_list (my_list); @@ -922,16 +963,18 @@ GlyrQuery db_query; GlyrDatabase * db = NULL; callback_data_t CBQueryData = INIT_CALLBACK_DATA; + SET_IF_NULL (CBQueryData.output_path,"."); glyr_query_init (&db_query); + glyr_opt_verbosity (&db_query,2); - if (argc >= 4) + if (argc >= 4 && strcmp("list", argv[2]) != 0) { parse_type_argument (argv[3],&db_query); } parse_commandline_general (argc-2, argv+2,&db_query,&CBQueryData,&db); - do_cache_interface (argv[2],&db_query,db); + do_cache_interface (argv[2],&db_query,db, &CBQueryData); } else { ++++++ glyr-date-n-time.patch ++++++ --- /var/tmp/diff_new_pack.Lyq7y1/_old 2015-01-12 09:50:11.000000000 +0100 +++ /var/tmp/diff_new_pack.Lyq7y1/_new 2015-01-12 09:50:11.000000000 +0100 @@ -1,9 +1,9 @@ Description: Remove __DATE and __TIME__ that causes the package to rebuild when not needed. Author: Kyrill Detinov <[email protected]> -Index: lib/glyr.c +Index: glyr-1.0.7/lib/glyr.c =================================================================== ---- lib/glyr.c.orig -+++ lib/glyr.c +--- glyr-1.0.7.orig/lib/glyr.c ++++ glyr-1.0.7/lib/glyr.c @@ -246,7 +246,7 @@ GlyrMemCache * glyr_cache_copy (GlyrMemC __attribute__ ( (visibility ("default") ) ) const char * glyr_version (void) ++++++ glyr-version.patch ++++++ --- /var/tmp/diff_new_pack.Lyq7y1/_old 2015-01-12 09:50:11.000000000 +0100 +++ /var/tmp/diff_new_pack.Lyq7y1/_new 2015-01-12 09:50:11.000000000 +0100 @@ -1,13 +1,31 @@ -Index: glyr-1.0.5/CMakeLists.txt +Index: glyr-1.0.7/CMakeLists.txt =================================================================== ---- glyr-1.0.5.orig/CMakeLists.txt -+++ glyr-1.0.5/CMakeLists.txt +--- glyr-1.0.7.orig/CMakeLists.txt ++++ glyr-1.0.7/CMakeLists.txt @@ -38,7 +38,7 @@ ENDIF() # ------------------------------------------------ SET(GLYR_VERSION_MAJOR "1") SET(GLYR_VERSION_MINOR "0") --SET(GLYR_VERSION_MICRO "2") -+SET(GLYR_VERSION_MICRO "5") +-SET(GLYR_VERSION_MICRO "6") ++SET(GLYR_VERSION_MICRO "7") SET(GLYR_VERSION_NAME "Raving Raven") # ------------------------------------------------ +Index: glyr-1.0.7/lib/config.h +=================================================================== +--- glyr-1.0.7.orig/lib/config.h ++++ glyr-1.0.7/lib/config.h +@@ -12,11 +12,11 @@ + + #define GLYR_VERSION_MAJOR "1" + #define GLYR_VERSION_MINOR "0" +-#define GLYR_VERSION_MICRO "6" ++#define GLYR_VERSION_MICRO "7" + + #define GLYR_VERSION_MAJOR_INT 1 + #define GLYR_VERSION_MINOR_INT 0 +-#define GLYR_VERSION_MICRO_INT 6 ++#define GLYR_VERSION_MICRO_INT 7 + + /** + * GLYR_CHECK_VERSION: -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
