Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 269171 - [PATCH] gentoolkit-0.3.0_rc5 - equery changes traceback when ChangeLog entry is unversioned
Summary: [PATCH] gentoolkit-0.3.0_rc5 - equery changes traceback when ChangeLog entry ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
: 272739 (view as bug list)
Depends on:
Blocks: 237964
  Show dependency tree
 
Reported: 2009-05-09 18:59 UTC by Douglas Anderson
Modified: 2009-06-19 17:13 UTC (History)
2 users (show)

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


Attachments
Make sure we don't traceback when entries don't have a version header (gentoolkit-changes-entrywithoutversion.patch,473 bytes, patch)
2009-05-09 19:00 UTC, Douglas Anderson
Details | Diff
Handle more cases, such as empty package name, empty ChangeLog file, or ChangeLog file with no version to match (gentoolkit-changes-handleemptychanglog.patch,1.35 KB, patch)
2009-05-10 17:29 UTC, Douglas Anderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Anderson 2009-05-09 18:59:28 UTC
Some ChangeLogs have entries without a version, for example when the ebuild is changed without updating the version:

$ head /usr/portage/media-video/dvbcut/ChangeLog 
# ChangeLog for media-video/dvbcut
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/media-video/dvbcut/ChangeLog,v 1.17 2009/03/08 17:22:13 aballier Exp $

  08 Mar 2009; Alexis Ballier <aballier@gentoo.org>
  +files/dvbcut-0.5.4-open.patch, dvbcut-0.5.4-r1.ebuild:
  fix build with fortify source

  19 Oct 2008; Alexis Ballier <aballier@gentoo.org>
  +files/dvbcut-0.5.4-scons.patch, dvbcut-0.5.4-r1.ebuild:

This can occasionally cause a traceback in equery changes:

$ equery c dvbcut
Traceback (most recent call last):
  File "/usr/bin/equery", line 32, in <module>
    equery.main() 
  File "/usr/lib/python2.6/site-packages/gentoolkit/equery/__init__.py", line 394, in main
    loaded_module.main(module_args)
  File "/usr/lib/python2.6/site-packages/gentoolkit/equery/changes.py", line 318, in main
    indexed_entries = index_changelog(log_entries)
  File "/usr/lib/python2.6/site-packages/gentoolkit/equery/changes.py", line 138, in index_changelog
    (VersionMatch(op="=", ver=pkg_split[1], rev=pkg_split[2]), entry))
TypeError: 'NoneType' object is unsubscriptable

The attached patch handles this exception.
Comment 1 Douglas Anderson 2009-05-09 19:00:56 UTC
Created attachment 190782 [details, diff]
Make sure we don't traceback when entries don't have a version header
Comment 2 Douglas Anderson 2009-05-09 19:01:55 UTC
Thanks to billie_80 on Freenode for pointing this out to me.
Comment 3 Daniel Pielmeier gentoo-dev 2009-05-09 21:43:37 UTC
(In reply to comment #2)
> Thanks to billie_80 on Freenode for pointing this out to me.
> 

With the patch the traceback disappears but when doing for instance "equery c dvbcut" it returns absolutely nothing which might irritate the user a bit. Maybe an informational message or something should be printed in this case.
Comment 4 Daniel Pielmeier gentoo-dev 2009-05-09 21:56:09 UTC
(In reply to comment #3)
> With the patch the traceback disappears but when doing for instance "equery c
> dvbcut" it returns absolutely nothing which might irritate the user a bit.
> Maybe an informational message or something should be printed in this case.
> 

Or falling back to the -l option for displaying the latest entry.
Comment 5 Douglas Anderson 2009-05-10 00:56:18 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > With the patch the traceback disappears but when doing for instance "equery c
> > dvbcut" it returns absolutely nothing which might irritate the user a bit.
> > Maybe an informational message or something should be printed in this case.
> > 
> 
> Or falling back to the -l option for displaying the latest entry.
> 

Try it with the patch in 269175 and let me know if that fixes the problem, because I couldn't duplicate your behavior.

$ svn revert changes.py
Reverted 'changes.py'
dja@vault equery $ patch -p0 < /development/patches/gentoolkit-changes-entrywithoutversion.patch 
patching file changes.py
dja@vault equery $ equery c dvbcut
*dvbcut-0.5.4-r1 (18 Oct 2007)

  18 Oct 2007; Matthias Schwarzott <zzam@gentoo.org>
  +files/dvbcut-0.5.4-ffmpeg-compat3.patch, +dvbcut-0.5.4-r1.ebuild:
  Fix compilation against newest ffmpeg, Bug #188184. Added desktop menu
  entry, Bug #188579.

  03 Jun 2007; Alexis Ballier <aballier@gentoo.org>
  -files/dvbcut-0.5.3-ac3-buffer.patch,
  -files/dvbcut-0.5.3-sconstruct.patch, -dvbcut-0.5.3-r1.ebuild:
  Cleanup old version

  01 Jun 2007; Alexis Ballier <aballier@gentoo.org>
  +files/dvbcut-0.5.4-ffmpeg-compat2.patch, +files/dvbcut-0.5.4-gcc42.patch,
  dvbcut-0.5.4.ebuild:
  Fix compilation against newest ffmpeg, bug #180547, also remove long time
  deprecated max c++ syntax that has been removed in gcc 4.2
dja@vault equery $ equery c gibberish
!!! Try using an unversioned query with --from and --to.
!!! No packages matching 'gibberish'


Comment 6 Daniel Pielmeier gentoo-dev 2009-05-10 12:21:07 UTC
(In reply to comment #5)
> 
> Try it with the patch in 269175 and let me know if that fixes the problem,
> because I couldn't duplicate your behavior.
> 

I found the problem, it has nothing to do with bug 269175. You can reproduce it if you copy the dvbcut directory from the portage tree to an overlay. In this case you will get no output from "equery c dvbcut" which is a bit strange.


If there is no Changelog in the overlay at all something similar to bug 1 from http://code.google.com/p/genscripts/issues/detail?id=1 happens where metadata.xml was missing in the package from the overlay "equery m dvbcut" has returned "!!! No metadata available."

I get the same now with the Changelog missing in the overlay. When I do "equery c dvbcut" I get "!!! /media/system/repositories/portage-billie/media-video/dvbcut/ChangeLog does not exist or is unreadable".

So it should also switch back to the Changelog of the in tree ebuild if there is any like for the metadata.xml. I often do testing in my overlay where i don't bother to include metadata.xml or the Changelog.
Comment 7 Douglas Anderson 2009-05-10 17:29:20 UTC
Created attachment 190853 [details, diff]
Handle more cases, such as empty package name, empty ChangeLog file, or ChangeLog file with no version to match

This patch improves handling of the following cases:

1) ChangeLog exists but doesn't contain any version to match. Solution is to print the first entry, same as equery c --latest:
dja@vault ~ $ equery c i3
26 Apr 2009; Andre-Patrick Bubel (moredread) <code@andre-bubel.de>
  +i3-3a.ebuild, +metadata.xml:
  New Ebuild for bug 267476 thanks to chithead, Ken69267, idl0r, Tommy[D]

2) ChangeLog exists but is unreadable:
dja@vault ~ $ sudo touch /usr/local/portage/layman/genscripts/app-portage/emeta/ChangeLog
dja@vault ~ $ equery c emeta                                                    !!! Fatal error: /usr/local/portage/layman/genscripts/app-portage/emeta/ChangeLog exists but doesn't contain entries.

3) This patch includes the improvements from the obsoleted patch.
Comment 8 Sebastian Luther (few) 2009-06-05 10:45:46 UTC
*** Bug 272739 has been marked as a duplicate of this bug. ***
Comment 9 Paul Varner (RETIRED) gentoo-dev 2009-06-19 17:13:47 UTC
Released in gentoolkit-0.3.0_rc7