diff options
author | Guillem Jover <guillem@debian.org> | 2014-01-07 04:33:17 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-01-15 15:02:16 +0100 |
commit | 5dd25afbfa71b37eeaaa7f1577f51263d2a2d45c (patch) | |
tree | 38db79c4b982ccde47b69fc8dda08da2c7227b6a /dpkg-deb/main.c | |
parent | c17be3cbfc58e5b54ae1d5ae4714460d7ae2e15c (diff) | |
download | dpkg-5dd25afbfa71b37eeaaa7f1577f51263d2a2d45c.tar.gz |
dpkg-deb: Allow to use the same compression for control.tar as data.tar
Add a new --uniform-compression, that allows to use the same compression
parameters on the control.tar member as for the data.tar member.
This is a transitional need, once a dpkg-deb supporting other control.tar
compressions is widely deployed, ideally on stable distribution releases,
then the default could possibly get switched.
Diffstat (limited to 'dpkg-deb/main.c')
-rw-r--r-- | dpkg-deb/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c index 5470b1e24..e6a74c49a 100644 --- a/dpkg-deb/main.c +++ b/dpkg-deb/main.c @@ -107,6 +107,7 @@ usage(const struct cmdinfo *cip, const char *value) " --new Legacy alias for '--deb-format=2.0'.\n" " --nocheck Suppress control file check (build bad\n" " packages).\n" +" --uniform-compression Use the compression params on all members.\n" " -z# Set the compression level when building.\n" " -Z<type> Set the compression type used when building.\n" " Allowed types: gzip, xz, bzip2, none.\n" @@ -142,6 +143,7 @@ static const char printforhelp[] = int debugflag = 0; int nocheckflag = 0; int opt_verbose = 0; +int opt_uniform_compression = 0; struct deb_version deb_format = DEB_VERSION(2, 0); @@ -233,6 +235,7 @@ static const struct cmdinfo cmdinfos[]= { { "debug", 'D', 0, &debugflag, NULL, NULL, 1 }, { "verbose", 'v', 0, &opt_verbose, NULL, NULL, 1 }, { "nocheck", 0, 0, &nocheckflag, NULL, NULL, 1 }, + { "uniform-compression", 0, 0, &opt_uniform_compression, NULL, NULL, 1 }, { NULL, 'z', 1, NULL, NULL, set_compress_level }, { NULL, 'Z', 1, NULL, NULL, set_compress_type }, { NULL, 'S', 1, NULL, NULL, set_compress_strategy }, @@ -255,6 +258,13 @@ int main(int argc, const char *const *argv) { if (!compressor_check_params(&compress_params, &err)) badusage(_("invalid compressor parameters: %s"), err.str); + if (opt_uniform_compression && + (compress_params.type != compressor_type_none && + compress_params.type != compressor_type_gzip && + compress_params.type != compressor_type_xz)) + badusage(_("unsupported compression type '%s' with uniform compression"), + compressor_get_name(compress_params.type)); + ret = cipaction->action(argv); dpkg_program_done(); |