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

GI.OSTree.Functions

Description

 
Synopsis

Methods

breakHardlink

breakHardlink Source #

Arguments

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

dfd: Directory fd

-> Text

path: Path relative to dfd

-> Bool

skipXattrs: Do not copy extended attributes

-> Maybe a 
-> m ()

(Can throw GError)

In many cases using libostree, a program may need to "break" hardlinks by performing a copy. For example, in order to logically append to a file.

This function performs full copying, including e.g. extended attributes and permissions of both regular files and symbolic links.

If the file is not hardlinked, this function does nothing and returns successfully.

This function does not perform synchronization via fsync() or fdatasync(); the idea is this will commonly be done as part of an ostree_repo_commit_transaction(), which itself takes care of synchronization.

Since: 2017.15

checkVersion

checkVersion Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

requiredYear: Major/year required

-> Word32

requiredRelease: Release version required

-> m Bool

Returns: True if current libostree has at least the requested version, False otherwise

No description available in the introspection data.

Since: 2017.4

checksumB64FromBytes

checksumB64FromBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ByteString

csum: An binary checksum of length 32

-> m Text

Returns: Modified base64 encoding of csum

The "modified" term refers to the fact that instead of '/', the '_' character is used.

No description available in the introspection data.

Since: 2016.8

checksumB64ToBytes

checksumB64ToBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

checksum: An ASCII checksum

-> m ByteString

Returns: Binary version of checksum.

No description available in the introspection data.

Since: 2016.8

checksumBytesPeek

checksumBytesPeek Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

bytes: GVariant of type ay

-> m ByteString

Returns: Binary checksum data in bytes; do not free. If bytes does not have the correct length, return Nothing.

No description available in the introspection data.

checksumBytesPeekValidate

checksumBytesPeekValidate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

bytes: GVariant of type ay

-> m ByteString

Returns: Binary checksum data (Can throw GError)

Like checksumBytesPeek, but also throws error.

checksumFile

checksumFile Source #

Arguments

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

f: File path

-> ObjectType

objtype: Object type

-> Maybe b

cancellable: Cancellable

-> m ByteString

(Can throw GError)

Compute the OSTree checksum for a given file.

checksumFileAsync

checksumFileAsync Source #

Arguments

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

f: File path

-> ObjectType

objtype: Object type

-> Int32

ioPriority: Priority for operation, see G_IO_PRIORITY_DEFAULT

-> Maybe b

cancellable: Cancellable

-> Maybe AsyncReadyCallback

callback: Invoked when operation is complete

-> m () 

Asynchronously compute the OSTree checksum for a given file; complete with checksumFileAsyncFinish.

checksumFileAsyncFinish

checksumFileAsyncFinish Source #

Arguments

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

f: File path

-> b

result: Async result

-> m ByteString

(Can throw GError)

Finish computing the OSTree checksum for a given file; see checksumFileAsync.

checksumFileAt

checksumFileAt Source #

Arguments

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

dfd: Directory file descriptor

-> Text

path: Subpath stbuf (allow-none): Optional stat buffer

-> Ptr () 
-> ObjectType

objtype: Object type

-> [ChecksumFlags]

flags: Flags outChecksum (out) (transfer full): Return location for hex checksum

-> Text 
-> Maybe a

cancellable: Cancellable

-> m ()

(Can throw GError)

Compute the OSTree checksum for a given file. This is an fd-relative version of checksumFile which also takes flags and fills in a caller allocated buffer.

Since: 2017.13

checksumFileFromInput

checksumFileFromInput Source #

Arguments

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

fileInfo: File information

-> Maybe GVariant

xattrs: Optional extended attributes

-> Maybe b

in: File content, should be Nothing for symbolic links

-> ObjectType

objtype: Object type

-> Maybe c

cancellable: Cancellable

-> m ByteString

(Can throw GError)

Compute the OSTree checksum for a given input.

checksumFromBytes

checksumFromBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ByteString

csum: An binary checksum of length 32

-> m Text

Returns: String form of csum

No description available in the introspection data.

checksumFromBytesV

checksumFromBytesV Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

csumV: GVariant of type ay

-> m Text

Returns: String form of csumBytes

No description available in the introspection data.

checksumInplaceToBytes

checksumInplaceToBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

checksum: a SHA256 string

-> Word8

buf: Output buffer with at least 32 bytes of space

-> m () 

Convert checksum from a string to binary in-place, without allocating memory. Use this function in hot code paths.

checksumToBytes

checksumToBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

checksum: An ASCII checksum

-> m ByteString

Returns: Binary checksum from checksum of length 32; free with free.

No description available in the introspection data.

checksumToBytesV

checksumToBytesV Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

checksum: An ASCII checksum

-> m GVariant

Returns: New GVariant of type ay with length 32

No description available in the introspection data.

cmd_Private #method:cmd_Private#

cmd_Private__ :: (HasCallStack, MonadIO m) => m CmdPrivateVTable Source #

No description available in the introspection data.

cmpChecksumBytes

cmpChecksumBytes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word8

a: A binary checksum

-> Word8

b: A binary checksum

-> m Int32 

Compare two binary checksums, using memcmp().

commitGetContentChecksum

commitGetContentChecksum Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

commitVariant: A commit object

-> m (Maybe Text)

Returns: A SHA-256 hex string, or Nothing if commitVariant is not well-formed

There are use cases where one wants a checksum just of the content of a commit. OSTree commits by default capture the current timestamp, and may have additional metadata, which means that re-committing identical content often results in a new checksum.

By comparing checksums of content, it's possible to easily distinguish cases where nothing actually changed.

The content checksums is simply defined as SHA256(root dirtree_checksum || root_dirmeta_checksum), i.e. the SHA-256 of the root "dirtree" object's checksum concatenated with the root "dirmeta" checksum (both in binary form, not hexadecimal).

Since: 2018.2

commitGetObjectSizes

commitGetObjectSizes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

commitVariant: variant of type ObjectTypeCommit

-> m [CommitSizesEntry]

(Can throw GError)

Reads a commit's "ostree.sizes" metadata and returns an array of CommitSizesEntry in outSizesEntries. Each element represents an object in the commit. If the commit does not contain the "ostree.sizes" metadata, a IOErrorEnumNotFound error will be returned.

Since: 2020.1

commitGetParent

commitGetParent Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

commitVariant: Variant of type ObjectTypeCommit

-> m Text

Returns: Checksum of the parent commit of commitVariant, or Nothing if none

No description available in the introspection data.

commitGetTimestamp

commitGetTimestamp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

commitVariant: Commit object

-> m Word64

Returns: timestamp in seconds since the Unix epoch, UTC

No description available in the introspection data.

Since: 2016.3

commitMetadataForBootable

commitMetadataForBootable Source #

Arguments

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

root: Root filesystem to be committed

-> VariantDict

dict: Dictionary to update

-> Maybe b 
-> m ()

(Can throw GError)

Update provided dict with standard metadata for bootable OSTree commits.

Since: 2021.1

contentFileParse

contentFileParse Source #

Arguments

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

compressed: Whether or not the stream is zlib-compressed

-> a

contentPath: Path to file containing content

-> Bool

trusted: If True, assume the content has been validated

-> Maybe b

cancellable: Cancellable

-> m (InputStream, FileInfo, GVariant)

(Can throw GError)

A thin wrapper for contentStreamParse; this function converts an object content stream back into components.

contentFileParseAt

contentFileParseAt Source #

Arguments

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

compressed: Whether or not the stream is zlib-compressed

-> Int32

parentDfd: Directory file descriptor

-> Text

path: Subpath

-> Bool

trusted: If True, assume the content has been validated

-> Maybe a

cancellable: Cancellable

-> m (InputStream, FileInfo, GVariant)

(Can throw GError)

A thin wrapper for contentStreamParse; this function converts an object content stream back into components.

contentStreamParse

contentStreamParse Source #

Arguments

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

compressed: Whether or not the stream is zlib-compressed

-> a

input: Object content stream

-> Word64

inputLength: Length of stream

-> Bool

trusted: If True, assume the content has been validated

-> Maybe b

cancellable: Cancellable

-> m (InputStream, FileInfo, GVariant)

(Can throw GError)

The reverse of rawFileToContentStream; this function converts an object content stream back into components.

createDirectoryMetadata

createDirectoryMetadata Source #

Arguments

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

dirInfo: a FileInfo containing directory information

-> Maybe GVariant

xattrs: Optional extended attributes

-> m GVariant

Returns: A new GVariant containing ObjectTypeDirMeta

No description available in the introspection data.

diffDirs

diffDirs Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a, IsFile b, IsCancellable c) 
=> [DiffFlags]

flags: Flags

-> a

a: First directory path, or Nothing

-> b

b: First directory path

-> [DiffItem]

modified: Modified files

-> [File]

removed: Removed files

-> [File]

added: Added files

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Compute the difference between directory a and b as 3 separate sets of DiffItem in modified, removed, and added.

diffDirsWithOptions

diffDirsWithOptions Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a, IsFile b, IsCancellable c) 
=> [DiffFlags]

flags: Flags

-> a

a: First directory path, or Nothing

-> b

b: First directory path

-> [DiffItem]

modified: Modified files

-> [File]

removed: Removed files

-> [File]

added: Added files

-> Maybe DiffDirsOptions

options: Options

-> Maybe c

cancellable: Cancellable

-> m ()

(Can throw GError)

Compute the difference between directory a and b as 3 separate sets of DiffItem in modified, removed, and added.

Since: 2017.4

diffPrint

diffPrint Source #

Arguments

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

a: First directory path

-> b

b: First directory path

-> [DiffItem]

modified: Modified files

-> [File]

removed: Removed files

-> [File]

added: Added files

-> m () 

Print the contents of a diff to stdout.

gpgErrorQuark

gpgErrorQuark :: (HasCallStack, MonadIO m) => m Word32 Source #

No description available in the introspection data.

Since: 2017.10

hashObjectName

hashObjectName Source #

Arguments

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

a: A GVariant containing a serialized object

-> m Word32 

Use this function with HashTable and objectNameSerialize.

metadataVariantType

metadataVariantType :: (HasCallStack, MonadIO m) => ObjectType -> m VariantType Source #

No description available in the introspection data.

objectFromString

objectFromString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

str: An ASCII checksum

-> m (Text, ObjectType) 

objectNameDeserialize

objectNameDeserialize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

variant: A GVariant of type (su)

-> m (Text, ObjectType) 

Reverse objectNameSerialize. Note that outChecksum is only valid for the lifetime of variant, and must not be freed.

objectNameSerialize

objectNameSerialize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

checksum: An ASCII checksum

-> ObjectType

objtype: An object type

-> m GVariant

Returns: A new floating GVariant containing checksum string and objtype

No description available in the introspection data.

objectToString

objectToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

checksum: An ASCII checksum

-> ObjectType

objtype: Object type

-> m Text

Returns: A string containing both checksum and a stringifed version of objtype

No description available in the introspection data.

objectTypeFromString

objectTypeFromString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

str: A stringified version of ObjectType

-> m ObjectType 

The reverse of objectTypeToString.

objectTypeToString

objectTypeToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ObjectType

objtype: an ObjectType

-> m Text 

Serialize objtype to a string; this is used for file extensions.

parseRefspec

parseRefspec Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

refspec: A "refspec" string

-> m (Maybe Text, Text)

(Can throw GError)

Split a refspec like gnome-ostree:gnome-ostree/buildmain or just gnome-ostree/buildmain into two parts. In the first case, outRemote will be set to gnome-ostree, and outRef to gnome-ostree/buildmain. In the second case (a local ref), outRemote will be Nothing, and outRef will be gnome-ostree/buildmain. In both cases, True will be returned.

rawFileToArchiveZ2Stream

rawFileToArchiveZ2Stream Source #

Arguments

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

input: File raw content stream

-> b

fileInfo: A file info

-> Maybe GVariant

xattrs: Optional extended attributes

-> Maybe c

cancellable: Cancellable

-> m InputStream

(Can throw GError)

Convert from a "bare" file representation into an OSTREE_OBJECT_TYPE_FILE stream suitable for ostree pull.

Since: 2016.6

rawFileToArchiveZ2StreamWithOptions

rawFileToArchiveZ2StreamWithOptions Source #

Arguments

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

input: File raw content stream

-> b

fileInfo: A file info

-> Maybe GVariant

xattrs: Optional extended attributes

-> Maybe GVariant

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

-> Maybe c

cancellable: Cancellable

-> m InputStream

(Can throw GError)

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

  • compression-level (i): Level of compression to use, 0–9, with 0 being the least compression, and <0 giving the default level (currently 6).

Since: 2017.3

rawFileToContentStream

rawFileToContentStream Source #

Arguments

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

input: File raw content stream

-> b

fileInfo: A file info

-> Maybe GVariant

xattrs: Optional extended attributes

-> Maybe c

cancellable: Cancellable

-> m (InputStream, Word64)

(Can throw GError)

Convert from a "bare" file representation into an OSTREE_OBJECT_TYPE_FILE stream. This is a fundamental operation for writing data to an Repo.

validateChecksumString

validateChecksumString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

sha256: SHA256 hex string

-> m ()

(Can throw GError)

Use this function to see if input strings are checksums.

validateCollectionId

validateCollectionId Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

collectionId: A collection ID

-> m ()

(Can throw GError)

Check whether the given collectionId is valid. Return an error if it is invalid or Nothing.

Valid collection IDs are reverse DNS names: * They are composed of 1 or more elements separated by a period (.) character. All elements must contain at least one character. * Each element must only contain the ASCII characters [A-Z][a-z][0-9]_ and must not begin with a digit. * They must contain at least one . (period) character (and thus at least two elements). * They must not begin with a . (period) character. * They must not exceed 255 characters in length.

(This makes their format identical to D-Bus interface names, for consistency.)

Since: 2018.6

validateRemoteName

validateRemoteName Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

remoteName: A remote name

-> m ()

(Can throw GError)

No description available in the introspection data.

Since: 2017.8

validateRev

validateRev Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

rev: A revision string

-> m ()

(Can throw GError)

No description available in the introspection data.

validateStructureofChecksumString

validateStructureofChecksumString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

checksum: an ASCII string

-> m ()

(Can throw GError)

No description available in the introspection data.

validateStructureofCommit

validateStructureofCommit Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

commit: A commit object, ObjectTypeCommit

-> m ()

(Can throw GError)

Use this to validate the basic structure of commit, independent of any other objects it references.

validateStructureofCsumV

validateStructureofCsumV Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

checksum: a GVariant of type "ay"

-> m ()

(Can throw GError)

No description available in the introspection data.

validateStructureofDirmeta

validateStructureofDirmeta Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

dirmeta: A dirmeta object, ObjectTypeDirMeta

-> m ()

(Can throw GError)

Use this to validate the basic structure of dirmeta.

validateStructureofDirtree

validateStructureofDirtree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

dirtree: A dirtree object, ObjectTypeDirTree

-> m ()

(Can throw GError)

Use this to validate the basic structure of dirtree, independent of any other objects it references.

validateStructureofFileMode

validateStructureofFileMode Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

mode: A Unix filesystem mode

-> m ()

(Can throw GError)

No description available in the introspection data.

validateStructureofObjtype

validateStructureofObjtype Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word8 
-> m ()

(Can throw GError)

No description available in the introspection data.