summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo-static-delta-private.h
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: Run clang-formatColin Walters2023-05-021-92/+64
| | | | | This is a one-time tree wide reformatting to ensure consistency going forward.
* Strip trailing whitespace on all C filesDan Nicholson2023-02-071-3/+3
| | | | | | | | My editor started following the configuration in .editorconfig and is applying this rule to many files I'm editing. Let's just get this over with and strip everything. This was done like so: git ls-files | grep '\.[ch]$' | xargs sed -ri 's/\s+$//'
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* deltas: Update delta indexes when updating summaryAlexander Larsson2020-10-231-0/+5
| | | | | | | | | | | | When we update the summary file (and its list of deltas) we also update all delta indexes. The index format is a single `a{sv}` variant identical to the metadata-part of the summary with (currently) only the `ostree.static-deltas` key. Since we expect most delta indexes to change rarely, we avoid unnecessary writes when reindexing. New indexes are compared to existing ones and only the changed ones are written to disk. This avoids unnecessary write load and mtime changes on the repo server.
* lib/deltas: Add inline signature for static-delta superblockFrédéric Danis2020-09-141-0/+19
| | | | | | | | | | | | | | | | | While the commits contained in the single static-delta file are signed so we can check them and operate on trusted data, the superblock isn't signed in any way, so it end up operating on untrusted data to: 1. actually find where the trusted data is, and 2. check whether the update is fit for the current device by looking at the collection id stored in the metadata This commit generates signatures of all static data, and concatenate them to the existing static delta format, i.e. as a GVariant layout `a{sv}ay` where - a{sv}: signatures - ay: existing delta variant Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
* deltas: Break out _ostree_repo_static_delta_superblock_digest() helperAlexander Larsson2020-09-111-0/+6
| | | | | | | This loads and makes a digest for a delta superblock. The previous code was used when generating the deltas section in the summary file. This changes nothing, but is in preparation for using similar formats in a separate delta index file.
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* lib/static-delta: Drop duplicated declaration from private headerPhilip Withnall2017-12-141-5/+0
| | | | | | | Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1347 Approved by: cgwalters
* tree-wide: Remove Emacs modelinesColin Walters2017-09-211-2/+1
| | | | | | | | | We added a `.dir-locals.el` in commit: 9a77017d87b74c5e2895cdd64ad098018929403f There's no need to have it per-file, with that people might think to add other editors, which is the wrong direction. Closes: #1206 Approved by: jlebon
* lib: Always checksum content in deltasColin Walters2016-12-061-2/+0
| | | | | | | | | | | | | | | | | | | This is a follow up to conversation on list - in practice, if we're backing away from summary signing, then it makes sense to remove the special casing for checksums in deltas around summary signatures. This is also related to the recent change to enable GPG checking for commits in deltas - now we have a more coherent story between the previous pull path and deltas. I didn't do any performance checking, and while it's slightly annoying that we're now doing sha256 on the delta content twice (once for the part and once per object)...sha256 is pretty fast, I think most users are I/O bound anyways, and it'd drop even farther if we started using openssl. Closes: #612 Approved by: jlebon
* delta: Add --if-not-exists optionColin Walters2016-07-041-0/+7
| | | | | | | | | | I often want to have "idempotent" systems that iterate to a known state. If after generating a commit, the system is interrupted, I'd like the next run to still generate a delta. But we don't want to regenerate if one exists, hence this option. Closes: #375 Approved by: jlebon
* Add support for ostree static-delta deleteAlexander Larsson2016-04-081-0/+6
| | | | | Closes: #245 Approved by: giuseppe
* deltas: Heuristically detect endianness for older deltasColin Walters2016-02-261-2/+1
| | | | | | | If the average object size is greater than 4GiB, let's assume we're dealing with opposite endianness. I'm fairly confident no one is going to be shipping peta- or exa- byte size ostree deltas, period. Past the gigabyte scale you really want bittorrent or something.
* deltas: Use endianness marker when parsingColin Walters2016-02-261-6/+40
| | | | | Extend the `static-delta show` and `pull` commands to use the endianness information (if available).
* lib: Expand `ostree static-delta show` to show part statsColin Walters2016-02-081-10/+17
| | | | | | Now we display stats on the individual parts, such as the blob size and the number of each type of opcode. Most interesting to me is things like how many bsdiff opcodes there are vs new objects, etc.
* lib: Create an internal static delta parsing/opening functionColin Walters2016-02-081-16/+17
| | | | | | | We had code to deal with opening/checksumming/decompressing static deltas in a few places. I'd like to teach `ostree static-delta show` how to display more information, and this will allow it to just use `_ostree_static_delta_part_open()` too.
* static-delta: Add `show` subcommandColin Walters2016-01-281-0/+11
| | | | | | | | | Right now though, almost all of the details of deltas are private, so we can't do the "honest thing" and have the command line just use the shared library. Eventually some of this should appear in the API, but for now add command line which is useful for debugging.
* deltas: Verify checksums in apply-offline unless skip_validate is TRUEAlexander Larsson2015-11-101-0/+3
|
* _ostree_static_delta_part_validate: Take a stream instead of a file as argAlexander Larsson2015-09-131-1/+1
| | | | | This is only called in one place, and we have already opened the file there, no need to open it twice.
* pull: add new switch option --disable-static-deltasGiuseppe Scrivano2015-05-131-0/+2
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Add bsdiff support to deltasGiuseppe Scrivano2015-03-031-1/+2
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* deltas: Search for similar objects (possibly renamed across directories)Colin Walters2015-02-161-0/+19
| | | | | | | | | | The previous diff algorithm was file tree based, and only looked at modified files that lived at the same path. However, components like the Linux kernel have versioned subdirectories, e.g. /usr/lib/modules/$kver/.../ext4.ko. We want to be able to detect these "modified renames" so that we can compute diffs (rollsum, bsdiff).
* deltas: Implement rollsumsColin Walters2015-02-161-1/+2
| | | | | | This does an rsync-style prepared delta basically. On my test data, it shaves ~6MB of uncompressed data. Not a huge amount, but I expect this to be more useful for things like binaries which embed data, etc.
* deltas: Stub out a few more opcodesColin Walters2015-02-161-0/+1
|
* deltas: Rework format to allow streamingColin Walters2015-02-161-5/+8
| | | | | | | | | | | | | There's still some silliness here, but there is now only one opcode open-splice-and-close, that writes a single chunk from the payload. This is really all we need for metadata, and small content objects are also fine with this. We get some deduplication between content objects by creating a dictionary for (uid,gid,mode) tuples and xattrs. This still keeps the operation/payload code in, so we could do rollsums in a future update easily.
* deltas: Add _V0 to part #defineColin Walters2015-02-161-2/+2
| | | | | To make more explicitly clear that this is the version that matches the version in the metadata.
* deltas: Remove support for gzipped delta partsColin Walters2015-02-161-1/+1
| | | | XZ is really, really good.
* deltas: Use base64 for csums, add version to partsColin Walters2015-02-161-4/+3
|
* syntax-check: Remove empty lines at the end of fileGiuseppe Scrivano2015-02-021-1/+0
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Static deltas supportColin Walters2014-12-181-10/+65
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=721799
* TODO: updateColin Walters2014-03-151-1/+1
|
* deltas: Add a timestamp to delta metadataColin Walters2014-02-101-1/+2
|
* Initial basic static delta code dropColin Walters2014-02-041-0/+96
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.