depot.py revision 54
20N/A# The contents of this file are subject to the terms of the 20N/A# Common Development and Distribution License (the "License"). 20N/A# You may not use this file except in compliance with the License. 20N/A# See the License for the specific language governing permissions 20N/A# and limitations under the License. 20N/A# When distributing Covered Code, include this CDDL HEADER in each 20N/A# If applicable, add the following below this CDDL HEADER, with the 20N/A# fields enclosed by brackets "[]" replaced with your own identifying 20N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3158N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 20N/A# Use is subject to license terms. 3143N/A# pkg.depotd - package repository daemon 0N/A# XXX The prototype pkg.depotd combines both the version management server that 50N/A# answers to pkgsend(1) sessions and the HTTP file server that answers to the 50N/A# various GET operations that a pkg(1) client makes. This split is expected to 50N/A# be made more explicit, by constraining the pkg(1) operations such that they 50N/A# can be served as a typical HTTP/HTTPS session. Thus, pkg.depotd will reduce 50N/A# to a special purpose HTTP/HTTPS server explicitly for the version management 50N/A# operations, and must manipulate the various state files--catalogs, in 50N/A# particular--such that the pkg(1) pull client can operately accurately with 50N/A# XXX We should support simple "last-modified" operations via HEAD queries. 50N/A# XXX Although we pushed the evaluation of next-version, etc. to the pull 50N/A# client, we should probably provide a query API to do same on the server, for 50N/A# dumb clients (like a notification service). 382N/A """The request is an encoded pkg FMRI. If the version is specified 382N/A incompletely, we return an error, as the client is expected to form 382N/A correct requests, based on its interpretation of the catalog and its 382N/A # Parse request into FMRI component and decode. 1431N/A """The request is the SHA-1 hash name for the file.""" 466N/A # XXX Authentication will be handled by virtue of possessing a signed 466N/A # certificate (or a more elaborate system). 2230N/A # Pull transaction ID from headers. 2028N/A # Pull transaction ID from headers. 812N/A<h1><code>pkg</code> server ok</h1> 589N/A print "pkg.depotd: unknown option '%s'" % e.
opt