diff options
author | Guillem Jover <guillem@debian.org> | 2011-11-22 20:32:50 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2011-11-23 08:59:50 +0100 |
commit | 584c3b4036048cebd93c08a009f365d639025811 (patch) | |
tree | b4975c420569783f38d2ce9502145b0e9300aadd /dpkg-deb/main.c | |
parent | 625a24bbc8280362c2ab0e3f2f83aacbf25283e0 (diff) | |
download | dpkg-584c3b4036048cebd93c08a009f365d639025811.tar.gz |
dpkg-deb: Add compression strategy support
The only currently supported option is “extreme” for xz.
Closes: #647915
Diffstat (limited to 'dpkg-deb/main.c')
-rw-r--r-- | dpkg-deb/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c index 6d52beaf8..df6140100 100644 --- a/dpkg-deb/main.c +++ b/dpkg-deb/main.c @@ -106,6 +106,8 @@ usage(const struct cmdinfo *cip, const char *value) " -z# Set the compression level when building.\n" " -Z<type> Set the compression type used when building.\n" " Allowed types: gzip, xz, bzip2, lzma, none.\n" +" -S<strategy> Set the compression strategy when building.\n" +" Allowed values: extreme (xz).\n" "\n")); printf(_( @@ -137,6 +139,7 @@ int opt_verbose = 0; struct compress_params compress_params = { .type = compressor_type_gzip, .level = -1, + .strategy = NULL, }; static void @@ -182,6 +185,7 @@ static const struct cmdinfo cmdinfos[]= { { "nocheck", 0, 0, &nocheckflag, NULL, NULL, 1 }, { "compression", 'z', 1, NULL, NULL, set_compress_level }, { "compress_type", 'Z', 1, NULL, NULL, setcompresstype }, + { NULL, 'S', 1, NULL, &compress_params.strategy, NULL }, { "showformat", 0, 1, NULL, &showformat, NULL }, { "help", 'h', 0, NULL, NULL, usage }, { "version", 0, 0, NULL, NULL, printversion }, @@ -189,6 +193,7 @@ static const struct cmdinfo cmdinfos[]= { }; int main(int argc, const char *const *argv) { + struct dpkg_error err; int ret; setlocale(LC_NUMERIC, "POSIX"); @@ -202,6 +207,9 @@ int main(int argc, const char *const *argv) { if (!cipaction) badusage(_("need an action option")); + if (!compressor_check_params(&compress_params, &err)) + badusage(_("invalid compressor parameters: %s"), err.str); + unsetenv("GZIP"); ret = cipaction->action(argv); |