Commit Graph

440 Commits

Author SHA1 Message Date
Colin Walters 7c903eb889 repo: Remove set-but-unused variable
The gpgme examples use this, but from what I can tell we don't really
need to because we don't need detailed results; we only care whether
we signed it at all.
2013-10-15 16:44:19 -04:00
Colin Walters 7b119370a2 repo: Enumerate objects using openat() too, make more efficient
This drops several calls to malloc()/g_object_new() per object
enumeration.  Just a followup to using openat() and friends in other
places.
2013-09-30 08:51:25 -04:00
Jeremy Whiting 7f9eefb62d pull: Verify commits with gpg signatures from detached metadata
This uses gpgv for verification against DATADIR/ostree/pubring.gpg by
default.  The keyring can be overridden by specifying OSTREE_GPG_HOME.

Add a unit test for commit signing with gpg key and verifying on pull;
to implement this we ship a test GPG key generated with no password
for Ostree Tester <test@test.com>.

Change all of the existing tests to disable GPG verification.
2013-09-29 14:49:47 -04:00
Jeremy Whiting 7d5aa74dae core: Use libgpgme to add GPG signatures to detached metadata for commit object
Add an optional dependency on gpgme to add GPG signatures into the
detached metadata, with the key "ostree.gpgsigs", as an "aay", an
array of signatures (treated as binary data).

The commit command gains a --gpg-sign=<key-id> argument.  Also add an
argument --gpg-homedir to set the GPG homedir where we look for
keyrings.
2013-09-28 16:12:35 -04:00
Colin Walters 27b46cb45c libostree: Fix compiler warning 2013-09-10 12:25:13 -04:00
Jasper St. Pierre 223bccf2f6 repo: Make read_commit spit out a resolved commit ref as well
read_commit resolves the ref to a commit, and a lot of consumers want
the resolved commit for their own purposes; this prevents them from
calling resolve_rev themselves.

https://bugzilla.gnome.org/show_bug.cgi?id=707727
2013-09-09 22:58:39 -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 3ff4b1874c core: Use openat() for reading bare file objects too
...unless we want xattrs, in which case we have to fallback to path
lookup due to lack of llistxattrat().

This looks nicer in strace.
2013-09-08 19:31:44 -04:00
Colin Walters d863ef5838 repo: Delete leftover repo/pending dir
This is a relic from long ago when we were trying to stage objects
before finally committing them all in one go in the pull code.

We're no longer doing that, so stop trying to make the directory.
This also fixes trying to use ostree as non-root to read the
root-owned repo, since we'd fail to create the pending dir.
2013-09-08 15:04:35 -04:00
Colin Walters 9846fb27fd core: Use linkat() for hardlink checkouts too
Clean up how we deal with the uncompressed object cache; we now use
openat()/linkat() and such just like we do for the main objects/.

Use linkat() between the objects and the destination, if possible.

https://bugzilla.gnome.org/show_bug.cgi?id=707733
2013-09-08 14:40:09 -04:00
Colin Walters 75225166da repo: Fix file descriptor leak from previous commit
I keep forgetting mmap doesn't take ownership of the fd.
2013-09-08 10:41:18 -04:00
Colin Walters 5a685ff989 core: Use at-relative lookups for archive-z2 content
We can't quite do it for bare repositories yet because we need to have
a way to go from struct stat -> GFileInfo, and that's buried in gio's
private GLocalFile class.
2013-09-07 10:10:21 -04:00
Colin Walters d2c6e19278 core: Use at-relative lookups for metadata reading
Just use openat() for locating variants, rather than doing the lstat()
+ open().  This also drops several malloc+object allocations from the
lookup path.
2013-09-07 05:03:48 -04:00
Colin Walters b97249d4f9 core: Use at-relative lookup for locating objects too
Add new internal API to both fstatat() and write a pathname for the
given object.  Use it in commit, and also wrapped in the old
GFile-based API.

This is more efficient.
2013-09-07 04:47:40 -04:00
Colin Walters a7c0992d94 core: Add malloc-free API for objects, use *at functions for storing
This is more efficient; we avoid malloc of a number of pathname +
GFile objects, plus the kernel doesn't have to traverse the repo path
again.
2013-09-07 04:18:41 -04:00
Jasper St. Pierre 3dcff0b2c4 Fix build
Before I pushed the "move code to a different file" commit, I rebased,
but forgot to test the build. Sorry.
2013-09-06 20:47:13 -04:00
Jasper St. Pierre 91d3b90c9f Move ref writing to be transaction-based
Rather than having separate write_ref calls, make clients start a
transaction, add some refs, and then commit it. While this doesn't
make it 100% atomic, it makes it easier for us to use an atomic
model, and it means we don't do as much I/O updating the summary
file and such.

https://bugzilla.gnome.org/show_bug.cgi?id=707644
2013-09-06 20:31:12 -04:00
Jasper St. Pierre 5082e1d8e9 repo: Rename "stage" to "write" in the API
An earlier version of this API acted like git in that some objects
would be staged in a temporary directory which would be then committed
in one go by moving files around. The API doesn't match most users
expectations though, as while the stage is nice as a high-level API
it isn't really suited for low-level APIs.

While the stage was removed, the APIs were never renamed. Rename
them now so that they match expectations.

https://bugzilla.gnome.org/show_bug.cgi?id=707644
2013-09-06 20:31:12 -04:00
Jasper St. Pierre c817217ad8 repo: Move commit code to another file
ostree-repo.c is a bit too big, and most of the commit code is
fairly standalone.

https://bugzilla.gnome.org/show_bug.cgi?id=707644
2013-09-06 20:31:11 -04:00
Jasper St. Pierre 89f4817bdf repo: Make prepare_transaction introspectable
We need to document the out pointer as an out pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=707644
2013-09-06 20:28:42 -04:00
Jasper St. Pierre b36e61f813 repo: Make OSTreeCommitModifier introspectable
Callbacks need GDestroyNotifies to be usable from bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=707644
2013-09-06 20:28:42 -04:00
Jasper St. Pierre f5f7fe5e9a repo: Make the ordering consistent between abort/complete_transaction
This just makes the functions nicer to stare at.

https://bugzilla.gnome.org/show_bug.cgi?id=707644
2013-09-06 20:28:42 -04:00
Colin Walters 2b61caa2fe core: Use fd-relative creation for tmp/
Update libgsystem submodule for a bugfix.

This is both more efficient from a kernel perspective, and avoids us
calling gs_file_get_path_cached() on tmp_dir constantly, which
triggered another bug due to lack of locking.
2013-09-06 18:45:16 -04:00
Jasper St. Pierre 02adfc8c03 repo: Rename ostree_repo_check to ostree_repo_open
As it more clearly describes what the function does: load the
repo from disk and initialize it.

At the same time, add a cancellable parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=707582
2013-09-05 14:07:03 -04:00
Jasper St. Pierre 57d285f619 repo: Move the 'init' builtin command to a public API, ostree_repo_create
This continues the goal of making more of ostree accessible by API,
rather than forking out to subprocesses.

https://bugzilla.gnome.org/show_bug.cgi?id=707582
2013-09-05 14:07:03 -04:00
Jasper St. Pierre eb6f017ef8 repo: Use constructed, not constructor
It's simpler to do this after the object is constructed, rather
than in the middle of construction.

https://bugzilla.gnome.org/show_bug.cgi?id=707582
2013-09-05 13:54:36 -04:00
Colin Walters 2534714501 core: Make ostree_write_variant_with_size() private
More work making the file formats and utilities private.
2013-09-04 07:49:41 -04:00
Colin Walters 0d72168961 libostree: Make the format of file objects private
It's now isolated almost entirely to ostree-core.c, except
ostree-repo.c needs to know how to create archive-z2 file headers.  So
give it a private API for that.
2013-09-03 18:43:42 -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
Colin Walters dd7d2f7b43 repo: Only apply setuid/xattrs after checksum validation
See the new comment in the source; basically if we're fetching content
over http, then someone with the capability to MITM the network could
create a transient setuid binary on disk with arbitrary content.  If
they also had a process running on the system (such as an application)
it could be escalated to root.

https://bugzilla.gnome.org/show_bug.cgi?id=707139
2013-09-02 15:31:55 -04:00
Tobias Hunger ed56908ccb Fix warnings about unused variables 2013-08-30 14:23:45 -04:00
Colin Walters d92eedac4a repo: Clean up tmpdir also on transaction abort
Pull the cleanup code to a helper function, and ensure we delete
leftover temporary files also when aborting a transaction.  Mainly
this will happen if a local 'ostree commit' fails.

While we're here, also change it to use gs_shutil_rm_rf() which also
handles directories, should we start using those.

Reviewed-by: Jeremy Whiting <jpwhiting@kde.org>
2013-08-27 11:35:45 -04:00
Jeremy Whiting d58a4c9f79 repo: Clean up temporaries after a transaction completes
Prevously, we were just leaving temporary files there forever if
a transaction was interrupted.

https://bugzilla.gnome.org/show_bug.cgi?id=706344
2013-08-27 11:35:36 -04:00
Colin Walters edfa76fad5 main: Code cleanup by passing OstreeRepo * directly to builtins
It turns out every builtin (with one special exception) that takes a
repo argument did the same thing; let's just centralize it.  The
special exception was "ostree init --repo=foo" where foo is expected
to *not* actually be a repo.  In that case, simply skip the
ostree_repo_check() invocation.

https://bugzilla.gnome.org/show_bug.cgi?id=706762
2013-08-25 15:28:23 -04:00
Colin Walters 6c61b19107 libostree: Improve commit filter API
Make the structure private, and document the flags.

https://bugzilla.gnome.org/show_bug.cgi?id=706214
2013-08-25 15:23:23 -04:00
Colin Walters b600ae5939 repo: Fix object storage size API to be 64 bit
This fixes a pointer size warning on 32-bit builds.

https://bugzilla.gnome.org/show_bug.cgi?id=706235
2013-08-25 15:19:54 -04:00
Colin Walters 35d7b9cdbf libostree: Increase gtk-doc coverage of ostree-repo.[ch] 2013-08-17 13:57:22 -04:00
Colin Walters 1fea88e64b libostree: Add gtk-doc section for ostree-repo.c 2013-08-17 13:22:58 -04:00
Colin Walters abe2320039 libostree: Fix many gtk-doc warnings 2013-08-17 08:41:31 -04:00
Colin Walters 1ec7c30408 core: Remove old "archive" mode
We'll always have "bare" mode for keeping files-as-hardlinks as root.
But "archive" was my second attempt at a format for non-root file
storage, used by the gnome-ostree buildsystem which runs as non-root.

It was really handy to have a "tar" like mode where I can create
tarballs as a user, that contain files owned by root for example.

The "archive" mode stored content files as two pieces in the
filesystem; ".file" contained metadata, and ".filecontent" was the
actual content, uncompressed.  The nice thing about this was that to
check out a tree as non-root, you could just hardlink into the repo.

However, archive was fairly bad for serving via HTTP; it required
*two* HTTP requests per content object, greatly magnifing the already
inefficient fetch process.  So "archive-z2" was introduced.

To allow gnome-ostree to still check out trees as a user, the
"uncompressed-object-cache" was introduced, and that's how things have
been working for a while.

So we should just be able to kill this code.  Specifically note just
how much better the stage_object() function became.

https://bugzilla.gnome.org/show_bug.cgi?id=706057
2013-08-16 22:56:42 -04:00
Colin Walters 11bdbe1fb8 repo: Add API to load any object as a stream
We have APIs to load metadata as variants, and files as parsed
content/info/xattrs, but for some cases such as static deltas, all we
want is to operate on all objects in their canonical representation.

https://bugzilla.gnome.org/show_bug.cgi?id=706031
2013-08-14 21:50:37 -04:00
Stef Walter 0111ec1307 Add some verbose logging to 'ostree commit'
This is so we can see near which file we fail when 'ostree commit'
falls over.

https://bugzilla.gnome.org/show_bug.cgi?id=705905
2013-08-13 15:38:51 +02:00
Colin Walters 71c4ea67f7 core: Clean up temporary file creation
Use new libgsystem API, don't expose the repo's tmpdir.
2013-08-06 23:58:29 +02:00
Colin Walters 9e480cd6a9 core: Finish making object path API private
This allows us to more easily change the internals later.
2013-07-31 03:48:33 -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 5aea9db3f2 Add API to retrieve statistics from transactions, use it in commit
It's just interesting to see =) This is also kind of prototyping out
some more "structured" output.
2013-07-25 19:23:25 -04:00
Colin Walters c9b61cbfee Drop support for related objects and metadata in commit objects
While the actual commit object format is presently the same, for a
number of reasons we'd like to change it fairly radically.  Among
other things, we need to drop our a{sv} types in objects, to protect
against GVariant changing format.

Since now gnome-ostree now longer uses related objects, and nothing
ever used metadata, just drop them both.
2013-07-24 12:59:27 -04:00
Colin Walters 8724565291 core: Drop a leftover unnecessary #define _GNU_SOURCE
We now use AC_USE_SYSTEM_EXTENSIONS.
2013-07-16 09:22:42 -04:00
Colin Walters 89181c4e8e Build without libsoup again 2013-07-09 20:35:15 -04:00
Colin Walters cb6b69616c libostree: Split off -refs.c
Continuing to break up ostree-repo.c.
2013-07-09 19:49:00 -04:00
Colin Walters 3b6a94d272 libostree: Split off libarchive code 2013-07-09 19:11:37 -04:00
Colin Walters dbffd31017 libostree: Start splitting up the monstrous ostree-repo.c
Checkout now lives in its own file.
2013-07-09 19:02:38 -04:00
Colin Walters 56f8584fe4 repo: Store transaction file, use it to optimize for pull resumes
If pull is interrupted, we may have downloaded an arbitrary subset of
the requested objects.  Previously, we handled this by scanning for
all objects each time.

However, there's an easy optimization - this patch creates a lock file
in the repo.  If we don't see that file when starting a pull, we know
we don't need to stat() every file; presence of a dirtree object for
example implies the existence of everything it references.
2013-07-08 09:05:34 -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 dc0f3c3dcb Add support for deleting refs
The internal API will be used by admin, and "ostree refs --delete"
is handy for interactive management.
2013-07-01 15:41:27 -04:00
Colin Walters 5b3fca8426 Add "refs" builtin
This is just useful to look at before pruning, etc.
2013-06-29 14:51:08 -04:00
Colin Walters 1ba852ebaa core: Add "refspec" which is remote:refname
This allows an unambiguous reference; otherwise, it was too easy to
have confusion between local heads and remotes.
2013-06-29 12:51:29 -04:00
Colin Walters 7bb20b0533 core: Port more callsites to gs_file_enumerator_iterate()
See previous commit.
2013-06-14 19:45:40 -04:00
Colin Walters fbd9f17e39 core: Update libgsystem, port some uses of GFileEnumerator
This makes the code *so* much nicer.
2013-06-14 19:14:35 -04:00
Colin Walters f4327cc6a0 repo: Fix race condition in async checkout
When multiple threads need to uncompress an object, there was
a race condition where thread A could get EEXIST, unlink,
then thread B calls linkat(), then thread A tries to link() but
fails.

We can just loop in this case.
2013-04-30 19:34:20 -04:00
Colin Walters 5d1b0ec1b3 core: Fix object enumeration for archive-z2 repositories
This makes fsck work again, among other things.
2013-04-01 11:43:03 -04:00
Colin Walters 47bd290065 core: Drain fdatasync() API into libgsystem
Just code cleanup.
2013-01-04 17:25:32 -05:00
Colin Walters 1ac307e6b8 Switch to libgsystem file reading API
More draining common utilities into libgsystem.
2012-11-29 16:58:39 -05:00
Colin Walters f3d765c903 Switch to libgsystem directory creation API
More code being dropped into a common place.
2012-11-29 16:40:17 -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 de1ce843f1 core: Drop old GLIB_CHECK_VERSION(2.32) bits
We hard require 2.34 now; if it doesn't exist on the system, that's
what embedded dependencies are for.
2012-11-18 15:44:21 -05:00
Colin Walters 5a51bee024 core: quiet a compiler warning 2012-10-17 20:54:52 -04:00
Colin Walters 0c3e901dae core: Check out files before directories
Otherwise we pretty easily hit maximum FD limits =(
2012-10-15 20:03:13 -04:00
Colin Walters bdbf76b6eb core: Ensure correct file data is synced in non-overwrite case 2012-10-15 18:44:55 -04:00
Colin Walters 1642310486 core: Use linkat() rather than link() in threaded checkouts
This seems to work around a likely Linux kernel VFS bug, where I
randomly see ENOENT on link() when we *definitely* called mkdir() at
an earlier point in time.
2012-10-15 10:49:48 -04:00
Colin Walters c0a6b5da71 core: Fix devino speedup for archive-z 2012-10-14 17:19:30 -04:00
Colin Walters 0d04738801 core: Rework archive-z mode to have header be uncompressed
This is an incompatible change to archive-z, thus it is now renamed to
archive-z2 and ostree will no longer parse archive-z.

I noticed in perf that we were spending some time zlib-decompressing
file headers, which is just inefficient.  Rather than do this, keep
the headers uncompressed, and just zlib-compress content.
2012-10-14 17:10:57 -04:00
Colin Walters 2b90e987bf core: Call fdatasync() before we rename()
Just noticed this from strace, doesn't really matter, but looks nicer.
2012-10-14 15:34:33 -04:00
Colin Walters 5b512d4c78 core: Fix case where we hardlinked successfully but thought we didn't
We need to return hardlink_supported even if we had to do an unlink
first.
2012-10-13 18:41:47 -04:00
Colin Walters ad26c7a80b core: A few more error-prefixings 2012-10-13 18:02:39 -04:00
Colin Walters a284075731 core: Prefix some error messages
To help debug why I still have this race condition...
2012-10-13 17:46:24 -04:00
Colin Walters 238da603b8 core: Ensure file data is synced to disk when checking out via non-hardlinks
Otherwise we aren't crash-safe.
2012-10-12 13:09:10 -04:00
Colin Walters e9dd22dc86 repo: Avoid race condition in threaded checkout with symbolic links
We were inconsistently putting symbolic links into the uncompressed
object cache, which could cause the threaded checkout to get confused.
2012-10-12 11:24:06 -04:00
Colin Walters ee73c0fa34 core: Add dynamic uncompressed object cache for archive-z
This gives us something closer to the advantages of archive and
archive-z when using the latter.  Concretely we get deduplication
among multiple checkouts, along with the "devino" hash table trick
during commits to avoid checksumming content again.

This is enabled by default.
2012-10-11 18:33:03 -04:00
Colin Walters 52a0b7bdb1 core: Only do devino scan on commit (speeds up pull)
When fetching data remotely, there's no point to the devino scan
because we're not going to be committing local files.

Only do it for "commit".
2012-10-05 17:12:39 -04:00
Colin Walters 9618232f4d pull: Stage content asynchronously
For similar reasons as metadata, this avoids having the main thread
blocked in fdatasync(), and even better - we can achieve much higher
parallelism if we have multiple threads blocked on fdatasync().
2012-10-04 20:00:00 -04:00
Colin Walters 5b8e833351 pull: Stage metadata objects asynchronously
This avoids the main thread being blocked on fdatasync(); also as a
bonus we checksum metadata in a separate thread too.
2012-10-04 18:24:37 -04:00
Colin Walters 26e487bacf core: use open(..., O_NOATIME) for reading loose objects
More efficient, and atime shouldn't matter for these.
2012-09-24 07:36:42 -04:00
Colin Walters 40ce43036f Add an archive-z repository mode
This is where loose content objects are stored as one compressed file,
instead of the two separate ones for regular archive mode.  This mode
would be suitable for HTTP servers, beause only one HTTP request is
necessary, and the result would be compressed.
2012-09-23 19:23:45 -04:00
Colin Walters 34c49f0411 core: Clean up staging API and internals
Cleanly separate metadata/content APIs, rather than defaulting to
raw streams.  This helps most use cases.

Also, drop support for staging content without knowing the total
length.  This complicated the code, and for things like streaming
HTTP, we should be able to figure this out from Content-Length.
2012-09-23 16:44:12 -04:00
Colin Walters 2a0601efc7 core: Drop packfiles as they are now
They're not a large efficiency win at the moment, because we don't
do any delta compression.

At the moment, they simply served to compress data, but we will change
the archive mode to do that by default.
2012-09-23 16:02:03 -04:00
Colin Walters 59ddbcc500 pull: Check the remote repo type
We can only pull from archive repositories right now.  This will also
be useful for adding compressed archives later.
2012-09-15 12:41:25 -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 4d2f770748 core: Use O_NOATIME to open metadata
We really don't need atime for metadata, it's just a speed hit.
2012-08-27 16:07:39 -04:00
Colin Walters 2396608754 repo: Call fdatasync() before adding objects to the repo
I run builds on my laptop, but it also crashes about 1/4 of the time
while suspending.  It's definitely undesrirable to get e.g. empty
.dirtree objects because they corrupt builds.  Concretely, I was
getting empty contents committed for xorg-util-macros.

Now, we used to write out temporary files using g_file_replace() which
does a fsync() during close, but then switched to a more "manual"
g_file_append_to().

We could switch back to g_file_replace(), but the problem is, we don't
want to call fsync() on temporary files in the case where we already
have the object.  Attempting to add an object we already have is a
*very* common case.

This is both the old and new code sequence for the case where an
object is already stored:

open(temp, O_WRONLY)
write() write() write()
close()
lstat(objects/3a/9fe332...) = 0
unlink(temp)

In the *new* code, here's the case where an object *isn't* stored:

open(temp, O_WRONLY)
write() write() write()
close()
lstat(objects/3a/9fe332...) = -1
open(temp, O_RDONLY)
fdatasync()
close()
rename(temp, objects/3a/9fe332)

Compare with the *old* code path for when an object isn't stored:

open(temp, O_WRONLY)
write() write() write()
close()
lstat(objects/3a/9fe332...) = -1
link(temp, objects/3a/9fe332)
unlink(temp)

The problem with this is we really need to fdatasync().  Also doing
just rename() instead of the weird link()/unlink() helps us express to
the filesystem that we want atomic semantics.  For example, BTRFS has
special handling for rename().
2012-08-27 15:35:40 -04:00
Colin Walters 8f6f3623c3 repo: Ensure all stored files are readable
We really don't have a sane story for private files.  This is a
defensive step ensuring that with old versions of gnome-ostree,
components that mistakenly have un-world-readable files don't break
pulls.
2012-08-26 16:35:44 -04:00
Colin Walters 9d58bad7ca repo: Also traverse remote refs when enumerating objects
Otherwise ostree --repo=repo prune will delete everything =/
2012-08-25 16:02:38 -04:00
Colin Walters 7087d28ec3 libostree: Quiet compiler warning with --disable-libarchive
This function is only used if compiling with it.
2012-08-24 16:47:31 -04:00
Giovanni Campagna 1057f8289c Don't fail for EPERM when hardlinking
As the manual page doesn't say, but the in-code kernel documentation
shows, hardlinking for normal users can fail for a variety of
reasons (including very common situations such as non regular file
or non writable file), if the owner of the file does not match
the user linking (e.g. when checking out a shadow repo with a root-
owned master).
If that happens, fail back silently to copying instead of aborting
the whole operation.

https://bugzilla.gnome.org/show_bug.cgi?id=682298
2012-08-20 23:01:57 +02:00
Colin Walters 43a2fec6a8 core: Drop ot_clear_ptrarray in favor of g_clear_pointer 2012-07-17 08:16:54 -04: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 57fcafd1ab core: Remove ot_clear_checksum() in favor of g_clear_pointer() 2012-07-17 08:08:57 -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 311493338e core: Drop ot_gfile_new_for_path
Not necessary anymore since we switched to GIO_USE_VFS=local in the
binaries.
2012-06-30 13:42:24 -04:00
Colin Walters a7b917c856 core: Check out asynchronously
This can be a large performance win in certain circumstances:

 * Cold buffer cache (we don't block the whole process)
 * Requiring a copy instead of hardlink
2012-06-21 18:05:13 -04:00
Colin Walters 35a80c8e39 core: Fall back to copying checkouts on EMLINK/EXDEV
The previous fix to just ignore symbolic links for hard linking isn't
really good enough, since it can happen for empty files too.

Since this is an optimization, when we get EMLINK, let's instead just
fall back to copying.  This also applies to EXDEV.
2012-06-12 14:50:41 -04:00
Colin Walters 9582effb8d core: Don't checkout symbolic links via hardlink
Doing so can easily get us up to the maximum ext4 hardlink count.
2012-05-26 11:55:12 -04:00
Colin Walters fb71519cd6 core: Attempt direct link() and fallback on EEXIST
Rather than always doing:

1) make temporary link
2) unlink() target
3) rename()

Just try making the link, and only do the second two if the file
already exists.  This reduces system call traffic a lot.
2012-05-24 20:14:51 -04:00
Colin Walters 1a5ea54aff core: Make OstreeRepo struct private 2012-05-23 18:08:52 -04:00
Colin Walters 893774aab5 core: Make device/inode loose object cache work for parent repos too
Otherwise ostbuild suddenly becomes significantly slower when using a
shadow repo.
2012-05-23 07:48:16 -04:00
Colin Walters 58d28ad5a6 core: Rearrange code for clarity (doesn't actually fix leaks) 2012-05-18 20:12:17 -04:00
Colin Walters 4f95106cda core: Prefer packed metadata 2012-05-18 16:30:44 -04:00
Colin Walters f95090095e core: Map metadata from repository as trusted
ot_util_variant_map() assumed untrusted; add a boolean, and use it for
the repository internals.
2012-05-18 16:30:44 -04:00
Colin Walters d7a15b381e core: Allow adding related objects to commits
This will be used to store the set of components.
2012-05-14 21:58:22 -04:00
Colin Walters 2fbf864251 core: Clarify error message 2012-05-14 11:22:18 -04:00
Colin Walters 4fa14eb712 core: Don't look in packs if we found loose object
Unless the caller wants us to; which at present none do, but let's be
forward looking and add an option.
2012-05-12 10:46:25 -04:00
Colin Walters a04ef7ba10 core: Fix ostree-pull to be able to look up remotes in parent repo
We should probably add a generalized inheritance mechanism.
2012-05-10 08:50:37 -04:00
Colin Walters 38dd179017 core: Compile again on GLib 2.28 2012-05-05 11:45:19 -04:00
Colin Walters 0660d9e5cf core: Improve error message if we hit an unreadable file 2012-05-04 16:14:47 -04:00
Colin Walters 26c484faed core: Add a mutex to cache data structures in preparation for threading
Conflicts:

	src/libostree/ostree-repo.c
2012-05-04 16:14:28 -04:00
Colin Walters ac38a7e1b1 core: Avoid checksumming hardlinks that point into repository
By default, when doing a commit, scan all of our loose objects and
build up a (device,inode) -> checksum hash.  Then when we're doing a
commit, if we see a file with that (device,inode) pair, we can avoid
checksumming it.
2012-05-04 16:10:30 -04:00
Colin Walters 0fc291b954 core: Drop --link-cache option, we do it by default now for archives 2012-05-04 16:10:30 -04:00
Colin Walters 27358a8de6 core: [INCOMPATIBLE CHANGE] Re-split archive content into .file and .filecontent
This will allow us to use hard links again for user-mode checkouts,
rather than the hackish link cache.  It was pretty silly anyways to
have file objects be stored with just a small metadata header
prepended, but uncompressed.

Either they should be hardlinkable, or compressed (in pack files).
2012-05-04 16:10:30 -04:00
Colin Walters 8d926c3e36 core: Add valgrind framework, plug various memory leaks 2012-05-04 10:04:32 -04:00
Colin Walters 7ce587da30 core: Optimize commits to raw repositories
Avoid creating a temporary intermediate file in the case where we have
the total object length available.
2012-05-04 06:15:47 -04:00
Colin Walters 67f61976f4 core: Clean up object storage API
Rather than passing xattr/file_info for all objects, change the API to
assume we're passing the defined object stream for each type.  Namely,
for OSTREE_OBJECT_TYPE_FILE, we're now giving the "archive file" data.

This significantly cleans up the code for committing to archive mode
repositories, at the cost of having to (at present) create an
intermediate temporary file when committing to raw repositories.
2012-05-03 19:59:13 -04:00
Colin Walters 749bf56917 core: Fix gcc uninitialized-variable warning 2012-05-01 18:53:00 -04:00
Colin Walters 8d6bdaedfe core: Fix 32/8 bit confusion in pack index listing 2012-05-01 17:44:14 -04:00
Colin Walters 5947b5b145 core: Add ability for repositories to have a "parent"
This will be useful for ostbuild; a user can create their own archive
mode repository which transparently inherits objects from the
root-owned one in /ostree.
2012-04-18 23:12:34 -04:00
Colin Walters 255b7d1309 core: Pull pack files individually 2012-04-16 18:17:11 -04:00
Colin Walters 3f02a1fd56 core: Cache pack indexes
This is a 10x speedup on heavy users of ostree_repo_find_object(),
such as ostree-pull.
2012-04-16 18:17:06 -04:00
Colin Walters 262f426997 core: Add --link-cache option to checkout
This is a convenient way to have a lookaside directory of hard links,
which can greatly speed up checkouts.  In the future we probably want
to push this down into the repository.
2012-04-13 14:33:38 -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 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 fa4cbc8b89 core: Drop wrapping of metadata variants 2012-04-11 22:04:05 -04:00
Colin Walters 5a82b141ae core: Split pack files into data/metadata
This will allow us to download metadata first (separately), and in the
future we can have an improved metadata pack format that compresses
heavily.
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 0e8149eb83 core: Clean up checksum API
We want to move towards guchar * for binary checksums.
2012-04-11 19:54:55 -04:00
Colin Walters d63ec5c2ff core: Fix uninitialized variables 2012-04-11 19:54:30 -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 3c39a5bfa7 core: Fix a minor memory leak 2012-04-09 14:18:00 -04:00
Colin Walters 3f23ac156a core: Clean up stale packfiles 2012-04-03 23:46:34 -04:00
Colin Walters 9c7a47434d core: Drop "staged" state for objects, refactor pull to split metadata/data
Previously we had the "staged" state to ensure we didn't add a commit
object without the associated dirtree, etc.  However it's
easier/better to just ensure in the pull command that we have all
referenced objects.

Also change pull to download metadata first.  This will allow adding
a progress bar later.
2012-04-02 19:52:22 -04:00
Colin Walters a0b7d94cb6 core: Fix a few memory leaks 2012-04-02 18:32:40 -04:00
Colin Walters ea4d2be39c core: Return input stream for raw repositories too
This bug is more obvious when fsck is rebased on top of
ostree_repo_load_file().
2012-04-02 18:32:40 -04:00
Colin Walters b971ce0dfa core: Only depend on GLib 2.30 2012-04-02 13:42:09 -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 70afd6011f core: Add helper functions to convert (checksum, objtype) pair to/from string 2012-03-14 09:37:00 -04:00
Colin Walters 76bc35186e core: Add --union mode to checkout
This is another step towards ostbuild using this instead of the
"compose" builtin.
2012-03-06 11:59:06 -05:00
Colin Walters 1513f29495 core: Pull diff functionality out into "diff" builtin
There's no good reason for this to be in core when it's only in use by
the diff builtin.
2012-03-06 11:59:06 -05:00
Colin Walters 1f7d776a18 core: Improve checkout API
Expose the lower-level functionality in libostree, change checkout
builtin to be a higher level driver.  This will allow us to more
easily improve the "checkout" builtin..
2012-03-06 11:59:06 -05:00
Colin Walters b783ebc189 core: Add API to validate rev 2012-02-27 08:37:37 -05:00
Colin Walters 810a3dac86 core: Write a refs/summary file for archive repositories
This will allow us to retrieve all refs over HTTP easily.
2012-02-27 06:20:42 -05:00
Colin Walters d3a73225b0 core: Add API to enumerate all refs 2012-02-27 05:58:42 -05:00
Colin Walters 51916a7002 core: Look up refs like origin/foo correctly again
We want to support both "bare" lookups where "foo" can be local, or in
any remote, as well as prefixed ones for a specific remote.

This fixes ostree-pull noticing that nothing has changed.
2012-02-24 16:08:34 -05:00
Colin Walters 16c0cfe9b5 core: Fix regression when committing symlinks in archive mode
Commit 802959f398 broke this because it
made all archived content files be S_IFREG, which is clearly wrong.
2012-02-24 10:05:26 -05:00
Colin Walters 14cda593d5 core: Correctly look up refs in remotes 2012-02-23 23:52:59 -05:00
Colin Walters b2ad353b42 core: Store "pending" objects explicitly, fix pull to use them
Before we were creating randomly-named temporary files in repo/tmp
when downloading via pull, but that means if the download process is
interrupted, we have to redownload everything again.

Let's still keep the concept of a "transaction" where files are
stored in the repository as atomically as possible (i.e. we
do a bunch of rename() calls), but now we also have an explicit
"tmp/pending/objects" directory that contains named objects.

This allows us to then skip redownloading things that are pending.
2012-02-23 18:19:00 -05:00
Colin Walters e8dbaa3c07 core: Add generic "commit filter" API, use it to implement statoverride
The builder wants the ability to mark a given file as e.g. setuid.  To
implement this, the repo now has a callback-based API when importing a
directory to modify or remove items.

The commit tool accepts a "statoverride" file as input which looks like:

+mode /path/to/file
2012-01-22 13:27:38 -05:00
Colin Walters ebe35dbefe core: Ensure we delete duplicate files in a transaction
If multiple files have the same hash, we need to ensure we're not
overwriting other tempfiles in the same transaction.  Instead
just delete them, since we know they're in the repo.
2012-01-15 12:25:52 -05:00
Colin Walters 9910c0ddf4 core: Create a directory for each transaction
This helps ensure that we can more easily identify stale tempfiles
left over if we crash in the middle of a transaction.
2012-01-15 11:03:01 -05:00
Colin Walters 62821024b9 core: While walking mtrees during commit, ensure the referenced path is resolved
This gives us a clean error instead of an assertion.
2012-01-11 13:42:59 -05:00
Colin Walters 5119cbdb7c core: Add --no-xattrs option for commit
Will be used by ostbuild.
2012-01-05 19:10:26 -05:00
Colin Walters 3e59cc1305 core: Add --tar-autocreate-parents option for commit
The tar files we're making of artifacts don't include parent
directories.  Now we could change the builder to make them, but we can
also just autocreate them on import.  Mode 0755 with no xattrs seems
OK here.
2011-12-23 06:49:04 -05:00
Colin Walters 4bbc99fb1d core: Fix build with libarchive disabled 2011-12-22 19:52:30 -05:00
Colin Walters dab4611263 core: Add --skip-if-unchanged option for commit
There's not much point for OS builds to have "empty" commits.
2011-12-22 18:47:30 -05:00
Colin Walters 3292dcb6d6 core: Allow / in ref names like git does
Using / is nice basically.
2011-12-22 15:59:47 -05:00
Colin Walters d25f1bf73d core: Use GFile for repo constructor API, and a bit more internally
Also, ensure that the repo directory GFile is absolute - this avoids
a getcwd() syscall every time we construct a GFile object.
2011-12-22 11:04:08 -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 add55849ab core: Allow specifying a previous commit tree as a basis for a new commit
It's pretty trivial to map a previously existing commit tree into a
mutable tree too.  While we're here change the command line arguments
for commit so that we can now properly overlay any combination of
directory, commit, or tarfile.
2011-12-21 20:10:10 -05:00
Colin Walters c8377c7c5c core: Expose more details of commit via API
Rather than offering high level "commit directory", instead perform
operations on a mtree.  Commits are treated more like regular objects.

Change the commit builtin to drive this all at a lower level.
2011-12-21 18:58:44 -05:00
Colin Walters 72257bab2b core: Rename "store" public APIs to "stage" since that's what they do 2011-12-21 17:13:04 -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 2b7a83d1cc core: Add new "mutable tree" class, use it for tar file import
The tar import code forced the resuscitation of a hackish "FileTree"
data type for representing an in-memory tree.  Split this out
into an OstreeMutableTree class for future use by any other in-memory
tree construction.
2011-12-21 13:34:10 -05:00
Colin Walters bdfde03b61 core: Support committing multiple tarballs in the same transaction
ostbuild will generate two artifacts: foo-runtime.tar.gz and
foo-devel.tar.gz in the general case.  When committing to the devel
tree, it'd be lame (i.e. slower and not atomic) to have to commit
twice.
2011-12-20 17:21:15 -05:00
Colin Walters 11d57d63e3 core: Support --owner-uid and --owner-gid options for commit
This allows us to more easily import user-built tarballs into
a root-owned OSTree repo.
2011-12-18 17:36:46 -05:00
Colin Walters 134283afbf core: In user mode checkouts of archives, use hard links
Now that we've done all the gyrations to separate content from
metadata in archives, we can just hard link when doing user checkouts.
2011-12-15 16:12:31 -05:00
Colin Walters e014b2d9c2 core: Fix a few memory leaks 2011-12-15 15:17:27 -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 dc4164993b core: Initialize variables in fsck
Otherwise we segfault on an unhandled filename.
2011-12-08 18:23:25 -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 35fa68a74c core: INCOMPATIBLE CHANGE: Rename .packfile to .archive
It's too confusing that we call the mode "archive" but the actual
files ".packfile".  Also, git already has a "packfile" that serves a
totally different purpose.
2011-12-08 17:15:59 -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 dccd106731 core: Clean up checkout code
Take a GFile * for destination.  Also, we only need one recursive
function, not two.
2011-12-08 10:28:44 -05:00
Colin Walters d70950e891 core: Add -U option for checkout to skip lchown() and xattrs
This is useful for checking out an OS filesystem tree as a regular
user, and not caring about /dev and stuff.
2011-12-06 21:38:04 -05:00
Colin Walters a94e0b8bf8 core: Ensure we chown created directories too 2011-12-06 20:16:03 -05:00
Colin Walters c32141c2bf core: Remove some useless wrapping of packfile unpacking in checkout 2011-12-06 20:09:09 -05:00
Colin Walters ce7345d51e core: Major cleanup to internal import API 2011-12-05 14:21:18 -05:00
Colin Walters b8000c00d5 core: Further unify code for importing from local FS and libarchive
Note this change makes it so we no longer call link() from an import
filesystem tree to the repository.  This is a Good Thing really; it
makes local FS commits slower, but also less prone to corruption.
2011-12-05 11:20:14 -05:00
Colin Walters 78f435d245 core: Fix handling of hardlinks for tar commits
We were creating files with the wrong name.  Add a test.
2011-12-04 14:38:30 -05:00
Colin Walters 17cc772cf3 core: Support for committing from any libarchive-supported format
We really want the ability to take a .tar.gz and directly import
it into a repository, without creating a temporary filesystem tree.

First, doing it this way is significantly faster.  Also, this allows
us to handle importing tar files with e.g. uid 0 files into packed
repositories as non-root, which is very useful for tests and builds.
2011-12-04 14:08:55 -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 3ab69101f7 core: Fix packed file creation
We were calculating the wrong checksum, and also mistakenly
not using packed files in archive mode for non-regular files.
2011-12-02 17:49:57 -05:00
Colin Walters b5ce760678 core: Don't use g_file_delete(), it calls into g_vfs_get_default()
For some (probably crazy) reason.  Skipping this and calling
unlink() directly makes 'strace' MUCH smaller.
2011-12-02 14:32:25 -05:00
Colin Walters 0d4df5b3fe core: Avoid reading regular file data twice when archiving 2011-12-02 14:23:01 -05:00
Colin Walters d1950da1a0 core: Further unify API to create files
We now have just one place which writes to the filesystem.  Wrap a
temporary file allocation API on top of that.
2011-12-02 13:42:25 -05:00
Colin Walters f98e2a2ddb core: Tweak dir metadata importing code for libarchive work
This will allow us to share a bit more code.
2011-12-01 19:45:00 -05:00
Colin Walters 23d01d97dd core: Propagate GCancellable a bit from the import APIs 2011-11-30 22:20:25 -05:00
Colin Walters 702c38739e core: Drop some dead code from packfile writing, expose GInputStream API too
We never actually dropped into the bits to write metadata as packfiles,
because such a thing doesn't exist.

Also add a GInputStream-based API for writing packfiles.
2011-11-30 22:15:05 -05:00
Colin Walters 556662b24c core: Extract stage_and_checksum() internal API
This will be used for staging both metadata and data consistently
before actually importing it.
2011-11-30 21:20:15 -05:00
Colin Walters 99bf19314e core: Add ot_gfile_create_tmp() to utils, use it 2011-11-30 20:32:06 -05:00
Colin Walters 247e027125 repo: Don't call g_hash_table_destroy on a NULL hash 2011-11-30 20:23:54 -05:00
Colin Walters 84562f161f core: Use ot_clear_checksum() 2011-11-29 14:06:54 -05:00
Colin Walters 7e32bc6cd7 core: Make commit always operate on directory contents, not file list
This simplifies things significantly, at some cost in flexibility.
We'll later add the ability to e.g. filter out files by regular
expression.
2011-11-28 12:57:25 -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 7d63ad5ae8 core: Switch to GFile* for unpacking and storing objects 2011-11-18 16:14:01 -05:00
Colin Walters c66474750b core: Expose API to get repository tmpdir 2011-11-18 16:01:28 -05:00
Colin Walters f6ec479f17 core: Rework object iteration API to be GFile based and pass more data
It makes more sense to have e.g. the details of .packfile naming
inside the repo, and pass the expected checksum and type.
2011-11-18 15:21:32 -05:00
Colin Walters 8621eb85b1 core: Skip an unnecessary unlink() call 2011-11-18 09:41:36 -05:00
Colin Walters 7276e2df43 core: Have single "overwrite" flag instead of ignore_exists+force pair
The default is always ignore_exists.  Also port the internals here
to use more GIO code, and stop using *at syscall variants since they're
only useful if used 100%.
2011-11-18 09:37:25 -05:00
Colin Walters 860c3cf502 core: Convert public get_object_path() to GFile* 2011-11-18 09:04:25 -05:00
Colin Walters 9cf15ed151 core: More cleanup of GIO utility API 2011-11-18 08:43:47 -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 7f64d5cec7 core: Make checksum API also operate on directories 2011-11-18 06:34:54 -05:00
Colin Walters b8cef545d1 core: CHANGE CHECKSUM ALGORITHM, port checksum API to GFile
This commit originally was to port ostree_stat_and_checksum_file() to
GFile*, but I noticed that the checksum code was reading data in host
endianness.  Fix that while we're here.

This invalidates all existing repositories.
2011-11-17 19:32:01 -05:00
Colin Walters 2c2b9c0e00 core: Convert metadata parsing API to GFile 2011-11-17 18:36:57 -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 8e9b9c59d6 core: Fix pull to actually download files too 2011-11-17 10:40:55 -05:00
Colin Walters ed2be6306d core: Should write remote refs in refs/<remote>/<branch>
Not just refs/<branch>, otherwise multiple remotes conflict.
2011-11-17 10:40:01 -05:00
Colin Walters db9801bff2 core: Allow resolving e.g. "origin/master" as a rev
Also:

* Disallow .. in revs to avoid looking outside where we should be
* Allow resolving empty revs
2011-11-17 10:36:04 -05:00
Colin Walters 4a26be1bef core: diff: Correctly handle files changing type 2011-11-16 23:09:32 -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 115626c264 core: Fix a minor memory leak 2011-11-16 22:51:09 -05:00
Colin Walters 9fb390664a core: Implement diff command 2011-11-16 18:16:41 -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 21c7ff74b6 De-recursify source tree 2011-11-02 15:45:32 -04:00
Colin Walters 2b00cf3810 core: add ^ for rev-parse 2011-11-02 13:22:13 -04:00
Colin Walters bab31db7ee core: Squash some memory leaks 2011-11-01 12:20:33 -04:00
Colin Walters a897642315 For archive checkouts, actually unpack the packfiles 2011-11-01 10:59:07 -04:00
Colin Walters 8769f4afd8 Switch to big-endian storage for all variant data
This ensures the saved archives are architecture-independent.
2011-10-31 22:41:50 -04:00
Colin Walters a160a2a5fa Add support for pulling from remote archives
This necessitated a large set of changes.

We now support an "archive" mode for repositories.  In this mode,
files are stored "packed" rather than hard linked.  This allows one to
e.g. store an OSTree repository with root-owned files as non-root.  It
is also used as the basis for serving repositories via HTTP.

While doing this I realized that GVariant is endianness-dependent; I
decided to just store all data in big endian.
2011-10-31 20:28:47 -04:00
Colin Walters ee4edf114b Don't default to "master", require a branch
It doesn't really make sense to have a default branch, since we expect
people to have multiple roots.  Thus, require a branch
specification always.
2011-10-27 21:42:44 -04:00
Colin Walters 7ca1c3d2e7 core: remove HEAD file, use branches instead
HEAD in git describes a working copy, and we don't have those.
Instead, default to a "master" branch.  This also lets us support
multiple branches.
2011-10-27 14:32:05 -04:00
Colin Walters ac99188c23 core: Add a config file with repo version
This should let us expand later.
2011-10-26 22:21:00 -04:00
Colin Walters 03943c659f Drop glib requrirement to 2.28
This lets it build on more currently-released systems like Fedora 15.
2011-10-26 14:12:13 -04:00
Colin Walters a2880a6ddd src: Squash some unused variables 2011-10-20 16:30:34 -04:00
Colin Walters aa25334286 repo: Only open regular files
Otherwise we'll try to open device files with predictably bad
consequences.
2011-10-19 18:06:06 -04:00
Colin Walters 961b1c80db Do "bare" repositories by default
Mixing the repository and checkouts is discouraged.
2011-10-19 17:45:00 -04:00
Colin Walters b27df6fd72 "Hacktree" is now known as "OSTree"
It just sounds better.
2011-10-18 14:44:48 -04:00