[oe-commits] org.oe.dev packages/libmrss: Apply my patches to libmrss (will be send upstream)

freyther commit openembedded-commits at lists.openembedded.org
Sun Apr 1 18:07:16 UTC 2007


packages/libmrss: Apply my patches to libmrss (will be send upstream)
    -Make sure pubDate is always set for ATOM feeds from planets
    -Bump the library version to 0.17
    -Format Atom dates RFC822 compliant

Author: freyther at openembedded.org
Branch: org.openembedded.dev
Revision: 2fdc45b3cc8b040134c7a56d423eb5149e53c9b5
ViewMTN: http://monotone.openembedded.org/revision.psp?id=2fdc45b3cc8b040134c7a56d423eb5149e53c9b5
Files:
1
packages/libmrss/files
packages/libmrss/files/atom-changes.patch
packages/libmrss/files/bump-version.patch
packages/libmrss/files/fix_atom_date_locale.patch
packages/libmrss/libmrss_0.17.bb
Diffs:

#
# mt diff -rcda80ec870750fd50bf1d91768f73c415d318f22 -r2fdc45b3cc8b040134c7a56d423eb5149e53c9b5
#
# 
# 
# add_dir "packages/libmrss/files"
# 
# add_file "packages/libmrss/files/atom-changes.patch"
#  content [e9ef3499454d0c5d2e808f46d622d586a5eb77fa]
# 
# add_file "packages/libmrss/files/bump-version.patch"
#  content [6784feb150398e54582cc389af5cc6befe047dfe]
# 
# add_file "packages/libmrss/files/fix_atom_date_locale.patch"
#  content [2a40f862bc244e4977082b4303b2652e9058c1cb]
# 
# patch "packages/libmrss/libmrss_0.17.bb"
#  from [2dc5c5b104a09e840eeec7934868236b5e5adf84]
#    to [b1ec3fabfe0aadbc9b9c4410c2fecc385a868c31]
# 
============================================================
--- packages/libmrss/files/atom-changes.patch	e9ef3499454d0c5d2e808f46d622d586a5eb77fa
+++ packages/libmrss/files/atom-changes.patch	e9ef3499454d0c5d2e808f46d622d586a5eb77fa
@@ -0,0 +1,17 @@
+Make sure to always set a pubDate
+
+Index: libmrss-0.17/src/mrss_parser.c
+===================================================================
+--- libmrss-0.17.orig/src/mrss_parser.c	2007-03-22 19:40:54.000000000 +0100
++++ libmrss-0.17/src/mrss_parser.c	2007-03-22 19:44:15.000000000 +0100
+@@ -270,6 +270,10 @@
+ 		   && data->version == MRSS_VERSION_ATOM_1_0)
+ 	    item->pubDate =
+ 	      __mrss_atom_prepare_date (nxmle_get_string (cur, NULL));
++	  else if (!strcmp(cur->value, "updated" ) && !item->pubDate
++		  && data->version == MRSS_VERSION_ATOM_1_0)
++	    item->pubDate =
++         __mrss_atom_prepare_date (nxmle_get_string (cur, NULL));
+ 
+ 	  /* issued -> pubDate (Atom 0.3) */
+ 	  else if (!strcmp (cur->value, "issued") && !item->pubDate)
============================================================
--- packages/libmrss/files/bump-version.patch	6784feb150398e54582cc389af5cc6befe047dfe
+++ packages/libmrss/files/bump-version.patch	6784feb150398e54582cc389af5cc6befe047dfe
@@ -0,0 +1,16 @@
+Bump the version info, specially as I changed the struct in a binary
+incompatible way.
+
+Index: libmrss-0.17/src/Makefile.am
+===================================================================
+--- libmrss-0.17.orig/src/Makefile.am	2007-04-01 16:43:58.000000000 +0200
++++ libmrss-0.17/src/Makefile.am	2007-04-01 16:44:10.000000000 +0200
+@@ -10,7 +10,7 @@
+ 	mrss_options.c \
+ 	mrss_search.c
+ 
+-libmrss_la_LDFLAGS = -version-info 0:16:0
++libmrss_la_LDFLAGS = -version-info 0:17:0
+ 
+ EXTRA_DIST = mrss.h mrss_internal.h
+ 
============================================================
--- packages/libmrss/files/fix_atom_date_locale.patch	2a40f862bc244e4977082b4303b2652e9058c1cb
+++ packages/libmrss/files/fix_atom_date_locale.patch	2a40f862bc244e4977082b4303b2652e9058c1cb
@@ -0,0 +1,122 @@
+The Atom date formating code tries to create a RFC822 date. This date
+requires to use the C locale for the date (for weekday-names and month-names).
+
+This patch uses new POSIX functionality to create a C locale and strftime_l
+to create a right RFC822 date.
+
+Index: libmrss-0.17/src/mrss.h
+===================================================================
+--- libmrss-0.17.orig/src/mrss.h	2007-04-01 00:29:06.000000000 +0200
++++ libmrss-0.17/src/mrss.h	2007-04-01 01:22:25.000000000 +0200
+@@ -364,6 +364,9 @@
+   mrss_element_t element;
+   int allocated;
+ 
++  /** For internal use only: */
++  void* c_locale;
++
+   /* Data: */
+ 
+   char *file;
+Index: libmrss-0.17/src/mrss_free.c
+===================================================================
+--- libmrss-0.17.orig/src/mrss_free.c	2007-04-01 00:32:56.000000000 +0200
++++ libmrss-0.17/src/mrss_free.c	2007-04-01 15:45:44.000000000 +0200
+@@ -22,9 +22,14 @@
+ # error Use configure; make; make install
+ #endif
+ 
++#define _GNU_SOURCE
++
+ #include "mrss.h"
+ #include "mrss_internal.h"
+ 
++#include <locale.h>
++
++
+ static void __mrss_free_channel (mrss_t * mrss);
+ static void __mrss_free_category (mrss_category_t * category);
+ static void __mrss_free_hour (mrss_hour_t * hour);
+@@ -202,6 +207,9 @@
+       __mrss_free_item ((mrss_item_t *) old);
+     }
+ 
++  if (mrss->c_locale)
++    freelocale (mrss->c_locale);
++
+   if (mrss->allocated)
+     free (mrss);
+ }
+Index: libmrss-0.17/src/mrss_parser.c
+===================================================================
+--- libmrss-0.17.orig/src/mrss_parser.c	2007-03-30 01:07:56.000000000 +0200
++++ libmrss-0.17/src/mrss_parser.c	2007-04-01 16:40:57.000000000 +0200
+@@ -22,9 +22,13 @@
+ # error Use configure; make; make install
+ #endif
+ 
++#define _GNU_SOURCE
++
+ #include "mrss.h"
+ #include "mrss_internal.h"
+ 
++#include <locale.h>
++
+ static void
+ __mrss_parse_tag_insert (mrss_tag_t ** where, mrss_tag_t * what)
+ {
+@@ -133,7 +137,7 @@
+ }
+ 
+ static char *
+-__mrss_atom_prepare_date (char *datestr)
++__mrss_atom_prepare_date (mrss_t *data, char *datestr)
+ {
+   char *ret = NULL;
+   if (datestr)
+@@ -150,8 +154,14 @@
+ 	  stm.tm_year -= 1900;
+ 	  char datebuf[256];
+ 	  free (datestr);
+-	  strftime (datebuf, sizeof (datebuf), "%a, %d %b %Y %H:%M:%S %z",
+-		    &stm);
++
++      if (!data->c_locale) {
++        printf( "Creating the locale\n" );
++         data->c_locale = newlocale(LC_ALL_MASK,"C",NULL);
++      }
++
++	  strftime_l (datebuf, sizeof (datebuf), "%a, %d %b %Y %H:%M:%S %z",
++		    &stm, data->c_locale);
+ 	  ret = strdup (datebuf);
+ 	}
+     }
+@@ -269,16 +279,16 @@
+ 	  else if (!strcmp (cur->value, "published") && !item->pubDate
+ 		   && data->version == MRSS_VERSION_ATOM_1_0)
+ 	    item->pubDate =
+-	      __mrss_atom_prepare_date (nxmle_get_string (cur, NULL));
++	      __mrss_atom_prepare_date (data, nxmle_get_string (cur, NULL));
+ 	  else if (!strcmp(cur->value, "updated" ) && !item->pubDate
+ 		  && data->version == MRSS_VERSION_ATOM_1_0)
+ 	    item->pubDate =
+-         __mrss_atom_prepare_date (nxmle_get_string (cur, NULL));
++         __mrss_atom_prepare_date (data, nxmle_get_string (cur, NULL));
+ 
+ 	  /* issued -> pubDate (Atom 0.3) */
+ 	  else if (!strcmp (cur->value, "issued") && !item->pubDate)
+ 	    item->pubDate =
+-	      __mrss_atom_prepare_date (nxmle_get_string (cur, NULL));
++	      __mrss_atom_prepare_date (data, nxmle_get_string (cur, NULL));
+ 
+ 	  /* id -> guid */
+ 	  else if (!strcmp (cur->value, "id") && !item->guid
+@@ -701,7 +711,7 @@
+ 	  /* updated -> lastBuildDate */
+ 	  else if (!strcmp (cur->value, "updated"))
+ 	    data->lastBuildDate =
+-	      __mrss_atom_prepare_date (nxmle_get_string (cur, NULL));
++	      __mrss_atom_prepare_date (data, nxmle_get_string (cur, NULL));
+ 
+ 	  /* author -> managingeditor */
+ 	  else if (!strcmp (cur->value, "author"))
============================================================
--- packages/libmrss/libmrss_0.17.bb	2dc5c5b104a09e840eeec7934868236b5e5adf84
+++ packages/libmrss/libmrss_0.17.bb	b1ec3fabfe0aadbc9b9c4410c2fecc385a868c31
@@ -6,7 +6,10 @@ inherit autotools pkgconfig
 
 inherit autotools pkgconfig
 
-SRC_URI = "http://www2.autistici.org/bakunin//libmrss/libmrss-${PV}.tar.gz;md5sum=28d0e78d736748e67f25ad99456f10c3"
+SRC_URI = "http://www2.autistici.org/bakunin//libmrss/libmrss-${PV}.tar.gz;md5sum=28d0e78d736748e67f25ad99456f10c3 \
+           file://atom-changes.patch;patch=1                                                                       \
+           file://fix_atom_date_locale.patch;patch=1                                                               \
+           file://bump-version.patch;patch=1 "
 
 do_stage() {
     autotools_stage_all






More information about the Openembedded-commits mailing list