]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Following Joerg's lead, split out the archive_write options discussion
authorTim Kientzle <kientzle@gmail.com>
Sun, 28 Feb 2010 00:12:33 +0000 (19:12 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sun, 28 Feb 2010 00:12:33 +0000 (19:12 -0500)
to a separate man page and add descriptions of the new ISO9660 write
options.

SVN-Revision: 2001

Makefile.am
libarchive/CMakeLists.txt
libarchive/archive_write.3
libarchive/archive_write_options.3 [new file with mode: 0644]

index 35d8226ca871b375de8437c38367ff0a4fbc17c6..6af3ad99c5d7a607b0ae3eca0ebceebf75675517 100644 (file)
@@ -198,6 +198,7 @@ libarchive_man_MANS=                                                \
        libarchive/archive_util.3                               \
        libarchive/archive_write.3                              \
        libarchive/archive_write_disk.3                         \
+       libarchive/archive_write_options.3                      \
        libarchive/cpio.5                                       \
        libarchive/libarchive.3                                 \
        libarchive/libarchive_internals.3                       \
index 5c815d9eaba6cec0edd935768f6905cf5a259af4..ebbd8b4326d213fdbbe5f30a879c2ace4c0a7b6f 100644 (file)
@@ -107,6 +107,7 @@ SET(libarchive_MANS
   archive_util.3
   archive_write.3
   archive_write_disk.3
+  archive_write_options.3
   cpio.5
   libarchive.3
   libarchive_internals.3
index 9a27409a6a8015f2622ff59a9288278f6858c8aa..364a5634c5d13607ff75fcf13024ae737d87b0aa 100644 (file)
@@ -43,9 +43,6 @@
 .Nm archive_write_set_compression_gzip ,
 .Nm archive_write_set_compression_none ,
 .Nm archive_write_set_compression_program ,
-.Nm archive_write_set_compressor_options ,
-.Nm archive_write_set_format_options ,
-.Nm archive_write_set_options ,
 .Nm archive_write_open ,
 .Nm archive_write_open_fd ,
 .Nm archive_write_open_FILE ,
 .Ft int
 .Fn archive_write_set_format_ustar "struct archive *"
 .Ft int
-.Fn archive_write_set_format_options "struct archive *" "const char *"
-.Ft int
-.Fn archive_write_set_compressor_options "struct archive *" "const char *"
-.Ft int
-.Fn archive_write_set_options "struct archive *" "const char *"
-.Ft int
 .Fo archive_write_open
 .Fa "struct archive *"
 .Fa "void *client_data"
@@ -216,68 +207,6 @@ Note that the compressed output is always properly blocked.
 The archive will be fed into the specified compression program.
 The output of that program is blocked and written to the client
 write callbacks.
-.It Xo
-.Fn archive_write_set_compressor_options ,
-.Fn archive_write_set_format_options ,
-.Fn archive_write_set_options
-.Xc
-Specifies options that will be passed to the currently-enabled
-compressor and/or format writer.
-The argument is a comma-separated list of individual options.
-Individual options have one of the following forms:
-.Bl -tag -compact -width indent
-.It Ar option=value
-The option/value pair will be provided to every module.
-Modules that do not accept an option with this name will ignore it.
-.It Ar option
-The option will be provided to every module with a value of
-.Dq 1 .
-.It Ar !option
-The option will be provided to every module with a NULL value.
-.It Ar module:option=value , Ar module:option , Ar module:!option
-As above, but the corresponding option and value will be provided
-only to modules whose name matches
-.Ar module .
-.El
-The return value will be
-.Cm ARCHIVE_OK
-if any module accepts the option, or
-.Cm ARCHIVE_WARN
-if no module accepted the option, or
-.Cm ARCHIVE_FATAL
-if there was a fatal error while attempting to process the option.
-.Pp
-The currently supported options are:
-.Bl -tag -compact -width indent
-.It Compressor gzip
-.Bl -tag -compact -width indent
-.It Cm compression-level
-The value is interpreted as a decimal integer specifying the
-gzip compression level.
-.El
-.It Compressor xz
-.Bl -tag -compact -width indent
-.It Cm compression-level
-The value is interpreted as a decimal integer specifying the
-compression level.
-.El
-.It Format mtree
-.Bl -tag -compact -width indent
-.It Cm cksum , Cm device , Cm flags , Cm gid , Cm gname , Cm indent , Cm link , Cm md5 , Cm mode , Cm nlink , Cm rmd160 , Cm sha1 , Cm sha256 , Cm sha384 , Cm sha512 , Cm size , Cm time , Cm uid , Cm uname
-Enable a particular keyword in the mtree output.
-Prefix with an exclamation mark to disable the corresponding keyword.
-The default is equivalent to
-.Dq device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname .
-.It Cm all
-Enables all of the above keywords.
-.It Cm use-set
-Enables generation of
-.Cm /set
-lines that specify default values for the following files and/or directories.
-.It Cm indent
-XXX needs explanation XXX
-.El
-.El
 .It Fn archive_write_open
 Freeze the settings, open the archive, and prepare for writing entries.
 This is the most generic form of this function, which accepts
@@ -590,6 +519,9 @@ and
 .Sh SEE ALSO
 .Xr tar 1 ,
 .Xr libarchive 3 ,
+.Xr archive_write_options 3 ,
+.Xr cpio 5 ,
+.Xr mtree 5 ,
 .Xr tar 5
 .Sh HISTORY
 The
diff --git a/libarchive/archive_write_options.3 b/libarchive/archive_write_options.3
new file mode 100644 (file)
index 0000000..a6d4b50
--- /dev/null
@@ -0,0 +1,330 @@
+.\" Copyright (c) 2003-2010 Tim Kientzle
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD: head/lib/libarchive/archive_write.3 201110 2009-12-28 03:31:29Z kientzle $
+.\"
+.Dd Feb 27, 2010
+.Dt archive_write_options 3
+.Os
+.Sh NAME
+.Nm archive_write_set_filter_options ,
+.Nm archive_write_set_format_options ,
+.Nm archive_write_set_options ,
+.Nd functions for controlling options when creating archives
+.Sh SYNOPSIS
+.Ft int
+.Fn archive_write_set_filter_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_write_set_format_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_write_set_options "struct archive *" "const char *"
+.Sh DESCRIPTION
+These functions provide a way for libarchive clients to configure
+specific write modules.
+The argument is a comma-separated list of key/value pairs that
+are parsed and passed to the currently-configured modules.
+.Pp
+Individual options have one of the following forms:
+.Bl -tag -compact -width indent
+.It Ar option=value
+The option/value pair will be provided to every module.
+Modules that do not accept an option with this name will ignore it.
+.It Ar option
+The option will be provided to every module with a value of
+.Dq 1 .
+.It Ar !option
+The option will be provided to every module with a NULL value.
+.It Ar module:option=value , Ar module:option , Ar module:!option
+As above, but the corresponding option and value will be provided
+only to modules whose name matches
+.Ar module .
+.El
+.Pp
+The currently supported options are:
+.Bl -tag -compact -width indent
+.It Filter gzip
+.Bl -tag -compact -width indent
+.It Cm compression-level
+The value is interpreted as a decimal integer specifying the
+gzip compression level.
+.El
+.It Filter xz
+.Bl -tag -compact -width indent
+.It Cm compression-level
+The value is interpreted as a decimal integer specifying the
+compression level.
+.El
+.It Format mtree
+.Bl -tag -compact -width indent
+.It Cm cksum , Cm device , Cm flags , Cm gid , Cm gname , Cm indent , Cm link , Cm md5 , Cm mode , Cm nlink , Cm rmd160 , Cm sha1 , Cm sha256 , Cm sha384 , Cm sha512 , Cm size , Cm time , Cm uid , Cm uname
+Enable a particular keyword in the mtree output.
+Prefix with an exclamation mark to disable the corresponding keyword.
+The default is equivalent to
+.Dq device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname .
+.It Cm all
+Enables all of the above keywords.
+.It Cm use-set
+Enables generation of
+.Cm /set
+lines that specify default values for the following files and/or directories.
+.It Cm indent
+XXX needs explanation XXX
+.El
+.It Format iso9660 - volume metadata
+These options are used to set standard ISO9660 metadata.
+.Bl -tag -compact -width indent
+.It Cm abstract-file Ns = Ns Ar filename
+The file with the specified name will be identified in the ISO9660 metadata
+as holding the abstract for this volume.  Default: none.
+.It Cm application-id Ns = Ns Ar filename
+The file with the specified name will be identified in the ISO9660 metadata
+as holding the application identifier for this volume.  Default: none.
+.It Cm biblio-file Ns = Ns Ar filename
+The file with the specified name will be identified in the ISO9660 metadata
+as holding the bibliography for this volume.  Default: none.
+.It Cm copyright-file Ns = Ns Ar filename
+The file with the specified name will be identified in the ISO9660 metadata
+as holding the copyright for this volume.  Default: none.
+.It Cm publisher Ns = Ns Ar filename
+The file with the specified name will be identified in the ISO9660 metadata
+as holding the publisher information for this volume.  Default: none.
+.It Cm volume-id Ns = Ns Ar string
+The specified string will be used as the Volume Identifier in the ISO9660 metadata.
+It is limited to 32 bytes. Default: none.
+.El
+.It Format iso9660 - boot support
+These options are used to make an ISO9660 image that can be directly
+booted on various systems.
+.Bl -tag -compact -width indent
+.It Cm boot Ns = Ns Ar filename
+The file matching this name will be used as the El Torito boot image file.
+.It Cm boot-catalog Ns = Ns Ar name
+The name that will be used for the El Torito boot catalog.
+Default:
+.Ar boot.catalog
+.It Cm boot-info-table
+The boot image file provided by the
+.Cm boot Ns = Ns Ar filename
+option will be edited with appropriate boot information in bytes 8 through 64.
+Default: disabled
+.It Cm boot-load-seg Ns = Ns Ar hexadecimal-number
+The load segment for a no-emulation boot image.
+.It Cm boot-load-size Ns = Ns Ar decimal-number
+The number of "virtual" 512-byte sectors to be loaded from a no-emulation boot image.
+Some very old BIOSes can only load very small images, setting this
+value to 4 will often allow such BIOSes to load the first part of
+the boot image (which will then need to be intelligent enough to
+load the rest of itself).
+This should not be needed unless you are trying to support systems with very old BIOSes.
+This defaults to the full size of the image.
+.It Cm boot-type Ns = Ns Ar value
+Specifies the boot semantics used by the El Torito boot image:
+If the
+.Ar value
+is
+.Cm fd ,
+then the boot image is assumed to be a bootable floppy image.
+If the
+.Ar value
+is
+.Cm hd ,
+then the the boot image is assumed to be a bootable hard disk image.
+If the
+.Ar value
+is
+.Cm no-emulation ,
+the boot image is used without floppy or hard disk emulation.
+If the boot image is exactly 1.2MB, 1.44MB, or 2.88MB, then
+the default is
+.Cm fd ,
+otherwise the default is
+.Cm no-emulation.
+.El
+.It Format iso9660 - filename and size extensions
+Various extensions to the base ISO9660 format.
+.Bl -tag -compact -width indent
+.It Cm allow-ldots
+If enabled, allows filenames to begin with a leading period.
+If disabled, filenames that begin with a leading period will have
+that period replaced by an underscore character in the standard ISO9660
+namespace.
+This does not impact names stored in the Rockridge or Joliet extension area.
+Default: disabled.
+.It Cm allow-lowercase
+If enabled, allows filenames to contain lowercase characters.
+If disabled, filenames will be forced to uppercase.
+This does not impact names stored in the Rockridge or Joliet extension area.
+Default: disabled.
+.It Cm allow-multidot
+If enabled, allows filenames to contain multiple period characters, in violation of the ISO9660 specification.
+If disabled, additional periods will be converted to underscore characters.
+This does not impact names stored in the Rockridge or Joliet extension area.
+Default: disabled.
+.It Cm allow-period
+If enabled, allows filenames to contain trailing period characters, in violation of the ISO9660 specification.
+If disabled,trailing periods will be converted to underscore characters.
+This does not impact names stored in the Rockridge or Joliet extension area.
+Default: disabled.
+.It Cm allow-pvd-lowercase
+If enabled, the Primary Volume Descriptor may contain lowercase ASCII characters, in violation of the ISO9660 specification.
+If disabled, characters will be converted to uppercase ASCII.
+Default: disabled.
+.It Cm allow-sharp-tilde
+If enabled, sharp and tilde characters will be permitted in filenames, in violation if the ISO9660 specification.
+If disabled, such characters will be converted to underscore characters.
+Default: disabled.
+.It Cm allow-vernum
+If enabled, version numbers will be included with files.
+If disabled, version numbers will be suppressed, in violation of the ISO9660 standard.
+This does not impact names stored in the Rockridge or Joliet extension area.
+Default: enabled.
+.It Cm iso-level
+This enables support for file size and file name extensions in the
+core ISO9660 area.
+The name extensions specified here do not affect the names stored in the Rockridge or Joliet extension areas.
+.Bl -tag -compact -width indent
+.It Cm iso-level=1
+The most compliant form of ISO9660 image.
+Filenames are limited to 8.3 uppercase format,
+directory names are limited to 8 uppercase characters,
+files are limited to 4 GiB,
+the complete ISO9660 image cannot exceed 4 GiB.
+.It Cm iso-level=2
+Filenames are limited to 30 uppercase characters with a 30-character extension,
+directory names are limited to 30 characters,
+files are limited to 4 GiB.
+.It Cm iso-level=3
+As with
+.Cm iso-level=2 ,
+except that files may exceed 4 GiB.
+.It Cm iso-level=4
+As with
+.Cm iso-level=3 ,
+except that filenames may be up to 193 characters
+and may include arbitrary 8-bit characters.
+.El
+.It Cm joliet
+Microsoft's Joliet extensions store a completely separate set of directory information about each file.
+In particular, this information includes Unicode filenames of up to 255 characters.
+Default: enabled.
+.It Cm limit-depth
+If enabled, libarchive will use directory relocation records to ensure that
+no pathname exceeds the ISO9660 limit of 8 directory levels.
+If disabled, no relocation will occur.
+Default: enabled.
+.It Cm limit-dirs
+If enabled, libarchive will cause an error if there are more than
+65536 directories.
+If disabled, there is no limit on the number of directories.
+Default: enabled
+.It Cm pad
+If enabled, 300 kiB of zero bytes will be appended to the end of the archive.
+Default: enabled
+.It Cm relaxed-filenames
+If enabled, all 7-bit ASCII characters are permitted in filenames
+(except lowercase characters unless
+.Cm allow-lowercase
+is also specified).
+This violates ISO9660 standards.
+This does not impact names stored in the Rockridge or Joliet extension area.
+Default: disabled.
+.It Cm rockridge
+The Rockridge extensions store an additional set of POSIX-style file
+information with each file, including mtime, atime, ctime, permissions,
+and long filenames with arbitrary 8-bit characters.
+These extensions also support symbolic links and other POSIX file types.
+Default: enabled.
+.El
+.It Format iso9660 - zisofs support
+The zisofs extensions permit each file to be independently compressed
+using a gzip-compatible compression.
+This can provide significant size savings, but requires the reading
+system to have support for these extensions.
+These extensions are disabled by default.
+.Bl -tag -compact -width indent
+.It Cm compression-level Ns = Ns number
+The compression level used by the deflate compressor.
+Ranges from 0 (least effort) to 9 (most effort).
+Default: 6
+.It Cm zisofs
+Synonym for
+.Cm zisofs=direct .
+.It Cm zisofs=direct
+Compress each file in the archive.
+Unlike
+.Cm zisofs=indirect ,
+this is handled entirely within libarchive and does not require a
+separate utility.
+For best results, libarchive tests each file and will store
+the file uncompressed if the compression does not actually save any space.
+In particular, files under 2k will never be compressed.
+Note that boot image files are never compressed.
+.It Cm zisofs=indirect
+Recognizes files that have already been compressed with the
+.Cm mkzftree
+utility and sets up the necessary file metadata so that
+readers will correctly identify these as zisofs-compressed files.
+.It Cm zisofs-exclude Ns = Ns Ar filename
+Specifies a filename that should not be compressed when using
+.Cm zisofs=direct .
+This option can be provided multiple times to suppress compression
+on many files.
+.El
+.El
+.Sh RETURN VALUES
+The return value will be
+.Cm ARCHIVE_OK
+if each specified option was accepted by at least one module,
+.Cm ARCHIVE_WARN
+if some option was refused by every module, or
+.Cm ARCHIVE_FATAL
+if there was a fatal error while attempting to process some option.
+.Sh EXAMPLES
+The following example creates an archive write handle to
+create a gzip-compressed ISO9660 format image.
+The two options here specify that the ISO9660 archive will use
+.Ar kernel.img
+as the boot image for El Torito booting, and that the gzip
+compressor should use the maximum compression level.
+.Bd -literal -offset indent
+a = archive_write_new();
+archive_write_add_filter_gzip(a);
+archive_write_set_format_iso9660(a);
+archive_write_set_options(a, "boot=kernel.img,compression=9");
+archive_write_open_filename(a, filename, blocksize);
+.Ed
+.Sh SEE ALSO
+.Xr tar 1 ,
+.Xr libarchive 3 ,
+.Xr archive_write 3
+.Sh HISTORY
+The
+.Nm libarchive
+library first appeared in
+.Fx 5.3 .
+.Sh AUTHORS
+.An -nosplit
+The options support for libarchive was originally implemented by
+.An Michihiro NAKAJIMA .
+.Sh BUGS