summaryrefslogtreecommitdiff
path: root/src/ostree/ot-builtin-static-delta.c
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: Run clang-formatColin Walters2023-05-021-149/+168
| | | | | This is a one-time tree wide reformatting to ensure consistency going forward.
* Rename ostree-cmdprivate to drop out of introspectionColin Walters2022-06-021-1/+1
| | | | | | I was looking at our `.gir` and noticed we had the cmdprivate bits because the pattern for excluding headers is `-private.h`, which didn't match `cmdprivate.h`.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* static-delta: Fix probably not actually possible NULL derefColin Walters2021-10-131-1/+1
| | | | | | Flagged by `gcc -fanalyzer`. I didn't study this really deeply but I think it's not actually reachable. Anyways, let's catch it on general principle.
* deltas: Add CLI ops to list and reindex delta-indexesAlexander Larsson2020-10-231-0/+57
|
* bin/static-delta: Add signature parameters to apply-offlineFrédéric Danis2020-09-141-1/+55
| | | | | | 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/+76
| | | | | | | 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/+62
| | | | | | Add signing ability to "static-delta generate" builtin. Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
* 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
* 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
* bin: Port a few commands (diff,remote,static-delta) to new styleColin Walters2017-11-151-60/+38
| | | | | | | No functional changes, not prep for anything, just keeping up some momentum. Closes: #1344 Approved by: jlebon
* ostree: provide command description in a better placeRuixin Bao2017-10-201-5/+5
| | | | | | | | | | | | | | | | | | | This is similar idea as https://github.com/projectatomic/rpm-ostree/pull/916/commits/5c0bf889155573feec108501ce849ac09a0c9567, The duplicated description is now removed, and the description of the command is now displayed beneath the Usage. For example: ostree cat -h will output the following: "Usage: ostree cat [OPTION?] COMMIT PATH... Concatenate contents of files" Closes: #1267 Approved by: cgwalters
* ostree: move flags into command struct, pass down through builtinsRuixin Bao2017-10-201-19/+25
| | | | | | | | | | | | | | | | | | | | 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-7/+12
| | | | | | | | | | | | | | | | | 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/static-delta: Convert to new style and tweak outputJonathan Lebon2017-09-131-46/+29
| | | | | | | | | | Convert the whole file to new style. Also tweak the help outputs to make it similar enough to the other commands for tests to pass. Of course, we should just centralize all subcommand handling the same way it was done in rpm-ostree, though let's punt on that for now. Closes: #1126 Approved by: cgwalters
* ostree: Add naggy comments to help keep options in syncMatthew Barnes2017-08-151-0/+4
| | | | | | | | | | /* ATTENTION: * Please remember to update the bash-completion script (bash/ostree) and * man page (man/ostree-$COMMANDNAME.xml) when changing the option list. */ Closes: #1080 Approved by: cgwalters
* tree-wide: Use g_autoptr(Ostree*)Colin Walters2017-08-031-5/+5
| | | | | | | | | | | Part of cleaning up our usage of libglnx; we want to use what's in GLib where we can. Had to change a few .c files to `#include ostree.h` early on to pick up autoptrs for the core types. Closes: #1040 Approved by: jlebon
* ostree: Use G_OPTION_ARG_FILENAME where appropriatePhilip Withnall2017-04-271-1/+1
| | | | | | | | | | | | | Instead of using G_OPTION_ARG_STRING, use G_OPTION_ARG_FILENAME, which handles filename encoding conversion differently from the locale conversion which G_OPTION_ARG_STRING. This will fix argument handling on systems where the filename encoding is not the same as the locale encoding (which is fairly unlikely since most systems use UTF-8). Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #810 Approved by: cgwalters
* deltas: Expose the filename parameterGatis Paeglis2017-02-271-0/+5
| | | | | | | | | | | The C API (ostree_repo_static_delta_generate) knows what to do with it, but this parameter was never exposed via command line tool. Closes: https://github.com/ostreedev/ostree/issues/695 Closes: #703 Approved by: jlebon
* tree-wide: Switch to autoptr for GOptionContextColin Walters2016-12-081-15/+5
| | | | | | | | | | We were leaking in a few places that I noticed in an ASAN run. Also, this was one of the last non-autoptr cleanup sections we have in `out:` cleanup sections, making us a lot closer to a potential full-tree rewrite to `return FALSE`. Closes: #624 Approved by: jlebon
* [ASAN] cmdline: Fix minor leak in delta cmdline entrypointColin Walters2016-11-301-5/+7
| | | | | | | Small, but it's important to stay clean. Closes: #598 Approved by: jlebon
* tree-wide: Remove unused variables detected by CLangColin Walters2016-10-271-1/+0
| | | | | | | | | | CLang finds these, whereas GCC treats having `__attribute__((cleanup))` as a use. This obsoletes https://github.com/ostreedev/ostree/pull/411 Closes: #548 Approved by: jlebon
* static-delta: fix command contextsJonathan Lebon2016-07-291-2/+2
| | | | | Closes: #418 Approved by: cgwalters
* delta: Add --if-not-exists optionColin Walters2016-07-041-0/+16
| | | | | | | | | | I often want to have "idempotent" systems that iterate to a known state. If after generating a commit, the system is interrupted, I'd like the next run to still generate a delta. But we don't want to regenerate if one exists, hence this option. Closes: #375 Approved by: jlebon
* Add support for ostree static-delta deleteAlexander Larsson2016-04-081-0/+35
| | | | | Closes: #245 Approved by: giuseppe
* deltas: Use endianness marker when parsingColin Walters2016-02-261-0/+38
| | | | | Extend the `static-delta show` and `pull` commands to use the endianness information (if available).
* static-delta: Add `show` subcommandColin Walters2016-01-281-0/+35
| | | | | | | | | Right now though, almost all of the details of deltas are private, so we can't do the "honest thing" and have the command line just use the shared library. Eventually some of this should appear in the API, but for now add command line which is useful for debugging.
* static-delta apply-offline: Don't skip validationAlexander Larsson2015-11-101-1/+1
| | | | This makes no sense, at least by default.
* static-deltas generate: Add --inline option to CLI toolAlexander Larsson2015-11-101-0/+5
|
* static-delta: add max-bsdiff-size optionGiuseppe Scrivano2015-07-281-0/+5
| | | | | | | It allows to specify the maximum size for input files to attempt bsdiff compression for. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* pull: get rid of detached metadata for deltasGiuseppe Scrivano2015-05-071-21/+0
| | | | | | | Once the summary file will be signed, we can validate the superblock from there. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Use g_autoptr(GVariantBuilder) instead of gs_unref_variant_builderMatthew Barnes2015-05-061-1/+1
|
* Use g_autoptr(GPtrArray) instead of gs_unref_ptrarrayMatthew Barnes2015-05-061-1/+1
|
* Use glnx_unref_object instead of gs_unref_objectMatthew Barnes2015-05-061-4/+4
| | | | | For non-GIO object types, at least until autocleanup support for GObject based types becomes more widespread.
* Use g_autoptr() for GIO object typesMatthew Barnes2015-05-061-1/+1
| | | | | GLib 2.44 supplies all the necessary autocleanup macros for GIO types, and libglnx backports the relevant macros for ostree.
* Use g_autofree instead of gs_freeMatthew Barnes2015-05-061-4/+4
|
* Check repo permission prior to attempting to modify itMatthew Barnes2015-03-251-0/+6
| | | | | Fail early with a helpful message if the user does not have sufficient permission to modify an OSTree repository.
* ostree_repo_static_delta_generate: add new param "verbose"Giuseppe Scrivano2015-03-031-0/+2
| | | | | | | | | | it will be used by the next patch that adds "--generate-static-delta" to the commit command. As part of the patch, update the list of supported "params" in the documentation. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* static-delta: Add --disable-bsdiff optionColin Walters2015-03-031-0/+5
| | | | | A builder may not want to pay the CPU penalty. Also it's useful for evaluating performance.
* static delta generation: Separate max chunk size from min fallback sizeAlexander Larsson2015-01-201-4/+9
| | | | | | There is no particular reason these have to be the same. https://bugzilla.gnome.org/show_bug.cgi?id=721799
* static-delta: do not accept both --from=REV and --empty for generateGiuseppe Scrivano2015-01-151-0/+6
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Allow creating and pulling static deltas starting from "empty"Alexander Larsson2015-01-141-4/+13
| | | | | | | | | | | | | | | | | You create these with something like: ostree static-delta generate --empty --to=master These will be automatically used during pull if no previous revision exists in the target repo. These work very much like the normal static deltas except they are named just by the "to" revision. I.e: deltas/94/f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d for a from-scratch to 94f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d delta. https://bugzilla.gnome.org/show_bug.cgi?id=721799
* fix --help for static-deltaGiuseppe Scrivano2014-12-181-28/+55
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Static deltas supportColin Walters2014-12-181-65/+222
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=721799
* Refactor command-line parsingMatthew Barnes2014-11-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Initial basic static delta code dropColin Walters2014-02-041-0/+129
This has a very basic level of functionality (deltas can be generated, and applied offline). There is only some stubbed out pull code to fetch them via HTTP. But, better to commit this now and improve it from a known starting point, rather than have it languish in a branch.