Package entropy :: Package client :: Package interfaces :: Package package :: Module _content

Module _content

source code


Author: Fabio Erculiani <[email protected]>

Contact: [email protected]

Copyright: Fabio Erculiani

License: GPL-2

Entropy Package Manager Client Package Interface.

Classes
  FileContentReader
  FileContentWriter
  FileContentSafetyWriter
  FileContentSafetyReader
Functions
 
generate_content_safety_file(content_safety)
Generate a file containing the "content_safety" metadata, reading by content_safety list or iterator.
source code
 
generate_content_file(content, package_id=None, filter_splitdebug=False, splitdebug=None, splitdebug_dirs=None)
Generate a file containing the "content" metadata, reading by content list or iterator.
source code
 
merge_content_file(content_file, sorted_content, cmp_func)
Given a sorted content_file content and a sorted list of content (sorted_content), apply the "merge" step of a merge sort algorithm.
source code
 
filter_content_file(content_file, filter_func)
This method rewrites the content of content_file by applying a filter to the path elements.
source code
Variables
  __package__ = 'entropy.client.interfaces.package'
Function Details

generate_content_safety_file(content_safety)

source code 

Generate a file containing the "content_safety" metadata, reading by content_safety list or iterator. Each item of "content_safety" must contain (path, sha256, mtime). Each item shall be written to file, one per line, in the following form: "<mtime>|<sha256>|<path>". The order of the element in "content_safety" will be kept.

generate_content_file(content, package_id=None, filter_splitdebug=False, splitdebug=None, splitdebug_dirs=None)

source code 

Generate a file containing the "content" metadata, reading by content list or iterator. Each item of "content" must contain (path, ftype). Each item shall be written to file, one per line, in the following form: "[<package_id>|]<ftype>|<path>". The order of the element in "content" will be kept.

merge_content_file(content_file, sorted_content, cmp_func)

source code 

Given a sorted content_file content and a sorted list of content (sorted_content), apply the "merge" step of a merge sort algorithm. In other words, add the sorted_content to content_file keeping content_file content ordered. It is of couse O(n+m) where n = lines in content_file and m = sorted_content length.