]> git.pld-linux.org Git - packages/dokuwiki-plugin-data.git/commitdiff
- add separate-rpmdb.patch
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 1 Dec 2010 18:21:09 +0000 (18:21 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dokuwiki-plugin-data.spec -> 1.20
    separate-rpmdb.patch -> 1.1

dokuwiki-plugin-data.spec
separate-rpmdb.patch [new file with mode: 0644]

index 91bdf63cf6e94a3782cbfd1ddc794192cdb589f1..990a8426d5374af0d9b8c610a17e3d0e61dec8e7 100644 (file)
@@ -4,7 +4,7 @@
 Summary:       DokuWiki Structured Data Plugin
 Name:          dokuwiki-plugin-%{plugin}
 Version:       20100608
-Release:       1
+Release:       3
 License:       GPL v2
 Group:         Applications/WWW
 Source0:       http://github.com/splitbrain/dokuwiki-plugin-%{plugin}/zipball/master#/%{plugin}-%{version}.zip
@@ -13,6 +13,7 @@ URL:          http://wiki.splitbrain.org/plugin:data
 Patch0:                interwiki.patch
 Patch1:                helper-map.patch
 Patch2:                separator-style.patch
+Patch3:                separate-rpmdb.patch
 BuildRequires: rpmbuild(macros) >= 1.520
 BuildRequires: unzip
 Requires:      php-common >= 4:%{php_min_version}
@@ -51,6 +52,7 @@ mv *-%{plugin}-*/* .
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 version=$(awk '/date/{print $2}' plugin.info.txt)
 if [ $(echo "$version" | tr -d -) != %{version} ]; then
diff --git a/separate-rpmdb.patch b/separate-rpmdb.patch
new file mode 100644 (file)
index 0000000..28c66d4
--- /dev/null
@@ -0,0 +1,50 @@
+Separate rpmdb data to rpmdb table, left join via %rpm% field name on demand.
+
+As the rpmdb data is huge comparing to other data, it's best we keep it
+in separate table, if it is still a performance problem, we could use
+separate datafile.
+
+--- dokuwiki-plugin-data-20100608/db/latest.version    2010-11-03 15:20:30.000000000 +0200
++++ dokuwiki-plugin-data-20100608/db/latest.version    2010-12-01 19:50:59.214345000 +0200
+@@ -1 +1 @@
+-4
++5
+--- dokuwiki-plugin-data-20100608/helper.php   2010-12-01 19:51:15.127904142 +0200
++++ dokuwiki-plugin-data-20100608/helper.php   2010-12-01 19:50:59.217678000 +0200
+@@ -182,7 +182,9 @@
+         // fix title for special columns
+         static $specials = array('%title%'  => array('page', 'title'),
+                                  '%pageid%' => array('title', 'page'),
+-                                 '%class%'  => array('class'));
++                                 '%class%'  => array('class'),
++                                 '%rpm%'    => array('rpm'),
++                                );
+         if (isset($specials[$column['title']])) {
+             $s = $specials[$column['title']];
+             $column['title'] = $this->getLang($s[0]);
+--- dokuwiki-plugin-data-20100608/lang/en/lang.php     2010-11-03 15:20:30.000000000 +0200
++++ dokuwiki-plugin-data-20100608/lang/en/lang.php     2010-12-01 19:50:59.217678000 +0200
+@@ -16,6 +16,7 @@
+ $lang['page']      = 'Page';
+ $lang['title']     = 'Page Name';
+ $lang['class']     = 'Page Class';
++$lang['rpm']       = 'RPM Package';
+ $lang['name']      = 'Type Alias';
+ $lang['type']      = 'Original Type';
+--- dokuwiki-plugin-data-20100608/syntax/table.php     2010-11-03 15:20:30.000000000 +0200
++++ dokuwiki-plugin-data-20100608/syntax/table.php     2010-12-01 19:50:59.217678000 +0200
+@@ -328,6 +328,13 @@
+                 $select[] = '" " || pages.class';
+             }elseif($key == '%title%'){
+                 $select[] = "pages.page || '|' || pages.title";
++            }elseif($key == '%rpm%'){
++                if(!isset($tables[$key])){
++                    $tables[$key] = 'T'.(++$cnt);
++                    $from  .= ' LEFT JOIN rpmdb AS '.$tables[$key].' ON '.$tables[$key].'.pid = pages.pid';
++                }
++                $select[] = "group_concat(".$tables[$key].".value,'\n')";
++
+             }else{
+                 if(!isset($tables[$key])){
+                     $tables[$key] = 'T'.(++$cnt);
This page took 0.188006 seconds and 4 git commands to generate.