- Package:
- tracker.debian.org
- Source:
- tracker.debian.org
- Submitter:
- Vincent Legout
- Date:
- 2014-12-11 14:15:04 UTC
- Severity:
- wishlist
Hi, The tracker page of gravitywars displays both the short and long descriptions instead of the short description only: https://tracker.debian.org/pkg/gravitywars Thanks, Vincent
Control: tag -1 newcomer Where? I only see "gravitywars clone of Gravity Force" in the title. So the long description is currently missing compared to the old tracker (where it's displayed in a tooltip). Is that what you are reporting? Cheers,
Control: retitle -1 Add long description as a tooltip on top of the short description Control: severity -1 wishlist Weird, maybe it was a bug in the package, because the tracker never displayed the long description anywhere. But this is actually a desirable feature. At least Paul Wise requested it already. So I'm keeping the bug but repurposing it to add the long description back as a tooltip. Cheers,
Raphael Hertzog <hertzog@debian.org> writes: Yes, you're right, I now only see the short description in the title. But I reported this bug because if I'm not wrong, the long description was also written in the <h4> title at least yesterday and a few days ago when I first looked at this page. Pages for other packages didn't have this bug. I guess this bug can be closed, sorry for the noise. Thanks, Vincent
Here is a patchset implementing half of this feature, I have not yet figured out how to feed the long description in the tracker. Cheers, Christophe
Hi Christophe, Can you be more explicit at where you're stuck? A quick look led me to distro_tracker.core.utils.packages.extract_information_from_packages_entry() to fix to inject the long description too. That said I'm not sure how to retrieve the long description from the "stanza" variable. A dump of the variable will hopefully give you the answer ? (otherwise it might be documented in the python-apt doc?) A few comments on your patch. It looks mostly good though: This comment is not accurate. The fallback is to use the description of the "only" package if there's only one package. There's no notion of the first package any more. Since the mistake probably comes from copy/paste, you should fix the original comment too :-) Don't we need something to encode quotes to avoid broken HTML if the long description contains double quotes? Or is this already taken care of by Django? Cheers,
Hi Raphaël,
In core.retrieve_data.UpdateRepositoriesTask._update_packages_file, the
long description is not returned by the following loop (line 375, only
the first line is retuned, i.e. the short description):
for stanza in deb822.Packages.iter_paragraphs(packages_file):
Testing the same method locally succeeds in returning the long description:
for pkg in deb822.Packages.iter_paragraphs(file('/var/lib/dpkg/status')):
print pkg['Description']
You are right, we should use the escape template filter (or possibly
an autoescape tag on the first part of that template).
Thanks,
Christophe
Django does that automatically according to this: https://docs.djangoproject.com/en/dev/topics/templates/
Hi, This test is not very helpful: - you use the status file which has the full description while we work on files downloaded by apt, those have descriptions split out in separate Translation-en files. - did you test both in the same environment (i.e. same version of python-apt / python-debian) ? In fact, I even wonder why we're getting short description at all... since we're not accessing data directly via AptCache and instead we are parsing the downloaded Packages files. Cheers,
Hi, Raphael Hertzog wrote: We could adapt AptCache (in core.utils.packages) and use apt_pkg for retrieving version and descriptions (short and long) for binary packages. But then it seems more coherent to use to same mechanism for retrieving source packages informations. I wonder why we opted for manually parsing the Packages and Sources files in the first place, and what would be the impact on performances. Christophe
Hi, The reason we parse individual files is that we want to only process modified files since the last update (precisely for performance reasons). apt_pkg doesn't let us extract a list of packages coming from a specific Packages/Sources file. But the whole retrieve_data.py really needs some better design and quite likely a rewrite. Its huge resource consumption is also a problem. Cheers,
In the Debian derivatives census scripts I have a way to do that (except I don't do the update check), basically you extract the filenames of the Packages/Sources and then pass them to the deb822 module: https://anonscm.debian.org/cgit/dex/census.git/tree/check-package-list