[arch-commits] Commit in web-news/trunk (PKGBUILD php7.patch)

Sergej Pupykin spupykin at archlinux.org
Tue Feb 16 15:07:31 UTC 2016


    Date: Tuesday, February 16, 2016 @ 16:07:31
  Author: spupykin
Revision: 161845

upgpkg: web-news 1.6.4-6

upd

Added:
  web-news/trunk/php7.patch
Modified:
  web-news/trunk/PKGBUILD

------------+
 PKGBUILD   |   16 ++++++++++++----
 php7.patch |   45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-02-16 15:03:12 UTC (rev 161844)
+++ PKGBUILD	2016-02-16 15:07:31 UTC (rev 161845)
@@ -3,7 +3,7 @@
 
 pkgname=web-news
 pkgver=1.6.4
-pkgrel=5
+pkgrel=6
 pkgdesc="A PHP web-based NNTP client"
 arch=('any')
 url="http://sourceforge.net/projects/web-news"
@@ -12,14 +12,22 @@
 backup=('etc/webapps/web-news/.htaccess'
 	'etc/webapps/web-news/webnews.cfg.php')
 source=(http://downloads.sourceforge.net/sourceforge/web-news/WebNews-$pkgver.tar.gz
-	utf8.patch)
+	utf8.patch
+	php7.patch)
 md5sums=('712ec4812bed52569ab83596dd2291a9'
-         '721064173f5b085c204b97c8bbe096e2')
+         '721064173f5b085c204b97c8bbe096e2'
+         '6908ee4cd9d5936507ff40f7bb18419b')
 
+prepare() {
+  cd $srcdir
+  patch -p1 <utf8.patch && rm -f utf8.patch
+  patch -p1 <php7.patch && rm -f php7.patch
+  find . -type f -name '*.orig' -exec rm -f {} \;
+}
+
 package() {
   _instdir=$pkgdir/usr/share/webapps/web-news
   mkdir -p ${_instdir} $pkgdir/etc/webapps/web-news
-  (cd $srcdir && patch -p1 <utf8.patch && rm -f utf8.patch)
   cd ${_instdir}
   rm -f $srcdir/WebNews-$pkgver.tar.gz
   cp -ra $srcdir/* .

Added: php7.patch
===================================================================
--- php7.patch	                        (rev 0)
+++ php7.patch	2016-02-16 15:07:31 UTC (rev 161845)
@@ -0,0 +1,45 @@
+diff -wbBur src/webnews/MIME_Message.php src.my/webnews/MIME_Message.php
+--- src/webnews/MIME_Message.php	2004-09-20 15:58:04.000000000 +0400
++++ src.my/webnews/MIME_Message.php	2016-02-16 18:02:11.415650635 +0300
+@@ -64,7 +64,7 @@
+ 		function decode_header($headers) {
+ 			$header_want = "/^(From|Subject|Date|Newsgroups|References|Message-ID|Content-Type|Content-Transfer-Encoding|Content-Disposition|Content-ID): (.*$)/i";
+ 			
+-			$headers = split("\r\n", $headers);
++			$headers = explode("\r\n", $headers);
+ 
+ 			// Parse the header
+ 			for ($line_count = 0; $line_count < sizeof($headers);$line_count++) {
+@@ -88,7 +88,7 @@
+ 
+ 		// An article is a raw MIME message
+ 		function decode_article($article) {
+-			list($header, $body) = split("\r\n\r\n", $article, 2);
++			list($header, $body) = explode("\r\n\r\n", $article, 2);
+ 						
+ 			$header = $this->decode_header($header);
+ 
+diff -wbBur src/webnews/util.php src.my/webnews/util.php
+--- src/webnews/util.php	2006-03-28 21:59:23.000000000 +0400
++++ src.my/webnews/util.php	2016-02-16 18:02:11.415650635 +0300
+@@ -46,7 +46,10 @@
+ 			$str = $matches[1].quoted_printable_decode($str).$matches[3];
+ 		}
+ 		while (preg_match("/=\?.*\?b\?.*\?=/i", $str)) {
+-			$str = preg_replace("/(.*)=\?.*\?b\?(.*)\?=(.*)/ie", "'$1'.base64_decode('$2').'$3'", $str);
++			$str = preg_replace_callback("/(.*)=\?.*\?b\?(.*)\?=(.*)/i",
++				function ($matches) {
++					return $matches[1].base64_decode($matches[2]).$matches[3];
++				}, $str);
+ 		}
+ 
+ 		return $str;
+@@ -403,7 +406,7 @@
+ 						$ini[$section_name] = array();
+ 					}
+ 				} else if (strpos($buf, "=") !== FALSE) {
+-					list($key, $value) = split("=", $buf, 2);
++					list($key, $value) = explode("=", $buf, 2);
+ 					$value = preg_replace("/^(['|\"])?(.*?)(?(1)['|\"])$/", "\\2", trim($value));
+ 
+ 					if ((strlen($key) != 0) && (strlen($value) != 0)) {					



More information about the arch-commits mailing list