depot.py revision 404
290N/A# The contents of this file are subject to the terms of the 290N/A# Common Development and Distribution License (the "License"). 290N/A# You may not use this file except in compliance with the License. 290N/A# See the License for the specific language governing permissions 290N/A# and limitations under the License. 290N/A# When distributing Covered Code, include this CDDL HEADER in each 290N/A# If applicable, add the following below this CDDL HEADER, with the 290N/A# fields enclosed by brackets "[]" replaced with your own identifying 290N/A# information: Portions Copyright [yyyy] [name of copyright owner] 849N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 395N/A# Use is subject to license terms. 883N/A# pkg.depotd - package repository daemon 290N/A# XXX The prototype pkg.depotd combines both the version management server that 448N/A# answers to pkgsend(1) sessions and the HTTP file server that answers to the 290N/A# various GET operations that a pkg(1) client makes. This split is expected to 290N/A# be made more explicit, by constraining the pkg(1) operations such that they 290N/A# can be served as a typical HTTP/HTTPS session. Thus, pkg.depotd will reduce 383N/A# to a special purpose HTTP/HTTPS server explicitly for the version management 290N/A# operations, and must manipulate the various state files--catalogs, in 395N/A# particular--such that the pkg(1) pull client can operately accurately with 849N/A# XXX We should support simple "last-modified" operations via HEAD queries. 290N/A# XXX Although we pushed the evaluation of next-version, etc. to the pull 849N/A# client, we should probably provide a query API to do same on the server, for 290N/A# dumb clients (like a notification service). 290N/A# The default authority for the depot. 383N/A# The default repository path. 290N/A# The default port to serve data from. 290N/A# The minimum number of threads allowed. 290N/A# The default number of threads to start. 290N/A# The maximum number of threads that can be started. 465N/A# The default server socket timeout in seconds. We want this to be longer than 465N/A# the normal default of 10 seconds to accommodate clients with poor quality 465N/A# Whether modify operations should be allowed. 1099N/A# Whether the repository catalog should be rebuilt on startup. 708N/A print """cherrypy 3.0.3 or greater (but less than 3.1.0) is """ \
1099N/A """required to use this program.""" 1391N/A [-s threads] [-t socket_timeout] 742N/A --readonly Read-only operation; modifying operations disallowed 742N/A --rebuild Re-build the catalog from pkgs in depot 395N/A [
"readonly",
"rebuild"])
290N/A print "pkg.depotd: option: %s -- %s" % (
opt, e)
1191N/A print "pkg.depotd: illegal option value: %s specified " \
290N/A print "pkg.depotd: unable to bind to the specified port: " \
1024N/A print "pkg.depotd: an error occurred while trying to " \
395N/A "initialize the depot repository directory " \
1099N/A # We have to override cherrypy's default response_class so that we 661N/A # have access to the write() callable to stream data directly to the 395N/A "environment":
"production",
395N/A print "pkg.depotd: unknown error starting depot, illegal " \
395N/A "option value specified?"