summaryrefslogtreecommitdiff
path: root/www/typolight27
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2009-06-22 01:17:06 +0000
committertaca <taca@pkgsrc.org>2009-06-22 01:17:06 +0000
commit6ba2d7557d19698b19e92472809166c2913fd547 (patch)
tree83d4a105ec0ab670cba1c04c6a8b64e14b3ada36 /www/typolight27
parent411d15e415037171b5e52d124ded42f940c65711 (diff)
downloadpkgsrc-6ba2d7557d19698b19e92472809166c2913fd547.tar.gz
Add a patch to fix Extention Repository access problem.
Bump PKGREVISION. Approved by agc@.
Diffstat (limited to 'www/typolight27')
-rw-r--r--www/typolight27/Makefile9
-rw-r--r--www/typolight27/distinfo3
-rw-r--r--www/typolight27/patches/patch-aa327
3 files changed, 334 insertions, 5 deletions
diff --git a/www/typolight27/Makefile b/www/typolight27/Makefile
index 6735d797dc9..2a3cc9db34a 100644
--- a/www/typolight27/Makefile
+++ b/www/typolight27/Makefile
@@ -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 @@ pre-install:
${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 --git a/www/typolight27/distinfo b/www/typolight27/distinfo
index 6907a5ad5ed..2e148831f31 100644
--- a/www/typolight27/distinfo
+++ b/www/typolight27/distinfo
@@ -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 --git a/www/typolight27/patches/patch-aa b/www/typolight27/patches/patch-aa
new file mode 100644
index 00000000000..f50b924cfab
--- /dev/null
+++ b/www/typolight27/patches/patch-aa
@@ -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>
+ * @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);
++
++ while (($line = trim(array_shift($split))) != false)
++ {
++ list($header, $value) = explode(':', $line, 2);
++
++ if (isset($this->arrResponseHeaders[$header]) && $header == 'Set-Cookie')
++ {
++ $this->arrResponseHeaders[$header] .= ',' . trim($value);
++ }
++ else
++ {
++ $this->arrResponseHeaders[$header] = trim($value);
++ }
++ }
++
++ $responses = array
++ (
++ 100 => 'Continue',
++ 101 => 'Switching Protocols',
++ 200 => 'OK',
++ 201 => 'Created',
++ 202 => 'Accepted',
++ 203 => 'Non-Authoritative Information',
++ 204 => 'No Content',
++ 205 => 'Reset Content',
++ 206 => 'Partial Content',
++ 300 => 'Multiple Choices',
++ 301 => 'Moved Permanently',
++ 302 => 'Found',
++ 303 => 'See Other',
++ 304 => 'Not Modified',
++ 305 => 'Use Proxy',
++ 307 => 'Temporary Redirect',
++ 400 => 'Bad Request',
++ 401 => 'Unauthorized',
++ 402 => 'Payment Required',
++ 403 => 'Forbidden',
++ 404 => 'Not Found',
++ 405 => 'Method Not Allowed',
++ 406 => 'Not Acceptable',
++ 407 => 'Proxy Authentication Required',
++ 408 => 'Request Timeout',
++ 409 => 'Conflict',
++ 410 => 'Gone',
++ 411 => 'Length Required',
++ 412 => 'Precondition Failed',
++ 413 => 'Request Entity Too Large',
++ 414 => 'Request-URI Too Large',
++ 415 => 'Unsupported Media Type',
++ 416 => 'Requested Range Not Satisfiable',
++ 417 => 'Expectation Failed',
++ 500 => 'Internal Server Error',
++ 501 => 'Not Implemented',
++ 502 => 'Bad Gateway',
++ 503 => 'Service Unavailable',
++ 504 => 'Gateway Timeout',
++ 505 => 'HTTP Version Not Supported'
++ );
++
++ if (!isset($responses[$code]))
++ {
++ $code = floor($code / 100) * 100;
++ }
++
++ $this->intCode = $code;
++
++ if (!in_array(intval($code), array(200, 304)))
++ {
++ $this->strError = strlen($text) ? $text : $responses[$code];
++ }
+ }
+ }
+