Commit Graph

990 Commits

Author SHA1 Message Date
Colin Walters aa69aae94e core: Move merge dirs code into gio utils 2011-11-21 15:04:07 -05:00
Colin Walters c117aadc95 core: Stub out a system daemon 2011-11-20 20:55:24 -05:00
Colin Walters 1dbf134946 core: Rework argument parsing
Default to /sysroot/ostree/repo when run as root.  Also better
handle the requires-repo flag.
2011-11-19 14:02:21 -05:00
Colin Walters dce29a984a core: Ensure data is properly initialized
Avoids a crash if we bail early.
2011-11-19 10:45:53 -05:00
Colin Walters a042731673 core: Add local-clone builtin
This is useful for converting between e.g. archive and non-archive
repositories.
2011-11-18 18:50:53 -05:00
Colin Walters b7a45b5815 core: Also chown() after unpacking objects 2011-11-18 18:50:29 -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 6591e586ed core: Remove last user of g_file_new() 2011-11-18 08:02:19 -05:00
Colin Walters 12f2d89174 core: Add checksum builtin
This necessitated reworking things so that builtins can specify no
--repo is required.
2011-11-18 07:29:13 -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 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 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 97e82447c6 core: Add --print-packfile argument for show
Just another debugging tool.
2011-11-15 15:16:38 -05:00
Colin Walters d196a47043 core: We actually want rdev, not dev for devices 2011-11-15 15:15:46 -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 796dc7fc57 core: remove stub http backend for now
The plain http pull is probably good enough.
2011-11-02 12:43:25 -04:00
Colin Walters 8f877c5b65 log: Fix a crash 2011-11-01 12:24:34 -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 80fcb3b818 checkout: Use ot_util_new_file_for_path 2011-10-31 20:22:34 -04:00
Colin Walters d2938ad6cc core: Add "ostree remote add" 2011-10-28 10:25:36 -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 dd13d172ef core: Add rev-parse builtin 2011-10-27 15:44:08 -04:00
Colin Walters d0222ce6c8 fsck: Kill unused variable 2011-10-27 15:41:15 -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 66011a84e5 init: Add branches, tags, refs directories like git 2011-10-26 22:37:23 -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 d0b3a07cf1 core: Fix checksum for symlinks walking off into uninitialized memory 2011-10-26 18:33:33 -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 4d86ee0a1d Pile of work on parallel-debian 2011-10-24 22:02:16 -04:00
Colin Walters 5146890457 Move triggers into new builtin: ostree run-triggers 2011-10-21 09:55:39 -04:00
Colin Walters 4d39070efd Fix up triggers and gnomeos-make-image.sh
Now both do something.
2011-10-20 17:24:21 -04:00
Colin Walters a2880a6ddd src: Squash some unused variables 2011-10-20 16:30:34 -04:00
Colin Walters 9d8522dfa1 Some initial work on triggers 2011-10-20 16:12:02 -04:00
Colin Walters b7d45436a0 Don't use g_variant_new_from_fixed_array(), it was only added in 2.31
g_variant_new_from_data() works, and actually allows us to avoid
a memdup()/free().
2011-10-20 10:20:51 -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
Colin Walters a06f724b72 src: Only use local VFS - this avoids hitting up the session bus
We are designed to run in the "unix model" of being forked a lot, so
startup time matters a lot, and hitting the session bus adds
unnecessary DBus traffic, shows up in strace etc.

It's a microoptimization I admit.
2011-10-17 15:55:06 -04:00
Colin Walters 97003b48da Add log builtin
The "less" spawning is buggy for some reason =(
2011-10-15 15:43:43 -04:00
Colin Walters 717945814c Save root directory permissions in commit 2011-10-15 14:20:22 -04:00
Colin Walters c768c2a746 Support for committing files from stdin or a file list file 2011-10-15 13:07:26 -04:00
Colin Walters 36ba6e5426 Ensure we don't get duplicate '.' which leads to corruption
In path_split(), we squash '.' entirely, since it's redundant and if
we don't, we return an extra component which callers would then have
to handle.

In repo, ensure we're never explicitly parsing '.' either (yet).
2011-10-15 13:04:50 -04:00
Colin Walters 2bd973f645 Make file deletion work, add test 2011-10-15 09:56:31 -04:00
Colin Walters 05c35f2cf7 Actually checksum xattr values, not just names
We need to call lgetxattr() and not just llistxattr().
2011-10-15 03:03:51 -04:00
Colin Walters 88c9851795 repo: Fix nested tree code 2011-10-15 03:02:51 -04:00
Colin Walters 7cffd09f6d repo: Fix format string bug 2011-10-15 02:39:47 -04:00
Colin Walters 3eb77d4ce8 Importing and checking out nested trees works! 2011-10-15 01:23:01 -04:00
Colin Walters 6f1b880377 repo: Allow empty commit bodies 2011-10-15 00:57:13 -04:00
Colin Walters 401ab27c11 checkout: New command 2011-10-15 00:45:07 -04:00
Colin Walters 3f12aa7bbd repo: Use 'self' in headers too 2011-10-14 23:24:51 -04:00
Colin Walters f16aad3710 We can commit multiple times now 2011-10-14 23:17:50 -04:00
Colin Walters ce6d9ca569 repo: Add some GError guards 2011-10-14 23:13:23 -04:00
Colin Walters 72c7385295 repo: Update HEAD after a commit 2011-10-14 22:56:40 -04:00
Colin Walters 9cac933c7f show: New builtin 2011-10-14 22:49:44 -04:00
Colin Walters 9e0e481835 repo: Fix some bugs loading variants 2011-10-14 22:49:28 -04:00
Colin Walters 0b851a743e Store objects with an extension so we know whether they're files or metadata 2011-10-14 22:30:18 -04:00
Colin Walters 3a9e2b36b0 fsck: Not an error to have 1-linked objects, also print HEAD 2011-10-14 22:10:06 -04:00
Colin Walters b3c556a349 repo: Add API to load variants, and get HEAD 2011-10-14 22:10:06 -04:00
Colin Walters 55b3c7ca69 repo: Ignore importing existing variants
It's not an error to duplicate a tree.
2011-10-14 22:07:58 -04:00
Colin Walters 98a043c671 Add probably working commits 2011-10-14 21:09:11 -04:00
Colin Walters 0808b94600 fsck: Add quiet option 2011-10-12 16:43:52 -04:00
Colin Walters ea96d5bf89 Fix option processing, add some options to link-file 2011-10-12 13:45:19 -04:00
Colin Walters cd3a56dd68 Don't include any timestamps in hash, add fsck command 2011-10-12 11:38:41 -04:00
Colin Walters 4dd6800389 Make link-file work 2011-10-11 22:05:16 -04:00
Colin Walters 7c1c61beb1 Write some code for importing 2011-10-11 20:58:50 -04:00
Colin Walters a2ffbdd0a4 Switch to GLib 2011-10-11 14:26:48 -04:00
Colin Walters 73a4b1a5f1 Rename from gbuild to hacktree 2011-10-10 18:46:57 -04:00
Colin Walters f874ac043d Initial commit 2011-10-09 17:03:08 -04:00