depot.py revision 46
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] 20N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 20N/A# Use is subject to license terms. 22N/A# pkg.depotd - package repository daemon 30N/A """The request is an encoded pkg FMRI. If the version is specified 30N/A incompletely, we return the latest matching manifest. The matched 30N/A version is returned in the headers. If an incomplete FMRI is received, 30N/A the client is expected to have provided a build release in the request 30N/A Legitimate requests are 30N/A allowing the request of the next matching version, based on client 30N/A # Parse request into FMRI component and decode. 45N/A # Look for exact match. 30N/A # Determine closest version. 45N/A# request.log_message("multiple manifest result ambiguous") 45N/A# request.send_response(400) 45N/A# request.end_headers() 30N/A # Open manifest and send. 30N/A """The request is the SHA-1 hash name for the file.""" 22N/A # XXX Authentication will be handled by virtue of possessing a signed 22N/A # certificate (or a more elaborate system). 0N/A # Pull transaction ID from headers. 22N/A # Pull transaction ID from headers. 26N/A # Informational APIs 26N/A<h1><code>pkg</code> server ok</h1> 26N/A print "pkg.depotd: unknown option"