Go to file
Colin Walters 115e05746b pull: Handle remote web server not honoring range requests
It's valid for the remote server to say 200 OK and give us the entire
file instead of a 206 Partial Content, and in that case we should blow
away the previous cached data, rather than blindly appending to it and
thus creating multiple copies of the data inside the file.

This problem primarily occurs when we do have the complete file, and
we're interrupted, then try again, where the new process didn't record
the download was already complete.  We do a range request for bytes
past the end, and some web servers (e.g. Akamai) will return 200 OK
with the whole content again, rather than a 416 Requested Range Not
Satisfiable.

Thus we could also fix this by saner caching strategy - since we know
the file is complete, rename it again to $checksum.done or something
before it's processed.  (Or really, rework how we do caching more
intelligently in general).

This fixes the issue that interrupted pulls failed with such
webservers, although repeated attempts would eventually succeed
because we'd unlink files that failed to pull.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1207292
2015-04-06 14:33:16 -04:00
bsdiff@1edf9f6568 bsdiff: change submodule location 2015-03-26 23:33:07 +01:00
build-aux Add infrastructure for "make syntax-check" 2015-01-30 15:27:36 +01:00
doc Add ostree_repo_is_writable() 2015-03-25 17:24:05 -04:00
libglnx@d59a63e3e6 build: Use glibc's xattr support instead of requiring libattr 2015-04-01 06:35:53 -04:00
manual-tests manual-tests: New directory with custom test scripts 2014-02-14 18:16:37 -05:00
packaging dist-packaging: Don't delete 91-ostree.preset, do clean old rpms/sources 2015-04-05 09:37:58 -04:00
src pull: Handle remote web server not honoring range requests 2015-04-06 14:33:16 -04:00
tests tests: Verify that the pull error was from interruption 2015-04-06 14:33:16 -04:00
.gitignore Use libglnx 2015-02-22 21:02:27 -05:00
.gitmodules bsdiff: change submodule location 2015-03-26 23:33:07 +01:00
COPYING COPYING: Update to latest FSF with current address 2014-01-16 10:22:30 -05:00
GNUmakefile Add infrastructure for "make syntax-check" 2015-01-30 15:27:36 +01:00
Makefile-boot.am syntax-check: Remove empty lines at the end of file 2015-02-02 15:07:56 +01:00
Makefile-decls.am libostree: Add initial GRUB2 support 2014-10-16 14:15:00 -04:00
Makefile-libostree-defines.am build: ostree-gpg-verify-result.h is a public header, install it 2015-03-20 10:56:23 -04:00
Makefile-libostree.am build: ostree-gpg-verify-result.h is a public header, install it 2015-03-20 10:56:23 -04:00
Makefile-ostree.am src: Move ot-tool-util from ostree/ to libotutil/ 2015-03-06 18:45:38 +01:00
Makefile-otutil.am src: Move ot-tool-util from ostree/ to libotutil/ 2015-03-06 18:45:38 +01:00
Makefile-switchroot.am Add support for mkinitcpio 2013-10-24 14:27:49 -04:00
Makefile-tests.am tests: Missing linker flags for test-rollsum 2015-04-06 10:29:07 -04:00
Makefile.am configure.ac: Make gpgme a hard dependency 2015-03-11 12:03:33 -04:00
README-historical.md README: Just link to wiki, move most of it to README-historical.md 2014-01-20 18:00:09 -05:00
README.md README.md: Note make check 2015-03-10 21:51:20 -04:00
TODO Fix repeated words. 2015-01-30 15:27:36 +01:00
autogen.sh Fix "make syntax-check" failures. 2015-03-03 12:16:17 -05:00
cfg.mk build: exclude .sig files from syntax-check 2015-04-03 09:57:20 +02:00
configure.ac build: Use glibc's xattr support instead of requiring libattr 2015-04-01 06:35:53 -04:00
maint.mk Add infrastructure for "make syntax-check" 2015-01-30 15:27:36 +01:00
ostree.doap doap category infrastructure 2014-07-31 11:26:32 +02:00

README.md

OSTree is a tool for managing bootable, immutable, versioned filesystem trees. While it takes over some of the roles of tradtional "package managers" like dpkg and rpm, it is not a package system; nor is it a tool for managing full disk images. Instead, it sits between those levels, offering a blend of the advantages (and disadvantages) of both.

For more information, see:

https://live.gnome.org/Projects/OSTree

Submitting patches

You can:

  1. Send mail to ostree-list@gnome.org, with the patch attached
  2. Submit a pull request against https://github.com/GNOME/ostree
  3. Attach them to https://bugzilla.gnome.org/

Please look at "git log" and match the commit log style.

Running the test suite

Currently, ostree uses https://wiki.gnome.org/GnomeGoals/InstalledTests To run just ostree's tests:

./configure ... --enable-installed-tests
gnome-desktop-testing-runner -p 0 ostree/

Also, there is a regular:

make check

That runs a different set of tests.

Coding style

Indentation is GNU. Files should start with the appropriate mode lines.

Use GCC __attribute__((cleanup)) wherever possible. If interacting with a third party library, try defining local cleanup macros.

Use GError and GCancellable where appropriate.

Prefer returning gboolean to signal success/failure, and have output values as parameters.

Prefer linear control flow inside functions (aside from standard loops). In other words, avoid "early exits" or use of goto besides goto out;.

This is an example of an "early exit":

static gboolean
myfunc (...)
{
    gboolean ret = FALSE;

    /* some code */

    /* some more code */

    if (condition)
      return FALSE;

    /* some more code */

    ret = TRUE;
  out:
    return ret;
}

If you must shortcut, use:

if (condition)
  {
    ret = TRUE;
    goto out;
  }

A consequence of this restriction is that you are encouraged to avoid deep nesting of loops or conditionals. Create internal static helper functions, particularly inside loops. For example, rather than:

while (condition)
  {
    /* some code */
    if (condition)
      {
         for (i = 0; i < somevalue; i++)
           {
              if (condition)
                {
                  /* deeply nested code */
                }

                /* more nested code */
           }
      }
  }

Instead do this:

static gboolean
helperfunc (..., GError **error)
{
  if (condition)
   {
     /* deeply nested code */
   }

  /* more nested code */

  return ret;
}

while (condition)
  {
    /* some code */
    if (!condition)
      continue;

    for (i = 0; i < somevalue; i++)
      {
        if (!helperfunc (..., i, error))
          goto out;
      }
  }