Package daklib :: Module archive :: Class ArchiveTransaction
[hide private]
[frames] | no frames]

Class ArchiveTransaction

source code

manipulate the archive in a transaction

Instance Methods [hide private]
 
__init__(self) source code
daklib.dbconn.PoolFile
get_file(self, hashed_file, source_name, check_hashes=True)
Look for file hashed_file in database
source code
daklib.dbconn.PoolFile
_install_file(self, directory, hashed_file, archive, component, source_name)
Install a file
source code
daklib.dbconn.DBBinary
install_binary(self, directory, binary, suite, component, allow_tainted=False, fingerprint=None, source_suites=None, extra_source_archives=None)
Install a binary package
source code
 
_ensure_extra_source_exists(self, filename, source, archive, extra_archives=None)
ensure source exists in the given archive
source code
 
_add_built_using(self, db_binary, filename, control, suite, extra_archives=None)
Add Built-Using sources to db_binary.extra_sources
source code
 
install_source_to_archive(self, directory, source, archive, component, changed_by, allow_tainted=False, fingerprint=None) source code
daklib.dbconn.DBSource
install_source(self, directory, source, suite, component, changed_by, allow_tainted=False, fingerprint=None)
Install a source package
source code
 
_copy_file(self, db_file, archive, component, allow_tainted=False)
Copy a file to the given archive and component
source code
 
copy_binary(self, db_binary, suite, component, allow_tainted=False, extra_archives=None)
Copy a binary package to the given suite and component
source code
 
copy_source(self, db_source, suite, component, allow_tainted=False)
Copy a source package to the given suite and component
source code
 
remove_file(self, db_file, archive, component)
Remove a file from a given archive and component
source code
 
remove_binary(self, binary, suite)
Remove a binary from a given suite and component
source code
 
remove_source(self, source, suite)
Remove a source from a given suite and component
source code
 
commit(self)
commit changes
source code
 
rollback(self)
rollback changes
source code
 
flush(self) source code
 
__enter__(self) source code
 
__exit__(self, type, value, traceback) source code
Method Details [hide private]

get_file(self, hashed_file, source_name, check_hashes=True)

source code 

Look for file hashed_file in database

Parameters:
  • hashed_file (daklib.upload.HashedFile) - file to look for in the database
  • source_name (str) - source package name
  • check_hashes (bool) - check size and hashes match
Returns: daklib.dbconn.PoolFile
database entry for the file
Raises:

_install_file(self, directory, hashed_file, archive, component, source_name)

source code 

Install a file

Will not give an error when the file is already present.

Returns: daklib.dbconn.PoolFile
database object for the new file

install_binary(self, directory, binary, suite, component, allow_tainted=False, fingerprint=None, source_suites=None, extra_source_archives=None)

source code 

Install a binary package

Parameters:
  • directory (str) - directory the binary package is located in
  • binary (daklib.upload.Binary) - binary package to install
  • suite (daklib.dbconn.Suite) - target suite
  • component (daklib.dbconn.Component) - target component
  • allow_tainted (bool) - allow to copy additional files from tainted archives
  • fingerprint (daklib.dbconn.Fingerprint) - optional fingerprint
  • source_suites (SQLAlchemy subquery for daklib.dbconn.Suite or True) - suites to copy the source from if they are not in suite or True to allow copying from any suite.
  • extra_source_archives (list of daklib.dbconn.Archive) - extra archives to copy Built-Using sources from
Returns: daklib.dbconn.DBBinary
databse object for the new package

_ensure_extra_source_exists(self, filename, source, archive, extra_archives=None)

source code 

ensure source exists in the given archive

This is intended to be used to check that Built-Using sources exist.

Parameters:

install_source(self, directory, source, suite, component, changed_by, allow_tainted=False, fingerprint=None)

source code 

Install a source package

Parameters:
Returns: daklib.dbconn.DBSource
database object for the new source

_copy_file(self, db_file, archive, component, allow_tainted=False)

source code 

Copy a file to the given archive and component

Parameters:

copy_binary(self, db_binary, suite, component, allow_tainted=False, extra_archives=None)

source code 

Copy a binary package to the given suite and component

Parameters:

copy_source(self, db_source, suite, component, allow_tainted=False)

source code 

Copy a source package to the given suite and component

Parameters:

remove_file(self, db_file, archive, component)

source code 

Remove a file from a given archive and component

Parameters:

remove_binary(self, binary, suite)

source code 

Remove a binary from a given suite and component

Parameters:

remove_source(self, source, suite)

source code 

Remove a source from a given suite and component

Parameters:
Raises:
  • ArchiveException - source package is still referenced by other binaries in the suite