summaryrefslogtreecommitdiff
path: root/src/libotutil/otutil.h
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: Run clang-formatColin Walters2023-05-021-21/+39
| | | | | This is a one-time tree wide reformatting to ensure consistency going forward.
* lib/util: add syslog.h for ot_journal_print()Christian Hergert2022-02-111-0/+5
| | | | If we aren't including sd-journal, we may need this too.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* sysroot: Handle ro /boot but rw /sysrootColin Walters2021-01-101-0/+6
| | | | | | | | | | | | | | | | | The recent change in https://github.com/coreos/fedora-coreos-config/pull/659 broke some of our tests that do `mount -o remount,rw /sysroot` but leave `/boot` read-only. We had code for having `/boot` read-only before `/sysroot` but in practice we had a file descriptor for `/sysroot` that we opened before the remount that would happen later on. Clean things up here so that in the library, we also remount `/boot` at the same time we remount `/sysroot` if either are readonly. Delete the legacy code for remounting `/boot` rw if we're not in a mount namespace. I am fairly confident most users are either using the `ostree` CLI, or they're using the mount namespace.
* Add g_autoptr helper for pushing a thread default main contextAlexander Larsson2020-09-111-0/+25
| | | | | | This happens in a bunch of places, and currently each time it does we have to use "goto out" style cleanups, which just isn't looking very nice.
* gpg: conditionally build GPG-related code for sign/verificationDenis Pynkin2019-08-011-1/+4
| | | | | | | | | | | | Do not build the code related to GPG sign and verification if GPGME support is disabled. Public functions return error 'G_IO_ERROR_NOT_SUPPORTED' in case if gpg-related check is rquested. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com> Closes: #1889 Approved by: cgwalters
* lib/kargs: Make API public and upstream new rpm-ostree APIsAllen Bai2019-06-181-0/+1
| | | | | | | | | | | | | | | | This change makes public the current kargs API in src/libostree/ostree-kernel-args.c and adds documentations. Upstreams the new kargs API from rpm-ostree/src/libpriv/rpmostree-kargs-process.c Merges libostree_kernel_args_la_SOURCES to libostree_1_la_SOURCES in Makefile-libostree.am Upstreams tests/check/test-kargs.c from rpm-ostree. Closes: #1833 Closes: #1869 Approved by: jlebon
* lib: Add ot_journal_* helper macrosJonathan Lebon2019-04-241-0/+8
| | | | | | | | | Rather than wrapping each instance of `sd_journal_*` with `HAVE_SYSTEMD`, let's just add some convenience macros that are just no-op if we're not compiling with systemd. Closes: #1841 Approved by: cgwalters
* 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
* Add OtVariantBuilderAlexander Larsson2017-10-271-0/+1
| | | | | | | | | | This is similar to GVariantBuilder in that it constructs variant containers, but it writes it directly to a file descriptor rather than keep the entier thing in memory. This is useful to create large variants without using a lot of memory. Closes: #1309 Approved by: cgwalters
* lib/util: Delete some unused functionsColin Walters2017-10-051-2/+0
| | | | | | | Hooray, dead code. Closes: #1254 Approved by: jlebon
* 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
* lib/sysroot: Add journal-msg signalColin Walters2017-08-101-1/+0
| | | | | | | | | | | | | | | This will allow us to drop the awful hack in rpm-ostree where we watch our own stdout. In general, libraries shouldn't write to stdout. Also we can kill the systemd journal wrapper code. There's some duplication at each call site now...but it's easier than trying to write a `sd_journal_send()` wrapper. I was originally going to have this emit all of the structured data too as a `GVariant` but decided it wasn't worth it right now. Closes: #1052 Approved by: jlebon
* libutil: Delete unused threadpool wrapperColin Walters2017-03-301-1/+0
| | | | | | | | This is dead code since 9cc98041953090160dde48afa69b97c936541cdb where pull-local became just a wrapper for pull, which has its own threading. Closes: #767 Approved by: jlebon
* lib: Add a private copy of checksum-instreamColin Walters2017-03-201-0/+1
| | | | | | | | | | | | The current `OstreeChecksumInputStream` is public due to a historical mistake. I'd like to add an OpenSSL checksum backend, but that's harder without breaking this API. Let's ignore it and create a new private version, so it's easier to do the GLib/OpenSSL abstraction in one place. Closes: #738 Approved by: jlebon
* Define an initializer for GVariant{Builder,Dict}Colin Walters2016-10-271-0/+7
| | | | | | | | So we build warning-free on GLib (< 2.50, >= 2.50). This is a band aid until we hard-require >= 2.50. Closes: #547 Approved by: jlebon
* Final excision of libgsystem dependencyColin Walters2016-08-091-2/+0
| | | | | | | | | | | | | | Lots and lots of preparation led to this moment - when nothing apparent changes for users! Woo! But seriously, having the extra dependency is a minor annoyance, and in the big picture I think the libgsystem idea was wrong - we need to land things in GLib, and use git submodules for API-unstable or Linux-specific sharing. For a lot of OSTree, the libgsystem `GFile*` orientation was also wrong, we really want fd-relative. Closes: #444 Approved by: jlebon
* lib: Use sd_journal directly (optionally)Colin Walters2016-06-211-0/+1
| | | | | | | | | | | | | | This was the last caller of libgsystem that isn't `gs_file_get_path_cached()`. I think the use case ostree has where the same code can be called via command line and via a shared library *and* via a daemon is rather unusual, so let's just copy the code for logging from libgsystem into here. For example rpm-ostree hard depends on a daemon mode, so it'll just use `sd_journal` directly. Closes: #341 Approved by: jlebon
* libotutil: Establish a place for GPG utilitiesMatthew Barnes2015-05-011-0/+1
| | | | Add ot-gpg-utils.[ch] and move _ostree_gpg_error_to_gio_error() here.
* libotutil: remove ot-waitable-queue.Giuseppe Scrivano2015-03-061-1/+0
| | | | | | | The module is not not used anymore. It can be restored from git if needed again. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Use libglnxColin Walters2015-02-221-0/+1
| | | | | | Starting down the path of not using libgsystem. The main win here will be code sharing between ostree/rpm-ostree as well as going down the path of not using GFile * for local files.
* Extract opendirat() helper function into libotutilColin Walters2014-09-161-0/+1
| | | | We were duplicating the code to do an opendirat() in a few places.
* Add --verbose and -v arguments to ostree for detailsStef Walter2013-08-131-1/+0
| | | | | | Use the GLib debug mechanism to handle verbose output. https://bugzilla.gnome.org/show_bug.cgi?id=705905
* Install a shared libraryColin Walters2013-07-261-0/+1
| | | | | This required a fair bit of surgery because previously ostree.h included otutil.h, but that's supposed to be a private library.
* Switch to #pragma once for headersColin Walters2013-07-091-3/+1
| | | | It's just less tedious, and we're GCC/LLVM specific anyways.
* Switch to libgsystem local allocation macrosColin Walters2013-07-071-1/+0
| | | | And drop our compatibility wrapper.
* pull: Rework threading communication modelColin Walters2013-04-011-1/+1
| | | | | | | | Previously, I've observed bugs where we either: 1) Exit too early, leaving undownloaded objects 2) Hang while downloading This rewrite hopefully fixes both.
* Update to the latest libgsystemColin Walters2013-01-231-0/+2
|
* pull: Asynchronous metadata fetchColin Walters2012-10-031-0/+1
| | | | | | | | | | Create a worker thread for processing metadata, reserving the main thread for HTTP requests. This can create a very significant efficiency win for large pull requests since we are much more likely to keep a full pipeline open. The status display is also nicer now.
* Extract keyfile helpers into libotutilColin Walters2012-09-151-0/+1
| | | | Will be used by ostree-pull too soon.
* core: Remove ot_clear_checksum() in favor of g_clear_pointer()Colin Walters2012-07-171-8/+0
|
* Hard require GLib 2.34Colin Walters2012-07-151-1/+0
| | | | | Anyone wanting to build against an earlier version can use the embedded-dependencies system.
* ostadmin: Initial codeColin Walters2012-05-071-0/+5
|
* core: Clean up checksummingColin Walters2012-04-111-0/+1
| | | | | | | | Don't expose GChecksum in APIs. Add a new stream class which allows us to pass an input stream somewhere, but gather a checksum as it's read. Move some bits of the internals towards binary csums.
* core: Add macros for local allocationColin Walters2012-04-091-0/+1
| | | | | This is GCC-specific, but it makes the code significantly cleaner.
* libotuil: Fix missing #define in headerColin Walters2012-03-061-0/+1
|
* core: Make ot_transfer_out_value() take a & for the second argumentColin Walters2011-12-081-2/+2
| | | | | As Ray Strode argued, it's confusing to have something that looks like a function be magical. And OT_TRANSFER_OUT_VALUE is uglier.
* core: New ot_transfer_out_value() macroColin Walters2011-12-021-0/+8
| | | | This makes out values considerably less typing.
* otutil: New utility functionsColin Walters2011-11-291-0/+10
|
* build: Move sources into src/ againColin Walters2011-11-141-0/+31
| | | | | | This is necessary if we want to build when srcdir == builddir, otherwise we blow up because "ostree" is a source directory and a binary.
* De-recursify source treeColin Walters2011-11-021-28/+0
|
* core: add ^ for rev-parseColin Walters2011-11-021-0/+1
|
* "Hacktree" is now known as "OSTree"Colin Walters2011-10-181-0/+27
It just sounds better.