daklib.contents

Helper code for contents generation.

@contact: Debian FTPMaster <ftpmaster@debian.org> @copyright: 2011 Torsten Werner <twerner@debian.org> @license: GNU General Public License version 2 or later

Functions

binary_helper(suite_id, arch_id, ...)

This function is called in a new subprocess and multiprocessing wants a top level function.

binary_scan_helper(binary_id)

This function runs in a subprocess.

source_helper(suite_id, component_id)

This function is called in a new subprocess and multiprocessing wants a top level function.

source_scan_helper(source_id)

This function runs in a subprocess.

Classes

BinaryContentsScanner(binary_id)

BinaryContentsScanner provides a threadsafe method scan() to scan the contents of a DBBinary object.

BinaryContentsWriter(suite, architecture, ...)

BinaryContentsWriter writes the Contents-$arch.gz files.

ContentsWriter()

Loop over all suites, architectures, overridetypes, and components to write all contents files.

SourceContentsScanner(source_id)

SourceContentsScanner provides a method scan() to scan the contents of a DBSource object.

SourceContentsWriter(suite, component)

SourceContentsWriter writes the Contents-source.gz files.

UnpackedSource(dscfilename[, tmpbasedir])

UnpackedSource extracts a source package into a temporary location and gives you some convinient function for accessing it.

class daklib.contents.BinaryContentsScanner(binary_id: int)[source]

BinaryContentsScanner provides a threadsafe method scan() to scan the contents of a DBBinary object.

scan() None[source]

This method does the actual scan and fills in the associated BinContents property. It commits any changes to the database. The argument dummy_arg is ignored but needed by our threadpool implementation.

classmethod scan_all(limit=None)[source]

The class method scan_all() scans all binaries using multiple threads. The number of binaries to be scanned can be limited with the limit argument. Returns the number of processed and remaining packages as a dict.

class daklib.contents.BinaryContentsWriter(suite, architecture, overridetype, component)[source]

BinaryContentsWriter writes the Contents-$arch.gz files.

fetch() Iterable[str][source]

Yields a new line of the Contents-$arch.gz file in filename order.

formatline(filename, package_list) str[source]

Returns a formatted string for the filename argument.

get_list() list[str][source]

Returns a list of lines for the Contents-$arch.gz file.

query()[source]

Returns a query object that is doing most of the work.

write_file() None[source]

Write the output file.

writer()[source]

Returns a writer object.

class daklib.contents.ContentsWriter[source]

Loop over all suites, architectures, overridetypes, and components to write all contents files.

classmethod log_result(result) None[source]

Writes a result message to the logfile.

classmethod write_all(logger, archive_names=None, suite_names=None, component_names=None, force=False)[source]

Writes all Contents files for suites in list suite_names which defaults to all ‘touchable’ suites if not specified explicitely. Untouchable suites will be included if the force argument is set to True.

class daklib.contents.SourceContentsScanner(source_id: int)[source]

SourceContentsScanner provides a method scan() to scan the contents of a DBSource object.

scan() None[source]

This method does the actual scan and fills in the associated SrcContents property. It commits any changes to the database.

classmethod scan_all(limit=None)[source]

The class method scan_all() scans all source using multiple processes. The number of sources to be scanned can be limited with the limit argument. Returns the number of processed and remaining packages as a dict.

class daklib.contents.SourceContentsWriter(suite, component)[source]

SourceContentsWriter writes the Contents-source.gz files.

fetch()[source]

Yields a new line of the Contents-source.gz file in filename order.

formatline(filename, package_list)[source]

Returns a formatted string for the filename argument.

get_list()[source]

Returns a list of lines for the Contents-source.gz file.

query()[source]

Returns a query object that is doing most of the work.

write_file()[source]

Write the output file.

writer()[source]

Returns a writer object.

class daklib.contents.UnpackedSource(dscfilename: str, tmpbasedir: Optional[str] = None)[source]

UnpackedSource extracts a source package into a temporary location and gives you some convinient function for accessing it.

cleanup() None[source]

Removes all temporary files.

get_all_filenames() Iterable[str][source]

Returns an iterator over all filenames. The filenames will be relative to the root directory.

get_root_directory() str[source]

Returns the name of the package’s root directory which is the directory where the debian subdirectory is located.

daklib.contents.binary_helper(suite_id: int, arch_id: int, overridetype_id: int, component_id: int)[source]

This function is called in a new subprocess and multiprocessing wants a top level function.

daklib.contents.binary_scan_helper(binary_id: int) None[source]

This function runs in a subprocess.

daklib.contents.source_helper(suite_id: int, component_id: int)[source]

This function is called in a new subprocess and multiprocessing wants a top level function.

daklib.contents.source_scan_helper(source_id: int) None[source]

This function runs in a subprocess.