pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/www/typolight27 Add a patch to fix Extention Repositor...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/624c2a4c07f3
branches:  trunk
changeset: 394900:624c2a4c07f3
user:      taca <taca%pkgsrc.org@localhost>
date:      Mon Jun 22 01:17:06 2009 +0000

description:
Add a patch to fix Extention Repository access problem.
Bump PKGREVISION.

Approved by agc@.

diffstat:

 www/typolight27/Makefile         |    9 +-
 www/typolight27/distinfo         |    3 +-
 www/typolight27/patches/patch-aa |  327 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 334 insertions(+), 5 deletions(-)

diffs (truncated from 373 to 300 lines):

diff -r adb4e84de5f8 -r 624c2a4c07f3 www/typolight27/Makefile
--- a/www/typolight27/Makefile  Mon Jun 22 01:11:40 2009 +0000
+++ b/www/typolight27/Makefile  Mon Jun 22 01:17:06 2009 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2009/05/01 03:04:48 taca Exp $
+# $NetBSD: Makefile,v 1.4 2009/06/22 01:17:06 taca Exp $
 #
 
 DISTNAME=      typolight-${TL_VERSION}
 PKGNAME=       typolight${TL_VER}-${TL_PKGVER}
+PKGREVISION=   1
 CATEGORIES=    www
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=typolight/}
 
@@ -106,13 +107,13 @@
        ${FIND} ${WRKSRC} -name "*.orig*" -exec ${RM} -f {} \;
 
 do-install:
-       cd ${WRKSRC}; pax -rw -pm ${WWW_FILES} ${DESTDIR}${PREFIX}/${TL_WEBDIR}
+       cd ${WRKSRC}; pax -rw ${WWW_FILES} ${DESTDIR}${PREFIX}/${TL_WEBDIR}
        cd ${WRKSRC}/system; \
-               pax -rw -pm ${WWW_SYSFILES} \
+               pax -rw ${WWW_SYSFILES} \
                        ${DESTDIR}${PREFIX}/${TL_WEBDIR}/system; \
                ${INSTALL_DATA} config/.htaccess \
                        ${DESTDIR}${PREFIX}/${TL_WEBDIR}/system/config
-       cd ${WRKSRC}; pax -rw -pm ${EG_DATA} ${DESTDIR}${PREFIX}/${TL_EGDIR}
+       cd ${WRKSRC}; pax -rw ${EG_DATA} ${DESTDIR}${PREFIX}/${TL_EGDIR}
        rm -f ${DESTDIR}${PREFIX}/${TL_EGDIR}/system/config/.htaccess
        ${INSTALL_DATA} ${WRKDIR}/typolight.conf ${DESTDIR}${PREFIX}/${TL_EGDIR}
        ${INSTALL_DATA} ${WRKDIR}/templates-htaccess \
diff -r adb4e84de5f8 -r 624c2a4c07f3 www/typolight27/distinfo
--- a/www/typolight27/distinfo  Mon Jun 22 01:11:40 2009 +0000
+++ b/www/typolight27/distinfo  Mon Jun 22 01:17:06 2009 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.3 2009/05/30 16:53:26 taca Exp $
+$NetBSD: distinfo,v 1.4 2009/06/22 01:17:06 taca Exp $
 
 SHA1 (typolight-2.7.1.tar.gz) = 498f1b117c5fd5edd21f5e62ab98a6ac9d393b2c
 RMD160 (typolight-2.7.1.tar.gz) = b6e0690a8f1c13ef57ddd9a6cc7cf2d2265f1dec
 Size (typolight-2.7.1.tar.gz) = 4286757 bytes
+SHA1 (patch-aa) = 901a6fdf247c950418e0b540b6107e9fab7ef235
diff -r adb4e84de5f8 -r 624c2a4c07f3 www/typolight27/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/typolight27/patches/patch-aa  Mon Jun 22 01:17:06 2009 +0000
@@ -0,0 +1,327 @@
+$NetBSD: patch-aa,v 1.1 2009/06/22 01:17:06 taca Exp $
+
+Fix Extention Repository access problem from TYPOlight forum's
+articles :
+       http://www.typolight.org/forum/topic/12088.html
+       http://www.typolight.org/board/message/80018.html
+
+--- system/libraries/Request.php.orig  2009-05-08 23:12:15.000000000 +0900
++++ system/libraries/Request.php
+@@ -30,7 +30,8 @@
+ /**
+  * Class Request
+  *
+- * Provide methods to handle HTTP request.
++ * Provide methods to handle HTTP request. This class uses some functions of
++ * Drupal's HTTP request class that you can find on http://drupal.org.
+  * @copyright  Leo Feyer 2005-2009
+  * @author     Leo Feyer <leo%typolight.org@localhost>
+  * @package    Library
+@@ -39,27 +40,61 @@ class Request
+ {
+ 
+       /**
+-       * HTTP object
+-       * @var object
++       * Data to be added to the request
++       * @var string
+        */
+-      protected $objHttp;
++      protected $strData;
+ 
++      /**
++       * Request method (defaults to GET)
++       * @var string
++       */
++      protected $strMethod;
+ 
+       /**
+-       * Instantiate object and load http plugin
+-       * @throws Exception
++       * Error string
++       * @var string
+        */
+-      public function __construct()
+-      {
+-              $strPluginPath = TL_ROOT . '/plugins/http';
++      protected $strError;
+ 
+-              if (!is_dir($strPluginPath))
+-              {
+-                      throw new Exception('Plugin http required');
+-              }
++      /**
++       * Response code
++       * @var integer
++       */
++      protected $intCode;
++
++      /**
++       * Response string
++       * @var string
++       */
++      protected $strResponse;
++
++      /**
++       * Request string
++       * @var string
++       */
++      protected $strRequest;
++
++      /**
++       * Headers array (these headers will be sent)
++       * @var array
++       */
++      protected $arrHeaders = array();
++
++      /**
++       * Response headers array (these headers are returned)
++       * @var array
++       */
++      protected $arrResponseHeaders = array();
+ 
+-              include_once($strPluginPath . '/class.http.php');
+-              $this->objHttp = new Http();
++
++      /**
++       * Set default values
++       */
++      public function __construct()
++      {
++              $this->strData = '';
++              $this->strMethod = 'get';
+       }
+ 
+ 
+@@ -74,11 +109,11 @@ class Request
+               switch ($strKey)
+               {
+                       case 'data':
+-                              $this->objHttp->setParams($varValue);
++                              $this->strData = $varValue;
+                               break;
+ 
+                       case 'method':
+-                              $this->objHttp->setMethod(strtoupper($varValue));
++                              $this->strMethod = $varValue;
+                               break;
+ 
+                       default:
+@@ -98,19 +133,23 @@ class Request
+               switch ($strKey)
+               {
+                       case 'error':
+-                              return $this->objHttp->getError();
++                              return $this->strError;
+                               break;
+ 
+                       case 'code':
+-                              return $this->objHttp->getStatus();
++                              return $this->intCode;
++                              break;
++
++                      case 'request':
++                              return $this->strRequest;
+                               break;
+ 
+                       case 'response':
+-                              return $this->objHttp->getResult();
++                              return $this->strResponse;
+                               break;
+ 
+                       case 'headers':
+-                              return $this->objHttp->getHeaders();
++                              return $this->arrResponseHeaders;
+                               break;
+ 
+                       default:
+@@ -121,12 +160,23 @@ class Request
+ 
+ 
+       /**
++       * Set additional request headers
++       * @param string
++       * @param mixed
++       */
++      public function setHeader($strKey, $varValue)
++      {
++              $this->arrHeaders[$strKey] = $varValue;
++      }
++
++
++      /**
+        * Return true if there has been an error
+        * @return boolean
+        */
+       public function hasError()
+       {
+-              return ($this->objHttp->getError() != '');
++              return strlen($this->strError) ? true : false;
+       }
+ 
+ 
+@@ -140,15 +190,161 @@ class Request
+       {
+               if ($strData)
+               {
+-                      $this->objHttp->setParams($strData);
++                      $this->strData = $strData;
+               }
+ 
+               if ($strMethod)
+               {
+-                      $this->objHttp->setMethod(strtoupper($strMethod));
++                      $this->strMethod = $strMethod;
+               }
+ 
+-              $this->objHttp->execute($strUrl);
++              $errstr = '';
++              $errno = null;
++              $uri = parse_url($strUrl);
++
++              switch ($uri['scheme'])
++              {
++                      case 'http':
++                              $port = isset($uri['port']) ? $uri['port'] : 80;
++                              $host = $uri['host'] . (($port != 80) ? ':' . $port : '');
++                              $fp = @fsockopen($uri['host'], $port, $errno, $errstr, 10);
++                              break;
++
++                      case 'https':
++                              $port = isset($uri['port']) ? $uri['port'] : 443;
++                              $host = $uri['host'] . (($port != 443) ? ':' . $port : '');
++                              $fp = @fsockopen('ssl://' . $uri['host'], $port, $errno, $errstr, 15);
++                              break;
++
++                      default:
++                              $this->strError = 'Invalid schema ' . $uri['scheme'];
++                              return;
++                              break;
++              }
++
++              if (!is_resource($fp))
++              {
++                      $this->strError = trim($errno .' '. $errstr);
++                      return;
++              }
++
++              $path = isset($uri['path']) ? $uri['path'] : '/';
++
++              if (isset($uri['query']))
++              {
++                      $path .= '?' . $uri['query'];
++              }
++
++              $default = array
++              (
++                      'Host' => 'Host: ' . $host,
++                      'User-Agent' => 'User-Agent: TYPOlight (+http://www.typolight.org/)',
++                      'Content-Length' => 'Content-Length: '. strlen($this->strData),
++                      'Connection' => 'Connection: close'
++              );
++
++              foreach ($this->arrHeaders as $header=>$value)
++              {
++                      $default[$header] = $header . ': ' . $value;
++              }
++
++              $request = strtoupper($this->strMethod) .' '. $path ." HTTP/1.1\r\n";
++              $request .= implode("\r\n", $default);
++              $request .= "\r\n\r\n";
++
++              if (strlen($this->strData))
++              {
++                      $request .= $this->strData . "\r\n";
++              }
++
++              $this->strRequest = $request;
++
++              fwrite($fp, $request);
++
++              $response = '';
++
++              while (!feof($fp) && ($chunk = fread($fp, 1024)) != false)
++              {
++                      $response .= $chunk;
++              }
++
++              fclose($fp);
++
++              list($split, $this->strResponse) = explode("\r\n\r\n", $response, 2);
++              $split = preg_split("/\r\n|\n|\r/", $split);
++
++              $this->arrResponseHeaders = array();
++              list(, $code, $text) = explode(' ', trim(array_shift($split)), 3);



Home | Main Index | Thread Index | Old Index