pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/audio/glyr Add a patch to fix lyricswiki provider (via...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/29825b96cfd9
branches:  trunk
changeset: 354747:29825b96cfd9
user:      leot <leot%pkgsrc.org@localhost>
date:      Mon Nov 07 15:12:33 2016 +0000

description:
Add a patch to fix lyricswiki provider (via upstream from pullup request #80)

Bump PKGREVISION

diffstat:

 audio/glyr/Makefile                                     |   4 +-
 audio/glyr/distinfo                                     |   3 +-
 audio/glyr/patches/patch-lib_intern_lyrics_lyricswiki.c |  40 +++++++++++++++++
 3 files changed, 44 insertions(+), 3 deletions(-)

diffs (70 lines):

diff -r 460b09c5f681 -r 29825b96cfd9 audio/glyr/Makefile
--- a/audio/glyr/Makefile       Mon Nov 07 14:18:07 2016 +0000
+++ b/audio/glyr/Makefile       Mon Nov 07 15:12:33 2016 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.12 2016/10/07 18:25:37 adam Exp $
+# $NetBSD: Makefile,v 1.13 2016/11/07 15:12:33 leot Exp $
 #
 
 DISTNAME=      glyr-1.0.9
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    audio
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=sahib/}
 
diff -r 460b09c5f681 -r 29825b96cfd9 audio/glyr/distinfo
--- a/audio/glyr/distinfo       Mon Nov 07 14:18:07 2016 +0000
+++ b/audio/glyr/distinfo       Mon Nov 07 15:12:33 2016 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.7 2016/05/17 13:47:17 leot Exp $
+$NetBSD: distinfo,v 1.8 2016/11/07 15:12:33 leot Exp $
 
 SHA1 (glyr-1.0.9.tar.gz) = 28c6f5ffaaa568149762400cf0c8ebaf134cb3c0
 RMD160 (glyr-1.0.9.tar.gz) = b244631677a44d3fdb444bffac3c32d475413347
 SHA512 (glyr-1.0.9.tar.gz) = 77144202c99c6e429c8800a7d89d27de5376627194945116b7166d920375a59048d3e3102cf63646b1b57d795999f057977d7b13490e4ca3af44b8ddb3207652
 Size (glyr-1.0.9.tar.gz) = 425175 bytes
+SHA1 (patch-lib_intern_lyrics_lyricswiki.c) = b4eb47fbb9ef10e84561d87e0d230f4ef81e5bc0
diff -r 460b09c5f681 -r 29825b96cfd9 audio/glyr/patches/patch-lib_intern_lyrics_lyricswiki.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/glyr/patches/patch-lib_intern_lyrics_lyricswiki.c   Mon Nov 07 15:12:33 2016 +0000
@@ -0,0 +1,40 @@
+$NetBSD: patch-lib_intern_lyrics_lyricswiki.c,v 1.1 2016/11/07 15:12:33 leot Exp $
+
+Fix lyricswiki provider (from upstream and pull request #80).
+
+--- lib/intern/lyrics/lyricswiki.c.orig        2016-05-17 11:39:52.000000000 +0000
++++ lib/intern/lyrics/lyricswiki.c
+@@ -66,6 +66,8 @@ static gboolean lv_cmp_content (const gc
+ #define LYR_NODE  "<div class='lyricbox"
+ #define LYR_BEGIN ">"
+ #define LYR_ENDIN "<!--"
++#define LYR_FOOTER "<div id=\"songfooter"
++#define LYR_CREDITS "<table"
+ #define LYR_INSTRUMENTAL "/Category:Instrumental"
+ #define LYR_SCRIPT_TAG "</script"
+ 
+@@ -78,13 +80,23 @@ GList * parse_result_page (GlyrQuery * q
+         node += (sizeof LYR_NODE);
+         char *script_tag = strstr(node, LYR_SCRIPT_TAG);
+         char *end_tag = strstr(node, LYR_ENDIN);
++        char *footer_tag = strstr(node, LYR_FOOTER);
++        char *credits_tag = strstr(node, LYR_CREDITS);
++        char *ending_tag = LYR_ENDIN;
++
++        if (footer_tag && footer_tag < end_tag) {
++            ending_tag = LYR_FOOTER;
++        }
++        if (credits_tag && credits_tag < end_tag) {
++            ending_tag = LYR_CREDITS;
++        }
+ 
+         if(script_tag && script_tag < end_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);
++        gchar * lyr = get_search_value (node,LYR_BEGIN,ending_tag);
+         gchar * beautiness_test = beautify_string (lyr);
+ 
+         if (is_instrumental || (beautiness_test != NULL && beautiness_test[0]))



Home | Main Index | Thread Index | Old Index