xbps-create: added support for lz4 and zstd compression formats.

This commit is contained in:
Juan RP 2019-06-17 07:12:18 +02:00
parent 59dffd76cc
commit ab9a587d34
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368
2 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*- /*-
* Copyright (c) 2012-2015 Juan Romero Pardines. * Copyright (c) 2012-2019 Juan Romero Pardines.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -108,7 +108,7 @@ usage(void)
" This expects a blank separated list of <name>:<symlink>:<target>, e.g\n" " This expects a blank separated list of <name>:<symlink>:<target>, e.g\n"
" 'vi:/usr/bin/vi:/usr/bin/vim foo:/usr/bin/foo:/usr/bin/blah'.\n" " 'vi:/usr/bin/vi:/usr/bin/vim foo:/usr/bin/foo:/usr/bin/blah'.\n"
" --build-options A string with the used build options.\n" " --build-options A string with the used build options.\n"
" --compression Compression format: none, gzip, bzip2, xz (default).\n" " --compression Compression format: none, gzip, bzip2, lz4, zstd, xz (default).\n"
" --shlib-provides List of provided shared libraries (blank separated list,\n" " --shlib-provides List of provided shared libraries (blank separated list,\n"
" e.g 'libfoo.so.1 libblah.so.2').\n" " e.g 'libfoo.so.1 libblah.so.2').\n"
" --shlib-requires List of required shared libraries (blank separated list,\n" " --shlib-requires List of required shared libraries (blank separated list,\n"
@ -1038,6 +1038,12 @@ main(int argc, char **argv)
} else if (strcmp(compression, "bzip2") == 0) { } else if (strcmp(compression, "bzip2") == 0) {
archive_write_add_filter_bzip2(ar); archive_write_add_filter_bzip2(ar);
archive_write_set_options(ar, "compression-level=9"); archive_write_set_options(ar, "compression-level=9");
} else if (strcmp(compression, "lz4") == 0) {
archive_write_add_filter_lz4(ar);
archive_write_set_options(ar, "compression-level=9");
} else if (strcmp(compression, "zstd") == 0) {
archive_write_add_filter_zstd(ar);
archive_write_set_options(ar, "compression-level=19");
} else if (strcmp(compression, "none") == 0) { } else if (strcmp(compression, "none") == 0) {
/* empty */ /* empty */
} else { } else {

View File

@ -1,4 +1,4 @@
.Dd June 12, 2019 .Dd June 17, 2019
.Dt XBPS-CREATE 1 .Dt XBPS-CREATE 1
.Sh NAME .Sh NAME
.Nm xbps-create .Nm xbps-create
@ -71,7 +71,7 @@ A list of tags (categories) this package should be part of, separated by whitesp
Show the version information. Show the version information.
.It Fl -build-options Ar string .It Fl -build-options Ar string
A string containing the build options used in package. A string containing the build options used in package.
.It Fl -compression Ar gzip | bzip2 | xz .It Fl -compression Ar none | gzip | bzip2 | xz | lz4 | zstd
Set the binary package compression format. If unset, defaults to Set the binary package compression format. If unset, defaults to
.Ar xz . .Ar xz .
.It Fl -shlib-provides Ar list .It Fl -shlib-provides Ar list