public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in www-servers/gorg/files: gorg-0.6.4-ruby19-date.patch gorg-0.6.4-ruby19.patch
@ 2011-12-04 10:12 Hans de Graaff (graaff)
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Graaff (graaff) @ 2011-12-04 10:12 UTC (permalink / raw
  To: gentoo-commits

graaff      11/12/04 10:12:59

  Added:                gorg-0.6.4-ruby19-date.patch
                        gorg-0.6.4-ruby19.patch
  Log:
  Convert to ruby-ng.eclass. Add ruby19 support. Thanks to naota for patches and testing in bug 315487.
  
  (Portage version: 2.1.10.11/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  www-servers/gorg/files/gorg-0.6.4-ruby19-date.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/gorg/files/gorg-0.6.4-ruby19-date.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/gorg/files/gorg-0.6.4-ruby19-date.patch?rev=1.1&content-type=text/plain

Index: gorg-0.6.4-ruby19-date.patch
===================================================================
diff --git a/lib/gorg/cache.rb b/lib/gorg/cache.rb
index 543b6a2..00ad1ab 100644
--- a/lib/gorg/cache.rb
+++ b/lib/gorg/cache.rb
@@ -22,7 +22,13 @@
 #  . a list of parameters as received by a webserver e.g.
 #  . a list of files it depends on
 
-require "parsedate"
+begin
+  require "parsedate"
+  $haveparsedate = true
+rescue LoadError
+  require "time"
+  $haveparsedate = false
+end
 require "fileutils"
 require "find"
 require "digest"
@@ -106,7 +112,11 @@ module Cache
       
         fst = File.stat(f)
         raise "Size of #{f} has changed from #{fst.size} to #{s.to_i}" unless fst.size == s.to_i
-        raise "Timestamp of #{f} has changed" unless Time.utc(*ParseDate.parsedate(d)) == fst.mtime.utc
+        if $haveparsedate
+          raise "Timestamp of #{f} has changed" unless Time.utc(*ParseDate.parsedate(d)) == fst.mtime.utc
+        else
+          raise "Timestamp of #{f} has changed" unless Time.parse(d) == fst.mtime.utc
+        end
       end
       mline = meta.shift
     end



1.1                  www-servers/gorg/files/gorg-0.6.4-ruby19.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/gorg/files/gorg-0.6.4-ruby19.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-servers/gorg/files/gorg-0.6.4-ruby19.patch?rev=1.1&content-type=text/plain

Index: gorg-0.6.4-ruby19.patch
===================================================================
diff --git a/ext/gorg/xsl/xsl.c b/ext/gorg/xsl/xsl.c
index d8d40b6..58ffc49 100644
--- a/ext/gorg/xsl/xsl.c
+++ b/ext/gorg/xsl/xsl.c
@@ -20,6 +20,13 @@
 
 #include "xsl.h"
 
+#ifndef RARRAY_LEN
+#define RARRAY_LEN(a) RARRAY(a)->len
+#endif
+#ifndef RSTRING_LEN
+#define RSTRING_LEN(str) RSTRING(str)->len
+#endif
+
 /*
  * Copied from xmlIO.c from libxml2
  */
@@ -156,8 +163,8 @@ void *XRootOpen (const char *filename, const char* rw) {
   
   if (g_xroot != Qnil)
   {
-    rbxrootPtr = RSTRING(g_xroot)->ptr;
-    rbxrootLen = RSTRING(g_xroot)->len;
+    rbxrootPtr = RSTRING_PTR(g_xroot);
+    rbxrootLen = RSTRING_LEN(g_xroot);
   }
   path = (char *) malloc((strlen(filename) + rbxrootLen + 1) * sizeof(char));
   if (path == NULL)
@@ -284,10 +291,10 @@ void xslMessageHandler(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
  */
 int looksLikeXML(VALUE v)
 {
-  return    (RSTRING(v)->len > FILENAME_MAX)
-         || (!strncmp(RSTRING(v)->ptr, "<?xml", 5))
-         || (!strncmp(RSTRING(v)->ptr, "<?xsl", 5))
-         || (strstr(RSTRING(v)->ptr, "\n"));
+  return    (RSTRING_LEN(v) > FILENAME_MAX)
+         || (!strncmp(RSTRING_PTR(v), "<?xml", 5))
+         || (!strncmp(RSTRING_PTR(v), "<?xsl", 5))
+         || (strstr(RSTRING_PTR(v), "\n"));
 //            We could also try with " " but some are stupid enough to use spaces in filenames
 }
  
@@ -456,7 +463,7 @@ VALUE check_params(VALUE xparams)
     // empty array => Qnil
     // array.length==2, could be 2 params [[p1,v1],[p2,v2]] or 1 param [p,v]
     // if both items are arrays, we have a list of params, otherwise we have a single param
-    len = RARRAY(ary)->len;
+    len = RARRAY_LEN(ary);
     switch (len)
     {
       case 0:
@@ -522,17 +529,17 @@ char *build_params(VALUE rbparams)
 
   // Compute total block size in one go
   tempval = rb_funcall(rbparams, id.to_s, 0);
-  ret = malloc (  ((RARRAY(rbparams)->len)*2+1) * sizeof(void *) // Two pointers per [param, value] + 1 NULL
-                + (RARRAY(rbparams)->len) * 4 * sizeof(char)     // Quotes around values + 1 NULL per value
-                + (RSTRING(tempval)->len) * sizeof(char)         // Size of param names & values
+  ret = malloc (  ((RARRAY_LEN(rbparams))*2+1) * sizeof(void *) // Two pointers per [param, value] + 1 NULL
+                + (RARRAY_LEN(rbparams)) * 4 * sizeof(char)     // Quotes around values + 1 NULL per value
+                + (RSTRING_LEN(tempval)) * sizeof(char)         // Size of param names & values
                   );
   if ( ret==NULL)
     return NULL; // out of memory
 
   paramPtr = (char **)ret;
-  paramData = ret + ((RARRAY(rbparams)->len)*2+1) * sizeof(void *);
+  paramData = ret + ((RARRAY_LEN(rbparams))*2+1) * sizeof(void *);
   // Copy each param name & value
-  for (i=0; i<RARRAY(rbparams)->len; ++i)
+  for (i=0; i<RARRAY_LEN(rbparams); ++i)
   {
     tempval = rb_ary_entry(rbparams, i); // ith param, i.e. [name, value]
     
@@ -542,9 +549,9 @@ char *build_params(VALUE rbparams)
     // Add param name address to list of pointers
     *paramPtr++ = paramData;
     // Copy param name into data block
-    strcpy(paramData, RSTRING(tempstr)->ptr);
+    strcpy(paramData, RSTRING_PTR(tempstr));
     // Move data pointer after inserted string
-    paramData += 1+ RSTRING(tempstr)->len;
+    paramData += 1+ RSTRING_LEN(tempstr);
     
     // 2. Copy param value, quoting it with ' or "
     
@@ -552,7 +559,7 @@ char *build_params(VALUE rbparams)
     // Don't bother if param is a mix of ' and ", users should know better :-)
     // or it's been checked already. Here we expect params to be OK.
     quotingChar = '"';
-    if ( strchr(RSTRING(tempstr)->ptr, quotingChar) )
+    if ( strchr(RSTRING_PTR(tempstr), quotingChar) )
       quotingChar = '\''; // Use ' instead of "
 
     // Add para value address in list of pointers
@@ -561,9 +568,9 @@ char *build_params(VALUE rbparams)
     // Start with quoting character
     *paramData++ = quotingChar;
     // Copy value
-    strcpy(paramData, RSTRING(tempstr)->ptr);
+    strcpy(paramData, RSTRING_PTR(tempstr));
     // Move data pointer after inserted string
-    paramData += RSTRING(tempstr)->len;
+    paramData += RSTRING_LEN(tempstr);
     // Close quote
     *paramData++ = quotingChar;
     // End string with \0
@@ -593,13 +600,13 @@ VALUE xsl_process_real(VALUE none, VALUE self)
   if (NIL_P(rbxml))
     rb_raise(rb_eArgError, "No XML data");
   rbxml = StringValue(rbxml);
-  if (!RSTRING(rbxml)->len)
+  if (!RSTRING_LEN(rbxml))
     rb_raise(rb_eArgError, "No XML data");
   rbxsl = rb_iv_get(self, "@xsl");
   if (NIL_P(rbxsl))
     rb_raise(rb_eArgError, "No Stylesheet");
   rbxsl = StringValue(rbxsl);
-  if (!RSTRING(rbxsl)->len)
+  if (!RSTRING_LEN(rbxsl))
     rb_raise(rb_eArgError, "No Stylesheet");
   rbxroot = rb_iv_get(self, "@xroot");
   rbparams = check_params(rb_iv_get(self, "@xparams"));
@@ -625,7 +632,7 @@ VALUE xsl_process_real(VALUE none, VALUE self)
   // Parse XSL
   if (looksLikeXML(rbxsl))
   {
-    myPointers.docxsl = xmlParseMemory(RSTRING(rbxsl)->ptr, RSTRING(rbxsl)->len);
+    myPointers.docxsl = xmlParseMemory(RSTRING_PTR(rbxsl), RSTRING_LEN(rbxsl));
 //    myPointers.docxsl = xmlReadMemory(RSTRING(rbxsl)->ptr, RSTRING(rbxsl)->len, ".", NULL, 0);
     if (myPointers.docxsl == NULL)
     {
@@ -641,7 +648,7 @@ VALUE xsl_process_real(VALUE none, VALUE self)
   }
   else // xsl is a filename
   {
-    myPointers.xsl = xsltParseStylesheetFile(RSTRING(rbxsl)->ptr);
+    myPointers.xsl = xsltParseStylesheetFile(RSTRING_PTR(rbxsl));
     if (myPointers.xsl == NULL)
     {
       my_raise(self, &myPointers, rb_eSystemCallError, "XSL file loading error");
@@ -652,7 +659,7 @@ VALUE xsl_process_real(VALUE none, VALUE self)
   // Parse XML 
   if (looksLikeXML(rbxml))
   {
-    myPointers.docxml = xmlReadMemory(RSTRING(rbxml)->ptr, RSTRING(rbxml)->len, ".", NULL, xmlOptions);
+    myPointers.docxml = xmlReadMemory(RSTRING_PTR(rbxml), RSTRING_LEN(rbxml), ".", NULL, xmlOptions);
     if (myPointers.docxml == NULL)
     {
       my_raise(self, &myPointers, rb_eSystemCallError, "XML parsing error");
@@ -661,7 +668,7 @@ VALUE xsl_process_real(VALUE none, VALUE self)
   }
   else // xml is a filename
   {
-	  myPointers.docxml = xmlReadFile(RSTRING(rbxml)->ptr, NULL, xmlOptions);
+	  myPointers.docxml = xmlReadFile(RSTRING_PTR(rbxml), NULL, xmlOptions);
     if (myPointers.docxml == NULL)
     {
       my_raise(self, &myPointers, rb_eSystemCallError, "XML file parsing error");






^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo-x86 commit in www-servers/gorg/files: gorg-0.6.4-ruby19-date.patch gorg-0.6.4-ruby19.patch
@ 2015-07-05  6:32 Hans de Graaff (graaff)
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Graaff (graaff) @ 2015-07-05  6:32 UTC (permalink / raw
  To: gentoo-commits

graaff      15/07/05 06:32:17

  Removed:              gorg-0.6.4-ruby19-date.patch
                        gorg-0.6.4-ruby19.patch
  Log:
  Remove masked gorg package.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-05  6:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-04 10:12 [gentoo-commits] gentoo-x86 commit in www-servers/gorg/files: gorg-0.6.4-ruby19-date.patch gorg-0.6.4-ruby19.patch Hans de Graaff (graaff)
  -- strict thread matches above, loose matches on Subject: below --
2015-07-05  6:32 Hans de Graaff (graaff)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox