diff options
author | Rob Landley | 2006-01-20 18:28:50 +0000 |
---|---|---|
committer | Rob Landley | 2006-01-20 18:28:50 +0000 |
commit | c1d69906a0c5f28f3d84c14afb3b74c8f19f81c1 (patch) | |
tree | 5e3796c33b995720bcd69f2b969e409e85bff119 /archival/tar.c | |
parent | 7a43bd07e64e6db795d4661321da1cab14d9c4f6 (diff) | |
download | busybox-c1d69906a0c5f28f3d84c14afb3b74c8f19f81c1.zip busybox-c1d69906a0c5f28f3d84c14afb3b74c8f19f81c1.tar.gz |
Patch from Aurelien Jacobs to add unlzma. (A new decompression type,
see www.7-zip.org)
Diffstat (limited to 'archival/tar.c')
-rw-r--r-- | archival/tar.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/archival/tar.c b/archival/tar.c index d5fa954..a4b13b5 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -615,14 +615,23 @@ static char get_header_tar_Z(archive_handle_t *archive_handle) # define TAR_OPT_AFTER_BZIP2 TAR_OPT_AFTER_CREATE #endif -#define TAR_OPT_INCLUDE_FROM (1 << (TAR_OPT_AFTER_BZIP2)) -#define TAR_OPT_EXCLUDE_FROM (1 << (TAR_OPT_AFTER_BZIP2 + 1)) +#define TAR_OPT_LZMA (1 << (TAR_OPT_AFTER_BZIP2)) +#ifdef CONFIG_FEATURE_TAR_LZMA +# define TAR_OPT_STR_LZMA "a" +# define TAR_OPT_AFTER_LZMA TAR_OPT_AFTER_BZIP2 + 1 +#else +# define TAR_OPT_STR_LZMA "" +# define TAR_OPT_AFTER_LZMA TAR_OPT_AFTER_BZIP2 +#endif + +#define TAR_OPT_INCLUDE_FROM (1 << (TAR_OPT_AFTER_LZMA)) +#define TAR_OPT_EXCLUDE_FROM (1 << (TAR_OPT_AFTER_LZMA + 1)) #ifdef CONFIG_FEATURE_TAR_FROM # define TAR_OPT_STR_FROM "T:X:" -# define TAR_OPT_AFTER_FROM TAR_OPT_AFTER_BZIP2 + 2 +# define TAR_OPT_AFTER_FROM TAR_OPT_AFTER_LZMA + 2 #else # define TAR_OPT_STR_FROM "" -# define TAR_OPT_AFTER_FROM TAR_OPT_AFTER_BZIP2 +# define TAR_OPT_AFTER_FROM TAR_OPT_AFTER_LZMA #endif #define TAR_OPT_GZIP (1 << (TAR_OPT_AFTER_FROM)) @@ -651,6 +660,7 @@ static char get_header_tar_Z(archive_handle_t *archive_handle) static const char tar_options[]="txC:f:Opvk" \ TAR_OPT_STR_CREATE \ TAR_OPT_STR_BZIP2 \ + TAR_OPT_STR_LZMA \ TAR_OPT_STR_FROM \ TAR_OPT_STR_GZIP \ TAR_OPT_STR_COMPRESS \ @@ -675,6 +685,9 @@ static const struct option tar_long_options[] = { # ifdef CONFIG_FEATURE_TAR_BZIP2 { "bzip2", 0, NULL, 'j' }, # endif +# ifdef CONFIG_FEATURE_TAR_LZMA + { "lzma", 0, NULL, 'a' }, +# endif # ifdef CONFIG_FEATURE_TAR_FROM { "files-from", 1, NULL, 'T' }, { "exclude-from", 1, NULL, 'X' }, @@ -757,6 +770,9 @@ int tar_main(int argc, char **argv) if (ENABLE_FEATURE_TAR_BZIP2 && (opt & TAR_OPT_BZIP2)) get_header_ptr = get_header_tar_bz2; + if (ENABLE_FEATURE_TAR_LZMA && (opt & TAR_OPT_LZMA)) + get_header_ptr = get_header_tar_lzma; + if (ENABLE_FEATURE_TAR_COMPRESS && (opt & TAR_OPT_UNCOMPRESS)) get_header_ptr = get_header_tar_Z; |