summaryrefslogtreecommitdiff
path: root/bash
Commit message (Collapse)AuthorAgeFilesLines
* bin/remote: Rename list-gpg-keys to gpg-list-keysDan Nicholson2021-08-231-1/+1
| | | | | | | | | | | | | | | As pointed out in the original review, `gpg-list-keys` fits better alongside the existing `gpg-import`. Changes were done with: ``` git grep -l list-gpg-keys | xargs sed -i 's/list-gpg-keys/gpg-list-keys/' for src in $(git ls-files '*list-gpg-keys*'); do dst=${src/list-gpg-keys/gpg-list-keys} git mv "$src" "$dst" done ```
* bin/remote: Add list-gpg-keys subcommandDan Nicholson2021-07-151-0/+35
| | | | | | | | This provides a wrapper for the `ostree_repo_remote_get_gpg_keys` function to show the GPG keys associated with a remote. This is particularly useful for validating that GPG key updates have been applied. Tests are added, which checks the `ostree_repo_remote_get_gpg_keys` API by extension.
* Add an API+CLI to inject metadata for bootable OSTree commitsColin Walters2021-03-121-0/+1
| | | | | | | | | | | | | | | | | | | | | I was doing some rpm-ostree work and I wanted to compare two OSTree commits to see if the kernel has changed. I think this should be a lot more natural. Add `ostree commit --bootable` which calls into a new generic library API `ostree_commit_metadata_for_bootable()` that discovers the kernel version and injects it as an `ostree.linux` metadata key. And for extra clarity, add an `ostree.bootable` key. It's interesting because the "core" OSTree layer is all about generic files, but this is adding special APIs around bootable OSTree commits (as opposed to e.g. flatpak as well as things like rpm-ostree's pkgcache refs). Eventually, I'd like to ensure everyone is using this and hard require this metadata key for the `ostree admin deploy` flow - mainly to prevent accidents.
* pull: Allow disabling commit binding verificationDan Nicholson2020-12-171-0/+2
| | | | | | | | | | | | | | | | In some cases such as backups or mirroring you may want to pull commits from one repo to another even if there commits that have incorrect bindings. Fixing the commits in the source repository to have correct bindings may not be feasible, so provide a pull option to disable verification. For Endless we have several repositories that predate collection IDs and ref bindings. Later these repositories gained collection IDs to support the features they provide and ref bindings as the ostree tooling was upgraded. These repositories contain released commits that were valid to the clients they were targeting at the time. Correcting the bindings is not really an option as it would mean invalidating the repository history.
* bin/static-delta: Add signature parameters to apply-offlineFrédéric Danis2020-09-141-0/+3
| | | | | | This allows to check the delta signature before applying it. Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
* bin/static-delta: Add command to verify delta signatureFrédéric Danis2020-09-141-0/+34
| | | | | | | Add new "static-delta verify" sub-command. This supports multiple keys to verify the static-delta file. Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
* bin/static-delta: Add support to sign superblockFrédéric Danis2020-09-141-0/+5
| | | | | | Add signing ability to "static-delta generate" builtin. Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
* bash-completion: add completion for `ostree sign`Denis Pynkin2020-03-251-0/+43
| | | | | | Add bash completion with supported options for signing command. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
* bin/show: Add --print-sizes option to show sizes metadataDan Nicholson2020-01-201-0/+1
| | | | | Use the new `ostree_commit_get_object_sizes()` API to read the `ostree.sizes` commit metadata and print a summary.
* bin/refs: Allow overwriting existing refDan Nicholson2019-06-121-0/+1
| | | | | | | | | | | | | | Currently if you want to update a non-alias ref, you need to first check if it exists and use either `ostree refs --create` or `ostree reset` as appropriate. That's unnecessarily complicated and is much less convenient than the old `write-refs` builtin that simply called `ostree_repo_set_ref_immediate()` without any checks. Add a `--force` option to be used with `--create` that does not raise an error when the destination ref already exists. Closes: #1870 Approved by: jlebon
* remote-add: Add --force option to add or replace remoteDan Nicholson2019-02-081-0/+1
| | | | | | | | | This uses the OSTREE_REPO_REMOTE_CHANGE_REPLACE operation to add a remote or replace an existing one. This is roughly the opposite of --if-not-exists and will raise an error if both options are passed. Closes: #1166 Approved by: cgwalters
* bash-completion: Fix --repo autocompleteMatthew Leeds2018-10-011-7/+16
| | | | | | | | | | This commit fixes the bash tab completion handling of the "--repo" argument. Before this commit, the completion only works if "--repo" comes after the main command. After this commit, you can use "--repo" directly after "ostree" in the command line, as is natural. Closes: #1745 Approved by: jlebon
* src/ostree: Add --group option to ostree configSinny Kumari2018-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | Fetching value from a repo config using 'ostree config get SECTIONNAME.KEYNAME' didn't work in some cases like when having dots in Group Name entry. As per Desktop entry file specification, Group Name may contain all ASCII characters except for [ and ] and control characters. Link - https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html Having --group option will help user to clearly specify Group Name and get desired result. It also adds test for ostree config get|set and bash completion for --group option Fixes https://github.com/ostreedev/ostree/issues/1565 Closes: #1696 Approved by: cgwalters
* ostree/pull: Add network-retries command line optionRobert Fairley2018-07-051-0/+1
| | | | | | | | | | | | This exposes a way to specify from the command line the number of times to retry each download after a network error. If a negative value is given, then the default number of retries (5) is used. If 0 is given, then errors are returned without retrying. closes #1659 Closes: #1669 Approved by: jlebon
* Make P2P API public (no longer experimental)Matthew Leeds2018-06-041-0/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the API that allows P2P operations (e.g. pulling an ostree ref from a LAN or USB source) is hidden behind the configure flag --enable-experimental-api. This commit makes the API public and makes that flag essentially a no-op (leaving it in place in case we want to use it again in the future). The P2P API has been tested over the last several months and proven to work. This means that since we're no longer using the "experimental" feature flag, P2P builds of Flatpak will fail when using versions of OSTree from this commit onwards, until Flatpak is patched in the near future. If you want to build Flatpak < 0.11.8 with P2P enabled and link against OSTree 2018.6, you'll have to patch Flatpak. However, since Flatpak won't yet have a hard dependency on OSTree 2018.6, it needs a new way to determine if the P2P API in OSTree is available, so this commit adds a "p2p" feature flag. This way the feature set is more semantically correct than if we had continued to use the "experimental" feature flag. In addition to making the P2P API public, this commit makes the P2P unit tests run by default, removes the f27-experimental CI instance that's no longer needed, changes a few man pages to reflect the changes, and updates the bash completion script to accept the new commands and options. Closes: #1596 Approved by: cgwalters
* bash-completion: Don't add a space after files and directoriesMatthew Leeds2018-05-241-0/+2
| | | | | | | | | | | Currently if ostree is completing a file or directory for you it adds a space to the end, but this is an inconvenience when it's an intermediate directory in a tree. It's better to let the user add the space after the final directory, so this commit changes the bash completion to avoid adding a space when completing files or directories. Closes: #1598 Approved by: jlebon
* bash-completion: Remove `admin` completionsColin Walters2018-02-271-497/+0
| | | | | | | | | | | | | | | The `admin` commandline should be considered a demo; I just added the `pin` command *mostly* so we could use it for unit tests, although I can imagine other people using it. But maintaining completions is a lot of overhead right now, let's not do it for `admin`. The other command line options that operate on repos we will definitely maintain since they're used in releng contexts. Closes: #1468 Approved by: jlebon
* sysroot: Add concept of deployment "pinning" 📌Colin Walters2018-02-261-0/+31
| | | | | | | | | | | | | Example user story: Jane rebases her OS to a new major version N, and wants to keep around N-1 even after a few upgrades for a while so she can easily roll back. I plan to add `rpm-ostree rebase --pin` to opt-in to this for example. Builds on the new `libostree-transient` group to store pinning state there. Closes: https://github.com/ostreedev/ostree/issues/1460 Closes: #1464 Approved by: jlebon
* bash/ostree: add missing --add-metadata optionJonathan Lebon2018-01-101-0/+1
| | | | | Closes: #1402 Approved by: cgwalters
* bin/commit: add --keep-metadata optionJonathan Lebon2018-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | Clients of libostree such as rpm-ostree make extensive use of the `ostree commit -b foo --tree=ref=foo` pattern in their tests, e.g. to simulate an update. What I'm trying to solve here is that it's often the case that we want to keep metadata from the previous commit without having to be too verbose (i.e. reading from the parent, then passing it as an argument). The new `--keep-metadata` switch makes this really easy. I intend to use this in the rpm-ostree testsuite to make sure we always carry over the `source-title` metadata as well as during set up for tests that require `rpmostree.rpmdb.pkglist` metadata. I initially implemented this in a small wrapper script that uses the API directly, though we make use of so many other `ostree commit` functions that it'd require re-implementing a lot of it. Closes: #1402 Approved by: cgwalters
* bin/fsck: Make ref binding verification optionalColin Walters2017-12-141-0/+1
| | | | | | | | | | | | | Today the rpm-ostree test suite uses `refs --create` to save commits. I think this is a legitimate use case, and other people may be doing something similar. On the other hand, I think we should probably be changing the rpm-ostree test suite to create "unbound" commits. But let's be maximially compatible here since we hit a real-world case where something needed to change. Closes: #1379 Approved by: pwithnall
* ostree/fsck: Add --verify-back-refs optionPhilip Withnall2017-12-141-0/+1
| | | | | | | | | | | | | | | | | | This new option verifies that the refs listed in the ref-bindings for each commit all point to that commit (i.e. there aren’t multiple commits listing the same ref in their ref-bindings, and there aren’t any commits with non-empty ref-bindings which aren’t pointed at by a ref). This is useful when generating a new repository from scratch, but not useful when adding new commits to an existing repository (since the old commits will still, correctly, have ref-bindings from when the refs pointed at them). That’s why it has to be enabled explicitly using --verify-back-refs, rather than being on by default. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1347 Approved by: cgwalters
* lib/core: add ostree_checksum_file_at APIJonathan Lebon2017-10-121-0/+1
| | | | | | | | | | | This is like `ostree_checksum_file` but fd-relative. This will be used by https://github.com/ostreedev/ostree/pull/1258. AFAICT, we actually didn't have any tests that check the `checksum` CLI. Add a basic one here to test the old code as well as the new code. Closes: #1263 Approved by: cgwalters
* commit: Add _CONSUME modifier flagColin Walters2017-10-101-0/+1
| | | | | | | | | | | | | | For many cases of commit, we can actually optimize things by simply "adopting" the object rather than writing a new copy. For example, in rpm-ostree package layering. We can only make that optimization though if we take ownership of the file. This commit hence adds an API where a caller tells us to do so. For now, that just means we `unlink()` the files/dirs as we go, but we can now later add the "adopt" optimization. Closes: #1255 Approved by: jlebon
* lib/checkout: Rename disjoint union, change to merge identical filesColin Walters2017-09-131-1/+1
| | | | | | | | | | | | | It turns out that librpm automatically merges identical files between distinct packages, and this occurs in practice with Fedora today between `chkconfig` and `initscripts` for exmaple. Since we added this for rpm-ostree, we basically want to do what librpm does, let's change the semantics to do a merge. While we're here rename to `UNION_IDENTICAL`. Closes: #1156 Approved by: jlebon
* checkout: add an extra checkout_overwrite modeRuixin2017-09-011-0/+1
| | | | | | | | | | | | This is for issue projectatomic/rpm-ostree#365, an extra option of overwrite mode is added to the checkout command so that when there is "non-directory" file already exist during checkout, the error will be handled. Some tests are added for regression Closes: #1116 Approved by: cgwalters
* Remove shebang from bash completionsSimon McVittie2017-08-291-2/+0
| | | | | | | | | | | | | bash completions are to be sourced. It makes little sense to execute them. Detected by Debian's Lintian tool, which warns about non-executable files that appear to be #! scripts. Signed-off-by: Simon McVittie <smcv@collabora.com> Closes: #1119 Approved by: cgwalters
* ostree-sysroot: make simple_write_deployment smarterJonathan Lebon2017-08-251-0/+3
| | | | | | | | | | | | | | | | | | | | This is a follow-up to https://github.com/ostreedev/ostree/pull/1097. We make simple_write_deployment smart enough so that it can be used for rpm-ostree's purposes. This is mostly an upstreaming of logic that already existed there. Notably we correctly append NOT_DEFAULT deployments *after* the booted deployment and we now support RETAIN_PENDING and RETAIN_ROLLBACK flags to have more granularity on deployment pruning. Expose these new flags on the CLI using new options (as well as expose the previously existing NOT_DEFAULT flag as --not-as-default). I couldn't add tests for --retain-pending because the merge deployment is always the topmost one. Though I did check that it worked in a VM. Closes: #1110 Approved by: cgwalters
* bash: Add bash completionMatthew Barnes2017-08-151-0/+2148
Completes commands, options, commit checksums, ref names, remotes, and file paths. Closes: #1077 Approved by: jlebon