packages: dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-redirectlinks.p...

glen glen at pld-linux.org
Tue Jun 12 22:58:09 CEST 2012


Author: glen                         Date: Tue Jun 12 20:58:09 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- update to 20110811

---- Files affected:
packages/dokuwiki-plugin-pagemove:
   dokuwiki-plugin-pagemove-redirectlinks.patch (1.2 -> 1.3) , dokuwiki-plugin-pagemove-selflinks.patch (1.2 -> 1.3) , dokuwiki-plugin-pagemove.spec (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-redirectlinks.patch
diff -u packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-redirectlinks.patch:1.2 packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-redirectlinks.patch:1.3
--- packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-redirectlinks.patch:1.2	Tue Mar 23 10:01:37 2010
+++ packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-redirectlinks.patch	Tue Jun 12 22:58:04 2012
@@ -1,57 +1,58 @@
---- pagemove/admin.php~	2010-03-22 15:40:57.000000000 +0200
-+++ pagemove/admin.php	2010-03-22 15:42:35.999975148 +0200
-@@ -698,7 +698,8 @@
-     function _pm_updatelinks(&$text, $links)
-     {
-       foreach( $links as $old => $new ) {
--        $text = preg_replace( '#\[\[:?' . $old . '((\]\])|[\|\#])#i', '[[' . $new . '\1', $text);
-+        $text = preg_replace( '#\[\[:?' . $old . '(\]\]|[\|\#])#i', '[[' . $new . '\1', $text);
-+        $text = preg_replace( '#~~REDIRECT>' . $old . '(~~|[\|\#])#i', '~~REDIRECT>' . $new . '\1', $text);
-       }
+--- dokuwiki-plugin-pagemove-20110811/admin.php~	2012-06-12 23:38:07.000000000 +0300
++++ dokuwiki-plugin-pagemove-20110811/admin.php	2012-06-12 23:47:42.513225196 +0300
+@@ -742,7 +742,8 @@
+      */
+     function _pm_updatelinks(&$text, $links) {
+         foreach( $links as $old => $new ) {
+-            $text = preg_replace( '#\[\[:?' . $old . '((\]\])|[\|\#])#i', '[[' . $new . '\1', $text);
++            $text = preg_replace( '#\[\[:?' . $old . '(\]\]|[\|\#])#i', '[[' . $new . '\1', $text);
++            $text = preg_replace( '#~~REDIRECT>' . $old . '(~~|[\|\#])#i', '~~REDIRECT>' . $new . '\1', $text);
+         }
      }
  
-@@ -440,7 +441,14 @@
-       //match all links
-       //FIXME may be incorrect because of code blocks
-       //      CamelCase isn't supported, too
--      preg_match_all('#\[\[(.+?)\]\]#si',$text,$matches,PREG_SET_ORDER);
-+      $matches = array();
-+      if (preg_match_all('#\[\[(.+?)\]\]#s',$text,$m,PREG_SET_ORDER)) {
-+        $matches = array_merge($matches, $m);
-+      }
-+      if (preg_match_all('#~~REDIRECT>(.+?)~~#s',$text,$m,PREG_SET_ORDER)) {
-+        $matches = array_merge($matches, $m);
-+      }
+@@ -772,7 +772,14 @@
+         // match all links
+         // FIXME may be incorrect because of code blocks
+         // TODO CamelCase isn't supported, too
+-        preg_match_all('#\[\[(.+?)\]\]#si', $text, $matches, PREG_SET_ORDER);
++        $matches = array();
++        if (preg_match_all('#\[\[(.+?)\]\]#s', $text, $m, PREG_SET_ORDER)) {
++            $matches = array_merge($matches, $m);
++        }
++        if (preg_match_all('#~~REDIRECT>(.+?)~~#s', $text, $m, PREG_SET_ORDER)) {
++            $matches = array_merge($matches, $m);
++        }
 +
-       foreach($matches as $match){
-         //get ID from link and discard most non wikilinks
-         list($mid) = split('[\|#]',$match[1],2);
-@@ -572,9 +580,9 @@
-      */
-     function _pm_search_backlinks(&$data,$base,$file,$type,$lvl,$opts){
-       //we do nothing with directories
--      if($type == 'd') return true;;
-+      if($type == 'd') return true;
-       //only search txt files
--      if(!preg_match('#\.txt$#',$file)) return true;;
-+      if(!preg_match('#\.txt$#',$file)) return true;
-     
-       //get text
-       $text = io_readfile($base.'/'.$file);
---- pagemove/admin.php~	2010-03-22 15:44:35.000000000 +0200
-+++ pagemove/admin.php	2010-03-22 15:45:49.644880286 +0200
-@@ -770,7 +770,13 @@
-       //match all links
-       //FIXME may be incorrect because of code blocks
-       //      CamelCase isn't supported, too
--      preg_match_all('#{{(.[^>]+?)}}#si',$text,$matches,PREG_SET_ORDER);
-+      $matches = array();
-+	  if (preg_match_all('#{{(.[^>]+?)}}#si',$text,$matches,PREG_SET_ORDER)) {
-+        $matches = array_merge($matches, $m);
-+	  }
-+      if (preg_match_all('#~~REDIRECT>(.+?)~~#s',$text,$m,PREG_SET_ORDER)) {
-+        $matches = array_merge($matches, $m);
-+      }
-       foreach($matches as $match){
-         //get ID from link and discard most non wikilinks
-         list($mid) = split('(\?|\|)',$match[1],2);
+         foreach($matches as $match) {
+             // ignore local headings [[#some_heading]]
+             if ( preg_match('/^#/', $match[1])) continue;
+@@ -819,7 +819,13 @@
+         // match all links
+         // FIXME may be incorrect because of code blocks
+         // TODO CamelCase isn't supported, too
+-        preg_match_all('#{{(.[^>]+?)}}#si', $text, $matches, PREG_SET_ORDER);
++        $matches = array();
++        if (preg_match_all('#{{(.[^>]+?)}}#si', $text, $m, PREG_SET_ORDER)) {
++            $matches = array_merge($matches, $m);
++        }
++        if (preg_match_all('#~~REDIRECT>(.+?)~~#s', $text, $m, PREG_SET_ORDER)) {
++            $matches = array_merge($matches, $m);
++        }
+         foreach($matches as $match) {
+             // get ID from link and discard most non wikilinks
+             list($mid) = split('(\?|\|)', $match[1], 2);
+@@ -947,7 +947,13 @@
+         // match all links
+         // FIXME may be incorrect because of code blocks
+         // FIXME CamelCase isn't supported, too
+-        preg_match_all('#\[\[(.+?)\]\]#si', $text, $matches, PREG_SET_ORDER);
++        $matches = array();
++        if (preg_match_all('#\[\[(.+?)\]\]#s', $text, $m, PREG_SET_ORDER)) {
++            $matches = array_merge($matches, $m);
++        }
++        if (preg_match_all('#~~REDIRECT>(.+?)~~#s', $text, $m, PREG_SET_ORDER)) {
++            $matches = array_merge($matches, $m);
++        }
+         foreach($matches as $match) {
+             // get ID from link and discard most non wikilinks
+             list($matchLink) = split('[\|#]', $match[1], 2);

================================================================
Index: packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-selflinks.patch
diff -u packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-selflinks.patch:1.2 packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-selflinks.patch:1.3
--- packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-selflinks.patch:1.2	Tue Mar 23 10:01:37 2010
+++ packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-selflinks.patch	Tue Jun 12 22:58:04 2012
@@ -1,65 +1,67 @@
---- pagemove/admin.php~	2010-03-22 15:48:44.000000000 +0200
-+++ pagemove/admin.php	2010-03-22 15:52:23.529214700 +0200
-@@ -600,22 +600,36 @@
-           //saveWikiText($ID, '', $this->lang['pm_movedto'].$opts['new_id']);
-           //if (@file_exists(wikiFN($opts['new_id']))) @unlink(wikiFN($ID));
-           if (@file_exists(wikiFN($opts['new_id']))) saveWikiText($ID, '',$this->lang['pm_delete'] );
--            
+--- dokuwiki-plugin-pagemove-20110811/admin.php~	2012-06-12 23:48:17.000000000 +0300
++++ dokuwiki-plugin-pagemove-20110811/admin.php	2012-06-12 23:50:28.916910665 +0300
+@@ -370,10 +370,10 @@
+ 
+             // Set things up to display the new page.
+             io_saveFile($conf['cachedir'].'/purgefile', time());
+-            $ID = $opts['new_id'];
+-            $ACT = 'show';
+-            $INFO = pageinfo();
+-            $this->show_form = false;
 +
-+          // replace our old id with new one as we already renamed the page but
-+          // there might be backlinks (links to self in this case).
-+          $opts['id'] = cleanID($opts['ns'].':'.$opts['name']);
-+          $selfmod = isset($backlinks[$opts['id']]);
-+          if ($selfmod) {
++            // redirect to page display
++            Header("Location: ".wl($opts['new_id']));
++            exit;
+         }
+         else {
+             $this->errors[] = $this->lang['pm_fatal'];
+@@ -618,14 +618,28 @@
+         	saveWikiText($ID, '', $this->lang['pm_delete'] );
+         }
+ 
++        // replace our old id with new one as we already renamed the page but
++        // there might be backlinks (links to self in this case).
++        $opts['id'] = cleanID($opts['ns'].':'.$opts['name']);
++        $selfmod = isset($backlinks[$opts['id']]);
++        if ($selfmod) {
 +            $backlinks[$opts['new_id']] = $backlinks[$opts['id']];
 +            unset($backlinks[$opts['id']]);
-+          }
-           
-           //Loop through backlinks
-           foreach($backlinks as $backlink => $links){
--            $this->_pm_updatebacklinks($backlink, $links, $opts, $brackets);
-+            $this->_pm_updatebacklinks($backlink, $links, $opts);
-           }
-           
-           //Move the old revisions
-           $this->_pm_movemeta('olddir', '/^'.$opts['name'].'\.[0-9]{10}\.txt(\.gz)?$/', $opts);
++        }
++
+         // Loop through backlinks
+         foreach($backlinksById as $backlinkingId => $backlinks) {
+-            $this->_pm_updatebacklinks($backlinkingId, $backlinks, $opts, $brackets);
++            $this->_pm_updatebacklinks($backlinkingId, $backlinks, $opts);
+         }
+ 
+         // Move the old revisions
+         $this->_pm_movemeta('olddir', '/^'.$opts['name'].'\.[0-9]{10}\.txt(\.gz)?$/', $opts);
  
-+          // remove cache. again if we ourselves were modified (due backlinks)
-+          if ($selfmod) {
++        // remove cache. again if we ourselves were modified (due backlinks)
++        if ($selfmod) {
 +            $cache = new cache_instructions($opts['new_id'], wikiFN($opts['new_id']));
 +            $cache->removeCache();
-+          }
-+
-           //Set things up to display the new page.
-           io_saveFile($conf['cachedir'].'/purgefile',time());
--          $ID = $opts['new_id'];
--          $ACT = 'show';
--          $INFO = pageinfo();
--          $this->show_form = false;
-+
-+          // redirect to page display
-+          Header("Location: ".wl($opts['new_id']));
-+          exit;
-         }
-       }
++        }
      }
-@@ -352,7 +364,7 @@
+ 
+ 
+@@ -637,7 +637,7 @@
       *
       * @author  Gary Owen <gary at isection.co.uk>
       */
--    function _pm_updatebacklinks($id, $links, $opts, &$brackets)
-+    function _pm_updatebacklinks($id, $links, $opts)
-     {
-       global $ID;
- 
-@@ -398,8 +410,8 @@
-       //Make the changes
-       $this->_pm_updatelinks($text, $oid);
- 
--      //Save backlink and release lock
--      saveWikiText($id, $text, sprintf($this->lang['pm_linkchange'], $ID, $opts['new_id']));
-+      //Save backlink and release lock. call the edit minor to avoid mail flood on marge backlinks changes
-+      saveWikiText($id, $text, sprintf($this->lang['pm_linkchange'], $ID, $opts['new_id']), 1);
-       unlock($id);
+-    function _pm_updatebacklinks($backlinkingId, $links, $opts, &$brackets) {
++    function _pm_updatebacklinks($backlinkingId, $links, $opts) {
+         global $ID;
+ 
+         // Get namespace of document we are editing
+@@ -730,8 +730,8 @@
+         // Make the changes
+         $this->_pm_updatelinks($text, $oid);
+ 
+-        // Save backlink and release lock
+-        saveWikiText($backlinkingId, $text, sprintf($this->lang['pm_linkchange'], $ID, $opts['new_id']));
++        // Save backlink and release lock. call the edit minor to avoid mail flood on marge backlinks changes
++        saveWikiText($backlinkingId, $text, sprintf($this->lang['pm_linkchange'], $ID, $opts['new_id']), 1);
+         unlock($backlinkingId);
      }
  

================================================================
Index: packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove.spec
diff -u packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove.spec:1.10 packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove.spec:1.11
--- packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove.spec:1.10	Thu May 13 17:30:57 2010
+++ packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove.spec	Tue Jun 12 22:58:04 2012
@@ -3,15 +3,15 @@
 Summary:	DokuWiki PageMove plugin
 Summary(pl.UTF-8):	Wtyczka PageMove dla DokuWiki
 Name:		dokuwiki-plugin-%{plugin}
-Version:	0.10.0
+Version:	20110811
 Release:	1
 License:	GPL v2
 Group:		Applications/WWW
-Source0:	http://acodeas.de/plugins/Version%{version}-pagemove_20100218.zip
-# Source0-md5:	48d2d8dde2794a9a5af5344623d608e8
+Source0:	http://github.com/desolat/DokuWiki-Pagemove-Plugin/tarball/master/%{plugin}-%{version}.tgz
+# Source0-md5:	eff88e845739a9052ac9620d8d2a5056
 Patch0:		%{name}-redirectlinks.patch
 Patch1:		%{name}-selflinks.patch
-URL:		http://www.isection.co.uk/doku.php
+URL:		http://www.dokuwiki.org/plugin:pagemove
 BuildRequires:	sed >= 4.0
 BuildRequires:	unzip
 Requires:	dokuwiki >= 20060309
@@ -43,9 +43,10 @@
 - wykonać połączenie powyższych.
 
 %prep
-%setup -q -n %{plugin}
-# undos the source
-%{__sed} -i -e 's,\r$,,' admin.php
+%setup -qc
+mv *-DokuWiki-Pagemove-Plugin-*/* .
+rm -f *-DokuWiki-Pagemove-Plugin-*/.git*
+%undos -f php
 
 %patch0 -p1
 %patch1 -p1
@@ -61,19 +62,18 @@
 install -d $RPM_BUILD_ROOT%{plugindir}
 cp -a . $RPM_BUILD_ROOT%{plugindir}
 
+%{__rm} $RPM_BUILD_ROOT%{plugindir}/README
+%{__rm} -r $RPM_BUILD_ROOT%{plugindir}/_test
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-# force css cache refresh
-if [ -f %{dokuconf}/local.php ]; then
-	touch %{dokuconf}/local.php
-fi
-
 %files
 %defattr(644,root,root,755)
+%doc README
 %dir %{plugindir}
-%{plugindir}/admin.php
+%{plugindir}/*.php
+%{plugindir}/*.txt
 %dir %{plugindir}/lang
 %{plugindir}/lang/en
 %lang(cs) %{plugindir}/lang/cs
@@ -93,6 +93,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.11  2012/06/12 20:58:04  glen
+- update to 20110811
+
 Revision 1.10  2010/05/13 15:30:57  sparky
 - BR: unzip
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-redirectlinks.patch?r1=1.2&r2=1.3
    http://cvs.pld-linux.org/packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove-selflinks.patch?r1=1.2&r2=1.3
    http://cvs.pld-linux.org/packages/dokuwiki-plugin-pagemove/dokuwiki-plugin-pagemove.spec?r1=1.10&r2=1.11



More information about the pld-cvs-commit mailing list