Commit Graph

443 Commits

Author SHA1 Message Date
Matthew Barnes b05d670031 libotutil: Remove ot_variant_new_from_bytes()
Not needed anymore - use g_variant_new_from_bytes().
2015-03-02 15:12:06 -05:00
Colin Walters 08476ce254 deltas: Prune deltas when the corresponding "to" commit vanishes
We want prune to actually give you back disk space when using deltas.
2015-02-16 10:10:35 -05:00
Colin Walters 92cc3b5968 deltas: Use base64 for csums, add version to parts 2015-02-16 10:10:35 -05:00
Colin Walters 9cc9804195 Change pull-local to just be a wrapper for pull with file:///
This follows up from the previous commit; now that pull knows how to
do the efficient link() or copy for local files, we can just have
pull-local call into ostree_repo_pull().

As part of this:
 - pull() can also accept a file:/// URI instead
   of a remote name (since pull local supports anonymous pulls)
 - pull() knows an "override-remote-name" option, since pull-local
   supported writing a ref out even if there wasn't a remote with
   that name
2015-02-08 04:43:06 -05:00
Colin Walters ab3bf493dd pull: Optimize file:/// URIs to skip libsoup and hardlink if possible
It's always been suboptimal to have both pull and pull-local; as we go
beyond the raw object data into things like deltas and summary files,
the logic to perform e.g. mirroring should only be in one place.

This will be used by Pulp's OSTree content plugin at least to perform
promotions.
2015-02-06 10:02:57 -05:00
Colin Walters 1fdecbd263 pull: Copy the upstream summary file when doing a pull --mirror
While it could be regenerated downstream, there might be other
metadata upstream, and the goal here is a mirror.

https://bugzilla.gnome.org/show_bug.cgi?id=739377
2015-02-05 21:24:21 -05:00
Colin Walters fab1e113db When mirroring, write content directly, do not verify
When doing a pull --mirror from an archive-z2 repository into another
archive-z2 repository, currently we gunzip/checksum/gzip each content
object.  The re-gzip process in particular is fairly expensive.

This does assume that the upstream content is trusted and correct.
It'd be nice in the future to do at least a CRC check, if not the full
checksum.  (Could we append CRC data to the end of filez objects?)

We could also choose to only do this optimization if fetching over
TLS.

before: 1626 metadata, 20320 content objects fetched; 299634 KiB transferred in 62 seconds
after : 1626 metadata, 20320 content objects fetched; 299634 KiB transferred in 11 seconds
2015-02-05 21:24:21 -05:00
Colin Walters 5b4500faf6 pull: (trivial) Fix English in function name
s/writed/written/
2015-01-25 09:14:21 -05:00
Colin Walters 8f4999c854 build: Add --disable-static-deltas
Since they're unstable, we want to allow organizations shipping ostree
now to be future proof against any changes.
2015-01-22 21:21:34 -05:00
Colin Walters f2e4830409 pull: Further extend static delta progress
With deltas, we have an accurate total size, among other things.
2015-01-22 09:07:13 -05:00
Colin Walters e40b86221a pull: Distingiush delta pulls from loose better 2015-01-22 09:07:13 -05:00
Colin Walters ebd03216a1 pull: Delete processed delta parts
Otherwise they stay around until a much later GC.
2015-01-14 22:18:00 -05:00
Colin Walters 9020fe2547 Change OstreeFetcher to be dirfd-relative
This is a noticeable cleanup, and fixes another big user of GFile* in
performance/security sensitive codepaths.

I'm specifically making this change because the static deltas code was
leaking temporary files, and cleaning that up nicely would be best if
we were fd relative.
2015-01-14 22:12:08 -05:00
Alexander Larsson 5b721a5b08 Allow creating and pulling static deltas starting from "empty"
You create these with something like:
  ostree static-delta generate --empty --to=master

These will be automatically used during pull if no previous revision
exists in the target repo.

These work very much like the normal static deltas except they
are named just by the "to" revision. I.e:

deltas/94/f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d

for a from-scratch to 94f7d2dc23759dd21f9bd01e6705a8fdf98f90cad3e0109ba3f6c091c1a3774d delta.

https://bugzilla.gnome.org/show_bug.cgi?id=721799
2015-01-14 14:43:32 +01:00
Colin Walters e3f9f331a2 Two 32 bit compilation fixes 2015-01-12 12:43:03 -05:00
Matthew Barnes 6ff841d3b0 repo: Report metadata fetch progress separately
Partially resolves https://bugzilla.gnome.org/740276
2015-01-12 11:21:18 -05:00
Matthew Barnes 4b5b450d5c pull: Prioritize fetching metadata objects over content objects 2015-01-11 18:48:21 -05:00
Matthew Barnes 5c26e392ec fetcher: Add a priority value to async requests 2015-01-11 18:48:21 -05:00
Giuseppe Scrivano 6e60c05d2f Remove unused variable warning 2014-12-18 12:48:47 +01:00
Colin Walters 5c47389243 test-rollsum: Process all input, print more statistics
Copying the bup code, we need to loop over all chunks even after
hitting the rollsum returning 0.

Also print more statistics.
2014-12-18 12:48:47 +01:00
Colin Walters ca678224be Static deltas support
https://bugzilla.gnome.org/show_bug.cgi?id=721799
2014-12-18 12:48:47 +01:00
Giuseppe Scrivano a23b3b332e Revert "ostree-repo-pull: Remove currently #if 0 static delta code"
This reverts commit 1c2e20af25.
2014-12-18 12:48:47 +01:00
Matthew Barnes ac882f2128 repo: Add private functions to access remote options
ostree_repo_pull_with_options() needs this, and I'd rather keep the
OstreeRemote struct definition tucked away in ostree-repo.c with its
own internal API.
2014-12-08 12:49:25 -05:00
Giuseppe Scrivano a5491f98cb ostree-fetcher: make _ostree_fetcher_stream_uri_sync private
Rename _ostree_fetcher_contents_membuf_sync to
ostree_fetcher_request_uri_to_membuf and drop unused argument
user_data.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-11-12 21:20:28 -05:00
Giuseppe Scrivano d48aca5645 ostree-fetcher: add max_size argument to change _ostree_metalink_request_sync
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-11-12 21:20:28 -05:00
Giuseppe Scrivano c832e9b751 metalink: have a single entry to the metalink module
Replace _ostree_metalink_request_async with a synchronous version.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-11-12 21:20:28 -05:00
Giuseppe Scrivano d5d73debd8 ostree_fetcher: new function _ostree_fetcher_contents_membuf_sync
Move code from ostree-repo-pull.c

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-11-12 21:20:28 -05:00
Giuseppe Scrivano 1c2e20af25 ostree-repo-pull: Remove currently #if 0 static delta code
We can readd this in the static deltas work.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-11-06 18:48:29 -05:00
Giuseppe Scrivano cb053ae0f6 pull: Fix a used before initialization warning
src/libostree/ostree-repo-pull.c:1676:22: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-30 12:16:59 -04:00
Giuseppe Scrivano 65c0594011 ostree-repo-pull: Fix inverted assert condition for maxdepth
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-10-30 11:46:02 -04:00
Colin Walters bcf40b4902 pull: Add depth support
For mirroring in particular, we really want to be able to traverse
all history.

$ ostree --repo=repo pull --mirror --depth=-1

https://bugzilla.gnome.org/show_bug.cgi?id=739240
2014-10-28 11:16:55 -04:00
Colin Walters 64dec0add8 libostree: Add ostree_repo_pull_with_options()
We potentially need a lot of argument types for pull.  Rather than
have a C function with tons of arguments, let's use a GVariant a{sv}
as a handy extensible (and immutable) bag of properties.

This is prepratory work for adding an option to pull to traverse
history.

https://bugzilla.gnome.org/show_bug.cgi?id=737844
2014-10-28 11:16:51 -04:00
Colin Walters 63abc1b513 pull: Support full recursive mirrors of repositories with summary file
Now that we have a summary file, we can use it to allow a simple:

ostree pull --mirror

To download the latest commit on every branch.  Also, for a case I'm
dealing with there's only one branch, but I don't want mirror users to
have to hardcode it.

https://bugzilla.gnome.org/show_bug.cgi?id=737807
2014-10-03 13:56:40 -04:00
Colin Walters a593078722 pull: Squash some uninitialized variable warnings 2014-09-08 13:43:12 -04:00
Colin Walters f8f5da219e Add repository "summary" file and metalink support
For Fedora and potentially other distributions which use globally
distributed mirrors, metalink is a popular solution to redirect
clients to a dynamic set of mirrors.

In order to make metalink work though, it needs *one* file which can
be checksummed.  (Well, potentially we could explode all refs into the
metalink.xml, but that would be a lot more invasive, and a bit weird
as we'd end up checksumming the checksum file).

This commit adds a new command:

$ ostree summary -u

To regenerate the summary file.  Can only be run by one process at a
time.

After that's done, the metalink can be generated based on it, and the
client fetch code will parse and load it.

https://bugzilla.gnome.org/show_bug.cgi?id=729585
2014-09-03 13:21:52 -04:00
Anne LoVerso 6dfe99a283 pull: Fix use-after-free
The strchr() was pointing into a string we were freeing.
2014-08-21 13:57:31 -04:00
Anne LoVerso 3742c32945 repo-pull: Allow pulling only one directory
Changes the pull API to allow pulling only a single directory instead
of the whole deployment.  This option is utilized by the check-diff
option in rpm-ostree.

Add a new state directory to hold <checksum>.commitpartial files, so
we know that we've only downloaded partial state.
2014-08-20 15:09:32 -04:00
Colin Walters b97a5f59df core: Support a per-remote "proxy" configuration option
We don't want to have to force people to set it in the environment.

https://bugzilla.gnome.org/show_bug.cgi?id=733734
2014-07-28 13:49:38 -04:00
James Antill 43bba232a0 Display bytes/second during pull
Add start time to the AsyncProgress object, use it in the common
progress.
2014-07-28 08:37:15 -04:00
Colin Walters 772409e945 pull: Only set ca path if we actually have a setting for it
Otherwise, GTlsFileDatabase ends up accepting NULL for anchors, and
then we don't trust any CAs at all.

https://bugzilla.gnome.org/show_bug.cgi?id=726256
2014-07-01 08:53:39 -04:00
Colin Walters f60bac45fd core: add "tls-ca-path" option
Some organizations will want to use private Certificate Authorities to
serve content to their clients.  While it's possible to add the CA
to the system-wide CA store, that has two drawbacks:

1) Compromise of that cert means it can be used for other web traffic
2) All of ca-certificates is trusted

This patch allows a much stronger scenario where *only* the CAs in
tls-ca-path are used for verification from the given repository.

https://bugzilla.gnome.org/show_bug.cgi?id=726256
2014-06-27 13:16:47 -04:00
Colin Walters 5936740b95 [staticanalysis]: Fix some dead code
One was an unused variable, the other is actually dead because we
can't have mfile != NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=732020
2014-06-21 18:08:49 -04:00
Colin Walters bb043b319f pull: Emit a better error if the remote isn't found
The generic GKeyFile error isn't quite informative enough here.

I hit this with the new compose process where we don't automatically
inject a configured remote into the generated disk images; we expect
people to add them.

https://bugzilla.gnome.org/show_bug.cgi?id=731346
2014-06-19 04:39:28 -04:00
Colin Walters 6a5e66b152 pull: Support --mirror option
There's several use cases for calling into ostree itself to do
mirroring, instead of using bare rsync.  For example, it's a bit more
efficient as it doesn't require syncing the objects/ directory.

https://bugzilla.gnome.org/show_bug.cgi?id=728351
2014-06-16 17:14:13 -04:00
Colin Walters 24c64d6b4f libostree: Make OstreeFetcher explicitly private
Per previous commit.  We're not attempting to export an HTTP to
clients, the high level API is ostree_repo_pull().

https://bugzilla.gnome.org/show_bug.cgi?id=731369
2014-06-09 14:04:53 -04:00
Colin Walters 47610b45c2 Limit metadata to 10 MiB
If fetching GPG-signed commits over plain HTTP, a MitM attacker can
fill up the drive of targets by simply returning an enormous stream
for the commit object.

Related to this, an attacker can also cause OSTree to perform large
memory allocations by returning enormous GVariants in the metadata.

This helps close that attack by limiting all metadata objects to 10
MiB, so the initial fetch will be truncated.

But now the attack is only slightly more difficult as the attacker
will have to return a correctly formed commit object, then return a
large stream of < 10 MiB dirmeta/dirtree objects.

https://bugzilla.gnome.org/show_bug.cgi?id=725921
2014-05-27 14:15:27 -04:00
Colin Walters 25ad4a9f65 pull: Add tls-client-cert-{path,key} (if we have new enough libsoup)
This is an actually working version of client-side certificates.
Depends on:
See: https://bugzilla.gnome.org/show_bug.cgi?id=334021

We detect whether libsoup is new enough for this.

https://bugzilla.gnome.org/show_bug.cgi?id=729356
2014-05-01 17:13:13 -04:00
Colin Walters 64b4ec6ef0 Revert "pull: Add tls-client-cert-{path,key}"
This reverts commit 94f9ee7bce.
Doesn't actually work, see
https://bugzilla.gnome.org/show_bug.cgi?id=334021
2014-05-01 10:23:11 -04:00
Colin Walters 94f9ee7bce pull: Add tls-client-cert-{path,key}
These can be used to present a client certificate when making requests
to a repository.
2014-05-01 07:57:06 -04:00
Colin Walters 7cc4a20f3b pull: Correctly handle error state when fetching optional data
For the static deltas work, we're using the already-extant internal
API to perform a HTTP fetch for optional data - static deltas are
optional.

Except that we didn't correctly unset the error if we were doing an
optional fetch and the data wasn't found.
2014-04-29 10:59:57 -04:00
Colin Walters 626fc8519b pull: Stay in mainloop if we're synchronously fetching URI
The static deltas work will be doing some synchronous fetching even
after refs are downloaded.
2014-04-29 10:59:57 -04:00
Colin Walters d27c78eab5 pull: Display download progress of individual objects as we get it
It was kind of annoying at least for rpm-ostree upgrades since /boot
happens to be first and we eat a 21MB initramfs with no download
progress.

https://bugzilla.gnome.org/show_bug.cgi?id=726348
2014-04-11 01:31:14 -04:00
Colin Walters a80872afa0 pull: Don't print, just use progress callback
More work on removing g_print() from the library.
2014-03-21 14:52:56 -04:00
Colin Walters b6b7d37c9d libostree: Fix crash if output is not a tty
This was a recent regression.
2014-03-14 21:59:36 -04:00
Colin Walters 5c839f0267 pull: Drop some g_print(), replace others with async progress
We shouldn't g_print() from a library, particularly when the
expectation is that the client has an async progress set up.

This should fix the pull output extending the status line.
2014-03-11 09:36:54 -04:00
Colin Walters c2123bfc71 pull: Ensure temporary data that appears corrupted is deleted
If a MITM attacker (or just network corruption) causes a temporary
downloaded object in tmp/ to be corrupted, we'll end up
continually trying to commit it, and fail.

Fix this unlinking the temp file immediately after opening it.  This
will ensure that if we exit due to an error (or crash), the kernel
will clean up the space for us.

https://bugzilla.gnome.org/show_bug.cgi?id=725924
2014-03-07 19:36:55 -05:00
Colin Walters b762c2f8f1 pull: Remove explicit threading
Mixing async and threads has proved to be too much for my little mind.
It has race conditions that I've tried repeatedly to fix, but failed.

The threading here was scanning metadata objects - and there are
two parts to that:

1) Physically loading them from disk
2) Parsing them

Now #1 has been partially addressed by avoiding a storm of lstat() if
we're starting from a known working state.  If pull gets interrupted,
then we do need to rescan all objects.  Also, we can address this with
local metadata packfiles.

The other potentially slow bit is that we recurse across the metadata,
blocking the main thread.  We could ameliorate that in the future by
scheduling metadata parsing as idle "chunks".

Anyways, let's move the needle back to reliability, and readd speed
more carefully.

https://bugzilla.gnome.org/show_bug.cgi?id=706456
2014-02-21 15:04:23 -05:00
Colin Walters f526fd4e3c pull: Remove a duplicate hash table
Not sure why we had two...perhaps the code originally had them
separate.
2014-02-10 09:40:35 -05:00
Colin Walters 8dd7b5575e Drop refs/summary
I'm not aware of anyone using this, and it's not efficient to write a
whole file every time a ref changes, plus it's not atomic.
2014-02-09 14:01:27 -05:00
Colin Walters d744436a50 pull: Don't crash if the URL is not found 2014-02-06 03:46:14 -05:00
Colin Walters 2d6374822b Initial basic static delta code drop
This has a very basic level of functionality (deltas can be generated,
and applied offline).  There is only some stubbed out pull code to
fetch them via HTTP.

But, better to commit this now and improve it from a known starting
point, rather than have it languish in a branch.
2014-02-04 10:31:44 -05:00
Colin Walters d64d2b6636 pull: Be less chatty with G_MESSAGES_DEBUG=all
Only note state *transitions*, don't spam on simple checks.
2014-01-22 15:02:01 +00:00
Colin Walters 9640171711 pull: Close another race
Only send _IDLE messages if and only if we state transition the main
thread (from idle -> !idle or !idle -> idle).  This ensures that we
don't send IDLE, then get it back, and process that when we're !idle.
2014-01-20 06:26:49 -05:00
Colin Walters 3cd866556c pull: Hopefully squash race where we would exit early
This is a redesign (again) of the pull code.  It is simpler and
survives 20 minutes of testing in a loop, whereas the old code would
only go from 30 seconds to 2 minutes.

The problem with the old code was that there was a race where we might
determine idle state even when there are content requests in flight
between the metadata thread and the main one.

This code majorly reworks things - there's now only one IDLE message,
sent in a circle from the main thread, through the metadata scanner,
and back to the main one.

Crucially it's only sent when the *main* thread is idle.  Previously
we were looking at whether the metadata scanner is idle, but that
doesn't make a lot of sense.  First let's make sure the main thread is
idle, then verify that the metadata one is.

This closes the loop because we'll have ensured we get any pending
requests.

https://bugzilla.gnome.org/show_bug.cgi?id=706456
2014-01-19 18:12:44 -05:00
Colin Walters 3ce687ef1b pull: Add a few more g_debug() and assertions
To help track down the race condition better.
2014-01-19 12:39:18 -05:00
Colin Walters 68c9c45e15 repo-pull: Remove leftover unused %s 2013-12-16 18:24:03 -05:00
Colin Walters 379db715d7 libostree: Squash a compiler warning 2013-10-24 14:37:50 -04:00
Colin Walters c65923e642 Add OstreeAsyncProgress, use it for ostree_repo_pull
Several APIs in libostree were moved there from the commandline code,
and have hardcoded g_print() for progress and notifications.  This
isn't useful for people who want to write PackageKit backends, custom
GUIs and the like.

From what I can tell, there isn't really a winning precedent in GLib
for progress notifications.

PackageKit has the model where the source has GObject properties that
change as async ops execute, which isn't bad...but I'd like something
a bit more general where say you can have multiple outstanding async
ops and sensibly track their state.

So, OstreeAsyncProgress is basically a threadsafe property bag with a
change notification signal.

Use this new API to move the GSConsole usage (i.e. g_print()) out from
libostree/ and into ostree/.
2013-10-24 14:27:13 -04:00
Colin Walters 8592922c2c core: Make ostree_get_relative_object_path() private
I plan to rename all of these APIs to use the term 'loose', so that it
makes more sense after pack files are introduced.  External users
should not use them; instead use _load_variant() or _read_commit().
2013-09-29 20:17:18 -04:00
Jeremy Whiting 7f9eefb62d pull: Verify commits with gpg signatures from detached metadata
This uses gpgv for verification against DATADIR/ostree/pubring.gpg by
default.  The keyring can be overridden by specifying OSTREE_GPG_HOME.

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

Change all of the existing tests to disable GPG verification.
2013-09-29 14:49:47 -04:00
Colin Walters 2ef652439d repo-pull: Allocate with g_new0 rather than g_new.
Conflicts:

	src/libostree/ostree-repo-pull.c
2013-09-26 14:38:37 -04:00
Colin Walters 7d72a4b941 pull: Also fetch detached commitmeta files
These will contain GPG signatures and the like in the future, so we
should fetch them now.
2013-09-26 14:36:06 -04:00
Colin Walters 94e42c521c pull: Drop usage of 2.36 symbol
Really need deprecation warnings while using RHEL6.4...maybe Software
Collections will save me.
2013-09-13 16:45:43 -04:00
Vivek Dasmohapatra f802822034 pull: ref the thread default main context during init, unref in cleanup
...get_thread_default returns NULL when the thread default is also the global
default, so this only shows up when running in a thread (eg g_task_run_in_thread)
2013-09-09 12:06:01 -04:00
Jasper St. Pierre 91d3b90c9f Move ref writing to be transaction-based
Rather than having separate write_ref calls, make clients start a
transaction, add some refs, and then commit it. While this doesn't
make it 100% atomic, it makes it easier for us to use an atomic
model, and it means we don't do as much I/O updating the summary
file and such.

https://bugzilla.gnome.org/show_bug.cgi?id=707644
2013-09-06 20:31:12 -04:00
Jasper St. Pierre bd2948e964 repo: Move the scanning hardlinks optimization out of prepare_transaction
This is just a terrible API to have. Make the scanning a separate method,
and document it as an optimization.
2013-09-06 20:31:12 -04:00
Jasper St. Pierre ef61724269 repo: Move the transaction stats to a separate struct
This is much easier for callers to handle, and simplifies
the API a lot.

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

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

https://bugzilla.gnome.org/show_bug.cgi?id=707644
2013-09-06 20:31:12 -04:00
Colin Walters 597da6ca6b libostree: Change synchronous fetching API to return a stream
There's not a good reason to write small things such as repo/config to
the filesystem, only to read them back in again.  Change the
non-partial API to just return a stream, then read it into a memory
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=707157
2013-09-02 14:48:21 -04:00
Tobias Hunger ed56908ccb Fix warnings about unused variables 2013-08-30 14:23:45 -04:00
Colin Walters 8fce2513e9 pull: Clean up synchronous fetching code
Fold in fetch_uri to fetch_uri_utf8(), and rename the latter to
include _sync as a suffix, since it's synchronous.

Improve the status line to show when we're fetching a synchronous URI;
previously we just showed "Scanning metadata".

https://bugzilla.gnome.org/show_bug.cgi?id=707023
2013-08-29 08:01:51 -04:00
Jeremy Whiting 499df2a90b pull: Add support for resuming downloads via range requests
Use a consistent temporary filename to download uri's.
Check for downloaded files before fetching from uri.
Download to hash.part file, then copy/move to hash.done when complete.
Add argument support to setup_fake_remote_repo1 function.
Add test for pull resume.
To implement this, pass --force-range-requests into the trivial-httpd,
which will only serve half of the objects to clients at a time.

https://bugzilla.gnome.org/show_bug.cgi?id=706344
2013-08-28 14:35:54 -04:00
Colin Walters 94ce562905 pull: Drop obsoleted "related objects" API
We removed support for writing "related objects" from ostree commits
in ostree git c9b61cbfee because it just
didn't work out as an idea.  This also removes the API and code from
"ostree pull".

Note there was no test suite coverage.

https://bugzilla.gnome.org/show_bug.cgi?id=706342
2013-08-25 15:20:13 -04:00
Colin Walters db4aecee44 pull: Update comment to better reflect current reality 2013-08-23 17:31:24 -04:00
Colin Walters eaee309112 Use { 0, } for structure initialization rather than memset()
It's cleaner, safer, and I had a totally wrong idea stuck in my head
about why memset() should be used.

https://bugzilla.gnome.org/show_bug.cgi?id=705968
2013-08-18 07:20:46 -04:00
Colin Walters 35d7b9cdbf libostree: Increase gtk-doc coverage of ostree-repo.[ch] 2013-08-17 13:57:22 -04:00
Colin Walters abe2320039 libostree: Fix many gtk-doc warnings 2013-08-17 08:41:31 -04:00
Colin Walters 71c4ea67f7 core: Clean up temporary file creation
Use new libgsystem API, don't expose the repo's tmpdir.
2013-08-06 23:58:29 +02:00
Colin Walters a5d43bb959 Install a shared library
This required a fair bit of surgery because previously ostree.h
included otutil.h, but that's supposed to be a private library.
2013-07-26 19:25:07 -04:00
Colin Walters 2bcb024824 pull: Tweak status line again, do what git does
Almost, we don't have bytes transferred.  And we lie about percentages
since as metadata comes in the total number of objects to fetch goes
up.
2013-07-24 18:20:19 -04:00
Colin Walters 688d8f176b pull: Always scan for commit object, even if ref is unchanged
If the admin encounters corruption and does:

$ ostree admin fsck --delete

We want them to be able to recover the objects easily from the
network; with this patch, they do:

$ ln -s dummyvalue /ostree/repo/transaction
$ ostree refs --delete remotename:branchname
$ ostree pull remotename

This patch avoids the need for the refs --delete; we might as well
force scan the commit, and with this patch we still print that it
changed.
2013-07-23 19:36:15 -04:00
Colin Walters ea914e7e49 main: pull: Reduce the status line length a bit
Drop "objects" where it's obvious [ to me anyways =) ], and drop the
bytes transferred since our math was off, and the HTTP status kind of
shows that.
2013-07-23 17:29:46 -04:00
Colin Walters 2535f32c56 libostree: Move pull code into here
More library work.
2013-07-09 20:14:53 -04:00