daklib.policy

module to process policy queue uploads

Classes

PolicyQueueUploadHandler(upload, session)

process uploads to policy queues

UploadCopy(upload[, group])

export a policy queue upload

class daklib.policy.PolicyQueueUploadHandler(upload: PolicyQueueUpload, session)[source]

process uploads to policy queues

This class allows to accept or reject uploads and to get a list of missing overrides (for NEW processing).

_binary_override(name: str, binarytype, component_name: str) Override[source]
property _changes_prefix: str
property _overridesuite: Suite
_source_override(component_name: str) Override[source]
accept() None[source]

mark upload as accepted

add_overrides(new_overrides, suite: Suite) None[source]
get_action() Optional[str][source]

get current action

Returns:

string giving the current action, one of ‘ACCEPT’, ‘ACCEPTED’, ‘REJECT’

missing_overrides(hints: Optional[list[dict]] = None) list[dict][source]

get missing override entries for the upload

Parameters:

hints – suggested hints for new overrides in the same format as the return value

Returns:

list of dicts with the following keys:

  • package: package name

  • priority: default priority (from upload)

  • section: default section (from upload)

  • component: default component (from upload)

  • type: type of required override (‘dsc’, ‘deb’ or ‘udeb’)

All values are strings.

reject(reason: str) None[source]

mark upload as rejected

Parameters:

reason – reason for the rejection

class daklib.policy.UploadCopy(upload: PolicyQueueUpload, group: Optional[str] = None)[source]

export a policy queue upload

This class can be used in a with-statement:

with UploadCopy(...) as copy:
   ...

Doing so will provide a temporary copy of the upload in the directory given by the directory attribute. The copy will be removed on leaving the with-block.

export(directory: str, mode: Optional[int] = None, symlink: bool = True, ignore_existing: bool = False) None[source]

export a copy of the upload

Parameters:
  • directory – directory to export to

  • mode – permissions to use for the copied files

  • symlink – use symlinks instead of copying the files

  • ignore_existing – ignore already existing files