OSTree.RepoFinderResult

Fields

Name Type Access Description
finder OSTree.RepoFinder r/w the OSTree.RepoFinder instance which produced this result
padding [object] r  
priority int r/w static priority of the result, where higher numbers indicate lower priority
ref_to_checksum {OSTree.CollectionRef: str} r/w map of collection–ref pairs to checksums provided by this remote; values may be None to indicate this remote doesn’t provide that ref
ref_to_timestamp {OSTree.CollectionRef: int} r/w map of collection–ref pairs to timestamps; values may be 0 for various reasons
remote OSTree.Remote r/w OSTree.Remote which contains the transport details for the result, such as its URI and GPG key
summary_last_modified int r/w Unix timestamp (seconds since the epoch, UTC) when the summary file on the remote was last modified, or 0 if unknown

Methods

class freev (results)
class new (remote, finder, priority, ref_to_checksum, ref_to_timestamp, summary_last_modified)
  compare (b)
  dup ()
  free ()

Details

class OSTree.RepoFinderResult

OSTree.RepoFinderResult gives a single result from an OSTree.RepoFinder.resolve_async() or OSTree.RepoFinder.resolve_all_async() operation. This represents a single remote which provides none, some or all of the refs being resolved. The structure includes various bits of metadata which allow OSTree.Repo.pull_from_remotes_async() (for example) to prioritise how to pull the refs.

An OSTree.RepoFinderResult is immutable after construction.

The priority is used as one input of many to ordering functions like OSTree.RepoFinderResult.compare().

ref_to_checksum indicates which refs (out of the ones queried for as inputs to OSTree.RepoFinder.resolve_async()) are provided by this remote. The refs are present as keys (of type OSTree.CollectionRef), and the corresponding values are the checksums of the commits the remote currently has for those refs. (These might not be the latest commits available out of all results.) A checksum may be None if the remote does not advertise the corresponding ref. After OSTree.RepoFinder.resolve_async() has been called, the commit metadata should be available locally, so the details for each checksum can be looked up using OSTree.Repo.load_commit().

ref_to_timestamp provides timestamps for the set of refs in ref_to_checksum. The refs are keys (of type OSTree.CollectionRef) and the values are guint64 pointers with the timestamp associated with the checksum provided in ref_to_checksum. ref_to_timestamp can be None, and when it’s not, the timestamps are zero when any of the following conditions are met: (1) the override-commit-ids option was used on OSTree.Repo.find_remotes_async (2) there was an error in trying to get the commit metadata (3) the checksum for this ref is None in ref_to_checksum.

New in version 2018.6.

classmethod freev(results)
Parameters:results ([OSTree.RepoFinderResult]) – an OSTree.RepoFinderResult

Free the given results array, freeing each element and the container.

New in version 2018.6.

classmethod new(remote, finder, priority, ref_to_checksum, ref_to_timestamp, summary_last_modified)
Parameters:
  • remote (OSTree.Remote) – an OSTree.Remote containing the transport details for the result
  • finder (OSTree.RepoFinder) – the OSTree.RepoFinder instance which produced the result
  • priority (int) – static priority of the result, where higher numbers indicate lower priority
  • ref_to_checksum ({OSTree.CollectionRef: str}) – map of collection–ref pairs to checksums provided by this result
  • ref_to_timestamp ({OSTree.CollectionRef: int} or None) – map of collection–ref pairs to timestamps provided by this result
  • summary_last_modified (int) – Unix timestamp (seconds since the epoch, UTC) when the summary file for the result was last modified, or 0 if this is unknown
Returns:

a new OSTree.RepoFinderResult

Return type:

OSTree.RepoFinderResult

Create a new OSTree.RepoFinderResult instance. The semantics for the arguments are as described in the OSTree.RepoFinderResult documentation.

New in version 2018.6.

compare(b)
Parameters:b (OSTree.RepoFinderResult) – an OSTree.RepoFinderResult
Returns:<0 if self is ordered before b, 0 if they are ordered equally, >0 if b is ordered before self
Return type:int

Compare two OSTree.RepoFinderResult instances to work out which one is better to pull from, and hence needs to be ordered before the other.

New in version 2018.6.

dup()
Returns:a newly allocated copy of self
Return type:OSTree.RepoFinderResult

Copy an OSTree.RepoFinderResult.

New in version 2018.6.

free()

Free the given self.

New in version 2018.6.