From ab9a587d34e945b7920f363403d90565c1f79502 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 17 Jun 2019 07:12:18 +0200 Subject: [PATCH] xbps-create: added support for lz4 and zstd compression formats. --- bin/xbps-create/main.c | 10 ++++++++-- bin/xbps-create/xbps-create.1 | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c index ec52e474..18c21c5d 100644 --- a/bin/xbps-create/main.c +++ b/bin/xbps-create/main.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2015 Juan Romero Pardines. + * Copyright (c) 2012-2019 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -108,7 +108,7 @@ usage(void) " This expects a blank separated list of ::, e.g\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" - " --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" " e.g 'libfoo.so.1 libblah.so.2').\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) { archive_write_add_filter_bzip2(ar); 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) { /* empty */ } else { diff --git a/bin/xbps-create/xbps-create.1 b/bin/xbps-create/xbps-create.1 index e4bfdea9..12b67b47 100644 --- a/bin/xbps-create/xbps-create.1 +++ b/bin/xbps-create/xbps-create.1 @@ -1,4 +1,4 @@ -.Dd June 12, 2019 +.Dd June 17, 2019 .Dt XBPS-CREATE 1 .Sh NAME .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. .It Fl -build-options Ar string 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 .Ar xz . .It Fl -shlib-provides Ar list