[pkg-discuss] Code review: bug #9002 - check_classifications.txt should be adjusted for new post 2008.11 classifications.

Rich Burridge Rich.Burridge at Sun.COM
Fri May 22 08:04:14 PDT 2009


Michal Pryc wrote:
> ...
>>> Understood but I don't believe src/gui/data/opensolaris.org.sections
>>> needs to be limited at the moment to just the ones being used by the
>>> import files, right?
>>
>> I don't think so, but John or Michal are probably the best people to
>> answer that.
>
> The publisher.sections file is describing relationship between 
> categories and sections (please see attached two files to understand 
> what I am calling section and category).
> So for example if the category Games is in the section Applications 
> then in the file publisher.sections there need to be relation Games 
> belongs to Applications.
> The sections are predefined and cannot be changed dynamically, but 
> publisher owners can define to which sections their categories belongs 
> using publisher.sections file.
>
> This file is per publisher, so that is why we do have 
> opensolaris.org.sections, because our publisher is called 
> opensolaris.org.
>
> Another file src/gui/data/opensolaris.org is describing relations 
> between packages and categories. For example SUNWgnome-games belongs 
> to the Games category.
>
> As far as I know there is script which generates 
> opensolaris.org.sections and opensolaris.org files while those are 
> published to the repository, but I am not 100% sure.
>
> Is that answaring your question?

No.

Please have a look at the webrev at:

  http://cr.opensolaris.org/~richb/pkg-9002-v1/

In there you will see a new file called
.../src/web/_resources/classifications.txt
(soon to be called .../src/web/_resources/classifications).

It will be served up by IPS package depots
(such as http://pkg.opensolaris.org/release/_resources/classifications).
 
It shows the classifications (categories/subcategories) in a
format that would be read with something like:

import simplejson
import urllib2

...

self.class_url = "http://pkg.opensolaris.org/release/_resources/classifications"

...

              try:
                  fileobj = urllib2.urlopen(self.class_url)
                  self.categories = simplejson.load(fileobj)
              except (ValueError, urllib2.HTTPError), e:
                  print >> sys.stderr, "Unable to get package classifications.", e
                  sys.exit(3)

The script .../gate/src/util/distro_import/check_classifications.py
has been modified (as part of the same webrev) to use it.

The Source Juicer folks would change their code to do the same.

The question for you:

Can the GUI Package Manager code be adjusted to read in this file
instead of opensolaris.org.sections? 






More information about the pkg-discuss mailing list