[UBUNTU] Implement on-the-fly rewriting of maintainer fields
Implement the same rules as pkgbinarymangler for rewriting
maintainer fields. This will fix the maintainer field of
source packages that were taken without changes from Debian
and contain therefor still the original maintainer information.
This should significantly reduce the number of Debian maintainers
that are listed on packages.ubuntu.com as Maintainers.
Thanks again to Colin Watson <cjwatson -at- ubuntu com> for the
suggestion.
[UBUNTU] Improve handling of maintainer fields, support original-maintainer
Handle and display Original-Maintainer field contents. Also treat
Uploaders as being related to Original-Maintainer if that exists
since AFAICT Ubuntu doesn't use this field.
Don't show the email addresses for Original-Maintainer, since they are
usually not needed anyway.
Add some helpful suggestions below maintainer email addresses to file
bugs or questions in launchpad instead. Usually this should give a
better response.
With thanks to Colin Watson <cjwatson -at- ubuntu com> for nagging
and suggestions.
The uri filter in TT 2.14 (i.e. the version in Debian etch) is broken
(or at least unusable). So always use URI::Escape::uri_escape instead.
Escaping the Homepage: field makes no sense since there is no reliable
way to decide what needs to be quoted. The URIs need to be correclty
quoted in the original field already. Use HTML quoting though.
[UBUNTU] Packages::DoSearchContents: Don't die when no information is available
Issue a real error message if no contents database is available for the suite
in question.
This isn't exposed on the Debian site since we actually have _some_ contents
for every suite (experimental has contents for debian-ports.org). But on
the Ubuntu site we have no information at all for *-backports and *-updates.
(cherry picked from commit 3eda9fe5cb2a6fe0fc67493c2147d8a3ff2d904d)
[UBUNTU] Packages::DoSearchContents: Don't die when no information is available
Issue a real error message if no contents database is available for the suite
in question.
This isn't exposed on the Debian site since we actually have _some_ contents
for every suite (experimental has contents for debian-ports.org). But on
the Ubuntu site we have no information at all for *-backports and *-updates.
Packages::Config: Add en to DDTP_LANGUAGES as well
Previously when we used DDTP_LANGUAGES and LANGUAGES together
this didn't cause any problems, but now that we evaluate them
separatly, this causes other languages to be preferred over
English, even though the user assigned a lower quality to them.
create_index_pages: Open less files simultaniously
The Ubuntu version ran out of allowed open filehandles.
Don't open the files for source and binary packages
simultaniously since that is not needed and thereby
reduce the number by 50%.
I've now moved packages.debian.net to a different (virtual)
server, since using the same apache for both sites causes
"interesting" effects. Enable mod_perl again.
The old version was very hard on all of CPU, memory,
and I/O. The new version tries to at least lessen the
burden on memory (and to a lesser extend on CPU), in the
hopes that this will indirectly (by lesser swapping) also
reduce the stress on I/O.
In the old version we first collected all the information
about all packages and then wrote the index files one after
one with TT.
The newer version tries to write all of the index files while
collecting the package information, therefor eliminating the
need to store any information longer than needed. Because the
amount of files we can open simulaniously is limited though,
we can't write all the index files at once. Instead we write
one index files for all languages, and in a second step then
use these files to write one file per language. I tried to
use the "slice" program for that, but it also computes all
the results in memory, while I wanted to have a concurrent
approach here as well.
Since we only use a very limited subset of the features of slice
I wrote a simple replacement that supports the bare minimum of
what we need with the price that we need to be a bit careful
about the format of the slice source files.
I also don't use TT for the package entries anymore since here
as well we only used a very limited set of features and I wanted
to make this script as fast as possible (without having to rewrite
it in C ;). The header and footer still use TT since this part isn't
speed critical and we can reuse the templates we have for the dynamic
pages.
Add the redirect code that maps packages.ubuntu.net
and packages.ubuntulinux.org to packages.ubuntu.com.
Comment it out since otherwise I get problems with
testing the new code on the same server as the old
one.
Separate handling of po translations and DDTP translations
This way we don't need to immediatly fall back to English
if people have more than one preferred language for which
only part of the page content is available.
If e.g. they would have "ca;q=0.9, de;q=0.5, en;q=0.1" in
their Accept-Language header (insert any DDTP-only language
for ca and any PO-available language for de), we can show the
description in Catalan if available, and the po contents in
German.
The code will usually try to fall back to $po_lang if a
description is not available in $ddtp_lang.
Not implemented (yet) is a DDTP language negotiation _after_
we actually know which DDTP translations are available.
The 'lang' query parameter overrides both values and has
only the fallback English (But you shouldn't use it
anyway ;).