diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-26 01:55:45 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-26 01:55:45 +0200 |
commit | d30b89c7eee19f395af0335b66822989c770437e (patch) | |
tree | 0695091ac035d39d6ba57e316474126fe8872347 /archival | |
parent | 2f86ca135069e457bb16ab9e062a10e0775717a6 (diff) |
updates for supporting Linux kernel build and initrd utilities
cpio: --verbose, --quiet, --to-stdout
test: make 64-bit math enable-able for hush too
dnsdomainname: alias to hostname -d
hostname: support --fqdn, --domain, --file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival')
-rw-r--r-- | archival/cpio.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/archival/cpio.c b/archival/cpio.c index a6484e5c0..5b4135f66 100644 --- a/archival/cpio.c +++ b/archival/cpio.c @@ -88,9 +88,17 @@ enum { CPIO_OPT_PRESERVE_MTIME = (1 << 6), CPIO_OPT_DEREF = (1 << 7), CPIO_OPT_FILE = (1 << 8), - CPIO_OPT_CREATE = (1 << 9) * ENABLE_FEATURE_CPIO_O, - CPIO_OPT_FORMAT = (1 << 10) * ENABLE_FEATURE_CPIO_O, - CPIO_OPT_PASSTHROUGH = (1 << 11) * ENABLE_FEATURE_CPIO_P, + OPTBIT_FILE = 8, + IF_FEATURE_CPIO_O(OPTBIT_CREATE ,) + IF_FEATURE_CPIO_O(OPTBIT_FORMAT ,) + IF_FEATURE_CPIO_P(OPTBIT_PASSTHROUGH,) + IF_LONG_OPTS( OPTBIT_QUIET ,) + IF_LONG_OPTS( OPTBIT_2STDOUT ,) + CPIO_OPT_CREATE = IF_FEATURE_CPIO_O((1 << OPTBIT_CREATE )) + 0, + CPIO_OPT_FORMAT = IF_FEATURE_CPIO_O((1 << OPTBIT_FORMAT )) + 0, + CPIO_OPT_PASSTHROUGH = IF_FEATURE_CPIO_P((1 << OPTBIT_PASSTHROUGH)) + 0, + CPIO_OPT_QUIET = IF_LONG_OPTS( (1 << OPTBIT_QUIET )) + 0, + CPIO_OPT_2STDOUT = IF_LONG_OPTS( (1 << OPTBIT_2STDOUT )) + 0, }; #define OPTION_STR "it0uvdmLF:" @@ -284,6 +292,9 @@ int cpio_main(int argc UNUSED_PARAM, char **argv) "pass-through\0" No_argument "p" #endif #endif + "verbose\0" No_argument "v" + "quiet\0" No_argument "\xff" + "to-stdout\0" No_argument "\xfe" ; #endif @@ -372,6 +383,8 @@ int cpio_main(int argc UNUSED_PARAM, char **argv) } if (opt & CPIO_OPT_EXTRACT) { archive_handle->action_data = data_extract_all; + if (opt & CPIO_OPT_2STDOUT) + archive_handle->action_data = data_extract_to_stdout; } if (opt & CPIO_OPT_UNCONDITIONAL) { archive_handle->ah_flags |= ARCHIVE_EXTRACT_UNCONDITIONAL; @@ -406,7 +419,9 @@ int cpio_main(int argc UNUSED_PARAM, char **argv) while (get_header_cpio(archive_handle) == EXIT_SUCCESS) continue; - if (archive_handle->ah_priv[2] != (void*) ~(ptrdiff_t)0) + if (archive_handle->ah_priv[2] != (void*) ~(ptrdiff_t)0 + && !(opt & CPIO_OPT_QUIET) + ) printf("%lu blocks\n", (unsigned long)(ptrdiff_t)(archive_handle->ah_priv[2])); return EXIT_SUCCESS; |