summaryrefslogtreecommitdiffstats
path: root/packages
AgeCommit message (Collapse)AuthorFilesLines
2012-08-04Include description in Depend unicode() outputDan McGee1-0/+7
This overrides the base class __unicode__ method. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-04Remove optional package depends columnDan McGee2-1/+211
This is now completely replaced by the deptype column. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-04Make adjustments for optional -> deptype conversionDan McGee1-0/+210
Very little dealt directly with this field. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Add new deptype column to package dependsDan McGee2-0/+221
This is more flexible than our existing 'optional' boolean and will allow us to import check and make depends into the database as well as what we are already doing. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Use a raw ID field for package Update packageDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Declare 'enums' at class scopeDan McGee1-7/+6
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Revert "Fall back to 410 Gone for package files view as well"release_2012-07-31Dan McGee1-10/+2
This reverts commit 9ab460c53a1ac4c79da6f05f2850ee21beedbab2. This seemed like the right thing to do, but it doesn't really play well with our more general dispatch framework we now do on the package details pages. Just let it 404 like it always did, as these pages are less essential. We can perhaps add a full dispatcher later if we really feel the need.
2012-07-31Reuse removed template for packages with multiple replacementsDan McGee1-4/+20
For example, bitcoin-git in the Arch repos is currently marked replaced by both bitcoin-qt and bitcoin-daemon. This allows us to show a page with both options listed instead of a blank 404 page. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Add package details redirect for package replacementsDan McGee1-1/+13
This makes sense if there is only one available replacement. We could get more sophisticated and show the removed page if there are multiple replacements available. Additionally, automatically redirect if there was only one matching package for a given package update deletion object. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Rework package details dispatch codeDan McGee1-37/+45
We had a variety of fallback paths that we took if a details page didn't exist for the combination of URL parts passed in. Before I go adding a few more possibilities, rework this so it is more flexible. It is now as simple as adding a method to the dispatch options list in order to have further fallback options. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Fix broken hidden input sort field on search formDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-24Replace deprecated list_detail usage in search with class-based viewDan McGee3-42/+45
We can convert the entire search view to a generic class-based ListView. This is still one of the more disgusting views in the application and has a ton of logic scattered buckshot across several methods, but this commit is not meant to address all of that in one go. This is the last of the deprecated pieces I know of we are still using in the codebase, so we should be relatively safe in the long run now for an upgrade to the eventual next major Django release. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-24Replace deprecated direct_to_template() with render() shortcutDan McGee4-24/+17
Now that Django actually provides a concise way to use a RequestContext object without instantiating it, we can use that rather than the old function-based generic view that worked well to do the same. Additionally, these function-based generic views will be gone in Django 1.5, so might as well make the move now. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-24Remove custom utc_now() function, use django.utils.timezone.now()Dan McGee3-10/+10
This was around from the time when we handled timezones sanely and Django did not; now that we are on 1.4 we no longer need our own code to handle this. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-24Add index on package updates pkgname fieldDan McGee2-1/+209
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-23Fall back to 410 Gone for package files view as wellDan McGee1-2/+10
This is another thing that Google and other search engines try to crawl that no longer exists at times, so we should handle it gracefully. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-23Ensure package files JS can support corner casesDan McGee1-0/+6
We should handle the cases dealing with no filelist available, outdated filelist, or a package without files, just as the HTML server-side page does. Add a bit more info to the JSON returned so we can do so. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-23Remove files list AJAX conditionalsDan McGee1-4/+0
Now that we just generate this list in JS, we don't need this separate code. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-23Add '410 Gone' support for packages moved out of repositoriesDan McGee2-5/+44
This allows us to do better than a generic 404 handler when we know a package previously existed in a given repository, and should also make things a bit nicer when getting sent in from a search engine to a page that no longer exists. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-21Split details/display package views into new moduleDan McGee2-147/+167
This moves a lot of the package and group display logic into a new view module, similar to what we already did earlier with a bunch of other views. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-08Get multilib package differences query working on sqlite3Dan McGee1-9/+22
Thank you database engines for all implementing such simple operations as substring() and length() in different ways. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-08Don't log package updates in Python when we have DB trigger supportDan McGee1-2/+13
This adds a helper method to find the database engine in use, and then skips code we shouldn't execute if we are doing this another way. Note that this helper method could be useful for backend-specific code paths elsewhere, such as custom SQL being called or lack of StdDev() in sqlite3 out of the box. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-08Add triggers for adding package update rowsDan McGee2-0/+75
This will be done instead of doing this logic at the application level, which has some subtle race conditions. When two simultaneous threads attempt to delete the same package, two update rows for the delete action are inserted. When done at the database level, we can ensure a one-to-one mapping between row operations and entries in this table. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-08Use a set instead of list when gathering package IDs to fetchDan McGee1-1/+1
If we have duplicates in this list, it makes no sense to include them in the list we send to the database. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-01Add indexes on 'created' field to several package-related modelsDan McGee2-3/+217
These models regularly sort by or limit by the created field, so adding a index on the created database column makes sense. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-01Log package updates during reporead invocationDan McGee1-0/+36
This adds a Manager and log_update method to help log all updates made to the packages table during reporead runs. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-01Add new package Update modelDan McGee3-2/+302
This will be used to track updates to package as we do them during reporead. By storing enough relevant fields from the package object, we should be able to produce a useful report on a regular basis of what has been happening in the repositories. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-01Remove no-longer necessary delayed imports of PackageDan McGee1-10/+7
Since commit 158be107e4ad6, we have been importing the Package model at the top-level in this file, so we can kill this code that was never updated. This should also give us back any performance hit we were seeing from the delayed imports. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18Drop old PackageDepend modelDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18Switch to usage of new Depend objectDan McGee2-7/+33
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18Migrate package depends data into new modelDan McGee1-0/+246
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18Add new depends modelDan McGee2-0/+206
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18Issue redirects from non-agnostic to agnostic URLs if unambiguousDan McGee1-0/+10
For something like "/extra/i686/apache-ant/", we can redirect to "/extra/any/apache-ant/" without ambiguity. Previously this redirected to the split packages listing with a single package, which was neither correct nor really expected. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18Add a get_best_satisfier method to RelatedToBaseDan McGee1-1/+35
This is basically what we do in PackageDepend already. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-18Refactor an abstract base class out of conflicts/provides/replacesDan McGee1-24/+17
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-12Use python json module directly in place of simplejsonDan McGee3-13/+9
As of Python 2.6, this is a builtin module that has all the same functions and capabilities of the Django simplejson module. Additionally simplejson is deprecated in the upcoming Django 1.5 release. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-05Fix suggestion caching again for non-ASCII charactersrelease_2012-05-05Dan McGee1-1/+2
This is why you should test this stuff with random input before rolling it out. Whoops. URL that caught this problem: /opensearch/packages/suggest?q=%D7%A0%D7%9F%D7%92%D7%9F aka /opensearch/packages/suggest?q=נןגן Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-04Fix search suggestions for invalid cache keysDan McGee1-2/+3
Unfortunately, "invalid" in this case includes spaces, which is a bit crazy. MD5 the provided search term before using it as a cache key to be safe. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02Flagging related cleanups and improvementsrelease_2012-05-02Dan McGee1-10/+24
Touch up the style slightly on the flag help popup to match the main site style more closely. When a logged-in user is flagging a package out of date, we have no need for them to fill in the email field since we already have an email address on file. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-02Ensure order_by default value is cleared when using distinct()Dan McGee1-1/+2
Otherwise the queryset returns nonsensical results. I find the design of this less than obvious but so be it; we can ensure the results work regardless of a default ordering on the model. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-01Add some caching to the Opensearch-related viewsDan McGee1-5/+13
Both some simple cache headers as well as low-level results caching on search terms suggestions. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-05-01Opensearch enhancementsDan McGee1-1/+17
* Add a 64x64 icon as indicated in the Opensearch specification. * Add suggestions capability and a new view providing suggestions based on package name starting with the typed value. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-27Use GenericIPAddressField in flag request ip_addressDan McGee2-1/+184
New (and slightly odd with regards to verbose_name) in Django 1.4. This simply ensures a deployment in an IPv6 environment actually works as expected. If you were using PostgreSQL as a database backend, you won't be affected by this as the 'inet' type was already used, but at least now you can edit the values in the admin without getting an error. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07Add JSON search viewrelease_2012-04-07Dan McGee3-1/+28
This still might change and should not be viewed as a public API yet. This has been a longstanding request in FS#13026. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07Move PackageJSONEncoder into package.utils moduleDan McGee2-37/+39
This will allow it to be used elsewhere, and doesn't really belong in views anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-07Choose an up-to-date mirror for download URLsDan McGee1-9/+4
Given that we collect a lot of mirror status data, we can utilize it to ensure the download link on the website actually works and newly-added packages have actually been mirrored out. Add a method that attempts to use the mirror status data to determine a mirror we should redirect our download requests to. This can change on a regular basis, and falls back to the old method if no mirror status data is available. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-03Use https:// links for all internal sitesDan McGee1-1/+1
We already use HTTPS exclusively for wiki, bugs, forums, etc. and we have it available for our other sites, so link only to the https:// protocol locations when pointing users at other sites. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-03Include category when linking to bug reportsDan McGee1-0/+1
Also change the default category to something legit. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-02Make hidden 'name' search field match exactlyDan McGee1-1/+1
This is much more useful than the old contains match if you are trying to narrow down your search to a specific package. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-29Return files in default orderDan McGee1-2/+4
When we read the repository databases, we get a filelist in sorted order. Save time by returning the file list in that order rather than resorting it based on filename and directory. Signed-off-by: Dan McGee <dan@archlinux.org>