Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 208376 - Missing "Search" Capability on Packages Webpage
Summary: Missing "Search" Capability on Packages Webpage
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Infrastructure
Classification: Unclassified
Component: [OLD] gpackages (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Packages Website
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-01 02:04 UTC by Pamela Fong
Modified: 2010-03-08 03:41 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
This is a patch that adds a search feature to the package.g.o website (git.diff,11.16 KB, patch)
2008-08-12 17:07 UTC, manuels
Details | Diff
Adds a search box that will redirect to a site:p.g.o google search (0003-Add-a-search-box-that-will-redirect-to-a-p.g.o-o.patch.txt,2.13 KB, patch)
2010-03-07 02:21 UTC, John Klehm
Details | Diff
Manuel Schoelling's form based google site search box (0001-Manuel-Schoelling-s-form-based-google-site-searc.patch.txt,1.06 KB, patch)
2010-03-07 15:40 UTC, John Klehm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pamela Fong 2008-02-01 02:04:25 UTC
The webpage,

http://packages.gentoo.org/

doesn't have a "Search" function for locating an individual package.  Is this expected?  This is the first time in over a year, that I've visited this page, but I remember it used to have that capability.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-02-01 03:01:29 UTC
It's a totally new codebase, this was discussed previously.
Use google to search it for now: "site:packages.gentoo.org FOO", this is done via OpenSearch as well.
Comment 2 Shawn Rutledge 2008-07-31 20:03:15 UTC
This is not a satisfying answer.  How hard is it to put a search field right on the web page?  The search engine can still be Google if you think that's best.
Comment 3 manuels 2008-08-12 17:07:12 UTC
Created attachment 162768 [details, diff]
This is a patch that adds a search feature to the package.g.o website

Features:
- searches changelog, description and package name
- also support for atomic search style (like "sys-apps/portage" or "=>sys-apps/portage-1.0")

BUT: the two tables must be altered like this:
alter table metadata add fulltext (changelog, description);
alter table packages add fulltext (pn);
Comment 4 manuels 2008-08-12 17:12:38 UTC
(In reply to comment #3)
> - also support for atomic search style (like "sys-apps/portage" or
> "=>sys-apps/portage-1.0")

Sorry, the last line must be:
">=sys-apps/portage-1.0")

Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-08-12 19:02:06 UTC
1. Are you sure your version comparator code is right? It looks like you are just trying string comparisons on the pv column, which isn't how Portage does it. 
2. Please patch dbgenerator/database.py with your schema changes.
3, Some of the code I need to look at more closely to ensure it's not possible to perform SQL injection.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-08-12 19:17:24 UTC
"alter table metadata add fulltext (changelog, description);"
That's not valid postgres at all...
Comment 7 manuels 2008-08-15 19:40:31 UTC
(In reply to comment #5)
> 1. Are you sure your version comparator code is right? It looks like you are
> just trying string comparisons on the pv column, which isn't how Portage does
> it. 
Nope, you're right. I can "steal" this code from portage.

> 2. Please patch dbgenerator/database.py with your schema changes.
>"alter table metadata add fulltext (changelog, description);"
>That's not valid postgres at all...
That's mysql. 
Comment 8 manuels 2008-08-15 19:45:18 UTC
Sorry, my keyboard fucked up.

That's mysql. I glaced over and there doesn't exist a proper full text search syntax standard.

> 3, Some of the code I need to look at more closely to ensure it's not possible
> to perform SQL injection.
Do so and tell me if you find anything.
Comment 9 Christian Strahl 2008-08-26 17:51:45 UTC
Is it possible to add support for regular expressions to the searchfunction?
Comment 10 Andrey Kislyuk (RETIRED) gentoo-dev 2009-02-10 14:24:58 UTC
Can we add a Google search box on packages.g.o? As it stands it really sucks that it doesn't have a search capability (drives the site's utility way down) and most users won't know that the official policy is "use Google to search the site".
Comment 11 Pacho Ramos gentoo-dev 2009-02-10 18:04:04 UTC
Why not make http://packages.larrythecow.org/ -> packages.gentoo.org ? 
Comment 12 Shawn Rutledge 2009-09-26 20:02:58 UTC
Geez this is ridiculous.  Everyone agrees it's possible and it's still not done after a year and a half of waiting.
Comment 13 John Klehm 2010-03-07 02:21:13 UTC
Created attachment 222389 [details, diff]
Adds a search box that will redirect to a site:p.g.o google search

Why not something a lot simpler gents?

How bout a javascript based redirect to a google site:packages.gentoo.org style search?

Tested in IE8 and FF but should work fine just bout any browser.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-03-07 03:44:44 UTC
John: thanks for the nice start. I'm not sure that redirect you're generating is correct however. Can you ensure it's correctly URL-encoded?

Also, jQuery has some better handling of the element issue there, maybe nick a bit of that?
Comment 15 manuels 2010-03-07 12:11:03 UTC
Ok, if you want to use Google, please don't use javascript because Gentoo users are likely to use a non-js browser.

<form method="get" action="http://www.google.com/custom">
<input type="submit" name="sa" value="Search" />
<input type="text" name="q" size="20" maxlength="255" value="" />
<input type="hidden" name="sitesearch" value="packages.gentoo.org" />
</form>
Comment 16 John Klehm 2010-03-07 14:51:08 UTC
(In reply to comment #15)
> Ok, if you want to use Google, please don't use javascript because Gentoo users
> are likely to use a non-js browser.
> 
> <form method="get" action="http://www.google.com/custom">
> <input type="submit" name="sa" value="Search" />
> <input type="text" name="q" size="20" maxlength="255" value="" />
> <input type="hidden" name="sitesearch" value="packages.gentoo.org" />
> </form>
> 

Ooo even simpler, I like it. :)  You going to patchify that? I can if you don't want too but I woudln't want to steal credit.
Comment 17 John Klehm 2010-03-07 15:40:54 UTC
Created attachment 222497 [details, diff]
Manuel Schoelling's form based google site search box

Hopefully if we give Robin enough options he'll have to commit one of them just to get us to leave him alone. :)
Comment 18 manuels 2010-03-07 16:05:50 UTC
(In reply to comment #16)
> Ooo even simpler, I like it. :)  You going to patchify that? I can if you don't
> want too but I woudln't want to steal credit.
Sorry, I'm stuck in another project.
Thanks for patchifying.
Comment 19 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-03-08 03:41:53 UTC
Live now, thanks for the commits.