gi-ostree-1.0.14: OSTree bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.OSTree.Objects.Repo

Contents

Description

No description available in the introspection data.

Synopsis

Exported types

newtype Repo Source #

Memory-managed wrapper type.

Constructors

Repo (ManagedPtr Repo) 

Instances

Instances details
Eq Repo Source # 
Instance details

Defined in GI.OSTree.Objects.Repo

Methods

(==) :: Repo -> Repo -> Bool #

(/=) :: Repo -> Repo -> Bool #

GObject Repo Source # 
Instance details

Defined in GI.OSTree.Objects.Repo

ManagedPtrNewtype Repo Source # 
Instance details

Defined in GI.OSTree.Objects.Repo

Methods

toManagedPtr :: Repo -> ManagedPtr Repo

TypedObject Repo Source # 
Instance details

Defined in GI.OSTree.Objects.Repo

Methods

glibType :: IO GType

HasParentTypes Repo Source # 
Instance details

Defined in GI.OSTree.Objects.Repo

IsGValue (Maybe Repo) Source #

Convert Repo to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.OSTree.Objects.Repo

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Repo -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Repo)

type ParentTypes Repo Source # 
Instance details

Defined in GI.OSTree.Objects.Repo

type ParentTypes Repo = '[Object]

class (GObject o, IsDescendantOf Repo o) => IsRepo o Source #

Type class for types which can be safely cast to Repo, for instance with toRepo.

Instances

Instances details
(GObject o, IsDescendantOf Repo o) => IsRepo o Source # 
Instance details

Defined in GI.OSTree.Objects.Repo

toRepo :: (MonadIO m, IsRepo o) => o -> m Repo Source #

Cast to Repo, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

abortTransaction, addGpgSignatureSummary, appendGpgSignature, bindProperty, bindPropertyFull, checkoutAt, checkoutGc, checkoutTree, commitTransaction, copyConfig, create, deleteObject, equal, findRemotesAsync, findRemotesFinish, forceFloating, freezeNotify, fsckObject, getv, gpgSignData, gpgVerifyData, hasObject, hash, importObjectFrom, importObjectFromWithTrust, isFloating, isSystem, isWritable, listCollectionRefs, listCommitObjectsStartingWith, listObjects, listRefs, listRefsExt, listStaticDeltaIndexes, listStaticDeltaNames, loadCommit, loadFile, loadObjectStream, loadVariant, loadVariantIfExists, markCommitPartial, markCommitPartialReason, notify, notifyByPspec, open, prepareTransaction, prune, pruneFromReachable, pruneStaticDeltas, pull, pullFromRemotesAsync, pullFromRemotesFinish, pullOneDir, pullWithOptions, queryObjectStorageSize, readCommit, readCommitDetachedMetadata, ref, refSink, regenerateSummary, reloadConfig, remoteAdd, remoteChange, remoteDelete, remoteFetchSummary, remoteFetchSummaryWithOptions, remoteGetGpgVerify, remoteGetGpgVerifySummary, remoteGetUrl, remoteGpgImport, remoteList, remoteListCollectionRefs, remoteListRefs, resolveCollectionRef, resolveKeyringForCollection, resolveRev, resolveRevExt, runDispose, scanHardlinks, signCommit, signDelta, staticDeltaExecuteOffline, staticDeltaExecuteOfflineWithSignature, staticDeltaGenerate, staticDeltaReindex, staticDeltaVerifySignature, stealData, stealQdata, thawNotify, transactionSetCollectionRef, transactionSetRef, transactionSetRefspec, traverseCommit, traverseReachableRefs, unref, verifyCommit, verifyCommitExt, verifyCommitForRemote, verifySummary, watchClosure, writeArchiveToMtree, writeArchiveToMtreeFromFd, writeCommit, writeCommitDetachedMetadata, writeCommitWithTime, writeConfig, writeContent, writeContentAsync, writeContentFinish, writeContentTrusted, writeDfdToMtree, writeDirectoryToMtree, writeMetadata, writeMetadataAsync, writeMetadataFinish, writeMetadataStreamTrusted, writeMetadataTrusted, writeMtree.

Getters

getBootloader, getCollectionId, getConfig, getData, getDefaultRepoFinders, getDfd, getDisableFsync, getMinFreeSpaceBytes, getMode, getParent, getPath, getProperty, getQdata, getRemoteBooleanOption, getRemoteListOption, getRemoteOption.

Setters

setAliasRefImmediate, setCacheDir, setCollectionId, setCollectionRefImmediate, setData, setDataFull, setDisableFsync, setProperty, setRefImmediate.

abortTransaction

repoAbortTransaction Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: An Repo

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Abort the active transaction; any staged objects and ref changes will be discarded. You *must* invoke this if you have chosen not to invoke repoCommitTransaction. Calling this function when not in a transaction will do nothing and return successfully.

addGpgSignatureSummary

repoAddGpgSignatureSummary Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Self

-> [Text]

keyId: NULL-terminated array of GPG keys.

-> Maybe Text

homedir: GPG home directory, or Nothing

-> Maybe b

cancellable: A Cancellable

-> m ()

(Can throw GError)

Add a GPG signature to a summary file.

appendGpgSignature

repoAppendGpgSignature Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Self

-> Text

commitChecksum: SHA256 of given commit to sign

-> Bytes

signatureBytes: Signature data

-> Maybe b

cancellable: A Cancellable

-> m ()

(Can throw GError)

Append a GPG signature to a commit.

checkoutAt

repoCheckoutAt Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Maybe RepoCheckoutAtOptions

options: Options

-> Int32

destinationDfd: Directory FD for destination

-> Text

destinationPath: Directory for destination

-> Text

commit: Checksum for commit

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Similar to repoCheckoutTree, but uses directory-relative paths for the destination, uses a new OstreeRepoCheckoutAtOptions, and takes a commit checksum and optional subpath pair, rather than requiring use of GFile APIs for the caller.

It also replaces repoCheckoutAt which was not safe to use with GObject introspection.

Note in addition that unlike repoCheckoutTree, the default is not to use the repository-internal uncompressed objects cache.

Since: 2016.8

checkoutGc

repoCheckoutGc Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Call this after finishing a succession of checkout operations; it will delete any currently-unused uncompressed objects from the cache.

checkoutTree

repoCheckoutTree Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsFile b, IsRepoFile c, IsFileInfo d, IsCancellable e) 
=> a

self: Repo

-> RepoCheckoutMode

mode: Options controlling all files

-> RepoCheckoutOverwriteMode

overwriteMode: Whether or not to overwrite files

-> b

destination: Place tree here

-> c

source: Source tree

-> d

sourceInfo: Source info

-> Maybe e

cancellable: Cancellable

-> m ()

(Can throw GError)

Check out source into destination, which must live on the physical filesystem. source may be any subdirectory of a given commit. The mode and overwriteMode allow control over how the files are checked out.

commitTransaction

repoCommitTransaction Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: An Repo

-> Maybe b

cancellable: Cancellable

-> m RepoTransactionStats

(Can throw GError)

Complete the transaction. Any refs set with repoTransactionSetRef or repoTransactionSetRefspec will be written out.

Note that if multiple threads are performing writes, all such threads must have terminated before this function is invoked.

Locking: Releases shared lock acquired by ostree_repo_prepare_transaction() Multithreading: This function is *not* MT safe; only one transaction can be active at a time.

copyConfig

repoCopyConfig Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a 
-> m KeyFile

Returns: A newly-allocated copy of the repository config

No description available in the introspection data.

create

repoCreate Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: An Repo

-> RepoMode

mode: The mode to store the repository in

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Create the underlying structure on disk for the repository, and call repoOpen on the result, preparing it for use.

Since version 2016.8, this function will succeed on an existing repository, and finish creating any necessary files in a partially created repository. However, this function cannot change the mode of an existing repository, and will silently ignore an attempt to do so.

Since 2017.9, "existing repository" is defined by the existence of an objects subdirectory.

This function predates repoCreateAt. It is an error to call this function on a repository initialized via repoOpenAt.

createAt

repoCreateAt Source #

Arguments

:: (HasCallStack, MonadIO m, IsCancellable a) 
=> Int32

dfd: Directory fd

-> Text

path: Path

-> RepoMode

mode: The mode to store the repository in

-> GVariant

options: a{sv}: See below for accepted keys

-> Maybe a

cancellable: Cancellable

-> m Repo

Returns: A new OSTree repository reference (Can throw GError)

This is a file-descriptor relative version of repoCreate. Create the underlying structure on disk for the repository, and call repoOpenAt on the result, preparing it for use.

If a repository already exists at dfd + path (defined by an objects/ subdirectory existing), then this function will simply call repoOpenAt. In other words, this function cannot be used to change the mode or configuration (repo/config) of an existing repo.

The options dict may contain:

  • collection-id: s: Set as collection ID in repo/config (Since 2017.9)

Since: 2017.10

deleteObject

repoDeleteObject Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Text

sha256: Checksum

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Remove the object of type objtype with checksum sha256 from the repository. An error of type IOErrorEnumNotFound is thrown if the object does not exist.

equal

repoEqual Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsRepo b) 
=> a

a: an Repo

-> b

b: an Repo

-> m Bool

Returns: True if a and b are the same repository on disk, False otherwise

Check whether two opened repositories are the same on disk: if their root directories are the same inode. If a or b are not open yet (due to repoOpen not being called on them yet), False will be returned.

Since: 2017.12

findRemotesAsync

repoFindRemotesAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b, IsCancellable c) 
=> a

self: an Repo

-> [CollectionRef]

refs: non-empty array of collection–ref pairs to find remotes for

-> Maybe GVariant

options: a GVariant a{sv} with an extensible set of flags

-> [RepoFinder]

finders: non-empty array of RepoFinder instances to use, or Nothing to use the system defaults

-> Maybe b

progress: an AsyncProgress to update with the operation’s progress, or Nothing

-> Maybe c

cancellable: a Cancellable, or Nothing

-> Maybe AsyncReadyCallback

callback: asynchronous completion callback

-> m () 

Find reachable remote URIs which claim to provide any of the given named refs. This will search for configured remotes (tRepoFinderConfig), mounted volumes (tRepoFinderMount) and (if enabled at compile time) local network peers (tRepoFinderAvahi). In order to use a custom configuration of RepoFinder instances, call repoFinderResolveAllAsync on them individually.

Any remote which is found and which claims to support any of the given refs will be returned in the results. It is possible that a remote claims to support a given ref, but turns out not to — it is not possible to verify this until repoPullFromRemotesAsync is called.

The returned results will be sorted with the most useful first — this is typically the remote which claims to provide the most of refs, at the lowest latency.

Each result contains a list of the subset of refs it claims to provide. It is possible for a non-empty list of results to be returned, but for some of refs to not be listed in any of the results. Callers must check for this.

Pass the results to repoPullFromRemotesAsync to pull the given refs from those remotes.

The following options are currently defined:

  • override-commit-ids (as): Array of specific commit IDs to fetch. The nth commit ID applies to the nth ref, so this must be the same length as refs, if provided.
  • n-network-retries (u): Number of times to retry each download on receiving a transient network error, such as a socket timeout; default is 5, 0 means return errors without retrying. Since: 2018.6

finders must be a non-empty Nothing-terminated array of the RepoFinder instances to use, or Nothing to use the system default set of finders, which will typically be all available finders using their default options (but this is not guaranteed).

GPG verification of commits will be used unconditionally.

This will use the thread-default MainContext, but will not iterate it.

Since: 2018.6

findRemotesFinish

repoFindRemotesFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsAsyncResult b) 
=> a

self: an Repo

-> b

result: the asynchronous result

-> m [RepoFinderResult]

Returns: a potentially empty array of OstreeRepoFinderResults, followed by a Nothing terminator element; or Nothing on error (Can throw GError)

Finish an asynchronous pull operation started with repoFindRemotesAsync.

Since: 2018.6

fsckObject

repoFsckObject Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Text

sha256: Checksum

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Verify consistency of the object; this performs checks only relevant to the immediate object itself, such as checksumming. This API call will not itself traverse metadata objects for example.

Since: 2017.15

getBootloader

repoGetBootloader Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: an Repo

-> m Text

Returns: bootloader configuration for the sysroot

Get the bootloader configured. See the documentation for the "sysroot.bootloader" config key.

Since: 2019.2

getCollectionId

repoGetCollectionId Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: an Repo

-> m (Maybe Text)

Returns: collection ID for the repository

Get the collection ID of this repository. See [collection IDs][collection-ids].

Since: 2018.6

getConfig

repoGetConfig Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a 
-> m KeyFile

Returns: The repository configuration; do not modify

No description available in the introspection data.

getDefaultRepoFinders

repoGetDefaultRepoFinders Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: an Repo

-> m [Text]

Returns: Nothing-terminated array of strings.

Get the set of default repo finders configured. See the documentation for the "core.default-repo-finders" config key.

Since: 2018.9

getDfd

repoGetDfd Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> m Int32

Returns: File descriptor for repository root - owned by self

In some cases it's useful for applications to access the repository directly; for example, writing content into repo/tmp ensures it's on the same filesystem. Another case is detecting the mtime on the repository (to see whether a ref was written).

Since: 2016.4

getDisableFsync

repoGetDisableFsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: An Repo

-> m Bool

Returns: Whether or not fsync() is enabled for this repo.

For more information see repoSetDisableFsync.

getMinFreeSpaceBytes

repoGetMinFreeSpaceBytes Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> m Word64

(Can throw GError)

Determine the number of bytes of free disk space that are reserved according to the repo config and return that number in outReservedBytes. See the documentation for the core.min-free-space-size and core.min-free-space-percent repo config options.

Since: 2018.9

getMode

repoGetMode :: (HasCallStack, MonadIO m, IsRepo a) => a -> m RepoMode Source #

No description available in the introspection data.

getParent

repoGetParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> m Repo

Returns: Parent repository, or Nothing if none

Before this function can be used, ostree_repo_init() must have been called.

getPath

repoGetPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> m File

Returns: Path to repo

Note that since the introduction of repoOpenAt, this function may return a process-specific path in /proc if the repository was created using that API. In general, you should avoid use of this API.

getRemoteBooleanOption

repoGetRemoteBooleanOption Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: A OstreeRepo

-> Text

remoteName: Name

-> Text

optionName: Option

-> Bool

defaultValue: Value returned if optionName is not present

-> m Bool

(Can throw GError)

OSTree remotes are represented by keyfile groups, formatted like: [remote "remotename"]. This function returns a value named optionName underneath that group, and returns it as a boolean. If the option is not set, outValue will be set to defaultValue. If an error is returned, outValue will be set to False.

Since: 2016.5

getRemoteListOption

repoGetRemoteListOption Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: A OstreeRepo

-> Text

remoteName: Name

-> Text

optionName: Option

-> m [Text]

(Can throw GError)

OSTree remotes are represented by keyfile groups, formatted like: [remote "remotename"]. This function returns a value named optionName underneath that group, and returns it as a zero terminated array of strings. If the option is not set, or if an error is returned, outValue will be set to Nothing.

Since: 2016.5

getRemoteOption

repoGetRemoteOption Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: A OstreeRepo

-> Text

remoteName: Name

-> Text

optionName: Option

-> Maybe Text

defaultValue: Value returned if optionName is not present

-> m Text

(Can throw GError)

OSTree remotes are represented by keyfile groups, formatted like: [remote "remotename"]. This function returns a value named optionName underneath that group, or defaultValue if the remote exists but not the option name. If an error is returned, outValue will be set to Nothing.

Since: 2016.5

gpgSignData

repoGpgSignData Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Self

-> Bytes

data: Data as a Bytes

-> Bytes

oldSignatures: Existing signatures to append to (or Nothing)

-> [Text]

keyId: NULL-terminated array of GPG keys.

-> Maybe Text

homedir: GPG home directory, or Nothing

-> Maybe b

cancellable: A Cancellable

-> m Bytes

(Can throw GError)

Sign the given data with the specified keys in keyId. Similar to repoAddGpgSignatureSummary but can be used on any data.

You can use repoGpgVerifyData to verify the signatures.

Since: 2020.8

gpgVerifyData

repoGpgVerifyData Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsFile b, IsFile c, IsCancellable d) 
=> a

self: Repository

-> Maybe Text

remoteName: Name of remote

-> Bytes

data: Data as a Bytes

-> Bytes

signatures: Signatures as a Bytes

-> Maybe b

keyringdir: Path to directory GPG keyrings; overrides built-in default if given

-> Maybe c

extraKeyring: Path to additional keyring file (not a directory)

-> Maybe d

cancellable: Cancellable

-> m GpgVerifyResult

Returns: an GpgVerifyResult, or Nothing on error (Can throw GError)

Verify signatures for data using GPG keys in the keyring for remoteName, and return an GpgVerifyResult.

The remoteName parameter can be Nothing. In that case it will do the verifications using GPG keys in the keyrings of all remotes.

Since: 2016.6

hasObject

repoHasObject Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Text

checksum: ASCII SHA256 checksum

-> Maybe b

cancellable: Cancellable

-> m Bool

(Can throw GError)

Set outHaveObject to True if self contains the given object; False otherwise.

hash

repoHash Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: an Repo

-> m Word32

Returns: hash value for the Repo

Calculate a hash value for the given open repository, suitable for use when putting it into a hash table. It is an error to call this on an Repo which is not yet open, as a persistent hash value cannot be calculated until the repository is open and the inode of its root directory has been loaded.

This function does no I/O.

Since: 2017.12

importObjectFrom

repoImportObjectFrom Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsRepo b, IsCancellable c) 
=> a

self: Destination repo

-> b

source: Source repo

-> ObjectType

objtype: Object type

-> Text

checksum: checksum

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Copy object named by objtype and checksum into self from the source repository source. If both repositories are of the same type and on the same filesystem, this will simply be a fast Unix hard link operation.

Otherwise, a copy will be performed.

importObjectFromWithTrust

repoImportObjectFromWithTrust Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsRepo b, IsCancellable c) 
=> a

self: Destination repo

-> b

source: Source repo

-> ObjectType

objtype: Object type

-> Text

checksum: checksum

-> Bool

trusted: If True, assume the source repo is valid and trusted

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Copy object named by objtype and checksum into self from the source repository source. If trusted is True and both repositories are of the same type and on the same filesystem, this will simply be a fast Unix hard link operation.

Otherwise, a copy will be performed.

Since: 2016.5

isSystem

repoIsSystem Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

repo: Repository

-> m Bool

Returns: True if this repository is the root-owned system global repository

No description available in the introspection data.

isWritable

repoIsWritable Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> m ()

(Can throw GError)

Returns whether the repository is writable by the current user. If the repository is not writable, the error indicates why.

listStaticDeltaIndexes

repoListStaticDeltaIndexes Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Maybe b

cancellable: Cancellable

-> m [Text]

(Can throw GError)

This function synchronously enumerates all static delta indexes in the repository, returning its result in outIndexes.

Since: 2020.7

listStaticDeltaNames

repoListStaticDeltaNames Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Maybe b

cancellable: Cancellable

-> m [Text]

(Can throw GError)

This function synchronously enumerates all static deltas in the repository, returning its result in outDeltas.

loadCommit

repoLoadCommit Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> Text

checksum: Commit checksum

-> m (GVariant, [RepoCommitState])

(Can throw GError)

A version of repoLoadVariant specialized to commits, capable of returning extended state information. Currently the only extended state is RepoCommitStatePartial, which means that only a sub-path of the commit is available.

loadFile

repoLoadFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Text

checksum: ASCII SHA256 checksum

-> Maybe b

cancellable: Cancellable

-> m (Maybe InputStream, Maybe FileInfo, Maybe GVariant)

(Can throw GError)

Load content object, decomposing it into three parts: the actual content (for regular files), the metadata, and extended attributes.

loadObjectStream

repoLoadObjectStream Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Text

checksum: ASCII SHA256 checksum

-> Maybe b

cancellable: Cancellable

-> m (InputStream, Word64)

(Can throw GError)

Load object as a stream; useful when copying objects between repositories.

loadVariant

repoLoadVariant Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> ObjectType

objtype: Expected object type

-> Text

sha256: Checksum string

-> m GVariant

(Can throw GError)

Load the metadata object sha256 of type objtype, storing the result in outVariant.

loadVariantIfExists

repoLoadVariantIfExists Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Text

sha256: ASCII checksum

-> m GVariant

(Can throw GError)

Attempt to load the metadata object sha256 of type objtype if it exists, storing the result in outVariant. If it doesn't exist, Nothing is returned.

markCommitPartial

repoMarkCommitPartial Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> Text

checksum: Commit SHA-256

-> Bool

isPartial: Whether or not this commit is partial

-> m ()

(Can throw GError)

Commits in the "partial" state do not have all their child objects written. This occurs in various situations, such as during a pull, but also if a "subpath" pull is used, as well as "commit only" pulls.

This function is used by repoPullWithOptions; you should use this if you are implementing a different type of transport.

Since: 2017.15

markCommitPartialReason

repoMarkCommitPartialReason Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> Text

checksum: Commit SHA-256

-> Bool

isPartial: Whether or not this commit is partial

-> [RepoCommitState]

inState: Reason bitmask for partial commit

-> m ()

(Can throw GError)

Allows the setting of a reason code for a partial commit. Presently it only supports setting reason bitmask to OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL, or OSTREE_REPO_COMMIT_STATE_NORMAL. This will allow successive ostree fsck operations to exit properly with an error code if the repository has been truncated as a result of fsck trying to repair it.

Since: 2019.4

modeFromString

repoModeFromString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

mode: a repo mode as a string

-> m RepoMode

(Can throw GError)

No description available in the introspection data.

new

repoNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a) 
=> a

path: Path to a repository

-> m Repo

Returns: An accessor object for an OSTree repository located at path

No description available in the introspection data.

newDefault

repoNewDefault Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Repo

Returns: An accessor object for an OSTree repository located at /ostree/repo

If the current working directory appears to be an OSTree repository, create a new Repo object for accessing it. Otherwise use the path in the OSTREE_REPO environment variable (if defined) or else the default system repository located at /ostree/repo.

newForSysrootPath

repoNewForSysrootPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a, IsFile b) 
=> a

repoPath: Path to a repository

-> b

sysrootPath: Path to the system root

-> m Repo

Returns: An accessor object for the OSTree repository located at repoPath.

Creates a new Repo instance, taking the system root path explicitly instead of assuming "/".

open

repoOpen Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a 
-> Maybe b 
-> m ()

(Can throw GError)

No description available in the introspection data.

openAt

repoOpenAt Source #

Arguments

:: (HasCallStack, MonadIO m, IsCancellable a) 
=> Int32

dfd: Directory fd

-> Text

path: Path

-> Maybe a 
-> m Repo

Returns: An accessor object for an OSTree repository located at dfd + path (Can throw GError)

This combines repoNew (but using fd-relative access) with repoOpen. Use this when you know you should be operating on an already extant repository. If you want to create one, use repoCreateAt.

Since: 2017.10

prepareTransaction

repoPrepareTransaction Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: An Repo

-> Maybe b

cancellable: Cancellable

-> m Bool

(Can throw GError)

Starts or resumes a transaction. In order to write to a repo, you need to start a transaction. You can complete the transaction with repoCommitTransaction, or abort the transaction with repoAbortTransaction.

Currently, transactions may result in partial commits or data in the target repository if interrupted during repoCommitTransaction, and further writing refs is also not currently atomic.

There can be at most one transaction active on a repo at a time per instance of OstreeRepo; however, it is safe to have multiple threads writing objects on a single OstreeRepo instance as long as their lifetime is bounded by the transaction.

Locking: Acquires a shared lock; release via commit or abort Multithreading: This function is *not* MT safe; only one transaction can be active at a time.

prune

repoPrune Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> [RepoPruneFlags]

flags: Options controlling prune process

-> Int32

depth: Stop traversal after this many iterations (-1 for unlimited)

-> Maybe b

cancellable: Cancellable

-> m (Int32, Int32, Word64)

(Can throw GError)

Delete content from the repository. By default, this function will only delete "orphaned" objects not referred to by any commit. This can happen during a local commit operation, when we have written content objects but not saved the commit referencing them.

However, if RepoPruneFlagsRefsOnly is provided, instead of traversing all commits, only refs will be used. Particularly when combined with depth, this is a convenient way to delete history from the repository.

Use the RepoPruneFlagsNoPrune to just determine statistics on objects that would be deleted, without actually deleting them.

Locking: exclusive

pruneFromReachable

repoPruneFromReachable Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> RepoPruneOptions

options: Options controlling prune process

-> Maybe b

cancellable: Cancellable

-> m (Int32, Int32, Word64)

(Can throw GError)

Delete content from the repository. This function is the "backend" half of the higher level repoPrune. To use this function, you determine the root set yourself, and this function finds all other unreferenced objects and deletes them.

Use this API when you want to perform more selective pruning - for example, retain all commits from a production branch, but just GC some history from your dev branch.

The RepoPruneFlagsNoPrune flag may be specified to just determine statistics on objects that would be deleted, without actually deleting them.

Locking: exclusive

Since: 2017.1

pruneStaticDeltas

repoPruneStaticDeltas Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Maybe Text

commit: ASCII SHA256 checksum for commit, or Nothing for each non existing commit

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Prune static deltas, if COMMIT is specified then delete static delta files only targeting that commit; otherwise any static delta of non existing commits are deleted.

Locking: exclusive

pull

repoPull Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b, IsCancellable c) 
=> a

self: Repo

-> Text

remoteName: Name of remote

-> Maybe [Text]

refsToFetch: Optional list of refs; if Nothing, fetch all configured refs

-> [RepoPullFlags]

flags: Options controlling fetch behavior

-> Maybe b

progress: Progress

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Connect to the remote repository, fetching the specified set of refs refsToFetch. For each ref that is changed, download the commit, all metadata, and all content objects, storing them safely on disk in self.

If flags contains RepoPullFlagsMirror, and the refsToFetch is Nothing, and the remote repository contains a summary file, then all refs will be fetched.

If flags contains RepoPullFlagsCommitOnly, then only the metadata for the commits in refsToFetch is pulled.

Warning: This API will iterate the thread default main context, which is a bug, but kept for compatibility reasons. If you want to avoid this, use mainContextPushThreadDefault to push a new one around this call.

pullDefaultConsoleProgressChanged

repoPullDefaultConsoleProgressChanged Source #

Arguments

:: (HasCallStack, MonadIO m, IsAsyncProgress a) 
=> a

progress: Async progress

-> Ptr ()

userData: User data

-> m () 

Convenient "changed" callback for use with asyncProgressNewAndConnect when pulling from a remote repository.

Depending on the state of the AsyncProgress, either displays a custom status message, or else outstanding fetch progress in bytes/sec, or else outstanding content or metadata writes to the repository in number of objects.

Compatibility note: this function previously assumed that userData was a pointer to a GSConsole instance. This is no longer the case, and userData is ignored.

pullFromRemotesAsync

repoPullFromRemotesAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b, IsCancellable c) 
=> a

self: an Repo

-> [RepoFinderResult]

results: Nothing-terminated array of remotes to pull from, including the refs to pull from each

-> Maybe GVariant

options: A GVariant a{sv} with an extensible set of flags

-> Maybe b

progress: an AsyncProgress to update with the operation’s progress, or Nothing

-> Maybe c

cancellable: a Cancellable, or Nothing

-> Maybe AsyncReadyCallback

callback: asynchronous completion callback

-> m () 

Pull refs from multiple remotes which have been found using repoFindRemotesAsync.

results are expected to be in priority order, with the best remotes to pull from listed first. repoPullFromRemotesAsync will generally pull from the remotes in order, but may parallelise its downloads.

If an error is encountered when pulling from a given remote, that remote will be ignored and another will be tried instead. If any refs have not been downloaded successfully after all remotes have been tried, IOErrorEnumFailed will be returned. The results of any successful downloads will remain cached in the local repository.

If cancellable is cancelled, IOErrorEnumCancelled will be returned immediately. The results of any successfully completed downloads at that point will remain cached in the local repository.

GPG verification of commits will be used unconditionally.

The following options are currently defined:

  • flags (i): RepoPullFlags to apply to the pull operation
  • inherit-transaction (b): True to inherit an ongoing transaction on the Repo, rather than encapsulating the pull in a new one
  • depth (i): How far in the history to traverse; default is 0, -1 means infinite
  • disable-static-deltas (b): Do not use static deltas
  • http-headers (a(ss)): Additional headers to add to all HTTP requests
  • subdirs (as): Pull just these subdirectories
  • update-frequency (u): Frequency to call the async progress callback in milliseconds, if any; only values higher than 0 are valid
  • append-user-agent (s): Additional string to append to the user agent
  • n-network-retries (u): Number of times to retry each download on receiving a transient network error, such as a socket timeout; default is 5, 0 means return errors without retrying. Since: 2018.6
  • ref-keyring-map (a(sss)): Array of (collection ID, ref name, keyring remote name) tuples specifying which remote's keyring should be used when doing GPG verification of each collection-ref. This is useful to prevent a remote from serving malicious updates to refs which did not originate from it. This can be a subset or superset of the refs being pulled; any ref not being pulled will be ignored and any ref without a keyring remote will be verified with the keyring of the remote being pulled from. Since: 2019.2

Since: 2018.6

pullFromRemotesFinish

repoPullFromRemotesFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsAsyncResult b) 
=> a

self: an Repo

-> b

result: the asynchronous result

-> m ()

(Can throw GError)

Finish an asynchronous pull operation started with repoPullFromRemotesAsync.

Since: 2018.6

pullOneDir

repoPullOneDir Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b, IsCancellable c) 
=> a

self: Repo

-> Text

remoteName: Name of remote

-> Text

dirToPull: Subdirectory path

-> Maybe [Text]

refsToFetch: Optional list of refs; if Nothing, fetch all configured refs

-> [RepoPullFlags]

flags: Options controlling fetch behavior

-> Maybe b

progress: Progress

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

This is similar to repoPull, but only fetches a single subpath.

pullWithOptions

repoPullWithOptions Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsAsyncProgress b, IsCancellable c) 
=> a

self: Repo

-> Text

remoteNameOrBaseurl: Name of remote or file:// url

-> GVariant

options: A GVariant a{sv} with an extensible set of flags.

-> Maybe b

progress: Progress

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Like repoPull, but supports an extensible set of flags. The following are currently defined:

  • refs (as): Array of string refs
  • collection-refs (a(sss)): Array of (collection ID, ref name, checksum) tuples to pull; mutually exclusive with refs and override-commit-ids. Checksums may be the empty string to pull the latest commit for that ref
  • flags (i): An instance of RepoPullFlags
  • subdir (s): Pull just this subdirectory
  • subdirs (as): Pull just these subdirectories
  • override-remote-name (s): If local, add this remote to refspec
  • gpg-verify (b): GPG verify commits
  • gpg-verify-summary (b): GPG verify summary
  • disable-sign-verify (b): Disable signapi verification of commits
  • disable-sign-verify-summary (b): Disable signapi verification of the summary
  • depth (i): How far in the history to traverse; default is 0, -1 means infinite
  • per-object-fsync (b): Perform disk writes more slowly, avoiding a single large I/O sync
  • disable-static-deltas (b): Do not use static deltas
  • require-static-deltas (b): Require static deltas
  • override-commit-ids (as): Array of specific commit IDs to fetch for refs
  • timestamp-check (b): Verify commit timestamps are newer than current (when pulling via ref); Since: 2017.11
  • timestamp-check-from-rev (s): Verify that all fetched commit timestamps are newer than timestamp of given rev; Since: 2020.4
  • metadata-size-restriction (t): Restrict metadata objects to a maximum number of bytes; 0 to disable. Since: 2018.9
  • dry-run (b): Only print information on what will be downloaded (requires static deltas)
  • override-url (s): Fetch objects from this URL if remote specifies no metalink in options
  • inherit-transaction (b): Don't initiate, finish or abort a transaction, useful to do multiple pulls in one transaction.
  • http-headers (a(ss)): Additional headers to add to all HTTP requests
  • update-frequency (u): Frequency to call the async progress callback in milliseconds, if any; only values higher than 0 are valid
  • localcache-repos (as): File paths for local repos to use as caches when doing remote fetches
  • append-user-agent (s): Additional string to append to the user agent
  • n-network-retries (u): Number of times to retry each download on receiving a transient network error, such as a socket timeout; default is 5, 0 means return errors without retrying. Since: 2018.6
  • ref-keyring-map (a(sss)): Array of (collection ID, ref name, keyring remote name) tuples specifying which remote's keyring should be used when doing GPG verification of each collection-ref. This is useful to prevent a remote from serving malicious updates to refs which did not originate from it. This can be a subset or superset of the refs being pulled; any ref not being pulled will be ignored and any ref without a keyring remote will be verified with the keyring of the remote being pulled from. Since: 2019.2
  • summary-bytes (ay'): Contents of the summary file to use. If this is specified, summary-sig-bytes must also be specified. This is useful if doing multiple pull operations in a transaction, using ostree_repo_remote_fetch_summary_with_options() beforehand to download the summary and summary.sig once for the entire transaction. If not specified, the summary@ will be downloaded from the remote. Since: 2020.5
  • summary-sig-bytes (ay): Contents of the summary.sig file. If this is specified, @summary-bytes` must also be specified. Since: 2020.5

queryObjectStorageSize

repoQueryObjectStorageSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Text

sha256: Checksum

-> Maybe b

cancellable: Cancellable

-> m Word64

(Can throw GError)

Return the size in bytes of object with checksum sha256, after any compression has been applied.

readCommit

repoReadCommit Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Text

ref: Ref or ASCII checksum

-> Maybe b

cancellable: Cancellable

-> m (File, Text)

(Can throw GError)

Load the content for rev into outRoot.

readCommitDetachedMetadata

repoReadCommitDetachedMetadata Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Text

checksum: ASCII SHA256 commit checksum

-> Maybe b

cancellable: Cancellable

-> m GVariant

(Can throw GError)

OSTree commits can have arbitrary metadata associated; this function retrieves them. If none exists, outMetadata will be set to Nothing.

regenerateSummary

repoRegenerateSummary Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Maybe GVariant

additionalMetadata: A GVariant of type a{sv}, or Nothing

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

An OSTree repository can contain a high level "summary" file that describes the available branches and other metadata.

If the timetable for making commits and updating the summary file is fairly regular, setting the ostree.summary.expires key in additionalMetadata will aid clients in working out when to check for updates.

It is regenerated automatically after any ref is added, removed, or updated if core/auto-update-summary is set.

If the core/collection-id key is set in the configuration, it will be included as OSTREE_SUMMARY_COLLECTION_ID in the summary file. Refs that have associated collection IDs will be included in the generated summary file, listed under the OSTREE_SUMMARY_COLLECTION_MAP key. Collection IDs and refs in OSTREE_SUMMARY_COLLECTION_MAP are guaranteed to be in lexicographic order.

Locking: exclusive

reloadConfig

repoReloadConfig Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: repo

-> Maybe b

cancellable: cancellable

-> m ()

(Can throw GError)

By default, an Repo will cache the remote configuration and its own repo/config data. This API can be used to reload it.

Since: 2017.2

remoteAdd

repoRemoteAdd Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Text

name: Name of remote

-> Text

url: URL for remote (if URL begins with metalink=, it will be used as such)

-> Maybe GVariant

options: GVariant of type a{sv}

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Create a new remote named name pointing to url. If options is provided, then it will be mapped to KeyFile entries, where the GVariant dictionary key is an option string, and the value is mapped as follows: * s: keyFileSetString * b: keyFileSetBoolean * as: keyFileSetStringList

remoteChange

repoRemoteChange Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsFile b, IsCancellable c) 
=> a

self: Repo

-> Maybe b

sysroot: System root

-> RepoRemoteChange

changeop: Operation to perform

-> Text

name: Name of remote

-> Text

url: URL for remote (if URL begins with metalink=, it will be used as such)

-> Maybe GVariant

options: GVariant of type a{sv}

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

A combined function handling the equivalent of repoRemoteAdd, repoRemoteDelete, with more options.

remoteDelete

repoRemoteDelete Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Text

name: Name of remote

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Delete the remote named name. It is an error if the provided remote does not exist.

remoteFetchSummary

repoRemoteFetchSummary Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Self

-> Text

name: name of a remote

-> Maybe b

cancellable: a Cancellable

-> m (Bytes, Bytes)

(Can throw GError)

Tries to fetch the summary file and any GPG signatures on the summary file over HTTP, and returns the binary data in outSummary and outSignatures respectively.

If no summary file exists on the remote server, outSummary is set to nULL. Likewise if the summary file is not signed, outSignatures is set to nULL. In either case the function still returns True.

This method does not verify the signature of the downloaded summary file. Use repoVerifySummary for that.

Parse the summary data into a GVariant using variantNewFromBytes with OSTREE_SUMMARY_GVARIANT_FORMAT as the format string.

remoteFetchSummaryWithOptions

repoRemoteFetchSummaryWithOptions Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Self

-> Text

name: name of a remote

-> Maybe GVariant

options: A GVariant a{sv} with an extensible set of flags

-> Maybe b

cancellable: a Cancellable

-> m (Bytes, Bytes)

(Can throw GError)

Like repoRemoteFetchSummary, but supports an extensible set of flags. The following are currently defined:

  • override-url (s): Fetch summary from this URL if remote specifies no metalink in options
  • http-headers (a(ss)): Additional headers to add to all HTTP requests
  • append-user-agent (s): Additional string to append to the user agent
  • n-network-retries (u): Number of times to retry each download on receiving a transient network error, such as a socket timeout; default is 5, 0 means return errors without retrying

Since: 2016.6

remoteGetGpgVerify

repoRemoteGetGpgVerify Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> Text

name: Name of remote

-> m Bool

(Can throw GError)

Return whether GPG verification is enabled for the remote named name through outGpgVerify. It is an error if the provided remote does not exist.

remoteGetGpgVerifySummary

repoRemoteGetGpgVerifySummary Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> Text

name: Name of remote

-> m Bool

(Can throw GError)

Return whether GPG verification of the summary is enabled for the remote named name through outGpgVerifySummary. It is an error if the provided remote does not exist.

remoteGetUrl

repoRemoteGetUrl Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> Text

name: Name of remote

-> m Text

(Can throw GError)

Return the URL of the remote named name through outUrl. It is an error if the provided remote does not exist.

remoteGpgImport

repoRemoteGpgImport Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsInputStream b, IsCancellable c) 
=> a

self: Self

-> Text

name: name of a remote

-> Maybe b

sourceStream: a InputStream, or Nothing

-> Maybe [Text]

keyIds: a Nothing-terminated array of GPG key IDs, or Nothing

-> Maybe c

cancellable: a Cancellable

-> m Word32

(Can throw GError)

Imports one or more GPG keys from the open sourceStream, or from the user's personal keyring if sourceStream is Nothing. The keyIds array can optionally restrict which keys are imported. If keyIds is Nothing, then all keys are imported.

The imported keys will be used to conduct GPG verification when pulling from the remote named name.

remoteList

repoRemoteList Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> m [Text]

Returns: a Nothing-terminated array of remote names

List available remote names in an Repo. Remote names are sorted alphabetically. If no remotes are available the function returns Nothing.

resolveCollectionRef

repoResolveCollectionRef Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: an Repo

-> CollectionRef

ref: a collection–ref to resolve

-> Bool

allowNoent: True to not throw an error if ref doesn’t exist

-> [RepoResolveRevExtFlags]

flags: options controlling behaviour

-> Maybe b

cancellable: a Cancellable, or Nothing

-> m (Maybe Text)

(Can throw GError)

Look up the checksum for the given collection–ref, returning it in outRev. This will search through the mirrors and remote refs.

If allowNoent is True and the given ref cannot be found, True will be returned and outRev will be set to Nothing. If allowNoent is False and the given ref cannot be found, a IOErrorEnumNotFound error will be returned.

If you want to check only local refs, not remote or mirrored ones, use the flag RepoResolveRevExtFlagsLocalOnly. This is analogous to using repoResolveRevExt but for collection-refs.

Since: 2018.6

resolveKeyringForCollection

repoResolveKeyringForCollection Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: an Repo

-> Text

collectionId: the collection ID to look up a keyring for

-> Maybe b

cancellable: a Cancellable, or Nothing

-> m Remote

Returns: Remote containing the GPG keyring for collectionId (Can throw GError)

Find the GPG keyring for the given collectionId, using the local configuration from the given Repo. This will search the configured remotes for ones whose collection-id key matches collectionId, and will return the first matching remote.

If multiple remotes match and have different keyrings, a debug message will be emitted, and the first result will be returned. It is expected that the keyrings should match.

If no match can be found, a IOErrorEnumNotFound error will be returned.

Since: 2018.6

resolveRev

repoResolveRev Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> Text

refspec: A refspec

-> Bool

allowNoent: Do not throw an error if refspec does not exist

-> m Text

(Can throw GError)

Look up the given refspec, returning the checksum it references in the parameter outRev. Will fall back on remote directory if cannot find the given refspec in local.

resolveRevExt

repoResolveRevExt Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> Text

refspec: A refspec

-> Bool

allowNoent: Do not throw an error if refspec does not exist

-> [RepoResolveRevExtFlags]

flags: Options controlling behavior

-> m Text

(Can throw GError)

Look up the given refspec, returning the checksum it references in the parameter outRev. Differently from repoResolveRev, this will not fall back to searching through remote repos if a local ref is specified but not found.

The flag RepoResolveRevExtFlagsLocalOnly is implied so using it has no effect.

Since: 2016.7

scanHardlinks

repoScanHardlinks Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: An Repo

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

This function is deprecated in favor of using repoDevInoCacheNew, which allows a precise mapping to be built up between hardlink checkout files and their checksums between ostree_repo_checkout_at() and ostree_repo_write_directory_to_mtree().

When invoking repoWriteDirectoryToMtree, it has to compute the checksum of all files. If your commit contains hardlinks from a checkout, this functions builds a mapping of device numbers and inodes to their checksum.

There is an upfront cost to creating this mapping, as this will scan the entire objects directory. If your commit is composed of mostly hardlinks to existing ostree objects, then this will speed up considerably, so call it before you call repoWriteDirectoryToMtree or similar. However, repoDevInoCacheNew is better as it avoids scanning all objects.

Multithreading: This function is *not* MT safe.

setAliasRefImmediate

repoSetAliasRefImmediate Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: An Repo

-> Maybe Text

remote: A remote for the ref

-> Text

ref: The ref to write

-> Maybe Text

target: The ref target to point it to, or Nothing to unset

-> Maybe b

cancellable: GCancellable

-> m ()

(Can throw GError)

Like repoSetRefImmediate, but creates an alias.

Since: 2017.10

setCacheDir

repoSetCacheDir Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: An Repo

-> Int32

dfd: directory fd

-> Text

path: subpath in dfd

-> Maybe b

cancellable: a Cancellable

-> m ()

(Can throw GError)

Set a custom location for the cache directory used for e.g. per-remote summary caches. Setting this manually is useful when doing operations on a system repo as a user because you don't have write permissions in the repo, where the cache is normally stored.

Since: 2016.5

setCollectionId

repoSetCollectionId Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: an Repo

-> Maybe Text

collectionId: new collection ID, or Nothing to unset it

-> m ()

(Can throw GError)

Set or clear the collection ID of this repository. See [collection IDs][collection-ids]. The update will be made in memory, but must be written out to the repository configuration on disk using repoWriteConfig.

Since: 2018.6

setCollectionRefImmediate

repoSetCollectionRefImmediate Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: An Repo

-> CollectionRef

ref: The collection–ref to write

-> Maybe Text

checksum: The checksum to point it to, or Nothing to unset

-> Maybe b

cancellable: GCancellable

-> m ()

(Can throw GError)

This is like repoTransactionSetCollectionRef, except it may be invoked outside of a transaction. This is presently safe for the case where we're creating or overwriting an existing ref.

Since: 2018.6

setDisableFsync

repoSetDisableFsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: An Repo

-> Bool

disableFsync: If True, do not fsync

-> m () 

Disable requests to fsync() to stable storage during commits. This option should only be used by build system tools which are creating disposable virtual machines, or have higher level mechanisms for ensuring data consistency.

setRefImmediate

repoSetRefImmediate Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: An Repo

-> Maybe Text

remote: A remote for the ref

-> Text

ref: The ref to write

-> Maybe Text

checksum: The checksum to point it to, or Nothing to unset

-> Maybe b

cancellable: GCancellable

-> m ()

(Can throw GError)

This is like repoTransactionSetRef, except it may be invoked outside of a transaction. This is presently safe for the case where we're creating or overwriting an existing ref.

Multithreading: This function is MT safe.

signCommit

repoSignCommit Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Self

-> Text

commitChecksum: SHA256 of given commit to sign

-> Text

keyId: Use this GPG key id

-> Maybe Text

homedir: GPG home directory, or Nothing

-> Maybe b

cancellable: A Cancellable

-> m ()

(Can throw GError)

Add a GPG signature to a commit.

signDelta

repoSignDelta Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Self

-> Text

fromCommit: From commit

-> Text

toCommit: To commit

-> Text

keyId: key id

-> Text

homedir: homedir

-> Maybe b

cancellable: cancellable

-> m ()

(Can throw GError)

This function is deprecated, sign the summary file instead. Add a GPG signature to a static delta.

staticDeltaExecuteOffline

repoStaticDeltaExecuteOffline Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsFile b, IsCancellable c) 
=> a

self: Repo

-> b

dirOrFile: Path to a directory containing static delta data, or directly to the superblock

-> Bool

skipValidation: If True, assume data integrity

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Given a directory representing an already-downloaded static delta on disk, apply it, generating a new commit. The directory must be named with the form "FROM-TO", where both are checksums, and it must contain a file named "superblock", along with at least one part.

staticDeltaExecuteOfflineWithSignature

repoStaticDeltaExecuteOfflineWithSignature Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsFile b, IsSign c, IsCancellable d) 
=> a

self: Repo

-> b

dirOrFile: Path to a directory containing static delta data, or directly to the superblock

-> c

sign: Signature engine used to check superblock

-> Bool

skipValidation: If True, assume data integrity

-> Maybe d

cancellable: Cancellable

-> m ()

(Can throw GError)

Given a directory representing an already-downloaded static delta on disk, apply it, generating a new commit. If sign is passed, the static delta signature is verified. If sign-verify-deltas configuration option is set and static delta is signed, signature verification will be mandatory before apply the static delta. The directory must be named with the form "FROM-TO", where both are checksums, and it must contain a file named "superblock", along with at least one part.

Since: 2020.7

staticDeltaGenerate

repoStaticDeltaGenerate Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> StaticDeltaGenerateOpt

opt: High level optimization choice

-> Maybe Text

from: ASCII SHA256 checksum of origin, or Nothing

-> Text

to: ASCII SHA256 checksum of target

-> Maybe GVariant

metadata: Optional metadata

-> Maybe GVariant

params: Parameters, see below

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Generate a lookaside "static delta" from from (Nothing means from-empty) which can generate the objects in to. This delta is an optimization over fetching individual objects, and can be conveniently stored and applied offline.

The params argument should be an a{sv}. The following attributes are known: - min-fallback-size: u: Minimum uncompressed size in megabytes to use fallback, 0 to disable fallbacks - max-chunk-size: u: Maximum size in megabytes of a delta part - max-bsdiff-size: u: Maximum size in megabytes to consider bsdiff compression for input files - compression: y: Compression type: 0=none, x=lzma, g=gzip - bsdiff-enabled: b: Enable bsdiff compression. Default TRUE. - inline-parts: b: Put part data in header, to get a single file delta. Default FALSE. - verbose: b: Print diagnostic messages. Default FALSE. - endianness: b: Deltas use host byte order by default; this option allows choosing (G_BIG_ENDIAN or G_LITTLE_ENDIAN) - filename: ay: Save delta superblock to this filename, and parts in the same directory. Default saves to repository. - sign-name: ay: Signature type to use. - sign-key-ids: as: Array of keys used to sign delta superblock.

staticDeltaReindex

repoStaticDeltaReindex Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

repo: Repo

-> StaticDeltaIndexFlags

flags: Flags affecting the indexing operation

-> Text

optToCommit: ASCII SHA256 checksum of target commit, or Nothing to index all targets

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

The delta index for a particular commit lists all the existing deltas that can be used when downloading that commit. This operation regenerates these indexes, either for a particular commit (if optToCommit is non-Nothing), or for all commits that are reachable by an existing delta (if optToCommit is Nothing).

This is normally called automatically when the summary is updated in repoRegenerateSummary.

Locking: shared

staticDeltaVerifySignature

repoStaticDeltaVerifySignature Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsSign b) 
=> a

self: Repo

-> Text

deltaId: delta path

-> b

sign: Signature engine used to check superblock

-> m (Maybe Text)

(Can throw GError)

Verify static delta file signature.

Since: 2020.7

transactionSetCollectionRef

repoTransactionSetCollectionRef Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: An Repo

-> CollectionRef

ref: The collection–ref to write

-> Maybe Text

checksum: The checksum to point it to

-> m () 

If checksum is not Nothing, then record it as the target of local ref named ref.

Otherwise, if checksum is Nothing, then record that the ref should be deleted.

The change will not be written out immediately, but when the transaction is completed with repoCommitTransaction. If the transaction is instead aborted with repoAbortTransaction, no changes will be made to the repository.

Multithreading: Since v2017.15 this function is MT safe.

Since: 2018.6

transactionSetRef

repoTransactionSetRef Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: An Repo

-> Maybe Text

remote: A remote for the ref

-> Text

ref: The ref to write

-> Maybe Text

checksum: The checksum to point it to

-> m () 

If checksum is not Nothing, then record it as the target of ref named ref; if remote is provided, the ref will appear to originate from that remote.

Otherwise, if checksum is Nothing, then record that the ref should be deleted.

The change will be written when the transaction is completed with repoCommitTransaction; that function takes care of writing all of the objects (such as the commit referred to by checksum) before updating the refs. If the transaction is instead aborted with repoAbortTransaction, no changes to the ref will be made to the repository.

Note however that currently writing *multiple* refs is not truly atomic; if the process or system is terminated during repoCommitTransaction, it is possible that just some of the refs will have been updated. Your application should take care to handle this case.

Multithreading: Since v2017.15 this function is MT safe.

transactionSetRefspec

repoTransactionSetRefspec Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: An Repo

-> Text

refspec: The refspec to write

-> Maybe Text

checksum: The checksum to point it to

-> m () 

Like repoTransactionSetRef, but takes concatenated refspec format as input instead of separate remote and name arguments.

Multithreading: Since v2017.15 this function is MT safe.

traverseParentsGetCommits

repoTraverseParentsGetCommits Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Map (Ptr ()) (Ptr ()) 
-> GVariant 
-> m [Text]

Returns: An array of checksums for the commits the key belongs to.

Gets all the commits that a certain object belongs to, as recorded by a parents table gotten from ostree_repo_traverse_commit_union_with_parents.

Since: 2018.5

verifyCommit

repoVerifyCommit Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsFile b, IsFile c, IsCancellable d) 
=> a

self: Repository

-> Text

commitChecksum: ASCII SHA256 checksum

-> Maybe b

keyringdir: Path to directory GPG keyrings; overrides built-in default if given

-> Maybe c

extraKeyring: Path to additional keyring file (not a directory)

-> Maybe d

cancellable: Cancellable

-> m ()

(Can throw GError)

Check for a valid GPG signature on commit named by the ASCII checksum commitChecksum.

verifyCommitExt

repoVerifyCommitExt Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsFile b, IsFile c, IsCancellable d) 
=> a

self: Repository

-> Text

commitChecksum: ASCII SHA256 checksum

-> Maybe b

keyringdir: Path to directory GPG keyrings; overrides built-in default if given

-> Maybe c

extraKeyring: Path to additional keyring file (not a directory)

-> Maybe d

cancellable: Cancellable

-> m GpgVerifyResult

Returns: an GpgVerifyResult, or Nothing on error (Can throw GError)

Read GPG signature(s) on the commit named by the ASCII checksum commitChecksum and return detailed results.

verifyCommitForRemote

repoVerifyCommitForRemote Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repository

-> Text

commitChecksum: ASCII SHA256 checksum

-> Text

remoteName: OSTree remote to use for configuration

-> Maybe b

cancellable: Cancellable

-> m GpgVerifyResult

Returns: an GpgVerifyResult, or Nothing on error (Can throw GError)

Read GPG signature(s) on the commit named by the ASCII checksum commitChecksum and return detailed results, based on the keyring configured for remote.

Since: 2016.14

verifySummary

repoVerifySummary Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Text

remoteName: Name of remote

-> Bytes

summary: Summary data as a Bytes

-> Bytes

signatures: Summary signatures as a Bytes

-> Maybe b

cancellable: Cancellable

-> m GpgVerifyResult

Returns: an GpgVerifyResult, or Nothing on error (Can throw GError)

Verify signatures for summary data using GPG keys in the keyring for remoteName, and return an GpgVerifyResult.

writeArchiveToMtree

repoWriteArchiveToMtree Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsFile b, IsMutableTree c, IsCancellable d) 
=> a

self: An Repo

-> b

archive: A path to an archive file

-> c

mtree: The MutableTree to write to

-> Maybe RepoCommitModifier

modifier: Optional commit modifier

-> Bool

autocreateParents: Autocreate parent directories

-> Maybe d

cancellable: Cancellable

-> m ()

(Can throw GError)

Import an archive file archive into the repository, and write its file structure to mtree.

writeArchiveToMtreeFromFd

repoWriteArchiveToMtreeFromFd Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsMutableTree b, IsCancellable c) 
=> a

self: An Repo

-> Int32

fd: A file descriptor to read the archive from

-> b

mtree: The MutableTree to write to

-> Maybe RepoCommitModifier

modifier: Optional commit modifier

-> Bool

autocreateParents: Autocreate parent directories

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Read an archive from fd and import it into the repository, writing its file structure to mtree.

writeCommit

repoWriteCommit Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsRepoFile b, IsCancellable c) 
=> a

self: Repo

-> Maybe Text

parent: ASCII SHA256 checksum for parent, or Nothing for none

-> Maybe Text

subject: Subject

-> Maybe Text

body: Body

-> Maybe GVariant

metadata: GVariant of type a{sv}, or Nothing for none

-> b

root: The tree to point the commit to

-> Maybe c

cancellable: Cancellable

-> m Text

(Can throw GError)

Write a commit metadata object, referencing rootContentsChecksum and rootMetadataChecksum.

writeCommitDetachedMetadata

repoWriteCommitDetachedMetadata Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> Text

checksum: ASCII SHA256 commit checksum

-> Maybe GVariant

metadata: Metadata to associate with commit in with format "a{sv}", or Nothing to delete

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Replace any existing metadata associated with commit referred to by checksum with metadata. If metadata is Nothing, then existing data will be deleted.

writeCommitWithTime

repoWriteCommitWithTime Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsRepoFile b, IsCancellable c) 
=> a

self: Repo

-> Maybe Text

parent: ASCII SHA256 checksum for parent, or Nothing for none

-> Maybe Text

subject: Subject

-> Maybe Text

body: Body

-> Maybe GVariant

metadata: GVariant of type a{sv}, or Nothing for none

-> b

root: The tree to point the commit to

-> Word64

time: The time to use to stamp the commit

-> Maybe c

cancellable: Cancellable

-> m Text

(Can throw GError)

Write a commit metadata object, referencing rootContentsChecksum and rootMetadataChecksum.

writeConfig

repoWriteConfig Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a) 
=> a

self: Repo

-> KeyFile

newConfig: Overwrite the config file with this data

-> m ()

(Can throw GError)

Save newConfig in place of this repository's config file.

writeContent

repoWriteContent Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsInputStream b, IsCancellable c) 
=> a

self: Repo

-> Maybe Text

expectedChecksum: If provided, validate content against this checksum

-> b

objectInput: Content object stream

-> Word64

length: Length of objectInput

-> Maybe c

cancellable: Cancellable

-> m ByteString

(Can throw GError)

Store the content object streamed as objectInput, with total length length. The actual checksum will be returned as outCsum.

writeContentAsync

repoWriteContentAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsInputStream b, IsCancellable c) 
=> a

self: Repo

-> Maybe Text

expectedChecksum: If provided, validate content against this checksum

-> b

object: Input

-> Word64

length: Length of object

-> Maybe c

cancellable: Cancellable

-> Maybe AsyncReadyCallback

callback: Invoked when content is writed

-> m () 

Asynchronously store the content object object. If provided, the checksum expectedChecksum will be verified.

writeContentFinish

repoWriteContentFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsAsyncResult b) 
=> a

self: a Repo

-> b

result: a AsyncResult

-> m Word8

(Can throw GError)

Completes an invocation of repoWriteContentAsync.

writeContentTrusted

repoWriteContentTrusted Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsInputStream b, IsCancellable c) 
=> a

self: Repo

-> Text

checksum: Store content using this ASCII SHA256 checksum

-> b

objectInput: Content stream

-> Word64

length: Length of objectInput

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Store the content object streamed as objectInput, with total length length. The given checksum will be treated as trusted.

This function should be used when importing file objects from local disk, for example.

writeDfdToMtree

repoWriteDfdToMtree Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsMutableTree b, IsCancellable c) 
=> a

self: Repo

-> Int32

dfd: Directory file descriptor

-> Text

path: Path

-> b

mtree: Overlay directory contents into this tree

-> Maybe RepoCommitModifier

modifier: Optional modifier

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Store as objects all contents of the directory referred to by dfd and path all children into the repository self, overlaying the resulting filesystem hierarchy into mtree.

writeDirectoryToMtree

repoWriteDirectoryToMtree Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsFile b, IsMutableTree c, IsCancellable d) 
=> a

self: Repo

-> b

dir: Path to a directory

-> c

mtree: Overlay directory contents into this tree

-> Maybe RepoCommitModifier

modifier: Optional modifier

-> Maybe d

cancellable: Cancellable

-> m ()

(Can throw GError)

Store objects for dir and all children into the repository self, overlaying the resulting filesystem hierarchy into mtree.

writeMetadata

repoWriteMetadata Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Maybe Text

expectedChecksum: If provided, validate content against this checksum

-> GVariant

object: Metadata

-> Maybe b

cancellable: Cancellable

-> m ByteString

(Can throw GError)

Store the metadata object object. Return the checksum as outCsum.

If expectedChecksum is not Nothing, verify it against the computed checksum.

writeMetadataAsync

repoWriteMetadataAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Maybe Text

expectedChecksum: If provided, validate content against this checksum

-> GVariant

object: Metadata

-> Maybe b

cancellable: Cancellable

-> Maybe AsyncReadyCallback

callback: Invoked when metadata is writed

-> m () 

Asynchronously store the metadata object variant. If provided, the checksum expectedChecksum will be verified.

writeMetadataFinish

repoWriteMetadataFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsAsyncResult b) 
=> a

self: Repo

-> b

result: Result

-> m ByteString

(Can throw GError)

Complete a call to repoWriteMetadataAsync.

writeMetadataStreamTrusted

repoWriteMetadataStreamTrusted Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsInputStream b, IsCancellable c) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Text

checksum: Store object with this ASCII SHA256 checksum

-> b

objectInput: Metadata object stream

-> Word64

length: Length, may be 0 for unknown

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Store the metadata object variant; the provided checksum is trusted.

writeMetadataTrusted

repoWriteMetadataTrusted Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsCancellable b) 
=> a

self: Repo

-> ObjectType

objtype: Object type

-> Text

checksum: Store object with this ASCII SHA256 checksum

-> GVariant

variant: Metadata object

-> Maybe b

cancellable: Cancellable

-> m ()

(Can throw GError)

Store the metadata object variant; the provided checksum is trusted.

writeMtree

repoWriteMtree Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepo a, IsMutableTree b, IsCancellable c) 
=> a

self: Repo

-> b

mtree: Mutable tree

-> Maybe c

cancellable: Cancellable

-> m File

(Can throw GError)

Write all metadata objects for mtree to repo; the resulting outFile points to the ObjectTypeDirTree object that the mtree represented.

Properties

path

Path to repository. Note that if this repository was created via ostree_repo_new_at(), this value will refer to a value in the Linux kernel's /proc/self/fd directory. Generally, you should avoid using this property at all; you can gain a reference to the repository's directory fd via ostree_repo_get_dfd() and use file-descriptor relative operations.

constructRepoPath :: (IsRepo o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “path” property. This is rarely needed directly, but it is used by new.

getRepoPath :: (MonadIO m, IsRepo o) => o -> m File Source #

Get the value of the “path” property. When overloading is enabled, this is equivalent to

get repo #path

remotesConfigDir

Path to directory containing remote definitions. The default is NULL. If a sysroot-path property is defined, this value will default to ${sysroot_path}/etc/ostree/remotes.d.

This value will only be used for system repositories.

constructRepoRemotesConfigDir :: (IsRepo o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “remotes-config-dir” property. This is rarely needed directly, but it is used by new.

getRepoRemotesConfigDir :: (MonadIO m, IsRepo o) => o -> m (Maybe Text) Source #

Get the value of the “remotes-config-dir” property. When overloading is enabled, this is equivalent to

get repo #remotesConfigDir

sysrootPath

A system using libostree for the host has a "system" repository; this property will be set for repositories referenced via ostree_sysroot_repo() for example.

You should avoid using this property; if your code is operating on a system repository, use OstreeSysroot and access the repository object via ostree_sysroot_repo().

constructRepoSysrootPath :: (IsRepo o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “sysroot-path” property. This is rarely needed directly, but it is used by new.

getRepoSysrootPath :: (MonadIO m, IsRepo o) => o -> m (Maybe File) Source #

Get the value of the “sysroot-path” property. When overloading is enabled, this is equivalent to

get repo #sysrootPath

Signals

gpgVerifyResult

type C_RepoGpgVerifyResultCallback = Ptr () -> CString -> Ptr GpgVerifyResult -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type RepoGpgVerifyResultCallback Source #

Arguments

 = Text

checksum: checksum of the signed object

-> GpgVerifyResult

result: an GpgVerifyResult

-> IO () 

Emitted during a pull operation upon GPG verification (if enabled). Applications can connect to this signal to output the verification results if desired.

The signal will be emitted from whichever MainContext is the thread-default at the point when repoPullWithOptions is called.

afterRepoGpgVerifyResult :: (IsRepo a, MonadIO m) => a -> RepoGpgVerifyResultCallback -> m SignalHandlerId Source #

Connect a signal handler for the gpgVerifyResult signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after repo #gpgVerifyResult callback

onRepoGpgVerifyResult :: (IsRepo a, MonadIO m) => a -> RepoGpgVerifyResultCallback -> m SignalHandlerId Source #

Connect a signal handler for the gpgVerifyResult signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on repo #gpgVerifyResult callback