Wolf Vollprecht [Thu, 6 Jan 2022 08:04:49 +0000 (09:04 +0100)]
add fcntl.h header for win
Wolf Vollprecht [Thu, 6 Jan 2022 08:03:03 +0000 (09:03 +0100)]
fix up get_tmp_fd for windows
Wolf Vollprecht [Wed, 5 Jan 2022 20:50:40 +0000 (21:50 +0100)]
fix tests
Wolf Vollprecht [Wed, 5 Jan 2022 17:09:24 +0000 (18:09 +0100)]
make tests build on Windows
Wolf Vollprecht [Tue, 4 Jan 2022 17:59:17 +0000 (18:59 +0100)]
Run CI on Windows
Wolf Vollprecht [Wed, 15 Dec 2021 15:12:19 +0000 (16:12 +0100)]
build dll on Windows
Jonathan Dieter [Thu, 6 Jan 2022 22:03:14 +0000 (22:03 +0000)]
Merge pull request #59 from eli-schwartz/wraps
Support meson wraps
Eli Schwartz [Wed, 5 Jan 2022 04:45:20 +0000 (23:45 -0500)]
meson: add subproject fallback for zstd
installed via the command:
```
meson wrap install zstd
```
This file does nothing, unless a dependency cannot be found; in that
case, instead of failing, meson will download a private copy of the
dependency and build + link to that instead.
(This is especially common on Windows, where managing dependencies
without a package manager can be difficult.)
Alternatively, users interested in specifically building a statically
linked / portable executable can configure meson with
`--wrap-mode=forcefallback` to prefer the private copy.
Eli Schwartz [Wed, 5 Jan 2022 04:42:03 +0000 (23:42 -0500)]
meson: fix incorrect use of global arguments to set symbol visibility
add_global_arguments applies to all subprojects, or more usually, fails.
The meson docs suggest that add_project_arguments is probably preferable
for this reason.
However, in this case it should only be applied to a single library as a
workaround for supporting older versions of meson. Move it to a
per-target c_args instead, for the same effect.
Jonathan Dieter [Tue, 4 Jan 2022 17:30:58 +0000 (17:30 +0000)]
Merge pull request #56 from wolfv/add_gh_action
Add github action
Wolf Vollprecht [Tue, 4 Jan 2022 17:03:01 +0000 (18:03 +0100)]
add openssl explicitly
Wolf Vollprecht [Wed, 22 Dec 2021 18:04:04 +0000 (19:04 +0100)]
add github action
Jonathan Dieter [Mon, 3 Jan 2022 20:52:19 +0000 (20:52 +0000)]
Merge pull request #58 from dirkmueller/main
Add expected sha256sums for zstd 1.5.1+ release (Fixes #57)
Dirk Müller [Mon, 3 Jan 2022 20:33:02 +0000 (21:33 +0100)]
Add expected sha256sums for zstd 1.5.1+ release (Fixes #57)
Jonathan Dieter [Thu, 25 Nov 2021 19:30:01 +0000 (19:30 +0000)]
Merge pull request #52 from martinetd/strict-prototypes
fix -Wstrict-prototypes warning
Dominique Martinet [Wed, 24 Nov 2021 00:27:04 +0000 (09:27 +0900)]
fix -Wstrict-prototypes warning
function declarations should always explicitly say no argument is expected,
as in C 'foo bar()' means bar can take any parameter.
This was noticed when building another project with -Wall -Wextra and getting
the following warning on installed header:
/usr/include/zck.h:66:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
66 | __attribute__ ((warn_unused_result));
| ^~~~~~~~~~~~~
/usr/include/zck.h:325:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
325 | __attribute__ ((warn_unused_result));
| ^~~~~~~~~~~~~
Jonathan Dieter [Fri, 12 Nov 2021 22:21:13 +0000 (22:21 +0000)]
Fix argplib dependency for new test executable (required for Alpine)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Fri, 12 Nov 2021 22:12:53 +0000 (22:12 +0000)]
Dictionary creation should be after compression format is set
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Fri, 12 Nov 2021 21:30:55 +0000 (21:30 +0000)]
Merge branch 'devel'
Jonathan Dieter [Fri, 12 Nov 2021 21:28:51 +0000 (21:28 +0000)]
Merge branch 'dllogs'
Stefano Babic [Fri, 10 Sep 2021 20:48:10 +0000 (22:48 +0200)]
Add test utility to compare a zck with uncompressed file
This utility reads a zck and generates an index from a file, then
compares and output the delta with the chunks that are required.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Fri, 10 Sep 2021 20:42:33 +0000 (22:42 +0200)]
Add function to generate uthash after write
uthash are generated only when a zck is read when index is parsed. In
case a comparison is done between a zck and a generated zck, to search
for hash both need to have a uthash database, so add function to create
the database when zck is created.
Add a function to assembly a zck with chunks from another zck (source).
The resulkting zck will contain all chunks from source when the hash
(compressed or not compressed in case the compressors are different)
matches.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Fri, 10 Sep 2021 20:39:01 +0000 (22:39 +0200)]
Do not duplicate index structure for uncompressed
Index is just one, there is no need to duplicate the structure to
support uthash for digest related to the uncompressed data. Drop
index_uncomp and add uthash for uncompressed data.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Fri, 17 Sep 2021 11:15:45 +0000 (13:15 +0200)]
Add accessor to return associated SRC chunk
If a chunk with the same hash is already present on device, it is
recorded in the src pointer. Add accessor to return this chunk.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Sun, 19 Sep 2021 14:10:35 +0000 (16:10 +0200)]
Drop too verbose log in comp.c
If zck_write is called in a loop, a "starting" output is unuseful and
too verbose, removed.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Fri, 10 Sep 2021 10:08:47 +0000 (12:08 +0200)]
zck: add option to select chunk hash
Hash is set to sha512_128, add an option to choose one of the supported
hashes for chunks.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Thu, 16 Sep 2021 10:24:45 +0000 (12:24 +0200)]
zck_log: allow a callback for logging
When zck is used as library, the caller has already its own LOG system.
It is nice to redirect zck's log into the main logger. ZCK can already
write into a fd specified by the user, but this add complexity in case
it cannot be mapped, for example if LOG should be sent to network or is
managed in a different way. iNot only, information like loglevel are
lost.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Jonathan Dieter [Wed, 22 Sep 2021 20:03:56 +0000 (21:03 +0100)]
curl-dev requires openssl1.1-compat-dev for the moment
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Wed, 22 Sep 2021 18:03:57 +0000 (19:03 +0100)]
Merge pull request #50 from zchunk/cleanup
Allow specification of `--compressed-format` in `zck`
Jonathan Dieter [Sat, 18 Sep 2021 17:23:31 +0000 (18:23 +0100)]
Fix indentation
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 18 Sep 2021 16:53:50 +0000 (17:53 +0100)]
Add support for specifying compression-format in zck
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 18 Sep 2021 16:53:29 +0000 (17:53 +0100)]
When unknown flags are set, show values of unrecognized flags
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 18 Sep 2021 16:04:47 +0000 (17:04 +0100)]
Simplify public function
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 18 Sep 2021 15:41:47 +0000 (16:41 +0100)]
Remove unneeded digest_size_uncompressed attribute
The uncompressed digest size is the same as the compressed, so no reason
to need an extra attribute
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 18 Sep 2021 15:28:18 +0000 (16:28 +0100)]
Revert "Add a way to disable check of chunk min size"
This reverts commit
e3fdd8210610ebe21a44a226888b519672e18986.
Jonathan Dieter [Thu, 2 Sep 2021 19:49:49 +0000 (20:49 +0100)]
Merge pull request #45 from sbabic/devel
Introduce checksum for uncompressed data in the zchunk header
Jonathan Dieter [Thu, 2 Sep 2021 19:48:53 +0000 (20:48 +0100)]
Merge pull request #22 from zchunk/uncompressed_source
Add uncompressed source flag to zchunk_format.txt
Stefano Babic [Tue, 31 Aug 2021 15:02:14 +0000 (17:02 +0200)]
buzhash: change fingerprint to track OOM
Function returns false if an error (OOM from calloc) occurs, and the
output is stored via pointer passed by caller.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Tue, 31 Aug 2021 12:43:12 +0000 (14:43 +0200)]
Drop assert in zrealloc and raise runtime error
Most assert in code are useful because they signal a real bug. However,
if allocation on the heap fails, it is a runtime error because system
gets rid of memory. This is more important on embedded systems,
and the caller process cannot exit but it should be informed with return
code and it will decide how to work on.
This drop the assert clause and add error code handling when zrealloc is
called. Because realloc does not touch the original pointer if fails, it
frees memory to avoid leaks.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Sat, 28 Aug 2021 14:18:54 +0000 (16:18 +0200)]
Add a way to disable check of chunk min size
The check for chunk size is done on the compressed data.
This forbids to create the same chunk set in case data is not compressed
and comparison is done using the hashes of original data and not of
compressed chunk.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Thu, 19 Aug 2021 16:11:02 +0000 (18:11 +0200)]
Add a uthash to uncompressed digest
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Tue, 17 Aug 2021 11:21:43 +0000 (13:21 +0200)]
Drop assert in zmalloc and raise runtime error
Most assert in code are useful because they signal a real bug. However,
if allocation on the heap fails, it is a runtime error because system
gets rid of memory. This is more important on embedded systems,
and the caller process cannot exit but it should be informed with return
code and it will decide how to work on.
This drop the assert clause and add error code handling when zmalloc is
called.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Mon, 16 Aug 2021 10:38:59 +0000 (12:38 +0200)]
zck_read_header: fix header with uncompressed
If checksum for uncompressed chunk is added to index, resize the header
to take into account that two sha will be printed.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic [Fri, 16 Jul 2021 07:40:35 +0000 (09:40 +0200)]
Add size of uncompressed chunk to index
Size of uncompressed chunk can be used to compare original and detect if
a chunk is required without having to convert it first to a zck file.
Signed-off-by: Stefano Babic <sbabic@denx.de>
Jonathan Dieter [Mon, 25 Nov 2019 17:45:31 +0000 (17:45 +0000)]
Add some clarification as to which sections are flag-dependent
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 23 Nov 2019 17:15:53 +0000 (17:15 +0000)]
Add uncompressed source flag to zchunk_format.txt
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Wed, 25 Aug 2021 19:22:04 +0000 (20:22 +0100)]
Merge pull request #46 from ppentchev/pp-cppcheck
Fix three problems reported by the cppcheck tool.
Peter Pentchev [Sun, 22 Aug 2021 11:51:49 +0000 (14:51 +0300)]
Only declare a variable if it will be used.
Spotted by: cppcheck
Peter Pentchev [Sun, 22 Aug 2021 11:52:18 +0000 (14:52 +0300)]
Check the correct value in a test.
Spotted by: cppcheck
Peter Pentchev [Sun, 22 Aug 2021 11:51:11 +0000 (14:51 +0300)]
Properly detect a read error.
Spotted by: cppcheck
Jonathan Dieter [Mon, 14 Jun 2021 17:50:03 +0000 (18:50 +0100)]
Bump to 1.1.16
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Mon, 14 Jun 2021 17:46:59 +0000 (18:46 +0100)]
Merge pull request #44 from fd00/cygwin
Fix build on cygwin
Daisuke Fujimura (fd0) [Sun, 13 Jun 2021 06:10:09 +0000 (15:10 +0900)]
Fix build on cygwin
Jonathan Dieter [Tue, 1 Jun 2021 19:36:49 +0000 (20:36 +0100)]
Bump to 1.1.15
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Tue, 1 Jun 2021 19:35:20 +0000 (20:35 +0100)]
Fix major bug when compressing with dictionary (and add more tests)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Thu, 20 May 2021 20:18:16 +0000 (21:18 +0100)]
Bump to 1.1.14
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Thu, 20 May 2021 20:17:15 +0000 (21:17 +0100)]
Fix build on s390x
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Thu, 20 May 2021 19:50:48 +0000 (20:50 +0100)]
Bump to 1.1.13
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Thu, 20 May 2021 19:43:59 +0000 (20:43 +0100)]
Make builds consistent across architectures for zstd-1.5.0
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 15 May 2021 17:18:10 +0000 (18:18 +0100)]
Update to 1.1.12
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 15 May 2021 17:17:01 +0000 (18:17 +0100)]
Fix tests for zstd => 1.5.0
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 1 May 2021 17:26:14 +0000 (18:26 +0100)]
Bump to 1.1.11
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 1 May 2021 17:16:06 +0000 (18:16 +0100)]
Fix type mismatch
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 1 May 2021 17:03:58 +0000 (18:03 +0100)]
Bump version to 1.1.10
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 1 May 2021 16:57:15 +0000 (17:57 +0100)]
Clarify warning messages when corrupted chunks are discovered locally
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 1 May 2021 16:56:16 +0000 (17:56 +0100)]
Handle certain rare web servers that don't start with \r\n
After testing the server in https://github.com/zchunk/zchunk/issues/40, I
found that it doesn't start with "\r\n", so let's make that part optional
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 1 May 2021 16:17:40 +0000 (17:17 +0100)]
Merge pull request #39 from susnux/master
meson: Fix argp detection, prevent Werror=return-type
Ferdinand Thiessen [Mon, 26 Apr 2021 22:28:09 +0000 (00:28 +0200)]
meson: Fix argp detection, prevent Werror=return-type
Jonathan Dieter [Tue, 20 Apr 2021 20:59:06 +0000 (21:59 +0100)]
Merge pull request #38 from zchunk/zck_gen_zdict_docs
Add documentation for generating zdicts
Jonathan Dieter [Mon, 19 Apr 2021 20:19:49 +0000 (21:19 +0100)]
Clean up phrasing to hopefully make it more clear that zdicts are optional
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Mon, 19 Apr 2021 19:44:57 +0000 (20:44 +0100)]
Add documentation for generating zdicts
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Mon, 19 Apr 2021 19:48:19 +0000 (20:48 +0100)]
Update copyright dates
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Thu, 11 Mar 2021 22:08:13 +0000 (22:08 +0000)]
Merge pull request #36 from kontura/memleak
Fix memory leak of zck->prep_digest
Aleš Matěj [Thu, 11 Mar 2021 09:19:06 +0000 (10:19 +0100)]
Fix memory leak of zck->prep_digest
Jonathan Dieter [Wed, 30 Dec 2020 22:47:08 +0000 (22:47 +0000)]
Update to 1.1.9
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Wed, 30 Dec 2020 22:44:08 +0000 (22:44 +0000)]
Handle zstd 1.4.7+
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Wed, 30 Dec 2020 22:43:22 +0000 (22:43 +0000)]
Merge pull request #35 from nima2007/darwin1
macOS: Use correct endian.h & use argp-standalone
Nima Vasseghi [Tue, 29 Dec 2020 02:01:49 +0000 (18:01 -0800)]
macOS: Use correct endian.h & use argp-standalone
Jonathan Dieter [Tue, 8 Dec 2020 20:34:35 +0000 (20:34 +0000)]
New release
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sun, 6 Dec 2020 19:16:18 +0000 (19:16 +0000)]
Merge pull request #33 from davidbrochart/fix_regex
Add REG_ENHANCED to regcomp for OSX
David Brochart [Sat, 5 Dec 2020 15:41:28 +0000 (16:41 +0100)]
Add REG_ENHANCED to regcomp for OSX
Jonathan Dieter [Sat, 26 Sep 2020 23:27:08 +0000 (00:27 +0100)]
Bump to 1.1.7
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 26 Sep 2020 23:23:05 +0000 (00:23 +0100)]
Update documentation
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 26 Sep 2020 23:08:57 +0000 (00:08 +0100)]
Add support for FreeBSD
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sun, 31 May 2020 21:27:50 +0000 (22:27 +0100)]
Merge pull request #26 from ppentchev/pp-unzck-ext
unzck: require a *.zck extension
Jonathan Dieter [Sun, 31 May 2020 21:22:31 +0000 (22:22 +0100)]
Merge pull request #28 from ppentchev/pp-manpages
Add manual page stubs for the command-line utilities.
Peter Pentchev [Sun, 31 May 2020 21:08:05 +0000 (00:08 +0300)]
Add manual page stubs for the command-line utilities.
Peter Pentchev [Sun, 31 May 2020 20:38:35 +0000 (23:38 +0300)]
unzck: require a *.zck extension
Blindly removing the last four characters from a filename may lead to
unexpected results if somebody has created a zchunk archive with
a non-standard name.
Jonathan Dieter [Sat, 14 Mar 2020 23:03:28 +0000 (23:03 +0000)]
Bump to 1.1.6
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 14 Mar 2020 22:51:44 +0000 (22:51 +0000)]
Don't clear cache because alpine is really strange
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 14 Mar 2020 21:56:54 +0000 (21:56 +0000)]
Simplify Jenkinsfile since we're no longer doing parallel builds
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 14 Mar 2020 21:54:25 +0000 (21:54 +0000)]
Fix Jenkinsfile
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 14 Mar 2020 21:53:20 +0000 (21:53 +0000)]
Add autotest case for Alpine Linux because it uses musl
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 14 Mar 2020 21:52:46 +0000 (21:52 +0000)]
Add support for building with argp-standalone library
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 14 Mar 2020 20:31:17 +0000 (20:31 +0000)]
Merge pull request #23 from texierp/fixes/musl
topic: musl fixes
Pierre-Jean Texier [Thu, 23 Jan 2020 21:42:40 +0000 (22:42 +0100)]
unzck: fix build with musl libc
On musl libc "stdout" is a preprocessor macro whose expansion leads to
compilation errors.
Fixes:
| In file included from ../git/src/unzck.c:31:
| ../git/src/unzck.c: In function 'parse_opt':
| ../git/src/unzck.c:78:24: error: expected identifier before '(' token
| 78 | arguments->stdout = true;
| | ^~~~~~
| ../git/src/unzck.c: In function 'main':
| ../git/src/unzck.c:141:20: error: expected identifier before '(' token
| 141 | if(!(arguments.stdout)) {
| | ^~~~~~
Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
Pierre-Jean Texier [Thu, 23 Jan 2020 18:14:40 +0000 (19:14 +0100)]
zck.h: fix build on musl
The ssize_t type requires the <sys/types.h> header. This fixes build with musl
libc:
include/zck.h:68:1: error: unknown type name 'ssize_t'; did you mean 'size_t'?
68 | ssize_t zck_read(zckCtx *zck, char *dst, size_t dst_size)
| ^~~~~~~
| size_t
include/zck.h:81:1: error: unknown type name 'ssize_t'; did you mean 'size_t'?
81 | ssize_t zck_write(zckCtx *zck, const char *src, const size_t src_size)
| ^~~~~~~
| size_t
Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
Jonathan Dieter [Sat, 18 Jan 2020 21:32:09 +0000 (21:32 +0000)]
Bump to 1.1.5
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Sat, 18 Jan 2020 21:21:53 +0000 (21:21 +0000)]
Handle write errors correctly
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
Jonathan Dieter [Mon, 25 Nov 2019 17:45:31 +0000 (17:45 +0000)]
Add some clarification as to which sections are flag-dependent
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>