Commit Graph

47 Commits

Author SHA1 Message Date
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
Colin Walters ae3a5e3c07 core: Clean up filename utility API
Remove more unused functions, and change pathname splitting to handle
more cases like duplicate //, and to throw an error on .. as a filename.
2011-12-04 12:12:34 -05:00
Colin Walters 0003e101f6 core: New ot_transfer_out_value() macro
This makes out values considerably less typing.
2011-12-02 18:17:06 -05:00
Colin Walters 7fc625c967 core: Move pack file parsing into core, add ostree_create_file_from_input() API
This moves us closer to consistently passing around a triple of:
  (GFileInfo *info, GVariant *xattrs, GInputStream *content)
Which will help the libarchive work.
2011-12-02 10:11:09 -05:00
Colin Walters b296dc4efc core: Some tweaks to ls output 2011-11-28 10:17:49 -05:00
Colin Walters 87547827c8 core: Add ls builtin 2011-11-27 20:10:48 -05:00
Colin Walters 3c025e526f core: Ad ot_clear_gvariant(), use it
This saves us a conditional.
2011-11-22 10:20:10 -05:00
Colin Walters 860c3cf502 core: Convert public get_object_path() to GFile* 2011-11-18 09:04:25 -05:00
Colin Walters 231f7ed76c core: Use ot_gfile_ prefix for new local GFile creation function 2011-11-18 08:10:23 -05:00
Colin Walters 218684786d core: Use GFile for xattr API 2011-11-17 18:33:26 -05:00
Colin Walters a8735778f0 core: Use ot_gfile_get_path_cached() pervasively
This requires no free() calls and is just better.
2011-11-17 18:23:36 -05:00
Colin Walters aa865bbb83 core: Validate file names read from directory variants
In a future where we pull data from remote servers, we don't want
to allow path uplinks.
2011-11-16 23:23:30 -05:00
Colin Walters c33db03b4c core: Flesh out diff a bit more
Now correctly notices changes to directory metadata (not just
contents).
2011-11-16 22:51:09 -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