Re: [aur-dev] [PATCH 1/1] fix for FS#15947

2009-09-28 Thread elij
On Mon, Sep 28, 2009 at 12:59 PM, Loui Chang louipc@gmail.com wrote:
 On Sun 27 Sep 2009 20:59 -0700, elij wrote:
 Fix for maintainer search ticket: FS#15947
 Also 
 http://mailman.archlinux.org/pipermail/aur-dev/2009-September/000892.html
 ---
  web/lib/aurjson.class.php |   41 ++---
  1 files changed, 34 insertions(+), 7 deletions(-)


 diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
 index 5b9ecd1..3af41be 100644
 --- a/web/lib/aurjson.class.php
 +++ b/web/lib/aurjson.class.php
 @@ -95,10 +95,9 @@ class AurJSON {
          $keyword_string = mysql_real_escape_string($keyword_string, 
 $this-dbh);

          $query = SELECT  . implode(',', $this-fields) .
 -             FROM Packages WHERE DummyPkg=0 AND ;
 -        $query .= sprintf(( Name LIKE '%%%s%%' OR Description LIKE 
 '%%%s%%' ),
 -                $keyword_string, $keyword_string);
 -
 +             FROM Packages, Users WHERE DummyPkg=0 AND  .

 This line breaks the basic search function since ID from $fields is not
 unique. Why are you selecting from the Users table anyways?

 +              ( Name LIKE '%{$keyword_string}%' OR  .
 +                Description LIKE '%{$keyword_string}%' );
          $result = db_query($query, $this-dbh);

          if ( $result  (mysql_num_rows($result)  0) ) {
 @@ -158,5 +157,33 @@ class AurJSON {
              return $this-json_error('No result found');
          }
      }
 +
 +    /**
 +     * Returns all the packages for a specific maintainer.
 +     * @param $maintainer The name of the maintainer.
 +     * @return mixed Returns an array of value data containing the package 
 data
 +     **/
 +    private function msearch($maintainer) {
 +        $maintainer = mysql_real_escape_string($maintainer, $this-dbh);
 +        $fields = implode(',', $this-fields);
 +
 +        $query = SELECT Users.Usermain as Maintainer, {$fields}  .
 +             FROM Packages, Users  .
 +                    WHERE Packages.MaintainerUID = Users.UID AND  .
 +                          Users.Username = '{$maintainer}';

 Users.Usermain isn't a field in the database, neither is Users.UID.
 There's also the problem of ID from $fields not being unique.

 I've fixed all these and pushed the modified patch.

 Please test your patches!
 Thanks



I didn't have a machine to test it on at the time.
*shrug*


Re: [aur-dev] some patches for cleanup and other stuff

2009-09-28 Thread Loui Chang
On Sun 27 Sep 2009 16:40 -0700, elij wrote:
 In response to a forum thread about stagnating aur development, 
 I worked on the aur a bit when I was bored today.
 
 The first patch is probably the most invasive, and I must admit that
 I haven't tested it (offline -- not dev sandbox). I think the spirit of
 this patch, if not the implementation of it, is needed.
 
 The rss2 - rss rename would require a simple apache rewrite rule
 should it go to production. I made notes on the patch itself for my
 reasoning as to the rename.
 
 The rest are misc patches and smaller cleanup elements. Feel free
 to use some, none, or all of them.

I pushed most of these, in a different order. Hah.
Thanks for the contribution.


[aur-dev] [PATCH] Add usage output info for maintainer search extension

2009-09-28 Thread djszapi2
From: Laszlo Papp djsza...@gmail.com

Add msearch type to the list on http://aur.archlinux.org/rpc.php

Signed-off-by: Laszlo Papp djsz...@archlinux.us
---
 web/html/rpc.php |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/web/html/rpc.php b/web/html/rpc.php
index 399c9ad..240cad1 100644
--- a/web/html/rpc.php
+++ b/web/html/rpc.php
@@ -11,13 +11,14 @@ if ( $_SERVER['REQUEST_METHOD'] == 'GET' ) {
 }
 else {
 // dump a simple usage output for people to use.
-// this could be moved to an api doc in the future, or generated from 
+// this could be moved to an api doc in the future, or generated from
 // the AurJSON class directly with phpdoc. For now though, just 
putting it here.
 echo 'htmlbody';
 echo 'The methods currently allowed are: br /';
 echo 'ul';
 echo 'lisearch/li';
 echo 'liinfo/li';
+echo 'limsearch/li';
 echo '/ulbr /';
 echo 'Each method requires the following HTTP GET syntax:br /';
 echo 'nbsp;nbsp; type=imethodname/iarg=idata/i br /br 
/';
-- 
1.6.4.4



Re: [aur-dev] [PATCH] Add usage output info for maintainer search extension

2009-09-28 Thread Loui Chang
On Tue 29 Sep 2009 00:50 +0200, djsza...@gmail.com wrote:
 From: Laszlo Papp djsza...@gmail.com
 
 Add msearch type to the list on http://aur.archlinux.org/rpc.php
 
 Signed-off-by: Laszlo Papp djsz...@archlinux.us

Thanks. Pushed.


Re: [aur-dev] [PATCH] Serbian translation for AUR

2009-09-28 Thread Loui Chang
On Tue 29 Sep 2009 01:25 +0200, Terzić Slobodan wrote:
 Hello,
 
 I've made Serbian translation for AUR, you can find patch in attached archive.
 Please merge.
 
 Also, it seems I've found a bug in translation_tool script, as it doesn't 
 extract all messages.
 During a local test I saw that other translations have a lot more translatabe 
 messages than translation_tool gave me, so I had to compare sr.po to other 
 translation files and add missing strings manually.
 Dunno what happened, maybe it was me doing something wrong. :/

Not your fault. There is indeed a bug in the translation_tool.
Thanks for the translation.



Re: [aur-dev] [PATCH 1/1] fix for FS#15947

2009-09-28 Thread Laszlo Papp
On Mon, Sep 28, 2009 at 10:12 PM, elij elij...@gmail.com wrote:

 On Mon, Sep 28, 2009 at 12:59 PM, Loui Chang louipc@gmail.com wrote:
  On Sun 27 Sep 2009 20:59 -0700, elij wrote:
  Fix for maintainer search ticket: FS#15947
  Also
 http://mailman.archlinux.org/pipermail/aur-dev/2009-September/000892.html
  ---
   web/lib/aurjson.class.php |   41
 ++---
   1 files changed, 34 insertions(+), 7 deletions(-)
 
 
  diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
  index 5b9ecd1..3af41be 100644
  --- a/web/lib/aurjson.class.php
  +++ b/web/lib/aurjson.class.php
  @@ -95,10 +95,9 @@ class AurJSON {
   $keyword_string = mysql_real_escape_string($keyword_string,
 $this-dbh);
 
   $query = SELECT  . implode(',', $this-fields) .
  - FROM Packages WHERE DummyPkg=0 AND ;
  -$query .= sprintf(( Name LIKE '%%%s%%' OR Description LIKE
 '%%%s%%' ),
  -$keyword_string, $keyword_string);
  -
  + FROM Packages, Users WHERE DummyPkg=0 AND  .
 
  This line breaks the basic search function since ID from $fields is not
  unique. Why are you selecting from the Users table anyways?
 
  +  ( Name LIKE '%{$keyword_string}%' OR  .
  +Description LIKE '%{$keyword_string}%' );
   $result = db_query($query, $this-dbh);
 
   if ( $result  (mysql_num_rows($result)  0) ) {
  @@ -158,5 +157,33 @@ class AurJSON {
   return $this-json_error('No result found');
   }
   }
  +
  +/**
  + * Returns all the packages for a specific maintainer.
  + * @param $maintainer The name of the maintainer.
  + * @return mixed Returns an array of value data containing the
 package data
  + **/
  +private function msearch($maintainer) {
  +$maintainer = mysql_real_escape_string($maintainer,
 $this-dbh);
  +$fields = implode(',', $this-fields);
  +
  +$query = SELECT Users.Usermain as Maintainer, {$fields}  .
  + FROM Packages, Users  .
  +WHERE Packages.MaintainerUID = Users.UID AND  .
  +  Users.Username = '{$maintainer}';
 
  Users.Usermain isn't a field in the database, neither is Users.UID.
  There's also the problem of ID from $fields not being unique.
 
  I've fixed all these and pushed the modified patch.
 
  Please test your patches!
  Thanks
 
 

 I didn't have a machine to test it on at the time.
 *shrug*


Hello Eliot!

The patch you did for the maintainer searching, it gives back the packages
in arrays chich contain the 'Maintainer' element which isn't contained in a
normal search.
Could this 'Maintainer element be in the normal searching too ? Just for the
unity, for example when parsing it would be better.

Best Regards,
Laszlo Papp


[aur-dev] [PATCH] Add Maintainer element in search/info object

2009-09-28 Thread djszapi2
From: Laszlo Papp djsz...@archlinux.us

Add 'Maintainer' element into search/info type object handling
too for the unity, it will be handled so not just in msearch
case separately.

Signed-off-by: Laszlo Papp djsz...@archlinux.us
---
 web/lib/aurjson.class.php |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index 5794ebc..f8f011b 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -94,9 +94,8 @@ class AurJSON {
 }

 $keyword_string = mysql_real_escape_string($keyword_string, 
$this-dbh);
-
-$query = SELECT  . implode(',', $this-fields) .
- FROM Packages WHERE DummyPkg=0 AND  .
+$base_query = SELECT Users.Username as Maintainer,  . 
implode(',',$this-fields) .
+ FROM Packages, Users WHERE Users.ID=Packages.MaintainerUID AND 
DummyPkg=0 AND  .
   ( Name LIKE '%{$keyword_string}%' OR  .
 Description LIKE '%{$keyword_string}%' );
 $result = db_query($query, $this-dbh);
@@ -121,8 +120,8 @@ class AurJSON {
  * @return mixed Returns an array of value data containing the package data
  **/
 private function info($pqdata) {
-$base_query = SELECT  . implode(',', $this-fields) .
- FROM Packages WHERE DummyPkg=0 AND ;
+$base_query = SELECT Users.Username as Maintainer,  . 
implode(',',$this-fields) .
+ FROM Packages, Users WHERE Users.ID=Packages.MaintainerUID AND 
DummyPkg=0 AND ;

 if ( is_numeric($pqdata) ) {
 // just using sprintf to coerce the pqd to an int
--
1.6.4.4