Package conary :: Package conaryclient :: Module mirror
[hide private]
[frames] | no frames]

Source Code for Module conary.conaryclient.mirror

  1  # -*- mode: python -*- 
  2  # 
  3  # Copyright (c) 2006-2008 rPath, Inc. 
  4  # 
  5  # This program is distributed under the terms of the Common Public License, 
  6  # version 1.0. A copy of this license should have been distributed with this 
  7  # source file in a file called LICENSE. If it is not present, the license 
  8  # is always available at http://www.rpath.com/permanent/licenses/CPL-1.0. 
  9  # 
 10  # This program is distributed in the hope that it will be useful, but 
 11  # without any warranty; without even the implied warranty of merchantability 
 12  # or fitness for a particular purpose. See the Common Public License for 
 13  # full details. 
 14  # 
 15  # 
 16   
 17  import fcntl 
 18  import itertools 
 19  import optparse 
 20  import os 
 21  import sys 
 22  import time 
 23   
 24  from conary.conaryclient import callbacks as clientCallbacks 
 25  from conary import conarycfg, callbacks, trove 
 26  from conary.lib import cfg, util, log 
 27  from conary.repository import errors, changeset, netclient 
 28   
29 -class OptionError(Exception):
30 - def __init__(self, errcode, errmsg, *args):
31 self.errcode = errcode 32 self.errmsg = errmsg 33 Exception.__init__(self, *args)
34
35 -def parseArgs(argv):
36 parser = optparse.OptionParser(version = '%prog 0.1') 37 parser.add_option("--config-file", dest = "configFile", 38 help = "configuration file", metavar = "FILE") 39 parser.add_option("--full-sig-sync", dest = "infoSync", 40 action = "store_true", default = False, 41 help = "deprecated: alias to --full-info-sync") 42 parser.add_option("--full-info-sync", dest = "infoSync", 43 action = "store_true", default = False, 44 help = "replace all the trove signatures and metadata " 45 "in the target repository") 46 parser.add_option("--fast-sync", dest = "fastSync", 47 action = "store_true", default = False, 48 help = "skip checking/mirroring of changed info records " 49 "for already mirrored troves") 50 parser.add_option("--absolute", dest = "absolute", 51 action = "store_true", default = False, 52 help = "use only absolute changesets when mirroring content") 53 parser.add_option("--full-trove-sync", dest = "sync", action = "store_true", 54 default = False, 55 help = "ignore the last-mirrored timestamp in the " 56 "target repository") 57 parser.add_option("--check-sync", dest = "checkSync", action = "store_true", 58 default = False, 59 help = "only check if the source and target(s) are in sync") 60 parser.add_option("--test", dest = "test", action = "store_true", 61 default = False, 62 help = "skip commiting changes to the target repository") 63 parser.add_option("-v", "--verbose", dest = "verbose", 64 action = "store_true", default = False, 65