Commit Graph

990 Commits

Author SHA1 Message Date
Colin Walters cc4df4f3c2 admin: Add new pull-deploy command
Fetch the latest for the current tree, and deploy it in one go.
2012-10-22 20:41:49 -04:00
Colin Walters f405737164 libgsystem: Update 2012-10-22 18:24:31 -04:00
Matthias Clasen a0449ed246 Make ostree admin --help output more useful
At a minimum, it should list the available subcommands. This is
still not perfect, since there is no way to get at the help output
of the subcommands - getting that right needs more refactoring.

Signed-off-by: Colin Walters <walters@verbum.org>
2012-10-22 18:10:56 -04: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 d6956bfc19 core: And one more race in multithreaded mkdir -p
Sigh =(
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 b0b409f82e checkout: Drop uncompressed object GC for now
It's racy when multiple processes are involved, and needs a bit more
thought.
2012-10-13 19:22:29 -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 c159188b81 core: One more minor tweak to recursive directory creation
We would fail in the case where we were trying to create a
subdirectory of /; this didn't actually happen, just noticed
via code inspection.
2012-10-13 17:54:19 -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 6b09f90122 core: Threadsafe recursive direction creation is harder than it appears 2012-10-13 10:47:03 -04:00
Colin Walters b4d408f483 core: Fix regression in previous commit 2012-10-12 15:25:25 -04:00
Colin Walters 4436ed34d8 core: Make mkdir -p function safer
Recursing here is just a more obvious way to do it, rather than
relying on the semantics of g_file_make_directory_with_parents().
2012-10-12 15:10:39 -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 3c0fe01152 pull: Print elapsed time 2012-10-05 17:20:40 -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 efe27f1b05 pull: Ensure worker queue finishes if we unhold an empty queue too 2012-10-04 20:32:14 -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 f1b4db15a2 pull: Ensure queued filemeta requests don't starve everything else
We need this hack for "archive mode" repositories; otherwise,
what ends up happening is that we get 10000+ requests pending
for .filemeta files, which we can't process until we also get
the .filecontent.

Note this hack is unneccessary when fetching from archive-z
repositories.
2012-10-04 18:23:18 -04:00
Colin Walters 4e51701bea pull: Merge metadata and content fetch phases
This is a notable speedup when the metadata scanner is working, and we
don't have a lot of traffic; we can pull down data at the same time.
2012-10-04 15:37:23 -04:00
Colin Walters 5c1dc390ae pull: Asynchronous metadata fetch
Create a worker thread for processing metadata, reserving the main
thread for HTTP requests.

This can create a very significant efficiency win for large pull
requests since we are much more likely to keep a full pipeline open.

The status display is also nicer now.
2012-10-03 22:35:33 -04:00
Colin Walters 8153799121 admin: Prepare /var/log/dracut.log when creating initramfs
Otherwise dracut complains.
2012-10-01 10:25:36 -04:00
Colin Walters 3e9c358628 Update libgsystem
This ensures we're disting the README, which makes the autogen.sh do
the right thing.
2012-09-25 22:25:06 -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 35a1ff51d0 pull: Fix two minor memory leaks 2012-09-23 17:32:11 -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 a8764bf996 diff: Fix case when used on native files 2012-09-23 15:55:02 -04:00
Colin Walters a6e9e54891 admin: Initialize /var more fully
This helps out gnome-ostree, because gdm needs /var/lib for example.
2012-09-18 08:58:07 -04:00
Giovanni Campagna 2881194186 Grub2: use /etc/system-release now that we have one
This matches the upstream code more, and avoids the GNOME OS trademark
in ostree, which is otherwise platform agnostic.

https://bugzilla.gnome.org/show_bug.cgi?id=684049
2012-09-17 00:25:30 +02:00
Giovanni Campagna 8c9406637c Add /ostree/current-etc symlink to current configuration
Configuration associated with a specific revision is stored in a folder
named <revision>-etc. In a similar spirit, add /ostree/current-etc, pointing
to the -etc folder for the revision named by current. This allows
easy editing of configuration from the host distribution, and allows
diffing current/etc and current-etc for configuration changes.

https://bugzilla.gnome.org/show_bug.cgi?id=684049
2012-09-17 00:25:29 +02:00
Giovanni Campagna 8a98e8d964 Update kernel files for command naming changes
ostadmin is now ostree admin.

https://bugzilla.gnome.org/show_bug.cgi?id=684049
2012-09-17 00:00:33 +02: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 117b9c109e ostadmin: Fix up deploy config logic again
Clearly we need tests here...
2012-09-09 11:42:17 -04:00
Colin Walters 2f8b3517f4 admin: Ensure we pass options to subcommands
Otherwise ostree admin --ostree-dir=/foo deploy --no-kernel bar
doesn't work.
2012-09-09 11:31:22 -04:00
Colin Walters 7831ae81c2 update-kernel: Fix free -> g_object_unref 2012-09-09 10:42:13 -04:00
Colin Walters fa5485c6c4 Move "ostadmin" => "ostree admin"
This helps us avoid polluting the global binary namespace.
2012-09-08 19:34:10 -04:00
Colin Walters 2ddbeb1f71 Make /etc a writable mount
First, move deployments to /ostree/deploy.  Having them in the
toplevel clutters the filesystem layout too much.

When we deploy a tree like /ostree/deploy/NAME, there is now also a
writable directory /ostree/deploy/NAME-etc.  This is mounted as
read-write inside the system.

On an initial install, that directory is copied from
/ostree/deploy/NAME/etc.  On subsequent deployments, we find any
changes made in the current deployment's /etc, and apply that set of
changes to the new deployment's /etc.

See https://live.gnome.org/OSTree/EverythingInEtcIsABug
2012-09-06 08:17:23 -04:00
Colin Walters 9ba968a5f4 otutil: Add a few more helper functions
To be used by wip/etc-writable branch.
2012-09-03 10:43:42 -07:00
Colin Walters cf31942a69 core: Refactor diff to be an internal API
For future use by other code.
2012-08-31 17:39:04 -07:00
Colin Walters 38d62d79a2 ostadmin: Also ensure /ostree/modules exists
We depend on host kernel for now.
2012-08-30 17:42:36 -07:00
Colin Walters 60368fae76 Use correct libgsystem
Accidentally pushed a local patch.
2012-08-28 09:58:07 -04:00
Colin Walters a17a8e1f4e Update libgsystem 2012-08-27 18:48:14 -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 5038a1930f traverse: Set an explicit error when loading a corrupted commit
I had a empty files for a .commit and .dirmeta, and previously we were
segfaulting.
2012-08-27 11:39:44 -04:00
Colin Walters 7b977beec8 ostadmin: Cosmetic change for option defaults 2012-08-26 17:34:32 -04:00
Colin Walters e9d23befd0 ostadmin: Add --ostree-dir option to init
Matches the option for deploy.
2012-08-26 17:34:25 -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 e2aabce708 prune: Don't fail if an object isn't found
We expect most people to have partial repositories.
2012-08-25 16:02:38 -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
Matthias Clasen 4b0bbb94a0 Improve the pango trigger
Use the new update-cache mode of pango-querymodules, which
automatically finds the correct cache file location.

Updated to look in both places by Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=682411
2012-08-25 14:59:17 -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
Matthias Clasen f5113085e1 ostree: Remove duplicate command in help output
The 'remote' command was listed twice. Also, the list
was almost-but-not-quite alphabetically sorted. Fix
that too.
2012-08-23 20:03:40 -04:00
Colin Walters 79f993beb4 pull: Only fetch pack files if we want more than 66% of their objects
This avoids some pathologically bad cases where we would fetch a 25MiB
pack file only to extract one 5KiB object from it.
2012-08-22 19:45:01 -04:00
Colin Walters b36b19eaf8 pull: Exit mainloop immediately if we encounter an error
Otherwise we'll just hang.
2012-08-22 19:45:00 -04:00
Colin Walters f115a8943a pack: Support --content-only
This should be useful for implementing more sophisticated packing
strategies.

Also clean up the pack size default handling.
2012-08-22 19:45:00 -04:00
Colin Walters ece71b22c5 pull: Set an error when we get an unsuccessful HTTP response
Otherwise we'll e.g. try to parse 404 HTML as an object which will
fail.
2012-08-22 19:45:00 -04:00
Giovanni Campagna a97bcc68d7 Add infrastructure for automatic kernel updates
If the distribution supports running arbitrary scripts at kernel
updates, we can hook into it and update the ostree side of things
automatically.
2012-08-20 23:01:58 +02:00
Giovanni Campagna affa5755a6 ostadmin: add update-kernel command to regenerate initramfs and boot config
This command regenerates kernel-dependent files. It is meant to
be run after kernel upgrades in the host distribution, to keep
the ostree installation running, and attempts to figure out the
right version automatically (and without changing the ostree checkout)
2012-08-20 23:01:57 +02: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
Giovanni Campagna 1d93a743dc ostree-run-triggers: fix typo in filename comparison function
The comparison function was comparing the first file to itself,
and this resulted in triggers being run in random order.

https://bugzilla.gnome.org/show_bug.cgi?id=682297
2012-08-20 23:01:57 +02:00
Stef Walter f5cf21e471 Include pull and other external commands in usage output 2012-08-19 15:05:01 -04:00
Giovanni Campagna edf69d6283 ostadmin: fix command line handling in the builtins
Common code was duplicating the command name and not shifting
arguments properly, which thus required the builtins to be aware
of it, instead of being treated like subcommands.
2012-08-18 19:21:22 +02:00
Stef Walter 66c8a1d3f6 Support non-builtin commands
* Support executing commands in the path
 * This makes 'ostree-pull' work as 'ostree pull'
2012-08-10 15:55:26 +02:00
Colin Walters 179fc65947 triggers: Print execution time for each trigger 2012-08-05 16:39:57 -04:00
Colin Walters 36b6ad41cb ostadmin: Use g_spawn_check_exit_status()
Just code cleanup.
2012-08-05 16:39:57 -04:00
Colin Walters a6c19aa00c ostadmin: Change command line for qemu deploy helper
The qemu helper really wants to copy kernel modules, but not
update the system bootloader.  Allow it to reuse ostadmin for
this.

Note that our previous path of shelling out to "cp -al" broke because
it refused to make cross-device links.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   src/libotutil/ot-gio-utils.c
#	modified:   src/libotutil/ot-gio-utils.h
#	modified:   src/ostadmin/ot-admin-builtin-deploy.c
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	embedded-dependencies/glib/
#	embedded-dependencies/libsoup/
2012-08-05 16:39:57 -04:00
Colin Walters 09707780b9 ostadmin: Add --ostree-dir directory
This will be used by the qemu deployment script.
2012-08-05 16:39:57 -04:00
Colin Walters 5284d21f8d ostadmin: Print an error message if run as non-root
See https://bugzilla.gnome.org/show_bug.cgi?id=680823
2012-07-30 10:29:45 -04:00
Colin Walters a179138a23 ostadmin: [incompat syntax change] Allow deploying any revision
The old command line syntax assumed you wanted the latest from
a given revision, but to bisect, you really want the ability
to deploy any given one.

Old:
$ ostadmin deploy gnomeos-3.6-i686-{runtime,devel}

New:

$ ostadmin deploy trees/gnomeos-3.6-i686-runtime
$ ostadmin deploy trees/gnomeos-3.6-i686-devel

And note that the deploy directory now changes to:
/ostree/trees/gnomeos-3.6-i686-devel

And now it's possible to:

$ ostadmin deploy trees/gnomeos-3.6-i686-devel trees/gnomeos-3.6-i686-devel^^^
2012-07-26 10:56:32 -04:00
Colin Walters 5bbdce2c06 pull: When --depth is specified, ensure we have all requested objects
We were previously optimizing by skipping object traversal if the refs
were unchanged, but if the user specifies a deeper depth than they did
before.
2012-07-26 10:17:41 -04:00
Colin Walters a310eb861b core: Add context when we fail to chmod()/chown()
This helps make things less confusing when we try to create a file not
owned by our uid, such as running ostree-pull as non-root on a
repository owned by root.
2012-07-19 11:01:39 -04:00
Colin Walters 0d86702115 core: Drop ot_clear_hashtable for g_clear_pointer() 2012-07-17 08:18:43 -04: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 c8d7fc216d core: Use g_spawn_check_exit_status() 2012-07-17 08:06:20 -04:00
Colin Walters 6b31c580ca pull: Only take up one terminal line for status output
And print total bytes transferred at the end.
2012-07-16 22:35:18 -04:00
Colin Walters b2c2bf7e04 Fix libgsystem submodule 2012-07-15 18:29:15 -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 464f4a81c9 Add libgsystem as git external
Don't replace ot_lfree and stuff yet though...to much code churn.
2012-07-15 11:59:05 -04:00
Colin Walters 95921bcbf0 pull: Correctly display concurrent libsoup requests
The "status text" code was assuming that libsoup was only doing one
thing at a time, but that's never been the case.  Change the code to
display the status of all active requests.
2012-07-12 11:19:15 -04:00
Colin Walters 664e9b404d core: drop dead/unused code
The daemon is a nice idea but needs a lot more thought.  Let's just
delete the unused code for now and come back to it later.
2012-06-30 13:49:25 -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 d5a1f1deda pull: Fix a memory leak 2012-06-28 15:18:10 -04:00
Colin Walters a98ca05676 pull: Fix use-after-free in async fetcher
Refcount the pending data structure.
2012-06-28 15:06:18 -04:00
Colin Walters d596615bab main: Fix a format string error 2012-06-27 22:26:16 -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 7cce6e5ba1 pull: Properly propagate errors 2012-06-20 15:42:41 -04:00
Colin Walters ee98a0b4f7 core: Don't silence output of ostree-run-triggers
We want to see which triggers are being run by default.
2012-06-19 16:14:31 -04:00
Colin Walters 4d59080f46 triggers: Quiet GConf trigger
The default is just way, way too verbose.
2012-06-19 15:03:16 -04:00
Adrian Perez bdc57338c1 Add fontconfig trigger
This wil regenerate the fontconfig caches, accounting for modifications in
the system font directories.
2012-06-13 17:58:53 +03: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 270dc05176 ostbuild: Move to gnome-ostree module
Since we want to keep "ostree" buildsystem-independent, let's move
ostbuild out into the gnome-ostree module.

http://git.gnome.org/browse/gnome-ostree/commit/?id=04ba1926e33b442af1e357460e4415d4c0311e87
2012-06-08 19:01:25 -04:00
Colin Walters 6aaa2089f0 ostbuild: Fix previous commit (this should have been amended) 2012-06-08 16:51:51 -04:00
Colin Walters f4b6d88254 ostbuild: Fix -k option to git-mirror 2012-06-08 16:47:23 -04:00
Colin Walters 13b37ddaa2 ostbuild: Allow specifying components to git fetch 2012-06-07 10:19:28 -04:00
Colin Walters 210fbc3daf ostbuild: Add rootdir argument to deploy-qemu 2012-06-06 15:43:42 -04:00
Colin Walters 2c385c0078 ostbuild: Fix circular dependency between resolve and git-mirror
git-mirror was looking for the latest snapshot, which we don't
have until we resolve.

This leads to some code duplication.
2012-06-06 12:56:48 -04:00
Colin Walters a14ff0aeab core: Fix mkdtemp invocation 2012-06-06 10:03:15 -04:00
Colin Walters c436f8ac61 ostbuild: Add -k option to git-mirror
libwacom's sourceforge git server was down...
2012-06-05 22:55:53 -04:00
Colin Walters e485bace01 pull: Download and checksum asynchronously
This is quite a noticeable speedup when downloading loose objects.
2012-06-05 22:38:17 -04:00
Colin Walters df54408e5d core: Fix memory leak 2012-06-05 22:32:03 -04:00
Colin Walters 8f2dda3e25 core: Just require libsoup, not libsoup-gnome 2012-05-31 10:25:41 -04:00
Colin Walters cbd4ade053 core: Switch to using mkdtemp() so we only depend on GLib 2.28
We claim to build against 2.28, let's actually make it work.
2012-05-29 22:34:11 -04:00
Colin Walters f438d9aaa6 core: Drop some dead temporary file code 2012-05-29 22:09:31 -04:00
Matthias Clasen 90aff4f2f6 Trivial: fix a typo 2012-05-26 18:48:06 -04:00
Colin Walters d3b063cec0 ostbuild: Have resolve use git-mirror rather than duplicating code
This also brings us back to a sensible world of:

ostbuild resolve --fetch

Doing both fetch *and* writing out the updated revisions.
2012-05-26 12:10:51 -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 1ef6bb0ef6 ostbuild: add --diffstat option for source-diff 2012-05-25 15:01:41 -04:00
Colin Walters 9c27f1de99 core: Remove leftover debug print 2012-05-25 09:55:10 -04:00
Colin Walters 88b3440eef core: ostree-pull: Add --depth option
This is useful for getting say the last 10 builds.
2012-05-24 20:58:20 -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 f7bbf41132 ostbuild: Add 'tag' concept to manifest, improve git mirroring
We should explicitly distinguish between the case where we have a git
branch we're following, versus an immutable tag.  In the latter case,
we can entirely avoid running 'git fetch' for it once we have it.
This is a noticeable speedup in our current scenario of pinning WebKit
to a tag.

The git mirroring code now has a --fetch-skip-secs=X option which
allows us to basically run it in a loop, without hitting remote git
repositories too often.
2012-05-24 19:54:36 -04:00
Colin Walters 0d1ba45c73 ostbuild: git-mirror: Also fetch patches git 2012-05-24 18:11:06 -04:00
Colin Walters 1a5ea54aff core: Make OstreeRepo struct private 2012-05-23 18:08:52 -04:00
Colin Walters 6c006815ce ostbuild: Fix --debug-shell option 2012-05-23 18:02:08 -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 b45a0803fe ostbuild: Few more misc fixes 2012-05-22 08:26:17 -04:00
Colin Walters 95f66e1157 ostbuild: Fix typos in component lookup path 2012-05-21 18:41:59 -04:00
Colin Walters 9bd36f9bff ostbuild: Enhance source-diff with --log and --logp options 2012-05-18 20:25:02 -04:00
Colin Walters 6d59b4077c ostbuild: Add source-diff builtin
OMG OMG OMG
2012-05-18 20:12:35 -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 790d2757f6 ostbuild: Drop dead branch-prefix and pull-components
And other various tweaks.
2012-05-18 16:30:45 -04:00
Colin Walters 32020e55c8 ostbuild: Various fixes, removal of dead code 2012-05-18 16:30:45 -04:00
Colin Walters ecfd9b2cf3 ostbuild: Remove /var from components
We expect them to create on demand.
2012-05-18 16:30:45 -04:00
Colin Walters a3246d590e ostbuild: Fix git-mirror 2012-05-18 16:30:45 -04:00
Colin Walters bcab6748a5 ostbuild: Some work on qemu deployment 2012-05-18 16:30:45 -04:00
Colin Walters 3a20f6a913 ostadmin: Update for new trees/ location of trees 2012-05-18 16:30:45 -04:00
Colin Walters 6e2efc6134 ostbuild: Add import-tree
This is the new workflow:

$ ostbuild import-tree wip-gnome-menus-3.6
$ $EDITOR ~/build/ostbuild/snapshots/wip-gnome-menus-3.6-2012.1-abcd.json
$ ostbuild build
2012-05-18 16:30:45 -04:00
Colin Walters f4aba2a339 ostbuild: Tighten build process significantly
First, "resolve" now just picks git commits.  We don't expand
config-opts and patches, nor do we generate tree contents.  This makes
the generated files *much* more human editable.

Next, fold "build-components" and "compose" into just "build".  One
never really wants to just build components.  This lets us eliminate
binary snapshots as a concept; instead we always have a combination of
source snapshot and component/ refs.
2012-05-18 16:30:45 -04:00
Colin Walters 92244c80cc ostbuild: More work on partial builds 2012-05-18 16:30:44 -04:00
Colin Walters eae69513a7 ostbuild: Make partial builds work
If we have component-revisions in our source+binary snapshot, then
we can skip them.
2012-05-18 16:30:44 -04:00
Colin Walters 5d0744ea29 ostbuild: Write out related objects on composes 2012-05-18 16:30:44 -04:00
Colin Walters 829a760b56 ostbuild: Minor fixes 2012-05-18 16:30:44 -04:00
Colin Walters 65165ff1df ostbuild: Make binary snapshots an extension of source
This significantly simplifies things; we no longer need to retrieve
individual components via 'pull-components', etc.
2012-05-18 16:30:44 -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 cf53ed5cef core: Limit recursion during traversal
The related objects commit introduced OSTREE_MAX_RECURSION; use it.
2012-05-18 16:30:44 -04:00
Colin Walters cd38cb1489 core: Add write-refs builtin
This will be used by import-tree to pipe refs to write.
2012-05-14 21:58:22 -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 50cc2356f4 core: Really fix saving variants with REPLACE_DESTINATION 2012-05-14 20:49:00 -04:00
Colin Walters 6d9de91672 core: Make argument parsing more robust against "lt-ostree" name
When running uninstalled, we were parsing our argv[0] incorrectly.
2012-05-14 11:31:53 -04:00
Colin Walters 102180c5f2 core: Replace pack superindex via rename() rather than truncating
This helps allow cloning repositories via "cp -al".
2012-05-14 11:22:18 -04:00
Colin Walters 2fbf864251 core: Clarify error message 2012-05-14 11:22:18 -04:00
Matthias Clasen 5a1a300892 ostree-pull: Avoid an uninitialized variable warning 2012-05-12 10:51:01 -04:00
Matthias Clasen 225cebd5ef core: fix a typo
ostree config had two 'set' subcommands, but no 'get'.
2012-05-12 10:50:53 -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 6fbe15fc05 ostbuild: Add ostree-revision in buildroots, bin-to-src
First, for binary snapshots we need to include the exact revision of
the architecture buildroot.  To do that, introduce
"architecture-buildroots2".

Second, for bin-to-src, we'd like to allow "partial" builds.  So while
we do expand everything to source, *also* include the binary
ostree-revision.  This will allow building just one component, while
reusing the previously built binaries.
2012-05-10 14:29:23 -04:00
Colin Walters d1b23f0807 ostbuild: Fix pull-components
We need to pull the actual commits, not the refs.
2012-05-10 10:30:02 -04:00
Colin Walters 488ce33795 pull: Use API to stage files with length
Not doing so at the moment triggers a bug in the staging path, and
it's more efficient anyways.
2012-05-10 10:29:26 -04:00
Colin Walters c6df0b0ae0 pull: Add --prefer-loose option
This is a hack...
2012-05-10 09:54:56 -04:00
Colin Walters efc2810f02 core: unpack: Add --keep-packs option
Matches the pack --keep-all-loose.
2012-05-10 09:47:24 -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 f33a2f9a08 core: pack: Keep loose objects which are referenced externally
By default, don't delete loose objects which have hard links.  This
has the natural semantics that if you delete all the checkouts, you
probably want it packed.

Conversely, if it has a hard link, we do want further checkouts to
share storage, even if we pack in between them.
2012-05-09 23:20:36 -04:00
Colin Walters d8b97316d9 core: unpack: Actually delete no-longer-needed pack files 2012-05-09 23:19:54 -04:00
Colin Walters fdf05be216 ostbuild: resolve: Add --fetch-patches option
This is kind of lame, but...
2012-05-09 19:46:29 -04:00
Colin Walters 7149530976 ostbuild: Allow using dirty-git: for patches too 2012-05-09 19:40:24 -04:00
Colin Walters 92891e60ca ostbuild: Use .lastfetch file per branch
This way we don't try to update gtk+ twice, once for gtk master and
once for gtk-2-22.
2012-05-09 19:36:46 -04:00
Adrian Perez bd6bd0eed5 ostree-pull: Fix segfault by initializing pull_data earlier
In the case of not being able to check the repository or not being able
to parse command line arguments, attributes from "pull_data" would be used
with garbage in them. This patch makes initialization of the sctructure to
happen earlier so it is safe to use in those cases.
2012-05-09 14:10:23 -04:00
Colin Walters d9bc7e0acd ostbuild: build-components: Ensure specifying components forces rebuild 2012-05-09 12:46:04 -04:00
Colin Walters d2da92be07 Move gnomeos/ to "gnome-ostree" module
Now that we're hopefully going to be changing the format less.  The
layering here is now more clear, rather than having things entangled.
2012-05-09 09:29:27 -04:00
Colin Walters dfbf1f7ac6 ostadmin: Use /ostree for current working directory of checkouts
Otherwise we put them in the wrong place.
2012-05-08 10:21:38 -04:00
Colin Walters 9179d1b27a ostadmin: Make a /ostree/current symbolic link 2012-05-08 09:14:03 -04:00
Colin Walters 18b6f5fd0c ostadmin: Initial code 2012-05-07 20:43:03 -04:00
Carl-Anton Ingmarsson 1de0cc238b ostbuild: further fixes to pull-components
Call self.parse_config() so that all necessary directories are parsed.

Also don't call nonexistant self.parse_active_branch() and just use
self.active_branch since it's already have been initialized.
2012-05-07 17:54:04 -04:00
Colin Walters f487500e50 ostbuild: Default to (previous) --skip-built
For components specified on the command line, we now force a rebuild.
There's also a new option to skip if the git revision matches, but
metadata changed (useful for now to avoid cascading builds if you know
you don't need it).
2012-05-07 17:51:12 -04:00
Matthias Clasen 2ca6f04265 ostbuild: make pull-components work
This builtin did not work for me. It did not initialize self.repo,
it used the nonexisting parse_active_branch function unconditionally,
and it did not actually find the list of components in contents.json.

This commit fixes all three of these issues.
2012-05-06 14:09:28 -04:00
Matthias Clasen ae0b4ac628 Fix a typo 2012-05-06 13:57:09 -04:00
Matthias Clasen 07f67f3baf ostree: avoid a segfault
When running ostree --repo=/ostree/repo without further arguments,
we end up calling strcmp with one argument being NULL.
2012-05-06 13:56:57 -04:00
Matthias Clasen 4a03176489 checkout: Deal gracefully with bad input
I had a /ostree/gnomeos-3.4-i686-devel directory, and this caused
ostree --repo=repo checkout gnomeos-3.5-i686-devel
to segfault.
2012-05-06 09:23:49 -04:00
Colin Walters c0e73c9fa0 core: pack: Fix calculation of size of pack objects
In archive mode, due to the previous change, we're now only
looking at metadata size, which is clearly wrong.
2012-05-05 16:00:53 -04:00
Colin Walters a0ad28c16c core: pull: Fix regression from memory leak fixes 2012-05-05 14:59:14 -04:00
Colin Walters 38dd179017 core: Compile again on GLib 2.28 2012-05-05 11:45:19 -04:00
Colin Walters ba1c75c61b ostbuild: Drop use of link cache, it's gone now 2012-05-05 09:54:42 -04:00
Colin Walters 9aa9397e42 ostbuild: Create deploy-qemu subcommand 2012-05-04 16:16:16 -04:00
Colin Walters a2d937c2f0 triggers: Print name of each trigger we're running 2012-05-04 16:16:16 -04:00
Adrian Perez 5835bb72b4 ostbuild: Make --shell-on-failure flag to work
Fixes an issue which would cause ostbuild to fail to spawn the
debug shell and print a traceback instead.
2012-05-04 16:16:16 -04:00
Colin Walters 0597a3f71c ostbuild: More work on deploy commands 2012-05-04 16:16:16 -04:00
Colin Walters 3a365521a8 ostbuild: Use --from-file for buildroot compose for easier debugging 2012-05-04 16:16:16 -04:00
Colin Walters 8785fefda8 ostbuild: Rename shadow-repo-init -> init 2012-05-04 16:16:16 -04:00
Colin Walters 851a9c2ce9 ostbuild: Checksum full component metadata for --skip-built
If we're using --skip-built, we really do want to rebuild if anything
changed (like the build dependency, configure arguments etc.)
2012-05-04 16:16:16 -04:00
Colin Walters 29b230107e ostbuild: Break out git-mirror from resolve
Other bits
2012-05-04 16:16:16 -04:00
Colin Walters 986cd2172b ostbuild: Use expanduser 2012-05-04 16:16:16 -04:00
Colin Walters 938f4eaf44 ostbuild: Lots more 2012-05-04 16:16:16 -04:00
Colin Walters b845e0a2bb ostbuild: Resolve takes --manifest arg 2012-05-04 16:16:16 -04:00
Colin Walters a6a8e00edf ostbuild: Add tree-to-bin and bin-to-src 2012-05-04 16:16:16 -04:00
Adrian Perez 0e266d3f92 ostbuild: Fix DB saving with /tmp and builddir in different volumes
This fixes the case where /tmp resides in one volume, and the build
directory in a different one: by storing the temporary file in the
same directory as the target one, we avoid the case in which os.rename()
would cross file system boundaries.

Reviewed-by: Colin Walters <walters@verbum.org>
2012-05-04 16:16:16 -04:00
Colin Walters 717cec46c3 ostbuild: Major rework 2012-05-04 16:16:16 -04:00
Colin Walters 7280ce358d ostbuild: Show ostbuild log messages in warningfilter again 2012-05-04 16:16:16 -04:00
Colin Walters d040b61d19 core: checkout: Add --from-file option too
Easier for debugging if we don't have to redirect stdin.

Conflicts:

	src/ostree/ot-builtin-checkout.c
2012-05-04 16:15:20 -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 6cdbedf4e6 core: pull-local: Be a bit more verbose, don't open objects we already have 2012-05-04 16:13:44 -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 3321fa08d7 core: Handle zero-sized archives, improve fsck error message 2012-05-04 13:40:25 -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 99cb8a80fa daemon: Use g_thread_new() for GLib 2.32 2012-05-03 16:07:18 -04:00
Colin Walters ff3867c052 core: Increase type safety of some local alloc functions 2012-05-03 16:05:53 -04:00
Colin Walters 749bf56917 core: Fix gcc uninitialized-variable warning 2012-05-01 18:53:00 -04:00
Colin Walters d4321629f4 core: Rename local-clone to pull-local
Also change it to copy selective refs, rather than enumerating
all objects.
2012-05-01 17:44:29 -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 233558d230 core: diff: Fast path unmodified directories 2012-04-29 12:15:12 -04:00
Colin Walters 9cb87ffc07 core: pack: Add --metadata-only argument
Useful for bare repositories.
2012-04-29 12:15:12 -04:00
Colin Walters da3b17be1e core: Fix uninitialized variable 2012-04-26 11:52:26 -04:00
Colin Walters bf3abd02cd core: local-clone: Delete leftover code assuming file objects are loose 2012-04-25 09:44:46 -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
Adrian Perez 99142ef417 switchroot: Properly check for number of arguments
The ostree-switch-root tool expects three arguments (argc=4): new root, OS
tree target, and init(8) binary to launch inside it. Also, the error message
when not enough arguments are passed now tells about the second argument
being the target OS tree.

Reviewed-by: Colin Walters <walters@verbum.org>
2012-04-18 15:20:46 -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 920cbbc242 triggers: Test for gconftool-2
This was done for the rest of the triggers.
2012-04-13 16:11:03 -04:00
Colin Walters 863384b90d ostbuild: Take advantage of link cache
This greatly speeds up construction of buildroots.
2012-04-13 16:10:40 -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 188621f0b2 core: Drop 'compose' builtin
We'll just add this functionality to commit.
2012-04-11 19:54:55 -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 6542b8f5c9 core: unpack: Regenerate pack index after unpacking 2012-04-11 19:54:30 -04:00
Colin Walters d63ec5c2ff core: Fix uninitialized variables 2012-04-11 19:54:30 -04:00
Colin Walters 394fe75471 core: Port builtins to local alloc macros 2012-04-09 15:57:46 -04:00
Colin Walters 8b6bf09d7a core: Port libostree to local alloc 2012-04-09 15:57:46 -04:00
Colin Walters 87f45052af core: Port libotutil to local-alloc 2012-04-09 15:57:46 -04:00
Colin Walters ca08ad6c5e core: Add macros for local allocation
This is GCC-specific, but it makes the code significantly
cleaner.
2012-04-09 15:56:28 -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 74485bed35 core: pull: Add progress bar, allow pulling individual commits 2012-04-08 17:26:02 -04:00
Colin Walters a69e4452b4 core: checkout: Add --from-stdin option
This allows checking out many branches in one go, useful in
combination with the --union flag for ostbuild to combine a lot of
components.
2012-04-06 15:11:11 -04:00
Colin Walters 92ab820c0b ls: Add mode to print filenames as binary
This is useful to extract the file listing to another program.
2012-04-06 15:10:20 -04:00
Diego Escalante Urrelo b64cd799dc ostree-pull: GOptionEntry must be NULL terminated 2012-04-05 09:05:22 -04:00
Colin Walters bae584c64a core: Associate branches with remotes, move trigger runs into checkout
Also add --atomic-retarget option to checkout. This does the magical
symlink dance to do atomic swaps between trees.
2012-04-03 23:46:34 -04:00
Colin Walters 3f23ac156a core: Clean up stale packfiles 2012-04-03 23:46:34 -04:00
Colin Walters 8792007bc1 core: Validate structure of objects in fsck 2012-04-03 08:52:58 -04:00
Colin Walters 10b2f30165 core: Make pull slightly more verbose 2012-04-03 08:52:44 -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 56089abd43 core: Make fsck verify from commit objects
Rather than verifying every object, traverse all commit objects we
find.  This is a better check, since primarily we care about being
able to check out trees.  In the new packfile regime, this ensures
validity of packed data.

It also means we aren't checking loose objects that we most likely
don't care about.
2012-04-02 18:32:40 -04:00
Colin Walters d8173a5125 core: Move commit/dirtree traversal into library
So it can more easily be reused by other builtins.
2012-04-02 18:32:40 -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 68cce01556 core: Add stream->variant helper, as well as clear macros for ptrarray/hashtable 2012-03-31 10:32:26 -04:00
Colin Walters b221b0fdd6 core: Add a few more GIO utility functions 2012-03-31 10:32:02 -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 277843f3a2 ostbuild: Add preserve_net config option
This is going to be necessary for the builder.
2012-03-13 17:06:06 -04:00
Colin Walters 8e3a3c5667 ostbuild: Re-unify into one snapshot.json file
This is actually easier.  Now add 'ostbuild query-content' which can
extract the JSON data we stuff into builds.
2012-03-13 10:39:31 -04:00
Colin Walters 4d1d6789c2 ostbuild: Rework again, split into components.json and targets.json
The "resolve" builtin now does a lot more heavy lifting; we expand the
manifest.json, and "build" consequently is less intelligent now, more
of a low-level implementation.
2012-03-13 10:39:31 -04:00
Colin Walters ee49c8098c ostbuild: Only check out source if we need to
When using --skip-built, we shouldn't do a checkout if we're not going
to build.
2012-03-13 10:39:31 -04:00
Colin Walters addbdb619c ostbuild: Stop generating git mirror config
Nothing's using it right now and it's a little buggy.
2012-03-13 10:39:31 -04:00
Colin Walters 87e9a29f11 ostbuild: Further work on regenerating a snapshot from a compose 2012-03-13 10:39:26 -04:00
Colin Walters 07e93bd326 ostbuild: Change to name-prefix and base-prefix in manifest
This makes it clearer that we're using this as a prefix, when we
generate the snapshots.
2012-03-13 10:39:26 -04:00
Colin Walters 76f7bf2060 ostbuild: Switch to composing via checkouts+commit
Store the compose contents as a JSON file in the filesystem tree.
This is more flexible compared to defining "compose" as just a literal
layering of filesystem trees.  For example, we might want to run
prelink.
2012-03-13 10:39:26 -04:00
Colin Walters 5dd62af628 ostbuild: Stop using "compose" to make buildroots
It pollutes the repository with a combinatorial explosion of .dirtree
metadata files, and we don't really need to track buildroots at that
level.
2012-03-13 10:39:25 -04:00
Colin Walters 5275e8d6b2 ostbuild: Drop "commit-artifacts" builtin
It's long since dead.
2012-03-13 10:39:25 -04:00
Colin Walters c11cefb99b ostbuild: Kill "autodiscover-meta"
No longer needed.
2012-03-13 10:39:25 -04:00
Colin Walters d3059d254b ostbuild: Adapt "status" to expanded manifest 2012-03-13 10:39:25 -04:00
Colin Walters ff81b21bcf ostbuild: Adapt "build" to newly updated expanded manifest 2012-03-13 10:39:25 -04:00
Colin Walters c71770c08c ostbuild: Write out separate arch-component snapshots 2012-03-13 10:39:25 -04:00
Colin Walters c3debe0fb6 ostbuild: 'checkout' command now also applies patches 2012-03-13 10:39:25 -04:00
Colin Walters d8eebaa2d1 ostbuild: Pull patches from specified patches git repository
We need to be more formal about where we get patches from, and more
specifically what version.  Let's assume they're also stored in a git
repository that we fetch, instead of copying them from "wherever the
manifest is".

This meshes nicely with splitting between manifest.json and
snapshot.json.
2012-03-13 10:39:25 -04:00
Colin Walters 6890444f28 ostbuild: Change metadata keys for artifacts
"ostbuild-name" is important to tie back in to the snapshot.
"ostbuild-revision" is shorter than ostbuild-artifact-version.
2012-03-13 10:39:25 -04:00
Colin Walters 12f2f8929d ostbuild: Copy snapshot JSON into artifact trees
This is kind of a hack...but...
2012-03-13 10:39:25 -04:00
Colin Walters d2f298488f ostbuild: Sort keys in JSON snapshot 2012-03-13 10:39:25 -04:00
Colin Walters b8e3f622f1 ostbuild: Rename build manifest to "snapshot.json"
It was confusing having two manifests.  "snapshot" matches the
jhbuild term for the same thing.
2012-03-13 10:39:24 -04:00
Colin Walters 40aedeb7a4 ostbuild: Move more intelligence into chroot-compile-one
Let's have chroot-compile-one be the core logic for composing a
buildroot, etc.  This allows us to use it as a developer tool by
checking out a tree, then doing a chroot build.
2012-03-13 10:39:24 -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 eb4302517f core: Fix crasher in "rev-parse" 2012-03-08 12:10:58 -05: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 83fb6d56e1 core: Don't call unlink() on directory if it already exists
If we fail to make a directory because it exists, we shouldn't call
unlink() on it.
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 4db485dd5f core: Add "subpath" option to checkout
Will be used by ostbuild to extract e.g. /runtime or /devel from
artifacts.
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 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 f484665bfe libotuil: Fix missing #define in header 2012-03-06 11:59:06 -05:00
Colin Walters e4849ebd2b mainloop: Don't create poll until we need to
This slightly optimizes the case where we speculatively create a
Mainloop we might not use.
2012-03-06 11:59:06 -05:00
Colin Walters da00891688 core: Allow 'rev-parse' to resolve multiple revs 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 9dc86d0f5e compose: Don't print trailing (null) if we skip committing
If we skip a commit due to an idential content parent, we shouldn't
print the (null) commit checksum.
2012-03-01 16:08:27 -05:00
Colin Walters 6829ab2260 pull: Allow pulling multiple specific refs 2012-02-28 13:17:03 -05:00
Colin Walters 19bc7ff85f prune: Fix two crasher bugs 2012-02-27 09:53:44 -05:00
Colin Walters 2440338968 pull: Add ability to fetch refs/summary if no ref specified
This allows us to fetch all refs, which is useful for ostbuild where
we do want the buildroot/ refs.
2012-02-27 08:37:51 -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 6ff07e0b3e pull: Print download URLs by default, rather than requiring -v
Let's leave verbose for more debug-type stuff.
2012-02-26 08:35:26 -05:00
Colin Walters 5329f1706b core: Further fix fallout from archive mode files
Continuing from 16c0cfe9b5, we now have
the problem that we're removing the executable bit, which obviously
breaks things when we chroot in for a build.  Fix this by masking over
our bits.
2012-02-24 17:50:44 -05:00
Colin Walters 0e5919bde1 core: Disable Soup-gnome features for pull
Otherwise we get a dconf thread that tries to talk to the session bus.
I think this comes from the proxy settings lookup.
2012-02-24 17:26:17 -05:00
Colin Walters ab58faefef core: Disable Gvfs for binaries
Otherwise
1) Lots of unnecessary shit happens and I like my straces to be clean
2) There is no dbus session bus for system daemons or when we're run
   in a root context
2012-02-24 17:24:50 -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 a417ee3fed core: Add "prune" builtin
This should be useful on clients to trim old refs.  For example,
after an upgrade the system could do:

ostree --repo=/ostree/repo prune --depth=2 gnomeos-3.4-i686-runtime

This would remote all objects that aren't in the current build and the
previous one.
2012-02-24 10:23:35 -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 8145faecbf pull: Don't automatically uncompress data
This totally breaks when the file we're trying to request was already
gzip'd.  We don't want to uncompress e.g. man pages because that
breaks content-addressed storage.
2012-02-23 21:52:15 -05:00
Colin Walters 7907a853b4 pull: Incrementally write into temporary file
Rather than downloading into one big chunk in memory, then writing all
at once.
2012-02-23 19:20:36 -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 802959f398 core: Ensure .archive-content files are mode 0644
We don't want to inherit the permissions of the actual file, otherwise
trying to fetch e.g. /etc/passwd when being served via Apache httpd
will break.
2012-02-23 12:34:43 -05:00
Colin Walters dee30bda7c pull: Only fetch .archive-content for regular files
Otherwise e.g. Apache httpd might try to follow a symbolic link to
/bin/tinylogin which clearly won't work.
2012-02-23 12:30:01 -05:00
Colin Walters 0a195e6874 ostbuild: Make resolve fully expand config-opts, delete now-unnecessary vcsconfig
The source manifest format allows for compression, but it's more
convenient for consuming code if it's fully expanded in one place.
2012-02-22 15:17:42 -05:00
Colin Walters b26b981b0d ostbuild: Use correct directory for submodule update 2012-02-22 14:17:18 -05:00
Colin Walters 9939f1861d osbuild: Don't use linux-user-chroot for git submodules
On the ostree.gnome.org build server, LDAP is used for username
lookups, and git aborts if it can't look up the user.
2012-02-22 11:51:18 -05:00
Colin Walters 341096f18a ostbuild: Drop down to Python 2.6
Hopefully this gets us working on RHEL6.
2012-02-20 22:31:10 -05:00
Colin Walters 21f1ca364f triggers: Fix comparison function 2012-02-19 21:10:59 -05:00
Colin Walters 633da1e7ad triggers: We need to order their execution
Otherwise we run in inode order which is unpredictable.  In particular
this causes problems because we might run e.g. the gtk+ trigger before
the gdk-pixbuf one.  And ldconfig should really be first.
2012-02-19 20:52:50 -05:00
Colin Walters f1e38d6e4b ostbuild: Add --recompose argument
This is necessary to run after rebuilding the Yocto base.
2012-02-16 18:30:42 -05:00
Colin Walters 8729997eab switchroot: Bind mount /lib/modules after we mount /lib
Otherwise we don't ge the right /lib/modules.
2012-02-13 10:56:13 -05:00
Colin Walters fcd70e5891 switchroot: Bind mount /lib/modules from /ostree/modules
Since we have kernels outside of the tree, keep modules outside
too.
2012-02-10 19:17:29 -05:00
Colin Walters 351d243ccf ostbuild: Fix --debug-shell
We want to reuse an existing source tree.
2012-02-09 16:47:25 -05:00
Colin Walters 820709e791 ostbuild: When doing a fetch, call fetch before trying to mirror the branch
Otherwise when the manifest specifies a branch we haven't fetched, we
error out.
2012-02-09 11:19:33 -05:00
Colin Walters feca75a930 switchroot: remount rootfs read/write
See rationale in comment.
2012-02-08 22:23:25 -05:00
Colin Walters 8e944cbffd ostree-switch-root: Correctly prepend sysroot before mounts to move from dracut 2012-02-08 20:22:27 -05:00
Colin Walters 0172ab5a3a switchroot: Further work on being dracut-only 2012-02-08 17:32:34 -05:00
Colin Walters fef67756f9 ostbuild: Add 'status' command
Roughly equivalent to 'jhbuild info'.
2012-02-08 16:37:14 -05:00
Colin Walters a904c9693b Add ostree-switch-root here
Merge the code from ostree-init; now that we're back to targeting an
initramfs (dracut), we don't need to statically link the binary, so
there's no strong reason to have a separate module.
2012-02-05 16:02:44 -05:00
Colin Walters 097c1b8025 vcs: Delete temporary directory too 2012-02-02 13:56:46 -05:00
Colin Walters 73fa98694e builtins: Fix error message if workdir doesn't exist 2012-02-02 13:56:25 -05:00
Colin Walters 845ba39a0e ostbuild: Add 'checkout' builtin
This is useful for the developer to get the source code of
several things at exactly the revision specified in the manifest.
2012-02-02 09:22:44 -05:00
Colin Walters df92b8d46f ostbuild: Unify mirrordir lookup code 2012-02-02 08:40:18 -05:00
Colin Walters f1930d2c99 triggers: Fix typo in gconf trigger 2012-01-31 22:59:28 -05:00
Colin Walters a8151ac836 Add gconf trigger 2012-01-31 22:54:23 -05:00
Colin Walters 914f9ffc61 ostbuild: Actually compose devel image from devel base
Otherwise we don't have gcc, gdb, git etc...
2012-01-31 18:57:02 -05:00
Colin Walters 102f6a7f43 ostbuild: Make separate .lastfetch files for e.g. gtk2 and gtk3
This ensures we don't need to check out any git repository which is
built twice under different names.
2012-01-29 17:24:20 -05:00
Colin Walters e048173c60 ostbuild: Fix error message for unknown builtin 2012-01-29 16:47:19 -05:00
Colin Walters 8c878ebb86 mainloop: Ensure we reset running to True when rerun
Otherwise we pretty much exit immediately...
2012-01-29 13:29:31 -05:00
Colin Walters 3426de05fe ostbuild: Ensure we return the right process exit code 2012-01-27 11:09:53 -05:00
Colin Walters 1d3b9ae711 triggers: Add dconf update
Necessary for gdm at least.
2012-01-23 18:09:33 -05:00
Colin Walters 00ec0ddb9b core: Add --delete option for fsck
Useful to clean up any broken objects.
2012-01-23 17:06:10 -05:00
Colin Walters 8e36e80896 ostbuild: Support marking files as setuid 2012-01-22 13:31:22 -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 1ca517f36f ostbuild: chdir into source directory when launching debug shell 2012-01-20 17:52:08 -05:00
Colin Walters dde4da9513 core: Allow cloning only certain refs for local clone
This is way, way faster.
2012-01-20 17:50:59 -05:00
Colin Walters d4470a844d ostbuild: Ensure we look in correct git repository if --fetch is specified
The mirrordir variable was bound from the previous iteration, which
was clearly broken.
2012-01-19 18:31:37 -05:00
Colin Walters 16f2f5f7e5 mainloop: Only delete pid watch if we found the right pid 2012-01-19 18:30:45 -05:00
Colin Walters abfe17e2cb ostbuild: Show cwd on failure
This is helpful for disambiguation.
2012-01-19 16:41:59 -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 660ff7422f ostbuild: Various cleanups 2012-01-18 17:38:31 -05:00
Colin Walters 970682a779 ostbuild: Actually do check for Makefile
Just kidding, we need the makefile path to check for .NOTPARALLEL
2012-01-18 17:08:30 -05:00
Colin Walters 4af64c7635 ostbuild: Don't check for a "Makefile"
WebKit uses GNUmakefile which is totally valid, and this check
isn't really gaining us anything.
2012-01-18 16:40:47 -05:00
Colin Walters 55f6998d37 ostbuild: Ensure we don't retrieve submodules from the network
This is a bit gross...we have to manually frob the submodule
URLs to point to our mirror.
2012-01-18 13:35:53 -05:00
Colin Walters 298e4957d9 ostbuild: Support rm-configure flag
This is easier than making git patches that delete configure.
2012-01-16 20:17:39 -05:00
Colin Walters 9d37f76a5a ostbuild: Actually exit with error if we fail a build 2012-01-16 17:50:57 -05:00
Colin Walters 5bf4eb39e7 ostbuild: Do fetches before resolution
Otherwise we get the OLD revision in the manifest.
2012-01-16 09:57:40 -05:00
Colin Walters a6e6146ab6 core: Note which artifact failed to compose 2012-01-16 09:57:24 -05:00
Colin Walters 813923943d ostbuild: Fix documentation dir (should be 'doc') 2012-01-16 09:57:00 -05:00
Colin Walters b1ff693ea3 Revert "ostbuild: Check for the Makefile in the correct directory"
I'm not sure how this made anything work...probably I was screwing
something else up.

This reverts commit aeeed8da13.
2012-01-16 09:39:13 -05:00
Colin Walters bff6baced8 ostbuild: Save build logs to a file, monitor output for warnings
This is bringing us back closer to metabuild.
2012-01-16 09:27:46 -05:00
Colin Walters d5def94b54 ostbuild: Clean up artifact splitting, put non-symlink .so in runtime
We were breaking nss which just installs libnss3.so as the real
shared library.
2012-01-15 21:45:12 -05:00
Colin Walters e34b90453c gnomeos: Building gdm 2012-01-15 17:06:18 -05:00
Colin Walters ef7f12f31b ostbuild: Run triggers after constructing build root 2012-01-15 17:05:23 -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 610afbd2f1 ostbuild: Make --fetch a separate option 2012-01-14 16:56:31 -05:00
Colin Walters aeeed8da13 ostbuild: Check for the Makefile in the correct directory 2012-01-14 16:54:00 -05:00
Colin Walters 40226c2769 core: Move triggers into separate binary: ostree-run-triggers
I'm trying to keep ostree as being closer to just being the versioning
filesystem, so let's split out the triggers into a different binary
(although still namespaced ostree-).
2012-01-13 15:08:27 -05:00
Colin Walters 134cddaa96 ostbuild: Make explicit resolve (and fetch steps)
Build should only work on already-downloaded sources.
2012-01-12 23:22:39 -05:00
Colin Walters b44afdef23 ostbuild: Lots of stuff
* Only create one build commit which contains multiple artifact trees,
  rather than one per artifact.  This is atomic.  We can use the new
  compose syntax like foo:/devel to slice out the /devel tree.
* Create the minimal buildroot for each component by composing the
  previous components in the build order, instead of continually
  updating one big tree.
* Ensure the artifact builder gets empty directories in /etc
2012-01-12 10:48:11 -05:00
Colin Walters ef2a16525e ostbuild: Optionally log start of commands we want output from too
compose is slow, but we also want output.
2012-01-11 14:33:48 -05:00
Colin Walters 1f398e001b ostbuild: Import odict from gobject-introspection 2012-01-11 14:32:37 -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 e693d2cfe5 core: Error out on an empty compose 2012-01-11 13:42:37 -05:00
Colin Walters 0044ff133a core: Add from-file argument to compose
We don't want to have to pass a million arguments.
2012-01-10 18:55:00 -05:00
Colin Walters 46d09b1501 compile-one: Fix build of modules that don't support srcdir != builddir
We need to run configure and make/make install in the _build
directory.
2012-01-09 19:56:03 -05:00
Colin Walters 492f0777f2 ostbuild: Make --debug-shell not exit immediately
We need to keep stdin open.
2012-01-09 11:10:10 -05:00
Colin Walters cddd58fbd8 ostbuild: Allow specifying no components to mean "all" 2012-01-08 14:20:52 -05:00
Colin Walters 888d33c943 core: Make diff accept one argument too to mean "foo^ foo" 2012-01-08 14:20:07 -05:00
Colin Walters e21b181b4a ostbuild: Allow specifying components to build on the command line 2012-01-07 11:47:51 -05:00
Colin Walters 8d935f46c4 core: Make local-clone handle nested refs/heads directories 2012-01-07 11:26:12 -05:00
Colin Walters 788dfe89e1 core: Ensure we abort transaction if we fail in the middle
Otherwise we could leave a lot of temp files lying around.
2012-01-07 11:11:51 -05:00
Colin Walters a2fdbcbe63 ostbuild: Switch to JSON metadata, various other fixes 2012-01-06 20:02:46 -05:00
Colin Walters 732b37698e ostbuild: Don't fail if trying to rename() across a bind mount 2012-01-06 14:07:20 -05:00
Colin Walters 5b2a5d1dd1 ostbuild: Make use of --recompose 2012-01-06 14:07:12 -05:00
Colin Walters 95d0e94370 core: Make --recompose skip passed arguments if they were already composed
This allows us to do "--recompose -b foo bar baz" and add bar and baz
iff they weren't already there.
2012-01-06 14:04:39 -05:00
Colin Walters d72d6c5fb1 ostbuild: Use split out linux-user-chroot binary
This way other meta-build projects could use it; mainly mock/pbuilder.

Also I don't have to keep running chown root:root; chmod u+s in a
separate root terminal after every install.
2012-01-06 11:41:27 -05:00
Colin Walters fea117cd5e gnomeos: Move everything into JSON, start plowing through X.org
Also:

* Stop generating tarballs for artifacts, use plain directories
* Commit artifacts as uid/gid 0, with no xattrs

Other misc stuff
2012-01-05 23:05:49 -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 5c3614d644 core: Error out cleanly if user attempts to commit an empty tree 2012-01-05 18:27:21 -05:00
Colin Walters 5b0084994e gnomeos: We can now build gobject-introspection 2012-01-03 19:09:12 -05:00
Colin Walters 1ae5149a3d core: Make compose skip commit if tree is identical
This was a new option for commit, but we always want to do it
for a compose.
2011-12-27 10:32:28 -05:00
Colin Walters 31ba50b809 core: Add --print-metadata-key option for show
Useful for tools to extract simple metadata.
2011-12-26 22:09:14 -05:00
Colin Walters a080ff0181 ostbuild: Port chroot-compile-one to ostbuild executor 2011-12-23 12:15:57 -05:00
Colin Walters be117edee4 ostbuild: Port commit-artifacts to ostbuild executor 2011-12-23 10:57:54 -05:00
Colin Walters 853dda39e7 ostbuild: Move autodiscover-meta to ostbuild executor 2011-12-23 10:48:57 -05:00
Colin Walters 122b31ed3b ostbuild: Make new 'ostbuild' main entry point, and compile-one a subcommand
The collection of Python scripts here have gotten to the point where
we need to share code.  Start refactoring things so that we have one
main command which imports subcommands as libraries.
2011-12-23 10:40:27 -05:00
Colin Walters 633477806c ostbuild: Propagate buildroot version, finish add-artifacts
We need to track what buildroot each artifact was created in.
2011-12-23 07:46:08 -05:00
Colin Walters 1687f3efa8 core: Add --add-metadata-string option for commit
A convenience function for the common case of slapping a string into
the metadata.
2011-12-23 07:17:46 -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 d8ea31e24e core: Add some more sanity checks to pull when parsing metadata 2011-12-22 17:00:58 -05:00
Colin Walters 786ce3b560 core: Preemptively error out on paths longer than PATH_MAX
Just noticed this while thinking like an attacker.
2011-12-22 16:50:01 -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 9bcd4ff8aa core: Use global random object
We were pointlessly creating a new rand (and thus opening /dev/random)
on every temp file creation, but still using the global rand.
2011-12-22 11:23:16 -05:00
Colin Walters 0018b6d75f core: Drop unix::is-mountpoint from fast queryinfo flags
If this is present, we call access() and stat() on the parent
directory.
2011-12-22 11:07:55 -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 8a499c4a2a core: Add --recompose option for compose
This will allow us to easily regenerate a compose without passing the
full list of components each time.
2011-12-22 10:29:16 -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 59281d5901 core: Add omitted mutable tree files 2011-12-21 18:58:27 -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 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 0b8754d47c ostbuild: Separate metadata discovery, kill wrapper scripts
Add a simple KEY=VALUE metadata file format, and rather than
assuming 'basename' at a low level, allow passing e.g. NAME=gtk3
to override "gtk+".

The wrapper scripts are annoying...for now let's just remove them.
2011-12-21 10:52:57 -05:00
Colin Walters 835e0eae59 ostbuild: In chroot build, reuse source directory basename
This ensures that the output artifacts are named correctly, and not
"source".
2011-12-20 18:45:20 -05:00
Colin Walters acca018e57 ostbuild: Ensure private libraries are in runtime, and kill .la files
A regular libfoo.so not in one of the regular directories should go in
runtime.  (Probably we should double check it's a regular file too).

Also, delete .la files unconditionally.
2011-12-20 18:42:27 -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 5f3b029638 ostbuild: Flesh out chroot build to use ostbuild-user-chroot
One thing that made this take significantly longer than it might
have otherwise is that we have to keep PWD "up to date" - otherwise
we hit bugs in glibc's getcwd() implementation.
2011-12-19 21:44:32 -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 ecbffd4915 core: Don't insert null byte in temporary file names 2011-12-15 13:10:41 -05:00
Colin Walters 8ab2296a70 core: Add utility functions to convert a OstreeObjectType to/from a string 2011-12-15 13:09:51 -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 db9b7b7be6 osbuild: Make a MS_NOSUID bind mount over /
This closes a serious issue in that we still do a uid switch to 0 when
executing a suid binary, even though we're not gaining capabilities.
2011-12-12 12:13:32 -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 d3058629fd core: Change fsck to use packfile parsing API 2011-12-08 18:04:37 -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 7932811fbb core: Delete some dead code 2011-12-08 14:55:41 -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 15d23546ff user-chroot: Add --unshare-pid, --unshare-net, and --mount-proc
To use CLONE_NEWPID we have to actually call clone() because it's
not supported by unshare().

To enable CLONE_NEWPID to be useful, we have to allow creating a new
proc mount rather than binding an existing one.
2011-12-07 10:52:42 -05:00
Colin Walters fbb09d71a6 ostbuild: Add --unshare-ipc flag for user-chroot
This optionally closes down more paths to the host, which is
a good thing.
2011-12-07 09:48:38 -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 fb5ecdac42 ostbuild: Also allow making directories read-only 2011-12-06 19:36:42 -05:00
Colin Walters a4b249e333 ostbuild: Clarify "safely" for user-chroot 2011-12-06 14:39:30 -05:00
Colin Walters d32b2cb572 ostbuild: Recursively make mount points private
This ensures we're not going to mutate any global state.
2011-12-06 14:36:57 -05:00
Colin Walters 3042724698 ostbuild: Allow binding arbitrary directories, don't hardcode /proc /dev
This is just more flexible, and eventually we want this to be a
generic user-chroot tool.
2011-12-06 14:06:45 -05:00