Current output looks like: ~amd64 ~amd64-linux ~ppc ~ppc-macos ~x86 ~x86-linux ~x86-macos ~x86-solaris Should look like: ~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris
Where does GLEP 53 say something about the order of keywords?
Actually, re-reading the GLEP, it doesn't say anything about sorting. Re-wording bug summary.
The following test has been added to equery's test suite and passes. The keyword sorting func can be found in gentoolkit.equery.keyword.compare_strs. equery.meta now makes use of this function to sort keywords. def test_compare_strs(self): compare_strs = keyword.compare_strs # Test ordering of keyword strings version_tests = [ # different archs ('amd64', 'x86'), # stable vs. unstable ('amd64-linux', '~amd64-linux'), # different OSes ('~x86-linux', '~x86-solaris'), # OS vs. no OS ('x86', '~amd64-linux') ] # Check less than for vt in version_tests: self.failUnless(compare_strs(vt[0], vt[1]) == -1) # Check greater than for vt in version_tests: self.failUnless(compare_strs(vt[1], vt[0]) == 1) # Check equal vt = ('~amd64-linux', '~amd64-linux') self.failUnless(compare_strs(vt[0], vt[1]) == 0) kwds_presort = [ '~amd64', '~amd64-linux', '~ppc', '~ppc-macos', '~x86', '~x86-linux', '~x86-macos', '~x86-solaris' ] kwds_postsort = [ '~amd64', '~ppc', '~x86', '~amd64-linux', '~x86-linux', '~ppc-macos', '~x86-macos', '~x86-solaris' ] self.failUnlessEqual(sorted(kwds_presort, cmp=compare_strs), kwds_postsort)
Not fixed in gentoolkit-0.3.0_rc10. Test case: $ epkginfo xfce4-panel * xfce-base/xfce4-panel [gentoo] Herd: xfce (xfce@gentoo.org) Maintainer: None specified Upstream: None specified Location: /usr/portage/xfce-base/xfce4-panel Keywords: 4.6.1:0: hppa Keywords: 4.6.2:0: alpha amd64 arm ia64 ppc ppc64 sparc x86 Keywords: 4.6.2-r1:0: Keywords: 4.7.1:0: ~alpha ~amd64 ~amd64-linux ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~x86-linux ~x86-solaris
The problem here is that the various sorting methods in gentoolkit.keyword all work for standard strings, but inside gentoolkit keywords are passed around as a list of unicode strings, and for some reason they don't sort the same. The test case in comment #3 needs to be modified to test for keywords like [u'this'].
Fixed in genscripts r458, though honestly I couldn't figure out why it wasn't working the other way... apparently it was not affected by the strings being unicode.
Released in gentoolkit-0.3.0_rc11