summaryrefslogtreecommitdiff
path: root/src/ostree/ot-main.h
Commit message (Collapse)AuthorAgeFilesLines
* main: add support for CLI extensions via external binariesLuca BRUNO2021-12-201-0/+6
| | | | | | | | | | This adds some logic to detect and dispatch unknown subcommands to extensions available in `$PATH`. Additional commands can be implemented by adding relevant `ostree-$verb` binaries to the system. As an example, if a `/usr/bin/ostree-extcommand` extension is provided, the execution of `ostree extcommand --help` will be dispatched to that as `ostree-extcommand extcommand --help`.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* bin: Hide `admin instutil` commandColin Walters2018-04-111-1/+2
| | | | | | | | | | | | | Add a "hidden command" flag, and use it for `admin instutil` since I regret adding it, and people should be using the API. Prep for adding another hidden command as part of staging deployments. (Down the line we should investigate deduplicating the recursive command parsing code) Closes: #1535 Approved by: jlebon
* main, status: Factor out deployment printing into helperColin Walters2018-03-191-0/+15
| | | | | | | | | | | | | Prep for staged deployments; they won't be in the primary deployment list, and we want to print them first. Also pull in some code from rpm-ostree for the red/bold bits and use that tree-wide. Update submodule: libglnx Closes: #1504 Approved by: jlebon
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* ostree: move flags into command struct, pass down through builtinsRuixin Bao2017-10-201-2/+17
| | | | | | | | | | | | | | | | | | | | This is a similar approach as https://github.com/projectatomic/rpm-ostree/commit/12c34bb2491a07079c911ef26401fee939e5573c. One thing to note is when we parse the admin related functions, we still keep the old admin related flags, and added a new parameter to represent the command struct. This allows us to identify the caller of the function, making it easier for us to possibly deduplicate the subcommand handling in the future. A similar approach is done in rpm-ostree: https://github.com/projectatomic/rpm-ostree/commit/83aeb018c1012c7a43783c09b74ec71bc9c45826 This also makes it easier for us to change the prototype of the function. If we want to add something new in the future, we won't need to touch every prototype. Closes: #1267 Approved by: cgwalters
* ostree: Describe subcommands in help outputRuixin Bao2017-10-201-0/+1
| | | | | | | | | | | | | | | | | Added a description argument to all type of commands. Now when we include -h or --help for commands that contain subcommands, the description for those subcommands are shown. The added subcommands help will be provided to the following commands: - ostree -h - ostree admin -h - ostree admin instutil -h - ostree remote -h - ostree static-delta -h Closes: #1267 Approved by: cgwalters
* tree-wide: Remove Emacs modelinesColin Walters2017-09-211-2/+1
| | | | | | | | | We added a `.dir-locals.el` in commit: 9a77017d87b74c5e2895cdd64ad098018929403f There's no need to have it per-file, with that people might think to add other editors, which is the wrong direction. Closes: #1206 Approved by: jlebon
* bin/admin: Change init-fs to stop loading a sysroot to init oneColin Walters2017-09-011-2/+3
| | | | | | | | | | | | | This is exactly analogous to the `ostree init` case where we have `OSTREE_BUILTIN_FLAG_NO_REPO` to avoid trying to load a repo when we're creating one. Let's avoid the pointless sysroot for `init-fs`; among other things this will then let us do `ostree_sysroot_load()` inside the argument parsing, and drop it from every other user. Closes: #1123 Approved by: jlebon
* Add a notion of "physical" sysroot, use for remote writingColin Walters2017-07-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Note this PR was reverted in <https://github.com/ostreedev/ostree/pull/902>; this version should be better) Using `${sysroot}` to mean the physical storage root: We don't want to write to `${sysroot}/etc/ostree/remotes.d`, since nothing will read it, and really `${sysroot}` should just have `/ostree` (ideally). Today the Anaconda rpmostree code ends up writing there. Fix this by adding a notion of "physical" sysroot. We determine whether the path is physical by checking for `/sysroot`, which exists in deployment roots (and there shouldn't be a `${sysroot}/sysroot`). In order to unit test this, I added a `--sysroot` argument to `remote add`. However, doing this better would require reworking the command line parsing for the `remote` argument to support specifying `--repo` or `--sysroot`, and I didn't quite want to do that yet in this patch. This second iteration of this patch fixes the bug we hit the first time; embarassingly enough I broke `ostree remote list` finding system remotes. The fix is to have `ostree_repo_open()` figure out whether it's the same as `/ostree/repo` for now. Down the line...we might consider having the `ostree remote` command line itself instatiate an `OstreeSysroot` by default, but this maximizes compatibility; we just have to pay a small cost that `ostree` usage outside of that case like `ostree static-delta` in a releng Jenkins job or whatever will do this `stat()` too. Closes: https://github.com/ostreedev/ostree/issues/892 Closes: #1008 Approved by: mbarnes
* Build on older versions of glibAlexander Larsson2016-05-251-1/+1
| | | | | | | | | | Various places need to include libglnx.h for the autoptr backport fallbacks to be there before ostree-autocleanups.h is included. This fixes the build on centos7· Closes: #309 Approved by: giuseppe
* prune: add --delete-commitGiuseppe Scrivano2015-11-161-0/+2
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* admin: Use locking for most sysroot commandsColin Walters2015-05-131-1/+2
| | | | | | | | | | The previous commit introduced locking for `ostree admin deploy`, but we do expect people to possibly accidentally do e.g. `ostree admin upgrade` concurrently. Using consistent locking in the admin commands will help rpm-ostree. Closes: https://github.com/GNOME/ostree/pull/110
* Juggling libglnx.h includesMatthew Barnes2015-05-061-0/+1
|
* pull: Print GPG signature status as soon as its knownMatthew Barnes2015-04-161-0/+2
|
* Add OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSERMatthew Barnes2015-03-251-0/+1
| | | | | | | Indicates the command requires superuser privilege. Fails early with a more helpful message than would otherwise be returned by libostree. Currently all admin commands except 'status' require superuser.
* Add OstreeAdminBuiltinFlags for admin commandsMatthew Barnes2015-03-251-0/+5
| | | | Only OSTREE_ADMIN_BUILTIN_FLAG_NONE so far; does nothing.
* Add ostree_ensure_repo_writable()Matthew Barnes2015-03-251-0/+2
| | | | | | | Commands that need to write files within the repo directory can call this early to ensure the directory is writable for the current user. If not, it fails with a helpful "You need to be root to perform this command" message.
* Refactor command-line parsingMatthew Barnes2014-11-241-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor command-line parsing to better utilize GOptionContext. This eliminates most of the manual parsing and global options are now shown in the help output. Here's a sample: $ ostree admin --help Usage: ostree admin [OPTION...] --print-current-dir|COMMAND Builtin "admin" Commands: cleanup config-diff deploy init-fs instutil os-init status switch undeploy upgrade Help Options: -h, --help Show help options Application Options: --sysroot=PATH Create a new OSTree sysroot at PATH -v, --verbose Print debug information during command processing --version Print version information and exit https://bugzilla.gnome.org/show_bug.cgi?id=740295
* main: Print error: in red bold just for funColin Walters2013-09-181-2/+0
| | | | It's easier to see. Also drop old dead ot_main() function.
* main: Code cleanup by passing OstreeRepo * directly to builtinsColin Walters2013-08-251-3/+4
| | | | | | | | | | It turns out every builtin (with one special exception) that takes a repo argument did the same thing; let's just centralize it. The special exception was "ostree init --repo=foo" where foo is expected to *not* actually be a repo. In that case, simply skip the ostree_repo_check() invocation. https://bugzilla.gnome.org/show_bug.cgi?id=706762
* Better parsing for global ostree optionsStef Walter2013-08-131-7/+0
| | | | | | | | | | | | | | | | * Specifying global options after the command for a more natural: # ostree commit --repo=/path/to/repo ... * Support asking for --help without --repo # ostree commit --help * Support short form of -h * Support specifying --repo without equals sign # ostree --repo /path/to/repo commit ... * Support global --help and -h # ostree --help * Ditto for ostree admin sub commands * Removed some leaky code https://bugzilla.gnome.org/show_bug.cgi?id=705903
* main: Move GCancellable to toplevelColin Walters2013-07-161-1/+1
| | | | | This is just cleaner, and makes the builtins slightly more of a library, which in turn makes it easier to turn them into real API.
* Switch to #pragma once for headersColin Walters2013-07-091-0/+2
| | | | It's just less tedious, and we're GCC/LLVM specific anyways.
* Move "ostadmin" => "ostree admin"Colin Walters2012-09-081-0/+7
| | | | This helps us avoid polluting the global binary namespace.
* Include pull and other external commands in usage outputStef Walter2012-08-191-4/+4
|
* Support non-builtin commandsStef Walter2012-08-101-0/+3
| | | | | * Support executing commands in the path * This makes 'ostree-pull' work as 'ostree pull'
* core: Use GFile for repo constructor API, and a bit more internallyColin Walters2011-12-221-1/+1
| | | | | Also, ensure that the repo directory GFile is absolute - this avoids a getcwd() syscall every time we construct a GFile object.
* core: Split pull functionality into separate ostree-pull binaryColin Walters2011-11-301-0/+37
This is to avoid everything depending on libsoup.