]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Sort short option list, fill in missing -I option, update
authorTim Kientzle <kientzle@gmail.com>
Sun, 19 Jul 2009 07:57:34 +0000 (03:57 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sun, 19 Jul 2009 07:57:34 +0000 (03:57 -0400)
manpage options to include -0, -J, -j, -lzma, and -h.
Since Windows no longer tries to automatically turn on ownership
restore, we need --preserve-owner to allow users to manually
turn it on.

SVN-Revision: 1240

cpio/bsdcpio.1
cpio/cmdline.c
cpio/cpio.c
cpio/cpio.h

index 81b34626bbd09c320dbc087793a88d8858b13a1e..79b6997ef4a8e71da71a30125b29a95c06d6c528 100644 (file)
@@ -80,6 +80,9 @@ specified directory.
 Unless specifically stated otherwise, options are applicable in
 all operating modes.
 .Bl -tag -width indent
+.It Fl 0
+Read filenames separated by NUL characters instead of newlines.
+This is necessary if any of the filenames being read might contain newlines.
 .It Fl A
 (o mode only)
 Append to the specified archive.
@@ -142,6 +145,11 @@ for more complete information about the
 formats currently supported by the underlying
 .Xr libarchive 3
 library.
+.It Fl H Ar format
+Synonym for
+.Fl -format .
+.It Fl h , Fl -help
+Print usage information.
 .It Fl I Ar file
 Read archive from
 .Ar file .
@@ -154,6 +162,14 @@ Disable security checks during extraction or copying.
 This allows extraction via symbolic links and path names containing
 .Sq ..
 in the name.
+.It Fl J
+(o mode only)
+Compress the file with xz-compatible compression before writing it.
+In input mode, this option is ignored; xz compression is recognized
+automatically on input.
+.It Fl j
+Synonym for
+.Fl y .
 .It Fl L
 (o and p modes)
 All symbolic links will be followed.
@@ -163,6 +179,11 @@ With this option, the target of the link will be archived or copied instead.
 (p mode only)
 Create links from the target directory to the original files,
 instead of copying.
+.It Fl lzma
+(o mode only)
+Compress the file with lzma-compatible compression before writing it.
+In input mode, this option is ignored; lzma compression is recognized
+automatically on input.
 .It Fl m
 (i and p modes)
 Set file modification time on created files to match
@@ -176,6 +197,10 @@ By default,
 displays the user and group names when they are provided in the
 archive, or looks up the user and group names in the system
 password database.
+.It Fl no-preserve-owner
+(i mode only)
+Do not attempt to restore file ownership.
+This is the default when run by non-root users.
 .It Fl O Ar file
 Write archive to
 .Ar file .
@@ -185,6 +210,10 @@ See above for description.
 .It Fl p
 Pass-through mode.
 See above for description.
+.It Fl preserve-owner
+(i mode only)
+Restore file ownership.
+This is the default when run by the root user.
 .It Fl -quiet
 Suppress unnecessary messages.
 .It Fl R Oo user Oc Ns Oo : Oc Ns Oo group Oc
index f090e260b5486f08c629c337ee8169027f3a155f..6dd6082b757d9737447d7a4492abace0c958fe35 100644 (file)
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/cmdline.c,v 1.5 2008/12/06 07:30:40 kientzl
 /*
  * Short options for cpio.  Please keep this sorted.
  */
-static const char *short_options = "0AaBC:F:O:cdE:f:H:hiJjLlmnopR:rtuvW:yZz";
+static const char *short_options = "0AaBC:cdE:F:f:H:hI:iJjLlmnO:opR:rtuvW:yZz";
 
 /*
  * Long options for cpio.  Please keep this sorted.
@@ -77,6 +77,7 @@ static const struct option {
        { "owner",                      1, 'R' },
        { "pass-through",               0, 'p' },
        { "preserve-modification-time", 0, 'm' },
+       { "preserve-owner",             0, OPTION_PRESERVE_OWNER },
        { "quiet",                      0, OPTION_QUIET },
        { "unconditional",              0, 'u' },
        { "verbose",                    0, 'v' },
index ae3990a015b2b9852403d55fb808725843c1baea..88c484bd4c38533a98f38725319f0f5a5266d862 100644 (file)
@@ -261,6 +261,9 @@ main(int argc, char *argv[])
                        cpio->mode = opt;
                        cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
                        break;
+               case OPTION_PRESERVE_OWNER:
+                       cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;
+                       break;
                case OPTION_QUIET: /* GNU cpio */
                        cpio->quiet = 1;
                        break;
index 4b38b5ff7cca2963edb29b3e714e4b9ec9845e58..a64dceb8a1ddcc2161e6d5189805e2c3310acdc8 100644 (file)
@@ -98,6 +98,7 @@ enum {
        OPTION_INSECURE = 1,
        OPTION_LZMA,
        OPTION_NO_PRESERVE_OWNER,
+       OPTION_PRESERVE_OWNER,
        OPTION_QUIET,
        OPTION_VERSION
 };