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

Class ConaryClient

source code

      clone.ClientClone --+
                          |
    branch.ClientBranch --+
                          |
    update.ClientUpdate --+
                          |
newtrove.ClientNewTrove --+
                          |
                         ConaryClient

ConaryClient is a high-level class to some useful Conary operations, including trove updates and erases.

Instance Methods [hide private]
 
__init__(self, cfg=None, passwordPrompter=None, resolverClass=<class 'conary.conaryclient.resolve.DependencySolver'>, updateCallback=None)
PUBLIC API
source code
 
createRepos(self, db, cfg, passwordPrompter=None, userMap=None) source code
conary.repository.netclient.NetworkRepositoryClient
getRepos(self)
PUBLIC API
source code
 
setRepos(self, repos) source code
 
getDatabase(self)
PUBLIC API
source code
 
disconnectRepos(self)
Disconnect the client from repositories.
source code
 
getMetadata(self, troveList, label, cacheFile=None, cacheOnly=False, saveOnly=False) source code
 
_createChangeSetList(self, csList, recurse=True, skipNotByDefault=False, excludeList=RegularExpressionList([]), callback=None) source code
 
createChangeSet(self, csList, recurse=True, skipNotByDefault=True, excludeList=RegularExpressionList([]), callback=None, withFiles=False, withFileContents=False)
PUBLIC API
source code
 
createChangeSetFile(self, path, csList, recurse=True, skipNotByDefault=True, excludeList=RegularExpressionList([]), callback=None)
Creates <path> as a change set file.
source code
 
checkWriteableRoot(self)
Prepares the installation root for trove updates and change set applications.
source code
 
pinTroves(self, troveList, pin=True)
PUBLIC API Calls L{conary.local.database.Database.pintroves} @param troveList: a list of troves to pin @type troveList: list of troves @note: As this call makes database updates, any of the errors documented in L{conary.dbstore.sqlerrors} may be raised.
source code
 
getConaryUrl(self, version, flavor)
returns url to a conary changeset for updating the local client to
source code
 
iterRollbacksList(self)
PUBLIC API
source code
conary.repository.searchsource.NetworkSearchSource
getSearchSource(self, flavor=0, troveSource=None, installLabelPath=0)
PUBLIC API
source code
 
applyRollback(self, rollbackSpec, replaceFiles=None, callback=None, tagScript=None, justDatabase=None, transactionCounter=None)
PUBLIC API
source code
 
close(self)
Close this client and release all associated resources
source code

Inherited from clone.ClientClone: createCloneChangeSet, createCloneChangeSetWithOptions, createSiblingCloneChangeSet, createTargetedCloneChangeSet

Inherited from branch.ClientBranch: createBranchChangeSet, createShadowChangeSet

Inherited from update.ClientUpdate: applyUpdate, applyUpdateJob, cleanRestartInfo, downloadUpdate, fullUpdateItemList, getChildLocalUpdates, getDownloadSizes, getPrimaryLocalUpdates, getUpdateCallback, getUpdateItemList, loadRestartInfo, newUpdateJob, prepareUpdateJob, recordManifest, saveRestartInfo, setUpdateCallback, updateChangeSet

Inherited from newtrove.ClientNewTrove: createSourceTrove, getFilesFromTrove

Static Methods [hide private]

Inherited from update.ClientUpdate: revertJournal

Class Variables [hide private]

Inherited from branch.ClientBranch: BRANCH_ALL, BRANCH_BINARY, BRANCH_SOURCE

Method Details [hide private]

__init__(self, cfg=None, passwordPrompter=None, resolverClass=<class 'conary.conaryclient.resolve.DependencySolver'>, updateCallback=None)
(Constructor)

source code 
PUBLIC API
Parameters:
Decorators:
  • @api.publicApi
Overrides: update.ClientUpdate.__init__

getRepos(self)

source code 
PUBLIC API
Returns: conary.repository.netclient.NetworkRepositoryClient
a repository client object
Decorators:
  • @api.publicApi

getDatabase(self)

source code 
PUBLIC API
Decorators:
  • @api.publicApi

disconnectRepos(self)

source code 

Disconnect the client from repositories.

This method is useful if the changesets are applied from local media or were previously downloaded with downloadUpdate.

createChangeSet(self, csList, recurse=True, skipNotByDefault=True, excludeList=RegularExpressionList([]), callback=None, withFiles=False, withFileContents=False)

source code 

PUBLIC API

Like self.createChangeSetFile(), but returns a change set object. withFiles and withFileContents are the same as for the underlying repository call.
Decorators:
  • @api.publicApi

createChangeSetFile(self, path, csList, recurse=True, skipNotByDefault=True, excludeList=RegularExpressionList([]), callback=None)

source code 
Creates <path> as a change set file.
Parameters:
  • path (string) - path to write the change set to
  • csList - list of (troveName, (oldVersion, oldFlavor), (newVersion, newFlavor), isAbsolute)
  • recurse (boolean) - If true, conatiner troves are recursed through
  • skipNotByDefault (boolean) - If True, troves which are included in a container with byDefault as False are not included (this flag doesn't do anything if recurse is False)
  • excludeList - List of regular expressions which are matched against recursively included trove names. Troves which match any of the expressions are left out of the change set (this list is meaningless if recurse is False).
  • callback (callbacks.UpdateCallback) - Callback object

pinTroves(self, troveList, pin=True)

source code 
PUBLIC API


Calls L{conary.local.database.Database.pintroves}

@param troveList: a list of troves to pin
@type troveList: list of troves

@note:
    As this call makes database updates, any of the errors
documented in L{conary.dbstore.sqlerrors} may be raised.

@rtype: None

Decorators:
  • @api.publicApi

getConaryUrl(self, version, flavor)

source code 
returns url to a conary changeset for updating the local client to
Parameters:

iterRollbacksList(self)

source code 

PUBLIC API

Iterate over rollback list. Yield (rollbackName, rollback)
Decorators:
  • @api.publicApi
Raises:
  • ConaryError - raised when the rollbacks directory cannot be read

getSearchSource(self, flavor=0, troveSource=None, installLabelPath=0)

source code 
PUBLIC API
Returns: conary.repository.searchsource.NetworkSearchSource
a searchSourceStack
Decorators:
  • @api.publicApi
Raises:
  • ConaryError - raised if SearchSourceStack creation fails
  • ParseError - raised if an element in the search path is malformed.

applyRollback(self, rollbackSpec, replaceFiles=None, callback=None, tagScript=None, justDatabase=None, transactionCounter=None)

source code 

PUBLIC API

Apply a rollback.
Parameters:
  • rollbackSpec (string) - Rollback specififier. This is either a number (in which case it refers to the absolute position in the rollback stack, with 0 being the oldest rollback) or a string like r.128, as listed by conary rblist.
  • replaceFiles (bool) -
  • callback (callbacks.UpdateCallback) - Callback for communicating information back to the invoker of this method.
  • tagScript (path) - A tag script.
  • justDatabase (bool) - Change only the database, do not revert the filesystem.
  • transactionCounter (int) - The Conary database contains a counter that gets incremented with every change. This argument is the counter's value at the time the rollback was computed from the specifier. It is used to ensure that no uninteded rollbacks are performed, if a concurrent update happens between the moment of reading the database state and the moment of performing the rollback.
Decorators:
  • @api.publicApi
Raises:
  • UpdateError - Generic update error. Can occur if the root is not writeable by the user running the command.
  • RollbackError - Generic rollback error. Finer grained rollback errors are RollbackDoesNotExist (raised if the rollback specifier was invalid) and RollbackOrderError (if the rollback was attempted not following the rollback stack order). It can also be raised if the database state has changed between the moment the rollback was computed and the moment of performing the rollback. See also the description for transactionCounter.
  • ConaryError - Generic Conary error. Raised if the user running the command does not have permissions to access the rollback directory, or the directory is missing.