Commit Graph

36 Commits

Author SHA1 Message Date
Alexander Larsson
744967a6e4 libotutil: Link to crypto libs
The checksum utils uses the crypto lib, but we're not explicitly linking
to it. I think this is why the CI got this error when using openssl
on debian, during ostree binary linking:

/usr/bin/ld: ./.libs/libotutil.a(libotutil_la-ot-checksum-utils.o): undefined reference to symbol 'EVP_DigestInit_ex@@OPENSSL_3.0.0'
/usr/bin/ld: /lib/x86_64-linux-gnu/libcrypto.so.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
2023-07-07 20:19:59 +02:00
Joseph Marrero
581a58067b Update FSF license notices to use URL instead of address 2021-12-07 08:34:25 -05:00
Dan Nicholson
fbff05e28d libotutil: Import implementation of zbase32 encoding
This will be used to implement the PGP Web Key Directory (WKD) URL
generation. This is a slightly cleaned up implementation[1] taken from
the zbase32 author's original implementation[2]. It provides a single
zbase32_encode API to convert a set of bytes to the zbase32 encoding.

I believe this should be acceptable for inclusion in ostree. The license
in the source files is BSD style while the original repo LICENSE file
claims the Creative Commons CC0 1.0 Universal license, which is public
domain.

1. https://github.com/dbnicholson/libbase32/tree/for-ostree
2. https://github.com/zooko/libbase32
2021-07-15 15:50:04 -06:00
Denis Pynkin
ca8752e01b build: Conditionally build GPGME-related sources
Do not build GPGME-related sources if flag USE_GPGME is not defined.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>

Closes: #1889
Approved by: cgwalters
2019-08-01 02:06:47 +00:00
Marcus Folkesson
6bf4b3e1d8 Add SPDX-License-Identifier to source files
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
2018-01-30 20:03:42 +00:00
Alexander Larsson
72bb1a6b17 Add OtVariantBuilder
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
2017-10-27 21:49:26 +00:00
Colin Walters
a903f96673 lib/util: Delete some unused functions
Hooray, dead code.

Closes: #1254
Approved by: jlebon
2017-10-05 15:41:00 +00:00
Colin Walters
de153dea30 lib/sysroot: Add journal-msg signal
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
2017-08-10 14:20:00 +00:00
Colin Walters
2571e21b41 libutil: Delete unused threadpool wrapper
This is dead code since 9cc9804195 where
pull-local became just a wrapper for pull, which has its own threading.

Closes: #767
Approved by: jlebon
2017-03-30 13:14:43 +00:00
Colin Walters
c2f5a999bf lib: Add a private copy of checksum-instream
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
2017-03-20 18:32:40 +00:00
Colin Walters
9e2763106b lib: Use sd_journal directly (optionally)
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
2016-06-21 18:24:17 +00:00
Matthew Barnes
ceacc57206 libotutil: Establish a place for GPG utilities
Add ot-gpg-utils.[ch] and move _ostree_gpg_error_to_gio_error() here.
2015-05-01 10:20:34 -04:00
Giuseppe Scrivano
c70abfd43c src: Move ot-tool-util from ostree/ to libotutil/
These utilities are not actually specific to the ostree commandline.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:38 +01:00
Giuseppe Scrivano
479b5ab4fc libotutil: remove ot-waitable-queue.
The module is not not used anymore.  It can be restored from git if
needed again.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-06 18:45:38 +01:00
Colin Walters
965a304a17 Use libglnx
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.
2015-02-22 21:02:27 -05:00
Colin Walters
b756a13a65 Extract opendirat() helper function into libotutil
We were duplicating the code to do an opendirat() in a few places.
2014-09-16 11:34:39 -04:00
Colin Walters
1bdabda5f3 Use external libgsystem 2014.2
It's been split off for a while, let's kill the code duplication.

Among other things, this fixes the systemd detection for the journal
logging.
2014-04-04 16:52:37 -04:00
Colin Walters
26cef497a6 Remove built in "triggers"
Originally, the idea was that clients would replicate "OS/tree"s from
a build server, but we'd run things like "ldconfig" on the client.
This was to allow adding e.g. the nVidia binary driver.

However, the triggers were the only thing in the system at the moment
that really had expected knowledge of the *contents* of the OS, like
the location of binaries.

For now, it's architecturally cleaner if we move the burden of
triggers to the tree builder (e.g. gnome-ostree or RPM).  Eventually
we may want OSTree to assist with this type of thing (perhaps
something like RPM %ghost), but this is the right thing to do now.
2013-07-07 14:37:59 -04:00
Colin Walters
4b170d656c Switch to libgsystem local allocation macros
And drop our compatibility wrapper.
2013-07-07 12:27:44 -04:00
Colin Walters
bac4d7a0d2 pull: Rework threading communication model
Previously, I've observed bugs where we either:
1) Exit too early, leaving undownloaded objects
2) Hang while downloading

This rewrite hopefully fixes both.
2013-04-01 18:56:38 -04:00
Colin Walters
5c1dc390ae pull: Asynchronous metadata fetch
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.
2012-10-03 22:35:33 -04:00
Colin Walters
31153913ff Extract keyfile helpers into libotutil
Will be used by ostree-pull too soon.
2012-09-15 11:20:56 -04:00
Colin Walters
c63cca53d7 build: Add --enable-triggers-only
For bootstrapping gnome-ostree, we need to install the triggers early
on, before we actually build the real ostree binary.
2012-08-26 13:58:23 -04:00
Colin Walters
da43fb6db5 Hard require GLib 2.34
Anyone wanting to build against an earlier version can use the
embedded-dependencies system.
2012-07-15 18:22:41 -04:00
Colin Walters
464f4a81c9 Add libgsystem as git external
Don't replace ot_lfree and stuff yet though...to much code churn.
2012-07-15 11:59:05 -04:00
Colin Walters
78b0d99238 Support building with embedded glib 2012-06-14 13:45:59 -04:00
Colin Walters
18b6f5fd0c ostadmin: Initial code 2012-05-07 20:43:03 -04:00
Colin Walters
f15c184584 core: Clean up checksumming
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.
2012-04-11 22:04:06 -04:00
Colin Walters
ca08ad6c5e core: Add macros for local allocation
This is GCC-specific, but it makes the code significantly
cleaner.
2012-04-09 15:56:28 -04:00
Colin Walters
e8865af09e core: Split pull functionality into separate ostree-pull binary
This is to avoid everything depending on libsoup.
2011-11-30 09:21:14 -05:00
Colin Walters
18f0b537a4 build: Move sources into src/ again
This is necessary if we want to build when srcdir == builddir,
otherwise we blow up because "ostree" is a source directory and a
binary.
2011-11-14 15:39:38 -05:00
Colin Walters
f5cf1a54de Switch to using explicit WARN_CFLAGS
The rationale is documented well in the automake manual.
2011-11-11 06:55:14 -05:00
Colin Walters
659c99417c Switch to LGPLv2+ for most code
Since we're making a shared library, it should be usable by non-GPL
apps.

To allow more code sharing between the core and the tests, move them
to the LGPLv2+ too.

A few bits of test and other code are still GPL.  See the new COPYING
file for more information.
2011-11-10 13:17:04 -05:00
Colin Walters
ed90bf77cc core: Make compose commits contain metadata about their composition
This allows tracking of their history better.
2011-11-04 15:59:08 -04:00
Colin Walters
8bca739315 Some work on ostree-build 2011-11-03 16:25:35 -04:00
Colin Walters
21c7ff74b6 De-recursify source tree 2011-11-02 15:45:32 -04:00