From: Tim Kientzle Date: Tue, 6 May 2008 22:55:46 +0000 (-0400) Subject: Add some additional examples and clarification about using X-Git-Tag: v2.6.0~262 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50be135b28fac6385a8e5801646e3b1004147255;p=thirdparty%2Flibarchive.git Add some additional examples and clarification about using mtree descriptions to generate tar archives using tar -cf output.tar @input.mtree Obtained from: Vincent Zweije SVN-Revision: 30 --- diff --git a/libarchive/libarchive-formats.5 b/libarchive/libarchive-formats.5 index 0346d8f5a..f570935c8 100644 --- a/libarchive/libarchive-formats.5 +++ b/libarchive/libarchive-formats.5 @@ -259,6 +259,14 @@ There are two common variants: the GNU format derived from SVR4, and the BSD format, which first appeared in 4.4BSD. Libarchive provides read and write support for both variants. +.Ss mtree +Libarchive can read files in +.Xr mtree 5 +format. This format is not a true archive format, but rather a description +of a file hierarchy. When requested, libarchive obtains the contents of +the files described by the +.Xr mtree 5 +format from files on disk instead. .Sh SEE ALSO .Xr ar 1 , .Xr cpio 1 , diff --git a/libarchive/mtree.5 b/libarchive/mtree.5 index 2341626d8..b6637d6f5 100644 --- a/libarchive/mtree.5 +++ b/libarchive/mtree.5 @@ -33,12 +33,12 @@ .Os .Sh NAME .Nm mtree -.Nd format of mtree dir heirarchy files +.Nd format of mtree dir hierarchy files .Sh DESCRIPTION The .Nm format is a textual format that describes a collection of filesystem objects. -Such files are typically used to create or verify directory heirarchies. +Such files are typically used to create or verify directory hierarchies. .Ss General Format An .Nm @@ -135,8 +135,7 @@ the .Xr cksum 1 utility. .It Cm contents -The full pathname of a file whose contents should be -compared to the contents of this file. +The full pathname of a file that holds the contents of this file. .It Cm flags The file flags as a symbolic name. See @@ -152,7 +151,7 @@ The file group as a symbolic name. .It Cm ignore Ignore any file hierarchy below this file. .It Cm link -The file the symbolic link is expected to reference. +The target of the symbolic link when type=link. .It Cm md5 The MD5 message digest of the file. .It Cm md5digest diff --git a/tar/bsdtar.1 b/tar/bsdtar.1 index ed8df3481..f3be2162a 100644 --- a/tar/bsdtar.1 +++ b/tar/bsdtar.1 @@ -294,7 +294,7 @@ is specified, and the program is being run by the root user. In this case, the file modes and flags from the archive will be restored, but ACLs or owner information in the archive will be discarded. -.Pp +.It Fl o (c, r, u mode) A synonym for .Fl -format Ar ustar @@ -512,6 +512,16 @@ directory and add .Pa foo2 to the output archive. .Pp +An input file in +.Xr mtree 5 +format can be used to create an output archive with arbitrary ownership, +permissions, or names that differ from existing data on disk: +.Pp +.Dl $ cat input.mtree +.Dl usr/bin uid=0 gid=0 mode=0755 type=dir +.Dl usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls +.Dl $ tar -cvf output.tar @input.mtree +.Pp The .Fl -newer and