Commit Graph

236 Commits

Author SHA1 Message Date
Colin Walters 45addeadf0 core: Handle NULL xattrs in packfile generation, throw error on invalid mode 2011-12-04 13:12:06 -05:00
Colin Walters 1f6d49cdb9 core: Initialize checksums for non-regular files, handle NULL xattrs 2011-12-04 12:11:29 -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 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 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 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 177d845f5b core: Modify pack file importer to also optionally checksum
For future work on importing from an archive.
2011-12-01 19:25:35 -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 84562f161f core: Use ot_clear_checksum() 2011-11-29 14:06:54 -05:00
Colin Walters 2f1490f766 core: Fix a compiler warning 2011-11-27 20:15:07 -05:00
Colin Walters b0b0ffcd61 core: Add asynchronous checksum API, use it in checksum builtin 2011-11-27 17:21:04 -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 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 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 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 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 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 d0b3a07cf1 core: Fix checksum for symlinks walking off into uninitialized memory 2011-10-26 18:33:33 -04:00
Colin Walters a2880a6ddd src: Squash some unused variables 2011-10-20 16:30:34 -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 b27df6fd72 "Hacktree" is now known as "OSTree"
It just sounds better.
2011-10-18 14:44:48 -04:00