Commit Graph

63 Commits

Author SHA1 Message Date
Daniel Kolesa aca9e8e6a7 glib: bump glib requirement to 2.66 and port to GUri
This removes the old SoupURI copypasta from previous generation
of libsoup and opens up a path for a simple libsoup3 port.
2022-03-12 04:44:18 +01:00
Joseph Marrero 581a58067b Update FSF license notices to use URL instead of address 2021-12-07 08:34:25 -05:00
Felix Krull aa5df8995e lib: add some missing (out) annotations
Closes: #1861
Approved by: cgwalters
2019-05-19 14:50:08 +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
Colin Walters 9917887a3f lib/repo-file: Add casts to appease GLib g_object_ref cast PR
This fixes the build with https://bugzilla.gnome.org/show_bug.cgi?id=790697

Closes: #1363
Approved by: jlebon
2017-12-07 20:04:47 +00:00
Colin Walters 6e4146a354 tree-wide: Remove Emacs modelines
We added a `.dir-locals.el` in commit: 9a77017d87
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
2017-09-21 21:38:34 +00:00
Colin Walters d3900f90f4 lib/repofile: Follow symlinks for `g_file_read()`
This avoids `ostree cat /path/to/symlink` crashing, a longstanding embarassing
issue.

Closes: #915
Approved by: jlebon
2017-06-07 20:54:32 +00:00
Colin Walters 807a804b16 lib/repofile: Port mostly to new code style
Prep for a bugfix.

Closes: #915
Approved by: jlebon
2017-06-07 20:54:32 +00:00
Mathnerd314 4cb77c51db core: Use OSTREE_SHA256_STRING_LEN instead of 64
Closes: #359
Approved by: cgwalters
2016-06-22 16:10:01 +00:00
Jonathan Lebon 41661e47e1 small cleanups
- Revert 'cannot' --> 'can not' (it's the exception!)
- Remove duplicate function
- Squelch compiler warnings

Closes: #248
Approved by: cgwalters
2016-04-08 18:43:18 +00:00
Matthew Barnes 5307af5a7a repo: Validate checksums have correct length
ostree_checksum_bytes_peek() can return NULL if the checksum has an
incorrect length (most likely from disk corruption) but most callers
are not prepared to handle this and would likely crash.

Use ostree_checksum_bytes_peek_validate() instead, which sets a
GError on an invalid checksum.
2015-11-17 20:35:54 -05:00
Matthew Barnes c2c322efa9 Use g_autoptr(GVariant) instead of gs_unref_variant 2015-05-06 22:07:10 -04:00
Matthew Barnes 4ee1acd981 Use g_autoptr() for GIO object types
GLib 2.44 supplies all the necessary autocleanup macros for GIO types,
and libglnx backports the relevant macros for ostree.
2015-05-06 21:51:19 -04:00
Matthew Barnes 7a62d64968 Use g_autofree instead of gs_free 2015-05-06 21:50:17 -04:00
Colin Walters cdaa9517af repofile: Avoid segfault if querying child in non-directory
The user might "ostree ls /usr/bin/bash/blah", which previously would
segfault.

A somewhat related future enhancement here would be for "ostree ls" to
follow symbolic links.

Reported-by: Dusty Mabe <dustymabe@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=733476
2014-07-21 07:58:07 -04:00
James Antill d4d4cbda7a core: Fix g_file_get_uri/get_parse_name for non-root ostree files 2014-06-18 17:34:04 -04:00
Colin Walters f841313206 libostree: Ensure we set standard::type when querying files
This makes the obvious code to recursively enumerate directories
operate more sanely.

Noticed this while trying to write corrupt-repo-ref.js.
2014-01-19 13:19:10 -05:00
Jasper St. Pierre c7f9fc9c63 repo: Change the pairs of checksums to instead be based on OstreeRepoFiles
We want an OstreeRepoFile to be the way to reference a "filesystem
tree" that's stored in the repo, which is a combination of a DIR_TREE
and a DIR_META. The idea is that once you write an mtree to the repo
using ostree_repo_write_mtree, it becomes serialized and you get an
OstreeRepoFile in return.

Change any APIs that care about DIR_TREE / DIR_META checksums to care
about OstreeRepoFiles instead, which right now is mostly is
ostree_repo_write_commit.

https://bugzilla.gnome.org/show_bug.cgi?id=707727
2013-09-09 22:51:33 -04:00
Jasper St. Pierre 33db74d0ce repo-file: Base OstreeRepoFile on trees instead of commits
We want an OstreeRepoFile to be the way to represent a filesystem tree
inside an ostree repository. In order to do this, we need to drop the
commit from an OstreeRepoFile, and make that go to callers.

Switch all current users of ostree_repo_file_new_root to
ostree_repo_read_commit, and make the actual constructor private.

https://bugzilla.gnome.org/show_bug.cgi?id=707727
2013-09-09 22:31:59 -04:00
Colin Walters a071a3ec3a core: Delete unused OstreeRepoFile API
Was just unused, and it was using further API i want to remove.
2013-09-08 16:49:21 -04:00
Jasper St. Pierre f49ed9e74d builtin-commit: Don't parse the parent's GVariant by hand
Instead, use OstreeRepoFile as a handle for the parent commit.
We need to add an accessor for the metadata checksum, as that
hasn't been exposed before.

https://bugzilla.gnome.org/show_bug.cgi?id=707727
2013-09-08 11:50:51 -04:00
Jasper St. Pierre 8ac0f99ed6 repo-file: s/content_checksum/contents_checksum/
This is what we call it everywhere else, so just be consistent.
It also lines up with metadata_checksum better.

https://bugzilla.gnome.org/show_bug.cgi?id=707727
2013-09-08 11:50:51 -04:00
Colin Walters 356de33b49 repo: Drop ostree_repo_load_variant_c API
Originally we had this to avoid forcing callers to malloc() if they
had a csum, but nowadays we have in-place conversion APIs that are
fast enough.
2013-09-03 18:23:11 -04:00
Tobias Hunger ed56908ccb Fix warnings about unused variables 2013-08-30 14:23:45 -04:00
Colin Walters 0dec1b287c core: Reduce API surface for file access
This function was only used by internals, make it private.
2013-07-31 00:35:53 -04:00
Colin Walters 7c5c3f2af8 core: Fix all introspection warnings
Still lots more docs to write and API to cleanup, but this is better.
2013-07-27 10:13:30 -04:00
Colin Walters a5d43bb959 Install a shared library
This required a fair bit of surgery because previously ostree.h
included otutil.h, but that's supposed to be a private library.
2013-07-26 19:25:07 -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 a821420711 core: Add API to convert csum -> checksum without malloc()
Just doing some profiling, this was in the top malloc() callers.
2013-02-23 11:02:56 -05:00
Colin Walters 5761733218 Drop some bits from libotutil that are now merged in libgsystem 2012-11-29 16:24:49 -05:00
Colin Walters 2ced4abf11 core: Drop ot_clear_gvariant() in favor of g_clear_pointer 2012-07-17 08:14:33 -04:00
Colin Walters 8d926c3e36 core: Add valgrind framework, plug various memory leaks 2012-05-04 10:04:32 -04:00
Colin Walters 38ef75e6e0 core: Re-unify on one OSTREE_OBJECT_TYPE_FILE
Having the archived vs not distinction in the object system wasn't
useful in light of pack files.  In fact, we should probably move
towards generating a pack file per commit by default.
2012-04-11 22:27:59 -04:00
Colin Walters fa4cbc8b89 core: Drop wrapping of metadata variants 2012-04-11 22:04:05 -04:00
Colin Walters 11c0fbc738 core: Switch to 'ay' for checksums, drop versions/metadata 2012-04-11 22:04:00 -04:00
Colin Walters 8b6bf09d7a core: Port libostree to local alloc 2012-04-09 15:57:46 -04:00
Colin Walters 72398ab62c core: Fix xattr API to conform to coding style 2012-04-09 15:56:27 -04:00
Colin Walters 80bdfd7f42 core: Add pack files
This concept is also directly inspired by git.  At present, our
implementation is quite similar, except we don't have delta
compression.
2012-03-31 11:51:47 -04:00
Colin Walters db93c43255 core: Fix "cat" crashing when it should have returned ENOENT 2012-03-08 12:10:58 -05:00
Colin Walters f44b8aca44 core: Add ostree-types.h
This allows us to have circular references between the headers.
2012-03-06 11:59:06 -05:00
Colin Walters eb7c3d01a3 core: Add 'cat' builtin 2012-03-06 11:59:06 -05:00
Colin Walters 39fe050f04 core: Add standard::size to info we get from archives
This makes "ostree ls" show the file size.
2012-01-19 09:54:09 -05:00
Colin Walters e9fd921afe core: Change compose to operate purely in-memory
This is *significantly* faster than checking out each branch into the
real filesystem, then importing it again.
2011-12-21 21:42:13 -05:00
Colin Walters 06548f137e core: Make OstreeRepoFile "public"
* "ls" used it
* It's not like our internal API is 100% stable anyways
* The _ is ugly
2011-12-21 13:41:38 -05:00
Colin Walters 14d682305b core: Remove dead code from OstreeRepoFile
Originally I thought it would make sense for OstreeRepoFile to be
mutable, and it probably does, but we should do it in a different way.
2011-12-21 11:01:41 -05:00
Colin Walters 9a71ab187d core: INCOMPATIBLE CHANGE: Split archive files in two parts (meta and content)
This will allow us to have hardlink checkouts of archives.  A key use
case here is an archive repo of an OS (with root-owned files etc.)
where we want to do builds in a user tree.

A positive side effect of doing things this way is that now the SHA256
checksums for a given file should be identical regardless of whether
it's stored in an archive or bare repository.
2011-12-15 13:14:06 -05:00
Colin Walters b8e8b58585 core: INCOMPATIBLE CHANGE: Name repo files with their type (e.g. .dirmeta)
This makes inspection easier.  Internally the code gets simpler because
metadata and files are more unified; there is just one object type.
2011-12-12 12:29:09 -05:00
Colin Walters f6117de8d3 core: s/pack/archived/
This completes the rename from the previous commit.
2011-12-08 17:45:37 -05:00
Colin Walters d6ceb91c35 core: Make ot_transfer_out_value() take a & for the second argument
As Ray Strode argued, it's confusing to have something that looks like
a function be magical.  And OT_TRANSFER_OUT_VALUE is uglier.
2011-12-08 17:31:45 -05:00
Colin Walters 30c53a967c core: Switch is_archive to an enumeration
This is in preparation for adding a third mode.
2011-12-08 17:05:16 -05:00