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

Source Code for Package conary.conaryclient

  1  # 
  2  # Copyright (c) 2004-2008 rPath, Inc. 
  3  # 
  4  # This program is distributed under the terms of the Common Public License, 
  5  # version 1.0. A copy of this license should have been distributed with this 
  6  # source file in a file called LICENSE. If it is not present, the license 
  7  # is always available at http://www.rpath.com/permanent/licenses/CPL-1.0. 
  8  # 
  9  # This program is distributed in the hope that it will be useful, but 
 10  # without any warranty; without even the implied warranty of merchantability 
 11  # or fitness for a particular purpose. See the Common Public License for 
 12  # full details. 
 13   
 14  import itertools 
 15  import os 
 16  import pickle 
 17   
 18  #conary imports 
 19  from conary import conarycfg, errors, metadata, rollbacks, trove 
 20  from conary.conaryclient import clone, resolve, update 
 21  from conary.lib import log, util, openpgpkey, api 
 22  from conary.local import database 
 23  from conary.repository.netclient import NetworkRepositoryClient 
 24  from conary.repository import trovesource 
 25  from conary.repository import searchsource 
 26  from conary.repository import resolvemethod 
 27   
 28  # mixins for ConaryClient 
 29  from conary.conaryclient.branch import ClientBranch 
 30  from conary.conaryclient import cmdline 
 31  from conary.conaryclient.clone import ClientClone 
 32  from conary.conaryclient import password 
 33  from conary.conaryclient.update import ClientUpdate 
 34  from conary.conaryclient.newtrove import ClientNewTrove 
 35   
 36  CloneError = clone.CloneError 
 37  CloneIncomplete = clone.CloneIncomplete 
 38  UpdateError = update.UpdateError 
 39  NoNewTrovesError = update.NoNewTrovesError 
 40  DependencyFailure = update.DependencyFailure 
 41  DepResolutionFailure = update.DepResolutionFailure 
 42  EraseDepFailure = update.EraseDepFailure 
 43  NeededTrovesFailure = update.NeededTrovesFailure 
 44  InstallPathConflicts = update.InstallPathConflicts 
 45   
 46  CriticalUpdateInfo = update.CriticalUpdateInfo 
 47   
 48  ChangeSetFromFile = update.changeset.ChangeSetFromFile 
 49   
50 -class TroveNotFound(Exception):
51 - def __init__(self, troveName):
52 self.troveName = troveName
53
54 - def __str__(self):
55 return "trove not found: %s" % self.troveName
56
57 -class VersionSuppliedError(UpdateError):
58 - def __str__(self):
59 return "version should not be specified when a Conary change set " \ 60 "is being installed"
61
62 -class ConaryClient(ClientClone, ClientBranch, ClientUpdate, ClientNewTrove):
63 """ 64 ConaryClient is a high-level class to some useful Conary operations, 65 including trove updates and erases. 66 """ 67 @api.publicApi
68 - def __init__(self, cfg = None, passwordPrompter = None, 69 resolverClass=resolve.DependencySolver, updateCallback=None):
70 """ 71 @param cfg: a custom L{conarycfg.ConaryConfiguration} object. 72 If None, the standard Conary configuration is loaded 73 from /etc/conaryrc, ~/.conaryrc, and ./conaryrc. 74 @type cfg: L{conarycfg.ConaryConfiguration} 75 """ 76 77 ClientUpdate.