I'd like to see an enhancement to the portage overlay feature. It works great now if you use the same categories that exist in the official portage tree. However, if you create your own category directory, then packages inside it won't be found. You must add the category to /usr/portage/profiles/categories, which gets wiped out during an rsync. It would be nice if the overlay code would append the overlay category file (like /opt/portage/profiles/categories) to the list defined in /usr/portage/profiles/categories.
I use a /etc/portage/categories file to list my custom categories, and apply the following one line patch to /usr/lib/python2.2/site-packages/portage.py (somwhere around line 4966): -------------------------------------------------------------------------------- categories=grabfile(settings["PORTDIR"]+"/profiles/categories") else: categories=[] + + categories+=grabfile("/etc/portage/categories") pkgmasklines=grabfile(settings["PORTDIR"]+"/profiles/package.mask") pkgmasklines+=grabfile("/etc/portage/profiles/package.mask") -------------------------------------------------------------------------------- I think the only potential issue is if user adds some already defined categories to is own list, then there will be some duplicates. I don't know their potential effect. But it's easy to replace the += to take care of this.
Why can't one just have ${PORTAGE_OVERLAY}/profiles/categories ? this seems to me like the easiest solution the user can then define thier own explicitly, or just cp the categories from the real portage tree for some defaults.
Actually /etc/portage/categories support has been introduced by portage-2.0.49_pre18. This bug can be closed.
Created attachment 57219 [details, diff] Patch to add portage overlay support for categories I know that this bug is fixed, but here's a patch for those interested to add a portage overlay support for categories Take note that this patch has been created for Portage 2.0.51.19.
I had the following traceback with portage 2.0.52-r1: >>> Updating Portage cache: 17%Traceback (most recent call last): File "/usr/bin/emerge", line 2731, in ? cleanse_cache(pdb, oldcat, savelist) File "/usr/bin/emerge", line 2706, in cleanse_cache for pv in pdb.auxdb[porttree_root][cat].keys(): KeyError: 'cross-alpha-unknown-linux-gnu' I have cross-alpha-unknown-linux-gnu in /etc/portage/categories and in my overlay. If i remove /etc/portage/categories, the traceback goes away. Is this intended ? or should i open a new bug ?