Gentoo Archives: gentoo-dev

From: "Kevin F. Quinn" <ml@××××××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: New category proposal
Date: Wed, 11 May 2005 07:46:00
Message-Id: 91AEL.27774KEO@kevquinn.com
In Reply to: Re: [gentoo-dev] Re: New category proposal by Brian Harring
1 On Wed, May 11, 2005 at 07:09:20, Brian Harring wrote:
2
3 > One thing that just clicked in the skull on why flat-tree has issues; > currently it's possible to have a package with the same name, yet a
4 > differing category (app-vim/sudo vs app-admin/sudo).
5
6 Aa flat package namespace would necessitate renaming any existing package name clashes. The essential problem with categories is that you will always have confusion in some cases as to which category a package should be in; it's natural that some packages will make sense in more than one category. A good example of this problem with categories can be seen in the CDDB/FreeDB track listing database which does a similar category thing with category/album-hash (the problem is pretty acute there, not least because the probability of clashes in the album-hash is high, but also because people disagree whether their favourite album is new-age, folk, etc).
7
8 Here's my suggestion, for what it's worth :)
9
10 The layout on disk and the semantics of categories do not need to be related. I like the idea of using the first character of a package name as the sub-directory name. This can be extended more deeply as and when necessary to avoid over-large directories which cause problems on some filesystems. e.g. for sudo you get "s/sudo" and vim-sudo "v/vim-sudo". This is architecture-neutral, rsyncable, scalable, and not too difficult for users to parse manually (see later for searching through categories). If the algorithm portage would use to locate a package is such that it doesn't mandate the depth (i.e. tries "package", "p/package" if "p/" exists, "p/a/package" if "p/a/" exists) then overlays can have a different depth to the rsync tree; if you only have a few packages in overlay then they need not be in subdirectories at all.
11
12 The key here is to separate the category (metadata) and filesystem layout (implementation detail) from the concept of package name. This opens up all sorts of possibilities, for example different layouts in CVS, on mirrors and on clients (some kind of custom rsync would be necessary) - but that's going perhaps too far...
13
14 Categories become metadata, formally (this is the root of the problem - including the category in the package name is a pollution of the package name). Once they become properly understood and implemented as metadata, a package being a member of more than one category is a natural consequence.
15
16 Whether category should be in the ebuild or in metadata.xml is a another issue. We already have some metadata in the ebuilds (e.g. DESCRIPTION). However that's really a separate debate; the question of whether all metadata that isn't version-dependent and doesn't impact the emerge process should be moved from ebuilds to metadata.xml...
17
18 Portage would essentially ignore categories. Some support would be necessary to allow the user to query categories (since 'ls /usr/portage/<category>' would no longer work) - but searching for packages is already a function and would just need to be adapted (and perhaps optimised ;) ). Indeed just listing out portage directories at the moment is often insufficient to find a suitable package, since package names are often amusing but uninformative acronyms.
19
20 The real problem with implementing the above is the amount of work it would take to modify portage and the tree, for relatively little gain at the moment. I'm certainly not volunteering :)
21
22 The benefits include
23 1) no more "moving packages around the tree"
24 2) categories can be added to a package in the most natural way
25 3) overlays can be tidier
26
27 The downsides include
28 1) Massive upheaval in the portage tree
29 2) Massive upheaval in the portage tree
30 3) Massive upheaval in the portage tree
31
32 well, it's a big downside...
33
34 Having said that, some things could be done now. If a flat package namespace is desirable, the existing package name clashes could be resolved by renaming the few packages that clash. Category could be added as a field in metadata.xml, so that a package could "belong" to multiple categories. The query/search tools could be enhanced to scan this metadata (perhaps including the current category directory as an implied entry in the metadata.xml).
35
36 Kev.
37
38
39
40 --
41 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Re: New category proposal Brian Harring <ferringb@g.o>