Gjsify LogoGjsify Logo

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

gTypeInstance: TypeInstance
path: Gio.File
remotesConfigDir: string
sysrootPath: Gio.File
$gtype: GType<Repo>
name: string

Methods

  • addGpgSignatureSummary(keyId: string[], homedir: string, cancellable: Gio.Cancellable): boolean
  • Add a GPG signature to a static delta.

    Parameters

    • keyId: string[]

      NULL-terminated array of GPG keys.

    • homedir: string

      GPG home directory, or %NULL

    • cancellable: Gio.Cancellable

      A #GCancellable

    Returns boolean

  • appendGpgSignature(commitChecksum: string, signatureBytes: any, cancellable: Gio.Cancellable): boolean
  • Append a GPG signature to a commit.

    Parameters

    • commitChecksum: string

      SHA256 of given commit to sign

    • signatureBytes: any

      Signature data

    • cancellable: Gio.Cancellable

      A #GCancellable

    Returns boolean

  • Creates a binding between source_property on source and target_property on target.

    Whenever the source_property is changed the target_property is updated using the same value. For instance:

      g_object_bind_property (action, "active", widget, "sensitive", 0);
    

    Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance.

    If flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if target_property on target changes then the source_property on source will be updated as well.

    The binding will automatically be removed when either the source or the target instances are finalized. To remove the binding without affecting the source and the target you can just call g_object_unref() on the returned #GBinding instance.

    Removing the binding by calling g_object_unref() on it must only be done if the binding, source and target are only used from a single thread and it is clear that both source and target outlive the binding. Especially it is not safe to rely on this if the binding, source or target can be finalized from different threads. Keep another reference to the binding and use g_binding_unbind() instead to be on the safe side.

    A #GObject can have multiple bindings.

    Parameters

    • sourceProperty: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • targetProperty: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    Returns Binding

  • Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

    This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.

    Parameters

    • sourceProperty: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • targetProperty: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    • transformTo: TClosure<any, any>

      a #GClosure wrapping the transformation function from the source to the target, or %NULL to use the default

    • transformFrom: TClosure<any, any>

      a #GClosure wrapping the transformation function from the target to the source, or %NULL to use the default

    Returns Binding

  • Similar to ostree_repo_checkout_tree(), 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 ostree_repo_checkout_at() which was not safe to use with GObject introspection.

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

    Parameters

    • options: RepoCheckoutAtOptions

      Options

    • destinationDfd: number

      Directory FD for destination

    • destinationPath: string

      Directory for destination

    • commit: string

      Checksum for commit

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

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

    Parameters

    Returns boolean

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

    Parameters

    Returns boolean

  • connect(sigName: "gpg-verify-result", callback: Repo_GpgVerifyResultSignalCallback): number
  • connect(sigName: "notify::path", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::remotes-config-dir", callback: ((...args: any[]) => void)): number
  • connect(sigName: "notify::sysroot-path", callback: ((...args: any[]) => void)): number
  • connect(sigName: string, callback: ((...args: any[]) => void)): number
  • Parameters

    Returns number

  • Parameters

    • sigName: "notify::path"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::remotes-config-dir"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: "notify::sysroot-path"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Create the underlying structure on disk for the repository, and call ostree_repo_open() 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.

    Parameters

    Returns boolean

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

    Parameters

    Returns boolean

  • emit(sigName: "gpg-verify-result", result: GpgVerifyResult, ...args: any[]): void
  • emit(sigName: "notify::path", ...args: any[]): void
  • emit(sigName: "notify::remotes-config-dir", ...args: any[]): void
  • emit(sigName: "notify::sysroot-path", ...args: any[]): void
  • emit(sigName: string, ...args: any[]): void
  • forceFloating(): void
  • This function is intended for #GObject implementations to re-enforce a [floating][floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink().

    Returns void

  • freezeNotify(): void
  • Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

    This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

    Returns void

  • getData(key?: string): object
  • Gets a named field from the objects table of associations (see g_object_set_data()).

    Parameters

    • Optional key: string

      name of the key for that association

    Returns object

  • getDfd(): number
  • 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).

    Returns number

  • getDisableFsync(): boolean
  • For more information see ostree_repo_set_disable_fsync().

    Returns boolean

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

    Returns Repo

  • getProperty(propertyName?: string, value?: any): void
  • Gets a property of an object.

    The value can be:

    • an empty #GValue initialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
    • a #GValue initialized with the expected type of the property
    • a #GValue initialized with a type to which the expected type of the property can be transformed

    In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset().

    Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.

    Parameters

    • Optional propertyName: string

      the name of the property to get

    • Optional value: any

      return location for the property value

    Returns void

  • getQdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • getRemoteBooleanOption(remoteName: string, optionName: string, defaultValue: boolean): [boolean, boolean]
  • OSTree remotes are represented by keyfile groups, formatted like: [remote "remotename"]. This function returns a value named option_name underneath that group, and returns it as a boolean. If the option is not set, out_value will be set to default_value.

    Parameters

    • remoteName: string

      Name

    • optionName: string

      Option

    • defaultValue: boolean

      Value returned if option_name is not present

    Returns [boolean, boolean]

  • getRemoteListOption(remoteName: string, optionName: string): [boolean, string[]]
  • OSTree remotes are represented by keyfile groups, formatted like: [remote "remotename"]. This function returns a value named option_name underneath that group, and returns it as an zero terminated array of strings. If the option is not set, out_value will be set to %NULL.

    Parameters

    • remoteName: string

      Name

    • optionName: string

      Option

    Returns [boolean, string[]]

  • getRemoteOption(remoteName: string, optionName: string, defaultValue: string): [boolean, string]
  • OSTree remotes are represented by keyfile groups, formatted like: [remote "remotename"]. This function returns a value named option_name underneath that group, or default_value if the remote exists but not the option name.

    Parameters

    • remoteName: string

      Name

    • optionName: string

      Option

    • defaultValue: string

      Value returned if option_name is not present

    Returns [boolean, string]

  • getv(names: string[], values: any[]): void
  • Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

    Parameters

    • names: string[]

      the names of each property to get

    • values: any[]

      the values of each property to get

    Returns void

  • Verify signatures for data using GPG keys in the keyring for remote_name, and return an #OstreeGpgVerifyResult.

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

    Parameters

    • remoteName: string

      Name of remote

    • data: any

      Data as a #GBytes

    • signatures: any

      Signatures as a #GBytes

    • keyringdir: Gio.File

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

    • extraKeyring: Gio.File

      Path to additional keyring file (not a directory)

    • cancellable: Gio.Cancellable

      Cancellable

    Returns GpgVerifyResult

  • Set out_have_object to %TRUE if self contains the given object; %FALSE otherwise.

    Parameters

    Returns [boolean, boolean]

  • 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.

    Parameters

    Returns boolean

  • 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.

    Parameters

    • source: Repo

      Source repo

    • objtype: OSTree.ObjectType

      Object type

    • checksum: string

      checksum

    • trusted: boolean

      If %TRUE, assume the source repo is valid and trusted

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • isFloating(): boolean
  • isSystem(): boolean
  • isWritable(): boolean
  • Returns whether the repository is writable by the current user. If the repository is not writable, the error indicates why.

    Returns boolean

  • listCommitObjectsStartingWith(start: string, outCommits: HashTable<string | number | symbol, string | number | boolean>, cancellable: Gio.Cancellable): boolean
  • This function synchronously enumerates all commit objects starting with start, returning data in out_commits.

    Parameters

    • start: string

      List commits starting with this checksum

    • outCommits: HashTable<string | number | symbol, string | number | boolean>

      Array of GVariants

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • This function synchronously enumerates all objects in the repository, returning data in out_objects. out_objects maps from keys returned by ostree_object_name_serialize() to #GVariant values of type %OSTREE_REPO_LIST_OBJECTS_VARIANT_TYPE.

    Parameters

    Returns [boolean, HashTable<string | number | symbol, string | number | boolean>]

  • listRefs(refspecPrefix: string, cancellable: Gio.Cancellable): [boolean, HashTable<string | number | symbol, string | number | boolean>]
  • If refspec_prefix is %NULL, list all local and remote refspecs, with their current values in out_all_refs. Otherwise, only list refspecs which have refspec_prefix as a prefix.

    Parameters

    • refspecPrefix: string

      Only list refs which match this prefix

    • cancellable: Gio.Cancellable

      Cancellable

    Returns [boolean, HashTable<string | number | symbol, string | number | boolean>]

  • If refspec_prefix is %NULL, list all local and remote refspecs, with their current values in out_all_refs. Otherwise, only list refspecs which have refspec_prefix as a prefix. Differently from ostree_repo_list_refs(), the prefix will not be removed from the ref name.

    Parameters

    Returns [boolean, HashTable<string | number | symbol, string | number | boolean>]

  • listStaticDeltaNames(cancellable: Gio.Cancellable): [boolean, string[]]
  • This function synchronously enumerates all static deltas in the repository, returning its result in out_deltas.

    Parameters

    Returns [boolean, string[]]

  • A version of ostree_repo_load_variant() specialized to commits, capable of returning extended state information. Currently the only extended state is %OSTREE_REPO_COMMIT_STATE_PARTIAL, which means that only a sub-path of the commit is available.

    Parameters

    • checksum: string

      Commit checksum

    Returns [boolean, GLib.Variant, RepoCommitState]

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

    Parameters

    Returns [boolean, GLib.Variant]

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

    Parameters

    Returns [boolean, GLib.Variant]

  • notify(propertyName: string): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    Parameters

    • propertyName: string

      the name of a property installed on the class of object.

    Returns void

  • Emits a "notify" signal for the property specified by pspec on object.

    This function omits the property name lookup, hence it is faster than g_object_notify().

    One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.:

      enum
    {
    PROP_0,
    PROP_FOO,
    PROP_LAST
    };

    static GParamSpec *properties[PROP_LAST];

    static void
    my_object_class_init (MyObjectClass *klass)
    {
    properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
    0, 100,
    50,
    G_PARAM_READWRITE);
    g_object_class_install_property (gobject_class,
    PROP_FOO,
    properties[PROP_FOO]);
    }

    and then notify a change on the "foo" property with:

      g_object_notify_by_pspec (self, properties[PROP_FOO]);
    

    Parameters

    • pspec: ParamSpec

      the #GParamSpec of a property installed on the class of object.

    Returns void

  • off(sigName: "gpg-verify-result", callback: Repo_GpgVerifyResultSignalCallback): EventEmitter
  • off(sigName: "notify::path", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::remotes-config-dir", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: "notify::sysroot-path", callback: ((...args: any[]) => void)): EventEmitter
  • off(sigName: string, callback: ((...args: any[]) => void)): EventEmitter
  • Parameters

    Returns EventEmitter

  • Parameters

    • sigName: "notify::path"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::remotes-config-dir"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: "notify::sysroot-path"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • on(sigName: "gpg-verify-result", callback: Repo_GpgVerifyResultSignalCallback, after?: boolean): EventEmitter
  • on(sigName: "notify::path", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::remotes-config-dir", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: "notify::sysroot-path", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • on(sigName: string, callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • Parameters

    Returns EventEmitter

  • Parameters

    • sigName: "notify::path"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::remotes-config-dir"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::sysroot-path"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • once(sigName: "gpg-verify-result", callback: Repo_GpgVerifyResultSignalCallback, after?: boolean): EventEmitter
  • once(sigName: "notify::path", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::remotes-config-dir", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: "notify::sysroot-path", callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • once(sigName: string, callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • Parameters

    Returns EventEmitter

  • Parameters

    • sigName: "notify::path"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::remotes-config-dir"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: "notify::sysroot-path"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Starts or resumes a transaction. In order to write to a repo, you need to start a transaction. You can complete the transaction with ostree_repo_commit_transaction(), or abort the transaction with ostree_repo_abort_transaction().

    Currently, transactions are not atomic, and aborting a transaction will not erase any data you write during the transaction.

    Parameters

    Returns [boolean, boolean]

  • 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 %OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY 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 %OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE to just determine statistics on objects that would be deleted, without actually deleting them.

    Parameters

    • flags: RepoPruneFlags

      Options controlling prune process

    • depth: number

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

    • cancellable: Gio.Cancellable

      Cancellable

    Returns [boolean, number, number, number]

  • pruneStaticDeltas(commit: string, cancellable: Gio.Cancellable): boolean
  • 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.

    Parameters

    • commit: string

      ASCII SHA256 checksum for commit, or %NULL for each non existing commit

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • Connect to the remote repository, fetching the specified set of refs refs_to_fetch. 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 %OSTREE_REPO_PULL_FLAGS_MIRROR, and the refs_to_fetch is %NULL, and the remote repository contains a summary file, then all refs will be fetched.

    If flags contains %OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY, then only the metadata for the commits in refs_to_fetch 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 g_main_context_push_thread_default() to push a new one around this call.

    Parameters

    • remoteName: string

      Name of remote

    • refsToFetch: string[]

      Optional list of refs; if %NULL, fetch all configured refs

    • flags: RepoPullFlags

      Options controlling fetch behavior

    • progress: AsyncProgress

      Progress

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • This is similar to ostree_repo_pull(), but only fetches a single subpath.

    Parameters

    • remoteName: string

      Name of remote

    • dirToPull: string

      Subdirectory path

    • refsToFetch: string[]

      Optional list of refs; if %NULL, fetch all configured refs

    • flags: RepoPullFlags

      Options controlling fetch behavior

    • progress: AsyncProgress

      Progress

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • Like ostree_repo_pull(), but supports an extensible set of flags. The following are currently defined:

    • refs (as): Array of string refs
    • flags (i): An instance of #OstreeRepoPullFlags
    • subdir (s): Pull just this subdirectory
    • override-remote-name (s): If local, add this remote to refspec
    • gpg-verify (b): GPG verify commits
    • gpg-verify-summary (b): GPG verify summary
    • depth (i): How far in the history to traverse; default is 0, -1 means infinite
    • 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
    • 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

    Parameters

    • remoteNameOrBaseurl: string

      Name of remote or file:// url

    • options: GLib.Variant

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

    • progress: AsyncProgress

      Progress

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

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

    Parameters

    Returns [boolean, number]

  • OSTree commits can have arbitrary metadata associated; this function retrieves them. If none exists, out_metadata will be set to %NULL.

    Parameters

    • checksum: string

      ASCII SHA256 commit checksum

    • cancellable: Gio.Cancellable

      Cancellable

    Returns [boolean, GLib.Variant]

  • Increases the reference count of object.

    Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type of object will be propagated to the return type (using the GCC typeof() extension), so any casting the caller needs to do on the return type must be explicit.

    Returns GObject.Object

  • Increase the reference count of object, and possibly remove the [floating][floating-ref] reference, if object has a floating reference.

    In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.

    Since GLib 2.56, the type of object will be propagated to the return type under the same conditions as for g_object_ref().

    Returns GObject.Object

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

    It is regenerated automatically after a commit if core/commit-update-summary is set.

    Parameters

    Returns boolean

  • Create a new remote named name pointing to url. If options is provided, then it will be mapped to #GKeyFile entries, where the GVariant dictionary key is an option string, and the value is mapped as follows:

    • s: g_key_file_set_string()
    • b: g_key_file_set_boolean()
    • as: g_key_file_set_string_list()

    Parameters

    • name: string

      Name of remote

    • url: string

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

    • options: GLib.Variant

      GVariant of type a{sv}

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • A combined function handling the equivalent of ostree_repo_remote_add(), ostree_repo_remote_delete(), with more options.

    Parameters

    • sysroot: Gio.File

      System root

    • changeop: RepoRemoteChange

      Operation to perform

    • name: string

      Name of remote

    • url: string

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

    • options: GLib.Variant

      GVariant of type a{sv}

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

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

    Parameters

    Returns boolean

  • remoteFetchSummary(name: string, outSummary: any, outSignatures: any, cancellable: Gio.Cancellable): boolean
  • Tries to fetch the summary file and any GPG signatures on the summary file over HTTP, and returns the binary data in out_summary and out_signatures respectively.

    If no summary file exists on the remote server, out_summary is set to NULL. Likewise if the summary file is not signed, out_signatures is set to NULL. In either case the function still returns %TRUE.

    Parse the summary data into a #GVariant using g_variant_new_from_bytes() with #OSTREE_SUMMARY_GVARIANT_FORMAT as the format string.

    Parameters

    • name: string

      name of a remote

    • outSummary: any

      return location for raw summary data, or %NULL

    • outSignatures: any

      return location for raw summary signature data, or %NULL

    • cancellable: Gio.Cancellable

      a #GCancellable

    Returns boolean

  • remoteFetchSummaryWithOptions(name: string, options: GLib.Variant, outSummary: any, outSignatures: any, cancellable: Gio.Cancellable): boolean
  • Like ostree_repo_remote_fetch_summary(), 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

    Parameters

    • name: string

      name of a remote

    • options: GLib.Variant

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

    • outSummary: any

      return location for raw summary data, or %NULL

    • outSignatures: any

      return location for raw summary signature data, or %NULL

    • cancellable: Gio.Cancellable

      a #GCancellable

    Returns boolean

  • remoteGetGpgVerify(name: string): [boolean, boolean]
  • Return whether GPG verification is enabled for the remote named name through out_gpg_verify. It is an error if the provided remote does not exist.

    Parameters

    • name: string

      Name of remote

    Returns [boolean, boolean]

  • remoteGetGpgVerifySummary(name: string): [boolean, boolean]
  • Return whether GPG verification of the summary is enabled for the remote named name through out_gpg_verify_summary. It is an error if the provided remote does not exist.

    Parameters

    • name: string

      Name of remote

    Returns [boolean, boolean]

  • remoteGetUrl(name: string): [boolean, string]
  • Return the URL of the remote named name through out_url. It is an error if the provided remote does not exist.

    Parameters

    • name: string

      Name of remote

    Returns [boolean, string]

  • Imports one or more GPG keys from the open source_stream, or from the user's personal keyring if source_stream is %NULL. The key_ids array can optionally restrict which keys are imported. If key_ids is %NULL, then all keys are imported.

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

    Parameters

    • name: string

      name of a remote

    • sourceStream: Gio.InputStream

      a #GInputStream, or %NULL

    • keyIds: string[]

      a %NULL-terminated array of GPG key IDs, or %NULL

    • outImported: number

      return location for the number of imported keys, or %NULL

    • cancellable: Gio.Cancellable

      a #GCancellable

    Returns boolean

  • remoteList(): string[]
  • List available remote names in an #OstreeRepo. Remote names are sorted alphabetically. If no remotes are available the function returns %NULL.

    Returns string[]

  • remoteListRefs(remoteName: string, cancellable: Gio.Cancellable): [boolean, HashTable<string | number | symbol, string | number | boolean>]
  • resolveRev(refspec: string, allowNoent: boolean): [boolean, string]
  • Look up the given refspec, returning the checksum it references in the parameter out_rev. Will fall back on remote directory if cannot find the given refspec in local.

    Parameters

    • refspec: string

      A refspec

    • allowNoent: boolean

      Do not throw an error if refspec does not exist

    Returns [boolean, string]

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

    Parameters

    • refspec: string

      A refspec

    • allowNoent: boolean

      Do not throw an error if refspec does not exist

    • flags: RepoResolveRevExtFlags

      Options controlling behavior

    Returns [boolean, string]

  • runDispose(): void
  • Releases all references to other objects. This can be used to break reference cycles.

    This function should only be called from object system implementations.

    Returns void

  • When ostree builds a mutable tree from directory like in ostree_repo_write_directory_to_mtree(), it has to scan all files that you pass in and compute their checksums. If your commit contains hardlinks from ostree's existing repo, ostree can build 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 ostree_write_directory_to_mtree() or similar.

    Parameters

    Returns boolean

  • setCacheDir(dfd: number, path: string, cancellable: Gio.Cancellable): boolean
  • 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.

    Parameters

    • dfd: number

      directory fd

    • path: string

      subpath in dfd

    • cancellable: Gio.Cancellable

      a #GCancellable

    Returns boolean

  • setData(key: string, data?: object): void
  • Each object carries around a table of associations from strings to pointers. This function lets you set an association.

    If the object already had an association with that name, the old association will be destroyed.

    Internally, the key is converted to a #GQuark using g_quark_from_string(). This means a copy of key is kept permanently (even after object has been finalized) — so it is recommended to only use a small, bounded set of values for key in your program, to avoid the #GQuark storage growing unbounded.

    Parameters

    • key: string

      name of the key

    • Optional data: object

      data to associate with that key

    Returns void

  • setDisableFsync(disableFsync: boolean): void
  • 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.

    Parameters

    • disableFsync: boolean

      If %TRUE, do not fsync

    Returns void

  • setProperty(propertyName: string, value?: any): void
  • Sets a property on an object.

    Parameters

    • propertyName: string

      the name of the property to set

    • Optional value: any

      the value

    Returns void

  • setRefImmediate(remote: string, ref: string, checksum: string, cancellable: Gio.Cancellable): boolean
  • This is like ostree_repo_transaction_set_ref(), 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.

    Parameters

    • remote: string

      A remote for the ref

    • ref: string

      The ref to write

    • checksum: string

      The checksum to point it to, or %NULL to unset

    • cancellable: Gio.Cancellable

      GCancellable

    Returns boolean

  • signCommit(commitChecksum: string, keyId: string, homedir: string, cancellable: Gio.Cancellable): boolean
  • Add a GPG signature to a commit.

    Parameters

    • commitChecksum: string

      SHA256 of given commit to sign

    • keyId: string

      Use this GPG key id

    • homedir: string

      GPG home directory, or %NULL

    • cancellable: Gio.Cancellable

      A #GCancellable

    Returns boolean

  • signDelta(fromCommit: string, toCommit: string, keyId: string, homedir: string, cancellable: Gio.Cancellable): boolean
  • This function is deprecated, sign the summary file instead. Add a GPG signature to a static delta.

    Parameters

    • fromCommit: string
    • toCommit: string
    • keyId: string
    • homedir: string
    • cancellable: Gio.Cancellable

    Returns boolean

  • staticDeltaExecuteOffline(dirOrFile: Gio.File, skipValidation: boolean, cancellable: Gio.Cancellable): boolean
  • 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.

    Parameters

    • dirOrFile: Gio.File

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

    • skipValidation: boolean

      If %TRUE, assume data integrity

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • Generate a lookaside "static delta" from from (%NULL 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.

    Parameters

    Returns boolean

  • stealData(key?: string): object
  • Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

    Parameters

    • Optional key: string

      name of the key

    Returns object

  • stealQdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata() and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

    void
    object_add_to_user_list (GObject *object,
    const gchar *new_string)
    {
    // the quark, naming the object data
    GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
    // retrieve the old string list
    GList *list = g_object_steal_qdata (object, quark_string_list);

    // prepend new string
    list = g_list_prepend (list, g_strdup (new_string));
    // this changed 'list', so we need to set it again
    g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
    }
    static void
    free_string_list (gpointer data)
    {
    GList *node, *list = data;

    for (node = list; node; node = node->next)
    g_free (node->data);
    g_list_free (list);
    }

    Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • thawNotify(): void
  • Reverts the effect of a previous call to g_object_freeze_notify(). The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

    Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued.

    It is an error to call this function when the freeze count is zero.

    Returns void

  • transactionSetRef(remote: string, ref: string, checksum: string): void
  • If checksum is not %NULL, 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 %NULL, then record that the ref should be deleted.

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

    Parameters

    • remote: string

      A remote for the ref

    • ref: string

      The ref to write

    • checksum: string

      The checksum to point it to

    Returns void

  • transactionSetRefspec(refspec: string, checksum: string): void
  • Like ostree_repo_transaction_set_ref(), but takes concatenated refspec format as input instead of separate remote and name arguments.

    Parameters

    • refspec: string

      The refspec to write

    • checksum: string

      The checksum to point it to

    Returns void

  • traverseCommit(commitChecksum: string, maxdepth: number, cancellable: Gio.Cancellable): [boolean, HashTable<string | number | symbol, string | number | boolean>]
  • Create a new set out_reachable containing all objects reachable from commit_checksum, traversing maxdepth parent commits.

    Parameters

    • commitChecksum: string

      ASCII SHA256 checksum

    • maxdepth: number

      Traverse this many parent commits, -1 for unlimited

    • cancellable: Gio.Cancellable

      Cancellable

    Returns [boolean, HashTable<string | number | symbol, string | number | boolean>]

  • unref(): void
  • Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

    If the pointer to the #GObject may be reused in future (for example, if it is an instance variable of another object), it is recommended to clear the pointer to %NULL rather than retain a dangling pointer to a potentially invalid #GObject instance. Use g_clear_object() for this.

    Returns void

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

    Parameters

    • commitChecksum: string

      ASCII SHA256 checksum

    • keyringdir: Gio.File

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

    • extraKeyring: Gio.File

      Path to additional keyring file (not a directory)

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

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

    Parameters

    • commitChecksum: string

      ASCII SHA256 checksum

    • keyringdir: Gio.File

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

    • extraKeyring: Gio.File

      Path to additional keyring file (not a directory)

    • cancellable: Gio.Cancellable

      Cancellable

    Returns GpgVerifyResult

  • Verify signatures for summary data using GPG keys in the keyring for remote_name, and return an #OstreeGpgVerifyResult.

    Parameters

    • remoteName: string

      Name of remote

    • summary: any

      Summary data as a #GBytes

    • signatures: any

      Summary signatures as a #GBytes

    • cancellable: Gio.Cancellable

      Cancellable

    Returns GpgVerifyResult

  • watchClosure(closure: TClosure<any, any>): void
  • This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_unref() are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

    Parameters

    • closure: TClosure<any, any>

      #GClosure to watch

    Returns void

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

    Parameters

    • archive: Gio.File

      A path to an archive file

    • mtree: MutableTree

      The #OstreeMutableTree to write to

    • modifier: RepoCommitModifier

      Optional commit modifier

    • autocreateParents: boolean

      Autocreate parent directories

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • Write a commit metadata object, referencing root_contents_checksum and root_metadata_checksum.

    Parameters

    • parent: string

      ASCII SHA256 checksum for parent, or %NULL for none

    • subject: string

      Subject

    • body: string

      Body

    • metadata: GLib.Variant

      GVariant of type a{sv}, or %NULL for none

    • root: RepoFile

      The tree to point the commit to

    • cancellable: Gio.Cancellable

      Cancellable

    Returns [boolean, string]

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

    Parameters

    • checksum: string

      ASCII SHA256 commit checksum

    • metadata: GLib.Variant

      Metadata to associate with commit in with format "a{sv}", or %NULL to delete

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • writeCommitWithTime(parent: string, subject: string, body: string, metadata: GLib.Variant, root: RepoFile, time: number, cancellable: Gio.Cancellable): [boolean, string]
  • Write a commit metadata object, referencing root_contents_checksum and root_metadata_checksum.

    Parameters

    • parent: string

      ASCII SHA256 checksum for parent, or %NULL for none

    • subject: string

      Subject

    • body: string

      Body

    • metadata: GLib.Variant

      GVariant of type a{sv}, or %NULL for none

    • root: RepoFile

      The tree to point the commit to

    • time: number

      The time to use to stamp the commit

    • cancellable: Gio.Cancellable

      Cancellable

    Returns [boolean, string]

  • Save new_config in place of this repository's config file. Note that new_config should not be modified after - this function simply adds a reference.

    Parameters

    • newConfig: GLib.KeyFile

      Overwrite the config file with this data. Do not change later!

    Returns boolean

  • Store the content object streamed as object_input, with total length length. The actual checksum will be returned as out_csum.

    Parameters

    • expectedChecksum: string

      If provided, validate content against this checksum

    • objectInput: Gio.InputStream

      Content object stream

    • length: number

      Length of object_input

    • cancellable: Gio.Cancellable

      Cancellable

    Returns [boolean, Uint8Array]

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

    Parameters

    • expectedChecksum: string

      If provided, validate content against this checksum

    • object: Gio.InputStream

      Input

    • length: number

      Length of object

    • cancellable: Gio.Cancellable

      Cancellable

    • callback: AsyncReadyCallback

      Invoked when content is writed

    Returns void

  • writeContentFinish(result: AsyncResult): [boolean, number]
  • Completes an invocation of ostree_repo_write_content_async().

    Parameters

    Returns [boolean, number]

  • Store the content object streamed as object_input, 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.

    Parameters

    • checksum: string

      Store content using this ASCII SHA256 checksum

    • objectInput: Gio.InputStream

      Content stream

    • length: number

      Length of object_input

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

  • 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.

    Parameters

    Returns boolean

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

    Parameters

    Returns boolean

  • Store the metadata object variant. Return the checksum as out_csum.

    If expected_checksum is not %NULL, verify it against the computed checksum.

    Parameters

    Returns [boolean, Uint8Array]

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

    Parameters

    Returns void

  • writeMetadataFinish(result: AsyncResult, outCsum: number): boolean
  • Store the metadata object variant; the provided checksum is trusted.

    Parameters

    • objtype: OSTree.ObjectType

      Object type

    • checksum: string

      Store object with this ASCII SHA256 checksum

    • objectInput: Gio.InputStream

      Metadata object stream

    • length: number

      Length, may be 0 for unknown

    • cancellable: Gio.Cancellable

      Cancellable

    Returns boolean

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

    Parameters

    Returns boolean

  • Write all metadata objects for mtree to repo; the resulting out_file points to the %OSTREE_OBJECT_TYPE_DIR_TREE object that the mtree represented.

    Parameters

    Returns [boolean, Gio.File]

  • compatControl(what: number, data: object): number
  • Find the #GParamSpec with the given name for an interface. Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • gIface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    • propertyName: string

      name of a property to look up.

    Returns ParamSpec

  • Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property.

    This function is meant to be called from the interface's default vtable initialization function (the class_init member of #GTypeInfo.) It must not be called after after class_init has been called for any object types implementing this interface.

    If pspec is a floating reference, it will be consumed.

    Parameters

    • gIface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface.

    • pspec: ParamSpec

      the #GParamSpec for the new property

    Returns void

  • Lists the properties of an interface.Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • gIface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    Returns ParamSpec[]

  • modeFromString(mode: string, outMode: RepoMode): boolean
  • If the current working directory appears to be an OSTree repository, create a new #OstreeRepo 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.

    Returns Repo

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

    Parameters

    • repoPath: Gio.File

      Path to a repository

    • sysrootPath: Gio.File

      Path to the system root

    Returns Repo

  • Creates a new instance of a #GObject subtype and sets its properties.

    Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.

    Parameters

    • objectType: GType<unknown>

      the type id of the #GObject subtype to instantiate

    • parameters: GObject.Parameter[]

      an array of #GParameter

    Returns GObject.Object

  • pullDefaultConsoleProgressChanged(progress: AsyncProgress, userData: object): void
  • Convenient "changed" callback for use with ostree_async_progress_new_and_connect() when pulling from a remote repository.

    Depending on the state of the #OstreeAsyncProgress, 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 user_data was a pointer to a #GSConsole instance. This is no longer the case, and user_data is ignored.

    Parameters

    • progress: AsyncProgress

      Async progress

    • userData: object

      User data

    Returns void

  • traverseNewReachable(): HashTable<string | number | symbol, string | number | boolean>
  • This hash table is a set of #GVariant which can be accessed via ostree_object_name_deserialize().

    Returns HashTable<string | number | symbol, string | number | boolean>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method