catalog.py revision 34
23N/A# The contents of this file are subject to the terms of the 23N/A# Common Development and Distribution License (the "License"). 23N/A# You may not use this file except in compliance with the License. 23N/A# See the License for the specific language governing permissions 23N/A# and limitations under the License. 23N/A# When distributing Covered Code, include this CDDL HEADER in each 23N/A# If applicable, add the following below this CDDL HEADER, with the 23N/A# fields enclosed by brackets "[]" replaced with your own identifying 23N/A# information: Portions Copyright [yyyy] [name of copyright owner] 23N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23N/A# Use is subject to license terms. 34N/A """A Catalog is the representation of the package FMRIs available to 34N/A this client or repository. Both purposes utilize the same storage 26N/A The serialized structure of the repository is an unordered list of 26N/A available package versions, followed by an unordered list of 26N/A incorporation relationships between packages. This latter section 26N/A allows the graph to be topologically sorted by the client. 30N/A XXX It would be nice to include available tags and package sizes, 30N/A although this could also be calculated from the set of manifests. 34N/A # each V line is an fmri 34N/A # split into a package and a version 34N/A # add package to pkgs 34N/A # add version to pkg 34N/A # stop at end of file 26N/A # for each version in the package, 26N/A # for each incorporation in the version, 26N/A # add to the version's list of incorporations 30N/A # iterate through pkgs, looking for an fmri match 26N/A s = s +
"I %s\n" % r
34N/A """Return a pair of lists, the first list being those package 34N/A FMRIs present in the current object but not in the presented 34N/A catalog, the second being those present in the presented catalog 34N/A but not in the current catalog."""