summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2008-02-26 13:09:20 +0000
committerjoerg <joerg@pkgsrc.org>2008-02-26 13:09:20 +0000
commit840b7e50a88a271ecaf658715d717f1874dec4cf (patch)
treeb1d6c54983a131a38eb3811e784be451aaf76330
parent716563bc0c4cdde2939f9371a03b69812faff736 (diff)
downloadpkgsrc-840b7e50a88a271ecaf658715d717f1874dec4cf.tar.gz
Import libarchive-2.4.13. This brings a number of bugfixes, support for
more ZIP archives and a more complete cpio frontend.
-rw-r--r--archivers/libarchive/files/Makefile.am218
-rw-r--r--archivers/libarchive/files/Makefile.in863
-rw-r--r--archivers/libarchive/files/NEWS64
-rw-r--r--archivers/libarchive/files/config.h.in21
-rwxr-xr-xarchivers/libarchive/files/configure739
-rw-r--r--archivers/libarchive/files/configure.ac96
-rw-r--r--archivers/libarchive/files/cpio/bsdcpio.143
-rw-r--r--archivers/libarchive/files/cpio/cmdline.c2
-rw-r--r--archivers/libarchive/files/cpio/cpio.c104
-rw-r--r--archivers/libarchive/files/cpio/cpio.h13
-rw-r--r--archivers/libarchive/files/cpio/matching.c252
-rw-r--r--archivers/libarchive/files/cpio/matching.h40
-rw-r--r--archivers/libarchive/files/cpio/pathmatch.c250
-rw-r--r--archivers/libarchive/files/cpio/pathmatch.h37
-rw-r--r--archivers/libarchive/files/cpio/test/list.h14
-rw-r--r--archivers/libarchive/files/cpio/test/main.c177
-rw-r--r--archivers/libarchive/files/cpio/test/test.h35
-rw-r--r--archivers/libarchive/files/cpio/test/test_basic.c10
-rw-r--r--archivers/libarchive/files/cpio/test/test_format_newc.c238
-rw-r--r--archivers/libarchive/files/cpio/test/test_gcpio_compat.c12
-rw-r--r--archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.bin.uu16
-rw-r--r--archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.crc.uu27
-rw-r--r--archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.newc.uu27
-rw-r--r--archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.ustar.uu84
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_B.c4
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_L.c82
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_a.c104
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_c.c195
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_d.c4
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_ell.c66
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_f.c65
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_f.cpio.uu16
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_help.c81
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_m.c4
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_m.cpio.uu16
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_t.c4
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_t.cpio.uu16
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_t.stdout.uu5
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_tv.stdout.uu5
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_u.c85
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_version.c84
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_y.c52
-rw-r--r--archivers/libarchive/files/cpio/test/test_option_z.c52
-rw-r--r--archivers/libarchive/files/cpio/test/test_pathmatch.c179
-rw-r--r--archivers/libarchive/files/doc/man/Makefile43
-rw-r--r--archivers/libarchive/files/doc/man/archive_entry.3841
-rw-r--r--archivers/libarchive/files/doc/man/archive_read.3850
-rw-r--r--archivers/libarchive/files/doc/man/archive_util.3274
-rw-r--r--archivers/libarchive/files/doc/man/archive_write.3750
-rw-r--r--archivers/libarchive/files/doc/man/archive_write_disk.3450
-rw-r--r--archivers/libarchive/files/doc/man/bsdcpio.1370
-rw-r--r--archivers/libarchive/files/doc/man/bsdtar.1697
-rw-r--r--archivers/libarchive/files/doc/man/cpio.5224
-rw-r--r--archivers/libarchive/files/doc/man/libarchive-formats.5171
-rw-r--r--archivers/libarchive/files/doc/man/libarchive.3352
-rw-r--r--archivers/libarchive/files/doc/man/libarchive_internals.3246
-rw-r--r--archivers/libarchive/files/doc/man/mtree.5280
-rw-r--r--archivers/libarchive/files/doc/man/tar.5457
-rw-r--r--archivers/libarchive/files/doc/mdoc2man.awk328
-rw-r--r--archivers/libarchive/files/doc/text/Makefile42
-rw-r--r--archivers/libarchive/files/doc/text/archive_entry.3350
-rw-r--r--archivers/libarchive/files/doc/text/archive_read.3395
-rw-r--r--archivers/libarchive/files/doc/text/archive_util.391
-rw-r--r--archivers/libarchive/files/doc/text/archive_write.3420
-rw-r--r--archivers/libarchive/files/doc/text/archive_write_disk.3253
-rw-r--r--archivers/libarchive/files/doc/text/bsdcpio.1187
-rw-r--r--archivers/libarchive/files/doc/text/bsdtar.1441
-rw-r--r--archivers/libarchive/files/doc/text/cpio.5235
-rw-r--r--archivers/libarchive/files/doc/text/libarchive-formats.5180
-rw-r--r--archivers/libarchive/files/doc/text/libarchive.3185
-rw-r--r--archivers/libarchive/files/doc/text/libarchive_internals.3248
-rw-r--r--archivers/libarchive/files/doc/text/mtree.5158
-rw-r--r--archivers/libarchive/files/doc/text/tar.5534
-rwxr-xr-xarchivers/libarchive/files/doc/update.sh47
-rw-r--r--archivers/libarchive/files/libarchive/archive.h.in2
-rw-r--r--archivers/libarchive/files/libarchive/archive_endian.h142
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry.c37
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry.h152
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry_link_resolver.c330
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry_private.h2
-rw-r--r--archivers/libarchive/files/libarchive/archive_entry_strmode.c8
-rw-r--r--archivers/libarchive/files/libarchive/archive_platform.h7
-rw-r--r--archivers/libarchive/files/libarchive/archive_read.c13
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_extract.c12
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_open_filename.c8
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_private.h5
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c4
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c4
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_compression_none.c2
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_all.c2
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_ar.c8
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c13
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c27
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c12
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_tar.c536
-rw-r--r--archivers/libarchive/files/libarchive/archive_read_support_format_zip.c258
-rw-r--r--archivers/libarchive/files/libarchive/archive_util.c2
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_disk.c127
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_open_filename.c8
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c10
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c29
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_compression_none.c2
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_ar.c22
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c2
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c10
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_pax.c197
-rw-r--r--archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c2
-rw-r--r--archivers/libarchive/files/libarchive/config_freebsd.h9
-rw-r--r--archivers/libarchive/files/libarchive/config_windows.h678
-rw-r--r--archivers/libarchive/files/libarchive/cpio.52
-rw-r--r--archivers/libarchive/files/libarchive/filter_fork.c2
-rw-r--r--archivers/libarchive/files/libarchive/libarchive-formats.52
-rw-r--r--archivers/libarchive/files/libarchive/libarchive_internals.32
-rw-r--r--archivers/libarchive/files/libarchive/test/list.h7
-rw-r--r--archivers/libarchive/files/libarchive/test/main.c191
-rw-r--r--archivers/libarchive/files/libarchive/test/read_open_memory.c2
-rw-r--r--archivers/libarchive/files/libarchive/test/test.h23
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_gtar.c110
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_gtar_1.tgz.uu9
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink.c104
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink_1.tar.uu39
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_zip.c69
-rw-r--r--archivers/libarchive/files/libarchive/test/test_compat_zip_1.zip.uu14
-rw-r--r--archivers/libarchive/files/libarchive/test/test_empty_write.c118
-rw-r--r--archivers/libarchive/files/libarchive/test/test_entry.c35
-rw-r--r--archivers/libarchive/files/libarchive/test/test_entry_strmode.c2
-rw-r--r--archivers/libarchive/files/libarchive/test/test_link_resolver.c222
-rw-r--r--archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.c132
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c2
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c644
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu26
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu26
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu29
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu27
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu27
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu1369
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c2
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_mtree.c2
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_tar.c49
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_format_zip.c2
-rw-r--r--archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c2
-rw-r--r--archivers/libarchive/files/libarchive/test/test_tar_filenames.c2
-rw-r--r--archivers/libarchive/files/libarchive/test/test_tar_large.c12
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk.c25
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk_hardlink.c165
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_disk_perms.c35
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_cpio.c2
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c47
-rw-r--r--archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c2
-rw-r--r--archivers/libarchive/files/tar/bsdtar.127
-rw-r--r--archivers/libarchive/files/tar/bsdtar.c18
-rw-r--r--archivers/libarchive/files/tar/bsdtar.h2
-rw-r--r--archivers/libarchive/files/tar/bsdtar_platform.h2
-rw-r--r--archivers/libarchive/files/tar/read.c2
-rw-r--r--archivers/libarchive/files/tar/test/main.c731
-rwxr-xr-xarchivers/libarchive/files/tar/test/old/config.sh75
-rwxr-xr-xarchivers/libarchive/files/tar/test/old/test-acl.sh76
-rwxr-xr-xarchivers/libarchive/files/tar/test/old/test-basic.sh432
-rwxr-xr-xarchivers/libarchive/files/tar/test/old/test-deep-dir.sh60
-rwxr-xr-xarchivers/libarchive/files/tar/test/old/test-flags.sh74
-rwxr-xr-xarchivers/libarchive/files/tar/test/old/test-nodump.sh52
-rwxr-xr-xarchivers/libarchive/files/tar/test/old/test-overwrite.sh51
-rwxr-xr-xarchivers/libarchive/files/tar/test/old/test-utf8.sh40
-rw-r--r--archivers/libarchive/files/tar/test/test.h144
-rw-r--r--archivers/libarchive/files/tar/test/test_basic.c158
-rw-r--r--archivers/libarchive/files/tar/test/test_copy.c279
-rw-r--r--archivers/libarchive/files/tar/test/test_getdate.c38
-rw-r--r--archivers/libarchive/files/tar/test/test_help.c81
-rw-r--r--archivers/libarchive/files/tar/test/test_stdio.c124
-rw-r--r--archivers/libarchive/files/tar/test/test_version.c73
-rw-r--r--archivers/libarchive/files/tar/util.c2
-rw-r--r--archivers/libarchive/files/tar/write.c4
-rw-r--r--archivers/libarchive/files/version2
173 files changed, 18642 insertions, 4769 deletions
diff --git a/archivers/libarchive/files/Makefile.am b/archivers/libarchive/files/Makefile.am
index c4cea7af690..89b67660844 100644
--- a/archivers/libarchive/files/Makefile.am
+++ b/archivers/libarchive/files/Makefile.am
@@ -8,16 +8,17 @@ AUTOMAKE_OPTIONS= foreign subdir-objects
lib_LTLIBRARIES= libarchive.la
bin_PROGRAMS= $(bsdtar_programs) $(bsdcpio_programs)
man_MANS= $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS)
-BUILT_SOURCES= libarchive/test/list.h cpio/test/list.h
+BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h $(libarchive_test_REFFILES) $(bsdcpio_test_REFFILES)
#
-# What to test
+# What to test: We always test libarchive, test bsdtar and bsdcpio only
+# if we built them.
#
-check_PROGRAMS= libarchive_test $(bsdcpio_test_programs)
-TESTS= libarchive_test $(bsdcpio_test_programs)
-TESTS_ENVIRONMENT= $(bsdcpio_TESTS_ENVIRONMENT)
-# Always build and test bsdcpio as part of 'distcheck'
-DISTCHECK_CONFIGURE_FLAGS = --enable-bsdcpio
+check_PROGRAMS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs)
+TESTS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs)
+TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT)
+# Always build and test both bsdtar and bsdcpio as part of 'distcheck'
+DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio
#
# What to include in the distribution
@@ -25,8 +26,11 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-bsdcpio
EXTRA_DIST= version \
contrib \
examples \
+ doc \
$(libarchive_EXTRA_DIST) \
+ $(libarchive_test_EXTRA_DIST) \
$(bsdtar_EXTRA_DIST) \
+ $(bsdtar_test_EXTRA_DIST) \
$(bsdcpio_EXTRA_DIST) \
$(bsdcpio_test_EXTRA_DIST)
@@ -38,18 +42,20 @@ dist-hook:
rm -f `find $(distdir) -name '*~'`
rm -f `find $(distdir) -name '*.out'`
rm -f `find $(distdir) -name '*.core'`
- rm -f $(distdir)/*/Makefile
- mkdir -p $(distdir)/doc/man
- cp $(distdir)/libarchive/*.[135] $(distdir)/doc/man
- cp $(distdir)/tar/*.[135] $(distdir)/doc/man
- cp $(distdir)/cpio/*.[135] $(distdir)/doc/man
- mkdir -p $(distdir)/doc/text
- cd $(distdir)/doc/man; for f in *.[135]; do nroff -mdoc $$f | col -b > ../text/`basename $$f`.txt; done
+ -rm -f $(distdir)/*/Makefile $(distdir)/*/*/Makefile
+ cd $(distdir)/doc && ./update.sh
+
+#
+# Extra rules for cleanup
+#
+CLEANFILES=$(libarchive_test_REFFILES) $(bsdcpio_test_REFFILES)
+
+DISTCLEANFILES= tar/getdate.c tar/getdate.h \
+ libarchive/test/list.h \
+ tar/test/list.h \
+ cpio/test/list.h
distclean-local:
- -rm -f tar/getdate.c tar/getdate.h
- -rm -f libarchive/test/list.h
- -rm -f cpio/test/list.h
-rm -rf autom4te.cache/
-rm -f *~
@@ -65,6 +71,7 @@ nodist_include_HEADERS= libarchive/archive.h
libarchive_la_SOURCES= \
libarchive/archive_check_magic.c \
+ libarchive/archive_endian.h \
libarchive/archive_entry.c \
libarchive/archive_entry.h \
libarchive/archive_entry_copy_stat.c \
@@ -164,8 +171,14 @@ libarchive_test_SOURCES= \
libarchive/test/test_acl_pax.c \
libarchive/test/test_archive_api_feature.c \
libarchive/test/test_bad_fd.c \
+ libarchive/test/test_compat_gtar.c \
+ libarchive/test/test_compat_tar_hardlink.c \
+ libarchive/test/test_compat_zip.c \
+ libarchive/test/test_empty_write.c \
libarchive/test/test_entry.c \
libarchive/test/test_entry_strmode.c \
+ libarchive/test/test_link_resolver.c \
+ libarchive/test/test_pax_filename_encoding.c \
libarchive/test/test_read_compress_program.c \
libarchive/test/test_read_data_large.c \
libarchive/test/test_read_extract.c \
@@ -197,6 +210,7 @@ libarchive_test_SOURCES= \
libarchive/test/test_tar_large.c \
libarchive/test/test_write_compress_program.c \
libarchive/test/test_write_disk.c \
+ libarchive/test/test_write_disk_hardlink.c \
libarchive/test/test_write_disk_perms.c \
libarchive/test/test_write_disk_secure.c \
libarchive/test/test_write_format_ar.c \
@@ -217,6 +231,58 @@ libarchive_test_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_builddir)/libarch
libarchive/test/list.h: Makefile
cat $(top_srcdir)/libarchive/test/test_*.c | grep DEFINE_TEST > libarchive/test/list.h
+libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_builddir);/bin/pwd`
+
+libarchive_test_EXTRA_DIST=\
+ libarchive/test/test_compat_gtar_1.tgz.uu \
+ libarchive/test/test_compat_tar_hardlink_1.tar.uu \
+ libarchive/test/test_compat_zip_1.zip.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
+
+libarchive_test_REFFILES=\
+ test_compat_gtar_1.tgz \
+ test_compat_tar_hardlink_1.tar \
+ test_compat_zip_1.zip \
+ test_read_format_gtar_sparse_1_13.tgz \
+ test_read_format_gtar_sparse_1_17.tgz \
+ test_read_format_gtar_sparse_1_17_posix00.tgz \
+ test_read_format_gtar_sparse_1_17_posix01.tgz \
+ test_read_format_gtar_sparse_1_17_posix10.tgz \
+ test_read_format_gtar_sparse_1_17_posix10_modified.tar
+
+# BSD make prefers $> here, GNU make prefers $<; $? works for both.
+test_compat_gtar_1.tgz: libarchive/test/test_compat_gtar_1.tgz.uu
+ cat $? | uudecode
+
+test_compat_tar_hardlink_1.tar: libarchive/test/test_compat_tar_hardlink_1.tar.uu
+ cat $? | uudecode
+
+test_compat_zip_1.zip: libarchive/test/test_compat_zip_1.zip.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_13.tgz: libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17.tgz: libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17_posix00.tgz: libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17_posix01.tgz: libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17_posix10.tgz: libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17_posix10_modified.tar: libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
+ cat $? | uudecode
+
#
#
# bsdtar source, docs, etc.
@@ -249,7 +315,6 @@ bsdtar_LDADD= libarchive.la
bsdtar_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive
bsdtar_LDFLAGS= $(bsdtar_static)
bsdtar_EXTRA_DIST= \
- tar/test \
tar/bsdtar.1
if BUILD_BSDTAR
@@ -260,6 +325,37 @@ bsdtar_man_MANS=
bsdtar_programs=
endif
+#
+# bsdtar_test
+#
+
+bsdtar_test_SOURCES= \
+ tar/getdate.c \
+ tar/test/main.c \
+ tar/test/test.h \
+ tar/test/test_basic.c \
+ tar/test/test_copy.c \
+ tar/test/test_getdate.c \
+ tar/test/test_help.c \
+ tar/test/test_stdio.c \
+ tar/test/test_version.c
+
+bsdtar_test_EXTRA_DIST= \
+ tar/test/old
+
+bsdtar_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_builddir)/tar/test
+
+tar/test/list.h: Makefile
+ cat $(top_srcdir)/tar/test/test_*.c | grep DEFINE_TEST > tar/test/list.h
+
+if BUILD_BSDTAR
+bsdtar_test_programs= bsdtar_test
+bsdtar_TESTS_ENVIRONMENT= BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar BSDTAR_TEST_FILES=`cd $(top_builddir);/bin/pwd`
+else
+bsdtar_test_programs=
+bsdtar_TESTS_ENVIRONMENT=
+endif
+
#
#
@@ -273,7 +369,10 @@ bsdcpio_SOURCES= \
cpio/cpio.h \
cpio/cpio_platform.h \
cpio/err.c \
- cpio/match.c
+ cpio/matching.c \
+ cpio/matching.h \
+ cpio/pathmatch.c \
+ cpio/pathmatch.h
bsdcpio_DEPENDENCIES = libarchive.la \
libarchive/archive_entry.h \
@@ -309,41 +408,88 @@ endif
bsdcpio_test_SOURCES= \
cpio/cmdline.c \
cpio/err.c \
- cpio/match.c \
+ cpio/pathmatch.c \
cpio/test/main.c \
cpio/test/test.h \
cpio/test/test_basic.c \
+ cpio/test/test_format_newc.c \
cpio/test/test_gcpio_compat.c \
- cpio/test/test_help.c \
+ cpio/test/test_option_a.c \
cpio/test/test_option_B.c \
+ cpio/test/test_option_c.c \
cpio/test/test_option_d.c \
+ cpio/test/test_option_f.c \
+ cpio/test/test_option_help.c \
+ cpio/test/test_option_L.c \
+ cpio/test/test_option_ell.c \
cpio/test/test_option_m.c \
cpio/test/test_option_t.c \
+ cpio/test/test_option_u.c \
+ cpio/test/test_option_version.c \
+ cpio/test/test_option_y.c \
+ cpio/test/test_option_z.c \
cpio/test/test_owner_parse.c \
- cpio/test/test_pathmatch.c \
- cpio/test/test_version.c \
- cpio/test/test_write_odc.c
-
-bsdcpio_test_EXTRA_DIST= \
- cpio/test/test_gcpio_compat_ref.bin \
- cpio/test/test_gcpio_compat_ref.crc \
- cpio/test/test_gcpio_compat_ref.newc \
- cpio/test/test_gcpio_compat_ref.ustar \
- cpio/test/test_option_m.cpio \
- cpio/test/test_option_t.cpio \
- cpio/test/test_option_t.stdout \
- cpio/test/test_option_tv.stdout
+ cpio/test/test_pathmatch.c
-bsdcpio_test_CPPFLAGS= -I$(top_builddir)/cpio/test
+bsdcpio_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_builddir)/cpio/test
cpio/test/list.h: Makefile
cat $(top_srcdir)/cpio/test/test_*.c | grep DEFINE_TEST > cpio/test/list.h
if BUILD_BSDCPIO
bsdcpio_test_programs= bsdcpio_test
-bsdcpio_TESTS_ENVIRONMENT= BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test
+bsdcpio_TESTS_ENVIRONMENT= BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio BSDCPIO_TEST_FILES=`cd $(top_builddir);/bin/pwd`
else
bsdcpio_test_programs=
bsdcpio_TESTS_ENVIRONMENT=
endif
+bsdcpio_test_REFFILES=\
+ test_gcpio_compat_ref.bin \
+ test_gcpio_compat_ref.crc \
+ test_gcpio_compat_ref.newc \
+ test_gcpio_compat_ref.ustar \
+ test_option_f.cpio \
+ test_option_m.cpio \
+ test_option_t.cpio \
+ test_option_t.stdout \
+ test_option_tv.stdout
+
+bsdcpio_test_EXTRA_DIST= \
+ cpio/test/test_gcpio_compat_ref.bin.uu \
+ cpio/test/test_gcpio_compat_ref.crc.uu \
+ cpio/test/test_gcpio_compat_ref.newc.uu \
+ cpio/test/test_gcpio_compat_ref.ustar.uu \
+ cpio/test/test_option_f.cpio.uu \
+ cpio/test/test_option_m.cpio.uu \
+ cpio/test/test_option_t.cpio.uu \
+ cpio/test/test_option_t.stdout.uu \
+ cpio/test/test_option_tv.stdout.uu
+
+test_gcpio_compat_ref.bin: cpio/test/test_gcpio_compat_ref.bin.uu
+ cat $? | uudecode
+
+test_gcpio_compat_ref.crc: cpio/test/test_gcpio_compat_ref.crc.uu
+ cat $? | uudecode
+
+test_gcpio_compat_ref.newc: cpio/test/test_gcpio_compat_ref.newc.uu
+ cat $? | uudecode
+
+test_gcpio_compat_ref.ustar: cpio/test/test_gcpio_compat_ref.ustar.uu
+ cat $? | uudecode
+
+test_option_f.cpio: cpio/test/test_option_f.cpio.uu
+ cat $? | uudecode
+
+test_option_m.cpio: cpio/test/test_option_m.cpio.uu
+ cat $? | uudecode
+
+test_option_t.cpio: cpio/test/test_option_t.cpio.uu
+ cat $? | uudecode
+
+test_option_t.stdout: cpio/test/test_option_t.stdout.uu
+ cat $? | uudecode
+
+test_option_tv.stdout: cpio/test/test_option_tv.stdout.uu
+ cat $? | uudecode
+
diff --git a/archivers/libarchive/files/Makefile.in b/archivers/libarchive/files/Makefile.in
index 453debc0a5c..f8ba7aa3a8b 100644
--- a/archivers/libarchive/files/Makefile.in
+++ b/archivers/libarchive/files/Makefile.in
@@ -35,8 +35,9 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
-check_PROGRAMS = libarchive_test$(EXEEXT) $(am__EXEEXT_3)
-TESTS = libarchive_test$(EXEEXT) $(am__EXEEXT_3)
+check_PROGRAMS = libarchive_test$(EXEEXT) $(am__EXEEXT_3) \
+ $(am__EXEEXT_4)
+TESTS = libarchive_test$(EXEEXT) $(am__EXEEXT_3) $(am__EXEEXT_4)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
@@ -128,30 +129,40 @@ libarchive_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@BUILD_BSDTAR_TRUE@am__EXEEXT_1 = bsdtar$(EXEEXT)
@BUILD_BSDCPIO_TRUE@am__EXEEXT_2 = bsdcpio$(EXEEXT)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-@BUILD_BSDCPIO_TRUE@am__EXEEXT_3 = bsdcpio_test$(EXEEXT)
+@BUILD_BSDTAR_TRUE@am__EXEEXT_3 = bsdtar_test$(EXEEXT)
+@BUILD_BSDCPIO_TRUE@am__EXEEXT_4 = bsdcpio_test$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
am_bsdcpio_OBJECTS = cpio/bsdcpio-cmdline.$(OBJEXT) \
cpio/bsdcpio-cpio.$(OBJEXT) cpio/bsdcpio-err.$(OBJEXT) \
- cpio/bsdcpio-match.$(OBJEXT)
+ cpio/bsdcpio-matching.$(OBJEXT) \
+ cpio/bsdcpio-pathmatch.$(OBJEXT)
bsdcpio_OBJECTS = $(am_bsdcpio_OBJECTS)
bsdcpio_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(bsdcpio_LDFLAGS) \
$(LDFLAGS) -o $@
am_bsdcpio_test_OBJECTS = cpio/bsdcpio_test-cmdline.$(OBJEXT) \
cpio/bsdcpio_test-err.$(OBJEXT) \
- cpio/bsdcpio_test-match.$(OBJEXT) \
+ cpio/bsdcpio_test-pathmatch.$(OBJEXT) \
cpio/test/bsdcpio_test-main.$(OBJEXT) \
cpio/test/bsdcpio_test-test_basic.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_format_newc.$(OBJEXT) \
cpio/test/bsdcpio_test-test_gcpio_compat.$(OBJEXT) \
- cpio/test/bsdcpio_test-test_help.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_a.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_B.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_c.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_d.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_f.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_help.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_L.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_ell.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_m.$(OBJEXT) \
cpio/test/bsdcpio_test-test_option_t.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_u.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_version.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_y.$(OBJEXT) \
+ cpio/test/bsdcpio_test-test_option_z.$(OBJEXT) \
cpio/test/bsdcpio_test-test_owner_parse.$(OBJEXT) \
- cpio/test/bsdcpio_test-test_pathmatch.$(OBJEXT) \
- cpio/test/bsdcpio_test-test_version.$(OBJEXT) \
- cpio/test/bsdcpio_test-test_write_odc.$(OBJEXT)
+ cpio/test/bsdcpio_test-test_pathmatch.$(OBJEXT)
bsdcpio_test_OBJECTS = $(am_bsdcpio_test_OBJECTS)
bsdcpio_test_LDADD = $(LDADD)
am_bsdtar_OBJECTS = tar/bsdtar-bsdtar.$(OBJEXT) \
@@ -162,6 +173,16 @@ bsdtar_OBJECTS = $(am_bsdtar_OBJECTS)
bsdtar_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(bsdtar_LDFLAGS) \
$(LDFLAGS) -o $@
+am_bsdtar_test_OBJECTS = tar/bsdtar_test-getdate.$(OBJEXT) \
+ tar/test/bsdtar_test-main.$(OBJEXT) \
+ tar/test/bsdtar_test-test_basic.$(OBJEXT) \
+ tar/test/bsdtar_test-test_copy.$(OBJEXT) \
+ tar/test/bsdtar_test-test_getdate.$(OBJEXT) \
+ tar/test/bsdtar_test-test_help.$(OBJEXT) \
+ tar/test/bsdtar_test-test_stdio.$(OBJEXT) \
+ tar/test/bsdtar_test-test_version.$(OBJEXT)
+bsdtar_test_OBJECTS = $(am_bsdtar_test_OBJECTS)
+bsdtar_test_LDADD = $(LDADD)
am__objects_1 = \
libarchive/libarchive_test-archive_check_magic.$(OBJEXT) \
libarchive/libarchive_test-archive_entry.$(OBJEXT) \
@@ -221,8 +242,14 @@ am_libarchive_test_OBJECTS = $(am__objects_1) \
libarchive/test/libarchive_test-test_acl_pax.$(OBJEXT) \
libarchive/test/libarchive_test-test_archive_api_feature.$(OBJEXT) \
libarchive/test/libarchive_test-test_bad_fd.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_gtar.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_tar_hardlink.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_zip.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_empty_write.$(OBJEXT) \
libarchive/test/libarchive_test-test_entry.$(OBJEXT) \
libarchive/test/libarchive_test-test_entry_strmode.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_link_resolver.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_pax_filename_encoding.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_compress_program.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_data_large.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_extract.$(OBJEXT) \
@@ -254,6 +281,7 @@ am_libarchive_test_OBJECTS = $(am__objects_1) \
libarchive/test/libarchive_test-test_tar_large.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_compress_program.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_disk_hardlink.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_perms.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_secure.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_format_ar.$(OBJEXT) \
@@ -285,10 +313,10 @@ LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
YLWRAP = $(top_srcdir)/config.aux/ylwrap
SOURCES = $(libarchive_la_SOURCES) $(bsdcpio_SOURCES) \
$(bsdcpio_test_SOURCES) $(bsdtar_SOURCES) \
- $(libarchive_test_SOURCES)
+ $(bsdtar_test_SOURCES) $(libarchive_test_SOURCES)
DIST_SOURCES = $(libarchive_la_SOURCES) $(bsdcpio_SOURCES) \
$(bsdcpio_test_SOURCES) $(bsdtar_SOURCES) \
- $(libarchive_test_SOURCES)
+ $(bsdtar_test_SOURCES) $(libarchive_test_SOURCES)
man1dir = $(mandir)/man1
man3dir = $(mandir)/man3
man5dir = $(mandir)/man5
@@ -430,10 +458,10 @@ AUTOMAKE_OPTIONS = foreign subdir-objects
#
lib_LTLIBRARIES = libarchive.la
man_MANS = $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS)
-BUILT_SOURCES = libarchive/test/list.h cpio/test/list.h
-TESTS_ENVIRONMENT = $(bsdcpio_TESTS_ENVIRONMENT)
-# Always build and test bsdcpio as part of 'distcheck'
-DISTCHECK_CONFIGURE_FLAGS = --enable-bsdcpio
+BUILT_SOURCES = libarchive/test/list.h tar/test/list.h cpio/test/list.h $(libarchive_test_REFFILES) $(bsdcpio_test_REFFILES)
+TESTS_ENVIRONMENT = $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT)
+# Always build and test both bsdtar and bsdcpio as part of 'distcheck'
+DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio
#
# What to include in the distribution
@@ -441,13 +469,26 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-bsdcpio
EXTRA_DIST = version \
contrib \
examples \
+ doc \
$(libarchive_EXTRA_DIST) \
+ $(libarchive_test_EXTRA_DIST) \
$(bsdtar_EXTRA_DIST) \
+ $(bsdtar_test_EXTRA_DIST) \
$(bsdcpio_EXTRA_DIST) \
$(bsdcpio_test_EXTRA_DIST)
#
+# Extra rules for cleanup
+#
+CLEANFILES = $(libarchive_test_REFFILES) $(bsdcpio_test_REFFILES)
+DISTCLEANFILES = tar/getdate.c tar/getdate.h \
+ libarchive/test/list.h \
+ tar/test/list.h \
+ cpio/test/list.h
+
+
+#
# Libarchive headers, source, etc.
#
#
@@ -457,6 +498,7 @@ include_HEADERS = libarchive/archive_entry.h
nodist_include_HEADERS = libarchive/archive.h
libarchive_la_SOURCES = \
libarchive/archive_check_magic.c \
+ libarchive/archive_endian.h \
libarchive/archive_entry.c \
libarchive/archive_entry.h \
libarchive/archive_entry_copy_stat.c \
@@ -559,8 +601,14 @@ libarchive_test_SOURCES = \
libarchive/test/test_acl_pax.c \
libarchive/test/test_archive_api_feature.c \
libarchive/test/test_bad_fd.c \
+ libarchive/test/test_compat_gtar.c \
+ libarchive/test/test_compat_tar_hardlink.c \
+ libarchive/test/test_compat_zip.c \
+ libarchive/test/test_empty_write.c \
libarchive/test/test_entry.c \
libarchive/test/test_entry_strmode.c \
+ libarchive/test/test_link_resolver.c \
+ libarchive/test/test_pax_filename_encoding.c \
libarchive/test/test_read_compress_program.c \
libarchive/test/test_read_data_large.c \
libarchive/test/test_read_extract.c \
@@ -592,6 +640,7 @@ libarchive_test_SOURCES = \
libarchive/test/test_tar_large.c \
libarchive/test/test_write_compress_program.c \
libarchive/test/test_write_disk.c \
+ libarchive/test/test_write_disk_hardlink.c \
libarchive/test/test_write_disk_perms.c \
libarchive/test/test_write_disk_secure.c \
libarchive/test/test_write_format_ar.c \
@@ -605,6 +654,29 @@ libarchive_test_SOURCES = \
libarchive/test/test_write_open_memory.c
libarchive_test_CPPFLAGS = -I$(top_builddir)/libarchive -I$(top_builddir)/libarchive/test
+libarchive_TESTS_ENVIRONMENT = LIBARCHIVE_TEST_FILES=`cd $(top_builddir);/bin/pwd`
+libarchive_test_EXTRA_DIST = \
+ libarchive/test/test_compat_gtar_1.tgz.uu \
+ libarchive/test/test_compat_tar_hardlink_1.tar.uu \
+ libarchive/test/test_compat_zip_1.zip.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu \
+ libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
+
+libarchive_test_REFFILES = \
+ test_compat_gtar_1.tgz \
+ test_compat_tar_hardlink_1.tar \
+ test_compat_zip_1.zip \
+ test_read_format_gtar_sparse_1_13.tgz \
+ test_read_format_gtar_sparse_1_17.tgz \
+ test_read_format_gtar_sparse_1_17_posix00.tgz \
+ test_read_format_gtar_sparse_1_17_posix01.tgz \
+ test_read_format_gtar_sparse_1_17_posix10.tgz \
+ test_read_format_gtar_sparse_1_17_posix10_modified.tar
+
#
#
@@ -633,7 +705,6 @@ bsdtar_LDADD = libarchive.la
bsdtar_CPPFLAGS = -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive
bsdtar_LDFLAGS = $(bsdtar_static)
bsdtar_EXTRA_DIST = \
- tar/test \
tar/bsdtar.1
@BUILD_BSDTAR_FALSE@bsdtar_man_MANS =
@@ -642,6 +713,29 @@ bsdtar_EXTRA_DIST = \
@BUILD_BSDTAR_TRUE@bsdtar_programs = bsdtar
#
+# bsdtar_test
+#
+bsdtar_test_SOURCES = \
+ tar/getdate.c \
+ tar/test/main.c \
+ tar/test/test.h \
+ tar/test/test_basic.c \
+ tar/test/test_copy.c \
+ tar/test/test_getdate.c \
+ tar/test/test_help.c \
+ tar/test/test_stdio.c \
+ tar/test/test_version.c
+
+bsdtar_test_EXTRA_DIST = \
+ tar/test/old
+
+bsdtar_test_CPPFLAGS = -I$(top_srcdir)/libarchive -I$(top_builddir)/tar/test
+@BUILD_BSDTAR_FALSE@bsdtar_test_programs =
+@BUILD_BSDTAR_TRUE@bsdtar_test_programs = bsdtar_test
+@BUILD_BSDTAR_FALSE@bsdtar_TESTS_ENVIRONMENT =
+@BUILD_BSDTAR_TRUE@bsdtar_TESTS_ENVIRONMENT = BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar BSDTAR_TEST_FILES=`cd $(top_builddir);/bin/pwd`
+
+#
#
# bsdcpio source, docs, etc.
#
@@ -652,7 +746,10 @@ bsdcpio_SOURCES = \
cpio/cpio.h \
cpio/cpio_platform.h \
cpio/err.c \
- cpio/match.c
+ cpio/matching.c \
+ cpio/matching.h \
+ cpio/pathmatch.c \
+ cpio/pathmatch.h
bsdcpio_DEPENDENCIES = libarchive.la \
libarchive/archive_entry.h \
@@ -680,36 +777,56 @@ bsdcpio_EXTRA_DIST = \
bsdcpio_test_SOURCES = \
cpio/cmdline.c \
cpio/err.c \
- cpio/match.c \
+ cpio/pathmatch.c \
cpio/test/main.c \
cpio/test/test.h \
cpio/test/test_basic.c \
+ cpio/test/test_format_newc.c \
cpio/test/test_gcpio_compat.c \
- cpio/test/test_help.c \
+ cpio/test/test_option_a.c \
cpio/test/test_option_B.c \
+ cpio/test/test_option_c.c \
cpio/test/test_option_d.c \
+ cpio/test/test_option_f.c \
+ cpio/test/test_option_help.c \
+ cpio/test/test_option_L.c \
+ cpio/test/test_option_ell.c \
cpio/test/test_option_m.c \
cpio/test/test_option_t.c \
+ cpio/test/test_option_u.c \
+ cpio/test/test_option_version.c \
+ cpio/test/test_option_y.c \
+ cpio/test/test_option_z.c \
cpio/test/test_owner_parse.c \
- cpio/test/test_pathmatch.c \
- cpio/test/test_version.c \
- cpio/test/test_write_odc.c
+ cpio/test/test_pathmatch.c
-bsdcpio_test_EXTRA_DIST = \
- cpio/test/test_gcpio_compat_ref.bin \
- cpio/test/test_gcpio_compat_ref.crc \
- cpio/test/test_gcpio_compat_ref.newc \
- cpio/test/test_gcpio_compat_ref.ustar \
- cpio/test/test_option_m.cpio \
- cpio/test/test_option_t.cpio \
- cpio/test/test_option_t.stdout \
- cpio/test/test_option_tv.stdout
-
-bsdcpio_test_CPPFLAGS = -I$(top_builddir)/cpio/test
+bsdcpio_test_CPPFLAGS = -I$(top_srcdir)/libarchive -I$(top_builddir)/cpio/test
@BUILD_BSDCPIO_FALSE@bsdcpio_test_programs =
@BUILD_BSDCPIO_TRUE@bsdcpio_test_programs = bsdcpio_test
@BUILD_BSDCPIO_FALSE@bsdcpio_TESTS_ENVIRONMENT =
-@BUILD_BSDCPIO_TRUE@bsdcpio_TESTS_ENVIRONMENT = BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test
+@BUILD_BSDCPIO_TRUE@bsdcpio_TESTS_ENVIRONMENT = BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio BSDCPIO_TEST_FILES=`cd $(top_builddir);/bin/pwd`
+bsdcpio_test_REFFILES = \
+ test_gcpio_compat_ref.bin \
+ test_gcpio_compat_ref.crc \
+ test_gcpio_compat_ref.newc \
+ test_gcpio_compat_ref.ustar \
+ test_option_f.cpio \
+ test_option_m.cpio \
+ test_option_t.cpio \
+ test_option_t.stdout \
+ test_option_tv.stdout
+
+bsdcpio_test_EXTRA_DIST = \
+ cpio/test/test_gcpio_compat_ref.bin.uu \
+ cpio/test/test_gcpio_compat_ref.crc.uu \
+ cpio/test/test_gcpio_compat_ref.newc.uu \
+ cpio/test/test_gcpio_compat_ref.ustar.uu \
+ cpio/test/test_option_f.cpio.uu \
+ cpio/test/test_option_m.cpio.uu \
+ cpio/test/test_option_t.cpio.uu \
+ cpio/test/test_option_t.stdout.uu \
+ cpio/test/test_option_tv.stdout.uu
+
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -997,7 +1114,9 @@ cpio/bsdcpio-cpio.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
cpio/bsdcpio-err.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
-cpio/bsdcpio-match.$(OBJEXT): cpio/$(am__dirstamp) \
+cpio/bsdcpio-matching.$(OBJEXT): cpio/$(am__dirstamp) \
+ cpio/$(DEPDIR)/$(am__dirstamp)
+cpio/bsdcpio-pathmatch.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
bsdcpio$(EXEEXT): $(bsdcpio_OBJECTS) $(bsdcpio_DEPENDENCIES)
@rm -f bsdcpio$(EXEEXT)
@@ -1006,7 +1125,7 @@ cpio/bsdcpio_test-cmdline.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
cpio/bsdcpio_test-err.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
-cpio/bsdcpio_test-match.$(OBJEXT): cpio/$(am__dirstamp) \
+cpio/bsdcpio_test-pathmatch.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
cpio/test/$(am__dirstamp):
@$(MKDIR_P) cpio/test
@@ -1018,25 +1137,41 @@ cpio/test/bsdcpio_test-main.$(OBJEXT): cpio/test/$(am__dirstamp) \
cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_basic.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_format_newc.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_gcpio_compat.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-test_help.$(OBJEXT): cpio/test/$(am__dirstamp) \
- cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_a.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_option_B.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_c.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_option_d.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_f.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_help.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_L.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_ell.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_option_m.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_option_t.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-test_owner_parse.$(OBJEXT): \
+cpio/test/bsdcpio_test-test_option_u.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-test_pathmatch.$(OBJEXT): \
+cpio/test/bsdcpio_test-test_option_version.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_y.$(OBJEXT): \
+ cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
+cpio/test/bsdcpio_test-test_option_z.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-test_version.$(OBJEXT): \
+cpio/test/bsdcpio_test-test_owner_parse.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-test_write_odc.$(OBJEXT): \
+cpio/test/bsdcpio_test-test_pathmatch.$(OBJEXT): \
cpio/test/$(am__dirstamp) cpio/test/$(DEPDIR)/$(am__dirstamp)
bsdcpio_test$(EXEEXT): $(bsdcpio_test_OBJECTS) $(bsdcpio_test_DEPENDENCIES)
@rm -f bsdcpio_test$(EXEEXT)
@@ -1064,6 +1199,31 @@ tar/bsdtar-write.$(OBJEXT): tar/$(am__dirstamp) \
bsdtar$(EXEEXT): $(bsdtar_OBJECTS) $(bsdtar_DEPENDENCIES)
@rm -f bsdtar$(EXEEXT)
$(bsdtar_LINK) $(bsdtar_OBJECTS) $(bsdtar_LDADD) $(LIBS)
+tar/bsdtar_test-getdate.$(OBJEXT): tar/$(am__dirstamp) \
+ tar/$(DEPDIR)/$(am__dirstamp)
+tar/test/$(am__dirstamp):
+ @$(MKDIR_P) tar/test
+ @: > tar/test/$(am__dirstamp)
+tar/test/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) tar/test/$(DEPDIR)
+ @: > tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-main.$(OBJEXT): tar/test/$(am__dirstamp) \
+ tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_basic.$(OBJEXT): tar/test/$(am__dirstamp) \
+ tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_copy.$(OBJEXT): tar/test/$(am__dirstamp) \
+ tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_getdate.$(OBJEXT): tar/test/$(am__dirstamp) \
+ tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_help.$(OBJEXT): tar/test/$(am__dirstamp) \
+ tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_stdio.$(OBJEXT): tar/test/$(am__dirstamp) \
+ tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_version.$(OBJEXT): tar/test/$(am__dirstamp) \
+ tar/test/$(DEPDIR)/$(am__dirstamp)
+bsdtar_test$(EXEEXT): $(bsdtar_test_OBJECTS) $(bsdtar_test_DEPENDENCIES)
+ @rm -f bsdtar_test$(EXEEXT)
+ $(LINK) $(bsdtar_test_OBJECTS) $(bsdtar_test_LDADD) $(LIBS)
libarchive/libarchive_test-archive_check_magic.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -1241,12 +1401,30 @@ libarchive/test/libarchive_test-test_archive_api_feature.$(OBJEXT): \
libarchive/test/libarchive_test-test_bad_fd.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_gtar.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_tar_hardlink.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_zip.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_empty_write.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_entry.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_entry_strmode.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_link_resolver.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_pax_filename_encoding.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_compress_program.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1340,6 +1518,9 @@ libarchive/test/libarchive_test-test_write_compress_program.$(OBJEXT): \
libarchive/test/libarchive_test-test_write_disk.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_disk_hardlink.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_write_disk_perms.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -1382,22 +1563,31 @@ mostlyclean-compile:
-rm -f cpio/bsdcpio-cmdline.$(OBJEXT)
-rm -f cpio/bsdcpio-cpio.$(OBJEXT)
-rm -f cpio/bsdcpio-err.$(OBJEXT)
- -rm -f cpio/bsdcpio-match.$(OBJEXT)
+ -rm -f cpio/bsdcpio-matching.$(OBJEXT)
+ -rm -f cpio/bsdcpio-pathmatch.$(OBJEXT)
-rm -f cpio/bsdcpio_test-cmdline.$(OBJEXT)
-rm -f cpio/bsdcpio_test-err.$(OBJEXT)
- -rm -f cpio/bsdcpio_test-match.$(OBJEXT)
+ -rm -f cpio/bsdcpio_test-pathmatch.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-main.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_basic.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_format_newc.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_gcpio_compat.$(OBJEXT)
- -rm -f cpio/test/bsdcpio_test-test_help.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_B.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_L.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_a.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_c.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_d.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_ell.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_f.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_help.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_m.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_option_t.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_u.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_version.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_y.$(OBJEXT)
+ -rm -f cpio/test/bsdcpio_test-test_option_z.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_owner_parse.$(OBJEXT)
-rm -f cpio/test/bsdcpio_test-test_pathmatch.$(OBJEXT)
- -rm -f cpio/test/bsdcpio_test-test_version.$(OBJEXT)
- -rm -f cpio/test/bsdcpio_test-test_write_odc.$(OBJEXT)
-rm -f libarchive/libarchive_la-archive_check_magic.$(OBJEXT)
-rm -f libarchive/libarchive_la-archive_check_magic.lo
-rm -f libarchive/libarchive_la-archive_entry.$(OBJEXT)
@@ -1557,8 +1747,14 @@ mostlyclean-compile:
-rm -f libarchive/test/libarchive_test-test_acl_pax.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_archive_api_feature.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_bad_fd.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_compat_gtar.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_compat_tar_hardlink.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_compat_zip.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_empty_write.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_entry.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_entry_strmode.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_link_resolver.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_pax_filename_encoding.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_compress_program.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_data_large.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_read_extract.$(OBJEXT)
@@ -1590,6 +1786,7 @@ mostlyclean-compile:
-rm -f libarchive/test/libarchive_test-test_tar_large.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_compress_program.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_disk.$(OBJEXT)
+ -rm -f libarchive/test/libarchive_test-test_write_disk_hardlink.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_disk_perms.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_disk_secure.$(OBJEXT)
-rm -f libarchive/test/libarchive_test-test_write_format_ar.$(OBJEXT)
@@ -1608,6 +1805,14 @@ mostlyclean-compile:
-rm -f tar/bsdtar-tree.$(OBJEXT)
-rm -f tar/bsdtar-util.$(OBJEXT)
-rm -f tar/bsdtar-write.$(OBJEXT)
+ -rm -f tar/bsdtar_test-getdate.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-main.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_basic.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_copy.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_getdate.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_help.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_stdio.$(OBJEXT)
+ -rm -f tar/test/bsdtar_test-test_version.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@@ -1615,22 +1820,31 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-cmdline.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-cpio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-err.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-match.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-matching.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-pathmatch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio_test-cmdline.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio_test-err.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio_test-match.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_basic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_gcpio_compat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_help.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_d.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_f.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_help.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_m.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_t.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_u.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_y.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_option_z.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_owner_parse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_pathmatch.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_version.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_write_odc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_check_magic.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_entry.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_entry_copy_stat.Plo@am__quote@
@@ -1739,8 +1953,14 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_acl_pax.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_archive_api_feature.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_bad_fd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_empty_write.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_entry.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_entry_strmode.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_link_resolver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_compress_program.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_data_large.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_extract.Po@am__quote@
@@ -1772,6 +1992,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_tar_large.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_program.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_perms.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_ar.Po@am__quote@
@@ -1790,6 +2011,14 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-tree.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-write.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar_test-getdate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_basic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_copy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_help.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_stdio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_version.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -2214,19 +2443,33 @@ cpio/bsdcpio-err.obj: cpio/err.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-err.obj `if test -f 'cpio/err.c'; then $(CYGPATH_W) 'cpio/err.c'; else $(CYGPATH_W) '$(srcdir)/cpio/err.c'; fi`
-cpio/bsdcpio-match.o: cpio/match.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-match.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-match.Tpo -c -o cpio/bsdcpio-match.o `test -f 'cpio/match.c' || echo '$(srcdir)/'`cpio/match.c
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-match.Tpo cpio/$(DEPDIR)/bsdcpio-match.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/match.c' object='cpio/bsdcpio-match.o' libtool=no @AMDEPBACKSLASH@
+cpio/bsdcpio-matching.o: cpio/matching.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-matching.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-matching.Tpo -c -o cpio/bsdcpio-matching.o `test -f 'cpio/matching.c' || echo '$(srcdir)/'`cpio/matching.c
+@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-matching.Tpo cpio/$(DEPDIR)/bsdcpio-matching.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/matching.c' object='cpio/bsdcpio-matching.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-matching.o `test -f 'cpio/matching.c' || echo '$(srcdir)/'`cpio/matching.c
+
+cpio/bsdcpio-matching.obj: cpio/matching.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-matching.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-matching.Tpo -c -o cpio/bsdcpio-matching.obj `if test -f 'cpio/matching.c'; then $(CYGPATH_W) 'cpio/matching.c'; else $(CYGPATH_W) '$(srcdir)/cpio/matching.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-matching.Tpo cpio/$(DEPDIR)/bsdcpio-matching.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/matching.c' object='cpio/bsdcpio-matching.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-match.o `test -f 'cpio/match.c' || echo '$(srcdir)/'`cpio/match.c
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-matching.obj `if test -f 'cpio/matching.c'; then $(CYGPATH_W) 'cpio/matching.c'; else $(CYGPATH_W) '$(srcdir)/cpio/matching.c'; fi`
-cpio/bsdcpio-match.obj: cpio/match.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-match.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-match.Tpo -c -o cpio/bsdcpio-match.obj `if test -f 'cpio/match.c'; then $(CYGPATH_W) 'cpio/match.c'; else $(CYGPATH_W) '$(srcdir)/cpio/match.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-match.Tpo cpio/$(DEPDIR)/bsdcpio-match.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/match.c' object='cpio/bsdcpio-match.obj' libtool=no @AMDEPBACKSLASH@
+cpio/bsdcpio-pathmatch.o: cpio/pathmatch.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-pathmatch.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-pathmatch.Tpo -c -o cpio/bsdcpio-pathmatch.o `test -f 'cpio/pathmatch.c' || echo '$(srcdir)/'`cpio/pathmatch.c
+@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-pathmatch.Tpo cpio/$(DEPDIR)/bsdcpio-pathmatch.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/pathmatch.c' object='cpio/bsdcpio-pathmatch.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-match.obj `if test -f 'cpio/match.c'; then $(CYGPATH_W) 'cpio/match.c'; else $(CYGPATH_W) '$(srcdir)/cpio/match.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-pathmatch.o `test -f 'cpio/pathmatch.c' || echo '$(srcdir)/'`cpio/pathmatch.c
+
+cpio/bsdcpio-pathmatch.obj: cpio/pathmatch.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-pathmatch.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-pathmatch.Tpo -c -o cpio/bsdcpio-pathmatch.obj `if test -f 'cpio/pathmatch.c'; then $(CYGPATH_W) 'cpio/pathmatch.c'; else $(CYGPATH_W) '$(srcdir)/cpio/pathmatch.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-pathmatch.Tpo cpio/$(DEPDIR)/bsdcpio-pathmatch.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/pathmatch.c' object='cpio/bsdcpio-pathmatch.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio-pathmatch.obj `if test -f 'cpio/pathmatch.c'; then $(CYGPATH_W) 'cpio/pathmatch.c'; else $(CYGPATH_W) '$(srcdir)/cpio/pathmatch.c'; fi`
cpio/bsdcpio_test-cmdline.o: cpio/cmdline.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-cmdline.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-cmdline.Tpo -c -o cpio/bsdcpio_test-cmdline.o `test -f 'cpio/cmdline.c' || echo '$(srcdir)/'`cpio/cmdline.c
@@ -2256,19 +2499,19 @@ cpio/bsdcpio_test-err.obj: cpio/err.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-err.obj `if test -f 'cpio/err.c'; then $(CYGPATH_W) 'cpio/err.c'; else $(CYGPATH_W) '$(srcdir)/cpio/err.c'; fi`
-cpio/bsdcpio_test-match.o: cpio/match.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-match.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-match.Tpo -c -o cpio/bsdcpio_test-match.o `test -f 'cpio/match.c' || echo '$(srcdir)/'`cpio/match.c
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio_test-match.Tpo cpio/$(DEPDIR)/bsdcpio_test-match.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/match.c' object='cpio/bsdcpio_test-match.o' libtool=no @AMDEPBACKSLASH@
+cpio/bsdcpio_test-pathmatch.o: cpio/pathmatch.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-pathmatch.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Tpo -c -o cpio/bsdcpio_test-pathmatch.o `test -f 'cpio/pathmatch.c' || echo '$(srcdir)/'`cpio/pathmatch.c
+@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Tpo cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/pathmatch.c' object='cpio/bsdcpio_test-pathmatch.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-match.o `test -f 'cpio/match.c' || echo '$(srcdir)/'`cpio/match.c
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-pathmatch.o `test -f 'cpio/pathmatch.c' || echo '$(srcdir)/'`cpio/pathmatch.c
-cpio/bsdcpio_test-match.obj: cpio/match.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-match.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-match.Tpo -c -o cpio/bsdcpio_test-match.obj `if test -f 'cpio/match.c'; then $(CYGPATH_W) 'cpio/match.c'; else $(CYGPATH_W) '$(srcdir)/cpio/match.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio_test-match.Tpo cpio/$(DEPDIR)/bsdcpio_test-match.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/match.c' object='cpio/bsdcpio_test-match.obj' libtool=no @AMDEPBACKSLASH@
+cpio/bsdcpio_test-pathmatch.obj: cpio/pathmatch.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-pathmatch.obj -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Tpo -c -o cpio/bsdcpio_test-pathmatch.obj `if test -f 'cpio/pathmatch.c'; then $(CYGPATH_W) 'cpio/pathmatch.c'; else $(CYGPATH_W) '$(srcdir)/cpio/pathmatch.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Tpo cpio/$(DEPDIR)/bsdcpio_test-pathmatch.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/pathmatch.c' object='cpio/bsdcpio_test-pathmatch.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-match.obj `if test -f 'cpio/match.c'; then $(CYGPATH_W) 'cpio/match.c'; else $(CYGPATH_W) '$(srcdir)/cpio/match.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-pathmatch.obj `if test -f 'cpio/pathmatch.c'; then $(CYGPATH_W) 'cpio/pathmatch.c'; else $(CYGPATH_W) '$(srcdir)/cpio/pathmatch.c'; fi`
cpio/test/bsdcpio_test-main.o: cpio/test/main.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-main.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo -c -o cpio/test/bsdcpio_test-main.o `test -f 'cpio/test/main.c' || echo '$(srcdir)/'`cpio/test/main.c
@@ -2298,6 +2541,20 @@ cpio/test/bsdcpio_test-test_basic.obj: cpio/test/test_basic.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_basic.obj `if test -f 'cpio/test/test_basic.c'; then $(CYGPATH_W) 'cpio/test/test_basic.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_basic.c'; fi`
+cpio/test/bsdcpio_test-test_format_newc.o: cpio/test/test_format_newc.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_format_newc.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Tpo -c -o cpio/test/bsdcpio_test-test_format_newc.o `test -f 'cpio/test/test_format_newc.c' || echo '$(srcdir)/'`cpio/test/test_format_newc.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_format_newc.c' object='cpio/test/bsdcpio_test-test_format_newc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_format_newc.o `test -f 'cpio/test/test_format_newc.c' || echo '$(srcdir)/'`cpio/test/test_format_newc.c
+
+cpio/test/bsdcpio_test-test_format_newc.obj: cpio/test/test_format_newc.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_format_newc.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Tpo -c -o cpio/test/bsdcpio_test-test_format_newc.obj `if test -f 'cpio/test/test_format_newc.c'; then $(CYGPATH_W) 'cpio/test/test_format_newc.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_format_newc.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_format_newc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_format_newc.c' object='cpio/test/bsdcpio_test-test_format_newc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_format_newc.obj `if test -f 'cpio/test/test_format_newc.c'; then $(CYGPATH_W) 'cpio/test/test_format_newc.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_format_newc.c'; fi`
+
cpio/test/bsdcpio_test-test_gcpio_compat.o: cpio/test/test_gcpio_compat.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_gcpio_compat.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_gcpio_compat.Tpo -c -o cpio/test/bsdcpio_test-test_gcpio_compat.o `test -f 'cpio/test/test_gcpio_compat.c' || echo '$(srcdir)/'`cpio/test/test_gcpio_compat.c
@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_gcpio_compat.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_gcpio_compat.Po
@@ -2312,19 +2569,19 @@ cpio/test/bsdcpio_test-test_gcpio_compat.obj: cpio/test/test_gcpio_compat.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_gcpio_compat.obj `if test -f 'cpio/test/test_gcpio_compat.c'; then $(CYGPATH_W) 'cpio/test/test_gcpio_compat.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_gcpio_compat.c'; fi`
-cpio/test/bsdcpio_test-test_help.o: cpio/test/test_help.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_help.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_help.Tpo -c -o cpio/test/bsdcpio_test-test_help.o `test -f 'cpio/test/test_help.c' || echo '$(srcdir)/'`cpio/test/test_help.c
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_help.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_help.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_help.c' object='cpio/test/bsdcpio_test-test_help.o' libtool=no @AMDEPBACKSLASH@
+cpio/test/bsdcpio_test-test_option_a.o: cpio/test/test_option_a.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_a.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Tpo -c -o cpio/test/bsdcpio_test-test_option_a.o `test -f 'cpio/test/test_option_a.c' || echo '$(srcdir)/'`cpio/test/test_option_a.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_a.c' object='cpio/test/bsdcpio_test-test_option_a.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_help.o `test -f 'cpio/test/test_help.c' || echo '$(srcdir)/'`cpio/test/test_help.c
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_a.o `test -f 'cpio/test/test_option_a.c' || echo '$(srcdir)/'`cpio/test/test_option_a.c
-cpio/test/bsdcpio_test-test_help.obj: cpio/test/test_help.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_help.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_help.Tpo -c -o cpio/test/bsdcpio_test-test_help.obj `if test -f 'cpio/test/test_help.c'; then $(CYGPATH_W) 'cpio/test/test_help.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_help.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_help.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_help.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_help.c' object='cpio/test/bsdcpio_test-test_help.obj' libtool=no @AMDEPBACKSLASH@
+cpio/test/bsdcpio_test-test_option_a.obj: cpio/test/test_option_a.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_a.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Tpo -c -o cpio/test/bsdcpio_test-test_option_a.obj `if test -f 'cpio/test/test_option_a.c'; then $(CYGPATH_W) 'cpio/test/test_option_a.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_a.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_a.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_a.c' object='cpio/test/bsdcpio_test-test_option_a.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_help.obj `if test -f 'cpio/test/test_help.c'; then $(CYGPATH_W) 'cpio/test/test_help.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_help.c'; fi`
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_a.obj `if test -f 'cpio/test/test_option_a.c'; then $(CYGPATH_W) 'cpio/test/test_option_a.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_a.c'; fi`
cpio/test/bsdcpio_test-test_option_B.o: cpio/test/test_option_B.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_B.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_B.Tpo -c -o cpio/test/bsdcpio_test-test_option_B.o `test -f 'cpio/test/test_option_B.c' || echo '$(srcdir)/'`cpio/test/test_option_B.c
@@ -2340,6 +2597,20 @@ cpio/test/bsdcpio_test-test_option_B.obj: cpio/test/test_option_B.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_B.obj `if test -f 'cpio/test/test_option_B.c'; then $(CYGPATH_W) 'cpio/test/test_option_B.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_B.c'; fi`
+cpio/test/bsdcpio_test-test_option_c.o: cpio/test/test_option_c.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_c.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Tpo -c -o cpio/test/bsdcpio_test-test_option_c.o `test -f 'cpio/test/test_option_c.c' || echo '$(srcdir)/'`cpio/test/test_option_c.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_c.c' object='cpio/test/bsdcpio_test-test_option_c.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_c.o `test -f 'cpio/test/test_option_c.c' || echo '$(srcdir)/'`cpio/test/test_option_c.c
+
+cpio/test/bsdcpio_test-test_option_c.obj: cpio/test/test_option_c.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_c.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Tpo -c -o cpio/test/bsdcpio_test-test_option_c.obj `if test -f 'cpio/test/test_option_c.c'; then $(CYGPATH_W) 'cpio/test/test_option_c.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_c.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_c.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_c.c' object='cpio/test/bsdcpio_test-test_option_c.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_c.obj `if test -f 'cpio/test/test_option_c.c'; then $(CYGPATH_W) 'cpio/test/test_option_c.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_c.c'; fi`
+
cpio/test/bsdcpio_test-test_option_d.o: cpio/test/test_option_d.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_d.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_d.Tpo -c -o cpio/test/bsdcpio_test-test_option_d.o `test -f 'cpio/test/test_option_d.c' || echo '$(srcdir)/'`cpio/test/test_option_d.c
@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_d.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_d.Po
@@ -2354,6 +2625,62 @@ cpio/test/bsdcpio_test-test_option_d.obj: cpio/test/test_option_d.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_d.obj `if test -f 'cpio/test/test_option_d.c'; then $(CYGPATH_W) 'cpio/test/test_option_d.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_d.c'; fi`
+cpio/test/bsdcpio_test-test_option_f.o: cpio/test/test_option_f.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_f.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_f.Tpo -c -o cpio/test/bsdcpio_test-test_option_f.o `test -f 'cpio/test/test_option_f.c' || echo '$(srcdir)/'`cpio/test/test_option_f.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_f.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_f.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_f.c' object='cpio/test/bsdcpio_test-test_option_f.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_f.o `test -f 'cpio/test/test_option_f.c' || echo '$(srcdir)/'`cpio/test/test_option_f.c
+
+cpio/test/bsdcpio_test-test_option_f.obj: cpio/test/test_option_f.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_f.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_f.Tpo -c -o cpio/test/bsdcpio_test-test_option_f.obj `if test -f 'cpio/test/test_option_f.c'; then $(CYGPATH_W) 'cpio/test/test_option_f.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_f.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_f.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_f.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_f.c' object='cpio/test/bsdcpio_test-test_option_f.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_f.obj `if test -f 'cpio/test/test_option_f.c'; then $(CYGPATH_W) 'cpio/test/test_option_f.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_f.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_help.o: cpio/test/test_option_help.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_help.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_help.Tpo -c -o cpio/test/bsdcpio_test-test_option_help.o `test -f 'cpio/test/test_option_help.c' || echo '$(srcdir)/'`cpio/test/test_option_help.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_help.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_help.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_help.c' object='cpio/test/bsdcpio_test-test_option_help.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_help.o `test -f 'cpio/test/test_option_help.c' || echo '$(srcdir)/'`cpio/test/test_option_help.c
+
+cpio/test/bsdcpio_test-test_option_help.obj: cpio/test/test_option_help.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_help.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_help.Tpo -c -o cpio/test/bsdcpio_test-test_option_help.obj `if test -f 'cpio/test/test_option_help.c'; then $(CYGPATH_W) 'cpio/test/test_option_help.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_help.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_help.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_help.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_help.c' object='cpio/test/bsdcpio_test-test_option_help.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_help.obj `if test -f 'cpio/test/test_option_help.c'; then $(CYGPATH_W) 'cpio/test/test_option_help.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_help.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_L.o: cpio/test/test_option_L.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_L.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Tpo -c -o cpio/test/bsdcpio_test-test_option_L.o `test -f 'cpio/test/test_option_L.c' || echo '$(srcdir)/'`cpio/test/test_option_L.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_L.c' object='cpio/test/bsdcpio_test-test_option_L.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_L.o `test -f 'cpio/test/test_option_L.c' || echo '$(srcdir)/'`cpio/test/test_option_L.c
+
+cpio/test/bsdcpio_test-test_option_L.obj: cpio/test/test_option_L.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_L.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Tpo -c -o cpio/test/bsdcpio_test-test_option_L.obj `if test -f 'cpio/test/test_option_L.c'; then $(CYGPATH_W) 'cpio/test/test_option_L.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_L.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_L.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_L.c' object='cpio/test/bsdcpio_test-test_option_L.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_L.obj `if test -f 'cpio/test/test_option_L.c'; then $(CYGPATH_W) 'cpio/test/test_option_L.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_L.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_ell.o: cpio/test/test_option_ell.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_ell.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Tpo -c -o cpio/test/bsdcpio_test-test_option_ell.o `test -f 'cpio/test/test_option_ell.c' || echo '$(srcdir)/'`cpio/test/test_option_ell.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_ell.c' object='cpio/test/bsdcpio_test-test_option_ell.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_ell.o `test -f 'cpio/test/test_option_ell.c' || echo '$(srcdir)/'`cpio/test/test_option_ell.c
+
+cpio/test/bsdcpio_test-test_option_ell.obj: cpio/test/test_option_ell.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_ell.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Tpo -c -o cpio/test/bsdcpio_test-test_option_ell.obj `if test -f 'cpio/test/test_option_ell.c'; then $(CYGPATH_W) 'cpio/test/test_option_ell.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_ell.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_ell.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_ell.c' object='cpio/test/bsdcpio_test-test_option_ell.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_ell.obj `if test -f 'cpio/test/test_option_ell.c'; then $(CYGPATH_W) 'cpio/test/test_option_ell.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_ell.c'; fi`
+
cpio/test/bsdcpio_test-test_option_m.o: cpio/test/test_option_m.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_m.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_m.Tpo -c -o cpio/test/bsdcpio_test-test_option_m.o `test -f 'cpio/test/test_option_m.c' || echo '$(srcdir)/'`cpio/test/test_option_m.c
@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_m.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_m.Po
@@ -2382,6 +2709,62 @@ cpio/test/bsdcpio_test-test_option_t.obj: cpio/test/test_option_t.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_t.obj `if test -f 'cpio/test/test_option_t.c'; then $(CYGPATH_W) 'cpio/test/test_option_t.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_t.c'; fi`
+cpio/test/bsdcpio_test-test_option_u.o: cpio/test/test_option_u.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_u.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_u.Tpo -c -o cpio/test/bsdcpio_test-test_option_u.o `test -f 'cpio/test/test_option_u.c' || echo '$(srcdir)/'`cpio/test/test_option_u.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_u.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_u.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_u.c' object='cpio/test/bsdcpio_test-test_option_u.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_u.o `test -f 'cpio/test/test_option_u.c' || echo '$(srcdir)/'`cpio/test/test_option_u.c
+
+cpio/test/bsdcpio_test-test_option_u.obj: cpio/test/test_option_u.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_u.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_u.Tpo -c -o cpio/test/bsdcpio_test-test_option_u.obj `if test -f 'cpio/test/test_option_u.c'; then $(CYGPATH_W) 'cpio/test/test_option_u.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_u.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_u.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_u.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_u.c' object='cpio/test/bsdcpio_test-test_option_u.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_u.obj `if test -f 'cpio/test/test_option_u.c'; then $(CYGPATH_W) 'cpio/test/test_option_u.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_u.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_version.o: cpio/test/test_option_version.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_version.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_version.Tpo -c -o cpio/test/bsdcpio_test-test_option_version.o `test -f 'cpio/test/test_option_version.c' || echo '$(srcdir)/'`cpio/test/test_option_version.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_version.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_version.c' object='cpio/test/bsdcpio_test-test_option_version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_version.o `test -f 'cpio/test/test_option_version.c' || echo '$(srcdir)/'`cpio/test/test_option_version.c
+
+cpio/test/bsdcpio_test-test_option_version.obj: cpio/test/test_option_version.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_version.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_version.Tpo -c -o cpio/test/bsdcpio_test-test_option_version.obj `if test -f 'cpio/test/test_option_version.c'; then $(CYGPATH_W) 'cpio/test/test_option_version.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_version.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_version.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_version.c' object='cpio/test/bsdcpio_test-test_option_version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_version.obj `if test -f 'cpio/test/test_option_version.c'; then $(CYGPATH_W) 'cpio/test/test_option_version.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_version.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_y.o: cpio/test/test_option_y.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_y.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_y.Tpo -c -o cpio/test/bsdcpio_test-test_option_y.o `test -f 'cpio/test/test_option_y.c' || echo '$(srcdir)/'`cpio/test/test_option_y.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_y.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_y.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_y.c' object='cpio/test/bsdcpio_test-test_option_y.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_y.o `test -f 'cpio/test/test_option_y.c' || echo '$(srcdir)/'`cpio/test/test_option_y.c
+
+cpio/test/bsdcpio_test-test_option_y.obj: cpio/test/test_option_y.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_y.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_y.Tpo -c -o cpio/test/bsdcpio_test-test_option_y.obj `if test -f 'cpio/test/test_option_y.c'; then $(CYGPATH_W) 'cpio/test/test_option_y.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_y.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_y.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_y.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_y.c' object='cpio/test/bsdcpio_test-test_option_y.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_y.obj `if test -f 'cpio/test/test_option_y.c'; then $(CYGPATH_W) 'cpio/test/test_option_y.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_y.c'; fi`
+
+cpio/test/bsdcpio_test-test_option_z.o: cpio/test/test_option_z.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_z.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_z.Tpo -c -o cpio/test/bsdcpio_test-test_option_z.o `test -f 'cpio/test/test_option_z.c' || echo '$(srcdir)/'`cpio/test/test_option_z.c
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_z.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_z.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_z.c' object='cpio/test/bsdcpio_test-test_option_z.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_z.o `test -f 'cpio/test/test_option_z.c' || echo '$(srcdir)/'`cpio/test/test_option_z.c
+
+cpio/test/bsdcpio_test-test_option_z.obj: cpio/test/test_option_z.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_option_z.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_option_z.Tpo -c -o cpio/test/bsdcpio_test-test_option_z.obj `if test -f 'cpio/test/test_option_z.c'; then $(CYGPATH_W) 'cpio/test/test_option_z.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_z.c'; fi`
+@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_option_z.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_option_z.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_option_z.c' object='cpio/test/bsdcpio_test-test_option_z.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_option_z.obj `if test -f 'cpio/test/test_option_z.c'; then $(CYGPATH_W) 'cpio/test/test_option_z.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_option_z.c'; fi`
+
cpio/test/bsdcpio_test-test_owner_parse.o: cpio/test/test_owner_parse.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_owner_parse.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_owner_parse.Tpo -c -o cpio/test/bsdcpio_test-test_owner_parse.o `test -f 'cpio/test/test_owner_parse.c' || echo '$(srcdir)/'`cpio/test/test_owner_parse.c
@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_owner_parse.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_owner_parse.Po
@@ -2410,34 +2793,6 @@ cpio/test/bsdcpio_test-test_pathmatch.obj: cpio/test/test_pathmatch.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_pathmatch.obj `if test -f 'cpio/test/test_pathmatch.c'; then $(CYGPATH_W) 'cpio/test/test_pathmatch.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_pathmatch.c'; fi`
-cpio/test/bsdcpio_test-test_version.o: cpio/test/test_version.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_version.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_version.Tpo -c -o cpio/test/bsdcpio_test-test_version.o `test -f 'cpio/test/test_version.c' || echo '$(srcdir)/'`cpio/test/test_version.c
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_version.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_version.c' object='cpio/test/bsdcpio_test-test_version.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_version.o `test -f 'cpio/test/test_version.c' || echo '$(srcdir)/'`cpio/test/test_version.c
-
-cpio/test/bsdcpio_test-test_version.obj: cpio/test/test_version.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_version.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_version.Tpo -c -o cpio/test/bsdcpio_test-test_version.obj `if test -f 'cpio/test/test_version.c'; then $(CYGPATH_W) 'cpio/test/test_version.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_version.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_version.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_version.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_version.c' object='cpio/test/bsdcpio_test-test_version.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_version.obj `if test -f 'cpio/test/test_version.c'; then $(CYGPATH_W) 'cpio/test/test_version.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_version.c'; fi`
-
-cpio/test/bsdcpio_test-test_write_odc.o: cpio/test/test_write_odc.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_write_odc.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_write_odc.Tpo -c -o cpio/test/bsdcpio_test-test_write_odc.o `test -f 'cpio/test/test_write_odc.c' || echo '$(srcdir)/'`cpio/test/test_write_odc.c
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_write_odc.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_write_odc.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_write_odc.c' object='cpio/test/bsdcpio_test-test_write_odc.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_write_odc.o `test -f 'cpio/test/test_write_odc.c' || echo '$(srcdir)/'`cpio/test/test_write_odc.c
-
-cpio/test/bsdcpio_test-test_write_odc.obj: cpio/test/test_write_odc.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_write_odc.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_write_odc.Tpo -c -o cpio/test/bsdcpio_test-test_write_odc.obj `if test -f 'cpio/test/test_write_odc.c'; then $(CYGPATH_W) 'cpio/test/test_write_odc.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_write_odc.c'; fi`
-@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_write_odc.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_write_odc.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_write_odc.c' object='cpio/test/bsdcpio_test-test_write_odc.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-test_write_odc.obj `if test -f 'cpio/test/test_write_odc.c'; then $(CYGPATH_W) 'cpio/test/test_write_odc.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_write_odc.c'; fi`
-
tar/bsdtar-bsdtar.o: tar/bsdtar.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-bsdtar.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-bsdtar.Tpo -c -o tar/bsdtar-bsdtar.o `test -f 'tar/bsdtar.c' || echo '$(srcdir)/'`tar/bsdtar.c
@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-bsdtar.Tpo tar/$(DEPDIR)/bsdtar-bsdtar.Po
@@ -2536,6 +2891,118 @@ tar/bsdtar-write.obj: tar/write.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar-write.obj `if test -f 'tar/write.c'; then $(CYGPATH_W) 'tar/write.c'; else $(CYGPATH_W) '$(srcdir)/tar/write.c'; fi`
+tar/bsdtar_test-getdate.o: tar/getdate.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar_test-getdate.o -MD -MP -MF tar/$(DEPDIR)/bsdtar_test-getdate.Tpo -c -o tar/bsdtar_test-getdate.o `test -f 'tar/getdate.c' || echo '$(srcdir)/'`tar/getdate.c
+@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar_test-getdate.Tpo tar/$(DEPDIR)/bsdtar_test-getdate.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/getdate.c' object='tar/bsdtar_test-getdate.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar_test-getdate.o `test -f 'tar/getdate.c' || echo '$(srcdir)/'`tar/getdate.c
+
+tar/bsdtar_test-getdate.obj: tar/getdate.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar_test-getdate.obj -MD -MP -MF tar/$(DEPDIR)/bsdtar_test-getdate.Tpo -c -o tar/bsdtar_test-getdate.obj `if test -f 'tar/getdate.c'; then $(CYGPATH_W) 'tar/getdate.c'; else $(CYGPATH_W) '$(srcdir)/tar/getdate.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar_test-getdate.Tpo tar/$(DEPDIR)/bsdtar_test-getdate.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/getdate.c' object='tar/bsdtar_test-getdate.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/bsdtar_test-getdate.obj `if test -f 'tar/getdate.c'; then $(CYGPATH_W) 'tar/getdate.c'; else $(CYGPATH_W) '$(srcdir)/tar/getdate.c'; fi`
+
+tar/test/bsdtar_test-main.o: tar/test/main.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-main.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-main.Tpo -c -o tar/test/bsdtar_test-main.o `test -f 'tar/test/main.c' || echo '$(srcdir)/'`tar/test/main.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-main.Tpo tar/test/$(DEPDIR)/bsdtar_test-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/main.c' object='tar/test/bsdtar_test-main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-main.o `test -f 'tar/test/main.c' || echo '$(srcdir)/'`tar/test/main.c
+
+tar/test/bsdtar_test-main.obj: tar/test/main.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-main.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-main.Tpo -c -o tar/test/bsdtar_test-main.obj `if test -f 'tar/test/main.c'; then $(CYGPATH_W) 'tar/test/main.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/main.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-main.Tpo tar/test/$(DEPDIR)/bsdtar_test-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/main.c' object='tar/test/bsdtar_test-main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-main.obj `if test -f 'tar/test/main.c'; then $(CYGPATH_W) 'tar/test/main.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/main.c'; fi`
+
+tar/test/bsdtar_test-test_basic.o: tar/test/test_basic.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_basic.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_basic.Tpo -c -o tar/test/bsdtar_test-test_basic.o `test -f 'tar/test/test_basic.c' || echo '$(srcdir)/'`tar/test/test_basic.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_basic.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_basic.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_basic.c' object='tar/test/bsdtar_test-test_basic.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_basic.o `test -f 'tar/test/test_basic.c' || echo '$(srcdir)/'`tar/test/test_basic.c
+
+tar/test/bsdtar_test-test_basic.obj: tar/test/test_basic.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_basic.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_basic.Tpo -c -o tar/test/bsdtar_test-test_basic.obj `if test -f 'tar/test/test_basic.c'; then $(CYGPATH_W) 'tar/test/test_basic.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_basic.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_basic.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_basic.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_basic.c' object='tar/test/bsdtar_test-test_basic.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_basic.obj `if test -f 'tar/test/test_basic.c'; then $(CYGPATH_W) 'tar/test/test_basic.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_basic.c'; fi`
+
+tar/test/bsdtar_test-test_copy.o: tar/test/test_copy.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_copy.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_copy.Tpo -c -o tar/test/bsdtar_test-test_copy.o `test -f 'tar/test/test_copy.c' || echo '$(srcdir)/'`tar/test/test_copy.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_copy.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_copy.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_copy.c' object='tar/test/bsdtar_test-test_copy.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_copy.o `test -f 'tar/test/test_copy.c' || echo '$(srcdir)/'`tar/test/test_copy.c
+
+tar/test/bsdtar_test-test_copy.obj: tar/test/test_copy.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_copy.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_copy.Tpo -c -o tar/test/bsdtar_test-test_copy.obj `if test -f 'tar/test/test_copy.c'; then $(CYGPATH_W) 'tar/test/test_copy.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_copy.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_copy.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_copy.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_copy.c' object='tar/test/bsdtar_test-test_copy.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_copy.obj `if test -f 'tar/test/test_copy.c'; then $(CYGPATH_W) 'tar/test/test_copy.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_copy.c'; fi`
+
+tar/test/bsdtar_test-test_getdate.o: tar/test/test_getdate.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_getdate.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Tpo -c -o tar/test/bsdtar_test-test_getdate.o `test -f 'tar/test/test_getdate.c' || echo '$(srcdir)/'`tar/test/test_getdate.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_getdate.c' object='tar/test/bsdtar_test-test_getdate.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_getdate.o `test -f 'tar/test/test_getdate.c' || echo '$(srcdir)/'`tar/test/test_getdate.c
+
+tar/test/bsdtar_test-test_getdate.obj: tar/test/test_getdate.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_getdate.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Tpo -c -o tar/test/bsdtar_test-test_getdate.obj `if test -f 'tar/test/test_getdate.c'; then $(CYGPATH_W) 'tar/test/test_getdate.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_getdate.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_getdate.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_getdate.c' object='tar/test/bsdtar_test-test_getdate.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_getdate.obj `if test -f 'tar/test/test_getdate.c'; then $(CYGPATH_W) 'tar/test/test_getdate.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_getdate.c'; fi`
+
+tar/test/bsdtar_test-test_help.o: tar/test/test_help.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_help.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_help.Tpo -c -o tar/test/bsdtar_test-test_help.o `test -f 'tar/test/test_help.c' || echo '$(srcdir)/'`tar/test/test_help.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_help.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_help.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_help.c' object='tar/test/bsdtar_test-test_help.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_help.o `test -f 'tar/test/test_help.c' || echo '$(srcdir)/'`tar/test/test_help.c
+
+tar/test/bsdtar_test-test_help.obj: tar/test/test_help.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_help.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_help.Tpo -c -o tar/test/bsdtar_test-test_help.obj `if test -f 'tar/test/test_help.c'; then $(CYGPATH_W) 'tar/test/test_help.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_help.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_help.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_help.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_help.c' object='tar/test/bsdtar_test-test_help.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_help.obj `if test -f 'tar/test/test_help.c'; then $(CYGPATH_W) 'tar/test/test_help.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_help.c'; fi`
+
+tar/test/bsdtar_test-test_stdio.o: tar/test/test_stdio.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_stdio.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_stdio.Tpo -c -o tar/test/bsdtar_test-test_stdio.o `test -f 'tar/test/test_stdio.c' || echo '$(srcdir)/'`tar/test/test_stdio.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_stdio.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_stdio.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_stdio.c' object='tar/test/bsdtar_test-test_stdio.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_stdio.o `test -f 'tar/test/test_stdio.c' || echo '$(srcdir)/'`tar/test/test_stdio.c
+
+tar/test/bsdtar_test-test_stdio.obj: tar/test/test_stdio.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_stdio.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_stdio.Tpo -c -o tar/test/bsdtar_test-test_stdio.obj `if test -f 'tar/test/test_stdio.c'; then $(CYGPATH_W) 'tar/test/test_stdio.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_stdio.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_stdio.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_stdio.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_stdio.c' object='tar/test/bsdtar_test-test_stdio.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_stdio.obj `if test -f 'tar/test/test_stdio.c'; then $(CYGPATH_W) 'tar/test/test_stdio.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_stdio.c'; fi`
+
+tar/test/bsdtar_test-test_version.o: tar/test/test_version.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_version.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_version.Tpo -c -o tar/test/bsdtar_test-test_version.o `test -f 'tar/test/test_version.c' || echo '$(srcdir)/'`tar/test/test_version.c
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_version.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_version.c' object='tar/test/bsdtar_test-test_version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_version.o `test -f 'tar/test/test_version.c' || echo '$(srcdir)/'`tar/test/test_version.c
+
+tar/test/bsdtar_test-test_version.obj: tar/test/test_version.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_version.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_version.Tpo -c -o tar/test/bsdtar_test-test_version.obj `if test -f 'tar/test/test_version.c'; then $(CYGPATH_W) 'tar/test/test_version.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_version.c'; fi`
+@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_version.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_version.c' object='tar/test/bsdtar_test-test_version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_version.obj `if test -f 'tar/test/test_version.c'; then $(CYGPATH_W) 'tar/test/test_version.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_version.c'; fi`
+
libarchive/libarchive_test-archive_check_magic.o: libarchive/archive_check_magic.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_check_magic.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_check_magic.Tpo -c -o libarchive/libarchive_test-archive_check_magic.o `test -f 'libarchive/archive_check_magic.c' || echo '$(srcdir)/'`libarchive/archive_check_magic.c
@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_check_magic.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_check_magic.Po
@@ -3334,6 +3801,62 @@ libarchive/test/libarchive_test-test_bad_fd.obj: libarchive/test/test_bad_fd.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_bad_fd.obj `if test -f 'libarchive/test/test_bad_fd.c'; then $(CYGPATH_W) 'libarchive/test/test_bad_fd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_bad_fd.c'; fi`
+libarchive/test/libarchive_test-test_compat_gtar.o: libarchive/test/test_compat_gtar.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_gtar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Tpo -c -o libarchive/test/libarchive_test-test_compat_gtar.o `test -f 'libarchive/test/test_compat_gtar.c' || echo '$(srcdir)/'`libarchive/test/test_compat_gtar.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_gtar.c' object='libarchive/test/libarchive_test-test_compat_gtar.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_gtar.o `test -f 'libarchive/test/test_compat_gtar.c' || echo '$(srcdir)/'`libarchive/test/test_compat_gtar.c
+
+libarchive/test/libarchive_test-test_compat_gtar.obj: libarchive/test/test_compat_gtar.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_gtar.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Tpo -c -o libarchive/test/libarchive_test-test_compat_gtar.obj `if test -f 'libarchive/test/test_compat_gtar.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_gtar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_gtar.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_gtar.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_gtar.c' object='libarchive/test/libarchive_test-test_compat_gtar.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_gtar.obj `if test -f 'libarchive/test/test_compat_gtar.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_gtar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_gtar.c'; fi`
+
+libarchive/test/libarchive_test-test_compat_tar_hardlink.o: libarchive/test/test_compat_tar_hardlink.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_tar_hardlink.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Tpo -c -o libarchive/test/libarchive_test-test_compat_tar_hardlink.o `test -f 'libarchive/test/test_compat_tar_hardlink.c' || echo '$(srcdir)/'`libarchive/test/test_compat_tar_hardlink.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_tar_hardlink.c' object='libarchive/test/libarchive_test-test_compat_tar_hardlink.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_tar_hardlink.o `test -f 'libarchive/test/test_compat_tar_hardlink.c' || echo '$(srcdir)/'`libarchive/test/test_compat_tar_hardlink.c
+
+libarchive/test/libarchive_test-test_compat_tar_hardlink.obj: libarchive/test/test_compat_tar_hardlink.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_tar_hardlink.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Tpo -c -o libarchive/test/libarchive_test-test_compat_tar_hardlink.obj `if test -f 'libarchive/test/test_compat_tar_hardlink.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_tar_hardlink.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_tar_hardlink.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_tar_hardlink.c' object='libarchive/test/libarchive_test-test_compat_tar_hardlink.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_tar_hardlink.obj `if test -f 'libarchive/test/test_compat_tar_hardlink.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_tar_hardlink.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_tar_hardlink.c'; fi`
+
+libarchive/test/libarchive_test-test_compat_zip.o: libarchive/test/test_compat_zip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_zip.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Tpo -c -o libarchive/test/libarchive_test-test_compat_zip.o `test -f 'libarchive/test/test_compat_zip.c' || echo '$(srcdir)/'`libarchive/test/test_compat_zip.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_zip.c' object='libarchive/test/libarchive_test-test_compat_zip.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_zip.o `test -f 'libarchive/test/test_compat_zip.c' || echo '$(srcdir)/'`libarchive/test/test_compat_zip.c
+
+libarchive/test/libarchive_test-test_compat_zip.obj: libarchive/test/test_compat_zip.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_zip.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Tpo -c -o libarchive/test/libarchive_test-test_compat_zip.obj `if test -f 'libarchive/test/test_compat_zip.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_zip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_zip.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_zip.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_compat_zip.c' object='libarchive/test/libarchive_test-test_compat_zip.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_zip.obj `if test -f 'libarchive/test/test_compat_zip.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_zip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_zip.c'; fi`
+
+libarchive/test/libarchive_test-test_empty_write.o: libarchive/test/test_empty_write.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_empty_write.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_empty_write.Tpo -c -o libarchive/test/libarchive_test-test_empty_write.o `test -f 'libarchive/test/test_empty_write.c' || echo '$(srcdir)/'`libarchive/test/test_empty_write.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_empty_write.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_empty_write.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_empty_write.c' object='libarchive/test/libarchive_test-test_empty_write.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_empty_write.o `test -f 'libarchive/test/test_empty_write.c' || echo '$(srcdir)/'`libarchive/test/test_empty_write.c
+
+libarchive/test/libarchive_test-test_empty_write.obj: libarchive/test/test_empty_write.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_empty_write.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_empty_write.Tpo -c -o libarchive/test/libarchive_test-test_empty_write.obj `if test -f 'libarchive/test/test_empty_write.c'; then $(CYGPATH_W) 'libarchive/test/test_empty_write.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_empty_write.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_empty_write.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_empty_write.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_empty_write.c' object='libarchive/test/libarchive_test-test_empty_write.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_empty_write.obj `if test -f 'libarchive/test/test_empty_write.c'; then $(CYGPATH_W) 'libarchive/test/test_empty_write.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_empty_write.c'; fi`
+
libarchive/test/libarchive_test-test_entry.o: libarchive/test/test_entry.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_entry.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_entry.Tpo -c -o libarchive/test/libarchive_test-test_entry.o `test -f 'libarchive/test/test_entry.c' || echo '$(srcdir)/'`libarchive/test/test_entry.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_entry.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_entry.Po
@@ -3362,6 +3885,34 @@ libarchive/test/libarchive_test-test_entry_strmode.obj: libarchive/test/test_ent
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_entry_strmode.obj `if test -f 'libarchive/test/test_entry_strmode.c'; then $(CYGPATH_W) 'libarchive/test/test_entry_strmode.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_entry_strmode.c'; fi`
+libarchive/test/libarchive_test-test_link_resolver.o: libarchive/test/test_link_resolver.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_link_resolver.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_link_resolver.Tpo -c -o libarchive/test/libarchive_test-test_link_resolver.o `test -f 'libarchive/test/test_link_resolver.c' || echo '$(srcdir)/'`libarchive/test/test_link_resolver.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_link_resolver.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_link_resolver.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_link_resolver.c' object='libarchive/test/libarchive_test-test_link_resolver.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_link_resolver.o `test -f 'libarchive/test/test_link_resolver.c' || echo '$(srcdir)/'`libarchive/test/test_link_resolver.c
+
+libarchive/test/libarchive_test-test_link_resolver.obj: libarchive/test/test_link_resolver.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_link_resolver.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_link_resolver.Tpo -c -o libarchive/test/libarchive_test-test_link_resolver.obj `if test -f 'libarchive/test/test_link_resolver.c'; then $(CYGPATH_W) 'libarchive/test/test_link_resolver.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_link_resolver.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_link_resolver.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_link_resolver.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_link_resolver.c' object='libarchive/test/libarchive_test-test_link_resolver.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_link_resolver.obj `if test -f 'libarchive/test/test_link_resolver.c'; then $(CYGPATH_W) 'libarchive/test/test_link_resolver.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_link_resolver.c'; fi`
+
+libarchive/test/libarchive_test-test_pax_filename_encoding.o: libarchive/test/test_pax_filename_encoding.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_pax_filename_encoding.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Tpo -c -o libarchive/test/libarchive_test-test_pax_filename_encoding.o `test -f 'libarchive/test/test_pax_filename_encoding.c' || echo '$(srcdir)/'`libarchive/test/test_pax_filename_encoding.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_pax_filename_encoding.c' object='libarchive/test/libarchive_test-test_pax_filename_encoding.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_pax_filename_encoding.o `test -f 'libarchive/test/test_pax_filename_encoding.c' || echo '$(srcdir)/'`libarchive/test/test_pax_filename_encoding.c
+
+libarchive/test/libarchive_test-test_pax_filename_encoding.obj: libarchive/test/test_pax_filename_encoding.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_pax_filename_encoding.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Tpo -c -o libarchive/test/libarchive_test-test_pax_filename_encoding.obj `if test -f 'libarchive/test/test_pax_filename_encoding.c'; then $(CYGPATH_W) 'libarchive/test/test_pax_filename_encoding.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_pax_filename_encoding.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_pax_filename_encoding.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_pax_filename_encoding.c' object='libarchive/test/libarchive_test-test_pax_filename_encoding.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_pax_filename_encoding.obj `if test -f 'libarchive/test/test_pax_filename_encoding.c'; then $(CYGPATH_W) 'libarchive/test/test_pax_filename_encoding.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_pax_filename_encoding.c'; fi`
+
libarchive/test/libarchive_test-test_read_compress_program.o: libarchive/test/test_read_compress_program.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_compress_program.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_compress_program.Tpo -c -o libarchive/test/libarchive_test-test_read_compress_program.o `test -f 'libarchive/test/test_read_compress_program.c' || echo '$(srcdir)/'`libarchive/test/test_read_compress_program.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_compress_program.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_compress_program.Po
@@ -3796,6 +4347,20 @@ libarchive/test/libarchive_test-test_write_disk.obj: libarchive/test/test_write_
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk.obj `if test -f 'libarchive/test/test_write_disk.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk.c'; fi`
+libarchive/test/libarchive_test-test_write_disk_hardlink.o: libarchive/test/test_write_disk_hardlink.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_hardlink.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_hardlink.o `test -f 'libarchive/test/test_write_disk_hardlink.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_hardlink.c
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_hardlink.c' object='libarchive/test/libarchive_test-test_write_disk_hardlink.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_hardlink.o `test -f 'libarchive/test/test_write_disk_hardlink.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_hardlink.c
+
+libarchive/test/libarchive_test-test_write_disk_hardlink.obj: libarchive/test/test_write_disk_hardlink.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_hardlink.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_hardlink.obj `if test -f 'libarchive/test/test_write_disk_hardlink.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_hardlink.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_hardlink.c'; fi`
+@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_hardlink.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_disk_hardlink.c' object='libarchive/test/libarchive_test-test_write_disk_hardlink.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_hardlink.obj `if test -f 'libarchive/test/test_write_disk_hardlink.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_hardlink.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_hardlink.c'; fi`
+
libarchive/test/libarchive_test-test_write_disk_perms.o: libarchive/test/test_write_disk_perms.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_perms.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_perms.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_perms.o `test -f 'libarchive/test/test_write_disk_perms.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_perms.c
@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_perms.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_perms.Po
@@ -4412,6 +4977,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -4425,6 +4991,9 @@ distclean-generic:
-rm -f libarchive/test/$(am__dirstamp)
-rm -f tar/$(DEPDIR)/$(am__dirstamp)
-rm -f tar/$(am__dirstamp)
+ -rm -f tar/test/$(DEPDIR)/$(am__dirstamp)
+ -rm -f tar/test/$(am__dirstamp)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -4438,7 +5007,7 @@ clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf cpio/$(DEPDIR) cpio/test/$(DEPDIR) libarchive/$(DEPDIR) libarchive/test/$(DEPDIR) tar/$(DEPDIR)
+ -rm -rf cpio/$(DEPDIR) cpio/test/$(DEPDIR) libarchive/$(DEPDIR) libarchive/test/$(DEPDIR) tar/$(DEPDIR) tar/test/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-local distclean-tags
@@ -4475,7 +5044,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf cpio/$(DEPDIR) cpio/test/$(DEPDIR) libarchive/$(DEPDIR) libarchive/test/$(DEPDIR) tar/$(DEPDIR)
+ -rm -rf cpio/$(DEPDIR) cpio/test/$(DEPDIR) libarchive/$(DEPDIR) libarchive/test/$(DEPDIR) tar/$(DEPDIR) tar/test/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -4531,18 +5100,10 @@ dist-hook:
rm -f `find $(distdir) -name '*~'`
rm -f `find $(distdir) -name '*.out'`
rm -f `find $(distdir) -name '*.core'`
- rm -f $(distdir)/*/Makefile
- mkdir -p $(distdir)/doc/man
- cp $(distdir)/libarchive/*.[135] $(distdir)/doc/man
- cp $(distdir)/tar/*.[135] $(distdir)/doc/man
- cp $(distdir)/cpio/*.[135] $(distdir)/doc/man
- mkdir -p $(distdir)/doc/text
- cd $(distdir)/doc/man; for f in *.[135]; do nroff -mdoc $$f | col -b > ../text/`basename $$f`.txt; done
+ -rm -f $(distdir)/*/Makefile $(distdir)/*/*/Makefile
+ cd $(distdir)/doc && ./update.sh
distclean-local:
- -rm -f tar/getdate.c tar/getdate.h
- -rm -f libarchive/test/list.h
- -rm -f cpio/test/list.h
-rm -rf autom4te.cache/
-rm -f *~
@@ -4552,8 +5113,66 @@ distclean-local:
libarchive/test/list.h: Makefile
cat $(top_srcdir)/libarchive/test/test_*.c | grep DEFINE_TEST > libarchive/test/list.h
+# BSD make prefers $> here, GNU make prefers $<; $? works for both.
+test_compat_gtar_1.tgz: libarchive/test/test_compat_gtar_1.tgz.uu
+ cat $? | uudecode
+
+test_compat_tar_hardlink_1.tar: libarchive/test/test_compat_tar_hardlink_1.tar.uu
+ cat $? | uudecode
+
+test_compat_zip_1.zip: libarchive/test/test_compat_zip_1.zip.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_13.tgz: libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17.tgz: libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17_posix00.tgz: libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17_posix01.tgz: libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17_posix10.tgz: libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu
+ cat $? | uudecode
+
+test_read_format_gtar_sparse_1_17_posix10_modified.tar: libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
+ cat $? | uudecode
+
+tar/test/list.h: Makefile
+ cat $(top_srcdir)/tar/test/test_*.c | grep DEFINE_TEST > tar/test/list.h
+
cpio/test/list.h: Makefile
cat $(top_srcdir)/cpio/test/test_*.c | grep DEFINE_TEST > cpio/test/list.h
+
+test_gcpio_compat_ref.bin: cpio/test/test_gcpio_compat_ref.bin.uu
+ cat $? | uudecode
+
+test_gcpio_compat_ref.crc: cpio/test/test_gcpio_compat_ref.crc.uu
+ cat $? | uudecode
+
+test_gcpio_compat_ref.newc: cpio/test/test_gcpio_compat_ref.newc.uu
+ cat $? | uudecode
+
+test_gcpio_compat_ref.ustar: cpio/test/test_gcpio_compat_ref.ustar.uu
+ cat $? | uudecode
+
+test_option_f.cpio: cpio/test/test_option_f.cpio.uu
+ cat $? | uudecode
+
+test_option_m.cpio: cpio/test/test_option_m.cpio.uu
+ cat $? | uudecode
+
+test_option_t.cpio: cpio/test/test_option_t.cpio.uu
+ cat $? | uudecode
+
+test_option_t.stdout: cpio/test/test_option_t.stdout.uu
+ cat $? | uudecode
+
+test_option_tv.stdout: cpio/test/test_option_tv.stdout.uu
+ cat $? | uudecode
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/archivers/libarchive/files/NEWS b/archivers/libarchive/files/NEWS
index d6de37483f5..d5b257a3239 100644
--- a/archivers/libarchive/files/NEWS
+++ b/archivers/libarchive/files/NEWS
@@ -1,4 +1,68 @@
+Feb 26, 2008: libarchive 2.4.13 released
+Feb 25, 2008: Handle path, linkname, gname, or uname that can't be converted
+ to/from UTF-8. Implement "hdrcharset" attribute from SUS-2008.
+Feb 25, 2008: Fix name clash on NetBSD.
+Feb 18, 2008: Fix writing empty 'ar' archives, per Kai Wang
+Feb 18, 2008: [bsdtar] Permit appending on block devices.
+Feb 09, 2008: New "linkify" resolver to help with newc hardlink writing;
+ bsdcpio still needs to be converted to use this.
+Feb 02, 2008: Windows compatibility fixes from Ivailo Petrov, Kees Zeelenberg
+Jan 30, 2008: Ignore hardlink size for non-POSIX tar archives.
+
+Jan 22, 2008: libarchive 2.4.12 released
+Jan 22, 2008: Fix bad padding when writing symlinks to newc cpio archives.
+Jan 22, 2008: Verify bsdcpio_test by getting it to work against GNU cpio 2.9.
+ bsdcpio_test complains about missing options (-y and -z), format
+ of informational messages (--version, --help), and a minor formatting
+ issue in odc format output. After this update, bsdcpio_test uncovered
+ several more cosmetic issues in bsdcpio, all now fixed.
+Jan 22, 2008: Experimental support for self-extracting Zip archives.
+Jan 22, 2008: Extend hardlink restore strategy to work correctly with
+ hardlinks extracted from newc cpio files. (Which store the body
+ only with the last occurrence of a link.)
+
+Dec 30, 2007: libarchive 2.4.11 released
+Dec 30, 2007: Fixed a compile error in bsdcpio on some systems.
+
+Dec 29, 2007: libarchive 2.4.10 released
+Dec 29, 2007: bsdcpio 0.9.0 is ready for wider use.
+Dec 29, 2007: Completed initial test harness for bsdcpio.
+
+Dec 22, 2007: libarchive 2.4.9 released
+Dec 22, 2007: Implement the remaining options for bsdcpio: -a, -q, -L, -f,
+ pattern selection for -i and -it.
+
+Dec 13, 2007: libarchive 2.4.8 released
+Dec 13, 2007: gzip and bzip2 compression now handle zero-byte writes correctly,
+ Thanks to Damien Golding for bringing this to my attention.
+
+Dec 12, 2007: libarchive 2.4.7 released
+
+Dec 10, 2007: libarchive 2.4.6 released
+Dec 09, 2007: tar/test/test_copy.c verifies "tar -c | tar -x" copy pipeline
+Dec 07, 2007: Fix a couple of minor memory leaks.
+
+Dec 04, 2007: libarchive 2.4.5 released
+Dec 04, 2007: Fix cpio/test/test_write_odc by setting the umask first.
+
+Dec 03, 2007: libarchive 2.4.4 released
+Dec 03, 2007: New configure options --disable-xattr and --disable-acl,
+ thanks to Samuli Suominen.
+
+Dec 03, 2007: libarchive 2.4.3 released
+Dec 03, 2007: Thanks to Lapo Luchini for sending me a ZIP file that
+ libarchive couldn't handle. Fixed a bug in handling of
+ "length at end" flags in ZIP files.
+Dec 03, 2007: Fixed bsdcpio -help, bsdtar -help tests.
+Dec 02, 2007: First cut at real bsdtar test harness.
+
+Dec 02, 2007: libarchive 2.4.2 released
+
+Dec 02, 2007: libarchive 2.4.1 released
+Dec 02, 2007: Minor fixes, rough cut of mdoc-to-man conversion for
+ man pages.
+
Oct 30, 2007: libarchive 2.4.0 released
Oct 30, 2007: Minor compile fix thanks to Joerg Schilling.
Oct 30, 2007: Only run the format auction once at the beginning of the
diff --git a/archivers/libarchive/files/config.h.in b/archivers/libarchive/files/config.h.in
index 4006d5b3318..87536d5d664 100644
--- a/archivers/libarchive/files/config.h.in
+++ b/archivers/libarchive/files/config.h.in
@@ -42,6 +42,9 @@
/* Define to 1 if you have the `chflags' function. */
#undef HAVE_CHFLAGS
+/* Define to 1 if you have the `chown' function. */
+#undef HAVE_CHOWN
+
/* Define to 1 if you have the declaration of `INT64_MAX', and to 0 if you
don't. */
#undef HAVE_DECL_INT64_MAX
@@ -132,6 +135,9 @@
/* Define to 1 if you have the `futimes' function. */
#undef HAVE_FUTIMES
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
+
/* Define to 1 if you have the `getopt_long' function. */
#undef HAVE_GETOPT_LONG
@@ -220,6 +226,9 @@
/* Define to 1 if you have the `mkfifo' function. */
#undef HAVE_MKFIFO
+/* Define to 1 if you have the `mknod' function. */
+#undef HAVE_MKNOD
+
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
@@ -241,6 +250,9 @@
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
@@ -325,6 +337,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
+/* Define to 1 if you have the <sys/utime.h> header file. */
+#undef HAVE_SYS_UTIME_H
+
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
@@ -334,12 +349,18 @@
/* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H
+/* Define to 1 if you have the `tzset' function. */
+#undef HAVE_TZSET
+
/* Define to 1 if the system has the type `uintmax_t'. */
#undef HAVE_UINTMAX_T
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
/* Define to 1 if the system has the type `unsigned long long'. */
#undef HAVE_UNSIGNED_LONG_LONG
diff --git a/archivers/libarchive/files/configure b/archivers/libarchive/files/configure
index 9c7318d9a5e..408b10afa9c 100755
--- a/archivers/libarchive/files/configure
+++ b/archivers/libarchive/files/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for libarchive 2.4.0.
+# Generated by GNU Autoconf 2.61 for libarchive 2.4.13.
#
# Report bugs to <kientzle@freebsd.org>.
#
@@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='libarchive'
PACKAGE_TARNAME='libarchive'
-PACKAGE_VERSION='2.4.0'
-PACKAGE_STRING='libarchive 2.4.0'
+PACKAGE_VERSION='2.4.13'
+PACKAGE_STRING='libarchive 2.4.13'
PACKAGE_BUGREPORT='kientzle@freebsd.org'
ac_unique_file="libarchive"
@@ -1408,7 +1408,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libarchive 2.4.0 to adapt to many kinds of systems.
+\`configure' configures libarchive 2.4.13 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1478,7 +1478,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libarchive 2.4.0:";;
+ short | recursive ) echo "Configuration of libarchive 2.4.13:";;
esac
cat <<\_ACEOF
@@ -1500,6 +1500,8 @@ Optional Features:
--enable-bsdcpio=static static build of bsdcpio
--enable-bsdcpio=shared dynamic build of bsdcpio
--disable-bsdcpio disable build of bsdcpio (default)
+ --disable-xattr Enable Extended Attributes support (default: check)
+ --disable-acl Enable ACL support (default: check)
--disable-largefile omit support for large files
Optional Packages:
@@ -1594,7 +1596,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libarchive configure 2.4.0
+libarchive configure 2.4.13
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1608,7 +1610,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libarchive $as_me 2.4.0, which was
+It was created by libarchive $as_me 2.4.13, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2302,7 +2304,7 @@ fi
# Define the identity of the package.
PACKAGE='libarchive'
- VERSION='2.4.0'
+ VERSION='2.4.13'
cat >>confdefs.h <<_ACEOF
@@ -4522,7 +4524,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4525 "configure"' > conftest.$ac_ext
+ echo '#line 4527 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7253,11 +7255,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7256: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7258: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7260: \$? = $ac_status" >&5
+ echo "$as_me:7262: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7521,11 +7523,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7524: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7526: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7528: \$? = $ac_status" >&5
+ echo "$as_me:7530: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7625,11 +7627,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7628: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7630: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7632: \$? = $ac_status" >&5
+ echo "$as_me:7634: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -9933,7 +9935,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9936 "configure"
+#line 9938 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10033,7 +10035,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10036 "configure"
+#line 10038 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12369,11 +12371,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12372: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12374: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12376: \$? = $ac_status" >&5
+ echo "$as_me:12378: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12473,11 +12475,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12476: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12478: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12480: \$? = $ac_status" >&5
+ echo "$as_me:12482: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14043,11 +14045,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14046: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14048: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14050: \$? = $ac_status" >&5
+ echo "$as_me:14052: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14147,11 +14149,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14150: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14152: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14154: \$? = $ac_status" >&5
+ echo "$as_me:14156: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16345,11 +16347,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16348: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16350: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16352: \$? = $ac_status" >&5
+ echo "$as_me:16354: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16613,11 +16615,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16616: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16618: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16620: \$? = $ac_status" >&5
+ echo "$as_me:16622: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16717,11 +16719,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16720: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16722: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16724: \$? = $ac_status" >&5
+ echo "$as_me:16726: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -20093,151 +20095,6 @@ _ACEOF
fi
-for ac_header in attr/xattr.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- ( cat <<\_ASBOX
-## ----------------------------------- ##
-## Report this to kientzle@freebsd.org ##
-## ----------------------------------- ##
-_ASBOX
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
@@ -20982,7 +20839,8 @@ done
-for ac_header in sys/param.h sys/poll.h sys/select.h sys/time.h
+
+for ac_header in sys/param.h sys/poll.h sys/select.h sys/time.h sys/utime.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -21278,148 +21136,6 @@ done
# Checks for libraries.
-{ echo "$as_me:$LINENO: checking for acl_set_file in -lacl" >&5
-echo $ECHO_N "checking for acl_set_file in -lacl... $ECHO_C" >&6; }
-if test "${ac_cv_lib_acl_acl_set_file+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lacl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char acl_set_file ();
-int
-main ()
-{
-return acl_set_file ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_acl_acl_set_file=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_acl_acl_set_file=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_acl_acl_set_file" >&5
-echo "${ECHO_T}$ac_cv_lib_acl_acl_set_file" >&6; }
-if test $ac_cv_lib_acl_acl_set_file = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBACL 1
-_ACEOF
-
- LIBS="-lacl $LIBS"
-
-fi
-
-
-{ echo "$as_me:$LINENO: checking for setxattr in -lattr" >&5
-echo $ECHO_N "checking for setxattr in -lattr... $ECHO_C" >&6; }
-if test "${ac_cv_lib_attr_setxattr+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lattr $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char setxattr ();
-int
-main ()
-{
-return setxattr ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_attr_setxattr=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_attr_setxattr=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_attr_setxattr" >&5
-echo "${ECHO_T}$ac_cv_lib_attr_setxattr" >&6; }
-if test $ac_cv_lib_attr_setxattr = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBATTR 1
-_ACEOF
-
- LIBS="-lattr $LIBS"
-
-fi
-
-
{ echo "$as_me:$LINENO: checking for BZ2_bzDecompressInit in -lbz2" >&5
echo $ECHO_N "checking for BZ2_bzDecompressInit in -lbz2... $ECHO_C" >&6; }
if test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then
@@ -25100,7 +24816,8 @@ done
-for ac_func in chflags fchdir fchflags fchmod fchown futimes
+
+for ac_func in chflags chown fchdir fchflags fchmod fchown futimes
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -25196,7 +24913,7 @@ done
-for ac_func in ftruncate getopt_long getxattr
+for ac_func in ftruncate geteuid getopt_long
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -25390,7 +25107,8 @@ done
-for ac_func in lgetxattr listxattr llistxattr fsetxattr lsetxattr
+
+for ac_func in lutimes memmove memset mkdir mkfifo mknod
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -25488,7 +25206,7 @@ done
-for ac_func in lutimes memmove memset mkdir mkfifo
+for ac_func in nl_langinfo poll select setenv setlocale
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -25585,7 +25303,8 @@ done
-for ac_func in nl_langinfo poll select setlocale
+
+for ac_func in strchr strdup strerror strrchr timegm
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -25682,10 +25401,7 @@ done
-
-
-
-for ac_func in strchr strdup strerror strrchr timegm utime utimes
+for ac_func in tzset unsetenv utime utimes
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -26202,6 +25918,331 @@ fi
echo "${ECHO_T}$ac_cv_member_struct_dirent_d_namlen" >&6; }
+# Check for Extended Attributes support
+# Check whether --enable-xattr was given.
+if test "${enable_xattr+set}" = set; then
+ enableval=$enable_xattr;
+fi
+
+
+if test "x$enable_xattr" != "xno"; then
+
+for ac_header in attr/xattr.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ----------------------------------- ##
+## Report this to kientzle@freebsd.org ##
+## ----------------------------------- ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ echo "$as_me:$LINENO: checking for setxattr in -lattr" >&5
+echo $ECHO_N "checking for setxattr in -lattr... $ECHO_C" >&6; }
+if test "${ac_cv_lib_attr_setxattr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lattr $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char setxattr ();
+int
+main ()
+{
+return setxattr ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_attr_setxattr=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_attr_setxattr=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_attr_setxattr" >&5
+echo "${ECHO_T}$ac_cv_lib_attr_setxattr" >&6; }
+if test $ac_cv_lib_attr_setxattr = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBATTR 1
+_ACEOF
+
+ LIBS="-lattr $LIBS"
+
+fi
+
+
+
+
+
+
+
+for ac_func in getxattr lgetxattr listxattr llistxattr fsetxattr lsetxattr
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+fi
+
# Check for ACL support
#
# The ACL support in libarchive is written against the POSIX1e draft,
@@ -26209,6 +26250,13 @@ echo "${ECHO_T}$ac_cv_member_struct_dirent_d_namlen" >&6; }
# platforms. Worse, some systems have completely non-POSIX acl functions,
# which makes the following checks rather more complex than I would like.
#
+# Check whether --enable-acl was given.
+if test "${enable_acl+set}" = set; then
+ enableval=$enable_acl;
+fi
+
+
+if test "x$enable_acl" != "xno"; then
for ac_header in sys/acl.h
do
@@ -26524,7 +26572,7 @@ fi
done
-{ echo "$as_me:$LINENO: checking for acl_permset_t" >&5
+ { echo "$as_me:$LINENO: checking for acl_permset_t" >&5
echo $ECHO_N "checking for acl_permset_t... $ECHO_C" >&6; }
if test "${ac_cv_type_acl_permset_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -26536,11 +26584,11 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_ACL_H
-#include <sys/acl.h>
-#endif
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
typedef acl_permset_t ac__type_new_;
@@ -26594,11 +26642,11 @@ _ACEOF
fi
-# The "acl_get_perm()" function was omitted from the POSIX draft.
-# (It's a pretty obvious oversight; otherwise, there's no way to
-# test for specific permissions in a permset.) Linux uses the obvious
-# name, FreeBSD adds _np to mark it as "non-Posix extension."
-# Test for both as a double-check that we really have POSIX-style ACL support.
+ # The "acl_get_perm()" function was omitted from the POSIX draft.
+ # (It's a pretty obvious oversight; otherwise, there's no way to
+ # test for specific permissions in a permset.) Linux uses the obvious
+ # name, FreeBSD adds _np to mark it as "non-Posix extension."
+ # Test for both as a double-check that we really have POSIX-style ACL support.
for ac_func in acl_get_perm_np acl_get_perm
@@ -26695,9 +26743,9 @@ fi
done
-# MacOS has an acl.h that isn't POSIX. It can be detected by
-# checking for ACL_USER
-{ echo "$as_me:$LINENO: checking whether ACL_USER is declared" >&5
+ # MacOS has an acl.h that isn't POSIX. It can be detected by
+ # checking for ACL_USER
+ { echo "$as_me:$LINENO: checking whether ACL_USER is declared" >&5
echo $ECHO_N "checking whether ACL_USER is declared... $ECHO_C" >&6; }
if test "${ac_cv_have_decl_ACL_USER+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -26758,6 +26806,7 @@ _ACEOF
fi
+fi
# Additional requirements
# Check whether --enable-largefile was given.
@@ -27350,7 +27399,7 @@ LTLIBOBJS=$ac_ltlibobjs
LIBARCHIVE_VERSION_STRING=$PACKAGE_VERSION
BSDTAR_VERSION_STRING=$PACKAGE_VERSION
# For a little while longer, cpio is considered immature
-BSDCPIO_VERSION_STRING=0.3.0
+BSDCPIO_VERSION_STRING=0.9.0
# Peel off first three numbers major.minor.revision
ARCHIVE_MAJOR=`echo $LIBARCHIVE_VERSION_STRING | sed -e 's/[^0-9]/./g' -e 's/\..*//'`
@@ -27736,7 +27785,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libarchive $as_me 2.4.0, which was
+This file was extended by libarchive $as_me 2.4.13, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -27789,7 +27838,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-libarchive config.status 2.4.0
+libarchive config.status 2.4.13
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/archivers/libarchive/files/configure.ac b/archivers/libarchive/files/configure.ac
index c1dd928eb43..eae9bebae98 100644
--- a/archivers/libarchive/files/configure.ac
+++ b/archivers/libarchive/files/configure.ac
@@ -19,7 +19,7 @@ AC_CONFIG_COMMANDS_PRE([
LIBARCHIVE_VERSION_STRING=$PACKAGE_VERSION
BSDTAR_VERSION_STRING=$PACKAGE_VERSION
# For a little while longer, cpio is considered immature
-BSDCPIO_VERSION_STRING=0.3.0
+BSDCPIO_VERSION_STRING=0.9.0
# Peel off first three numbers major.minor.revision
ARCHIVE_MAJOR=`echo $LIBARCHIVE_VERSION_STRING | sed -e 's/[[^0-9]]/./g' -e 's/\..*//'`
@@ -158,7 +158,6 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ])
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([attr/xattr.h])
AC_CHECK_HEADERS([bzlib.h errno.h ext2fs/ext2_fs.h fcntl.h grp.h])
AC_CHECK_HEADERS([inttypes.h langinfo.h limits.h linux/ext2_fs.h linux/fs.h])
# Include inttypes.h into archive.h only if appropriate.
@@ -172,12 +171,10 @@ AC_CHECK_HEADER(inttypes.h,
[AC_SUBST(ARCHIVE_H_INCLUDE_INTTYPES_H,[''])])
AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h stdarg.h])
AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/acl.h sys/ioctl.h])
-AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/time.h])
+AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/time.h sys/utime.h])
AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h zlib.h])
# Checks for libraries.
-AC_CHECK_LIB(acl,acl_set_file)
-AC_CHECK_LIB(attr,setxattr)
AC_CHECK_LIB(bz2,BZ2_bzDecompressInit)
AC_CHECK_LIB(z,inflate)
@@ -238,13 +235,13 @@ AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([chflags fchdir fchflags fchmod fchown futimes])
-AC_CHECK_FUNCS([ftruncate getopt_long getxattr])
+AC_CHECK_FUNCS([chflags chown fchdir fchflags fchmod fchown futimes])
+AC_CHECK_FUNCS([ftruncate geteuid getopt_long])
AC_CHECK_FUNCS([lchflags lchmod lchown])
-AC_CHECK_FUNCS([lgetxattr listxattr llistxattr fsetxattr lsetxattr])
-AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo])
-AC_CHECK_FUNCS([nl_langinfo poll select setlocale])
-AC_CHECK_FUNCS([strchr strdup strerror strrchr timegm utime utimes])
+AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo mknod])
+AC_CHECK_FUNCS([nl_langinfo poll select setenv setlocale])
+AC_CHECK_FUNCS([strchr strdup strerror strrchr timegm])
+AC_CHECK_FUNCS([tzset unsetenv utime utimes])
AC_CHECK_FUNCS([wcscpy wcslen wmemcmp wmemcpy])
# FreeBSD's nl_langinfo supports an option to specify whether the
@@ -280,6 +277,17 @@ AC_CHECK_MEMBER(struct dirent.d_namlen,,,
#endif
])
+# Check for Extended Attributes support
+AC_ARG_ENABLE([xattr],
+ AS_HELP_STRING([--disable-xattr],
+ [Enable Extended Attributes support (default: check)]))
+
+if test "x$enable_xattr" != "xno"; then
+ AC_CHECK_HEADERS([attr/xattr.h])
+ AC_CHECK_LIB(attr,setxattr)
+ AC_CHECK_FUNCS([getxattr lgetxattr listxattr llistxattr fsetxattr lsetxattr])
+fi
+
# Check for ACL support
#
# The ACL support in libarchive is written against the POSIX1e draft,
@@ -287,39 +295,45 @@ AC_CHECK_MEMBER(struct dirent.d_namlen,,,
# platforms. Worse, some systems have completely non-POSIX acl functions,
# which makes the following checks rather more complex than I would like.
#
-AC_CHECK_HEADERS([sys/acl.h])
-AC_CHECK_LIB([acl],[acl_get_file])
-AC_CHECK_FUNCS([acl_create_entry acl_init acl_set_fd acl_set_fd_np acl_set_file])
-
-AC_CHECK_TYPES(acl_permset_t,,,
-[#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_ACL_H
-#include <sys/acl.h>
-#endif
-])
-
-# The "acl_get_perm()" function was omitted from the POSIX draft.
-# (It's a pretty obvious oversight; otherwise, there's no way to
-# test for specific permissions in a permset.) Linux uses the obvious
-# name, FreeBSD adds _np to mark it as "non-Posix extension."
-# Test for both as a double-check that we really have POSIX-style ACL support.
-AC_CHECK_FUNCS(acl_get_perm_np acl_get_perm,,,
-[#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_ACL_H
-#include <sys/acl.h>
-#endif
-])
-
-# MacOS has an acl.h that isn't POSIX. It can be detected by
-# checking for ACL_USER
-AC_CHECK_DECL([ACL_USER],
+AC_ARG_ENABLE([acl],
+ AS_HELP_STRING([--disable-acl],
+ [Enable ACL support (default: check)]))
+
+if test "x$enable_acl" != "xno"; then
+ AC_CHECK_HEADERS([sys/acl.h])
+ AC_CHECK_LIB([acl],[acl_get_file])
+ AC_CHECK_FUNCS([acl_create_entry acl_init acl_set_fd acl_set_fd_np acl_set_file])
+
+ AC_CHECK_TYPES(acl_permset_t,,,
+ [#if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
+ ])
+
+ # The "acl_get_perm()" function was omitted from the POSIX draft.
+ # (It's a pretty obvious oversight; otherwise, there's no way to
+ # test for specific permissions in a permset.) Linux uses the obvious
+ # name, FreeBSD adds _np to mark it as "non-Posix extension."
+ # Test for both as a double-check that we really have POSIX-style ACL support.
+ AC_CHECK_FUNCS(acl_get_perm_np acl_get_perm,,,
+ [#if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
+ ])
+
+ # MacOS has an acl.h that isn't POSIX. It can be detected by
+ # checking for ACL_USER
+ AC_CHECK_DECL([ACL_USER],
[AC_DEFINE(HAVE_ACL_USER, 1, [True for systems with POSIX ACL support])],
[],
[#include <sys/acl.h>])
+fi
# Additional requirements
AC_SYS_LARGEFILE
diff --git a/archivers/libarchive/files/cpio/bsdcpio.1 b/archivers/libarchive/files/cpio/bsdcpio.1
index 58fc9bf5c1f..70889dfe036 100644
--- a/archivers/libarchive/files/cpio/bsdcpio.1
+++ b/archivers/libarchive/files/cpio/bsdcpio.1
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 05, 2007
+.Dd December 21, 2007
.Dt BSDCPIO 1
.Os
.Sh NAME
@@ -64,12 +64,12 @@ Read an archive from standard input and extract the contents to disk or
.Fl t
option is specified)
list the contents to standard output.
+If one or more file patterns are specified, only files matching
+one of the patterns will be extracted.
.It Fl o
Output.
Read a list of filenames from standard input and produce a new archive
on standard output containing the specified items.
-If one or more file patterns are specified, only files matching
-one of the patterns will be extracted.
.It Fl p
Pass-through.
Read a list of filenames from standard input and copy the files to the
@@ -83,7 +83,6 @@ all operating modes.
.It Fl a
(o and p modes)
Reset access times on files after they are read.
-(Not yet implemented)
.It Fl B
(o mode only)
Block output to records of 5120 bytes.
@@ -99,7 +98,6 @@ Create directories as necessary.
(i mode only)
Ignore files that match
.Ar pattern .
-(Not yet implemented.)
.It Fl -format Ar format
(o mode only)
Produce the output archive in the specified format.
@@ -135,7 +133,6 @@ See above for description.
All symbolic links will be followed.
Normally, symbolic links are archived and copied as symbolic links.
With this option, the target of the link will be archived or copied instead.
-(Not yet implemented.)
.It Fl l
(p mode only)
Create links from the target directory to the original files,
@@ -151,7 +148,7 @@ See above for description.
Pass-through mode.
See above for description.
.It Fl -quiet
-(Not yet implemented.)
+Suppress unnecessary messages.
.It Fl R Oo user Oc Ns Oo : Oc Ns Oo group Oc
Set the owner and/or group on files in the output.
If group is specified with no user
@@ -312,19 +309,15 @@ and
.Nm find
utilities were written by Dick Haight
while working in AT&T's Unix Support Group.
-They first appeared in PWB/UNIX 1.0, the
+They first appeared in 1977 in PWB/UNIX 1.0, the
.Dq Programmer's Work Bench
-system developed for use within AT&T and released in 1977.
-XXX It was first released outside of AT&T
-as part of System III Unix in 1981. XXX
-XXX Need to verify the previous statement. XXX
+system developed for use within AT&T.
+They were first released outside of AT&T as part of System III Unix in 1981.
As a result,
.Nm cpio
actually predates
.Nm tar ,
-even though it was not well-known outside of AT&T
-until some time later.
-XXX When did cpio first appear in BSD? XXX
+even though it was not well-known outside of AT&T until some time later.
.Pp
This is a complete re-implementation based on the
.Xr libarchive 3
@@ -340,23 +333,3 @@ The cpio archive formats cannot support files over 4 gigabytes,
except for the
.Dq odc
variant, which can support files up to 8 gigabytes.
-.Pp
-This is an early alpha version of
-.Nm .
-The underlying
-.Nm libarchive
-library is quite mature, so the archive format support
-and creation of objects on disk should be robust.
-However, the cpio-specific options and features
-are still very new.
-Known issues that will be fixed soon:
-.Bl -bullet -offset indent -compact
-.It
-Options documented above as
-.Do Not yet implemented Dc .
-.It
-Filter arguments to
-.Fl i ,
-and
-.Fl it .
-.El
diff --git a/archivers/libarchive/files/cpio/cmdline.c b/archivers/libarchive/files/cpio/cmdline.c
index 6c92b5dcd60..06689325707 100644
--- a/archivers/libarchive/files/cpio/cmdline.c
+++ b/archivers/libarchive/files/cpio/cmdline.c
@@ -66,7 +66,7 @@ struct option {
*/
-static const char *cpio_opts = "aBcdf:H:hijlmopR:rtuvW:yz";
+static const char *cpio_opts = "aBcdf:H:hijLlmopR:rtuvW:yz";
/*
* On systems that lack getopt_long, long options can be specified
diff --git a/archivers/libarchive/files/cpio/cpio.c b/archivers/libarchive/files/cpio/cpio.c
index 6a74431d007..9f24d9c4626 100644
--- a/archivers/libarchive/files/cpio/cpio.c
+++ b/archivers/libarchive/files/cpio/cpio.c
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#endif
#include "cpio.h"
+#include "matching.h"
static int copy_data(struct archive *, struct archive *);
static const char *cpio_rename(const char *name);
@@ -68,6 +69,8 @@ static void mode_pass(struct cpio *, const char *);
static int out_file(struct cpio *, const char *pathname);
static int process_lines(struct cpio *cpio, const char *pathname,
int (*process)(struct cpio *, const char *));
+static void restore_time(struct cpio *, struct archive_entry *,
+ const char *, int fd);
static void usage(void);
static void version(FILE *);
@@ -77,14 +80,14 @@ main(int argc, char *argv[])
struct cpio _cpio; /* Allocated on stack. */
struct cpio *cpio;
int uid, gid;
- char opt;
+ int opt;
cpio = &_cpio;
memset(cpio, 0, sizeof(*cpio));
/* Need cpio_progname before calling cpio_warnc. */
if (*argv == NULL)
- cpio_progname = "cpio";
+ cpio_progname = "bsdcpio";
else {
cpio_progname = strrchr(*argv, '/');
if (cpio_progname != NULL)
@@ -123,7 +126,7 @@ main(int argc, char *argv[])
cpio->extract_flags &= ~ARCHIVE_EXTRACT_NO_AUTODIR;
break;
case 'f': /* POSIX 1997 */
- /* TODO */
+ exclude(cpio, optarg);
break;
case 'H': /* GNU cpio, also --format */
cpio->format = optarg;
@@ -135,7 +138,7 @@ main(int argc, char *argv[])
cpio->mode = opt;
break;
case 'L': /* GNU cpio, BSD convention */
- /* TODO: Implement this */
+ cpio->option_follow_links = 1;
break;
case 'l': /* POSIX 1997 */
cpio->option_link = 1;
@@ -174,7 +177,7 @@ main(int argc, char *argv[])
cpio->verbose++;
break;
case OPTION_VERSION: /* GNU convention */
- version(stderr);
+ version(stdout);
break;
#if 0
/*
@@ -205,7 +208,11 @@ main(int argc, char *argv[])
mode_out(cpio);
break;
case 'i':
- /* TODO: parse patterns on command line. */
+ while (*cpio->argv != NULL) {
+ include(cpio, *cpio->argv);
+ --cpio->argc;
+ ++cpio->argv;
+ }
if (cpio->option_list)
mode_list(cpio);
else
@@ -304,6 +311,7 @@ version(FILE *out)
static void
mode_out(struct cpio *cpio)
{
+ unsigned long blocks;
int r;
cpio->archive = archive_write_new();
@@ -334,6 +342,13 @@ mode_out(struct cpio *cpio)
r = archive_write_close(cpio->archive);
if (r != ARCHIVE_OK)
cpio_errc(1, 0, archive_error_string(cpio->archive));
+
+ if (!cpio->quiet) {
+ blocks = (archive_position_uncompressed(cpio->archive) + 511)
+ / 512;
+ fprintf(stderr, "%lu %s\n", blocks,
+ blocks == 1 ? "block" : "blocks");
+ }
archive_write_finish(cpio->archive);
}
@@ -377,8 +392,12 @@ file_to_archive(struct cpio *cpio, const char *srcpath, const char *destpath)
/* TODO: pathname editing. */
- if (lstat(srcpath, &st) != 0) {
- cpio_warnc(errno, "Couldn't stat");
+ if (cpio->option_follow_links)
+ r = stat(srcpath, &st);
+ else
+ r = lstat(srcpath, &st);
+ if (r != 0) {
+ cpio_warnc(errno, "Couldn't stat \"%s\"", srcpath);
goto cleanup;
}
@@ -466,9 +485,7 @@ file_to_archive(struct cpio *cpio, const char *srcpath, const char *destpath)
}
}
- if (cpio->option_atime_restore) {
- /* TODO: invoke utimes() ?? */
- }
+ restore_time(cpio, entry, srcpath, fd);
cleanup:
if (cpio->verbose)
@@ -481,6 +498,48 @@ cleanup:
return (0);
}
+static void
+restore_time(struct cpio *cpio, struct archive_entry *entry,
+ const char *name, int fd)
+{
+#ifndef HAVE_UTIMES
+ static int warned = 0;
+
+ (void)cpio; /* UNUSED */
+ (void)entry; /* UNUSED */
+ (void)name; /* UNUSED */
+ (void)fd; /* UNUSED */
+
+ if (!warned)
+ cpio_warnc(0, "Can't restore access times on this platform");
+ warned = 1;
+ return;
+#else
+ struct timeval times[2];
+
+ if (!cpio->option_atime_restore)
+ return;
+
+ times[1].tv_sec = archive_entry_mtime(entry);
+ times[1].tv_usec = archive_entry_mtime_nsec(entry) / 1000;
+
+ times[0].tv_sec = archive_entry_atime(entry);
+ times[0].tv_usec = archive_entry_atime_nsec(entry) / 1000;
+
+#ifdef HAVE_FUTIMES
+ if (fd >= 0 && futimes(fd, times) == 0)
+ return;
+#endif
+
+#ifdef HAVE_LUTIMES
+ if (lutimes(name, times) != 0)
+#else
+ if (!S_ISLNK(archive_entry_mode(entry)) && utimes(name, times) != 0)
+#endif
+ cpio_warnc(errno, "Can't update time for %s", name);
+#endif
+}
+
static void
mode_in(struct cpio *cpio)
@@ -489,6 +548,7 @@ mode_in(struct cpio *cpio)
struct archive_entry *entry;
struct archive *ext;
const char *destpath;
+ unsigned long blocks;
int r;
ext = archive_write_disk_new();
@@ -514,6 +574,8 @@ mode_in(struct cpio *cpio)
cpio_errc(1, archive_errno(a),
archive_error_string(a));
}
+ if (excluded(cpio, archive_entry_pathname(entry)))
+ continue;
if (cpio->option_rename) {
destpath = cpio_rename(archive_entry_pathname(entry));
archive_entry_set_pathname(entry, destpath);
@@ -539,10 +601,16 @@ mode_in(struct cpio *cpio)
r = archive_read_close(a);
if (r != ARCHIVE_OK)
cpio_errc(1, 0, archive_error_string(a));
- archive_read_finish(a);
r = archive_write_close(ext);
if (r != ARCHIVE_OK)
cpio_errc(1, 0, archive_error_string(ext));
+ if (!cpio->quiet) {
+ blocks = (archive_position_uncompressed(a) + 511)
+ / 512;
+ fprintf(stderr, "%lu %s\n", blocks,
+ blocks == 1 ? "block" : "blocks");
+ }
+ archive_read_finish(a);
archive_write_finish(ext);
exit(0);
}
@@ -578,6 +646,7 @@ mode_list(struct cpio *cpio)
{
struct archive *a;
struct archive_entry *entry;
+ unsigned long blocks;
int r;
a = archive_read_new();
@@ -597,6 +666,8 @@ mode_list(struct cpio *cpio)
cpio_errc(1, archive_errno(a),
archive_error_string(a));
}
+ if (excluded(cpio, archive_entry_pathname(entry)))
+ continue;
if (cpio->verbose) {
/* TODO: uname/gname lookups */
/* TODO: Clean this up. */
@@ -614,6 +685,12 @@ mode_list(struct cpio *cpio)
r = archive_read_close(a);
if (r != ARCHIVE_OK)
cpio_errc(1, 0, archive_error_string(a));
+ if (!cpio->quiet) {
+ blocks = (archive_position_uncompressed(a) + 511)
+ / 512;
+ fprintf(stderr, "%lu %s\n", blocks,
+ blocks == 1 ? "block" : "blocks");
+ }
archive_read_finish(a);
exit(0);
}
@@ -717,9 +794,6 @@ cpio_rename(const char *name)
/* Trim the final newline. */
while (*p != '\0' && *p != '\n')
++p;
- if (*p == '\0') {
- /* TODO: Handle this error somehow. */
- }
/* Overwrite the final \n with a null character. */
*p = '\0';
return (ret);
diff --git a/archivers/libarchive/files/cpio/cpio.h b/archivers/libarchive/files/cpio/cpio.h
index 624c13babae..a928d595b1e 100644
--- a/archivers/libarchive/files/cpio/cpio.h
+++ b/archivers/libarchive/files/cpio/cpio.h
@@ -25,6 +25,9 @@
* $FreeBSD$
*/
+#ifndef CPIO_H_INCLUDED
+#define CPIO_H_INCLUDED
+
#include "cpio_platform.h"
#include <stdio.h>
@@ -51,9 +54,10 @@ struct cpio {
char symlink_mode; /* H or L, per BSD conventions */
const char *compress_program;
int option_atime_restore; /* -a */
- int option_null; /* -0 --null */
- int option_list; /* -t */
+ int option_follow_links; /* -L */
int option_link; /* -l */
+ int option_list; /* -t */
+ int option_null; /* -0 --null */
int option_rename; /* -r */
char *pass_destdir;
size_t pass_destpath_alloc;
@@ -70,6 +74,8 @@ struct cpio {
char **argv;
int return_value; /* Value returned by main() */
struct archive_entry_linkresolver *linkresolver;
+
+ struct matching *matching;
};
/* Name of this program; used in error reporting, initialized in main(). */
@@ -88,4 +94,5 @@ enum {
};
int cpio_getopt(struct cpio *cpio);
-int pathmatch(const char *pattern, const char *s);
+
+#endif
diff --git a/archivers/libarchive/files/cpio/matching.c b/archivers/libarchive/files/cpio/matching.c
new file mode 100644
index 00000000000..d949ea8949b
--- /dev/null
+++ b/archivers/libarchive/files/cpio/matching.c
@@ -0,0 +1,252 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+
+#include "cpio_platform.h"
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "matching.h"
+#include "pathmatch.h"
+
+struct match {
+ struct match *next;
+ int matches;
+ char pattern[1];
+};
+
+struct matching {
+ struct match *exclusions;
+ int exclusions_count;
+ struct match *inclusions;
+ int inclusions_count;
+ int inclusions_unmatched_count;
+};
+
+static void add_pattern(struct match **list, const char *pattern);
+static void initialize_matching(struct cpio *);
+static int match_exclusion(struct match *, const char *pathname);
+static int match_inclusion(struct match *, const char *pathname);
+
+/*
+ * The matching logic here needs to be re-thought. I started out to
+ * try to mimic gtar's matching logic, but it's not entirely
+ * consistent. In particular 'tar -t' and 'tar -x' interpret patterns
+ * on the command line as anchored, but --exclude doesn't.
+ */
+
+/*
+ * Utility functions to manage exclusion/inclusion patterns
+ */
+
+int
+exclude(struct cpio *cpio, const char *pattern)
+{
+ struct matching *matching;
+
+ if (cpio->matching == NULL)
+ initialize_matching(cpio);
+ matching = cpio->matching;
+ add_pattern(&(matching->exclusions), pattern);
+ matching->exclusions_count++;
+ return (0);
+}
+
+#if 0
+int
+exclude_from_file(struct cpio *cpio, const char *pathname)
+{
+ return (process_lines(cpio, pathname, &exclude));
+}
+#endif
+
+int
+include(struct cpio *cpio, const char *pattern)
+{
+ struct matching *matching;
+
+ if (cpio->matching == NULL)
+ initialize_matching(cpio);
+ matching = cpio->matching;
+ add_pattern(&(matching->inclusions), pattern);
+ matching->inclusions_count++;
+ matching->inclusions_unmatched_count++;
+ return (0);
+}
+
+#if 0
+int
+include_from_file(struct cpio *cpio, const char *pathname)
+{
+ return (process_lines(cpio, pathname, &include));
+}
+#endif
+
+static void
+add_pattern(struct match **list, const char *pattern)
+{
+ struct match *match;
+
+ match = malloc(sizeof(*match) + strlen(pattern) + 1);
+ if (match == NULL)
+ cpio_errc(1, errno, "Out of memory");
+ if (pattern[0] == '/')
+ pattern++;
+ strcpy(match->pattern, pattern);
+ /* Both "foo/" and "foo" should match "foo/bar". */
+ if (match->pattern[strlen(match->pattern)-1] == '/')
+ match->pattern[strlen(match->pattern)-1] = '\0';
+ match->next = *list;
+ *list = match;
+ match->matches = 0;
+}
+
+
+int
+excluded(struct cpio *cpio, const char *pathname)
+{
+ struct matching *matching;
+ struct match *match;
+ struct match *matched;
+
+ matching = cpio->matching;
+ if (matching == NULL)
+ return (0);
+
+ /* Exclusions take priority */
+ for (match = matching->exclusions; match != NULL; match = match->next){
+ if (match_exclusion(match, pathname))
+ return (1);
+ }
+
+ /* Then check for inclusions */
+ matched = NULL;
+ for (match = matching->inclusions; match != NULL; match = match->next){
+ if (match_inclusion(match, pathname)) {
+ /*
+ * If this pattern has never been matched,
+ * then we're done.
+ */
+ if (match->matches == 0) {
+ match->matches++;
+ matching->inclusions_unmatched_count++;
+ return (0);
+ }
+ /*
+ * Otherwise, remember the match but keep checking
+ * in case we can tick off an unmatched pattern.
+ */
+ matched = match;
+ }
+ }
+ /*
+ * We didn't find a pattern that had never been matched, but
+ * we did find a match, so count it and exit.
+ */
+ if (matched != NULL) {
+ matched->matches++;
+ return (0);
+ }
+
+ /* If there were inclusions, default is to exclude. */
+ if (matching->inclusions != NULL)
+ return (1);
+
+ /* No explicit inclusions, default is to match. */
+ return (0);
+}
+
+/*
+ * This is a little odd, but it matches the default behavior of
+ * gtar. In particular, 'a*b' will match 'foo/a1111/222b/bar'
+ *
+ */
+int
+match_exclusion(struct match *match, const char *pathname)
+{
+ return (pathmatch(match->pattern,
+ pathname,
+ PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
+}
+
+/*
+ * Again, mimic gtar: inclusions are always anchored (have to match
+ * the beginning of the path) even though exclusions are not anchored.
+ */
+int
+match_inclusion(struct match *match, const char *pathname)
+{
+ return (pathmatch(match->pattern, pathname, 0));
+}
+
+void
+cleanup_exclusions(struct cpio *cpio)
+{
+ struct match *p, *q;
+
+ if (cpio->matching) {
+ p = cpio->matching->inclusions;
+ while (p != NULL) {
+ q = p;
+ p = p->next;
+ free(q);
+ }
+ p = cpio->matching->exclusions;
+ while (p != NULL) {
+ q = p;
+ p = p->next;
+ free(q);
+ }
+ free(cpio->matching);
+ }
+}
+
+static void
+initialize_matching(struct cpio *cpio)
+{
+ cpio->matching = malloc(sizeof(*cpio->matching));
+ if (cpio->matching == NULL)
+ cpio_errc(1, errno, "No memory");
+ memset(cpio->matching, 0, sizeof(*cpio->matching));
+}
+
+int
+unmatched_inclusions(struct cpio *cpio)
+{
+ struct matching *matching;
+
+ matching = cpio->matching;
+ if (matching == NULL)
+ return (0);
+ return (matching->inclusions_unmatched_count);
+}
diff --git a/archivers/libarchive/files/cpio/matching.h b/archivers/libarchive/files/cpio/matching.h
new file mode 100644
index 00000000000..a66bc86bc73
--- /dev/null
+++ b/archivers/libarchive/files/cpio/matching.h
@@ -0,0 +1,40 @@
+/*-
+ * Copyright (c) 2003-2007 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
+ * in this position and unchanged.
+ * 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(S) ``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(S) 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$
+ */
+
+#ifndef MATCHING_H
+#define MATCHING_H
+
+#include "cpio.h"
+
+int exclude(struct cpio *, const char *pattern);
+int include(struct cpio *, const char *pattern);
+int excluded(struct cpio *cpio, const char *pathname);
+void cleanup_exclusions(struct cpio *cpio);
+int unmatched_inclusions(struct cpio *cpio);
+
+#endif
diff --git a/archivers/libarchive/files/cpio/pathmatch.c b/archivers/libarchive/files/cpio/pathmatch.c
new file mode 100644
index 00000000000..d33bd343898
--- /dev/null
+++ b/archivers/libarchive/files/cpio/pathmatch.c
@@ -0,0 +1,250 @@
+/*-
+ * Copyright (c) 2003-2007 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
+ * in this position and unchanged.
+ * 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(S) ``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(S) 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.
+ */
+
+#include "cpio_platform.h"
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "pathmatch.h"
+
+/*
+ * Check whether a character 'c' is matched by a list specification [...]:
+ * * Leading '!' negates the class.
+ * * <char>-<char> is a range of characters
+ * * \<char> removes any special meaning for <char>
+ *
+ * Some interesting boundary cases:
+ * a-d-e is one range (a-d) followed by two single characters - and e.
+ * \a-\d is same as a-d
+ * a\-d is three single characters: a, d, -
+ * Trailing - is not special (so [a-] is two characters a and -).
+ * Initial - is not special ([a-] is same as [-a] is same as [\\-a])
+ * This function never sees a trailing \.
+ * [] always fails
+ * [!] always succeeds
+ */
+static int
+pm_list(const char *start, const char *end, const char c, int flags)
+{
+ const char *p = start;
+ char rangeStart = '\0', nextRangeStart;
+ int match = 1, nomatch = 0;
+
+ /* This will be used soon... */
+ (void)flags; /* UNUSED */
+
+ /* If this is a negated class, return success for nomatch. */
+ if (*p == '!' && p < end) {
+ match = 0;
+ nomatch = 1;
+ ++p;
+ }
+
+ while (p < end) {
+ nextRangeStart = '\0';
+ switch (*p) {
+ case '-':
+ /* Trailing or initial '-' is not special. */
+ if ((rangeStart == '\0') || (p == end - 1)) {
+ if (*p == c)
+ return (match);
+ } else {
+ char rangeEnd = *++p;
+ if (rangeEnd == '\\')
+ rangeEnd = *++p;
+ if ((rangeStart <= c) && (c <= rangeEnd))
+ return (match);
+ }
+ break;
+ case '\\':
+ ++p;
+ /* Fall through */
+ default:
+ if (*p == c)
+ return (match);
+ nextRangeStart = *p; /* Possible start of range. */
+ }
+ rangeStart = nextRangeStart;
+ ++p;
+ }
+ return (nomatch);
+}
+
+/*
+ * If s is pointing to "./", ".//", "./././" or the like, skip it.
+ */
+static const char *
+pm_slashskip(const char *s) {
+ while (*s == '.' || *s == '/') {
+ if (s[0] != '/' && s[1] != '/')
+ break;
+ ++s;
+ }
+ return (s);
+}
+
+static int
+pm(const char *p, const char *s, int flags)
+{
+ const char *end;
+
+ /*
+ * Ignore leading './', './/', '././', etc.
+ */
+ if (s[0] == '.' && s[1] == '/')
+ s = pm_slashskip(s + 1);
+ if (p[0] == '.' && p[1] == '/')
+ p = pm_slashskip(p + 1);
+
+ for (;;) {
+ switch (*p) {
+ case '\0':
+ if (s[0] == '/') {
+ if (flags & PATHMATCH_NO_ANCHOR_END)
+ return (1);
+ /* "dir" == "dir/" == "dir/." */
+ s = pm_slashskip(s);
+ if (s[0] == '.' && s[1] == '\0')
+ return (1);
+ }
+ return (*s == '\0');
+ break;
+ case '?':
+ /* ? always succeds, unless we hit end of 's' */
+ if (*s == '\0')
+ return (0);
+ break;
+ case '*':
+ /* "*" == "**" == "***" ... */
+ while (*p == '*')
+ ++p;
+ /* Trailing '*' always succeeds. */
+ if (*p == '\0')
+ return (1);
+ while (*s) {
+ if (pathmatch(p, s, flags))
+ return (1);
+ ++s;
+ }
+ return (0);
+ break;
+ case '[':
+ /*
+ * Find the end of the [...] character class,
+ * ignoring \] that might occur within the class.
+ */
+ end = p + 1;
+ while (*end != '\0' && *end != ']') {
+ if (*end == '\\' && end[1] != '\0')
+ ++end;
+ ++end;
+ }
+ if (*end == ']') {
+ /* We found [...], try to match it. */
+ if (!pm_list(p + 1, end, *s, flags))
+ return (0);
+ p = end; /* Jump to trailing ']' char. */
+ break;
+ } else
+ /* No final ']', so just match '['. */
+ if (*p != *s)
+ return (0);
+ break;
+ default:
+ if (*p == *s)
+ break;
+ if ((*s == '\0') && (*p == '/')) {
+ p = pm_slashskip(p);
+ if (*p == '\0')
+ return (1);
+ if (p[0] == '.' && p[1] == '\0')
+ return (1);
+ return (0);
+ }
+ return (0);
+ break;
+ case '\\':
+ /* Trailing '\\' matches itself. */
+ if (p[1] == '\0') {
+ if (*s != '\\')
+ return (0);
+ } else {
+ ++p;
+ if (*p != *s)
+ return (0);
+ }
+ break;
+ }
+ /*
+ * TODO: pattern of "\/\.\/" should not match plain "/",
+ * it should only match explicit "/./".
+ */
+ if (*p == '/')
+ p = pm_slashskip(p);
+ else
+ ++p;
+ if (*s == '/')
+ s = pm_slashskip(s);
+ else
+ ++s;
+ }
+}
+
+/* Main entry point. */
+int
+pathmatch(const char *p, const char *s, int flags)
+{
+ /* Empty pattern only matches the empty string. */
+ if (p == NULL || *p == '\0')
+ return (s == NULL || *s == '\0');
+
+ /* Leading '^' anchors the start of the pattern. */
+ if (*p == '^') {
+ ++p;
+ flags &= ~PATHMATCH_NO_ANCHOR_START;
+ }
+
+ /* Certain patterns anchor implicitly. */
+ if (*p == '*' || *p == '/')
+ return (pm(p, s, flags));
+
+ /* If start is unanchored, try to match start of each path element. */
+ if (flags & PATHMATCH_NO_ANCHOR_START) {
+ for ( ; p != NULL; p = strchr(p, '/')) {
+ if (*p == '/')
+ p++;
+ if (pm(p, s, flags))
+ return (1);
+ }
+ return (0);
+ }
+
+ /* Default: Match from beginning. */
+ return (pm(p, s, flags));
+}
diff --git a/archivers/libarchive/files/cpio/pathmatch.h b/archivers/libarchive/files/cpio/pathmatch.h
new file mode 100644
index 00000000000..990fa1fa1e0
--- /dev/null
+++ b/archivers/libarchive/files/cpio/pathmatch.h
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2003-2007 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
+ * in this position and unchanged.
+ * 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(S) ``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(S) 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$
+ */
+
+#ifndef PATHMATCH_H
+#define PATHMATCH_H
+
+#define PATHMATCH_NO_ANCHOR_START 1
+#define PATHMATCH_NO_ANCHOR_END 2
+
+int pathmatch(const char *p, const char *s, int flags);
+
+#endif
diff --git a/archivers/libarchive/files/cpio/test/list.h b/archivers/libarchive/files/cpio/test/list.h
index f0620311681..9b0197cd50f 100644
--- a/archivers/libarchive/files/cpio/test/list.h
+++ b/archivers/libarchive/files/cpio/test/list.h
@@ -1,11 +1,19 @@
DEFINE_TEST(test_basic)
+DEFINE_TEST(test_format_newc)
DEFINE_TEST(test_gcpio_compat)
-DEFINE_TEST(test_help)
DEFINE_TEST(test_option_B)
+DEFINE_TEST(test_option_L)
+DEFINE_TEST(test_option_a)
+DEFINE_TEST(test_option_c)
DEFINE_TEST(test_option_d)
+DEFINE_TEST(test_option_ell)
+DEFINE_TEST(test_option_f)
+DEFINE_TEST(test_option_help)
DEFINE_TEST(test_option_m)
DEFINE_TEST(test_option_t)
+DEFINE_TEST(test_option_u)
+DEFINE_TEST(test_option_version)
+DEFINE_TEST(test_option_y)
+DEFINE_TEST(test_option_z)
DEFINE_TEST(test_owner_parse)
DEFINE_TEST(test_pathmatch)
-DEFINE_TEST(test_version)
-DEFINE_TEST(test_write_odc)
diff --git a/archivers/libarchive/files/cpio/test/main.c b/archivers/libarchive/files/cpio/test/main.c
index 6eb7b5d5e57..373238fa2fb 100644
--- a/archivers/libarchive/files/cpio/test/main.c
+++ b/archivers/libarchive/files/cpio/test/main.c
@@ -24,6 +24,17 @@
*/
/*
+ * This same file is used pretty much verbatim for all test harnesses.
+ *
+ * The next line is used to define various environment variables, etc.
+ *
+ * The tar and cpio test harnesses are identical except for this line;
+ * the libarchive test harness omits some code that is needed only for
+ * testing standalone executables.
+ */
+#define PROGRAM "BSDCPIO"
+
+/*
* Various utility routines useful for test programs.
* Each test program is linked against this file.
*/
@@ -32,7 +43,7 @@
#include <time.h>
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.8 2007/07/31 05:03:27 kientzle Exp $");
+__FBSDID("$FreeBSD$");
/*
* "list.h" is simply created by "grep DEFINE_TEST"; it has
@@ -60,6 +71,8 @@ static int quiet_flag = 0;
static int failures = 0;
/* Cumulative count of skipped component tests. */
static int skips = 0;
+/* Cumulative count of assertions. */
+static int assertions = 0;
/*
* My own implementation of the standard assert() macro emits the
@@ -80,7 +93,7 @@ static char msg[4096];
* For each test source file, we remember how many times each
* failure was reported.
*/
-static const char *failed_filename;
+static const char *failed_filename = NULL;
static struct line {
int line;
int count;
@@ -115,6 +128,18 @@ previous_failures(const char *filename, int line)
}
/*
+ * Copy arguments into file-local variables.
+ */
+static const char *test_filename;
+static int test_line;
+static void *test_extra;
+void test_setup(const char *filename, int line)
+{
+ test_filename = filename;
+ test_line = line;
+}
+
+/*
* Inform user that we're skipping a test.
*/
void
@@ -200,85 +225,93 @@ failure(const char *fmt, ...)
}
/* Generic assert() just displays the failed condition. */
-void
+int
test_assert(const char *file, int line, int value, const char *condition, void *extra)
{
+ ++assertions;
if (value) {
msg[0] = '\0';
- return;
+ return (1);
}
failures ++;
if (previous_failures(file, line))
- return;
+ return (0);
fprintf(stderr, "%s:%d: Assertion failed\n", file, line);
fprintf(stderr, " Condition: %s\n", condition);
report_failure(extra);
+ return (0);
}
/* assertEqualInt() displays the values of the two integers. */
-void
+int
test_assert_equal_int(const char *file, int line,
int v1, const char *e1, int v2, const char *e2, void *extra)
{
+ ++assertions;
if (v1 == v2) {
msg[0] = '\0';
- return;
+ return (1);
}
failures ++;
if (previous_failures(file, line))
- return;
+ return (0);
fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n",
file, line);
fprintf(stderr, " %s=%d\n", e1, v1);
fprintf(stderr, " %s=%d\n", e2, v2);
report_failure(extra);
+ return (0);
}
/* assertEqualString() displays the values of the two strings. */
-void
+int
test_assert_equal_string(const char *file, int line,
const char *v1, const char *e1,
const char *v2, const char *e2,
void *extra)
{
+ ++assertions;
if (v1 == NULL || v2 == NULL) {
if (v1 == v2) {
msg[0] = '\0';
- return;
+ return (1);
}
} else if (strcmp(v1, v2) == 0) {
msg[0] = '\0';
- return;
+ return (1);
}
failures ++;
if (previous_failures(file, line))
- return;
+ return (0);
fprintf(stderr, "%s:%d: Assertion failed: Strings not equal\n",
file, line);
fprintf(stderr, " %s = \"%s\"\n", e1, v1);
fprintf(stderr, " %s = \"%s\"\n", e2, v2);
report_failure(extra);
+ return (0);
}
/* assertEqualWString() displays the values of the two strings. */
-void
+int
test_assert_equal_wstring(const char *file, int line,
const wchar_t *v1, const char *e1,
const wchar_t *v2, const char *e2,
void *extra)
{
+ ++assertions;
if (wcscmp(v1, v2) == 0) {
msg[0] = '\0';
- return;
+ return (1);
}
failures ++;
if (previous_failures(file, line))
- return;
+ return (0);
fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n",
file, line);
fwprintf(stderr, L" %s = \"%ls\"\n", e1, v1);
fwprintf(stderr, L" %s = \"%ls\"\n", e2, v2);
report_failure(extra);
+ return (0);
}
/*
@@ -298,7 +331,7 @@ hexdump(const char *p, const char *ref, size_t l, size_t offset)
for (j = 0; j < 16 && i + j < l; j++) {
if (ref != NULL && p[i + j] != ref[i + j])
sep = '_';
- fprintf(stderr, "%c%02x", sep, p[i+j]);
+ fprintf(stderr, "%c%02x", sep, 0xff & (int)p[i+j]);
if (ref != NULL && p[i + j] == ref[i + j])
sep = ' ';
}
@@ -320,24 +353,25 @@ hexdump(const char *p, const char *ref, size_t l, size_t offset)
/* assertEqualMem() displays the values of the two memory blocks. */
/* TODO: For long blocks, hexdump the first bytes that actually differ. */
-void
+int
test_assert_equal_mem(const char *file, int line,
const char *v1, const char *e1,
const char *v2, const char *e2,
size_t l, const char *ld, void *extra)
{
+ ++assertions;
if (v1 == NULL || v2 == NULL) {
if (v1 == v2) {
msg[0] = '\0';
- return;
+ return (1);
}
} else if (memcmp(v1, v2, l) == 0) {
msg[0] = '\0';
- return;
+ return (1);
}
failures ++;
if (previous_failures(file, line))
- return;
+ return (0);
fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n",
file, line);
fprintf(stderr, " size %s = %d\n", ld, (int)l);
@@ -347,14 +381,19 @@ test_assert_equal_mem(const char *file, int line,
hexdump(v2, v1, l < 32 ? l : 32, 0);
fprintf(stderr, "\n");
report_failure(extra);
+ return (0);
}
-void
+int
test_assert_empty_file(const char *f1fmt, ...)
{
+ char buff[1024];
char f1[1024];
struct stat st;
va_list ap;
+ ssize_t s;
+ int fd;
+
va_start(ap, f1fmt);
vsprintf(f1, f1fmt, ap);
@@ -363,16 +402,32 @@ test_assert_empty_file(const char *f1fmt, ...)
if (stat(f1, &st) != 0) {
fprintf(stderr, "%s:%d: Could not stat: %s\n", test_filename, test_line, f1);
report_failure(NULL);
- } else if (st.st_size > 0) {
- fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1);
- fprintf(stderr, " File size: %d\n", (int)st.st_size);
- report_failure(NULL);
}
+ if (st.st_size == 0)
+ return (1);
+
+ failures ++;
+ if (previous_failures(test_filename, test_line))
+ return (0);
+
+ fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1);
+ fprintf(stderr, " File size: %d\n", (int)st.st_size);
+ fprintf(stderr, " Contents:\n");
+ fd = open(f1, O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, " Unable to open %s\n", f1);
+ } else {
+ s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size;
+ s = read(fd, buff, s);
+ hexdump(buff, NULL, s, 0);
+ }
+ report_failure(NULL);
+ return (0);
}
/* assertEqualFile() asserts that two files have the same contents. */
/* TODO: hexdump the first bytes that actually differ. */
-void
+int
test_assert_equal_file(const char *f1, const char *f2pattern, ...)
{
char f2[1024];
@@ -394,14 +449,57 @@ test_assert_equal_file(const char *f1, const char *f2pattern, ...)
if (n1 != n2)
break;
if (n1 == 0 && n2 == 0)
- return;
+ return (1);
if (memcmp(buff1, buff2, n1) != 0)
break;
}
- fprintf(stderr, "%s:%d: Files are not identical\n", test_filename, test_line);
+ failures ++;
+ if (previous_failures(test_filename, test_line))
+ return (0);
+ fprintf(stderr, "%s:%d: Files are not identical\n",
+ test_filename, test_line);
fprintf(stderr, " file1=\"%s\"\n", f1);
fprintf(stderr, " file2=\"%s\"\n", f2);
report_failure(test_extra);
+ return (0);
+}
+
+/* assertFileContents() asserts the contents of a file. */
+int
+test_assert_file_contents(const void *buff, int s, const char *fpattern, ...)
+{
+ char f[1024];
+ va_list ap;
+ char *contents;
+ int fd;
+ int n;
+
+ va_start(ap, fpattern);
+ vsprintf(f, fpattern, ap);
+ va_end(ap);
+
+ fd = open(f, O_RDONLY);
+ contents = malloc(s * 2);
+ n = read(fd, contents, s * 2);
+ if (n == s && memcmp(buff, contents, s) == 0) {
+ free(contents);
+ return (1);
+ }
+ failures ++;
+ if (!previous_failures(test_filename, test_line)) {
+ fprintf(stderr, "%s:%d: File contents don't match\n",
+ test_filename, test_line);
+ fprintf(stderr, " file=\"%s\"\n", f);
+ if (n > 0)
+ hexdump(contents, buff, n, 0);
+ else {
+ fprintf(stderr, " File empty, contents should be:\n");
+ hexdump(buff, NULL, s, 0);
+ }
+ report_failure(test_extra);
+ }
+ free(contents);
+ return (0);
}
@@ -542,7 +640,7 @@ static void usage(const char *program)
printf(" -k Keep running after failures.\n");
printf(" Default: Core dump after any failure.\n");
printf(" -p <path> Path to executable to be tested.\n");
- printf(" Default: path taken from BSDCPIO environment variable.\n");
+ printf(" Default: path taken from " PROGRAM " environment variable.\n");
printf(" -q Quiet.\n");
printf(" -r <dir> Path to dir containing reference files.\n");
printf(" Default: Current directory.\n");
@@ -557,6 +655,7 @@ int main(int argc, char **argv)
static const int limit = sizeof(tests) / sizeof(tests[0]);
int i, tests_run = 0, tests_failed = 0, opt;
time_t now;
+ char *refdir_alloc = NULL;
char *progname, *p;
char tmpdir[256];
char tmpdir_timestamp[256];
@@ -573,10 +672,14 @@ int main(int argc, char **argv)
}
/* Get the target program from environment, if available. */
- testprog = getenv("BSDCPIO");
+ testprog = getenv(PROGRAM);
+
+ /* Allow -k to be controlled through the environment. */
+ if (getenv(PROGRAM "_KEEP_GOING") != NULL)
+ dump_on_failure = 0;
/* Get the directory holding test files from environment. */
- refdir = getenv("BSDCPIO_TEST_FILES");
+ refdir = getenv(PROGRAM "_TEST_FILES");
/*
* Parse options.
@@ -636,7 +739,7 @@ int main(int argc, char **argv)
*/
if (refdir == NULL) {
systemf("/bin/pwd > %s/refdir", tmpdir);
- refdir = slurpfile(NULL, "%s/refdir", tmpdir);
+ refdir = refdir_alloc = slurpfile(NULL, "%s/refdir", tmpdir);
p = refdir + strlen(refdir);
while (p[-1] == '\n') {
--p;
@@ -683,10 +786,14 @@ int main(int argc, char **argv)
*/
if (!quiet_flag) {
printf("\n");
- printf("%d of %d test groups reported failures\n",
+ printf("%d of %d tests reported failures\n",
tests_failed, tests_run);
- printf(" Total of %d individual tests failed.\n", failures);
- printf(" Total of %d individual tests were skipped.\n", skips);
+ printf(" Total of %d assertions checked.\n", assertions);
+ printf(" Total of %d assertions failed.\n", failures);
+ printf(" Total of %d assertions skipped.\n", skips);
}
+
+ free(refdir_alloc);
+
return (tests_failed);
}
diff --git a/archivers/libarchive/files/cpio/test/test.h b/archivers/libarchive/files/cpio/test/test.h
index 77205550465..fcd3304d4ef 100644
--- a/archivers/libarchive/files/cpio/test/test.h
+++ b/archivers/libarchive/files/cpio/test/test.h
@@ -94,30 +94,35 @@
* See below for comments about variable arguments here...
*/
#define assertEqualFile \
- test_extra=NULL;test_filename=__FILE__;test_line=__LINE__;test_assert_equal_file
+ test_setup(__FILE__, __LINE__);test_assert_equal_file
/* Assert that a file is empty; supports printf-style arguments. */
#define assertEmptyFile \
- test_extra=NULL;test_filename=__FILE__;test_line=__LINE__;test_assert_empty_file
+ test_setup(__FILE__, __LINE__);test_assert_empty_file
+/* Assert that file contents match a string; supports printf-style arguments. */
+#define assertFileContents \
+ test_setup(__FILE__, __LINE__);test_assert_file_contents
/*
* This would be simple with C99 variadic macros, but I don't want to
- * require that. Instead, I just assign the file/line values here and
- * then replace the function call without trying to pass the variable
- * arguments through the macro. Crude, but effective.
+ * require that. Instead, I insert a function call before each
+ * skipping() call to pass the file and line information down. Crude,
+ * but effective.
*/
#define skipping \
- test_extra=NULL;test_filename=__FILE__;test_line=__LINE__;test_skipping
+ test_setup(__FILE__, __LINE__);test_skipping
/* Function declarations. These are defined in test_utility.c. */
void failure(const char *fmt, ...);
+void test_setup(const char *, int);
void test_skipping(const char *fmt, ...);
-void test_assert(const char *, int, int, const char *, void *);
-void test_assert_empty_file(const char *, ...);
-void test_assert_equal_file(const char *, const char *, ...);
-void test_assert_equal_int(const char *, int, int, const char *, int, const char *, void *);
-void test_assert_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
-void test_assert_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-void test_assert_equal_mem(const char *, int, const char *, const char *, const char *, const char *, size_t, const char *, void *);
+int test_assert(const char *, int, int, const char *, void *);
+int test_assert_empty_file(const char *, ...);
+int test_assert_equal_file(const char *, const char *, ...);
+int test_assert_equal_int(const char *, int, int, const char *, int, const char *, void *);
+int test_assert_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
+int test_assert_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
+int test_assert_equal_mem(const char *, int, const char *, const char *, const char *, const char *, size_t, const char *, void *);
+int test_assert_file_contents(const void *, int, const char *, ...);
/* Like sprintf, then system() */
int systemf(const char * fmt, ...);
@@ -132,10 +137,6 @@ char *slurpfile(size_t *, const char *fmt, ...);
/* Directory holding reference files. */
char *refdir;
-/* Filename, line number, pointer to extra data for failure reports. */
-const char *test_filename;
-int test_line;
-void *test_extra;
/*
* Special interfaces for bsdcpio test harness.
diff --git a/archivers/libarchive/files/cpio/test/test_basic.c b/archivers/libarchive/files/cpio/test/test_basic.c
index 492861e0673..3a9982b8e1c 100644
--- a/archivers/libarchive/files/cpio/test/test_basic.c
+++ b/archivers/libarchive/files/cpio/test/test_basic.c
@@ -36,8 +36,8 @@ basic_cpio(const char *target, const char *pack_options, const char *unpack_opti
assertEqualInt(0, mkdir(target, 0775));
/* Use the cpio program to create an archive. */
- r = systemf("%s -o %s < filelist >%s/archive 2>%s/pack.err", testprog, pack_options, target, target);
- failure("Error invoking %s -o %s", testprog, pack_options);
+ r = systemf("%s -o --quiet %s < filelist >%s/archive 2>%s/pack.err", testprog, pack_options, target, target);
+ failure("Error invoking %s -o --quiet %s", testprog, pack_options);
assertEqualInt(r, 0);
chdir(target);
@@ -48,11 +48,11 @@ basic_cpio(const char *target, const char *pack_options, const char *unpack_opti
/*
* Use cpio to unpack the archive into another directory.
*/
- r = systemf("%s -i %s< archive >unpack.out 2>unpack.err", testprog, unpack_options);
+ r = systemf("%s -i --quiet %s< archive >unpack.out 2>unpack.err", testprog, unpack_options);
failure("Error invoking %s -i %s", testprog, unpack_options);
assertEqualInt(r, 0);
- /* Verify that nothing went to stderr. */
+ /* Verify stderr. */
assertEmptyFile("unpack.err");
/*
@@ -152,7 +152,7 @@ DEFINE_TEST(test_basic)
basic_cpio("copy", "", "");
basic_cpio("copy_odc", "--format=odc", "");
basic_cpio("copy_newc", "-H newc", "");
- basic_cpio("copy_cpio", "-H cpio", "");
+ basic_cpio("copy_cpio", "-H odc", "");
basic_cpio("copy_ustar", "-H ustar", "");
umask(oldumask);
diff --git a/archivers/libarchive/files/cpio/test/test_format_newc.c b/archivers/libarchive/files/cpio/test/test_format_newc.c
new file mode 100644
index 00000000000..8d24ad5f020
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_format_newc.c
@@ -0,0 +1,238 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+static int
+is_hex(const char *p, size_t l)
+{
+ while (l > 0) {
+ if ((*p >= '0' && *p <= '9')
+ || (*p >= 'a' && *p <= 'f')
+ || (*p >= 'A' && *p <= 'F'))
+ {
+ --l;
+ ++p;
+ } else
+ return (0);
+
+ }
+ return (1);
+}
+
+static int
+from_hex(const char *p, size_t l)
+{
+ int r = 0;
+
+ while (l > 0) {
+ r *= 16;
+ if (*p >= 'a' && *p <= 'f')
+ r += *p + 10 - 'a';
+ else if (*p >= 'A' && *p <= 'F')
+ r += *p + 10 - 'A';
+ else
+ r += *p - '0';
+ --l;
+ ++p;
+ }
+ return (r);
+}
+
+DEFINE_TEST(test_format_newc)
+{
+ int fd, list;
+ int r;
+ int devmajor, devminor, ino, gid;
+ time_t t, now;
+ char *p, *e;
+ size_t s;
+ mode_t oldmask;
+
+ oldmask = umask(0);
+
+ /*
+ * Create an assortment of files.
+ * TODO: Extend this to cover more filetypes.
+ */
+ list = open("list", O_CREAT | O_WRONLY, 0644);
+
+ /* "file1" */
+ fd = open("file1", O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(10, write(fd, "123456789", 10));
+ close(fd);
+ assertEqualInt(6, write(list, "file1\n", 6));
+
+ /* "hardlink" */
+ assertEqualInt(0, link("file1", "hardlink"));
+ assertEqualInt(9, write(list, "hardlink\n", 9));
+
+ /* "symlink" */
+ assertEqualInt(0, symlink("file1", "symlink"));
+ assertEqualInt(8, write(list, "symlink\n", 8));
+
+ /* "dir" */
+ assertEqualInt(0, mkdir("dir", 0775));
+ assertEqualInt(4, write(list, "dir\n", 4));
+
+ /* Record some facts about what we just created: */
+ now = time(NULL); /* They were all created w/in last two seconds. */
+
+ /* Use the cpio program to create an archive. */
+ close(list);
+ r = systemf("%s -o --format=newc --quiet <list >newc.out 2>newc.err",
+ testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that nothing went to stderr. */
+ assertEmptyFile("newc.err");
+
+ /* Verify that stdout is a well-formed cpio file in "newc" format. */
+ p = slurpfile(&s, "newc.out");
+ assertEqualInt(s, 1024);
+ e = p;
+
+ /*
+ * Some of these assertions could be stronger, but it's
+ * a little tricky because they depend on the local environment.
+ */
+
+ /* First entry is "file1" */
+ assert(is_hex(e, 110)); /* Entire header is octal digits. */
+ assertEqualMem(e + 0, "070701", 6); /* Magic */
+ ino = from_hex(e + 6, 8); /* ino */
+ assertEqualInt(0x81a4, from_hex(e + 14, 8)); /* Mode */
+ assertEqualInt(from_hex(e + 22, 8), getuid()); /* uid */
+ gid = from_hex(e + 30, 8); /* gid */
+ assertEqualMem(e + 38, "00000002", 8); /* nlink */
+ t = from_hex(e + 46, 8); /* mtime */
+ failure("t=0x%08x now=0x%08x=%d", t, now, now);
+ assert(t <= now); /* File wasn't created in future. */
+ failure("t=0x%08x now - 2=0x%08x = %d", t, now - 2, now - 2);
+ assert(t >= now - 2); /* File was created w/in last 2 secs. */
+#if 0
+ /* TODO: FIX THIS!!! */
+ failure("newc format stores body only with last appearance of a link\n"
+ " first appearance should be empty, so this file size\n"
+ " field should be zero");
+ assertEqualInt(0, from_hex(e + 54, 8)); /* File size */
+#else
+ skipping("Known bug in writing hardlinks to newc files.\n This bug will be fixed before bsdcpio 1.0 is released.\n Note that this is not a bug in libarchive's implementation of newc format,\n it is a bug in bsdcpio not properly marking subsequent links to a file.");
+#endif
+ devmajor = from_hex(e + 62, 8); /* devmajor */
+ devminor = from_hex(e + 70, 8); /* devminor */
+ assert(is_hex(e + 78, 8)); /* rdevmajor */
+ assert(is_hex(e + 86, 8)); /* rdevminor */
+ assertEqualMem(e + 94, "00000006", 8); /* Name size */
+ assertEqualInt(0, from_hex(e + 102, 8)); /* check field */
+ assertEqualMem(e + 110, "file1\0", 6); /* Name contents */
+ /* Since there's another link, no file contents here. */
+ /* But add in file size so that an error here doesn't cascade. */
+ e += 116 + from_hex(e + 54, 8) + (3 & -from_hex(e + 54, 8));
+
+ /* Hardlink identical to "file1" */
+ assert(is_hex(e, 110));
+ assertEqualMem(e + 0, "070701", 6); /* Magic */
+ assertEqualInt(ino, from_hex(e + 6, 8)); /* ino */
+ assertEqualInt(0x81a4, from_hex(e + 14, 8)); /* Mode */
+ assertEqualInt(from_hex(e + 22, 8), getuid()); /* uid */
+ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
+ assertEqualMem(e + 38, "00000002", 8); /* nlink */
+ assertEqualInt(t, from_hex(e + 46, 8)); /* mtime */
+ assertEqualInt(10, from_hex(e + 54, 8)); /* File size */
+ assertEqualInt(devmajor, from_hex(e + 62, 8)); /* devmajor */
+ assertEqualInt(devminor, from_hex(e + 70, 8)); /* devminor */
+ assert(is_hex(e + 78, 8)); /* rdevmajor */
+ assert(is_hex(e + 86, 8)); /* rdevminor */
+ assertEqualMem(e + 94, "00000009", 8); /* Name size */
+ assertEqualInt(0, from_hex(e + 102, 8)); /* check field */
+ assertEqualMem(e + 110, "hardlink\0\0", 10); /* Name contents */
+ assertEqualMem(e + 120, "123456789\0\0\0", 12); /* File contents */
+ e += 120 + from_hex(e + 54, 8) + (3 & -from_hex(e + 54, 8));
+
+ /* "symlink" pointing to "file1" */
+ assert(is_hex(e, 110));
+ assertEqualMem(e + 0, "070701", 6); /* Magic */
+ assert(is_hex(e + 6, 8)); /* ino */
+ assertEqualInt(0xa1ff, from_hex(e + 14, 8)); /* Mode */
+ assertEqualInt(from_hex(e + 22, 8), getuid()); /* uid */
+ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
+ assertEqualMem(e + 38, "00000001", 8); /* nlink */
+ assertEqualInt(t, from_hex(e + 46, 8)); /* mtime */
+ assertEqualMem(e + 54, "00000005", 8); /* File size */
+ assertEqualInt(devmajor, from_hex(e + 62, 8)); /* devmajor */
+ assertEqualInt(devminor, from_hex(e + 70, 8)); /* devminor */
+ assert(is_hex(e + 78, 8)); /* rdevmajor */
+ assert(is_hex(e + 86, 8)); /* rdevminor */
+ assertEqualMem(e + 94, "00000008", 8); /* Name size */
+ assertEqualInt(0, from_hex(e + 102, 8)); /* check field */
+ assertEqualMem(e + 110, "symlink\0\0\0", 10); /* Name contents */
+ assertEqualMem(e + 120, "file1\0\0\0", 8); /* symlink target */
+ e += 120 + from_hex(e + 54, 8) + (3 & -from_hex(e + 54, 8));
+
+ /* "dir" */
+ assert(is_hex(e, 110));
+ assertEqualMem(e + 0, "070701", 6); /* Magic */
+ assert(is_hex(e + 6, 8)); /* ino */
+ assertEqualInt(0x41fd, from_hex(e + 14, 8)); /* Mode */
+ assertEqualInt(from_hex(e + 22, 8), getuid()); /* uid */
+ assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
+ assertEqualMem(e + 38, "00000002", 8); /* nlink */
+ assertEqualInt(t, from_hex(e + 46, 8)); /* mtime */
+ assertEqualMem(e + 54, "00000000", 8); /* File size */
+ assertEqualInt(devmajor, from_hex(e + 62, 8)); /* devmajor */
+ assertEqualInt(devminor, from_hex(e + 70, 8)); /* devminor */
+ assert(is_hex(e + 78, 8)); /* rdevmajor */
+ assert(is_hex(e + 86, 8)); /* rdevminor */
+ assertEqualMem(e + 94, "00000004", 8); /* Name size */
+ assertEqualInt(0, from_hex(e + 102, 8)); /* check field */
+ assertEqualMem(e + 110, "dir\0\0\0", 6); /* Name contents */
+ e += 116;
+
+ /* TODO: Verify other types of entries. */
+
+ /* Last entry is end-of-archive marker. */
+ assert(is_hex(e, 110));
+ assertEqualMem(e + 0, "070701", 6); /* Magic */
+ assertEqualMem(e + 8, "00000000", 8); /* ino */
+ assertEqualMem(e + 14, "00000000", 8); /* mode */
+ assertEqualMem(e + 22, "00000000", 8); /* uid */
+ assertEqualMem(e + 30, "00000000", 8); /* gid */
+ assertEqualMem(e + 38, "00000001", 8); /* nlink */
+ assertEqualMem(e + 46, "00000000", 8); /* mtime */
+ assertEqualMem(e + 54, "00000000", 8); /* size */
+ assertEqualMem(e + 62, "00000000", 8); /* devmajor */
+ assertEqualMem(e + 70, "00000000", 8); /* devminor */
+ assertEqualMem(e + 78, "00000000", 8); /* rdevmajor */
+ assertEqualMem(e + 86, "00000000", 8); /* rdevminor */
+ assertEqualInt(11, from_hex(e + 94, 8)); /* name size */
+ assertEqualMem(e + 102, "00000000", 8); /* check field */
+ assertEqualMem(e + 110, "TRAILER!!!\0\0", 12); /* Name */
+
+ free(p);
+
+ umask(oldmask);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_gcpio_compat.c b/archivers/libarchive/files/cpio/test/test_gcpio_compat.c
index ebc53575f66..32f4b6b3103 100644
--- a/archivers/libarchive/files/cpio/test/test_gcpio_compat.c
+++ b/archivers/libarchive/files/cpio/test/test_gcpio_compat.c
@@ -40,9 +40,10 @@ unpack_test(const char *from, const char *options)
/*
* Use cpio to unpack the sample archive
*/
- r = systemf("%s -i %s < %s/%s >unpack.out 2>unpack.err",
+ r = systemf("%s -i --quiet %s < %s/%s >unpack.out 2>unpack.err",
+ testprog, options, refdir, from);
+ failure("Error invoking %s -i --quiet %s < %s/%s",
testprog, options, refdir, from);
- failure("Error invoking %s -i %s < %s/%s", testprog, options, refdir, from);
assertEqualInt(r, 0);
/* Verify that nothing went to stderr. */
@@ -76,7 +77,7 @@ unpack_test(const char *from, const char *options)
assertEqualInt(10, st2.st_size);
failure("file %s/file", from);
assertEqualInt(2, st2.st_nlink);
- /* Verify that the two are really hardlinked. */
+ failure("file and linkfile should be hardlinked");
assertEqualInt(st.st_dev, st2.st_dev);
failure("file %s/file", from);
assertEqualInt(st.st_ino, st2.st_ino);
@@ -117,9 +118,8 @@ DEFINE_TEST(test_gcpio_compat)
/* Dearchive sample files with a variety of options. */
unpack_test("test_gcpio_compat_ref.bin", "");
- /* TODO: Fix the next two. */
- /* unpack_test("test_gcpio_compat_ref.crc", ""); */
- /* unpack_test("test_gcpio_compat_ref.newc", ""); */
+ unpack_test("test_gcpio_compat_ref.crc", "");
+ unpack_test("test_gcpio_compat_ref.newc", "");
unpack_test("test_gcpio_compat_ref.ustar", "");
umask(oldumask);
diff --git a/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.bin.uu b/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.bin.uu
new file mode 100644
index 00000000000..745d8ab7851
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.bin.uu
@@ -0,0 +1,16 @@
+$FreeBSD$
+begin 644 test_gcpio_compat_ref.bin
+MQW%9`*IWI('H`^@#`@````U'=YD%````"@!F:6QE```Q,C,T-38W.#D*QW%9
+M`*IWI('H`^@#`@````U'=YD)````"@!L:6YK9FEL90``,3(S-#4V-S@Y"L=Q
+M60"K=^VAZ`/H`P$````-1X29"`````0`<WEM;&EN:P!F:6QEQW%9`*YW_4'H
+M`^@#`@````U'A9D$``````!D:7(`QW$``````````````0`````````+````
+M``!44D%)3$52(2$A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+1````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.crc.uu b/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.crc.uu
new file mode 100644
index 00000000000..df8dde05bd8
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.crc.uu
@@ -0,0 +1,27 @@
+$FreeBSD$
+begin 644 test_gcpio_compat_ref.crc
+M,#<P-S`R,#`S,S<W86$P,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P
+M,C0W,&0Y.3<W,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#4Y,#`P,#`P,#`P,#`P
+M,#`P,#`P,#`P,#`U,#`P,#`P,#!F:6QE```P-S`W,#(P,#,S-S=A83`P,#`X
+M,6$T,#`P,#`S93@P,#`P,#-E.#`P,#`P,#`R-#<P9#DY-S<P,#`P,#`P83`P
+M,#`P,#`P,#`P,#`P-3DP,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#DP,#`P,#%E
+M-VQI;FMF:6QE```Q,C,T-38W.#D*```P-S`W,#(P,#,S-S=A8C`P,#!A,65D
+M,#`P,#`S93@P,#`P,#-E.#`P,#`P,#`Q-#<P9#DY.#0P,#`P,#`P-#`P,#`P
+M,#`P,#`P,#`P-3DP,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#@P,#`P,#`P,'-Y
+M;6QI;FL```!F:6QE,#<P-S`R,#`S,S<W864P,#`P-#%F9#`P,#`P,V4X,#`P
+M,#`S93@P,#`P,#`P,C0W,&0Y.3@U,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#4Y
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`T,#`P,#`P,#!D:7(````P-S`W,#(P
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`Q,#`P,#`P
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P
+M,#`P,&(P,#`P,#`P,%1204E,15(A(2$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+B````````````````````````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.newc.uu b/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.newc.uu
new file mode 100644
index 00000000000..1e29ba907bb
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.newc.uu
@@ -0,0 +1,27 @@
+$FreeBSD$
+begin 644 test_gcpio_compat_ref.newc
+M,#<P-S`Q,#`S,S<W86$P,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P
+M,C0W,&0Y.3<W,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#4Y,#`P,#`P,#`P,#`P
+M,#`P,#`P,#`P,#`U,#`P,#`P,#!F:6QE```P-S`W,#$P,#,S-S=A83`P,#`X
+M,6$T,#`P,#`S93@P,#`P,#-E.#`P,#`P,#`R-#<P9#DY-S<P,#`P,#`P83`P
+M,#`P,#`P,#`P,#`P-3DP,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#DP,#`P,#`P
+M,&QI;FMF:6QE```Q,C,T-38W.#D*```P-S`W,#$P,#,S-S=A8C`P,#!A,65D
+M,#`P,#`S93@P,#`P,#-E.#`P,#`P,#`Q-#<P9#DY.#0P,#`P,#`P-#`P,#`P
+M,#`P,#`P,#`P-3DP,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#@P,#`P,#`P,'-Y
+M;6QI;FL```!F:6QE,#<P-S`Q,#`S,S<W864P,#`P-#%F9#`P,#`P,V4X,#`P
+M,#`S93@P,#`P,#`P,C0W,&0Y.3@U,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#4Y
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`T,#`P,#`P,#!D:7(````P-S`W,#$P
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`Q,#`P,#`P
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P
+M,#`P,&(P,#`P,#`P,%1204E,15(A(2$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+B````````````````````````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.ustar.uu b/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.ustar.uu
new file mode 100644
index 00000000000..77989f4aed0
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_gcpio_compat_ref.ustar.uu
@@ -0,0 +1,84 @@
+$FreeBSD$
+begin 644 test_gcpio_compat_ref.ustar
+M9FEL90``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`P,#$R
+M`#$P-S`S,S$T-38W`#`P,3$S-C,`,```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,'1I;0``
+M````````````````````````````````````=&EM````````````````````
+M```````````````````P,#`P,#`P`#`P,#`P,#``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````Q,C,T-38W.#D*````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&QI;FMF:6QE````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#`P,#`P,``Q,#<P,S,Q-#4V
+M-P`P,#$S,#<W`#%F:6QE````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!T:6T`````````````````
+M`````````````````````'1I;0``````````````````````````````````
+M````,#`P,#`P,``P,#`P,#`P````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````<WEM;&EN:P``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#`P,#`W-34`,#`P,3<U,``P,#`Q-S4P`#`P,#`P
+M,#`P,#`P`#$P-S`S,S$T-C`T`#`P,3(W-C0`,F9I;&4`````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!U<W1A<@`P
+M,'1I;0``````````````````````````````````````=&EM````````````
+M```````````````````````````P,#`P,#`P`#`P,#`P,#``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!D:7(O````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````,#`P,#<W-0`P,#`Q
+M-S4P`#`P,#$W-3``,#`P,#`P,#`P,#``,3`W,#,S,30V,#4`,#`Q,3,P,0`U
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````'5S=&%R`#`P=&EM````````````````````````````````
+M``````!T:6T``````````````````````````````````````#`P,#`P,#``
+M,#`P,#`P,```````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+=````````````````````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/cpio/test/test_option_B.c b/archivers/libarchive/files/cpio/test/test_option_B.c
index 59c491ecfcc..17533180cec 100644
--- a/archivers/libarchive/files/cpio/test/test_option_B.c
+++ b/archivers/libarchive/files/cpio/test/test_option_B.c
@@ -39,14 +39,14 @@ DEFINE_TEST(test_option_B)
close(fd);
/* Create an archive without -B; this should be 512 bytes. */
- r = systemf("echo file | %s -o > small.cpio 2>small.err", testprog);
+ r = systemf("echo file | %s -o --quiet > small.cpio 2>small.err", testprog);
assertEqualInt(r, 0);
assertEmptyFile("small.err");
assertEqualInt(0, stat("small.cpio", &st));
assertEqualInt(512, st.st_size);
/* Create an archive with -B; this should be 5120 bytes. */
- r = systemf("echo file | %s -oB > large.cpio 2>large.err", testprog);
+ r = systemf("echo file | %s -oB --quiet > large.cpio 2>large.err", testprog);
assertEqualInt(r, 0);
assertEmptyFile("large.err");
assertEqualInt(0, stat("large.cpio", &st));
diff --git a/archivers/libarchive/files/cpio/test/test_option_L.c b/archivers/libarchive/files/cpio/test/test_option_L.c
new file mode 100644
index 00000000000..e0422ee052c
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_L.c
@@ -0,0 +1,82 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_option_L)
+{
+ struct stat st;
+ int fd, filelist;
+ int r;
+
+ filelist = open("filelist", O_CREAT | O_WRONLY, 0644);
+
+ /* Create a file and a symlink to the file. */
+ fd = open("file", O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(10, write(fd, "123456789", 10));
+ close(fd);
+ write(filelist, "file\n", 5);
+
+ /* Symlink to above file. */
+ assertEqualInt(0, symlink("file", "symlink"));
+ write(filelist, "symlink\n", 8);
+
+ close(filelist);
+
+ r = systemf("cat filelist | %s -pd --quiet copy >copy.out 2>copy.err", testprog);
+ assertEqualInt(r, 0);
+ assertEqualInt(0, lstat("copy/symlink", &st));
+ failure("Regular -p without -L should preserve symlinks.");
+ assert(S_ISLNK(st.st_mode));
+
+ r = systemf("cat filelist | %s -pd -L --quiet copy-L >copy-L.out 2>copy-L.err", testprog);
+ assertEqualInt(r, 0);
+ assertEqualInt(0, lstat("copy-L/symlink", &st));
+ failure("-pL should dereference symlinks and turn them into files.");
+ assert(!S_ISLNK(st.st_mode));
+
+ r = systemf("cat filelist | %s -o --quiet >archive.out 2>archive.err", testprog);
+ failure("Error invoking %s -o --quiet %s", testprog);
+ assertEqualInt(r, 0);
+
+ assertEqualInt(0, mkdir("unpack", 0755));
+ r = systemf("cat archive.out | (cd unpack ; %s -i >unpack.out 2>unpack.err)", testprog);
+ failure("Error invoking %s -i %s", testprog);
+ assertEqualInt(r, 0);
+ assertEqualInt(0, lstat("unpack/symlink", &st));
+ assert(S_ISLNK(st.st_mode));
+
+ r = systemf("cat filelist | %s -oL --quiet >archive-L.out 2>archive-L.err", testprog);
+ failure("Error invoking %s -oL --quiet %s", testprog);
+ assertEqualInt(r, 0);
+
+ assertEqualInt(0, mkdir("unpack-L", 0755));
+ r = systemf("cat archive-L.out | (cd unpack-L ; %s -i >unpack-L.out 2>unpack-L.err)", testprog);
+ failure("Error invoking %s -i %s < archive-L.out", testprog);
+ assertEqualInt(r, 0);
+ assertEqualInt(0, lstat("unpack-L/symlink", &st));
+ assert(!S_ISLNK(st.st_mode));
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_a.c b/archivers/libarchive/files/cpio/test/test_option_a.c
new file mode 100644
index 00000000000..d0d9cfed0ff
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_a.c
@@ -0,0 +1,104 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Create a file on disk and set the atime to a known value.
+ */
+static void
+test_create(const char *filename)
+{
+ int fd;
+ struct timeval times[2];
+
+ fd = open(filename, O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ /*
+ * Note: Have to write at least one byte to the file.
+ * cpio doesn't bother reading the file if it's zero length,
+ * so the atime never gets changed in that case, which
+ * makes the tests below rather pointless.
+ */
+ assertEqualInt(1, write(fd, "a", 1));
+ memset(times, 0, sizeof(times));
+ times[0].tv_sec = 1; /* atime = 1.000000002 */
+ times[0].tv_usec = 2;
+ times[1].tv_sec = 3; /* mtime = 3.000000004 */
+ times[1].tv_usec = 4;
+ assertEqualInt(0, futimes(fd, times));
+ close(fd);
+}
+
+DEFINE_TEST(test_option_a)
+{
+ struct stat st;
+ int r;
+
+ /* Sanity check; verify that test_create really works. */
+ test_create("f0");
+ assertEqualInt(0, stat("f0", &st));
+ failure("test_create function is supposed to create a file with atime == 1; if this doesn't work, test_option_a is entirely invalid.");
+ assertEqualInt(st.st_atime, 1);
+
+ /* Copy the file without -a; should change the atime. */
+ test_create("f1");
+ r = systemf("echo f1 | %s -pd --quiet copy-no-a > copy-no-a.out 2>copy-no-a.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("copy-no-a.err");
+ assertEmptyFile("copy-no-a.out");
+ assertEqualInt(0, stat("f1", &st));
+ failure("Copying file without -a should have changed atime. Ignore this if your system does not record atimes.");
+ assert(st.st_atime != 1);
+
+ /* Archive the file without -a; should change the atime. */
+ test_create("f2");
+ r = systemf("echo f2 | %s -o --quiet > archive-no-a.out 2>archive-no-a.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("copy-no-a.err");
+ assertEqualInt(0, stat("f2", &st));
+ failure("Archiving file without -a should have changed atime. Ignore this if your system does not record atimes.");
+ assert(st.st_atime != 1);
+
+ /* Copy the file with -a; should not change the atime. */
+ test_create("f3");
+ r = systemf("echo f3 | %s -pad --quiet copy-a > copy-a.out 2>copy-a.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("copy-a.err");
+ assertEmptyFile("copy-a.out");
+ assertEqualInt(0, stat("f3", &st));
+ failure("Copying file with -a should not have changed atime.");
+ assertEqualInt(st.st_atime, 1);
+
+ /* Archive the file without -a; should change the atime. */
+ test_create("f4");
+ r = systemf("echo f4 | %s -oa --quiet > archive-a.out 2>archive-a.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("copy-a.err");
+ assertEqualInt(0, stat("f4", &st));
+ failure("Archiving file with -a should not have changed atime.");
+ assertEqualInt(st.st_atime, 1);
+
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_c.c b/archivers/libarchive/files/cpio/test/test_option_c.c
new file mode 100644
index 00000000000..7596ba9de88
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_c.c
@@ -0,0 +1,195 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+static int
+is_octal(const char *p, size_t l)
+{
+ while (l > 0) {
+ if (*p < '0' || *p > '7')
+ return (0);
+ --l;
+ ++p;
+ }
+ return (1);
+}
+
+static int
+from_octal(const char *p, size_t l)
+{
+ int r = 0;
+
+ while (l > 0) {
+ r *= 8;
+ r += *p - '0';
+ --l;
+ ++p;
+ }
+ return (r);
+}
+
+DEFINE_TEST(test_option_c)
+{
+ int fd, filelist;
+ int r;
+ int dev, ino, gid;
+ time_t t, now;
+ char *p, *e;
+ size_t s;
+ mode_t oldmask;
+
+ oldmask = umask(0);
+
+ /*
+ * Create an assortment of files.
+ * TODO: Extend this to cover more filetypes.
+ */
+ filelist = open("filelist", O_CREAT | O_WRONLY, 0644);
+
+ /* "file" */
+ fd = open("file", O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(10, write(fd, "123456789", 10));
+ close(fd);
+ assertEqualInt(5, write(filelist, "file\n", 5));
+
+ /* "symlink" */
+ assertEqualInt(0, symlink("file", "symlink"));
+ assertEqualInt(8, write(filelist, "symlink\n", 8));
+
+ /* "dir" */
+ assertEqualInt(0, mkdir("dir", 0775));
+ /* Record some facts about what we just created: */
+ now = time(NULL); /* They were all created w/in last two seconds. */
+ assertEqualInt(4, write(filelist, "dir\n", 4));
+
+ /* Use the cpio program to create an archive. */
+ close(filelist);
+ r = systemf("%s -oc --quiet <filelist >basic.out 2>basic.err", testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that nothing went to stderr. */
+ assertEmptyFile("basic.err");
+
+ /* Verify that stdout is a well-formed cpio file in "odc" format. */
+ p = slurpfile(&s, "basic.out");
+ assertEqualInt(s, 512);
+ e = p;
+
+ /*
+ * Some of these assertions could be stronger, but it's
+ * a little tricky because they depend on the local environment.
+ */
+
+ /* First entry is "file" */
+ assert(is_octal(e, 76)); /* Entire header is octal digits. */
+ assertEqualMem(e + 0, "070707", 6); /* Magic */
+ assert(is_octal(e + 6, 6)); /* dev */
+ dev = from_octal(e + 6, 6);
+ assert(is_octal(e + 12, 6)); /* ino */
+ ino = from_octal(e + 12, 6);
+ assertEqualMem(e + 18, "100644", 6); /* Mode */
+ assertEqualInt(from_octal(e + 24, 6), getuid()); /* uid */
+ assert(is_octal(e + 30, 6)); /* gid */
+ gid = from_octal(e + 30, 6);
+ assertEqualMem(e + 36, "000001", 6); /* nlink */
+ failure("file entries should not have rdev set (dev field was 0%o)",
+ dev);
+ assertEqualMem(e + 42, "000000", 6); /* rdev */
+ t = from_octal(e + 48, 11); /* mtime */
+ assert(t <= now); /* File wasn't created in future. */
+ assert(t >= now - 2); /* File was created w/in last 2 secs. */
+ assertEqualMem(e + 59, "000005", 6); /* Name size */
+ assertEqualMem(e + 65, "00000000012", 11); /* File size */
+ assertEqualMem(e + 76, "file\0", 5); /* Name contents */
+ assertEqualMem(e + 81, "123456789\0", 10); /* File contents */
+ e += 91;
+
+ /* Second entry is "symlink" pointing to "file" */
+ assert(is_octal(e, 76)); /* Entire header is octal digits. */
+ assertEqualMem(e + 0, "070707", 6); /* Magic */
+ assertEqualInt(dev, from_octal(e + 6, 6)); /* dev */
+ assert(dev != from_octal(e + 12, 6)); /* ino */
+ assertEqualMem(e + 18, "120777", 6); /* Mode */
+ assertEqualInt(from_octal(e + 24, 6), getuid()); /* uid */
+ assertEqualInt(gid, from_octal(e + 30, 6)); /* gid */
+ assertEqualMem(e + 36, "000001", 6); /* nlink */
+ failure("file entries should have rdev == 0 (dev was 0%o)",
+ from_octal(e + 6, 6));
+ assertEqualMem(e + 42, "000000", 6); /* rdev */
+ t = from_octal(e + 48, 11); /* mtime */
+ assert(t <= now); /* File wasn't created in future. */
+ assert(t >= now - 2); /* File was created w/in last 2 secs. */
+ assertEqualMem(e + 59, "000010", 6); /* Name size */
+ assertEqualMem(e + 65, "00000000004", 11); /* File size */
+ assertEqualMem(e + 76, "symlink\0", 8); /* Name contents */
+ assertEqualMem(e + 84, "file", 4); /* Symlink target. */
+ e += 88;
+
+ /* Second entry is "dir" */
+ assert(is_octal(e, 76));
+ assertEqualMem(e + 0, "070707", 6); /* Magic */
+ /* Dev should be same as first entry. */
+ assert(is_octal(e + 6, 6)); /* dev */
+ assertEqualInt(dev, from_octal(e + 6, 6));
+ /* Ino must be different from first entry. */
+ assert(is_octal(e + 12, 6)); /* ino */
+ assert(dev != from_octal(e + 12, 6));
+ assertEqualMem(e + 18, "040775", 6); /* Mode */
+ assertEqualInt(from_octal(e + 24, 6), getuid()); /* uid */
+ /* Gid should be same as first entry. */
+ assert(is_octal(e + 30, 6)); /* gid */
+ assertEqualInt(gid, from_octal(e + 30, 6));
+ assertEqualMem(e + 36, "000002", 6); /* Nlink */
+ t = from_octal(e + 48, 11); /* mtime */
+ assert(t <= now); /* File wasn't created in future. */
+ assert(t >= now - 2); /* File was created w/in last 2 secs. */
+ assertEqualMem(e + 59, "000004", 6); /* Name size */
+ assertEqualMem(e + 65, "00000000000", 11); /* File size */
+ assertEqualMem(e + 76, "dir\0", 4); /* name */
+ e += 80;
+
+ /* TODO: Verify other types of entries. */
+
+ /* Last entry is end-of-archive marker. */
+ assert(is_octal(e, 76));
+ assertEqualMem(e + 0, "070707", 6); /* Magic */
+ assertEqualMem(e + 6, "000000", 6); /* dev */
+ assertEqualMem(e + 12, "000000", 6); /* ino */
+ assertEqualMem(e + 18, "000000", 6); /* Mode */
+ assertEqualMem(e + 24, "000000", 6); /* uid */
+ assertEqualMem(e + 30, "000000", 6); /* gid */
+ assertEqualMem(e + 36, "000001", 6); /* Nlink */
+ assertEqualMem(e + 42, "000000", 6); /* rdev */
+ assertEqualMem(e + 48, "00000000000", 11); /* mtime */
+ assertEqualMem(e + 59, "000013", 6); /* Name size */
+ assertEqualMem(e + 65, "00000000000", 11); /* File size */
+ assertEqualMem(e + 76, "TRAILER!!!\0", 11); /* Name */
+
+ free(p);
+
+ umask(oldmask);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_d.c b/archivers/libarchive/files/cpio/test/test_option_d.c
index a0139879518..cc962cc5856 100644
--- a/archivers/libarchive/files/cpio/test/test_option_d.c
+++ b/archivers/libarchive/files/cpio/test/test_option_d.c
@@ -40,7 +40,7 @@ DEFINE_TEST(test_option_d)
close(fd);
/* Create an archive. */
- r = systemf("echo dir/file | %s -o > archive.cpio 2>archive.err", testprog);
+ r = systemf("echo dir/file | %s -o --quiet > archive.cpio 2>archive.err", testprog);
assertEqualInt(r, 0);
assertEmptyFile("archive.err");
assertEqualInt(0, stat("archive.cpio", &st));
@@ -59,7 +59,7 @@ DEFINE_TEST(test_option_d)
assertEqualInt(0, chdir(".."));
assertEqualInt(0, mkdir("with-d", 0755));
assertEqualInt(0, chdir("with-d"));
- r = systemf("%s -id < ../archive.cpio >out 2>err", testprog);
+ r = systemf("%s -id --quiet < ../archive.cpio >out 2>err", testprog);
assertEqualInt(r, 0);
assertEmptyFile("out");
assertEmptyFile("err");
diff --git a/archivers/libarchive/files/cpio/test/test_option_ell.c b/archivers/libarchive/files/cpio/test/test_option_ell.c
new file mode 100644
index 00000000000..caf2a80b6d4
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_ell.c
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * This is called "test_option_ell" instead of "test_option_l" to
+ * avoid any conflicts with "test_option_L" on case-insensitive
+ * filesystems.
+ */
+
+DEFINE_TEST(test_option_ell)
+{
+ struct stat st, st2;
+ int fd;
+ int r;
+
+ /* Create a file. */
+ fd = open("f", O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(1, write(fd, "a", 1));
+ close(fd);
+
+ /* Stat it. */
+ assertEqualInt(0, stat("f", &st));
+
+ /* Copy the file to the "copy" dir. */
+ r = systemf("echo f | %s -pd --quiet copy >copy.out 2>copy.err",
+ testprog);
+ assertEqualInt(r, 0);
+
+ /* Check that the copy is a true copy and not a link. */
+ assertEqualInt(0, stat("copy/f", &st2));
+ assert(st2.st_ino != st.st_ino);
+
+ /* Copy the file to the "link" dir with the -l option. */
+ r = systemf("echo f | %s -pld --quiet link >link.out 2>link.err",
+ testprog);
+ assertEqualInt(r, 0);
+
+ /* Check that this is a link and not a copy. */
+ assertEqualInt(0, stat("link/f", &st2));
+ assert(st2.st_ino == st.st_ino);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_f.c b/archivers/libarchive/files/cpio/test/test_option_f.c
new file mode 100644
index 00000000000..c1fefd9c804
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_f.c
@@ -0,0 +1,65 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Unpack the archive in a new dir.
+ */
+static void
+unpack(const char *dirname, const char *option)
+{
+ int r;
+
+ assertEqualInt(0, mkdir(dirname, 0755));
+ assertEqualInt(0, chdir(dirname));
+ r = systemf("%s -i --quiet %s < %s/test_option_f.cpio > copy-no-a.out 2>copy-no-a.err", testprog, option, refdir);
+ assertEqualInt(0, r);
+ assertEqualInt(0, chdir(".."));
+}
+
+DEFINE_TEST(test_option_f)
+{
+ /* Calibrate: No -f option, so everything should be extracted. */
+ unpack("t0", "");
+ assertEqualInt(0, access("t0/a123", F_OK));
+ assertEqualInt(0, access("t0/a234", F_OK));
+ assertEqualInt(0, access("t0/b123", F_OK));
+ assertEqualInt(0, access("t0/b234", F_OK));
+
+ /* Don't extract 'a*' files. */
+ unpack("t1", "-f 'a*'");
+ assert(0 != access("t1/a123", F_OK));
+ assert(0 != access("t1/a234", F_OK));
+ assertEqualInt(0, access("t1/b123", F_OK));
+ assertEqualInt(0, access("t1/b234", F_OK));
+
+ /* Don't extract 'b*' files. */
+ unpack("t2", "-f 'b*'");
+ assertEqualInt(0, access("t2/a123", F_OK));
+ assertEqualInt(0, access("t2/a234", F_OK));
+ assert(0 != access("t2/b123", F_OK));
+ assert(0 != access("t2/b234", F_OK));
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_f.cpio.uu b/archivers/libarchive/files/cpio/test/test_option_f.cpio.uu
new file mode 100644
index 00000000000..42c63c39685
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_f.cpio.uu
@@ -0,0 +1,16 @@
+$FreeBSD$
+begin 644 test_option_f.cpio
+M,#<P-S`W,#`P,3,Q-C(Q-38Q,3`P-C0T,#`Q-S4P,#`Q-S4P,#`P,#`Q,#`P
+M,#`P,3`W,S4Q,3(U,C8P,#`P,#4P,#`P,#`P,#`P,&$Q,C,`,#<P-S`W,#`P
+M,3,Q-C(Q-38S,3`P-C0T,#`Q-S4P,#`Q-S4P,#`P,#`Q,#`P,#`P,3`W,S4Q
+M,3(U-#`P,#`P,#4P,#`P,#`P,#`P,&$R,S0`,#<P-S`W,#`P,3,Q-C(Q-38R
+M,3`P-C0T,#`Q-S4P,#`Q-S4P,#`P,#`Q,#`P,#`P,3`W,S4Q,3(U,S0P,#`P
+M,#4P,#`P,#`P,#`P,&(Q,C,`,#<P-S`W,#`P,3,Q-C(Q-38T,3`P-C0T,#`Q
+M-S4P,#`Q-S4P,#`P,#`Q,#`P,#`P,3`W,S4Q,3(U-#,P,#`P,#4P,#`P,#`P
+M,#`P,&(R,S0`,#<P-S`W,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P
+M,#`P,#`Q,#`P,#`P,#`P,#`P,#`P,#`P,#`P,3,P,#`P,#`P,#`P,%1204E,
+M15(A(2$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+1````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/cpio/test/test_option_help.c b/archivers/libarchive/files/cpio/test/test_option_help.c
new file mode 100644
index 00000000000..b9433a43a68
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_help.c
@@ -0,0 +1,81 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Test that "--help", "-h", and "-W help" options all work and
+ * generate reasonable output.
+ */
+
+static int
+in_first_line(const char *p, const char *substring)
+{
+ size_t l = strlen(substring);
+
+ while (*p != '\0' && *p != '\n') {
+ if (memcmp(p, substring, l) == 0)
+ return (1);
+ ++p;
+ }
+ return (0);
+}
+
+DEFINE_TEST(test_option_help)
+{
+ int r;
+ char *p;
+ size_t plen;
+
+ /* Exercise --help option. */
+ r = systemf("%s --help >help.stdout 2>help.stderr", testprog);
+ failure("--help should generate nothing to stderr.");
+ assertEmptyFile("help.stderr");
+ /* Help message should start with name of program. */
+ p = slurpfile(&plen, "help.stdout");
+ failure("Help output should be long enough.");
+ assert(plen >= 7);
+ failure("First line of help output should contain string 'bsdcpio'");
+ assert(in_first_line(p, "bsdcpio"));
+ /*
+ * TODO: Extend this check to further verify that --help output
+ * looks approximately right.
+ */
+ free(p);
+
+ /* -h option should generate the same output. */
+ r = systemf("%s -h >h.stdout 2>h.stderr", testprog);
+ failure("-h should generate nothing to stderr.");
+ assertEmptyFile("h.stderr");
+ failure("stdout should be same for -h and --help");
+ assertEqualFile("h.stdout", "help.stdout");
+
+ /* -W help should be another synonym. */
+ r = systemf("%s -W help >Whelp.stdout 2>Whelp.stderr", testprog);
+ failure("-W help should generate nothing to stderr.");
+ assertEmptyFile("Whelp.stderr");
+ failure("stdout should be same for -W help and --help");
+ assertEqualFile("Whelp.stdout", "help.stdout");
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_m.c b/archivers/libarchive/files/cpio/test/test_option_m.c
index 1781719ae27..e43d259277a 100644
--- a/archivers/libarchive/files/cpio/test/test_option_m.c
+++ b/archivers/libarchive/files/cpio/test/test_option_m.c
@@ -44,7 +44,7 @@ DEFINE_TEST(test_option_m)
now = time(NULL);
assertEqualInt(r, 0);
assertEmptyFile("out");
- assertEmptyFile("err");
+ assertFileContents("1 block\n", 8, "err");
assertEqualInt(0, stat("file", &st));
/* Should have been created within the last few seconds. */
assert(st.st_mtime <= now);
@@ -58,7 +58,7 @@ DEFINE_TEST(test_option_m)
now = time(NULL);
assertEqualInt(r, 0);
assertEmptyFile("out");
- assertEmptyFile("err");
+ assertFileContents("1 block\n", 8, "err");
assertEqualInt(0, stat("file", &st));
/*
* mtime in reference archive is '1' == 1 second after
diff --git a/archivers/libarchive/files/cpio/test/test_option_m.cpio.uu b/archivers/libarchive/files/cpio/test/test_option_m.cpio.uu
new file mode 100644
index 00000000000..3d2002355e5
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_m.cpio.uu
@@ -0,0 +1,16 @@
+$FreeBSD$
+begin 644 test_option_m.cpio
+M,#<P-S`W,#`P,3,Q-#4P,#8T,3`P-C0T,#`Q-S4P,#`Q-S4P,#`P,#`Q,#`P
+M,#`P,#`P,#`P,#`P,#$P,#`P,#4P,#`P,#`P,#`P,&9I;&4`,#<P-S`W,#`P
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`Q,#`P,#`P,#`P,#`P
+M,#`P,#`P,#`P,3,P,#`P,#`P,#`P,%1204E,15(A(2$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+1````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/cpio/test/test_option_t.c b/archivers/libarchive/files/cpio/test/test_option_t.c
index ad229e0db63..1bb993461f7 100644
--- a/archivers/libarchive/files/cpio/test/test_option_t.c
+++ b/archivers/libarchive/files/cpio/test/test_option_t.c
@@ -33,12 +33,12 @@ DEFINE_TEST(test_option_t)
/* List reference archive, make sure the TOC is correct. */
r = systemf("%s -it < %s/test_option_t.cpio >t.out 2>t.err", testprog, refdir);
assertEqualInt(r, 0);
- assertEmptyFile("t.err");
+ assertFileContents("1 block\n", 8, "t.err");
assertEqualFile("t.out", "%s/test_option_t.stdout", refdir);
/* List reference archive verbosely, make sure the TOC is correct. */
r = systemf("%s -itv < %s/test_option_t.cpio >tv.out 2>tv.err", testprog, refdir);
assertEqualInt(r, 0);
- assertEmptyFile("tv.err");
+ assertFileContents("1 block\n", 8, "tv.err");
assertEqualFile("tv.out", "%s/test_option_tv.stdout", refdir);
}
diff --git a/archivers/libarchive/files/cpio/test/test_option_t.cpio.uu b/archivers/libarchive/files/cpio/test/test_option_t.cpio.uu
new file mode 100644
index 00000000000..055fe747d06
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_t.cpio.uu
@@ -0,0 +1,16 @@
+$FreeBSD$
+begin 644 test_option_t.cpio
+M,#<P-S`W,#`P,3,Q-#4P,#8T,3`P-C0T,#`Q-S4P,#`Q-S4P,#`P,#`Q,#`P
+M,#`P,#`P,#`P,#`P,#$P,#`P,#4P,#`P,#`P,#`P,&9I;&4`,#<P-S`W,#`P
+M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`Q,#`P,#`P,#`P,#`P
+M,#`P,#`P,#`P,3,P,#`P,#`P,#`P,%1204E,15(A(2$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+1````````````````````````
+`
+end
diff --git a/archivers/libarchive/files/cpio/test/test_option_t.stdout.uu b/archivers/libarchive/files/cpio/test/test_option_t.stdout.uu
new file mode 100644
index 00000000000..2457706ecee
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_t.stdout.uu
@@ -0,0 +1,5 @@
+$FreeBSD$
+begin 644 test_option_t.stdout
+%9FEL90H`
+`
+end
diff --git a/archivers/libarchive/files/cpio/test/test_option_tv.stdout.uu b/archivers/libarchive/files/cpio/test/test_option_tv.stdout.uu
new file mode 100644
index 00000000000..baead3ee324
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_tv.stdout.uu
@@ -0,0 +1,5 @@
+$FreeBSD$
+begin 644 test_option_tv.stdout
+G+7)W+7(M+7(M+2`@(#$@("`H;G5L;"D@("AN=6QL*2`P(&9I;&4*
+`
+end
diff --git a/archivers/libarchive/files/cpio/test/test_option_u.c b/archivers/libarchive/files/cpio/test/test_option_u.c
new file mode 100644
index 00000000000..b35719f6c52
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_u.c
@@ -0,0 +1,85 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_option_u)
+{
+ struct timeval times[2];
+ char *p;
+ size_t s;
+ int fd;
+ int r;
+
+ /* Create a file. */
+ fd = open("f", O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(1, write(fd, "a", 1));
+ close(fd);
+
+ /* Copy the file to the "copy" dir. */
+ r = systemf("echo f | %s -pd --quiet copy >copy.out 2>copy.err",
+ testprog);
+ assertEqualInt(r, 0);
+
+ /* Check that the file contains only a single "a" */
+ p = slurpfile(&s, "copy/f");
+ assertEqualInt(s, 1);
+ assertEqualMem(p, "a", 1);
+
+ /* Recreate the file with a single "b" */
+ fd = open("f", O_CREAT | O_TRUNC | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(1, write(fd, "b", 1));
+ close(fd);
+
+ /* Set the mtime to the distant past. */
+ memset(times, 0, sizeof(times));
+ times[0].tv_sec = 1; /* atime = 1.000000002 */
+ times[0].tv_usec = 2;
+ times[1].tv_sec = 3; /* mtime = 3.000000004 */
+ times[1].tv_usec = 4;
+ assertEqualInt(0, utimes("f", times));
+
+ /* Copy the file to the "copy" dir. */
+ r = systemf("echo f | %s -pd --quiet copy >copy.out 2>copy.err",
+ testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that the file hasn't changed (it wasn't overwritten) */
+ p = slurpfile(&s, "copy/f");
+ assertEqualInt(s, 1);
+ assertEqualMem(p, "a", 1);
+
+ /* Copy the file to the "copy" dir with -u (force) */
+ r = systemf("echo f | %s -pud --quiet copy >copy.out 2>copy.err",
+ testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that the file has changed (it was overwritten) */
+ p = slurpfile(&s, "copy/f");
+ assertEqualInt(s, 1);
+ assertEqualMem(p, "b", 1);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_version.c b/archivers/libarchive/files/cpio/test/test_option_version.c
new file mode 100644
index 00000000000..06df47a171c
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_version.c
@@ -0,0 +1,84 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Test that --version option works and generates reasonable output.
+ */
+
+static void
+verify(const char *q, size_t s)
+{
+ /* Version message should start with name of program, then space. */
+ failure("version message too short");
+ if (!assert(s > 6))
+ return;
+ failure("Version message should begin with 'bsdcpio'");
+ if (!assertEqualMem(q, "bsdcpio ", 8))
+ /* If we're not testing bsdcpio, don't keep going. */
+ return;
+ q += 8; s -= 8;
+ /* Version number is a series of digits and periods. */
+ while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
+ ++q;
+ --s;
+ }
+ /* Version number terminated by space. */
+ assert(s > 1);
+ assert(*q == ' ');
+ ++q; --s;
+ /* Separator. */
+ assertEqualMem(q, "-- ", 3);
+ q += 3; s -= 3;
+ /* libarchive name and version number */
+ assert(s > 11);
+ assertEqualMem(q, "libarchive ", 11);
+ q += 11; s -= 11;
+ /* Version number is a series of digits and periods. */
+ while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
+ ++q;
+ --s;
+ }
+ /* All terminated by a newline. */
+ assert(s >= 1);
+ assertEqualMem(q, "\n", 1);
+}
+
+
+DEFINE_TEST(test_option_version)
+{
+ int r;
+ char *p;
+ size_t s;
+
+ r = systemf("%s --version >version.stdout 2>version.stderr", testprog);
+ /* --version should generate nothing to stderr. */
+ assertEmptyFile("version.stderr");
+ /* Verify format of version message. */
+ p = slurpfile(&s, "version.stdout");
+ verify(p, s);
+ free(p);
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_y.c b/archivers/libarchive/files/cpio/test/test_option_y.c
new file mode 100644
index 00000000000..56852a805f4
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_y.c
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_option_y)
+{
+ char *p;
+ int fd;
+ int r;
+ size_t s;
+
+ /* Create a file. */
+ fd = open("f", O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(1, write(fd, "a", 1));
+ close(fd);
+
+ /* Archive it with bzip2 compression. */
+ r = systemf("echo f | %s -oy >archive.out 2>archive.err",
+ testprog);
+ assertFileContents("1 block\n", 8, "archive.err");
+ failure("-y (bzip) option seems to be broken");
+ if (assertEqualInt(r, 0)) {
+ /* Check that the archive file has a bzip2 signature. */
+ p = slurpfile(&s, "archive.out");
+ assert(s > 2);
+ assertEqualMem(p, "BZh9", 4);
+ }
+}
diff --git a/archivers/libarchive/files/cpio/test/test_option_z.c b/archivers/libarchive/files/cpio/test/test_option_z.c
new file mode 100644
index 00000000000..15337a4ca15
--- /dev/null
+++ b/archivers/libarchive/files/cpio/test/test_option_z.c
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_option_z)
+{
+ char *p;
+ int fd;
+ int r;
+ size_t s;
+
+ /* Create a file. */
+ fd = open("f", O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(1, write(fd, "a", 1));
+ close(fd);
+
+ /* Archive it with gzip compression. */
+ r = systemf("echo f | %s -oz >archive.out 2>archive.err",
+ testprog);
+ failure("-z option seems to be broken");
+ assertEqualInt(r, 0);
+ if (r == 0) {
+ /* Check that the archive file has a gzip signature. */
+ p = slurpfile(&s, "archive.out");
+ assert(s > 2);
+ assertEqualMem(p, "\x1f\x8b\x08\x00", 4);
+ }
+}
diff --git a/archivers/libarchive/files/cpio/test/test_pathmatch.c b/archivers/libarchive/files/cpio/test/test_pathmatch.c
index ad56fba963c..83528c01ffb 100644
--- a/archivers/libarchive/files/cpio/test/test_pathmatch.c
+++ b/archivers/libarchive/files/cpio/test/test_pathmatch.c
@@ -25,7 +25,7 @@
#include "test.h"
__FBSDID("$FreeBSD$");
-#include "../cpio.h"
+#include "../pathmatch.h"
/*
* Verify that the pattern matcher implements the wildcard logic specified
@@ -38,71 +38,128 @@ __FBSDID("$FreeBSD$");
*
* The specification in SUSv2 is a bit incomplete, I assume the following:
* Trailing '-' in [...] is not special.
- * Leading ']' in [...] is not special.
*/
DEFINE_TEST(test_pathmatch)
{
- assertEqualInt(1, pathmatch("*",""));
- assertEqualInt(1, pathmatch("*","a"));
- assertEqualInt(1, pathmatch("*","abcd"));
+ assertEqualInt(1, pathmatch("*","", 0));
+ assertEqualInt(1, pathmatch("*","a", 0));
+ assertEqualInt(1, pathmatch("*","abcd", 0));
/* SUSv2: * matches / */
- assertEqualInt(1, pathmatch("*","abcd/efgh/ijkl"));
- assertEqualInt(1, pathmatch("abcd*efgh/ijkl","abcd/efgh/ijkl"));
- assertEqualInt(1, pathmatch("abcd***efgh/ijkl","abcd/efgh/ijkl"));
- assertEqualInt(1, pathmatch("abcd***/efgh/ijkl","abcd/efgh/ijkl"));
- assertEqualInt(0, pathmatch("?", ""));
- assertEqualInt(1, pathmatch("?", "a"));
- assertEqualInt(0, pathmatch("?", "ab"));
- assertEqualInt(1, pathmatch("?", "."));
- assertEqualInt(1, pathmatch("?", "?"));
- assertEqualInt(1, pathmatch("a", "a"));
- assertEqualInt(0, pathmatch("a", "ab"));
- assertEqualInt(0, pathmatch("a", "ab"));
- assertEqualInt(1, pathmatch("a?c", "abc"));
+ assertEqualInt(1, pathmatch("*","abcd/efgh/ijkl", 0));
+ assertEqualInt(1, pathmatch("abcd*efgh/ijkl","abcd/efgh/ijkl", 0));
+ assertEqualInt(1, pathmatch("abcd***efgh/ijkl","abcd/efgh/ijkl", 0));
+ assertEqualInt(1, pathmatch("abcd***/efgh/ijkl","abcd/efgh/ijkl", 0));
+ assertEqualInt(0, pathmatch("?", "", 0));
+ assertEqualInt(0, pathmatch("?", "\0", 0));
+ assertEqualInt(1, pathmatch("?", "a", 0));
+ assertEqualInt(0, pathmatch("?", "ab", 0));
+ assertEqualInt(1, pathmatch("?", ".", 0));
+ assertEqualInt(1, pathmatch("?", "?", 0));
+ assertEqualInt(1, pathmatch("a", "a", 0));
+ assertEqualInt(0, pathmatch("a", "ab", 0));
+ assertEqualInt(0, pathmatch("a", "ab", 0));
+ assertEqualInt(1, pathmatch("a?c", "abc", 0));
/* SUSv2: ? matches / */
- assertEqualInt(1, pathmatch("a?c", "a/c"));
- assertEqualInt(1, pathmatch("a?*c*", "a/c"));
- assertEqualInt(1, pathmatch("*a*", "a/c"));
- assertEqualInt(1, pathmatch("*a*", "/a/c"));
- assertEqualInt(1, pathmatch("*a*", "defaaaaaaa"));
- assertEqualInt(0, pathmatch("*a*", "defghi"));
- assertEqualInt(1, pathmatch("abc[def", "abc[def"));
- assertEqualInt(0, pathmatch("abc[def]", "abc[def"));
- assertEqualInt(0, pathmatch("abc[def", "abcd"));
- assertEqualInt(1, pathmatch("abc[def]", "abcd"));
- assertEqualInt(1, pathmatch("abc[def]", "abce"));
- assertEqualInt(1, pathmatch("abc[def]", "abcf"));
- assertEqualInt(0, pathmatch("abc[def]", "abcg"));
- assertEqualInt(1, pathmatch("abc[d*f]", "abcd"));
- assertEqualInt(1, pathmatch("abc[d*f]", "abc*"));
- assertEqualInt(0, pathmatch("abc[d*f]", "abcdefghi"));
- assertEqualInt(0, pathmatch("abc[d*", "abcdefghi"));
- assertEqualInt(1, pathmatch("abc[d*", "abc[defghi"));
- assertEqualInt(1, pathmatch("abc[d-f]", "abcd"));
- assertEqualInt(1, pathmatch("abc[d-f]", "abce"));
- assertEqualInt(1, pathmatch("abc[d-f]", "abcf"));
- assertEqualInt(0, pathmatch("abc[d-f]", "abcg"));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abcd"));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abce"));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abcf"));
- assertEqualInt(0, pathmatch("abc[d-fh-k]", "abcg"));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abch"));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abci"));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abcj"));
- assertEqualInt(1, pathmatch("abc[d-fh-k]", "abck"));
- assertEqualInt(0, pathmatch("abc[d-fh-k]", "abcl"));
- assertEqualInt(0, pathmatch("abc[d-fh-k]", "abc-"));
- assertEqualInt(0, pathmatch("abc[d-fh-]", "abcl"));
- assertEqualInt(1, pathmatch("abc[d-fh-]", "abch"));
- assertEqualInt(1, pathmatch("abc[d-fh-]", "abc-"));
- assertEqualInt(1, pathmatch("abc[d-fh-]", "abc-"));
- /* I assume: initial ']' is non-special. */
- assertEqualInt(1, pathmatch("abc[]]", "abc]"));
- assertEqualInt(1, pathmatch("abc[]d]", "abc]"));
- assertEqualInt(1, pathmatch("abc[]d]", "abcd"));
- assertEqualInt(1, pathmatch("abc[d]e]", "abcde]"));
- assertEqualInt(0, pathmatch("abc[d]e]", "abc]"));
+ assertEqualInt(1, pathmatch("a?c", "a/c", 0));
+ assertEqualInt(1, pathmatch("a?*c*", "a/c", 0));
+ assertEqualInt(1, pathmatch("*a*", "a/c", 0));
+ assertEqualInt(1, pathmatch("*a*", "/a/c", 0));
+ assertEqualInt(1, pathmatch("*a*", "defaaaaaaa", 0));
+ assertEqualInt(0, pathmatch("a*", "defghi", 0));
+ assertEqualInt(0, pathmatch("*a*", "defghi", 0));
+ assertEqualInt(1, pathmatch("abc[def", "abc[def", 0));
+ assertEqualInt(0, pathmatch("abc[def]", "abc[def", 0));
+ assertEqualInt(0, pathmatch("abc[def", "abcd", 0));
+ assertEqualInt(1, pathmatch("abc[def]", "abcd", 0));
+ assertEqualInt(1, pathmatch("abc[def]", "abce", 0));
+ assertEqualInt(1, pathmatch("abc[def]", "abcf", 0));
+ assertEqualInt(0, pathmatch("abc[def]", "abcg", 0));
+ assertEqualInt(1, pathmatch("abc[d*f]", "abcd", 0));
+ assertEqualInt(1, pathmatch("abc[d*f]", "abc*", 0));
+ assertEqualInt(0, pathmatch("abc[d*f]", "abcdefghi", 0));
+ assertEqualInt(0, pathmatch("abc[d*", "abcdefghi", 0));
+ assertEqualInt(1, pathmatch("abc[d*", "abc[defghi", 0));
+ assertEqualInt(1, pathmatch("abc[d-f]", "abcd", 0));
+ assertEqualInt(1, pathmatch("abc[d-f]", "abce", 0));
+ assertEqualInt(1, pathmatch("abc[d-f]", "abcf", 0));
+ assertEqualInt(0, pathmatch("abc[d-f]", "abcg", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-k]", "abcd", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-k]", "abce", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-k]", "abcf", 0));
+ assertEqualInt(0, pathmatch("abc[d-fh-k]", "abcg", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-k]", "abch", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-k]", "abci", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-k]", "abcj", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-k]", "abck", 0));
+ assertEqualInt(0, pathmatch("abc[d-fh-k]", "abcl", 0));
+ assertEqualInt(0, pathmatch("abc[d-fh-k]", "abc-", 0));
- /* TODO: Implement leading '!' as negation character. */
+ /* I assume: Trailing '-' is non-special. */
+ assertEqualInt(0, pathmatch("abc[d-fh-]", "abcl", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-]", "abch", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-]", "abc-", 0));
+ assertEqualInt(1, pathmatch("abc[d-fh-]", "abc-", 0));
+
+ /* ']' can be backslash-quoted within a character class. */
+ assertEqualInt(1, pathmatch("abc[\\]]", "abc]", 0));
+ assertEqualInt(1, pathmatch("abc[\\]d]", "abc]", 0));
+ assertEqualInt(1, pathmatch("abc[\\]d]", "abcd", 0));
+ assertEqualInt(1, pathmatch("abc[d\\]]", "abc]", 0));
+ assertEqualInt(1, pathmatch("abc[d\\]]", "abcd", 0));
+ assertEqualInt(1, pathmatch("abc[d]e]", "abcde]", 0));
+ assertEqualInt(1, pathmatch("abc[d\\]e]", "abc]", 0));
+ assertEqualInt(0, pathmatch("abc[d\\]e]", "abcd]e", 0));
+ assertEqualInt(0, pathmatch("abc[d]e]", "abc]", 0));
+
+ /* backslash-quoted chars can appear as either end of a range. */
+ assertEqualInt(1, pathmatch("abc[\\d-f]gh", "abcegh", 0));
+ assertEqualInt(0, pathmatch("abc[\\d-f]gh", "abcggh", 0));
+ assertEqualInt(0, pathmatch("abc[\\d-f]gh", "abc\\gh", 0));
+ assertEqualInt(1, pathmatch("abc[d-\\f]gh", "abcegh", 0));
+ assertEqualInt(1, pathmatch("abc[\\d-\\f]gh", "abcegh", 0));
+ assertEqualInt(1, pathmatch("abc[\\d-\\f]gh", "abcegh", 0));
+ /* backslash-quoted '-' isn't special. */
+ assertEqualInt(0, pathmatch("abc[d\\-f]gh", "abcegh", 0));
+ assertEqualInt(1, pathmatch("abc[d\\-f]gh", "abc-gh", 0));
+
+ /* Leading '!' negates a character class. */
+ assertEqualInt(0, pathmatch("abc[!d]", "abcd", 0));
+ assertEqualInt(1, pathmatch("abc[!d]", "abce", 0));
+ assertEqualInt(1, pathmatch("abc[!d]", "abcc", 0));
+ assertEqualInt(0, pathmatch("abc[!d-z]", "abcq", 0));
+ assertEqualInt(1, pathmatch("abc[!d-gi-z]", "abch", 0));
+ assertEqualInt(1, pathmatch("abc[!fgijkl]", "abch", 0));
+ assertEqualInt(0, pathmatch("abc[!fghijkl]", "abch", 0));
+
+ /* Backslash quotes next character. */
+ assertEqualInt(0, pathmatch("abc\\[def]", "abc\\d", 0));
+ assertEqualInt(1, pathmatch("abc\\[def]", "abc[def]", 0));
+ assertEqualInt(0, pathmatch("abc\\\\[def]", "abc[def]", 0));
+ assertEqualInt(0, pathmatch("abc\\\\[def]", "abc\\[def]", 0));
+ assertEqualInt(1, pathmatch("abc\\\\[def]", "abc\\d", 0));
+
+ /*
+ * Because '.' and '/' have special meanings, we can
+ * identify many equivalent paths even if they're expressed
+ * differently.
+ */
+ assertEqualInt(1, pathmatch("./abc/./def/", "abc/def/", 0));
+ assertEqualInt(1, pathmatch("abc/def", "./././abc/./def", 0));
+ assertEqualInt(1, pathmatch("abc/def/././//", "./././abc/./def/", 0));
+ assertEqualInt(1, pathmatch(".////abc/.//def", "./././abc/./def", 0));
+ assertEqualInt(1, pathmatch("./abc?def/", "abc/def/", 0));
+ failure("\"?./\" is not the same as \"/./\"");
+ assertEqualInt(0, pathmatch("./abc?./def/", "abc/def/", 0));
+ failure("Trailing '/' should match no trailing '/'");
+ assertEqualInt(1, pathmatch("./abc/./def/", "abc/def", 0));
+ failure("Trailing '/./' is still the same directory.");
+ assertEqualInt(1, pathmatch("./abc/./def/./", "abc/def", 0));
+ failure("Trailing '/.' is still the same directory.");
+ assertEqualInt(1, pathmatch("./abc/./def/.", "abc/def", 0));
+ assertEqualInt(1, pathmatch("./abc/./def", "abc/def/", 0));
+ failure("Trailing '/./' is still the same directory.");
+ assertEqualInt(1, pathmatch("./abc/./def", "abc/def/./", 0));
+ failure("Trailing '/.' is still the same directory.");
+ assertEqualInt(1, pathmatch("./abc*/./def", "abc/def/.", 0));
}
diff --git a/archivers/libarchive/files/doc/man/Makefile b/archivers/libarchive/files/doc/man/Makefile
new file mode 100644
index 00000000000..c33aac4c647
--- /dev/null
+++ b/archivers/libarchive/files/doc/man/Makefile
@@ -0,0 +1,43 @@
+
+default: all
+
+
+archive_entry.3: ../mdoc2man.awk ../../libarchive/archive_entry.3
+ awk -f ../mdoc2man.awk < ../../libarchive/archive_entry.3 > archive_entry.3
+
+archive_read.3: ../mdoc2man.awk ../../libarchive/archive_read.3
+ awk -f ../mdoc2man.awk < ../../libarchive/archive_read.3 > archive_read.3
+
+archive_util.3: ../mdoc2man.awk ../../libarchive/archive_util.3
+ awk -f ../mdoc2man.awk < ../../libarchive/archive_util.3 > archive_util.3
+
+archive_write.3: ../mdoc2man.awk ../../libarchive/archive_write.3
+ awk -f ../mdoc2man.awk < ../../libarchive/archive_write.3 > archive_write.3
+
+archive_write_disk.3: ../mdoc2man.awk ../../libarchive/archive_write_disk.3
+ awk -f ../mdoc2man.awk < ../../libarchive/archive_write_disk.3 > archive_write_disk.3
+
+cpio.5: ../mdoc2man.awk ../../libarchive/cpio.5
+ awk -f ../mdoc2man.awk < ../../libarchive/cpio.5 > cpio.5
+
+libarchive-formats.5: ../mdoc2man.awk ../../libarchive/libarchive-formats.5
+ awk -f ../mdoc2man.awk < ../../libarchive/libarchive-formats.5 > libarchive-formats.5
+
+libarchive.3: ../mdoc2man.awk ../../libarchive/libarchive.3
+ awk -f ../mdoc2man.awk < ../../libarchive/libarchive.3 > libarchive.3
+
+libarchive_internals.3: ../mdoc2man.awk ../../libarchive/libarchive_internals.3
+ awk -f ../mdoc2man.awk < ../../libarchive/libarchive_internals.3 > libarchive_internals.3
+
+mtree.5: ../mdoc2man.awk ../../libarchive/mtree.5
+ awk -f ../mdoc2man.awk < ../../libarchive/mtree.5 > mtree.5
+
+tar.5: ../mdoc2man.awk ../../libarchive/tar.5
+ awk -f ../mdoc2man.awk < ../../libarchive/tar.5 > tar.5
+
+bsdtar.1: ../mdoc2man.awk ../../tar/bsdtar.1
+ awk -f ../mdoc2man.awk < ../../tar/bsdtar.1 > bsdtar.1
+
+bsdcpio.1: ../mdoc2man.awk ../../cpio/bsdcpio.1
+ awk -f ../mdoc2man.awk < ../../cpio/bsdcpio.1 > bsdcpio.1
+all: archive_entry.3 archive_read.3 archive_util.3 archive_write.3 archive_write_disk.3 cpio.5 libarchive-formats.5 libarchive.3 libarchive_internals.3 mtree.5 tar.5 bsdtar.1 bsdcpio.1
diff --git a/archivers/libarchive/files/doc/man/archive_entry.3 b/archivers/libarchive/files/doc/man/archive_entry.3
index 6b1b270f1a5..a3548c2f414 100644
--- a/archivers/libarchive/files/doc/man/archive_entry.3
+++ b/archivers/libarchive/files/doc/man/archive_entry.3
@@ -1,298 +1,567 @@
-.\" Copyright (c) 2003-2007 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: src/lib/libarchive/archive_entry.3,v 1.15 2007/07/15 19:10:34 kientzle Exp $
-.\"
-.Dd December 15, 2003
-.Dt archive_entry 3
-.Os
-.Sh NAME
-.Nm archive_entry_acl_add_entry ,
-.Nm archive_entry_acl_add_entry_w ,
-.Nm archive_entry_acl_clear ,
-.Nm archive_entry_acl_count ,
-.Nm archive_entry_acl_next ,
-.Nm archive_entry_acl_next_w ,
-.Nm archive_entry_acl_reset ,
-.Nm archive_entry_acl_text_w ,
-.Nm archive_entry_atime ,
-.Nm archive_entry_atime_nsec ,
-.Nm archive_entry_clear ,
-.Nm archive_entry_clone ,
-.Nm archive_entry_copy_fflags_text_w ,
-.Nm archive_entry_copy_gname ,
-.Nm archive_entry_copy_gname_w ,
-.Nm archive_entry_copy_hardlink ,
-.Nm archive_entry_copy_hardlink_w ,
-.Nm archive_entry_copy_pathname_w ,
-.Nm archive_entry_copy_stat ,
-.Nm archive_entry_copy_symlink ,
-.Nm archive_entry_copy_symlink_w ,
-.Nm archive_entry_copy_uname ,
-.Nm archive_entry_copy_uname_w ,
-.Nm archive_entry_dev ,
-.Nm archive_entry_devmajor ,
-.Nm archive_entry_devminor ,
-.Nm archive_entry_filetype ,
-.Nm archive_entry_fflags ,
-.Nm archive_entry_fflags_text ,
-.Nm archive_entry_free ,
-.Nm archive_entry_gid ,
-.Nm archive_entry_gname ,
-.Nm archive_entry_hardlink ,
-.Nm archive_entry_ino ,
-.Nm archive_entry_mode ,
-.Nm archive_entry_mtime ,
-.Nm archive_entry_mtime_nsec ,
-.Nm archive_entry_nlink ,
-.Nm archive_entry_new ,
-.Nm archive_entry_pathname ,
-.Nm archive_entry_pathname_w ,
-.Nm archive_entry_rdev ,
-.Nm archive_entry_rdevmajor ,
-.Nm archive_entry_rdevminor ,
-.Nm archive_entry_set_atime ,
-.Nm archive_entry_set_ctime ,
-.Nm archive_entry_set_dev ,
-.Nm archive_entry_set_devmajor ,
-.Nm archive_entry_set_devminor ,
-.Nm archive_entry_set_filetype ,
-.Nm archive_entry_set_fflags ,
-.Nm archive_entry_set_gid ,
-.Nm archive_entry_set_gname ,
-.Nm archive_entry_set_hardlink ,
-.Nm archive_entry_set_link ,
-.Nm archive_entry_set_mode ,
-.Nm archive_entry_set_mtime ,
-.Nm archive_entry_set_pathname ,
-.Nm archive_entry_set_rdevmajor ,
-.Nm archive_entry_set_rdevminor ,
-.Nm archive_entry_set_size ,
-.Nm archive_entry_set_symlink ,
-.Nm archive_entry_set_uid ,
-.Nm archive_entry_set_uname ,
-.Nm archive_entry_size ,
-.Nm archive_entry_stat ,
-.Nm archive_entry_symlink ,
-.Nm archive_entry_uid ,
-.Nm archive_entry_uname
-.Nd functions for manipulating archive entry descriptions
-.Sh SYNOPSIS
-.In archive_entry.h
-.Ft void
-.Fn archive_entry_acl_add_entry "struct archive_entry *" "int type" "int permset" "int tag" "int qual" "const char *name"
-.Ft void
-.Fn archive_entry_acl_add_entry_w "struct archive_entry *" "int type" "int permset" "int tag" "int qual" "const wchar_t *name"
-.Ft void
-.Fn archive_entry_acl_clear "struct archive_entry *"
-.Ft int
-.Fn archive_entry_acl_count "struct archive_entry *" "int type"
-.Ft int
-.Fn archive_entry_acl_next "struct archive_entry *" "int want_type" "int *type" "int *permset" "int *tag" "int *qual" "const char **name"
-.Ft int
-.Fn archive_entry_acl_next_w "struct archive_entry *" "int want_type" "int *type" "int *permset" "int *tag" "int *qual" "const wchar_t **name"
-.Ft int
-.Fn archive_entry_acl_reset "struct archive_entry *" "int want_type"
-.Ft const wchar_t *
-.Fn archive_entry_acl_text_w "struct archive_entry *" "int flags"
-.Ft time_t
-.Fn archive_entry_atime "struct archive_entry *"
-.Ft long
-.Fn archive_entry_atime_nsec "struct archive_entry *"
-.Ft "struct archive_entry *"
-.Fn archive_entry_clear "struct archive_entry *"
-.Ft struct archive_entry *
-.Fn archive_entry_clone "struct archive_entry *"
-.Ft const wchar_t *
-.Fn archive_entry_copy_fflags_text_w "struct archive_entry *" "const wchar_t *"
-.Ft void
-.Fn archive_entry_copy_gname "struct archive_entry *" "const char *"
-.Ft void
-.Fn archive_entry_copy_gname_w "struct archive_entry *" "const wchar_t *"
-.Ft void
-.Fn archive_entry_copy_hardlink "struct archive_entry *" "const char *"
-.Ft void
-.Fn archive_entry_copy_hardlink_w "struct archive_entry *" "const wchar_t *"
-.Ft void
-.Fn archive_entry_copy_pathname_w "struct archive_entry *" "const wchar_t *"
-.Ft void
-.Fn archive_entry_copy_stat "struct archive_entry *" "const struct stat *"
-.Ft void
-.Fn archive_entry_copy_symlink "struct archive_entry *" "const char *"
-.Ft void
-.Fn archive_entry_copy_symlink_w "struct archive_entry *" "const wchar_t *"
-.Ft void
-.Fn archive_entry_copy_uname "struct archive_entry *" "const char *"
-.Ft void
-.Fn archive_entry_copy_uname_w "struct archive_entry *" "const wchar_t *"
-.Ft dev_t
-.Fn archive_entry_dev "struct archive_entry *"
-.Ft dev_t
-.Fn archive_entry_devmajor "struct archive_entry *"
-.Ft dev_t
-.Fn archive_entry_devminor "struct archive_entry *"
-.Ft mode_t
-.Fn archive_entry_filetype "struct archive_entry *"
-.Ft void
-.Fn archive_entry_fflags "struct archive_entry *" "unsigned long *set" "unsigned long *clear"
-.Ft const char *
-.Fn archive_entry_fflags_text "struct archive_entry *"
-.Ft void
-.Fn archive_entry_free "struct archive_entry *"
-.Ft const char *
-.Fn archive_entry_gname "struct archive_entry *"
-.Ft const char *
-.Fn archive_entry_hardlink "struct archive_entry *"
-.Ft ino_t
-.Fn archive_entry_ino "struct archive_entry *"
-.Ft mode_t
-.Fn archive_entry_mode "struct archive_entry *"
-.Ft time_t
-.Fn archive_entry_mtime "struct archive_entry *"
-.Ft long
-.Fn archive_entry_mtime_nsec "struct archive_entry *"
-.Ft unsigned int
-.Fn archive_entry_nlink "struct archive_entry *"
-.Ft struct archive_entry *
-.Fn archive_entry_new "void"
-.Ft const char *
-.Fn archive_entry_pathname "struct archive_entry *"
-.Ft const wchar_t *
-.Fn archive_entry_pathname_w "struct archive_entry *"
-.Ft dev_t
-.Fn archive_entry_rdev "struct archive_entry *"
-.Ft dev_t
-.Fn archive_entry_rdevmajor "struct archive_entry *"
-.Ft dev_t
-.Fn archive_entry_rdevminor "struct archive_entry *"
-.Ft void
-.Fn archive_entry_set_dev "struct archive_entry *" "dev_t"
-.Ft void
-.Fn archive_entry_set_devmajor "struct archive_entry *" "dev_t"
-.Ft void
-.Fn archive_entry_set_devminor "struct archive_entry *" "dev_t"
-.Ft void
-.Fn archive_entry_set_filetype "struct archive_entry *" "unsigned int"
-.Ft void
-.Fn archive_entry_set_fflags "struct archive_entry *" "unsigned long set" "unsigned long clear"
-.Ft void
-.Fn archive_entry_set_gid "struct archive_entry *" "gid_t"
-.Ft void
-.Fn archive_entry_set_gname "struct archive_entry *" "const char *"
-.Ft void
-.Fn archive_entry_set_hardlink "struct archive_entry *" "const char *"
-.Ft void
-.Fn archive_entry_set_ino "struct archive_entry *" "unsigned long"
-.Ft void
-.Fn archive_entry_set_link "struct archive_entry *" "const char *"
-.Ft void
-.Fn archive_entry_set_mode "struct archive_entry *" "mode_t"
-.Ft void
-.Fn archive_entry_set_mtime "struct archive_entry *" "time_t" "long nanos"
-.Ft void
-.Fn archive_entry_set_nlink "struct archive_entry *" "unsigned int"
-.Ft void
-.Fn archive_entry_set_pathname "struct archive_entry *" "const char *"
-.Ft void
-.Fn archive_entry_set_rdev "struct archive_entry *" "dev_t"
-.Ft void
-.Fn archive_entry_set_rdevmajor "struct archive_entry *" "dev_t"
-.Ft void
-.Fn archive_entry_set_rdevminor "struct archive_entry *" "dev_t"
-.Ft void
-.Fn archive_entry_set_size "struct archive_entry *" "int64_t"
-.Ft void
-.Fn archive_entry_set_symlink "struct archive_entry *" "const char *"
-.Ft void
-.Fn archive_entry_set_uid "struct archive_entry *" "uid_t"
-.Ft void
-.Fn archive_entry_set_uname "struct archive_entry *" "const char *"
-.Ft int64_t
-.Fn archive_entry_size "struct archive_entry *"
-.Ft const struct stat *
-.Fn archive_entry_stat "struct archive_entry *"
-.Ft const char *
-.Fn archive_entry_symlink "struct archive_entry *"
-.Ft const char *
-.Fn archive_entry_uname "struct archive_entry *"
-.Sh DESCRIPTION
+.TH archive_entry 3 "December 15, 2003" ""
+.SH NAME
+\fBarchive_entry_acl_add_entry\fP,
+\fBarchive_entry_acl_add_entry_w\fP,
+\fBarchive_entry_acl_clear\fP,
+\fBarchive_entry_acl_count\fP,
+\fBarchive_entry_acl_next\fP,
+\fBarchive_entry_acl_next_w\fP,
+\fBarchive_entry_acl_reset\fP,
+\fBarchive_entry_acl_text_w\fP,
+\fBarchive_entry_atime\fP,
+\fBarchive_entry_atime_nsec\fP,
+\fBarchive_entry_clear\fP,
+\fBarchive_entry_clone\fP,
+\fBarchive_entry_copy_fflags_text_w\fP,
+\fBarchive_entry_copy_gname\fP,
+\fBarchive_entry_copy_gname_w\fP,
+\fBarchive_entry_copy_hardlink\fP,
+\fBarchive_entry_copy_hardlink_w\fP,
+\fBarchive_entry_copy_pathname_w\fP,
+\fBarchive_entry_copy_stat\fP,
+\fBarchive_entry_copy_symlink\fP,
+\fBarchive_entry_copy_symlink_w\fP,
+\fBarchive_entry_copy_uname\fP,
+\fBarchive_entry_copy_uname_w\fP,
+\fBarchive_entry_dev\fP,
+\fBarchive_entry_devmajor\fP,
+\fBarchive_entry_devminor\fP,
+\fBarchive_entry_filetype\fP,
+\fBarchive_entry_fflags\fP,
+\fBarchive_entry_fflags_text\fP,
+\fBarchive_entry_free\fP,
+\fBarchive_entry_gid\fP,
+\fBarchive_entry_gname\fP,
+\fBarchive_entry_hardlink\fP,
+\fBarchive_entry_ino\fP,
+\fBarchive_entry_mode\fP,
+\fBarchive_entry_mtime\fP,
+\fBarchive_entry_mtime_nsec\fP,
+\fBarchive_entry_nlink\fP,
+\fBarchive_entry_new\fP,
+\fBarchive_entry_pathname\fP,
+\fBarchive_entry_pathname_w\fP,
+\fBarchive_entry_rdev\fP,
+\fBarchive_entry_rdevmajor\fP,
+\fBarchive_entry_rdevminor\fP,
+\fBarchive_entry_set_atime\fP,
+\fBarchive_entry_set_ctime\fP,
+\fBarchive_entry_set_dev\fP,
+\fBarchive_entry_set_devmajor\fP,
+\fBarchive_entry_set_devminor\fP,
+\fBarchive_entry_set_filetype\fP,
+\fBarchive_entry_set_fflags\fP,
+\fBarchive_entry_set_gid\fP,
+\fBarchive_entry_set_gname\fP,
+\fBarchive_entry_set_hardlink\fP,
+\fBarchive_entry_set_link\fP,
+\fBarchive_entry_set_mode\fP,
+\fBarchive_entry_set_mtime\fP,
+\fBarchive_entry_set_pathname\fP,
+\fBarchive_entry_set_rdevmajor\fP,
+\fBarchive_entry_set_rdevminor\fP,
+\fBarchive_entry_set_size\fP,
+\fBarchive_entry_set_symlink\fP,
+\fBarchive_entry_set_uid\fP,
+\fBarchive_entry_set_uname\fP,
+\fBarchive_entry_size\fP,
+\fBarchive_entry_stat\fP,
+\fBarchive_entry_symlink\fP,
+\fBarchive_entry_uid\fP,
+\fBarchive_entry_uname\fP
+\- functions for manipulating archive entry descriptions
+.SH SYNOPSIS
+\fB#include <archive_entry.h>\fP
+.br
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_acl_add_entry\fP
+.hy
+("struct archive_entry *" "int type" "int permset" "int tag" "int qual" "const char *name");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_acl_add_entry_w\fP
+.hy
+("struct archive_entry *" "int type" "int permset" "int tag" "int qual" "const wchar_t *name");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_acl_clear\fP
+.hy
+("struct archive_entry *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_entry_acl_count\fP
+.hy
+("struct archive_entry *" "int type");
+\fIint\fP
+.RE
+.nh
+\fBarchive_entry_acl_next\fP
+.hy
+("struct archive_entry *" "int want_type" "int *type" "int *permset" "int *tag" "int *qual" "const char **name");
+\fIint\fP
+.RE
+.nh
+\fBarchive_entry_acl_next_w\fP
+.hy
+("struct archive_entry *" "int want_type" "int *type" "int *permset" "int *tag" "int *qual" "const wchar_t **name");
+\fIint\fP
+.RE
+.nh
+\fBarchive_entry_acl_reset\fP
+.hy
+("struct archive_entry *" "int want_type");
+\fIconst wchar_t *\fP
+.RE
+.nh
+\fBarchive_entry_acl_text_w\fP
+.hy
+("struct archive_entry *" "int flags");
+\fItime_t\fP
+.RE
+.nh
+\fBarchive_entry_atime\fP
+.hy
+("struct archive_entry *");
+\fIlong\fP
+.RE
+.nh
+\fBarchive_entry_atime_nsec\fP
+.hy
+("struct archive_entry *");
+\fI"struct archive_entry *"\fP
+.RE
+.nh
+\fBarchive_entry_clear\fP
+.hy
+("struct archive_entry *");
+\fIstruct archive_entry *\fP
+.RE
+.nh
+\fBarchive_entry_clone\fP
+.hy
+("struct archive_entry *");
+\fIconst wchar_t *\fP
+.RE
+.nh
+\fBarchive_entry_copy_fflags_text_w\fP
+.hy
+("struct archive_entry *" "const wchar_t *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_gname\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_gname_w\fP
+.hy
+("struct archive_entry *" "const wchar_t *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_hardlink\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_hardlink_w\fP
+.hy
+("struct archive_entry *" "const wchar_t *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_pathname_w\fP
+.hy
+("struct archive_entry *" "const wchar_t *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_stat\fP
+.hy
+("struct archive_entry *" "const struct stat *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_symlink\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_symlink_w\fP
+.hy
+("struct archive_entry *" "const wchar_t *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_uname\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_copy_uname_w\fP
+.hy
+("struct archive_entry *" "const wchar_t *");
+\fIdev_t\fP
+.RE
+.nh
+\fBarchive_entry_dev\fP
+.hy
+("struct archive_entry *");
+\fIdev_t\fP
+.RE
+.nh
+\fBarchive_entry_devmajor\fP
+.hy
+("struct archive_entry *");
+\fIdev_t\fP
+.RE
+.nh
+\fBarchive_entry_devminor\fP
+.hy
+("struct archive_entry *");
+\fImode_t\fP
+.RE
+.nh
+\fBarchive_entry_filetype\fP
+.hy
+("struct archive_entry *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_fflags\fP
+.hy
+("struct archive_entry *" "unsigned long *set" "unsigned long *clear");
+\fIconst char *\fP
+.RE
+.nh
+\fBarchive_entry_fflags_text\fP
+.hy
+("struct archive_entry *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_free\fP
+.hy
+("struct archive_entry *");
+\fIconst char *\fP
+.RE
+.nh
+\fBarchive_entry_gname\fP
+.hy
+("struct archive_entry *");
+\fIconst char *\fP
+.RE
+.nh
+\fBarchive_entry_hardlink\fP
+.hy
+("struct archive_entry *");
+\fIino_t\fP
+.RE
+.nh
+\fBarchive_entry_ino\fP
+.hy
+("struct archive_entry *");
+\fImode_t\fP
+.RE
+.nh
+\fBarchive_entry_mode\fP
+.hy
+("struct archive_entry *");
+\fItime_t\fP
+.RE
+.nh
+\fBarchive_entry_mtime\fP
+.hy
+("struct archive_entry *");
+\fIlong\fP
+.RE
+.nh
+\fBarchive_entry_mtime_nsec\fP
+.hy
+("struct archive_entry *");
+\fIunsigned int\fP
+.RE
+.nh
+\fBarchive_entry_nlink\fP
+.hy
+("struct archive_entry *");
+\fIstruct archive_entry *\fP
+.RE
+.nh
+\fBarchive_entry_new\fP
+.hy
+("void");
+\fIconst char *\fP
+.RE
+.nh
+\fBarchive_entry_pathname\fP
+.hy
+("struct archive_entry *");
+\fIconst wchar_t *\fP
+.RE
+.nh
+\fBarchive_entry_pathname_w\fP
+.hy
+("struct archive_entry *");
+\fIdev_t\fP
+.RE
+.nh
+\fBarchive_entry_rdev\fP
+.hy
+("struct archive_entry *");
+\fIdev_t\fP
+.RE
+.nh
+\fBarchive_entry_rdevmajor\fP
+.hy
+("struct archive_entry *");
+\fIdev_t\fP
+.RE
+.nh
+\fBarchive_entry_rdevminor\fP
+.hy
+("struct archive_entry *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_dev\fP
+.hy
+("struct archive_entry *" "dev_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_devmajor\fP
+.hy
+("struct archive_entry *" "dev_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_devminor\fP
+.hy
+("struct archive_entry *" "dev_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_filetype\fP
+.hy
+("struct archive_entry *" "unsigned int");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_fflags\fP
+.hy
+("struct archive_entry *" "unsigned long set" "unsigned long clear");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_gid\fP
+.hy
+("struct archive_entry *" "gid_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_gname\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_hardlink\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_ino\fP
+.hy
+("struct archive_entry *" "unsigned long");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_link\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_mode\fP
+.hy
+("struct archive_entry *" "mode_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_mtime\fP
+.hy
+("struct archive_entry *" "time_t" "long nanos");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_nlink\fP
+.hy
+("struct archive_entry *" "unsigned int");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_pathname\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_rdev\fP
+.hy
+("struct archive_entry *" "dev_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_rdevmajor\fP
+.hy
+("struct archive_entry *" "dev_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_rdevminor\fP
+.hy
+("struct archive_entry *" "dev_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_size\fP
+.hy
+("struct archive_entry *" "int64_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_symlink\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_uid\fP
+.hy
+("struct archive_entry *" "uid_t");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_entry_set_uname\fP
+.hy
+("struct archive_entry *" "const char *");
+\fIint64_t\fP
+.RE
+.nh
+\fBarchive_entry_size\fP
+.hy
+("struct archive_entry *");
+\fIconst struct stat *\fP
+.RE
+.nh
+\fBarchive_entry_stat\fP
+.hy
+("struct archive_entry *");
+\fIconst char *\fP
+.RE
+.nh
+\fBarchive_entry_symlink\fP
+.hy
+("struct archive_entry *");
+\fIconst char *\fP
+.RE
+.nh
+\fBarchive_entry_uname\fP
+.hy
+("struct archive_entry *");
+.SH DESCRIPTION
These functions create and manipulate data objects that
represent entries within an archive.
You can think of a
-.Tn struct archive_entry
+Tn struct archive_entry
as a heavy-duty version of
-.Tn struct stat :
+Tn struct stat:
it includes everything from
-.Tn struct stat
+Tn struct stat
plus associated pathname, textual group and user names, etc.
These objects are used by
-.Xr libarchive 3
+\fBlibarchive\fP(3)
to represent the metadata associated with a particular
entry in an archive.
-.Ss Create and Destroy
+.SS Create and Destroy
There are functions to allocate, destroy, clear, and copy
-.Va archive_entry
+\fIarchive_entry\fP
objects:
-.Bl -tag -compact -width indent
-.It Fn archive_entry_clear
+.TP
+.nh
+\fBarchive_entry_clear\fP
+.hy
+();
Erases the object, resetting all internal fields to the
same state as a newly-created object.
This is provided to allow you to quickly recycle objects
without thrashing the heap.
-.It Fn archive_entry_clone
+.TP
+.nh
+\fBarchive_entry_clone\fP
+.hy
+();
A deep copy operation; all text fields are duplicated.
-.It Fn archive_entry_free
+.TP
+.nh
+\fBarchive_entry_free\fP
+.hy
+();
Releases the
-.Tn struct archive_entry
+Tn struct archive_entry
object.
-.It Fn archive_entry_new
+.TP
+.nh
+\fBarchive_entry_new\fP
+.hy
+();
Allocate and return a blank
-.Tn struct archive_entry
+Tn struct archive_entry
object.
-.El
-.Ss Set and Get Functions
+.SS Set and Get Functions
Most of the functions here set or read entries in an object.
Such functions have one of the following forms:
-.Bl -tag -compact -width indent
-.It Fn archive_entry_set_XXXX
+.TP
+.nh
+\fBarchive_entry_set_XXXX\fP
+.hy
+();
Stores the provided data in the object.
In particular, for strings, the pointer is stored,
not the referenced string.
-.It Fn archive_entry_copy_XXXX
+.TP
+.nh
+\fBarchive_entry_copy_XXXX\fP
+.hy
+();
As above, except that the referenced data is copied
into the object.
-.It Fn archive_entry_XXXX
+.TP
+.nh
+\fBarchive_entry_XXXX\fP
+.hy
+();
Returns the specified data.
In the case of strings, a const-qualified pointer to
the string is returned.
-.El
String data can be set or accessed as wide character strings
or normal
-.Va char
+\fIchar\fP
strings.
The functions that use wide character strings are suffixed with
-.Cm _w .
+\fB_w\fP.
Note that these are different representations of the same data:
For example, if you store a narrow string and read the corresponding
wide string, the object will transparently convert formats
@@ -300,14 +569,15 @@ using the current locale.
Similarly, if you store a wide string and then store a
narrow string for the same data, the previously-set wide string will
be discarded in favor of the new data.
-.Pp
There are a few set/get functions that merit additional description:
-.Bl -tag -compact -width indent
-.It Fn archive_entry_set_link
+.TP
+.nh
+\fBarchive_entry_set_link\fP
+.hy
+();
This function sets the symlink field if it is already set.
Otherwise, it sets the hardlink field.
-.El
-.Ss File Flags
+.SS File Flags
File flags are transparently converted between a bitmap
representation and a textual format.
For example, if you set the bitmap and ask for text, the library
@@ -318,7 +588,6 @@ If you need to canonicalize a textual flags string, you should first set the
text form, then request the bitmap form, then use that to set the bitmap form.
Setting the bitmap format will clear the internal text representation
and force it to be reconstructed when you next request the text form.
-.Pp
The bitmap format consists of two integers, one containing bits
that should be set, the other specifying bits that should be
cleared.
@@ -328,15 +597,17 @@ In unusual circumstances, you can force a fully-specified set
of file flags by setting the bitmap of flags to clear to the complement
of the bitmap of flags to set.
(This differs from
-.Xr fflagstostr 3 ,
+\fBfflagstostr\fP(3),
which only includes names for set bits.)
Converting a bitmap to a textual string is a platform-specific
operation; bits that are not meaningful on the current platform
will be ignored.
-.Pp
The canonical text format is a comma-separated list of flag names.
The
-.Fn archive_entry_copy_fflags_text_w
+.nh
+\fBarchive_entry_copy_fflags_text_w\fP
+.hy
+();
function parses the provided text and sets the internal bitmap values.
This is a platform-specific operation; names that are not meaningful
on the current platform will be ignored.
@@ -346,14 +617,13 @@ Note that every name--including names that follow an unrecognized name--will
be evaluated, and the bitmaps will be set to reflect every name that is
recognized.
(In particular, this differs from
-.Xr strtofflags 3 ,
+\fBstrtofflags\fP(3),
which stops parsing at the first unrecognized name.)
-.Ss ACL Handling
+.SS ACL Handling
XXX This needs serious help.
XXX
-.Pp
An
-.Dq Access Control List
+``Access Control List''
(ACL) is a list of permissions that grant access to particular users or
groups beyond what would normally be provided by standard POSIX mode bits.
The ACL handling here addresses some deficiencies in the POSIX.1e draft 17 ACL
@@ -361,22 +631,17 @@ specification.
In particular, POSIX.1e draft 17 specifies several different formats, but
none of those formats include both textual user/group names and numeric
UIDs/GIDs.
-.Pp
XXX explain ACL stuff XXX
-.\" .Sh EXAMPLE
-.\" .Sh RETURN VALUES
-.\" .Sh ERRORS
-.Sh SEE ALSO
-.Xr archive 3
-.Sh HISTORY
+.SH SEE ALSO
+\fBarchive\fP(3)
+.SH HISTORY
The
-.Nm libarchive
+\fBlibarchive\fP
library first appeared in
-.Fx 5.3 .
-.Sh AUTHORS
-.An -nosplit
+FreeBSD 5.3.
+.SH AUTHORS
+-nosplit
The
-.Nm libarchive
+\fBlibarchive\fP
library was written by
-.An Tim Kientzle Aq kientzle@acm.org .
-.\" .Sh BUGS
+Tim Kientzle <kientzle@acm.org.>
diff --git a/archivers/libarchive/files/doc/man/archive_read.3 b/archivers/libarchive/files/doc/man/archive_read.3
index 6daba3f3d11..524c5a8d79d 100644
--- a/archivers/libarchive/files/doc/man/archive_read.3
+++ b/archivers/libarchive/files/doc/man/archive_read.3
@@ -1,230 +1,446 @@
-.\" Copyright (c) 2003-2007 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: src/lib/libarchive/archive_read.3,v 1.35 2007/09/19 16:37:45 kientzle Exp $
-.\"
-.Dd August 19, 2006
-.Dt archive_read 3
-.Os
-.Sh NAME
-.Nm archive_read_new ,
-.Nm archive_read_support_compression_all ,
-.Nm archive_read_support_compression_bzip2 ,
-.Nm archive_read_support_compression_compress ,
-.Nm archive_read_support_compression_gzip ,
-.Nm archive_read_support_compression_none ,
-.Nm archive_read_support_compression_program ,
-.Nm archive_read_support_format_all ,
-.Nm archive_read_support_format_cpio ,
-.Nm archive_read_support_format_empty ,
-.Nm archive_read_support_format_iso9660 ,
-.Nm archive_read_support_format_tar ,
-.Nm archive_read_support_format_zip ,
-.Nm archive_read_open ,
-.Nm archive_read_open2 ,
-.Nm archive_read_open_fd ,
-.Nm archive_read_open_FILE ,
-.Nm archive_read_open_filename ,
-.Nm archive_read_open_memory ,
-.Nm archive_read_next_header ,
-.Nm archive_read_data ,
-.Nm archive_read_data_block ,
-.Nm archive_read_data_skip ,
-.\" #if ARCHIVE_API_VERSION < 3
-.Nm archive_read_data_into_buffer ,
-.\" #endif
-.Nm archive_read_data_into_fd ,
-.Nm archive_read_extract ,
-.Nm archive_read_extract_set_progress_callback ,
-.Nm archive_read_close ,
-.Nm archive_read_finish
-.Nd functions for reading streaming archives
-.Sh SYNOPSIS
-.In archive.h
-.Ft struct archive *
-.Fn archive_read_new "void"
-.Ft int
-.Fn archive_read_support_compression_all "struct archive *"
-.Ft int
-.Fn archive_read_support_compression_bzip2 "struct archive *"
-.Ft int
-.Fn archive_read_support_compression_compress "struct archive *"
-.Ft int
-.Fn archive_read_support_compression_gzip "struct archive *"
-.Ft int
-.Fn archive_read_support_compression_none "struct archive *"
-.Ft int
-.Fn archive_read_support_compression_program "struct archive *" "const char *cmd"
-.Ft int
-.Fn archive_read_support_format_all "struct archive *"
-.Ft int
-.Fn archive_read_support_format_cpio "struct archive *"
-.Ft int
-.Fn archive_read_support_format_empty "struct archive *"
-.Ft int
-.Fn archive_read_support_format_iso9660 "struct archive *"
-.Ft int
-.Fn archive_read_support_format_tar "struct archive *"
-.Ft int
-.Fn archive_read_support_format_zip "struct archive *"
-.Ft int
-.Fn archive_read_open "struct archive *" "void *client_data" "archive_open_callback *" "archive_read_callback *" "archive_close_callback *"
-.Ft int
-.Fn archive_read_open2 "struct archive *" "void *client_data" "archive_open_callback *" "archive_read_callback *" "archive_skip_callback *" "archive_close_callback *"
-.Ft int
-.Fn archive_read_open_FILE "struct archive *" "FILE *file"
-.Ft int
-.Fn archive_read_open_fd "struct archive *" "int fd" "size_t block_size"
-.Ft int
-.Fn archive_read_open_filename "struct archive *" "const char *filename" "size_t block_size"
-.Ft int
-.Fn archive_read_open_memory "struct archive *" "void *buff" "size_t size"
-.Ft int
-.Fn archive_read_next_header "struct archive *" "struct archive_entry **"
-.Ft ssize_t
-.Fn archive_read_data "struct archive *" "void *buff" "size_t len"
-.Ft int
-.Fn archive_read_data_block "struct archive *" "const void **buff" "size_t *len" "off_t *offset"
-.Ft int
-.Fn archive_read_data_skip "struct archive *"
-.\" #if ARCHIVE_API_VERSION < 3
-.Ft int
-.Fn archive_read_data_into_buffer "struct archive *" "void *" "ssize_t len"
-.\" #endif
-.Ft int
-.Fn archive_read_data_into_fd "struct archive *" "int fd"
-.Ft int
-.Fn archive_read_extract "struct archive *" "struct archive_entry *" "int flags"
-.Ft void
-.Fn archive_read_extract_set_progress_callback "struct archive *" "void (*func)(void *)" "void *user_data"
-.Ft int
-.Fn archive_read_close "struct archive *"
-.Ft int
-.Fn archive_read_finish "struct archive *"
-.Sh DESCRIPTION
+.TH archive_read 3 "August 19, 2006" ""
+.SH NAME
+\fBarchive_read_new\fP,
+\fBarchive_read_support_compression_all\fP,
+\fBarchive_read_support_compression_bzip2\fP,
+\fBarchive_read_support_compression_compress\fP,
+\fBarchive_read_support_compression_gzip\fP,
+\fBarchive_read_support_compression_none\fP,
+\fBarchive_read_support_compression_program\fP,
+\fBarchive_read_support_format_all\fP,
+\fBarchive_read_support_format_cpio\fP,
+\fBarchive_read_support_format_empty\fP,
+\fBarchive_read_support_format_iso9660\fP,
+\fBarchive_read_support_format_tar\fP,
+\fBarchive_read_support_format_zip\fP,
+\fBarchive_read_open\fP,
+\fBarchive_read_open2\fP,
+\fBarchive_read_open_fd\fP,
+\fBarchive_read_open_FILE\fP,
+\fBarchive_read_open_filename\fP,
+\fBarchive_read_open_memory\fP,
+\fBarchive_read_next_header\fP,
+\fBarchive_read_data\fP,
+\fBarchive_read_data_block\fP,
+\fBarchive_read_data_skip\fP,
+\fBarchive_read_data_into_buffer\fP,
+\fBarchive_read_data_into_fd\fP,
+\fBarchive_read_extract\fP,
+\fBarchive_read_extract_set_progress_callback\fP,
+\fBarchive_read_close\fP,
+\fBarchive_read_finish\fP
+\- functions for reading streaming archives
+.SH SYNOPSIS
+\fB#include <archive.h>\fP
+.br
+\fIstruct archive *\fP
+.RE
+.nh
+\fBarchive_read_new\fP
+.hy
+("void");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_compression_all\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_compression_bzip2\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_compression_compress\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_compression_gzip\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_compression_none\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_compression_program\fP
+.hy
+("struct archive *" "const char *cmd");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_format_all\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_format_cpio\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_format_empty\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_format_iso9660\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_format_tar\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_support_format_zip\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_open\fP
+.hy
+("struct archive *" "void *client_data" "archive_open_callback *" "archive_read_callback *" "archive_close_callback *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_open2\fP
+.hy
+("struct archive *" "void *client_data" "archive_open_callback *" "archive_read_callback *" "archive_skip_callback *" "archive_close_callback *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_open_FILE\fP
+.hy
+("struct archive *" "FILE *file");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_open_fd\fP
+.hy
+("struct archive *" "int fd" "size_t block_size");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_open_filename\fP
+.hy
+("struct archive *" "const char *filename" "size_t block_size");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_open_memory\fP
+.hy
+("struct archive *" "void *buff" "size_t size");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_next_header\fP
+.hy
+("struct archive *" "struct archive_entry **");
+\fIssize_t\fP
+.RE
+.nh
+\fBarchive_read_data\fP
+.hy
+("struct archive *" "void *buff" "size_t len");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_data_block\fP
+.hy
+("struct archive *" "const void **buff" "size_t *len" "off_t *offset");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_data_skip\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_data_into_buffer\fP
+.hy
+("struct archive *" "void *" "ssize_t len");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_data_into_fd\fP
+.hy
+("struct archive *" "int fd");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_extract\fP
+.hy
+("struct archive *" "struct archive_entry *" "int flags");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_read_extract_set_progress_callback\fP
+.hy
+("struct archive *" "void (*func)(void *)" "void *user_data");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_close\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_read_finish\fP
+.hy
+("struct archive *");
+.SH DESCRIPTION
These functions provide a complete API for reading streaming archives.
The general process is to first create the
-.Tn struct archive
+Tn struct archive
object, set options, initialize the reader, iterate over the archive
headers and associated data, then close the archive and release all
resources.
The following summary describes the functions in approximately the
order they would be used:
-.Bl -tag -compact -width indent
-.It Fn archive_read_new
+.TP
+.nh
+\fBarchive_read_new\fP
+.hy
+();
Allocates and initializes a
-.Tn struct archive
+Tn struct archive
object suitable for reading from an archive.
-.It Fn archive_read_support_compression_all , Fn archive_read_support_compression_bzip2 , Fn archive_read_support_compression_compress , Fn archive_read_support_compression_gzip , Fn archive_read_support_compression_none
+.TP
+.nh
+\fBarchive_read_support_compression_all\fP
+.hy
+(, .nh);
+\fBarchive_read_support_compression_bzip2\fP
+.hy
+(, .nh);
+\fBarchive_read_support_compression_compress\fP
+.hy
+(, .nh);
+\fBarchive_read_support_compression_gzip\fP
+.hy
+(, .nh);
+\fBarchive_read_support_compression_none\fP
+.hy
+();
Enables auto-detection code and decompression support for the
specified compression.
Note that
-.Dq none
+``none''
is always enabled by default.
For convenience,
-.Fn archive_read_support_compression_all
+.nh
+\fBarchive_read_support_compression_all\fP
+.hy
+();
enables all available decompression code.
-.It Fn archive_read_support_compression_program
+.TP
+.nh
+\fBarchive_read_support_compression_program\fP
+.hy
+();
Data is fed through the specified external program before being dearchived.
Note that this disables automatic detection of the compression format,
so it makes no sense to specify this in conjunction with any other
decompression option.
-.It Fn archive_read_support_format_all , Fn archive_read_support_format_cpio , Fn archive_read_support_format_empty , Fn archive_read_support_format_iso9660 , Fn archive_read_support_format_tar, Fn archive_read_support_format_zip
+.TP
+.nh
+\fBarchive_read_support_format_all\fP
+.hy
+(, .nh);
+\fBarchive_read_support_format_cpio\fP
+.hy
+(, .nh);
+\fBarchive_read_support_format_empty\fP
+.hy
+(, .nh);
+\fBarchive_read_support_format_iso9660\fP
+.hy
+(, .nh);
+\fBarchive_read_support_format_tar,\fP
+.hy
+(.nh);
+\fBarchive_read_support_format_zip\fP
+.hy
+();
Enables support---including auto-detection code---for the
specified archive format.
For example,
-.Fn archive_read_support_format_tar
+.nh
+\fBarchive_read_support_format_tar\fP
+.hy
+();
enables support for a variety of standard tar formats, old-style tar,
ustar, pax interchange format, and many common variants.
For convenience,
-.Fn archive_read_support_format_all
+.nh
+\fBarchive_read_support_format_all\fP
+.hy
+();
enables support for all available formats.
Only empty archives are supported by default.
-.It Fn archive_read_open
+.TP
+.nh
+\fBarchive_read_open\fP
+.hy
+();
The same as
-.Fn archive_read_open2 ,
+.nh
+\fBarchive_read_open2\fP
+.hy
+(,);
except that the skip callback is assumed to be
-.Dv NULL .
-.It Fn archive_read_open2
+.BR NULL.
+.TP
+.nh
+\fBarchive_read_open2\fP
+.hy
+();
Freeze the settings, open the archive, and prepare for reading entries.
This is the most generic version of this call, which accepts
four callback functions.
Most clients will want to use
-.Fn archive_read_open_filename ,
-.Fn archive_read_open_FILE ,
-.Fn archive_read_open_fd ,
+.nh
+\fBarchive_read_open_filename\fP
+.hy
+(,);
+.nh
+\fBarchive_read_open_FILE\fP
+.hy
+(,);
+.nh
+\fBarchive_read_open_fd\fP
+.hy
+(,);
or
-.Fn archive_read_open_memory
+.nh
+\fBarchive_read_open_memory\fP
+.hy
+();
instead.
The library invokes the client-provided functions to obtain
raw bytes from the archive.
-.It Fn archive_read_open_FILE
+.TP
+.nh
+\fBarchive_read_open_FILE\fP
+.hy
+();
Like
-.Fn archive_read_open ,
+.nh
+\fBarchive_read_open\fP
+.hy
+(,);
except that it accepts a
-.Ft "FILE *"
+\fI"FILE *"\fP
+.RE
pointer.
This function should not be used with tape drives or other devices
that require strict I/O blocking.
-.It Fn archive_read_open_fd
+.TP
+.nh
+\fBarchive_read_open_fd\fP
+.hy
+();
Like
-.Fn archive_read_open ,
+.nh
+\fBarchive_read_open\fP
+.hy
+(,);
except that it accepts a file descriptor and block size rather than
a set of function pointers.
Note that the file descriptor will not be automatically closed at
end-of-archive.
This function is safe for use with tape drives or other blocked devices.
-.It Fn archive_read_open_file
+.TP
+.nh
+\fBarchive_read_open_file\fP
+.hy
+();
This is a deprecated synonym for
-.Fn archive_read_open_filename .
-.It Fn archive_read_open_filename
+.nh
+\fBarchive_read_open_filename\fP
+.hy
+(.);
+.TP
+.nh
+\fBarchive_read_open_filename\fP
+.hy
+();
Like
-.Fn archive_read_open ,
+.nh
+\fBarchive_read_open\fP
+.hy
+(,);
except that it accepts a simple filename and a block size.
A NULL filename represents standard input.
This function is safe for use with tape drives or other blocked devices.
-.It Fn archive_read_open_memory
+.TP
+.nh
+\fBarchive_read_open_memory\fP
+.hy
+();
Like
-.Fn archive_read_open ,
+.nh
+\fBarchive_read_open\fP
+.hy
+(,);
except that it accepts a pointer and size of a block of
memory containing the archive data.
-.It Fn archive_read_next_header
+.TP
+.nh
+\fBarchive_read_next_header\fP
+.hy
+();
Read the header for the next entry and return a pointer to
a
-.Tn struct archive_entry .
-.It Fn archive_read_data
+Tn struct archive_entry.
+.TP
+.nh
+\fBarchive_read_data\fP
+.hy
+();
Read data associated with the header just read.
Internally, this is a convenience function that calls
-.Fn archive_read_data_block
+.nh
+\fBarchive_read_data_block\fP
+.hy
+();
and fills any gaps with nulls so that callers see a single
continuous stream of data.
-.It Fn archive_read_data_block
+.TP
+.nh
+\fBarchive_read_data_block\fP
+.hy
+();
Return the next available block of data for this entry.
Unlike
-.Fn archive_read_data ,
+.nh
+\fBarchive_read_data\fP
+.hy
+(,);
the
-.Fn archive_read_data_block
+.nh
+\fBarchive_read_data_block\fP
+.hy
+();
function avoids copying data and allows you to correctly handle
sparse files, as supported by some archive formats.
The library guarantees that offsets will increase and that blocks
@@ -232,43 +448,76 @@ will not overlap.
Note that the blocks returned from this function can be much larger
than the block size read from disk, due to compression
and internal buffer optimizations.
-.It Fn archive_read_data_skip
+.TP
+.nh
+\fBarchive_read_data_skip\fP
+.hy
+();
A convenience function that repeatedly calls
-.Fn archive_read_data_block
+.nh
+\fBarchive_read_data_block\fP
+.hy
+();
to skip all of the data for this archive entry.
-.\" #if ARCHIVE_API_VERSION < 3
-.It Fn archive_read_data_into_buffer
+.TP
+.nh
+\fBarchive_read_data_into_buffer\fP
+.hy
+();
This function is deprecated and will be removed.
Use
-.Fn archive_read_data
+.nh
+\fBarchive_read_data\fP
+.hy
+();
instead.
-.\" #endif
-.It Fn archive_read_data_into_fd
+.TP
+.nh
+\fBarchive_read_data_into_fd\fP
+.hy
+();
A convenience function that repeatedly calls
-.Fn archive_read_data_block
+.nh
+\fBarchive_read_data_block\fP
+.hy
+();
to copy the entire entry to the provided file descriptor.
-.It Fn archive_read_extract , Fn archive_read_extract_set_skip_file
+.TP
+.nh
+\fBarchive_read_extract\fP
+.hy
+(, .nh);
+\fBarchive_read_extract_set_skip_file\fP
+.hy
+();
A convenience function that wraps the corresponding
-.Xr archive_write_disk 3
+\fBarchive_write_disk\fP(3)
interfaces.
The first call to
-.Fn archive_read_extract
+.nh
+\fBarchive_read_extract\fP
+.hy
+();
creates a restore object using
-.Xr archive_write_disk_new 3
+\fBarchive_write_disk_new\fP(3)
and
-.Xr archive_write_disk_set_standard_lookup 3 ,
+\fBarchive_write_disk_set_standard_lookup\fP(3),
then transparently invokes
-.Xr archive_write_disk_set_options 3 ,
-.Xr archive_write_header 3 ,
-.Xr archive_write_data 3 ,
+\fBarchive_write_disk_set_options\fP(3),
+\fBarchive_write_header\fP(3),
+\fBarchive_write_data\fP(3),
and
-.Xr archive_write_finish_entry 3
+\fBarchive_write_finish_entry\fP(3)
to create the entry on disk and copy data into it.
The
-.Va flags
+\fIflags\fP
argument is passed unmodified to
-.Xr archive_write_disk_set_options 3 .
-.It Fn archive_read_extract_set_progress_callback
+\fBarchive_write_disk_set_options\fP(3).
+.TP
+.nh
+\fBarchive_read_extract_set_progress_callback\fP
+.hy
+();
Sets a pointer to a user-defined callback that can be used
for updating progress displays during extraction.
The progress function will be invoked during the extraction of large
@@ -277,73 +526,100 @@ The progress function will be invoked with the pointer provided to this call.
Generally, the data pointed to should include a reference to the archive
object and the archive_entry object so that various statistics
can be retrieved for the progress display.
-.It Fn archive_read_close
+.TP
+.nh
+\fBarchive_read_close\fP
+.hy
+();
Complete the archive and invoke the close callback.
-.It Fn archive_read_finish
+.TP
+.nh
+\fBarchive_read_finish\fP
+.hy
+();
Invokes
-.Fn archive_read_close
+.nh
+\fBarchive_read_close\fP
+.hy
+();
if it was not invoked manually, then release all resources.
Note: In libarchive 1.x, this function was declared to return
-.Ft void ,
+\fIvoid,\fP
+.RE
which made it impossible to detect certain errors when
-.Fn archive_read_close
+.nh
+\fBarchive_read_close\fP
+.hy
+();
was invoked implicitly from this function.
The declaration is corrected beginning with libarchive 2.0.
-.El
-.Pp
Note that the library determines most of the relevant information about
the archive by inspection.
In particular, it automatically detects
-.Xr gzip 1
+\fBgzip\fP(1)
or
-.Xr bzip2 1
+\fBbzip2\fP(1)
compression and transparently performs the appropriate decompression.
It also automatically detects the archive format.
-.Pp
A complete description of the
-.Tn struct archive
+Tn struct archive
and
-.Tn struct archive_entry
+Tn struct archive_entry
objects can be found in the overview manual page for
-.Xr libarchive 3 .
-.Sh CLIENT CALLBACKS
+\fBlibarchive\fP(3).
+.SH CLIENT CALLBACKS
The callback functions must match the following prototypes:
-.Bl -item -offset indent
-.It
-.Ft typedef ssize_t
-.Fn archive_read_callback "struct archive *" "void *client_data" "const void **buffer"
-.It
-.\" #if ARCHIVE_API_VERSION < 2
-.Ft typedef int
-.Fn archive_skip_callback "struct archive *" "void *client_data" "size_t request"
-.\" #else
-.\" .Ft typedef off_t
-.\" .Fn archive_skip_callback "struct archive *" "void *client_data" "off_t request"
-.\" #endif
-.It
-.Ft typedef int
-.Fn archive_open_callback "struct archive *" "void *client_data"
-.It
-.Ft typedef int
-.Fn archive_close_callback "struct archive *" "void *client_data"
-.El
-.Pp
+.IP
+\fItypedef ssize_t\fP
+.RE
+.nh
+\fBarchive_read_callback\fP
+.hy
+("struct archive *" "void *client_data" "const void **buffer");
+.IP
+\fItypedef int\fP
+.RE
+.nh
+\fBarchive_skip_callback\fP
+.hy
+("struct archive *" "void *client_data" "size_t request");
+.IP
+\fItypedef int\fP
+.RE
+.nh
+\fBarchive_open_callback\fP
+.hy
+("struct archive *" "void *client_data");
+.IP
+\fItypedef int\fP
+.RE
+.nh
+\fBarchive_close_callback\fP
+.hy
+("struct archive *" "void *client_data");
The open callback is invoked by
-.Fn archive_open .
+.nh
+\fBarchive_open\fP
+.hy
+(.);
It should return
-.Cm ARCHIVE_OK
+\fBARCHIVE_OK\fP
if the underlying file or data source is successfully
opened.
If the open fails, it should call
-.Fn archive_set_error
+.nh
+\fBarchive_set_error\fP
+.hy
+();
to register an error code and message and return
-.Cm ARCHIVE_FATAL .
-.Pp
+\fBARCHIVE_FATAL\fP.
The read callback is invoked whenever the library
requires raw bytes from the archive.
The read callback should read data into a buffer,
set the
-.Li const void **buffer
+.RS
+const void **buffer
+.RE
argument to point to the available data, and
return a count of the number of bytes available.
The library will invoke the read callback again
@@ -353,10 +629,12 @@ of the data blocks returned.
On end-of-file, the read callback should
return zero.
On error, the read callback should invoke
-.Fn archive_set_error
+.nh
+\fBarchive_set_error\fP
+.hy
+();
to register an error code and message and
return -1.
-.Pp
The skip callback is invoked when the
library wants to ignore a block of data.
The return value is the number of bytes actually
@@ -365,41 +643,42 @@ If the callback cannot skip data, it should return
zero.
If the skip callback is not provided (the
function pointer is
-.Dv NULL ),
+.BR NULL ),
the library will invoke the read function
instead and simply discard the result.
A skip callback can provide significant
performance gains when reading uncompressed
archives from slow disk drives or other media
that can skip quickly.
-.Pp
The close callback is invoked by archive_close when
the archive processing is complete.
The callback should return
-.Cm ARCHIVE_OK
+\fBARCHIVE_OK\fP
on success.
On failure, the callback should invoke
-.Fn archive_set_error
+.nh
+\fBarchive_set_error\fP
+.hy
+();
to register an error code and message and
return
-.Cm ARCHIVE_FATAL.
-.Sh EXAMPLE
+\fBARCHIVE_FATAL.\fP
+.SH EXAMPLE
The following illustrates basic usage of the library.
In this example,
the callback functions are simply wrappers around the standard
-.Xr open 2 ,
-.Xr read 2 ,
+\fBopen\fP(2),
+\fBread\fP(2),
and
-.Xr close 2
+\fBclose\fP(2)
system calls.
-.Bd -literal -offset indent
+.RS
void
list_archive(const char *name)
{
struct mydata *mydata;
struct archive *a;
struct archive_entry *entry;
-
mydata = malloc(sizeof(struct mydata));
a = archive_read_new();
mydata->name = name;
@@ -413,112 +692,123 @@ list_archive(const char *name)
archive_read_finish(a);
free(mydata);
}
-
ssize_t
myread(struct archive *a, void *client_data, const void **buff)
{
struct mydata *mydata = client_data;
-
*buff = mydata->buff;
return (read(mydata->fd, mydata->buff, 10240));
}
-
int
myopen(struct archive *a, void *client_data)
{
struct mydata *mydata = client_data;
-
mydata->fd = open(mydata->name, O_RDONLY);
return (mydata->fd >= 0 ? ARCHIVE_OK : ARCHIVE_FATAL);
}
-
int
myclose(struct archive *a, void *client_data)
{
struct mydata *mydata = client_data;
-
if (mydata->fd > 0)
close(mydata->fd);
return (ARCHIVE_OK);
}
-.Ed
-.Sh RETURN VALUES
+.RE
+.SH RETURN VALUES
Most functions return zero on success, non-zero on error.
The possible return codes include:
-.Cm ARCHIVE_OK
+\fBARCHIVE_OK\fP
(the operation succeeded),
-.Cm ARCHIVE_WARN
+\fBARCHIVE_WARN\fP
(the operation succeeded but a non-critical error was encountered),
-.Cm ARCHIVE_EOF
+\fBARCHIVE_EOF\fP
(end-of-archive was encountered),
-.Cm ARCHIVE_RETRY
+\fBARCHIVE_RETRY\fP
(the operation failed but can be retried),
and
-.Cm ARCHIVE_FATAL
+\fBARCHIVE_FATAL\fP
(there was a fatal error; the archive should be closed immediately).
Detailed error codes and textual descriptions are available from the
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
and
-.Fn archive_error_string
+.nh
+\fBarchive_error_string\fP
+.hy
+();
functions.
-.Pp
-.Fn archive_read_new
+.nh
+\fBarchive_read_new\fP
+.hy
+();
returns a pointer to a freshly allocated
-.Tn struct archive
+Tn struct archive
object.
It returns
-.Dv NULL
+.BR NULL
on error.
-.Pp
-.Fn archive_read_data
+.nh
+\fBarchive_read_data\fP
+.hy
+();
returns a count of bytes actually read or zero at the end of the entry.
On error, a value of
-.Cm ARCHIVE_FATAL ,
-.Cm ARCHIVE_WARN ,
+\fBARCHIVE_FATAL\fP,
+\fBARCHIVE_WARN\fP,
or
-.Cm ARCHIVE_RETRY
+\fBARCHIVE_RETRY\fP
is returned and an error code and textual description can be retrieved from the
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
and
-.Fn archive_error_string
+.nh
+\fBarchive_error_string\fP
+.hy
+();
functions.
-.Pp
The library expects the client callbacks to behave similarly.
If there is an error, you can use
-.Fn archive_set_error
+.nh
+\fBarchive_set_error\fP
+.hy
+();
to set an appropriate error code and description,
then return one of the non-zero values above.
(Note that the value eventually returned to the client may
not be the same; many errors that are not critical at the level
of basic I/O can prevent the archive from being properly read,
thus most I/O errors eventually cause
-.Cm ARCHIVE_FATAL
+\fBARCHIVE_FATAL\fP
to be returned.)
-.\" .Sh ERRORS
-.Sh SEE ALSO
-.Xr tar 1 ,
-.Xr archive 3 ,
-.Xr archive_util 3 ,
-.Xr tar 5
-.Sh HISTORY
+.SH SEE ALSO
+\fBtar\fP(1),
+\fBarchive\fP(3),
+\fBarchive_util\fP(3),
+\fBtar\fP(5)
+.SH HISTORY
The
-.Nm libarchive
+\fBlibarchive\fP
library first appeared in
-.Fx 5.3 .
-.Sh AUTHORS
-.An -nosplit
+FreeBSD 5.3.
+.SH AUTHORS
+-nosplit
The
-.Nm libarchive
+\fBlibarchive\fP
library was written by
-.An Tim Kientzle Aq kientzle@acm.org .
-.Sh BUGS
+Tim Kientzle <kientzle@acm.org.>
+.SH BUGS
Many traditional archiver programs treat
empty files as valid empty archives.
For example, many implementations of
-.Xr tar 1
+\fBtar\fP(1)
allow you to append entries to an empty file.
Of course, it is impossible to determine the format of an empty file
by inspecting the contents, so this library treats empty files as
having a special
-.Dq empty
+``empty''
format.
diff --git a/archivers/libarchive/files/doc/man/archive_util.3 b/archivers/libarchive/files/doc/man/archive_util.3
index b8a030e4932..e41c59f56e8 100644
--- a/archivers/libarchive/files/doc/man/archive_util.3
+++ b/archivers/libarchive/files/doc/man/archive_util.3
@@ -1,146 +1,204 @@
-.\" Copyright (c) 2003-2007 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: src/lib/libarchive/archive_util.3,v 1.7 2007/05/29 01:00:19 kientzle Exp $
-.\"
-.Dd January 8, 2005
-.Dt archive_util 3
-.Os
-.Sh NAME
-.Nm archive_clear_error ,
-.Nm archive_compression ,
-.Nm archive_compression_name ,
-.Nm archive_copy_error ,
-.Nm archive_errno ,
-.Nm archive_error_string ,
-.Nm archive_format ,
-.Nm archive_format_name ,
-.Nm archive_set_error
-.Nd libarchive utility functions
-.Sh SYNOPSIS
-.In archive.h
-.Ft void
-.Fn archive_clear_error "struct archive *"
-.Ft int
-.Fn archive_compression "struct archive *"
-.Ft const char *
-.Fn archive_compression_name "struct archive *"
-.Ft void
-.Fn archive_copy_error "struct archive *" "struct archive *"
-.Ft int
-.Fn archive_errno "struct archive *"
-.Ft const char *
-.Fn archive_error_string "struct archive *"
-.Ft int
-.Fn archive_format "struct archive *"
-.Ft const char *
-.Fn archive_format_name "struct archive *"
-.Ft void
-.Fn archive_set_error "struct archive *" "int error_code" "const char *fmt" "..."
-.Sh DESCRIPTION
+.TH archive_util 3 "January 8, 2005" ""
+.SH NAME
+\fBarchive_clear_error\fP,
+\fBarchive_compression\fP,
+\fBarchive_compression_name\fP,
+\fBarchive_copy_error\fP,
+\fBarchive_errno\fP,
+\fBarchive_error_string\fP,
+\fBarchive_format\fP,
+\fBarchive_format_name\fP,
+\fBarchive_set_error\fP
+\- libarchive utility functions
+.SH SYNOPSIS
+\fB#include <archive.h>\fP
+.br
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_clear_error\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_compression\fP
+.hy
+("struct archive *");
+\fIconst char *\fP
+.RE
+.nh
+\fBarchive_compression_name\fP
+.hy
+("struct archive *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_copy_error\fP
+.hy
+("struct archive *" "struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_errno\fP
+.hy
+("struct archive *");
+\fIconst char *\fP
+.RE
+.nh
+\fBarchive_error_string\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_format\fP
+.hy
+("struct archive *");
+\fIconst char *\fP
+.RE
+.nh
+\fBarchive_format_name\fP
+.hy
+("struct archive *");
+\fIvoid\fP
+.RE
+.nh
+\fBarchive_set_error\fP
+.hy
+("struct archive *" "int error_code" "const char *fmt" "...");
+.SH DESCRIPTION
These functions provide access to various information about the
-.Tn struct archive
+Tn struct archive
object used in the
-.Xr libarchive 3
+\fBlibarchive\fP(3)
library.
-.Bl -tag -compact -width indent
-.It Fn archive_clear_error
+.TP
+.nh
+\fBarchive_clear_error\fP
+.hy
+();
Clears any error information left over from a previous call.
Not generally used in client code.
-.It Fn archive_compression
+.TP
+.nh
+\fBarchive_compression\fP
+.hy
+();
Returns a numeric code indicating the current compression.
This value is set by
-.Fn archive_read_open .
-.It Fn archive_compression_name
+.nh
+\fBarchive_read_open\fP
+.hy
+(.);
+.TP
+.nh
+\fBarchive_compression_name\fP
+.hy
+();
Returns a text description of the current compression suitable for display.
-.It Fn archive_copy_error
+.TP
+.nh
+\fBarchive_copy_error\fP
+.hy
+();
Copies error information from one archive to another.
-.It Fn archive_errno
+.TP
+.nh
+\fBarchive_errno\fP
+.hy
+();
Returns a numeric error code (see
-.Xr errno 2 )
+\fBerrno\fP(2))
indicating the reason for the most recent error return.
-.It Fn archive_error_string
+.TP
+.nh
+\fBarchive_error_string\fP
+.hy
+();
Returns a textual error message suitable for display.
The error message here is usually more specific than that
obtained from passing the result of
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
to
-.Xr strerror 3 .
-.It Fn archive_format
+\fBstrerror\fP(3).
+.TP
+.nh
+\fBarchive_format\fP
+.hy
+();
Returns a numeric code indicating the format of the current
archive entry.
This value is set by a successful call to
-.Fn archive_read_next_header .
+.nh
+\fBarchive_read_next_header\fP
+.hy
+(.);
Note that it is common for this value to change from
entry to entry.
For example, a tar archive might have several entries that
utilize GNU tar extensions and several entries that do not.
These entries will have different format codes.
-.It Fn archive_format_name
+.TP
+.nh
+\fBarchive_format_name\fP
+.hy
+();
A textual description of the format of the current entry.
-.It Fn archive_set_error
+.TP
+.nh
+\fBarchive_set_error\fP
+.hy
+();
Sets the numeric error code and error description that will be returned
by
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
and
-.Fn archive_error_string .
+.nh
+\fBarchive_error_string\fP
+.hy
+(.);
This function should be used within I/O callbacks to set system-specific
error codes and error descriptions.
This function accepts a printf-like format string and arguments.
However, you should be careful to use only the following printf
format specifiers:
-.Dq %c ,
-.Dq %d ,
-.Dq %jd ,
-.Dq %jo ,
-.Dq %ju ,
-.Dq %jx ,
-.Dq %ld ,
-.Dq %lo ,
-.Dq %lu ,
-.Dq %lx ,
-.Dq %o ,
-.Dq %u ,
-.Dq %s ,
-.Dq %x ,
-.Dq %% .
+``%c'',
+``%d'',
+``%jd'',
+``%jo'',
+``%ju'',
+``%jx'',
+``%ld'',
+``%lo'',
+``%lu'',
+``%lx'',
+``%o'',
+``%u'',
+``%s'',
+``%x'',
+``%%''.
Field-width specifiers and other printf features are
not uniformly supported and should not be used.
-.El
-.Sh SEE ALSO
-.Xr archive_read 3 ,
-.Xr archive_write 3 ,
-.Xr libarchive 3 ,
-.Xr printf 3
-.Sh HISTORY
+.SH SEE ALSO
+\fBarchive_read\fP(3),
+\fBarchive_write\fP(3),
+\fBlibarchive\fP(3),
+\fBprintf\fP(3)
+.SH HISTORY
The
-.Nm libarchive
+\fBlibarchive\fP
library first appeared in
-.Fx 5.3 .
-.Sh AUTHORS
-.An -nosplit
+FreeBSD 5.3.
+.SH AUTHORS
+-nosplit
The
-.Nm libarchive
+\fBlibarchive\fP
library was written by
-.An Tim Kientzle Aq kientzle@acm.org .
+Tim Kientzle <kientzle@acm.org.>
diff --git a/archivers/libarchive/files/doc/man/archive_write.3 b/archivers/libarchive/files/doc/man/archive_write.3
index c07b6b570ea..c4b93958177 100644
--- a/archivers/libarchive/files/doc/man/archive_write.3
+++ b/archivers/libarchive/files/doc/man/archive_write.3
@@ -1,123 +1,199 @@
-.\" Copyright (c) 2003-2007 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: src/lib/libarchive/archive_write.3,v 1.22 2007/05/29 01:00:19 kientzle Exp $
-.\"
-.Dd August 19, 2006
-.Dt archive_write 3
-.Os
-.Sh NAME
-.Nm archive_write_new ,
-.Nm archive_write_set_format_cpio ,
-.Nm archive_write_set_format_pax ,
-.Nm archive_write_set_format_pax_restricted ,
-.Nm archive_write_set_format_shar ,
-.Nm archive_write_set_format_shar_binary ,
-.Nm archive_write_set_format_ustar ,
-.Nm archive_write_get_bytes_per_block ,
-.Nm archive_write_set_bytes_per_block ,
-.Nm archive_write_set_bytes_in_last_block ,
-.Nm archive_write_set_compression_bzip2 ,
-.Nm archive_write_set_compression_gzip ,
-.Nm archive_write_set_compression_none ,
-.Nm archive_write_set_compression_program ,
-.Nm archive_write_open ,
-.Nm archive_write_open_fd ,
-.Nm archive_write_open_FILE ,
-.Nm archive_write_open_filename ,
-.Nm archive_write_open_memory ,
-.Nm archive_write_header ,
-.Nm archive_write_data ,
-.Nm archive_write_finish_entry ,
-.Nm archive_write_close ,
-.Nm archive_write_finish
-.Nd functions for creating archives
-.Sh SYNOPSIS
-.In archive.h
-.Ft struct archive *
-.Fn archive_write_new "void"
-.Ft int
-.Fn archive_write_get_bytes_per_block "struct archive *"
-.Ft int
-.Fn archive_write_set_bytes_per_block "struct archive *" "int bytes_per_block"
-.Ft int
-.Fn archive_write_set_bytes_in_last_block "struct archive *" "int"
-.Ft int
-.Fn archive_write_set_compression_bzip2 "struct archive *"
-.Ft int
-.Fn archive_write_set_compression_gzip "struct archive *"
-.Ft int
-.Fn archive_write_set_compression_none "struct archive *"
-.Ft int
-.Fn archive_write_set_compression_program "struct archive *" "const char * cmd"
-.Ft int
-.Fn archive_write_set_format_cpio "struct archive *"
-.Ft int
-.Fn archive_write_set_format_pax "struct archive *"
-.Ft int
-.Fn archive_write_set_format_pax_restricted "struct archive *"
-.Ft int
-.Fn archive_write_set_format_shar "struct archive *"
-.Ft int
-.Fn archive_write_set_format_shar_binary "struct archive *"
-.Ft int
-.Fn archive_write_set_format_ustar "struct archive *"
-.Ft int
-.Fn archive_write_open "struct archive *" "void *client_data" "archive_open_callback *" "archive_write_callback *" "archive_close_callback *"
-.Ft int
-.Fn archive_write_open_fd "struct archive *" "int fd"
-.Ft int
-.Fn archive_write_open_FILE "struct archive *" "FILE *file"
-.Ft int
-.Fn archive_write_open_filename "struct archive *" "const char *filename"
-.Ft int
-.Fn archive_write_open_memory "struct archive *" "void *buffer" "size_t bufferSize" "size_t *outUsed"
-.Ft int
-.Fn archive_write_header "struct archive *" "struct archive_entry *"
-.Ft ssize_t
-.Fn archive_write_data "struct archive *" "const void *" "size_t"
-.Ft int
-.Fn archive_write_finish_entry "struct archive *"
-.Ft int
-.Fn archive_write_close "struct archive *"
-.Ft int
-.Fn archive_write_finish "struct archive *"
-.Sh DESCRIPTION
+.TH archive_write 3 "August 19, 2006" ""
+.SH NAME
+\fBarchive_write_new\fP,
+\fBarchive_write_set_format_cpio\fP,
+\fBarchive_write_set_format_pax\fP,
+\fBarchive_write_set_format_pax_restricted\fP,
+\fBarchive_write_set_format_shar\fP,
+\fBarchive_write_set_format_shar_binary\fP,
+\fBarchive_write_set_format_ustar\fP,
+\fBarchive_write_get_bytes_per_block\fP,
+\fBarchive_write_set_bytes_per_block\fP,
+\fBarchive_write_set_bytes_in_last_block\fP,
+\fBarchive_write_set_compression_bzip2\fP,
+\fBarchive_write_set_compression_gzip\fP,
+\fBarchive_write_set_compression_none\fP,
+\fBarchive_write_set_compression_program\fP,
+\fBarchive_write_open\fP,
+\fBarchive_write_open_fd\fP,
+\fBarchive_write_open_FILE\fP,
+\fBarchive_write_open_filename\fP,
+\fBarchive_write_open_memory\fP,
+\fBarchive_write_header\fP,
+\fBarchive_write_data\fP,
+\fBarchive_write_finish_entry\fP,
+\fBarchive_write_close\fP,
+\fBarchive_write_finish\fP
+\- functions for creating archives
+.SH SYNOPSIS
+\fB#include <archive.h>\fP
+.br
+\fIstruct archive *\fP
+.RE
+.nh
+\fBarchive_write_new\fP
+.hy
+("void");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_get_bytes_per_block\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_bytes_per_block\fP
+.hy
+("struct archive *" "int bytes_per_block");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_bytes_in_last_block\fP
+.hy
+("struct archive *" "int");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_compression_bzip2\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_compression_gzip\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_compression_none\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_compression_program\fP
+.hy
+("struct archive *" "const char * cmd");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_format_cpio\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_format_pax\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_format_pax_restricted\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_format_shar\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_format_shar_binary\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_set_format_ustar\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_open\fP
+.hy
+("struct archive *" "void *client_data" "archive_open_callback *" "archive_write_callback *" "archive_close_callback *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_open_fd\fP
+.hy
+("struct archive *" "int fd");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_open_FILE\fP
+.hy
+("struct archive *" "FILE *file");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_open_filename\fP
+.hy
+("struct archive *" "const char *filename");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_open_memory\fP
+.hy
+("struct archive *" "void *buffer" "size_t bufferSize" "size_t *outUsed");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_header\fP
+.hy
+("struct archive *" "struct archive_entry *");
+\fIssize_t\fP
+.RE
+.nh
+\fBarchive_write_data\fP
+.hy
+("struct archive *" "const void *" "size_t");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_finish_entry\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_close\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_finish\fP
+.hy
+("struct archive *");
+.SH DESCRIPTION
These functions provide a complete API for creating streaming
archive files.
The general process is to first create the
-.Tn struct archive
+Tn struct archive
object, set any desired options, initialize the archive, append entries, then
close the archive and release all resources.
The following summary describes the functions in approximately
the order they are ordinarily used:
-.Bl -tag -width indent
-.It Fn archive_write_new
+.TP
+.nh
+\fBarchive_write_new\fP
+.hy
+();
Allocates and initializes a
-.Tn struct archive
+Tn struct archive
object suitable for writing a tar archive.
-.It Fn archive_write_set_bytes_per_block
+.TP
+.nh
+\fBarchive_write_set_bytes_per_block\fP
+.hy
+();
Sets the block size used for writing the archive data.
Every call to the write callback function, except possibly the last one, will
use this value for the length.
@@ -128,11 +204,19 @@ If it is non-zero, padding will be added both before and after compression.
The default is to use a block size of 10240 bytes and to pad the last block.
Note that a block size of zero will suppress internal blocking
and cause writes to be sent directly to the write callback as they occur.
-.It Fn archive_write_get_bytes_per_block
+.TP
+.nh
+\fBarchive_write_get_bytes_per_block\fP
+.hy
+();
Retrieve the block size to be used for writing.
A value of -1 here indicates that the library should use default values.
A value of zero indicates that internal blocking is suppressed.
-.It Fn archive_write_set_bytes_in_last_block
+.TP
+.nh
+\fBarchive_write_set_bytes_in_last_block\fP
+.hy
+();
Sets the block size used for writing the last block.
If this value is zero, the last block will be padded to the same size
as the other blocks.
@@ -142,257 +226,401 @@ For compressed output, any padding generated by this option
is applied only after the compression.
The uncompressed data is always unpadded.
The default is to pad the last block to the full block size (note that
-.Fn archive_write_open_filename
+.nh
+\fBarchive_write_open_filename\fP
+.hy
+();
will set this based on the file type).
Unlike the other
-.Dq set
+``set''
functions, this function can be called after the archive is opened.
-.It Fn archive_write_get_bytes_in_last_block
+.TP
+.nh
+\fBarchive_write_get_bytes_in_last_block\fP
+.hy
+();
Retrieve the currently-set value for last block size.
A value of -1 here indicates that the library should use default values.
-.It Fn archive_write_set_format_cpio , Fn archive_write_set_format_pax , Fn archive_write_set_format_pax_restricted , Fn archive_write_set_format_shar , Fn archive_write_set_format_shar_binary , Fn archive_write_set_format_ustar
+.TP
+.nh
+\fBarchive_write_set_format_cpio\fP
+.hy
+(, .nh);
+\fBarchive_write_set_format_pax\fP
+.hy
+(, .nh);
+\fBarchive_write_set_format_pax_restricted\fP
+.hy
+(, .nh);
+\fBarchive_write_set_format_shar\fP
+.hy
+(, .nh);
+\fBarchive_write_set_format_shar_binary\fP
+.hy
+(, .nh);
+\fBarchive_write_set_format_ustar\fP
+.hy
+();
Sets the format that will be used for the archive.
The library can write
POSIX octet-oriented cpio format archives,
POSIX-standard
-.Dq pax interchange
+``pax interchange''
format archives,
traditional
-.Dq shar
+``shar''
archives,
enhanced
-.Dq binary
+``binary''
shar archives that store a variety of file attributes and handle binary files,
and
POSIX-standard
-.Dq ustar
+``ustar''
archives.
The pax interchange format is a backwards-compatible tar format that
adds key/value attributes to each entry and supports arbitrary
filenames, linknames, uids, sizes, etc.
-.Dq Restricted pax interchange format
+``Restricted pax interchange format''
is the library default; this is the same as pax format, but suppresses
the pax extended header for most normal files.
In most cases, this will result in ordinary ustar archives.
-.It Fn archive_write_set_compression_bzip2 , Fn archive_write_set_compression_gzip , Fn archive_write_set_compression_none
+.TP
+.nh
+\fBarchive_write_set_compression_bzip2\fP
+.hy
+(, .nh);
+\fBarchive_write_set_compression_gzip\fP
+.hy
+(, .nh);
+\fBarchive_write_set_compression_none\fP
+.hy
+();
The resulting archive will be compressed as specified.
Note that the compressed output is always properly blocked.
-.It Fn archive_write_set_compression_program
+.TP
+.nh
+\fBarchive_write_set_compression_program\fP
+.hy
+();
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 Fn archive_write_open
+.TP
+.nh
+\fBarchive_write_open\fP
+.hy
+();
Freeze the settings, open the archive, and prepare for writing entries.
This is the most generic form of this function, which accepts
pointers to three callback functions which will be invoked by
the compression layer to write the constructed archive.
-.It Fn archive_write_open_fd
+.TP
+.nh
+\fBarchive_write_open_fd\fP
+.hy
+();
A convenience form of
-.Fn archive_write_open
+.nh
+\fBarchive_write_open\fP
+.hy
+();
that accepts a file descriptor.
The
-.Fn archive_write_open_fd
+.nh
+\fBarchive_write_open_fd\fP
+.hy
+();
function is safe for use with tape drives or other
block-oriented devices.
-.It Fn archive_write_open_FILE
+.TP
+.nh
+\fBarchive_write_open_FILE\fP
+.hy
+();
A convenience form of
-.Fn archive_write_open
+.nh
+\fBarchive_write_open\fP
+.hy
+();
that accepts a
-.Ft "FILE *"
+\fI"FILE *"\fP
+.RE
pointer.
Note that
-.Fn archive_write_open_FILE
+.nh
+\fBarchive_write_open_FILE\fP
+.hy
+();
is not safe for writing to tape drives or other devices
that require correct blocking.
-.It Fn archive_write_open_file
+.TP
+.nh
+\fBarchive_write_open_file\fP
+.hy
+();
A deprecated synonym for
-.Fn archive_write_open_filename .
-.It Fn archive_write_open_filename
+.nh
+\fBarchive_write_open_filename\fP
+.hy
+(.);
+.TP
+.nh
+\fBarchive_write_open_filename\fP
+.hy
+();
A convenience form of
-.Fn archive_write_open
+.nh
+\fBarchive_write_open\fP
+.hy
+();
that accepts a filename.
A NULL argument indicates that the output should be written to standard output;
an argument of
-.Dq -
+``-''
will open a file with that name.
If you have not invoked
-.Fn archive_write_set_bytes_in_last_block ,
+.nh
+\fBarchive_write_set_bytes_in_last_block\fP
+.hy
+(,);
then
-.Fn archive_write_open_filename
+.nh
+\fBarchive_write_open_filename\fP
+.hy
+();
will adjust the last-block padding depending on the file:
it will enable padding when writing to standard output or
to a character or block device node, it will disable padding otherwise.
You can override this by manually invoking
-.Fn archive_write_set_bytes_in_last_block
+.nh
+\fBarchive_write_set_bytes_in_last_block\fP
+.hy
+();
before calling
-.Fn archive_write_open .
+.nh
+\fBarchive_write_open\fP
+.hy
+(.);
The
-.Fn archive_write_open_filename
+.nh
+\fBarchive_write_open_filename\fP
+.hy
+();
function is safe for use with tape drives or other
block-oriented devices.
-.It Fn archive_write_open_memory
+.TP
+.nh
+\fBarchive_write_open_memory\fP
+.hy
+();
A convenience form of
-.Fn archive_write_open
+.nh
+\fBarchive_write_open\fP
+.hy
+();
that accepts a pointer to a block of memory that will receive
the archive.
The final
-.Ft "size_t *"
+\fI"size_t *"\fP
+.RE
argument points to a variable that will be updated
after each write to reflect how much of the buffer
is currently in use.
You should be careful to ensure that this variable
remains allocated until after the archive is
closed.
-.It Fn archive_write_header
+.TP
+.nh
+\fBarchive_write_header\fP
+.hy
+();
Build and write a header using the data in the provided
-.Tn struct archive_entry
+Tn struct archive_entry
structure.
See
-.Xr archive_entry 3
+\fBarchive_entry\fP(3)
for information on creating and populating
-.Tn struct archive_entry
+Tn struct archive_entry
objects.
-.It Fn archive_write_data
+.TP
+.nh
+\fBarchive_write_data\fP
+.hy
+();
Write data corresponding to the header just written.
Returns number of bytes written or -1 on error.
-.It Fn archive_write_finish_entry
+.TP
+.nh
+\fBarchive_write_finish_entry\fP
+.hy
+();
Close out the entry just written.
In particular, this writes out the final padding required by some formats.
Ordinarily, clients never need to call this, as it
is called automatically by
-.Fn archive_write_next_header
+.nh
+\fBarchive_write_next_header\fP
+.hy
+();
and
-.Fn archive_write_close
+.nh
+\fBarchive_write_close\fP
+.hy
+();
as needed.
-.It Fn archive_write_close
+.TP
+.nh
+\fBarchive_write_close\fP
+.hy
+();
Complete the archive and invoke the close callback.
-.It Fn archive_write_finish
+.TP
+.nh
+\fBarchive_write_finish\fP
+.hy
+();
Invokes
-.Fn archive_write_close
+.nh
+\fBarchive_write_close\fP
+.hy
+();
if it was not invoked manually, then releases all resources.
Note that this function was declared to return
-.Ft void
+\fIvoid\fP
+.RE
in libarchive 1.x, which made it impossible to detect errors when
-.Fn archive_write_close
+.nh
+\fBarchive_write_close\fP
+.hy
+();
was invoked implicitly from this function.
This is corrected beginning with libarchive 2.0.
-.El
More information about the
-.Va struct archive
+\fIstruct\fP archive
object and the overall design of the library can be found in the
-.Xr libarchive 3
+\fBlibarchive\fP(3)
overview.
-.Sh IMPLEMENTATION
+.SH IMPLEMENTATION
Compression support is built-in to libarchive, which uses zlib and bzlib
to handle gzip and bzip2 compression, respectively.
-.Sh CLIENT CALLBACKS
+.SH CLIENT CALLBACKS
To use this library, you will need to define and register
callback functions that will be invoked to write data to the
resulting archive.
These functions are registered by calling
-.Fn archive_write_open :
-.Bl -item -offset indent
-.It
-.Ft typedef int
-.Fn archive_open_callback "struct archive *" "void *client_data"
-.El
-.Pp
+.nh
+\fBarchive_write_open\fP
+.hy
+(:);
+.IP
+\fItypedef int\fP
+.RE
+.nh
+\fBarchive_open_callback\fP
+.hy
+("struct archive *" "void *client_data");
The open callback is invoked by
-.Fn archive_write_open .
+.nh
+\fBarchive_write_open\fP
+.hy
+(.);
It should return
-.Cm ARCHIVE_OK
+\fBARCHIVE_OK\fP
if the underlying file or data source is successfully
opened.
If the open fails, it should call
-.Fn archive_set_error
+.nh
+\fBarchive_set_error\fP
+.hy
+();
to register an error code and message and return
-.Cm ARCHIVE_FATAL .
-.Bl -item -offset indent
-.It
-.Ft typedef ssize_t
-.Fn archive_write_callback "struct archive *" "void *client_data" "void *buffer" "size_t length"
-.El
-.Pp
+\fBARCHIVE_FATAL\fP.
+.IP
+\fItypedef ssize_t\fP
+.RE
+.nh
+\fBarchive_write_callback\fP
+.hy
+("struct archive *" "void *client_data" "void *buffer" "size_t length");
The write callback is invoked whenever the library
needs to write raw bytes to the archive.
For correct blocking, each call to the write callback function
should translate into a single
-.Xr write 2
+\fBwrite\fP(2)
system call.
This is especially critical when writing archives to tape drives.
On success, the write callback should return the
number of bytes actually written.
On error, the callback should invoke
-.Fn archive_set_error
+.nh
+\fBarchive_set_error\fP
+.hy
+();
to register an error code and message and return -1.
-.Bl -item -offset indent
-.It
-.Ft typedef int
-.Fn archive_close_callback "struct archive *" "void *client_data"
-.El
-.Pp
+.IP
+\fItypedef int\fP
+.RE
+.nh
+\fBarchive_close_callback\fP
+.hy
+("struct archive *" "void *client_data");
The close callback is invoked by archive_close when
the archive processing is complete.
The callback should return
-.Cm ARCHIVE_OK
+\fBARCHIVE_OK\fP
on success.
On failure, the callback should invoke
-.Fn archive_set_error
+.nh
+\fBarchive_set_error\fP
+.hy
+();
to register an error code and message and
return
-.Cm ARCHIVE_FATAL.
-.Sh EXAMPLE
+\fBARCHIVE_FATAL.\fP
+.SH EXAMPLE
The following sketch illustrates basic usage of the library.
In this example,
the callback functions are simply wrappers around the standard
-.Xr open 2 ,
-.Xr write 2 ,
+\fBopen\fP(2),
+\fBwrite\fP(2),
and
-.Xr close 2
+\fBclose\fP(2)
system calls.
-.Bd -literal -offset indent
+.RS
#include <sys/stat.h>
#include <archive.h>
#include <archive_entry.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
-
struct mydata {
const char *name;
int fd;
};
-
int
myopen(struct archive *a, void *client_data)
{
struct mydata *mydata = client_data;
-
mydata->fd = open(mydata->name, O_WRONLY | O_CREAT, 0644);
if (mydata->fd >= 0)
return (ARCHIVE_OK);
else
return (ARCHIVE_FATAL);
}
-
ssize_t
mywrite(struct archive *a, void *client_data, void *buff, size_t n)
{
struct mydata *mydata = client_data;
-
return (write(mydata->fd, buff, n));
}
-
int
myclose(struct archive *a, void *client_data)
{
struct mydata *mydata = client_data;
-
if (mydata->fd > 0)
close(mydata->fd);
return (0);
}
-
void
write_archive(const char *outname, const char **filename)
{
@@ -403,7 +631,6 @@ write_archive(const char *outname, const char **filename)
char buff[8192];
int len;
int fd;
-
a = archive_write_new();
mydata->name = outname;
archive_write_set_compression_gzip(a);
@@ -426,7 +653,6 @@ write_archive(const char *outname, const char **filename)
}
archive_write_finish(a);
}
-
int main(int argc, const char **argv)
{
const char *outname;
@@ -435,89 +661,125 @@ int main(int argc, const char **argv)
write_archive(outname, argv);
return 0;
}
-.Ed
-.Sh RETURN VALUES
+.RE
+.SH RETURN VALUES
Most functions return
-.Cm ARCHIVE_OK
+\fBARCHIVE_OK\fP
(zero) on success, or one of several non-zero
error codes for errors.
Specific error codes include:
-.Cm ARCHIVE_RETRY
+\fBARCHIVE_RETRY\fP
for operations that might succeed if retried,
-.Cm ARCHIVE_WARN
+\fBARCHIVE_WARN\fP
for unusual conditions that do not prevent further operations, and
-.Cm ARCHIVE_FATAL
+\fBARCHIVE_FATAL\fP
for serious errors that make remaining operations impossible.
The
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
and
-.Fn archive_error_string
+.nh
+\fBarchive_error_string\fP
+.hy
+();
functions can be used to retrieve an appropriate error code and a
textual error message.
-.Pp
-.Fn archive_write_new
+.nh
+\fBarchive_write_new\fP
+.hy
+();
returns a pointer to a newly-allocated
-.Tn struct archive
+Tn struct archive
object.
-.Pp
-.Fn archive_write_data
+.nh
+\fBarchive_write_data\fP
+.hy
+();
returns a count of the number of bytes actually written.
On error, -1 is returned and the
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
and
-.Fn archive_error_string
+.nh
+\fBarchive_error_string\fP
+.hy
+();
functions will return appropriate values.
Note that if the client-provided write callback function
returns a non-zero value, that error will be propagated back to the caller
through whatever API function resulted in that call, which
may include
-.Fn archive_write_header ,
-.Fn archive_write_data ,
-.Fn archive_write_close ,
+.nh
+\fBarchive_write_header\fP
+.hy
+(,);
+.nh
+\fBarchive_write_data\fP
+.hy
+(,);
+.nh
+\fBarchive_write_close\fP
+.hy
+(,);
or
-.Fn archive_write_finish .
+.nh
+\fBarchive_write_finish\fP
+.hy
+(.);
The client callback can call
-.Fn archive_set_error
+.nh
+\fBarchive_set_error\fP
+.hy
+();
to provide values that can then be retrieved by
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
and
-.Fn archive_error_string .
-.Sh SEE ALSO
-.Xr tar 1 ,
-.Xr libarchive 3 ,
-.Xr tar 5
-.Sh HISTORY
+.nh
+\fBarchive_error_string\fP
+.hy
+(.);
+.SH SEE ALSO
+\fBtar\fP(1),
+\fBlibarchive\fP(3),
+\fBtar\fP(5)
+.SH HISTORY
The
-.Nm libarchive
+\fBlibarchive\fP
library first appeared in
-.Fx 5.3 .
-.Sh AUTHORS
-.An -nosplit
+FreeBSD 5.3.
+.SH AUTHORS
+-nosplit
The
-.Nm libarchive
+\fBlibarchive\fP
library was written by
-.An Tim Kientzle Aq kientzle@acm.org .
-.Sh BUGS
+Tim Kientzle <kientzle@acm.org.>
+.SH BUGS
There are many peculiar bugs in historic tar implementations that may cause
certain programs to reject archives written by this library.
For example, several historic implementations calculated header checksums
incorrectly and will thus reject valid archives; GNU tar does not fully support
pax interchange format; some old tar implementations required specific
field terminations.
-.Pp
The default pax interchange format eliminates most of the historic
tar limitations and provides a generic key/value attribute facility
for vendor-defined extensions.
One oversight in POSIX is the failure to provide a standard attribute
for large device numbers.
This library uses
-.Dq SCHILY.devminor
+``SCHILY.devminor''
and
-.Dq SCHILY.devmajor
+``SCHILY.devmajor''
for device numbers that exceed the range supported by the backwards-compatible
ustar header.
These keys are compatible with Joerg Schilling's
-.Nm star
+\fBstar\fP
archiver.
Other implementations may not recognize these keys and will thus be unable
to correctly restore device nodes with large device numbers from archives
diff --git a/archivers/libarchive/files/doc/man/archive_write_disk.3 b/archivers/libarchive/files/doc/man/archive_write_disk.3
index 880a399b949..4e81e1caec8 100644
--- a/archivers/libarchive/files/doc/man/archive_write_disk.3
+++ b/archivers/libarchive/files/doc/man/archive_write_disk.3
@@ -1,145 +1,190 @@
-.\" Copyright (c) 2003-2007 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: src/lib/libarchive/archive_write_disk.3,v 1.1 2007/03/03 07:37:36 kientzle Exp $
-.\"
-.Dd March 2, 2007
-.Dt archive_write_disk 3
-.Os
-.Sh NAME
-.Nm archive_write_disk_new ,
-.Nm archive_write_disk_set_options ,
-.Nm archive_write_disk_set_skip_file ,
-.Nm archive_write_disk_set_group_lookup ,
-.Nm archive_write_disk_set_standard_lookup ,
-.Nm archive_write_disk_set_user_lookup ,
-.Nm archive_write_header ,
-.Nm archive_write_data ,
-.Nm archive_write_finish_entry ,
-.Nm archive_write_close ,
-.Nm archive_write_finish
-.Nd functions for creating objects on disk
-.Sh SYNOPSIS
-.In archive.h
-.Ft struct archive *
-.Fn archive_write_disk_new "void"
-.Ft int
-.Fn archive_write_disk_set_options "struct archive *" "int flags"
-.Ft int
-.Fn archive_write_disk_set_skip_file "struct archive *" "dev_t" "ino_t"
-.Ft int
-.Fn archive_write_disk_set_group_lookup "struct archive *" "void *" "gid_t (*)(void *, const char *gname, gid_t gid)" "void (*cleanup)(void *)"
-.Ft int
-.Fn archive_write_disk_set_standard_lookup "struct archive *"
-.Ft int
-.Fn archive_write_disk_set_user_lookup "struct archive *" "void *" "uid_t (*)(void *, const char *uname, uid_t uid)" "void (*cleanup)(void *)"
-.Ft int
-.Fn archive_write_header "struct archive *" "struct archive_entry *"
-.Ft ssize_t
-.Fn archive_write_data "struct archive *" "const void *" "size_t"
-.Ft int
-.Fn archive_write_finish_entry "struct archive *"
-.Ft int
-.Fn archive_write_close "struct archive *"
-.Ft int
-.Fn archive_write_finish "struct archive *"
-.Sh DESCRIPTION
+.TH archive_write_disk 3 "March 2, 2007" ""
+.SH NAME
+\fBarchive_write_disk_new\fP,
+\fBarchive_write_disk_set_options\fP,
+\fBarchive_write_disk_set_skip_file\fP,
+\fBarchive_write_disk_set_group_lookup\fP,
+\fBarchive_write_disk_set_standard_lookup\fP,
+\fBarchive_write_disk_set_user_lookup\fP,
+\fBarchive_write_header\fP,
+\fBarchive_write_data\fP,
+\fBarchive_write_finish_entry\fP,
+\fBarchive_write_close\fP,
+\fBarchive_write_finish\fP
+\- functions for creating objects on disk
+.SH SYNOPSIS
+\fB#include <archive.h>\fP
+.br
+\fIstruct archive *\fP
+.RE
+.nh
+\fBarchive_write_disk_new\fP
+.hy
+("void");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_disk_set_options\fP
+.hy
+("struct archive *" "int flags");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_disk_set_skip_file\fP
+.hy
+("struct archive *" "dev_t" "ino_t");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_disk_set_group_lookup\fP
+.hy
+("struct archive *" "void *" "gid_t (*)(void *, const char *gname, gid_t gid)" "void (*cleanup)(void *)");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_disk_set_standard_lookup\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_disk_set_user_lookup\fP
+.hy
+("struct archive *" "void *" "uid_t (*)(void *, const char *uname, uid_t uid)" "void (*cleanup)(void *)");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_header\fP
+.hy
+("struct archive *" "struct archive_entry *");
+\fIssize_t\fP
+.RE
+.nh
+\fBarchive_write_data\fP
+.hy
+("struct archive *" "const void *" "size_t");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_finish_entry\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_close\fP
+.hy
+("struct archive *");
+\fIint\fP
+.RE
+.nh
+\fBarchive_write_finish\fP
+.hy
+("struct archive *");
+.SH DESCRIPTION
These functions provide a complete API for creating objects on
disk from
-.Tn struct archive_entry
+Tn struct archive_entry
descriptions.
They are most naturally used when extracting objects from an archive
using the
-.Fn archive_read
+.nh
+\fBarchive_read\fP
+.hy
+();
interface.
The general process is to read
-.Tn struct archive_entry
+Tn struct archive_entry
objects from an archive, then write those objects to a
-.Tn struct archive
+Tn struct archive
object created using the
-.Fn archive_write_disk
+.nh
+\fBarchive_write_disk\fP
+.hy
+();
family functions.
This interface is deliberately very similar to the
-.Fn archive_write
+.nh
+\fBarchive_write\fP
+.hy
+();
interface used to write objects to a streaming archive.
-.Bl -tag -width indent
-.It Fn archive_write_disk_new
+.TP
+.nh
+\fBarchive_write_disk_new\fP
+.hy
+();
Allocates and initializes a
-.Tn struct archive
+Tn struct archive
object suitable for writing objects to disk.
-.It Fn archive_write_disk_set_skip_file
+.TP
+.nh
+\fBarchive_write_disk_set_skip_file\fP
+.hy
+();
Records the device and inode numbers of a file that should not be
overwritten.
This is typically used to ensure that an extraction process does not
overwrite the archive from which objects are being read.
This capability is technically unnecessary but can be a significant
performance optimization in practice.
-.It Fn archive_write_disk_set_options
+.TP
+.nh
+\fBarchive_write_disk_set_options\fP
+.hy
+();
The options field consists of a bitwise OR of one or more of the
following values:
-.Bl -tag -compact -width "indent"
-.It Cm ARCHIVE_EXTRACT_OWNER
+.TP
+\fBARCHIVE_EXTRACT_OWNER\fP
The user and group IDs should be set on the restored file.
By default, the user and group IDs are not restored.
-.It Cm ARCHIVE_EXTRACT_PERM
+.TP
+\fBARCHIVE_EXTRACT_PERM\fP
Full permissions (including SGID, SUID, and sticky bits) should
be restored exactly as specified, without obeying the
current umask.
Note that SUID and SGID bits can only be restored if the
user and group ID of the object on disk are correct.
If
-.Cm ARCHIVE_EXTRACT_OWNER
+\fBARCHIVE_EXTRACT_OWNER\fP
is not specified, then SUID and SGID bits will only be restored
if the default user and group IDs of newly-created objects on disk
happen to match those specified in the archive entry.
By default, only basic permissions are restored, and umask is obeyed.
-.It Cm ARCHIVE_EXTRACT_TIME
+.TP
+\fBARCHIVE_EXTRACT_TIME\fP
The timestamps (mtime, ctime, and atime) should be restored.
By default, they are ignored.
Note that restoring of atime is not currently supported.
-.It Cm ARCHIVE_EXTRACT_NO_OVERWRITE
+.TP
+\fBARCHIVE_EXTRACT_NO_OVERWRITE\fP
Existing files on disk will not be overwritten.
By default, existing regular files are truncated and overwritten;
existing directories will have their permissions updated;
other pre-existing objects are unlinked and recreated from scratch.
-.It Cm ARCHIVE_EXTRACT_UNLINK
+.TP
+\fBARCHIVE_EXTRACT_UNLINK\fP
Existing files on disk will be unlinked before any attempt to
create them.
In some cases, this can prove to be a significant performance improvement.
By default, existing files are truncated and rewritten, but
the file is not recreated.
In particular, the default behavior does not break existing hard links.
-.It Cm ARCHIVE_EXTRACT_ACL
+.TP
+\fBARCHIVE_EXTRACT_ACL\fP
Attempt to restore ACLs.
By default, extended ACLs are ignored.
-.It Cm ARCHIVE_EXTRACT_FFLAGS
+.TP
+\fBARCHIVE_EXTRACT_FFLAGS\fP
Attempt to restore extended file flags.
By default, file flags are ignored.
-.It Cm ARCHIVE_EXTRACT_XATTR
+.TP
+\fBARCHIVE_EXTRACT_XATTR\fP
Attempt to restore POSIX.1e extended attributes.
By default, they are ignored.
-.It Cm ARCHIVE_EXTRACT_SECURE_SYMLINKS
+.TP
+\fBARCHIVE_EXTRACT_SECURE_SYMLINKS\fP
Refuse to extract any object whose final location would be altered
by a symlink on disk.
This is intended to help guard against a variety of mischief
@@ -147,22 +192,29 @@ caused by archives that (deliberately or otherwise) extract
files outside of the current directory.
The default is not to perform this check.
If
-.Cm ARCHIVE_EXTRACT_UNLINK
+\fBARCHIVE_EXTRACT_UNLINK\fP
is specified together with this option, the library will
remove any intermediate symlinks it finds and return an
error only if such symlink could not be removed.
-.It Cm ARCHIVE_EXTRACT_SECURE_NODOTDOT
+.TP
+\fBARCHIVE_EXTRACT_SECURE_NODOTDOT\fP
Refuse to extract a path that contains a
-.Pa ..
+\fI\& ..\fP
element anywhere within it.
The default is to not refuse such paths.
Note that paths ending in
-.Pa ..
+\fI\& ..\fP
always cause an error, regardless of this flag.
-.El
-.It Fn archive_write_disk_set_group_lookup , Fn archive_write_disk_set_user_lookup
+.TP
+.nh
+\fBarchive_write_disk_set_group_lookup\fP
+.hy
+(, .nh);
+\fBarchive_write_disk_set_user_lookup\fP
+.hy
+();
The
-.Tn struct archive_entry
+Tn struct archive_entry
objects contain both names and ids that can be used to identify users
and groups.
These names and ids describe the ownership of the file itself and
@@ -172,187 +224,241 @@ this can be overridden by registering user and group lookup functions.
To register, you must provide a lookup function which
accepts both a name and id and returns a suitable id.
You may also provide a
-.Tn void *
+Tn void *
pointer to a private data structure and a cleanup function for
that data.
The cleanup function will be invoked when the
-.Tn struct archive
+Tn struct archive
object is destroyed.
-.It Fn archive_write_disk_set_standard_lookup
+.TP
+.nh
+\fBarchive_write_disk_set_standard_lookup\fP
+.hy
+();
This convenience function installs a standard set of user
and group lookup functions.
These functions use
-.Xr getpwnam 3
+\fBgetpwnam\fP(3)
and
-.Xr getgrnam 3
+\fBgetgrnam\fP(3)
to convert names to ids, defaulting to the ids if the names cannot
be looked up.
These functions also implement a simple memory cache to reduce
the number of calls to
-.Xr getpwnam 3
+\fBgetpwnam\fP(3)
and
-.Xr getgrnam 3 .
-.It Fn archive_write_header
+\fBgetgrnam\fP(3).
+.TP
+.nh
+\fBarchive_write_header\fP
+.hy
+();
Build and write a header using the data in the provided
-.Tn struct archive_entry
+Tn struct archive_entry
structure.
See
-.Xr archive_entry 3
+\fBarchive_entry\fP(3)
for information on creating and populating
-.Tn struct archive_entry
+Tn struct archive_entry
objects.
-.It Fn archive_write_data
+.TP
+.nh
+\fBarchive_write_data\fP
+.hy
+();
Write data corresponding to the header just written.
Returns number of bytes written or -1 on error.
-.It Fn archive_write_finish_entry
+.TP
+.nh
+\fBarchive_write_finish_entry\fP
+.hy
+();
Close out the entry just written.
Ordinarily, clients never need to call this, as it
is called automatically by
-.Fn archive_write_next_header
+.nh
+\fBarchive_write_next_header\fP
+.hy
+();
and
-.Fn archive_write_close
+.nh
+\fBarchive_write_close\fP
+.hy
+();
as needed.
-.It Fn archive_write_close
+.TP
+.nh
+\fBarchive_write_close\fP
+.hy
+();
Set any attributes that could not be set during the initial restore.
For example, directory timestamps are not restored initially because
restoring a subsequent file would alter that timestamp.
Similarly, non-writable directories are initially created with
write permissions (so that their contents can be restored).
The
-.Nm
+\fBarchive_write_disk_new\fP
library maintains a list of all such deferred attributes and
sets them when this function is invoked.
-.It Fn archive_write_finish
+.TP
+.nh
+\fBarchive_write_finish\fP
+.hy
+();
Invokes
-.Fn archive_write_close
+.nh
+\fBarchive_write_close\fP
+.hy
+();
if it was not invoked manually, then releases all resources.
-.El
More information about the
-.Va struct archive
+\fIstruct\fP archive
object and the overall design of the library can be found in the
-.Xr libarchive 3
+\fBlibarchive\fP(3)
overview.
Many of these functions are also documented under
-.Xr archive_write 3 .
-.Sh RETURN VALUES
+\fBarchive_write\fP(3).
+.SH RETURN VALUES
Most functions return
-.Cm ARCHIVE_OK
+\fBARCHIVE_OK\fP
(zero) on success, or one of several non-zero
error codes for errors.
Specific error codes include:
-.Cm ARCHIVE_RETRY
+\fBARCHIVE_RETRY\fP
for operations that might succeed if retried,
-.Cm ARCHIVE_WARN
+\fBARCHIVE_WARN\fP
for unusual conditions that do not prevent further operations, and
-.Cm ARCHIVE_FATAL
+\fBARCHIVE_FATAL\fP
for serious errors that make remaining operations impossible.
The
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
and
-.Fn archive_error_string
+.nh
+\fBarchive_error_string\fP
+.hy
+();
functions can be used to retrieve an appropriate error code and a
textual error message.
-.Pp
-.Fn archive_write_disk_new
+.nh
+\fBarchive_write_disk_new\fP
+.hy
+();
returns a pointer to a newly-allocated
-.Tn struct archive
+Tn struct archive
object.
-.Pp
-.Fn archive_write_data
+.nh
+\fBarchive_write_data\fP
+.hy
+();
returns a count of the number of bytes actually written.
On error, -1 is returned and the
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
and
-.Fn archive_error_string
+.nh
+\fBarchive_error_string\fP
+.hy
+();
functions will return appropriate values.
-.Sh SEE ALSO
-.Xr archive_read 3 ,
-.Xr archive_write 3 ,
-.Xr tar 1 ,
-.Xr libarchive 3
-.Sh HISTORY
+.SH SEE ALSO
+\fBarchive_read\fP(3),
+\fBarchive_write\fP(3),
+\fBtar\fP(1),
+\fBlibarchive\fP(3)
+.SH HISTORY
The
-.Nm libarchive
+\fBlibarchive\fP
library first appeared in
-.Fx 5.3 .
+FreeBSD 5.3.
The
-.Nm archive_write_disk
+\fBarchive_write_disk\fP
interface was added to
-.Nm libarchive 2.0
+\fBlibarchive\fP 2.0
and first appeared in
-.Fx 6.3 .
-.Sh AUTHORS
-.An -nosplit
+FreeBSD 6.3.
+.SH AUTHORS
+-nosplit
The
-.Nm libarchive
+\fBlibarchive\fP
library was written by
-.An Tim Kientzle Aq kientzle@acm.org .
-.Sh BUGS
+Tim Kientzle <kientzle@acm.org.>
+.SH BUGS
Directories are actually extracted in two distinct phases.
Directories are created during
-.Fn archive_write_header ,
+.nh
+\fBarchive_write_header\fP
+.hy
+(,);
but final permissions are not set until
-.Fn archive_write_close .
+.nh
+\fBarchive_write_close\fP
+.hy
+(.);
This separation is necessary to correctly handle borderline
cases such as a non-writable directory containing
files, but can cause unexpected results.
In particular, directory permissions are not fully
restored until the archive is closed.
If you use
-.Xr chdir 2
+\fBchdir\fP(2)
to change the current directory between calls to
-.Fn archive_read_extract
+.nh
+\fBarchive_read_extract\fP
+.hy
+();
or before calling
-.Fn archive_read_close ,
+.nh
+\fBarchive_read_close\fP
+.hy
+(,);
you may confuse the permission-setting logic with
the result that directory permissions are restored
incorrectly.
-.Pp
The library attempts to create objects with filenames longer than
-.Cm PATH_MAX
+\fBPATH_MAX\fP
by creating prefixes of the full path and changing the current directory.
Currently, this logic is limited in scope; the fixup pass does
not work correctly for such objects and the symlink security check
option disables the support for very long pathnames.
-.Pp
Restoring the path
-.Pa aa/../bb
+\fIaa/../bb\fP
does create each intermediate directory.
In particular, the directory
-.Pa aa
+\fIaa\fP
is created as well as the final object
-.Pa bb .
+\fIbb\fP.
In theory, this can be exploited to create an entire directory heirarchy
with a single request.
Of course, this does not work if the
-.Cm ARCHIVE_EXTRACT_NODOTDOT
+\fBARCHIVE_EXTRACT_NODOTDOT\fP
option is specified.
-.Pp
Implicit directories are always created obeying the current umask.
Explicit objects are created obeying the current umask unless
-.Cm ARCHIVE_EXTRACT_PERM
+\fBARCHIVE_EXTRACT_PERM\fP
is specified, in which case they current umask is ignored.
-.Pp
SGID and SUID bits are restored only if the correct user and
group could be set.
If
-.Cm ARCHIVE_EXTRACT_OWNER
+\fBARCHIVE_EXTRACT_OWNER\fP
is not specified, then no attempt is made to set the ownership.
In this case, SGID and SUID bits are restored only if the
user and group of the final object happen to match those specified
in the entry.
-.Pp
The
-.Dq standard
+``standard''
user-id and group-id lookup functions are not the defaults because
-.Xr getgrnam 3
+\fBgetgrnam\fP(3)
and
-.Xr getpwnam 3
+\fBgetpwnam\fP(3)
are sometimes too large for particular applications.
The current design allows the application author to use a more
compact implementation when appropriate.
-.Pp
There should be a corresponding
-.Nm archive_read_disk
+\fBarchive_read_disk\fP
interface that walks a directory heirarchy and returns archive
-entry objects. \ No newline at end of file
+entry objects.
diff --git a/archivers/libarchive/files/doc/man/bsdcpio.1 b/archivers/libarchive/files/doc/man/bsdcpio.1
index 58fc9bf5c1f..26c5c1d36fc 100644
--- a/archivers/libarchive/files/doc/man/bsdcpio.1
+++ b/archivers/libarchive/files/doc/man/bsdcpio.1
@@ -1,335 +1,323 @@
-.\" Copyright (c) 2003-2007 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$
-.\"
-.Dd August 05, 2007
-.Dt BSDCPIO 1
-.Os
-.Sh NAME
-.Nm cpio
-.Nd copy files to and from archives
-.Sh SYNOPSIS
-.Nm
-.Brq Fl i
-.Op Ar options
-.Op Ar pattern ...
-.Op Ar < archive
-.Nm
-.Brq Fl o
-.Op Ar options
-.Ar < name-list
-.Op Ar > archive
-.Nm
-.Brq Fl p
-.Op Ar options
-.Ar dest-dir
-.Ar < name-list
-.Sh DESCRIPTION
-.Nm
+.TH BSDCPIO 1 "December 21, 2007" ""
+.SH NAME
+\fBcpio\fP
+\- copy files to and from archives
+.SH SYNOPSIS
+.br
+\fBcpio\fP
+{\fB\-i\fP}
+[\fIoptions\fP]
+[\fIpattern\fP ...]
+[\fI<\fP archive]
+.br
+\fBcpio\fP
+{\fB\-o\fP}
+[\fIoptions\fP]
+\fI<\fP name-list
+[\fI>\fP archive]
+.br
+\fBcpio\fP
+{\fB\-p\fP}
+[\fIoptions\fP]
+\fIdest-dir\fP
+\fI<\fP name-list
+.SH DESCRIPTION
+\fBcpio\fP
copies files between archives and directories.
This implementation can extract from tar, pax, cpio, zip, jar, ar,
and ISO 9660 cdrom images and can create tar, pax, cpio, ar,
and shar archives.
-.Pp
The first option to
-.Nm
+\fBcpio\fP
is a mode indicator from the following list:
-.Bl -tag -compact -width indent
-.It Fl i
+.TP
+\fB\-i\fP
Input.
Read an archive from standard input and extract the contents to disk or
(if the
-.Fl t
+\fB\-t\fP
option is specified)
list the contents to standard output.
-.It Fl o
+If one or more file patterns are specified, only files matching
+one of the patterns will be extracted.
+.TP
+\fB\-o\fP
Output.
Read a list of filenames from standard input and produce a new archive
on standard output containing the specified items.
-If one or more file patterns are specified, only files matching
-one of the patterns will be extracted.
-.It Fl p
+.TP
+\fB\-p\fP
Pass-through.
Read a list of filenames from standard input and copy the files to the
specified directory.
-.El
-.Pp
-.Sh OPTIONS
+.SH OPTIONS
Unless specifically stated otherwise, options are applicable in
all operating modes.
-.Bl -tag -width indent
-.It Fl a
+.TP
+\fB\-a\fP
(o and p modes)
Reset access times on files after they are read.
-(Not yet implemented)
-.It Fl B
+.TP
+\fB\-B\fP
(o mode only)
Block output to records of 5120 bytes.
-.It Fl c
+.TP
+\fB\-c\fP
(o mode only)
Use the old POSIX portable character format.
Equivalent to
-.Fl -format Ar odc .
-.It Fl d
+\fB\--format\fP \fIodc\fP.
+.TP
+\fB\-d\fP
(i and p modes)
Create directories as necessary.
-.It Fl f Ar pattern
+.TP
+\fB\-f\fP \fIpattern\fP
(i mode only)
Ignore files that match
-.Ar pattern .
-(Not yet implemented.)
-.It Fl -format Ar format
+\fIpattern\fP.
+.TP
+\fB\--format\fP \fIformat\fP
(o mode only)
Produce the output archive in the specified format.
Supported formats include:
-.Pp
-.Bl -tag -width "iso9660" -compact
-.It Ar cpio
+.TP
+\fIcpio\fP
Synonym for
-.Ar odc .
-.It Ar newc
+\fIodc\fP.
+.TP
+\fInewc\fP
The SVR4 portable cpio format.
-.It Ar odc
+.TP
+\fIodc\fP
The old POSIX.1 portable octet-oriented cpio format.
-.It Ar pax
+.TP
+\fIpax\fP
The POSIX.1 pax format, an extension of the ustar format.
-.It Ar ustar
+.TP
+\fIustar\fP
The POSIX.1 tar format.
-.El
-.Pp
The default format is
-.Ar odc .
+\fIodc\fP.
See
-.Xr libarchive_formats 5
+\fBlibarchive_formats\fP(5)
for more complete information about the
formats currently supported by the underlying
-.Xr libarchive 3
+\fBlibarchive\fP(3)
library.
-.It Fl i
+.TP
+\fB\-i\fP
Input mode.
See above for description.
-.It Fl L
+.TP
+\fB\-L\fP
(o and p modes)
All symbolic links will be followed.
Normally, symbolic links are archived and copied as symbolic links.
With this option, the target of the link will be archived or copied instead.
-(Not yet implemented.)
-.It Fl l
+.TP
+\fB\-l\fP
(p mode only)
Create links from the target directory to the original files,
instead of copying.
-.It Fl m
+.TP
+\fB\-m\fP
(i and p modes)
Set file modification time on created files to match
those in the source.
-.It Fl o
+.TP
+\fB\-o\fP
Output mode.
See above for description.
-.It Fl p
+.TP
+\fB\-p\fP
Pass-through mode.
See above for description.
-.It Fl -quiet
-(Not yet implemented.)
-.It Fl R Oo user Oc Ns Oo : Oc Ns Oo group Oc
+.TP
+\fB\--quiet\fP
+Suppress unnecessary messages.
+.TP
+\fB\-R\fP [user] [:] [group]
Set the owner and/or group on files in the output.
If group is specified with no user
(for example,
-.Fl R Ar :wheel )
+\fB\-R\fP \fI:wheel\fP)
then the group will be set but not the user.
If the user is specified with a trailing colon and no group
(for example,
-.Fl R Ar root: )
+\fB\-R\fP \fIroot:\fP)
then the group will be set to the user's default group.
If the user is specified with no trailing colon, then
the user will be set but not the group.
In
-.Fl i
+\fB\-i\fP
and
-.Fl p
+\fB\-p\fP
modes, this option can only be used by the super-user.
(For compatibility, a period can be used in place of the colon.)
-.It Fl r
+.TP
+\fB\-r\fP
(All modes.)
Rename files interactively.
For each file, a prompt is written to
-.Pa /dev/tty
+\fI/dev/tty\fP
containing the name of the file and a line is read from
-.Pa /dev/tty .
+\fI/dev/tty\fP.
If the line read is blank, the file is skipped.
If the line contains a single period, the file is processed normally.
Otherwise, the line is taken to be the new name of the file.
-.It Fl t
+.TP
+\fB\-t\fP
(i mode only)
List the contents of the archive to stdout;
do not restore the contents to disk.
-.It Fl u
+.TP
+\fB\-u\fP
(i and p modes)
Unconditionally overwrite existing files.
Ordinarily, an older file will not overwrite a newer file on disk.
-.It Fl v
+.TP
+\fB\-v\fP
Print the name of each file to stderr as it is processed.
With
-.Fl t ,
+\fB\-t\fP,
provide a detailed listing of each file.
-.It Fl -version
+.TP
+\fB\--version\fP
Print the program version information and exit.
-.It Fl y
+.TP
+\fB\-y\fP
(o mode only)
Compress the archive with bzip2-compatible compression before
writing to stdout.
In input mode, this option is ignored;
bzip2 compression is recognized automatically on input.
-.It Fl z
+.TP
+\fB\-z\fP
(o mode only)
Compress the archive with gzip-compatible compression before writing
it to stdout.
In input mode, this option is ignored;
gzip compression is recognized automatically on input.
-.El
-.Sh ENVIRONMENT
+.SH ENVIRONMENT
The following environment variables affect the execution of
-.Nm :
-.Bl -tag -width ".Ev BLOCKSIZE"
-.It Ev LANG
+\fB:\fP
+.TP
+.B LANG
The locale to use.
See
-.Xr environ 7
+\fBenviron\fP(7)
for more information.
-.It Ev TZ
+.TP
+.B TZ
The timezone to use when displaying dates.
See
-.Xr environ 7
+\fBenviron\fP(7)
for more information.
-.El
-.Sh EXIT STATUS
-.Ex -std
-.Sh EXAMPLES
+.SH EXIT STATUS
+The \fBcpio\fP utility exits 0 on success, and >0 if an error occurs.
+.SH EXAMPLES
The
-.Nm
+\fBcpio\fP
command is traditionally used to copy file heirarchies in conjunction
with the
-.Xr find 1
+\fBfind\fP(1)
command.
The first example here simply copies all files from
-.Pa src
+\fIsrc\fP
to
-.Pa dest :
-.Dl Nm find Pa src | Nm Fl pmud Pa dest
-.Pp
+\fIdest\fP:
+.RS
+\fBcpio\fP find \fIsrc\fP | \fBcpio\fP \fB\-pmud\fP \fIdest\fP
+.RE
By carefully selecting options to the
-.Xr find 1
+\fBfind\fP(1)
command and combining it with other standard utilities,
it is possible to exercise very fine control over which files are copied.
This next example copies files from
-.Pa src
+\fIsrc\fP
to
-.Pa dest
+\fIdest\fP
that are more than 2 days old and whose names match a particular pattern:
-.Dl Nm find Pa src Fl mtime Ar +2 | Nm grep foo[bar] | Nm Fl pdmu Pa dest
-.Pp
+.RS
+\fBcpio\fP find \fIsrc\fP \fB\-mtime\fP \fI+2\fP | \fINm\fP grep foo[bar] | \fBcpio\fP \fB\-pdmu\fP \fIdest\fP
+.RE
This example copies files from
-.Pa src
+\fIsrc\fP
to
-.Pa dest
+\fIdest\fP
that are more than 2 days old and which contain the word
-.Do foobar Dc :
-.Dl Nm find Pa src Fl mtime Ar +2 | Nm xargs Nm grep -l foobar | Nm Fl pdmu Pa dest
-.Sh COMPATIBILITY
+Do foobar Dc:
+.RS
+\fBcpio\fP find \fIsrc\fP \fB\-mtime\fP \fI+2\fP | \fINm\fP xargs \fBcpio\fP grep -l foobar | \fBcpio\fP \fB\-pdmu\fP \fIdest\fP
+.RE
+.SH COMPATIBILITY
The mode options i, o, and p and the options
a, B, c, d, f, l, m, r, t, u, and v comply with SUSv2.
-.Pp
The old POSIX.1 standard specified that only
-.Fl i ,
-.Fl o ,
+\fB\-i\fP,
+\fB\-o\fP,
and
-.Fl p
+\fB\-p\fP
were interpreted as command-line options.
Each took a single argument of a list of modifier
characters.
For example, the standard syntax allows
-.Fl imu
+\fB\-imu\fP
but does not support
-.Fl miu
+\fB\-miu\fP
or
-.Fl i Fl m Fl u ,
+\fB\-i\fP \fB\-m\fP \fB\-u\fP,
since
-.Ar m
+\fIm\fP
and
-.Ar u
+\fIu\fP
are only modifiers to
-.Fl i ,
+\fB\-i\fP,
they are not command-line options in their own right.
The syntax supported by this implementation is backwards-compatible
with the standard.
For best compatibility, scripts should limit themselves to the
standard syntax.
-.Sh SEE ALSO
-.Xr bzip2 1 ,
-.Xr tar 1 ,
-.Xr gzip 1 ,
-.Xr mt 1 ,
-.Xr pax 1 ,
-.Xr libarchive 3 ,
-.Xr cpio 5 ,
-.Xr libarchive-formats 5 ,
-.Xr tar 5
-.Sh STANDARDS
+.SH SEE ALSO
+\fBbzip2\fP(1),
+\fBtar\fP(1),
+\fBgzip\fP(1),
+\fBmt\fP(1),
+\fBpax\fP(1),
+\fBlibarchive\fP(3),
+\fBcpio\fP(5),
+\fBlibarchive-formats\fP(5),
+\fBtar\fP(5)
+.SH STANDARDS
There is no current POSIX standard for the cpio command; it appeared
in
-.St -p1003.1-96
+ISO/IEC 9945-1:1996 (``POSIX.1'')
but was dropped from
-.St -p1003.1-2001 .
-.Pp
+IEEE Std 1003.1-2001 (``POSIX.1'').
The cpio, ustar, and pax interchange file formats are defined by
-.St -p1003.1-2001
+IEEE Std 1003.1-2001 (``POSIX.1'')
for the pax command.
-.Sh HISTORY
+.SH HISTORY
The original
-.Nm cpio
+\fBcpio\fP
and
-.Nm find
+\fBfind\fP
utilities were written by Dick Haight
while working in AT&T's Unix Support Group.
-They first appeared in PWB/UNIX 1.0, the
-.Dq Programmer's Work Bench
-system developed for use within AT&T and released in 1977.
-XXX It was first released outside of AT&T
-as part of System III Unix in 1981. XXX
-XXX Need to verify the previous statement. XXX
+They first appeared in 1977 in PWB/UNIX 1.0, the
+``Programmer's Work Bench''
+system developed for use within AT&T.
+They were first released outside of AT&T as part of System III Unix in 1981.
As a result,
-.Nm cpio
+\fBcpio\fP
actually predates
-.Nm tar ,
-even though it was not well-known outside of AT&T
-until some time later.
-XXX When did cpio first appear in BSD? XXX
-.Pp
+\fBtar\fP,
+even though it was not well-known outside of AT&T until some time later.
This is a complete re-implementation based on the
-.Xr libarchive 3
+\fBlibarchive\fP(3)
library.
-.Sh BUGS
+.SH BUGS
The cpio archive format has several basic limitations:
It does not store user and group names, only numbers.
As a result, it cannot be reliably used to transfer
@@ -338,25 +326,5 @@ Older cpio formats limit the user and group numbers to
16 or 18 bits, which is insufficient for modern systems.
The cpio archive formats cannot support files over 4 gigabytes,
except for the
-.Dq odc
+``odc''
variant, which can support files up to 8 gigabytes.
-.Pp
-This is an early alpha version of
-.Nm .
-The underlying
-.Nm libarchive
-library is quite mature, so the archive format support
-and creation of objects on disk should be robust.
-However, the cpio-specific options and features
-are still very new.
-Known issues that will be fixed soon:
-.Bl -bullet -offset indent -compact
-.It
-Options documented above as
-.Do Not yet implemented Dc .
-.It
-Filter arguments to
-.Fl i ,
-and
-.Fl it .
-.El
diff --git a/archivers/libarchive/files/doc/man/bsdtar.1 b/archivers/libarchive/files/doc/man/bsdtar.1
index db6a10aa1ca..b0e452347cc 100644
--- a/archivers/libarchive/files/doc/man/bsdtar.1
+++ b/archivers/libarchive/files/doc/man/bsdtar.1
@@ -1,180 +1,168 @@
-.\" Copyright (c) 2003-2007 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: src/usr.bin/tar/bsdtar.1,v 1.35 2007/05/29 05:39:10 kientzle Exp $
-.\"
-.Dd April 13, 2004
-.Dt BSDTAR 1
-.Os
-.Sh NAME
-.Nm tar
-.Nd manipulate tape archives
-.Sh SYNOPSIS
-.Nm
-.Op Ar bundled-flags Ao args Ac
-.Op Ao Ar file Ac | Ao Ar pattern Ac ...
-.Nm
-.Brq Fl c
-.Op Ar options
-.Op Ar files | directories
-.Nm
-.Brq Fl r | Fl u
-.Fl f Ar archive-file
-.Op Ar options
-.Op Ar files | directories
-.Nm
-.Brq Fl t | Fl x
-.Op Ar options
-.Op Ar patterns
-.Sh DESCRIPTION
-.Nm
+.TH BSDTAR 1 "April 13, 2004" ""
+.SH NAME
+\fBtar\fP
+\- manipulate tape archives
+.SH SYNOPSIS
+.br
+\fBtar\fP
+[\fIbundled-flags\fP <args>]
+[<\fIfile\fP> | <\fIpattern\fP> ...]
+.br
+\fBtar\fP
+{\fB\-c\fP}
+[\fIoptions\fP]
+[\fIfiles\fP | \fIdirectories\fP]
+.br
+\fBtar\fP
+{\fB\-r\fP | \fB\-u\fP}
+\fB\-f\fP \fIarchive-file\fP
+[\fIoptions\fP]
+[\fIfiles\fP | \fIdirectories\fP]
+.br
+\fBtar\fP
+{\fB\-t\fP | \fB\-x\fP}
+[\fIoptions\fP]
+[\fIpatterns\fP]
+.SH DESCRIPTION
+\fBtar\fP
creates and manipulates streaming archive files.
This implementation can extract from tar, pax, cpio, zip, jar, ar,
and ISO 9660 cdrom images and can create tar, pax, cpio, ar,
and shar archives.
-.Pp
The first synopsis form shows a
-.Dq bundled
+``bundled''
option word.
This usage is provided for compatibility with historical implementations.
See COMPATIBILITY below for details.
-.Pp
The other synopsis forms show the preferred usage.
The first option to
-.Nm
+\fBtar\fP
is a mode indicator from the following list:
-.Bl -tag -compact -width indent
-.It Fl c
+.TP
+\fB\-c\fP
Create a new archive containing the specified items.
-.It Fl r
+.TP
+\fB\-r\fP
Like
-.Fl c ,
+\fB\-c\fP,
but new entries are appended to the archive.
Note that this only works on uncompressed archives stored in regular files.
The
-.Fl f
+\fB\-f\fP
option is required.
-.It Fl t
+.TP
+\fB\-t\fP
List archive contents to stdout.
-.It Fl u
+.TP
+\fB\-u\fP
Like
-.Fl r ,
+\fB\-r\fP,
but new entries are added only if they have a modification date
newer than the corresponding entry in the archive.
Note that this only works on uncompressed archives stored in regular files.
The
-.Fl f
+\fB\-f\fP
option is required.
-.It Fl x
+.TP
+\fB\-x\fP
Extract to disk from the archive.
If a file with the same name appears more than once in the archive,
each copy will be extracted, with later copies overwriting (replacing)
earlier copies.
-.El
-.Pp
In
-.Fl c ,
-.Fl r ,
+\fB\-c\fP,
+\fB\-r\fP,
or
-.Fl u
+\fB\-u\fP
mode, each specified file or directory is added to the
archive in the order specified on the command line.
By default, the contents of each directory are also archived.
-.Pp
In extract or list mode, the entire command line
is read and parsed before the archive is opened.
The pathnames or patterns on the command line indicate
which items in the archive should be processed.
Patterns are shell-style globbing patterns as
documented in
-.Xr tcsh 1 .
-.Sh OPTIONS
+\fBtcsh\fP(1).
+.SH OPTIONS
Unless specifically stated otherwise, options are applicable in
all operating modes.
-.Bl -tag -width indent
-.It Cm @ Ns Pa archive
+.TP
+\fB@\fP \fIarchive\fP
(c and r mode only)
The specified archive is opened and the entries
in it will be appended to the current archive.
As a simple example,
-.Dl Nm Fl c Fl f Pa - Pa newfile Cm @ Ns Pa original.tar
+.RS
+\fBtar\fP \fB\-c\fP \fB\-f\fP \fI-\fP \fInewfile\fP \fB@\fP \fIoriginal.tar\fP
+.RE
writes a new archive to standard output containing a file
-.Pa newfile
+\fInewfile\fP
and all of the entries from
-.Pa original.tar .
+\fIoriginal.tar\fP.
In contrast,
-.Dl Nm Fl c Fl f Pa - Pa newfile Pa original.tar
+.RS
+\fBtar\fP \fB\-c\fP \fB\-f\fP \fI-\fP \fInewfile\fP \fIoriginal.tar\fP
+.RE
creates a new archive with only two entries.
Similarly,
-.Dl Nm Fl czf Pa - Fl -format Cm pax Cm @ Ns Pa -
+.RS
+\fBtar\fP \fB\-czf\fP \fI-\fP \fB\--format\fP \fBpax\fP \fB@\fP \fI-\fP
+.RE
reads an archive from standard input (whose format will be determined
automatically) and converts it into a gzip-compressed
pax-format archive on stdout.
In this way,
-.Nm
+\fBtar\fP
can be used to convert archives from one format to another.
-.It Fl b Ar blocksize
+.TP
+\fB\-b\fP \fIblocksize\fP
Specify the block size, in 512-byte records, for tape drive I/O.
As a rule, this argument is only needed when reading from or writing
to tape drives, and usually not even then as the default block size of
20 records (10240 bytes) is very common.
-.It Fl C Ar directory
+.TP
+\fB\-C\fP \fIdirectory\fP
In c and r mode, this changes the directory before adding
the following files.
In x mode, change directories after opening the archive
but before extracting entries from the archive.
-.It Fl -check-links ( Fl W Cm check-links )
+.TP
+\fB\--check-links\fP (\fB\-W\fP \fBcheck-links\fP)
(c and r modes only)
Issue a warning message unless all links to each file are archived.
-.It Fl -exclude Ar pattern ( Fl W Cm exclude Ns = Ns Ar pattern )
+.TP
+\fB\--exclude\fP \fIpattern\fP (\fB\-W\fP \fBexclude\fP=\fIpattern\fP)
Do not process files or directories that match the
specified pattern.
Note that exclusions take precedence over patterns or filenames
specified on the command line.
-.It Fl -format Ar format ( Fl W Cm format Ns = Ns Ar format )
+.TP
+\fB\--format\fP \fIformat\fP (\fB\-W\fP \fBformat\fP=\fIformat\fP)
(c mode only)
Use the specified format for the created archive.
Supported formats include
-.Dq cpio ,
-.Dq pax ,
-.Dq shar ,
+``cpio'',
+``pax'',
+``shar'',
and
-.Dq ustar .
+``ustar''.
Other formats may also be supported; see
-.Xr libarchive-formats 5
+\fBlibarchive-formats\fP(5)
for more information about currently-supported formats.
-.It Fl f Ar file
+.TP
+\fB\-f\fP \fIfile\fP
Read the archive from or write the archive to the specified file.
The filename can be
-.Pa -
+\fI-\fP
for standard input or standard output.
If not specified, the default tape device will be used.
(On
-.Fx ,
+FreeBSD,
the default tape device is
-.Pa /dev/sa0 . )
-.It Fl -fast-read ( Fl W Cm fast-read )
+\fI/dev/sa0\fP.)
+.TP
+\fB\--fast-read\fP (\fB\-W\fP \fBfast-read\fP)
(x and t mode only)
Extract or list only the first archive entry that matches each pattern
or filename operand.
@@ -183,333 +171,361 @@ By default, the archive is always read to the very end, since
there can be multiple entries with the same name and, by convention,
later entries overwrite earlier entries.
This option is provided as a performance optimization.
-.It Fl H
+.TP
+\fB\-H\fP
(c and r mode only)
Symbolic links named on the command line will be followed; the
target of the link will be archived, not the link itself.
-.It Fl h
+.TP
+\fB\-h\fP
(c and r mode only)
Synonym for
-.Fl L .
-.It Fl I
+\fB\-L\fP.
+.TP
+\fB\-I\fP
Synonym for
-.Fl T .
-.It Fl -include Ar pattern ( Fl W Cm include Ns = Ns Ar pattern )
+\fB\-T\fP.
+.TP
+\fB\--include\fP \fIpattern\fP (\fB\-W\fP \fBinclude\fP=\fIpattern\fP)
Process only files or directories that match the specified pattern.
Note that exclusions specified with
-.Fl -exclude
+\fB\--exclude\fP
take precedence over inclusions.
If no inclusions are explicitly specified, all entries are processed by
default.
The
-.Fl -include
+\fB\--include\fP
option is especially useful when filtering archives.
For example, the command
-.Dl Nm Fl c Fl f Pa new.tar Fl -include='*foo*' Cm @ Ns Pa old.tgz
+.RS
+\fBtar\fP \fB\-c\fP \fB\-f\fP \fInew.tar\fP \fB\--include='*foo*'\fP \fB@\fP \fIold.tgz\fP
+.RE
creates a new archive
-.Pa new.tar
+\fInew.tar\fP
containing only the entries from
-.Pa old.tgz
+\fIold.tgz\fP
containing the string
-.Sq foo .
-.It Fl j
+Sq foo.
+.TP
+\fB\-j\fP
(c mode only)
Compress the resulting archive with
-.Xr bzip2 1 .
+\fBbzip2\fP(1).
In extract or list modes, this option is ignored.
Note that, unlike other
-.Nm tar
+\fBtar\fP
implementations, this implementation recognizes bzip2 compression
automatically when reading archives.
-.It Fl k
+.TP
+\fB\-k\fP
(x mode only)
Do not overwrite existing files.
In particular, if a file appears more than once in an archive,
later copies will not overwrite earlier copies.
-.It Fl L
+.TP
+\fB\-L\fP
(c and r mode only)
All symbolic links will be followed.
Normally, symbolic links are archived as such.
With this option, the target of the link will be archived instead.
-.It Fl l
-If
-.Ev POSIXLY_CORRECT
-is specified in the environment, this is a synonym for the
-.Fl -check-links
+.TP
+\fB\-l\fP
+This is a synonym for the
+\fB\--check-links\fP
option.
-Otherwise, an error will be displayed.
-Users who desire behavior compatible with GNU tar should use
-the
-.Fl -one-file-system
-option instead.
-.It Fl m
+.TP
+\fB\-m\fP
(x mode only)
Do not extract modification time.
By default, the modification time is set to the time stored in the archive.
-.It Fl n
+.TP
+\fB\-n\fP
(c, r, u modes only)
Do not recursively archive the contents of directories.
-.It Fl -newer Ar date ( Fl W Cm newer Ns = Ns Ar date )
+.TP
+\fB\--newer\fP \fIdate\fP (\fB\-W\fP \fBnewer\fP=\fIdate\fP)
(c, r, u modes only)
Only include files and directories newer than the specified date.
This compares ctime entries.
-.It Fl -newer-mtime Ar date ( Fl W Cm newer-mtime Ns = Ns Ar date )
+.TP
+\fB\--newer-mtime\fP \fIdate\fP (\fB\-W\fP \fBnewer-mtime\fP=\fIdate\fP)
(c, r, u modes only)
Like
-.Fl -newer ,
+\fB\--newer\fP,
except it compares mtime entries instead of ctime entries.
-.It Fl -newer-than Pa file ( Fl W Cm newer-than Ns = Ns Pa file )
+.TP
+\fB\--newer-than\fP \fIfile\fP (\fB\-W\fP \fBnewer-than\fP=\fIfile\fP)
(c, r, u modes only)
Only include files and directories newer than the specified file.
This compares ctime entries.
-.It Fl -newer-mtime-than Pa file ( Fl W Cm newer-mtime-than Ns = Ns Pa file )
+.TP
+\fB\--newer-mtime-than\fP \fIfile\fP (\fB\-W\fP \fBnewer-mtime-than\fP=\fIfile\fP)
(c, r, u modes only)
Like
-.Fl -newer-than ,
+\fB\--newer-than\fP,
except it compares mtime entries instead of ctime entries.
-.It Fl -nodump ( Fl W Cm nodump )
+.TP
+\fB\--nodump\fP (\fB\-W\fP \fBnodump\fP)
(c and r modes only)
Honor the nodump file flag by skipping this file.
-.It Fl -null ( Fl W Cm null )
+.TP
+\fB\--null\fP (\fB\-W\fP \fBnull\fP)
(use with
-.Fl I ,
-.Fl T ,
+\fB\-I\fP,
+\fB\-T\fP,
or
-.Fl X )
+\fB\-X\fP)
Filenames or patterns are separated by null characters,
not by newlines.
This is often used to read filenames output by the
-.Fl print0
+\fB\-print0\fP
option to
-.Xr find 1 .
-.It Fl O
+\fBfind\fP(1).
+.TP
+\fB\-O\fP
(x, t modes only)
In extract (-x) mode, files will be written to standard out rather than
being extracted to disk.
In list (-t) mode, the file listing will be written to stderr rather than
the usual stdout.
-.It Fl o
+.TP
+\fB\-o\fP
(x mode only)
Use the user and group of the user running the program rather
than those specified in the archive.
Note that this has no significance unless
-.Fl p
+\fB\-p\fP
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.
-.It Fl -one-file-system ( Fl W Cm one-file-system )
+.TP
+\fB\--one-file-system\fP (\fB\-W\fP \fBone-file-system\fP)
(c, r, and u modes)
Do not cross mount points.
-.It Fl P
+.TP
+\fB\-P\fP
Preserve pathnames.
By default, absolute pathnames (those that begin with a /
character) have the leading slash removed both when creating archives
and extracting from them.
Also,
-.Nm
+\fBtar\fP
will refuse to extract archive entries whose pathnames contain
-.Pa ..
+\fI\& ..\fP
or whose target directory would be altered by a symlink.
This option suppresses these behaviors.
-.It Fl p
+.TP
+\fB\-p\fP
(x mode only)
Preserve file permissions.
Attempt to restore the full permissions, including owner, file modes, file
flags and ACLs, if available, for each item extracted from the archive.
By default, newly-created files are owned by the user running
-.Nm ,
+\fB,\fP
the file mode is restored for newly-created regular files, and
all other types of entries receive default permissions.
If
-.Nm
+\fBtar\fP
is being run by root, the default is to restore the owner unless the
-.Fl o
+\fB\-o\fP
option is also specified.
-.It Fl -strip-components Ar count ( Fl W Cm strip-components Ns = Ns Ar count )
+.TP
+\fB\--strip-components\fP \fIcount\fP (\fB\-W\fP \fBstrip-components\fP=\fIcount\fP)
(x and t mode only)
Remove the specified number of leading path elements.
Pathnames with fewer elements will be silently skipped.
Note that the pathname is edited after checking inclusion/exclusion patterns
but before security checks.
-.It Fl T Ar filename
+.TP
+\fB\-T\fP \fIfilename\fP
In x or t mode,
-.Nm
+\fBtar\fP
will read the list of names to be extracted from
-.Pa filename .
+\fIfilename\fP.
In c mode,
-.Nm
+\fBtar\fP
will read names to be archived from
-.Pa filename .
+\fIfilename\fP.
The special name
-.Dq -C
+``-C''
on a line by itself will cause the current directory to be changed to
the directory specified on the following line.
Names are terminated by newlines unless
-.Fl -null
+\fB\--null\fP
is specified.
Note that
-.Fl -null
+\fB\--null\fP
also disables the special handling of lines containing
-.Dq -C .
-.It Fl U
+``-C''.
+.TP
+\fB\-U\fP
(x mode only)
Unlink files before creating them.
Without this option,
-.Nm
+\fBtar\fP
overwrites existing files, which preserves existing hardlinks.
With this option, existing hardlinks will be broken, as will any
symlink that would affect the location of an extracted file.
-.It Fl -use-compress-program Ar program
+.TP
+\fB\--use-compress-program\fP \fIprogram\fP
Pipe the input (in x or t mode) or the output (in c mode) through
-.Pa program
+\fIprogram\fP
instead of using the builtin compression support.
-.It Fl v
+.TP
+\fB\-v\fP
Produce verbose output.
In create and extract modes,
-.Nm
+\fBtar\fP
will list each file name as it is read from or written to
the archive.
In list mode,
-.Nm
+\fBtar\fP
will produce output similar to that of
-.Xr ls 1 .
+\fBls\fP(1).
Additional
-.Fl v
+\fB\-v\fP
options will provide additional detail.
-.It Fl W Ar longopt=value
+.TP
+\fB\-W\fP \fIlongopt=value\fP
Long options (preceded by
-.Fl - )
+\fB\--\fP)
are only supported directly on systems that have the
-.Xr getopt_long 3
+\fBgetopt_long\fP(3)
function.
The
-.Fl W
+\fB\-W\fP
option can be used to access long options on systems that
do not support this function.
-.It Fl w
+.TP
+\fB\-w\fP
Ask for confirmation for every action.
-.It Fl X Ar filename
+.TP
+\fB\-X\fP \fIfilename\fP
Read a list of exclusion patterns from the specified file.
See
-.Fl -exclude
+\fB\--exclude\fP
for more information about the handling of exclusions.
-.It Fl y
+.TP
+\fB\-y\fP
(c mode only)
Compress the resulting archive with
-.Xr bzip2 1 .
+\fBbzip2\fP(1).
In extract or list modes, this option is ignored.
Note that, unlike other
-.Nm tar
+\fBtar\fP
implementations, this implementation recognizes bzip2 compression
automatically when reading archives.
-.It Fl z
+.TP
+\fB\-z\fP
(c mode only)
Compress the resulting archive with
-.Xr gzip 1 .
+\fBgzip\fP(1).
In extract or list modes, this option is ignored.
Note that, unlike other
-.Nm tar
+\fBtar\fP
implementations, this implementation recognizes gzip compression
automatically when reading archives.
-.El
-.Sh ENVIRONMENT
+.SH ENVIRONMENT
The following environment variables affect the execution of
-.Nm :
-.Bl -tag -width ".Ev BLOCKSIZE"
-.It Ev LANG
+\fB:\fP
+.TP
+.B LANG
The locale to use.
See
-.Xr environ 7
+\fBenviron\fP(7)
for more information.
-.It Ev POSIXLY_CORRECT
-If this environment variable is defined, the
-.Fl l
-option will be interpreted in accordance with
-.St -p1003.1-96 .
-.It Ev TAPE
+.TP
+.B TAPE
The default tape device.
The
-.Fl f
+\fB\-f\fP
option overrides this.
-.It Ev TZ
+.TP
+.B TZ
The timezone to use when displaying dates.
See
-.Xr environ 7
+\fBenviron\fP(7)
for more information.
-.El
-.Sh FILES
-.Bl -tag -width ".Ev BLOCKSIZE"
-.It Pa /dev/sa0
+.SH FILES
+.TP
+.B /dev/sa0
The default tape device, if not overridden by the
-.Ev TAPE
+.IR TAPE
environment variable or the
-.Fl f
+\fB\-f\fP
option.
-.El
-.Sh EXIT STATUS
-.Ex -std
-.Sh EXAMPLES
+.SH EXIT STATUS
+The \fBtar\fP utility exits 0 on success, and >0 if an error occurs.
+.SH EXAMPLES
The following creates a new archive
called
-.Ar file.tar.gz
+\fIfile.tar.gz\fP
that contains two files
-.Ar source.c
+\fIsource.c\fP
and
-.Ar source.h :
-.Dl Nm Fl czf Pa file.tar.gz Pa source.c Pa source.h
-.Pp
+\fIsource.h\fP:
+.RS
+\fBtar\fP \fB\-czf\fP \fIfile.tar.gz\fP \fIsource.c\fP \fIsource.h\fP
+.RE
To view a detailed table of contents for this
archive:
-.Dl Nm Fl tvf Pa file.tar.gz
-.Pp
+.RS
+\fBtar\fP \fB\-tvf\fP \fIfile.tar.gz\fP
+.RE
To extract all entries from the archive on
the default tape drive:
-.Dl Nm Fl x
-.Pp
+.RS
+\fBtar\fP \fB\-x\fP
+.RE
To examine the contents of an ISO 9660 cdrom image:
-.Dl Nm Fl tf Pa image.iso
-.Pp
+.RS
+\fBtar\fP \fB\-tf\fP \fIimage.iso\fP
+.RE
To move file hierarchies, invoke
-.Nm
+\fBtar\fP
as
-.Dl Nm Fl cf Pa - Fl C Pa srcdir\ . | Nm Fl xpf Pa - Fl C Pa destdir
+.RS
+\fBtar\fP \fB\-cf\fP \fI-\fP \fB\-C\fP \fIsrcdir\\fP. | \fBtar\fP \fB\-xpf\fP \fI-\fP \fB\-C\fP \fIdestdir\fP
+.RE
or more traditionally
-.Dl cd srcdir \&; Nm Fl cf Pa -\ . | ( cd destdir \&; Nm Fl xpf Pa - )
-.Pp
+.RS
+cd srcdir \&; \fBtar\fP \fB\-cf\fP \fI-\\fP. | (cd destdir \&; \fBtar\fP \fB\-xpf\fP \fI-\fP)
+.RE
In create mode, the list of files and directories to be archived
can also include directory change instructions of the form
-.Cm -C Ns Pa foo/baz
+\fB-C\fP \fIfoo/baz\fP
and archive inclusions of the form
-.Cm @ Ns Pa archive-file .
+\fB@\fP \fIarchive-file\fP.
For example, the command line
-.Dl Nm Fl c Fl f Pa new.tar Pa foo1 Cm @ Ns Pa old.tgz Cm -C Ns Pa /tmp Pa foo2
+.RS
+\fBtar\fP \fB\-c\fP \fB\-f\fP \fInew.tar\fP \fIfoo1\fP \fB@\fP \fIold.tgz\fP \fB-C\fP \fI/tmp\fP \fIfoo2\fP
+.RE
will create a new archive
-.Pa new.tar .
-.Nm
+\fInew.tar\fP.
+\fBtar\fP
will read the file
-.Pa foo1
+\fIfoo1\fP
from the current directory and add it to the output archive.
It will then read each entry from
-.Pa old.tgz
+\fIold.tgz\fP
and add those entries to the output archive.
Finally, it will switch to the
-.Pa /tmp
+\fI/tmp\fP
directory and add
-.Pa foo2
+\fIfoo2\fP
to the output archive.
-.Pp
The
-.Fl -newer
+\fB\--newer\fP
and
-.Fl -newer-mtime
+\fB\--newer-mtime\fP
switches accept a variety of common date and time specifications, including
-.Dq 12 Mar 2005 7:14:29pm ,
-.Dq 2005-03-12 19:14 ,
-.Dq 5 minutes ago ,
+``12 Mar 2005 7:14:29pm'',
+``2005-03-12 19:14'',
+``5 minutes ago'',
and
-.Dq 19:14 PST May 1 .
-.Sh COMPATIBILITY
+``19:14 PST May 1''.
+.SH COMPATIBILITY
The bundled-arguments format is supported for compatibility
with historic implementations.
It consists of an initial word (with no leading - character) in which
@@ -518,56 +534,55 @@ Arguments follow as separate words.
The order of the arguments must match the order
of the corresponding characters in the bundled command word.
For example,
-.Dl Nm Cm tbf 32 Pa file.tar
+.RS
+\fBtar\fP \fBtbf\fP 32 \fIfile.tar\fP
+.RE
specifies three flags
-.Cm t ,
-.Cm b ,
+\fBt\fP,
+\fBb\fP,
and
-.Cm f .
+\fBf\fP.
The
-.Cm b
+\fBb\fP
and
-.Cm f
+\fBf\fP
flags both require arguments,
so there must be two additional items
on the command line.
The
-.Ar 32
+\fI32\fP
is the argument to the
-.Cm b
+\fBb\fP
flag, and
-.Ar file.tar
+\fIfile.tar\fP
is the argument to the
-.Cm f
+\fBf\fP
flag.
-.Pp
The mode options c, r, t, u, and x and the options
b, f, l, m, o, v, and w comply with SUSv2.
-.Pp
For maximum portability, scripts that invoke
-.Nm tar
+\fBtar\fP
should use the bundled-argument format above, should limit
themselves to the
-.Cm c ,
-.Cm t ,
+\fBc\fP,
+\fBt\fP,
and
-.Cm x
+\fBx\fP
modes, and the
-.Cm b ,
-.Cm f ,
-.Cm m ,
-.Cm v ,
+\fBb\fP,
+\fBf\fP,
+\fBm\fP,
+\fBv\fP,
and
-.Cm w
+\fBw\fP
options.
-.Pp
On systems that support getopt_long(), additional long options
are available to improve compatibility with other tar implementations.
-.Sh SECURITY
+.SH SECURITY
Certain security issues are common to many archiving programs, including
-.Nm .
+\fB.\fP
In particular, carefully-crafted archives can request that
-.Nm
+\fBtar\fP
extract files to locations outside of the target directory.
This can potentially be used to cause unwitting users to overwrite
files they did not intend to overwrite.
@@ -575,124 +590,123 @@ If the archive is being extracted by the superuser, any file
on the system can potentially be overwritten.
There are three ways this can happen.
Although
-.Nm
+\fBtar\fP
has mechanisms to protect against each one,
savvy users should be aware of the implications:
-.Bl -bullet -width indent
-.It
+.IP \(bu
Archive entries can have absolute pathnames.
By default,
-.Nm
+\fBtar\fP
removes the leading
-.Pa /
+\fI/\fP
character from filenames before restoring them to guard against this problem.
-.It
+.IP \(bu
Archive entries can have pathnames that include
-.Pa ..
+\fI\& ..\fP
components.
By default,
-.Nm
+\fBtar\fP
will not extract files containing
-.Pa ..
+\fI\& ..\fP
components in their pathname.
-.It
+.IP \(bu
Archive entries can exploit symbolic links to restore
files to other directories.
An archive can restore a symbolic link to another directory,
then use that link to restore a file into that directory.
To guard against this,
-.Nm
+\fBtar\fP
checks each extracted path for symlinks.
If the final path element is a symlink, it will be removed
and replaced with the archive entry.
If
-.Fl U
+\fB\-U\fP
is specified, any intermediate symlink will also be unconditionally removed.
If neither
-.Fl U
+\fB\-U\fP
nor
-.Fl P
+\fB\-P\fP
is specified,
-.Nm
+\fBtar\fP
will refuse to extract the entry.
-.El
To protect yourself, you should be wary of any archives that
come from untrusted sources.
You should examine the contents of an archive with
-.Dl Nm Fl tf Pa filename
+.RS
+\fBtar\fP \fB\-tf\fP \fIfilename\fP
+.RE
before extraction.
You should use the
-.Fl k
+\fB\-k\fP
option to ensure that
-.Nm
+\fBtar\fP
will not overwrite any existing files or the
-.Fl U
+\fB\-U\fP
option to remove any pre-existing files.
You should generally not extract archives while running with super-user
privileges.
Note that the
-.Fl P
+\fB\-P\fP
option to
-.Nm
+\fBtar\fP
disables the security checks above and allows you to extract
an archive while preserving any absolute pathnames,
-.Pa ..
+\fI\& ..\fP
components, or symlinks to other directories.
-.Sh SEE ALSO
-.Xr bzip2 1 ,
-.Xr cpio 1 ,
-.Xr gzip 1 ,
-.Xr mt 1 ,
-.Xr pax 1 ,
-.Xr shar 1 ,
-.Xr libarchive 3 ,
-.Xr libarchive-formats 5 ,
-.Xr tar 5
-.Sh STANDARDS
+.SH SEE ALSO
+\fBbzip2\fP(1),
+\fBcpio\fP(1),
+\fBgzip\fP(1),
+\fBmt\fP(1),
+\fBpax\fP(1),
+\fBshar\fP(1),
+\fBlibarchive\fP(3),
+\fBlibarchive-formats\fP(5),
+\fBtar\fP(5)
+.SH STANDARDS
There is no current POSIX standard for the tar command; it appeared
in
-.St -p1003.1-96
+ISO/IEC 9945-1:1996 (``POSIX.1'')
but was dropped from
-.St -p1003.1-2001 .
+IEEE Std 1003.1-2001 (``POSIX.1'').
The options used by this implementation were developed by surveying a
number of existing tar implementations as well as the old POSIX specification
for tar and the current POSIX specification for pax.
-.Pp
The ustar and pax interchange file formats are defined by
-.St -p1003.1-2001
+IEEE Std 1003.1-2001 (``POSIX.1'')
for the pax command.
-.Sh HISTORY
+.SH HISTORY
A
-.Nm tar
+\fBtar\fP
command appeared in Seventh Edition Unix, which was released in January, 1979.
There have been numerous other implementations,
many of which extended the file format.
John Gilmore's
-.Nm pdtar
+\fBpdtar\fP
public-domain implementation (circa November, 1987)
was quite influential, and formed the basis of GNU tar.
GNU tar was included as the standard system tar
in
-.Fx
+FreeBSD
beginning with
-.Fx 1.0 .
-.Pp
+FreeBSD 1.0.
This is a complete re-implementation based on the
-.Xr libarchive 3
+\fBlibarchive\fP(3)
library.
-.Sh BUGS
-POSIX and GNU violently disagree about the meaning of the
-.Fl l
+.SH BUGS
+This program follows
+ISO/IEC 9945-1:1996 (``POSIX.1'')
+for the definition of the
+\fB\-l\fP
+option.
+Note that GNU tar prior to version 1.15 treated
+\fB\-l\fP
+as a synonym for the
+\fB\--one-file-system\fP
option.
-Because of the potential for disaster if someone expects
-one behavior and gets the other, the
-.Fl l
-option is deliberately broken in this implementation.
-.Pp
The
-.Fl C Pa dir
+\fB\-C\fP \fIdir\fP
option may differ from historic implementations.
-.Pp
All archive output is written in correctly-sized blocks, even
if the output is being compressed.
Whether or not the last output block is padded to a full
@@ -705,65 +719,60 @@ a tape drive.
If the output is being written to a regular file, the last block
will not be padded.
Many compressors, including
-.Xr gzip 1
+\fBgzip\fP(1)
and
-.Xr bzip2 1 ,
+\fBbzip2\fP(1),
complain about the null padding when decompressing an archive created by
-.Nm ,
+\fB,\fP
although they still extract it correctly.
-.Pp
The compression and decompression is implemented internally, so
there may be insignificant differences between the compressed output
generated by
-.Dl Nm Fl czf Pa - file
+.RS
+\fBtar\fP \fB\-czf\fP \fI-\fP file
+.RE
and that generated by
-.Dl Nm Fl cf Pa - file | Nm gzip
-.Pp
+.RS
+\fBtar\fP \fB\-cf\fP \fI-\fP file | \fBtar\fP gzip
+.RE
The default should be to read and write archives to the standard I/O paths,
but tradition (and POSIX) dictates otherwise.
-.Pp
The
-.Cm r
+\fBr\fP
and
-.Cm u
+\fBu\fP
modes require that the archive be uncompressed
and located in a regular file on disk.
Other archives can be modified using
-.Cm c
+\fBc\fP
mode with the
-.Pa @archive-file
+\fI@archive-file\fP
extension.
-.Pp
To archive a file called
-.Pa @foo
+\fI@foo\fP
or
-.Pa -foo
+\fI-foo\fP
you must specify it as
-.Pa ./@foo
+\fI\& ./@foo\fP
or
-.Pa ./-foo ,
+\fI\& ./-foo\fP,
respectively.
-.Pp
In create mode, a leading
-.Pa ./
+\fI\& ./\fP
is always removed.
A leading
-.Pa /
+\fI/\fP
is stripped unless the
-.Fl P
+\fB\-P\fP
option is specified.
-.Pp
There needs to be better support for file selection on both create
and extract.
-.Pp
There is not yet any support for multi-volume archives or for archiving
sparse files.
-.Pp
Converting between dissimilar archive formats (such as tar and cpio) using the
-.Cm @ Ns Pa -
+\fB@\fP \fI-\fP
convention can cause hard link information to be lost.
(This is a consequence of the incompatible ways that different archive
formats store hardlink information.)
-.Pp
There are alternative long options for many of the short options that
are deliberately not documented.
diff --git a/archivers/libarchive/files/doc/man/cpio.5 b/archivers/libarchive/files/doc/man/cpio.5
index 2f298332d18..a77d96b3b25 100644
--- a/archivers/libarchive/files/doc/man/cpio.5
+++ b/archivers/libarchive/files/doc/man/cpio.5
@@ -1,51 +1,23 @@
-.\" Copyright (c) 2007 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$
-.\"
-.Dd October 5, 2007
-.Dt CPIO 5
-.Os
-.Sh NAME
-.Nm cpio
-.Nd format of cpio archive files
-.Sh DESCRIPTION
+.TH CPIO 5 "October 5, 2007" ""
+.SH NAME
+\fBcpio\fP
+\- format of cpio archive files
+.SH DESCRIPTION
The
-.Nm
+\fBcpio\fP
archive format collects any number of files, directories, and other
file system objects (symbolic links, device nodes, etc.) into a single
stream of bytes.
-.Ss General Format
+.SS General Format
Each file system object in a
-.Nm
+\fBcpio\fP
archive comprises a header record with basic numeric metadata
followed by the full pathname of the entry and the file data.
The header record stores a series of integer values that generally
follow the fields in
-.Va struct stat .
+\fIstruct\fP stat.
(See
-.Xr stat 2
+\fBstat\fP(2)
for details.)
The variants differ primarily in how they store those integers
(binary, octal, or hexadecimal).
@@ -54,15 +26,15 @@ entry (the length of the pathname is stored in the header)
and any file data.
The end of the archive is indicated by a special record with
the pathname
-.Dq TRAILER!!! .
-.Ss PWB format
+``TRAILER!!!''.
+.SS PWB format
XXX Any documentation of the original PWB/UNIX 1.0 format? XXX
-.Ss Old Binary Format
+.SS Old Binary Format
The old binary
-.Nm
+\fBcpio\fP
format stores numbers as 2-byte and 4-byte binary values.
Each entry begins with a header in the following format:
-.Bd -literal -offset indent
+.RS
struct header_old_cpio {
unsigned short c_magic;
unsigned short c_dev;
@@ -76,111 +48,125 @@ struct header_old_cpio {
unsigned short c_namesize;
unsigned short c_filesize[2];
};
-.Ed
-.Pp
+.RE
The
-.Va unsigned short
+\fIunsigned\fP short
fields here are 16-bit integer values; the
-.Va unsigned int
+\fIunsigned\fP int
fields are 32-bit integer values.
The fields are as follows
-.Bl -tag -width indent
-.It Va magic
+.TP
+\fImagic\fP
The integer value octal 070707.
This value can be used to determine whether this archive is
written with little-endian or big-endian integers.
-.It Va dev , Va ino
+.TP
+\fIdev\fP, \fIino\fP
The device and inode numbers from the disk.
These are used by programs that read
-.Nm
+\fBcpio\fP
archives to determine when two entries refer to the same file.
Programs that synthesize
-.Nm
+\fBcpio\fP
archives should be careful to set these to distinct values for each entry.
-.It Va mode
+.TP
+\fImode\fP
The mode specifies both the regular permissions and the file type.
It consists of several bit fields as follows:
-.Bl -tag -width "MMMMMMM" -compact
-.It 0170000
+.TP
+0170000
This masks the file type bits.
-.It 0140000
+.TP
+0140000
File type value for sockets.
-.It 0120000
+.TP
+0120000
File type value for symbolic links.
For symbolic links, the link body is stored as file data.
-.It 0100000
+.TP
+0100000
File type value for regular files.
-.It 0060000
+.TP
+0060000
File type value for block special devices.
-.It 0040000
+.TP
+0040000
File type value for directories.
-.It 0020000
+.TP
+0020000
File type value for character special devices.
-.It 0010000
+.TP
+0010000
File type value for named pipes or FIFOs.
-.It 0004000
+.TP
+0004000
SUID bit.
-.It 0002000
+.TP
+0002000
SGID bit.
-.It 0001000
+.TP
+0001000
Sticky bit.
On some systems, this modifies the behavior of executables and/or directories.
-.It 0000777
+.TP
+0000777
The lower 9 bits specify read/write/execute permissions
for world, group, and user following standard POSIX conventions.
-.El
-.It Va uid , Va gid
+.TP
+\fIuid\fP, \fIgid\fP
The numeric user id and group id of the owner.
-.It Va nlink
+.TP
+\fInlink\fP
The number of links to this file.
Directories always have a value of at least two here.
Note that hardlinked files include file data with every copy in the archive.
-.It Va rdev
+.TP
+\fIrdev\fP
For block special and character special entries,
this field contains the associated device number.
For all other entry types, it should be set to zero by writers
and ignored by readers.
-.It Va mtime
+.TP
+\fImtime\fP
Modification time of the file, indicated as the number
of seconds since the start of the epoch,
00:00:00 UTC January 1, 1970.
The four-byte integer is stored with the most-significant 16 bits first
followed by the least-significant 16 bits.
Each of the two 16 bit values are stored in machine-native byte order.
-.It Va namesize
+.TP
+\fInamesize\fP
The number of bytes in the pathname that follows the header.
This count includes the trailing NULL byte.
-.It Va filesize
+.TP
+\fIfilesize\fP
The size of the file.
Note that this archive format is limited to
four gigabyte file sizes.
See
-.Va mtime
+\fImtime\fP
above for a description of the storage of four-byte integers.
-.El
-.Pp
The pathname immediately follows the fixed header.
If the
-.Cm namesize
+\fBnamesize\fP
is odd, an additional NULL byte is added after the pathname.
The file data is then appended, padded with NULL
bytes to an even length.
-.Pp
Hardlinked files are not given special treatment;
the full file contents are included with each copy of the
file.
-.Ss Portable ASCII Format
-.St -susv2
+.SS Portable ASCII Format
+Version 2 of the Single UNIX Specification (``SUSv2'')
standardized an ASCII variant that is portable across all
platforms.
It is commonly known as the
-.Dq old character
+``old character''
format or as the
-.Dq odc
+``odc''
format.
It stores the same numeric fields as the old binary format, but
represents them as 6-character or 11-character octal values.
-.Bd -literal -offset indent
+.RS
struct cpio_odc_header {
char c_magic[6];
char c_dev[6];
@@ -194,8 +180,7 @@ struct cpio_odc_header {
char c_namesize[6];
char c_filesize[11];
};
-.Ed
-.Pp
+.RE
The fields are identical to those in the old binary format.
The name and file body follow the fixed header.
Unlike the old binary format, there is no additional padding
@@ -203,11 +188,11 @@ after the pathname or file contents.
If the files being archived are themselves entirely ASCII, then
the resulting archive will be entirely ASCII, except for the
NULL byte that terminates the name field.
-.Ss New ASCII Format
+.SS New ASCII Format
The "new" ASCII format uses 8-byte hexadecimal fields for
all numbers and separates device numbers into separate fields
for major and minor numbers.
-.Bd -literal -offset indent
+.RS
struct cpio_newc_header {
char c_magic[6];
char c_ino[8];
@@ -224,102 +209,93 @@ struct cpio_newc_header {
char c_namesize[8];
char c_check[8];
};
-.Ed
-.Pp
+.RE
Except as specified below, the fields here match those specified
for the old binary format above.
-.Bl -tag -width indent
-.It Va magic
+.TP
+\fImagic\fP
The string
-.Dq 070701 .
-.It Va check
+``070701''.
+.TP
+\fIcheck\fP
This field is always set to zero by writers and ignored by readers.
See the next section for more details.
-.El
-.Pp
The pathname is followed by NULL bytes so that the total size
of the fixed header plus pathname is a multiple of four.
Likewise, the file data is padded to a multiple of four bytes.
Note that this format supports only 4 gigabyte files (unlike the
older ASCII format, which supports 8 gigabyte files).
-.Pp
In this format, hardlinked files are handled by setting the
filesize to zero for each entry except the last one that
appears in the archive.
-.Ss New CRC Format
+.SS New CRC Format
The CRC format is identical to the new ASCII format described
in the previous section except that the magic field is set
to
-.Dq 070702
+``070702''
and the
-.Va check
+\fIcheck\fP
field is set to the sum of all bytes in the file data.
This sum is computed treating all bytes as unsigned values
and using unsigned arithmetic.
Only the least-significant 32 bits of the sum are stored.
-.Ss HP variants
+.SS HP variants
The
-.Nm cpio
+\fBcpio\fP
implementation distributed with HPUX used XXXX but stored
device numbers differently XXX.
-.Ss Other Extensions and Variants
+.SS Other Extensions and Variants
Sun Solaris uses additional file types to store extended file
data, including ACLs and extended attributes, as special
entries in cpio archives.
-.Pp
XXX Others? XXX
-.Sh BUGS
+.SH BUGS
The
-.Dq CRC
+``CRC''
format is mis-named, as it uses a simple checksum and
not a cyclic redundancy check.
-.Pp
The old binary format is limited to 16 bits for user id,
group id, device, and inode numbers.
It is limited to 4 gigabyte file sizes.
-.Pp
The old ASCII format is limited to 18 bits for
the user id, group id, device, and inode numbers.
It is limited to 8 gigabyte file sizes.
-.Pp
The new ASCII format is limited to 4 gigabyte file sizes.
-.Pp
None of the cpio formats store user or group names,
which are essential when moving files between systems with
dissimilar user or group numbering.
-.Pp
Especially when writing older cpio variants, it may be necessary
to map actual device/inode values to synthesized values that
fit the available fields.
With very large filesystems, this may be necessary even for
the newer formats.
-.Sh SEE ALSO
-.Xr cpio 1 ,
-.Xr tar 5
-.Sh STANDARDS
+.SH SEE ALSO
+\fBcpio\fP(1),
+\fBtar\fP(5)
+.SH STANDARDS
The
-.Nm cpio
+\fBcpio\fP
utility is no longer a part of POSIX or the Single Unix Standard.
It last appeared in
-.St -susv2 .
+Version 2 of the Single UNIX Specification (``SUSv2'').
It has been supplanted in subsequent standards by
-.Xr pax 1 .
+\fBpax\fP(1).
The portable ASCII format is currently part of the specification for the
-.Xr pax 1
+\fBpax\fP(1)
utility.
-.Sh HISTORY
+.SH HISTORY
The original cpio utility was written by Dick Haight
while working in AT&T's Unix Support Group.
It appeared in 1977 as part of PWB/UNIX 1.0, the
-.Dq Programmer's Work Bench
+``Programmer's Work Bench''
derived from
-.At v6
+At v6
that was used internally at AT&T.
Both the old binary and old character formats were in use
by 1980, according to the System III source released
by SCO under their
-.Dq Ancient Unix
+``Ancient Unix''
license.
The character format was adopted as part of
-.St -p1003.1-88 .
-XXX when did "newc" appear? Who invented it? When did HP come out with their variant? When did Sun introduce ACLs and extended attributes? XXX \ No newline at end of file
+IEEE Std 1003.1-1988 (``POSIX.1'').
+XXX when did "newc" appear? Who invented it? When did HP come out with their variant? When did Sun introduce ACLs and extended attributes? XXX
diff --git a/archivers/libarchive/files/doc/man/libarchive-formats.5 b/archivers/libarchive/files/doc/man/libarchive-formats.5
index 0606a5ba1d0..1e88dd2d2ae 100644
--- a/archivers/libarchive/files/doc/man/libarchive-formats.5
+++ b/archivers/libarchive/files/doc/man/libarchive-formats.5
@@ -1,44 +1,15 @@
-.\" Copyright (c) 2003-2007 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: src/lib/libarchive/libarchive-formats.5,v 1.14 2007/04/05 05:07:53 kientzle Exp $
-.\"
-.Dd April 27, 2004
-.Dt libarchive-formats 3
-.Os
-.Sh NAME
-.Nm libarchive-formats
-.Nd archive formats supported by the libarchive library
-.Sh DESCRIPTION
+.TH libarchive-formats 3 "April 27, 2004" ""
+.SH NAME
+\fBlibarchive-formats\fP
+\- archive formats supported by the libarchive library
+.SH DESCRIPTION
The
-.Xr libarchive 3
+\fBlibarchive\fP(3)
library reads and writes a variety of streaming archive formats.
Generally speaking, all of these archive formats consist of a series of
-.Dq entries .
+``entries''.
Each entry stores a single file system object, such as a file, directory,
or symbolic link.
-.Pp
The following provides a brief description of each format supported
by libarchive, with some information about recognized extensions or
limitations of the current library support.
@@ -46,16 +17,15 @@ Note that just because a format is supported by libarchive does not
imply that a program that uses libarchive will support that format.
Applications that use libarchive specify which formats they wish
to support.
-.Ss Tar Formats
+.SS Tar Formats
The
-.Xr libarchive 3
+\fBlibarchive\fP(3)
library can read most tar archives.
However, it only writes POSIX-standard
-.Dq ustar
+``ustar''
and
-.Dq pax interchange
+``pax interchange''
formats.
-.Pp
All tar formats store each entry in one or more 512-byte records.
The first record is used for file metadata, including filename,
timestamp, and mode information, and the file data is stored in
@@ -64,11 +34,10 @@ Later variants have extended this by either appropriating undefined
areas of the header record, extending the header to multiple records,
or by storing special entries that modify the interpretation of
subsequent entries.
-.Pp
-.Bl -tag -width indent
-.It Cm gnutar
+.TP
+\fBgnutar\fP
The
-.Xr libarchive 3
+\fBlibarchive\fP(3)
library can read GNU-format tar archives.
It currently supports the most popular GNU extensions, including
modern long filename and linkname support, as well as atime and ctime data.
@@ -76,9 +45,10 @@ The libarchive library does not support multi-volume
archives, nor the old GNU long filename format.
It can read GNU sparse file entries, including the new POSIX-based
formats, but cannot write GNU sparse file entries.
-.It Cm pax
+.TP
+\fBpax\fP
The
-.Xr libarchive 3
+\fBlibarchive\fP(3)
library can read and write POSIX-compliant pax interchange format
archives.
Pax interchange format archives are an extension of the older ustar
@@ -92,11 +62,12 @@ Keywords defined in the standard are in all lowercase; vendors are allowed
to define custom keys by preceding them with the vendor name in all uppercase.
When writing pax archives, libarchive uses many of the SCHILY keys
defined by Joerg Schilling's
-.Dq star
+``star''
archiver.
The libarchive library can read most of the SCHILY keys.
It silently ignores any keywords that it does not understand.
-.It Cm restricted pax
+.TP
+\fBrestricted\fP pax
The libarchive library can also write pax archives in which it
attempts to suppress the extended attributes entry whenever
possible.
@@ -110,49 +81,45 @@ can read POSIX-compliant pax interchange format archives.
Programs that correctly read ustar format (see below) will also be
able to read this format; any extended attributes will be extracted as
separate files stored in
-.Pa PaxHeader
+\fIPaxHeader\fP
directories.
-.It Cm ustar
+.TP
+\fBustar\fP
The libarchive library can both read and write this format.
This format has the following limitations:
-.Bl -bullet -compact
-.It
+.IP \(bu
Device major and minor numbers are limited to 21 bits.
Nodes with larger numbers will not be added to the archive.
-.It
+.IP \(bu
Path names in the archive are limited to 255 bytes.
(Shorter if there is no / character in exactly the right place.)
-.It
+.IP \(bu
Symbolic links and hard links are stored in the archive with
the name of the referenced file.
This name is limited to 100 bytes.
-.It
+.IP \(bu
Extended attributes, file flags, and other extended
security information cannot be stored.
-.It
+.IP \(bu
Archive entries are limited to 2 gigabytes in size.
-.El
Note that the pax interchange format has none of these restrictions.
-.El
-.Pp
The libarchive library can also read a variety of commonly-used extensions to
the basic tar format.
In particular, it supports base-256 values in certain numeric fields.
This essentially removes the limitations on file size, modification time,
and device numbers.
-.Pp
The first tar program appeared in Seventh Edition Unix in 1979.
The first official standard for the tar file format was the
-.Dq ustar
+``ustar''
(Unix Standard Tar) format defined by POSIX in 1988.
POSIX.1-2001 extended the ustar format to create the
-.Dq pax interchange
+``pax interchange''
format.
-.Ss Cpio Formats
+.SS Cpio Formats
The libarchive library can read a number of common cpio variants and can write
-.Dq odc
+``odc''
and
-.Dq newc
+``newc''
format archives.
A cpio archive stores each entry as a fixed-size header followed
by a variable-length filename and variable-length data.
@@ -161,20 +128,22 @@ There are a variety of cpio formats, which differ primarily in
how they store the initial header: some store the values as
octal or hexadecimal numbers in ASCII, others as binary values of
varying byte order and length.
-.Bl -tag -width indent
-.It Cm binary
+.TP
+\fBbinary\fP
The libarchive library can read both big-endian and little-endian
variants of the original binary cpio format.
This format used 32-bit binary values for file size and mtime,
and 16-bit binary values for the other fields.
-.It Cm odc
+.TP
+\fBodc\fP
The libarchive library can both read and write this
POSIX-standard format.
This format stores the header contents as octal values in ASCII.
It is standard, portable, and immune from byte-order confusion.
File sizes and mtime are limited to 33 bits (8GB file size),
other fields are limited to 18 bits.
-.It Cm SVR4
+.TP
+\fBSVR4\fP
The libarchive library can read both CRC and non-CRC variants of
this format.
The SVR4 format uses eight-digit hexadecimal values for
@@ -183,8 +152,6 @@ This limits file size to 4GB, and also limits the mtime and
other fields to 32 bits.
The SVR4 format can optionally include a CRC of the file
contents, although libarchive does not currently verify this CRC.
-.El
-.Pp
Cpio first appeared in PWB/UNIX 1.0, which was released within
AT&T in 1977.
PWB/UNIX 1.0 formed the basis of System III Unix, released outside
@@ -194,9 +161,9 @@ in Version 7 AT&T Unix.
As a result, the tar command became much better known in universities
and research groups that used Version 7.
The combination of the
-.Nm find
+\fBfind\fP
and
-.Nm cpio
+\fBcpio\fP
utilities provided very precise control over file selection.
Unfortunately, the format has many limitations that make it unsuitable
for widespread use.
@@ -205,68 +172,68 @@ limit for most other fields makes it unsuitable for modern systems.
In addition, cpio formats only store numeric UID/GID values (not
usernames and group names), which can make it very difficult to correctly
transfer archives across systems with dissimilar user numbering.
-.Ss Shar Formats
+.SS Shar Formats
A
-.Dq shell archive
+``shell archive''
is a shell script that, when executed on a POSIX-compliant
system, will recreate a collection of file system objects.
The libarchive library can write two different kinds of shar archives:
-.Bl -tag -width indent
-.It Cm shar
+.TP
+\fBshar\fP
The traditional shar format uses a limited set of POSIX
commands, including
-.Xr echo 1 ,
-.Xr mkdir 1 ,
+\fBecho\fP(1),
+\fBmkdir\fP(1),
and
-.Xr sed 1 .
+\fBsed\fP(1).
It is suitable for portably archiving small collections of plain text files.
However, it is not generally well-suited for large archives
(many implementations of
-.Xr sh 1
+\fBsh\fP(1)
have limits on the size of a script) nor should it be used with non-text files.
-.It Cm shardump
+.TP
+\fBshardump\fP
This format is similar to shar but encodes files using
-.Xr uuencode 1
+\fBuuencode\fP(1)
so that the result will be a plain text file regardless of the file contents.
It also includes additional shell commands that attempt to reproduce as
many file attributes as possible, including owner, mode, and flags.
The additional commands used to restore file attributes make
shardump archives less portable than plain shar archives.
-.El
-.Ss ISO9660 format
+.SS ISO9660 format
Libarchive can read and extract from files containing ISO9660-compliant
CDROM images.
It also has partial support for Rockridge extensions.
In many cases, this can remove the need to burn a physical CDROM.
It also avoids security and complexity issues that come with
virtual mounts and loopback devices.
-.Ss Zip format
+.SS Zip format
Libarchive can extract from most zip format archives.
It currently only supports uncompressed entries and entries
compressed with the
-.Dq deflate
+``deflate''
algorithm.
Older zip compression algorithms are not supported.
-.Ss Archive (library) file format
+.SS Archive (library) file format
The Unix archive format (commonly created by the
-.Xr ar 1
+\fBar\fP(1)
archiver) is a general-purpose format which is
used almost exclusively for object files to be
read by the link editor
-.Xr ld 1 .
+\fBld\fP(1).
The ar format has never been standardised.
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.
-.Sh SEE ALSO
-.Xr ar 1 ,
-.Xr cpio 1 ,
-.Xr mkisofs 1 ,
-.Xr shar 1 ,
-.Xr tar 1 ,
-.Xr zip 1 ,
-.Xr zlib 3 ,
-.Xr cpio 5 ,
-.Xr mtree 5 ,
-.Xr tar 5
+.SH SEE ALSO
+\fBar\fP(1),
+\fBcpio\fP(1),
+\fBmkisofs\fP(1),
+\fBshar\fP(1),
+\fBtar\fP(1),
+\fBzip\fP(1),
+\fBzlib\fP(3),
+\fBcpio\fP(5),
+\fBmtree\fP(5),
+\fBtar\fP(5)
diff --git a/archivers/libarchive/files/doc/man/libarchive.3 b/archivers/libarchive/files/doc/man/libarchive.3
index 8c19d008a90..722b765e78e 100644
--- a/archivers/libarchive/files/doc/man/libarchive.3
+++ b/archivers/libarchive/files/doc/man/libarchive.3
@@ -1,129 +1,111 @@
-.\" Copyright (c) 2003-2007 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: src/lib/libarchive/libarchive.3,v 1.11 2007/01/09 08:05:56 kientzle Exp $
-.\"
-.Dd August 19, 2006
-.Dt LIBARCHIVE 3
-.Os
-.Sh NAME
-.Nm libarchive
-.Nd functions for reading and writing streaming archives
-.Sh LIBRARY
-.Lb libarchive
-.Sh OVERVIEW
+.TH LIBARCHIVE 3 "August 19, 2006" ""
+.SH NAME
+\fBlibarchive\fP
+\- functions for reading and writing streaming archives
+.SH LIBRARY
+Lb libarchive
+.SH OVERVIEW
The
-.Nm
+\fBlibarchive\fP
library provides a flexible interface for reading and writing
streaming archive files such as tar and cpio.
The library is inherently stream-oriented; readers serially iterate through
the archive, writers serially add things to the archive.
In particular, note that there is no built-in support for
random access nor for in-place modification.
-.Pp
When reading an archive, the library automatically detects the
format and the compression.
The library currently has read support for:
-.Bl -bullet -compact
-.It
+.IP \(bu
old-style tar archives,
-.It
+.IP \(bu
most variants of the POSIX
-.Dq ustar
+``ustar''
format,
-.It
+.IP \(bu
the POSIX
-.Dq pax interchange
+``pax interchange''
format,
-.It
+.IP \(bu
GNU-format tar archives,
-.It
+.IP \(bu
most common cpio archive formats,
-.It
+.IP \(bu
ISO9660 CD images (with or without RockRidge extensions),
-.It
+.IP \(bu
Zip archives.
-.El
The library automatically detects archives compressed with
-.Xr gzip 1 ,
-.Xr bzip2 1 ,
+\fBgzip\fP(1),
+\fBbzip2\fP(1),
or
-.Xr compress 1
+\fBcompress\fP(1)
and decompresses them transparently.
-.Pp
When writing an archive, you can specify the compression
to be used and the format to use.
The library can write
-.Bl -bullet -compact
-.It
+.IP \(bu
POSIX-standard
-.Dq ustar
+``ustar''
archives,
-.It
+.IP \(bu
POSIX
-.Dq pax interchange format
+``pax interchange format''
archives,
-.It
+.IP \(bu
POSIX octet-oriented cpio archives,
-.It
+.IP \(bu
two different variants of shar archives.
-.El
Pax interchange format is an extension of the tar archive format that
eliminates essentially all of the limitations of historic tar formats
in a standard fashion that is supported
by POSIX-compliant
-.Xr pax 1
+\fBpax\fP(1)
implementations on many systems as well as several newer implementations of
-.Xr tar 1 .
+\fBtar\fP(1).
Note that the default write format will suppress the pax extended
attributes for most entries; explicitly requesting pax format will
enable those attributes for all entries.
-.Pp
The read and write APIs are accessed through the
-.Fn archive_read_XXX
+.nh
+\fBarchive_read_XXX\fP
+.hy
+();
functions and the
-.Fn archive_write_XXX
+.nh
+\fBarchive_write_XXX\fP
+.hy
+();
functions, respectively, and either can be used independently
of the other.
-.Pp
The rest of this manual page provides an overview of the library
operation.
More detailed information can be found in the individual manual
pages for each API or utility function.
-.Sh READING AN ARCHIVE
+.SH READING AN ARCHIVE
To read an archive, you must first obtain an initialized
-.Tn struct archive
+Tn struct archive
object from
-.Fn archive_read_new .
+.nh
+\fBarchive_read_new\fP
+.hy
+(.);
You can then modify this object for the desired operations with the
various
-.Fn archive_read_set_XXX
+.nh
+\fBarchive_read_set_XXX\fP
+.hy
+();
and
-.Fn archive_read_support_XXX
+.nh
+\fBarchive_read_support_XXX\fP
+.hy
+();
functions.
In particular, you will need to invoke appropriate
-.Fn archive_read_support_XXX
+.nh
+\fBarchive_read_support_XXX\fP
+.hy
+();
functions to enable the corresponding compression and format
support.
Note that these latter functions perform two distinct operations:
@@ -131,201 +113,267 @@ they cause the corresponding support code to be linked into your
program, and they enable the corresponding auto-detect code.
Unless you have specific constraints, you will generally want
to invoke
-.Fn archive_read_support_compression_all
+.nh
+\fBarchive_read_support_compression_all\fP
+.hy
+();
and
-.Fn archive_read_support_format_all
+.nh
+\fBarchive_read_support_format_all\fP
+.hy
+();
to enable auto-detect for all formats and compression types
currently supported by the library.
-.Pp
Once you have prepared the
-.Tn struct archive
+Tn struct archive
object, you call
-.Fn archive_read_open
+.nh
+\fBarchive_read_open\fP
+.hy
+();
to actually open the archive and prepare it for reading.
There are several variants of this function;
the most basic expects you to provide pointers to several
functions that can provide blocks of bytes from the archive.
There are convenience forms that allow you to
specify a filename, file descriptor,
-.Ft "FILE *"
+\fI"FILE *"\fP
+.RE
object, or a block of memory from which to read the archive data.
Note that the core library makes no assumptions about the
size of the blocks read;
callback functions are free to read whatever block size is
most appropriate for the medium.
-.Pp
Each archive entry consists of a header followed by a certain
amount of data.
You can obtain the next header with
-.Fn archive_read_next_header ,
+.nh
+\fBarchive_read_next_header\fP
+.hy
+(,);
which returns a pointer to an
-.Tn struct archive_entry
+Tn struct archive_entry
structure with information about the current archive element.
If the entry is a regular file, then the header will be followed
by the file data.
You can use
-.Fn archive_read_data
+.nh
+\fBarchive_read_data\fP
+.hy
+();
(which works much like the
-.Xr read 2
+\fBread\fP(2)
system call)
to read this data from the archive.
You may prefer to use the higher-level
-.Fn archive_read_data_skip ,
+.nh
+\fBarchive_read_data_skip\fP
+.hy
+(,);
which reads and discards the data for this entry,
-.Fn archive_read_data_to_buffer ,
+.nh
+\fBarchive_read_data_to_buffer\fP
+.hy
+(,);
which reads the data into an in-memory buffer,
-.Fn archive_read_data_to_file ,
+.nh
+\fBarchive_read_data_to_file\fP
+.hy
+(,);
which copies the data to the provided file descriptor, or
-.Fn archive_read_extract ,
+.nh
+\fBarchive_read_extract\fP
+.hy
+(,);
which recreates the specified entry on disk and copies data
from the archive.
In particular, note that
-.Fn archive_read_extract
+.nh
+\fBarchive_read_extract\fP
+.hy
+();
uses the
-.Tn struct archive_entry
+Tn struct archive_entry
structure that you provide it, which may differ from the
entry just read from the archive.
In particular, many applications will want to override the
pathname, file permissions, or ownership.
-.Pp
Once you have finished reading data from the archive, you
should call
-.Fn archive_read_close
+.nh
+\fBarchive_read_close\fP
+.hy
+();
to close the archive, then call
-.Fn archive_read_finish
+.nh
+\fBarchive_read_finish\fP
+.hy
+();
to release all resources, including all memory allocated by the library.
-.Pp
The
-.Xr archive_read 3
+\fBarchive_read\fP(3)
manual page provides more detailed calling information for this API.
-.Sh WRITING AN ARCHIVE
+.SH WRITING AN ARCHIVE
You use a similar process to write an archive.
The
-.Fn archive_write_new
+.nh
+\fBarchive_write_new\fP
+.hy
+();
function creates an archive object useful for writing,
the various
-.Fn archive_write_set_XXX
+.nh
+\fBarchive_write_set_XXX\fP
+.hy
+();
functions are used to set parameters for writing the archive, and
-.Fn archive_write_open
+.nh
+\fBarchive_write_open\fP
+.hy
+();
completes the setup and opens the archive for writing.
-.Pp
Individual archive entries are written in a three-step
process:
You first initialize a
-.Tn struct archive_entry
+Tn struct archive_entry
structure with information about the new entry.
At a minimum, you should set the pathname of the
entry and provide a
-.Va struct stat
+\fIstruct\fP stat
with a valid
-.Va st_mode
+\fIst_mode\fP
field, which specifies the type of object and
-.Va st_size
+\fIst_size\fP
field, which specifies the size of the data portion of the object.
The
-.Fn archive_write_header
+.nh
+\fBarchive_write_header\fP
+.hy
+();
function actually writes the header data to the archive.
You can then use
-.Fn archive_write_data
+.nh
+\fBarchive_write_data\fP
+.hy
+();
to write the actual data.
-.Pp
After all entries have been written, use the
-.Fn archive_write_finish
+.nh
+\fBarchive_write_finish\fP
+.hy
+();
function to release all resources.
-.Pp
The
-.Xr archive_write 3
+\fBarchive_write\fP(3)
manual page provides more detailed calling information for this API.
-.Sh DESCRIPTION
+.SH DESCRIPTION
Detailed descriptions of each function are provided by the
corresponding manual pages.
-.Pp
All of the functions utilize an opaque
-.Tn struct archive
+Tn struct archive
datatype that provides access to the archive contents.
-.Pp
The
-.Tn struct archive_entry
+Tn struct archive_entry
structure contains a complete description of a single archive
entry.
It uses an opaque interface that is fully documented in
-.Xr archive_entry 3 .
-.Pp
+\fBarchive_entry\fP(3).
Users familiar with historic formats should be aware that the newer
variants have eliminated most restrictions on the length of textual fields.
Clients should not assume that filenames, link names, user names, or
group names are limited in length.
In particular, pax interchange format can easily accommodate pathnames
in arbitrary character sets that exceed
-.Va PATH_MAX .
-.Sh RETURN VALUES
+\fIPATH_MAX\fP.
+.SH RETURN VALUES
Most functions return zero on success, non-zero on error.
The return value indicates the general severity of the error, ranging
from
-.Cm ARCHIVE_WARN ,
+\fBARCHIVE_WARN\fP,
which indicates a minor problem that should probably be reported
to the user, to
-.Cm ARCHIVE_FATAL ,
+\fBARCHIVE_FATAL\fP,
which indicates a serious problem that will prevent any further
operations on this archive.
On error, the
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
function can be used to retrieve a numeric error code (see
-.Xr errno 2 ) .
+\fBerrno\fP(2)).
The
-.Fn archive_error_string
+.nh
+\fBarchive_error_string\fP
+.hy
+();
returns a textual error message suitable for display.
-.Pp
-.Fn archive_read_new
+.nh
+\fBarchive_read_new\fP
+.hy
+();
and
-.Fn archive_write_new
+.nh
+\fBarchive_write_new\fP
+.hy
+();
return pointers to an allocated and initialized
-.Tn struct archive
+Tn struct archive
object.
-.Pp
-.Fn archive_read_data
+.nh
+\fBarchive_read_data\fP
+.hy
+();
and
-.Fn archive_write_data
+.nh
+\fBarchive_write_data\fP
+.hy
+();
return a count of the number of bytes actually read or written.
A value of zero indicates the end of the data for this entry.
A negative value indicates an error, in which case the
-.Fn archive_errno
+.nh
+\fBarchive_errno\fP
+.hy
+();
and
-.Fn archive_error_string
+.nh
+\fBarchive_error_string\fP
+.hy
+();
functions can be used to obtain more information.
-.Sh ENVIRONMENT
+.SH ENVIRONMENT
There are character set conversions within the
-.Xr archive_entry 3
+\fBarchive_entry\fP(3)
functions that are impacted by the currently-selected locale.
-.Sh SEE ALSO
-.Xr tar 1 ,
-.Xr archive_entry 3 ,
-.Xr archive_read 3 ,
-.Xr archive_util 3 ,
-.Xr archive_write 3 ,
-.Xr tar 5
-.Sh HISTORY
+.SH SEE ALSO
+\fBtar\fP(1),
+\fBarchive_entry\fP(3),
+\fBarchive_read\fP(3),
+\fBarchive_util\fP(3),
+\fBarchive_write\fP(3),
+\fBtar\fP(5)
+.SH HISTORY
The
-.Nm libarchive
+\fBlibarchive\fP
library first appeared in
-.Fx 5.3 .
-.Sh AUTHORS
-.An -nosplit
+FreeBSD 5.3.
+.SH AUTHORS
+-nosplit
The
-.Nm libarchive
+\fBlibarchive\fP
library was written by
-.An Tim Kientzle Aq kientzle@acm.org .
-.Sh BUGS
+Tim Kientzle <kientzle@acm.org.>
+.SH BUGS
Some archive formats support information that is not supported by
-.Tn struct archive_entry .
+Tn struct archive_entry.
Such information cannot be fully archived or restored using this library.
This includes, for example, comments, character sets,
or the arbitrary key/value pairs that can appear in
pax interchange format archives.
-.Pp
Conversely, of course, not all of the information that can be
stored in an
-.Tn struct archive_entry
+Tn struct archive_entry
is supported by all formats.
For example, cpio formats do not support nanosecond timestamps;
old tar formats do not support large device numbers.
diff --git a/archivers/libarchive/files/doc/man/libarchive_internals.3 b/archivers/libarchive/files/doc/man/libarchive_internals.3
index a84c9406d34..fae95d8aebf 100644
--- a/archivers/libarchive/files/doc/man/libarchive_internals.3
+++ b/archivers/libarchive/files/doc/man/libarchive_internals.3
@@ -1,91 +1,61 @@
-.\" Copyright (c) 2003-2007 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: src/lib/libarchive/libarchive_internals.3,v 1.1 2007/05/29 01:00:20 kientzle Exp $
-.\"
-.Dd April 16, 2007
-.Dt LIBARCHIVE 3
-.Os
-.Sh NAME
-.Nm libarchive_internals
-.Nd description of libarchive internal interfaces
-.Sh OVERVIEW
+.TH LIBARCHIVE 3 "April 16, 2007" ""
+.SH NAME
+\fBlibarchive_internals\fP
+\- description of libarchive internal interfaces
+.SH OVERVIEW
The
-.Nm libarchive
+\fBlibarchive\fP
library provides a flexible interface for reading and writing
streaming archive files such as tar and cpio.
Internally, it follows a modular layered design that should
make it easy to add new archive and compression formats.
-.Sh GENERAL ARCHITECTURE
+.SH GENERAL ARCHITECTURE
Externally, libarchive exposes most operations through an
opaque, object-style interface.
The
-.Xr archive_entry 1
+\fBarchive_entry\fP(1)
objects store information about a single filesystem object.
The rest of the library provides facilities to write
-.Xr archive_entry 1
+\fBarchive_entry\fP(1)
objects to archive files,
read them from archive files,
and write them to disk.
(There are plans to add a facility to read
-.Xr archive_entry 1
+\fBarchive_entry\fP(1)
objects from disk as well.)
-.Pp
The read and write APIs each have four layers: a public API
layer, a format layer that understands the archive file format,
a compression layer, and an I/O layer.
The I/O layer is completely exposed to clients who can replace
it entirely with their own functions.
-.Pp
In order to provide as much consistency as possible for clients,
some public functions are virtualized.
Eventually, it should be possible for clients to open
an archive or disk writer, and then use a single set of
code to select and write entries, regardless of the target.
-.Sh READ ARCHITECTURE
+.SH READ ARCHITECTURE
From the outside, clients use the
-.Xr archive_read 3
+\fBarchive_read\fP(3)
API to manipulate an
-.Nm archive
+\fBarchive\fP
object to read entries and bodies from an archive stream.
Internally, the
-.Nm archive
+\fBarchive\fP
object is cast to an
-.Nm archive_read
+\fBarchive_read\fP
object, which holds all read-specific data.
The API has four layers:
The lowest layer is the I/O layer.
This layer can be overridden by clients, but most clients use
the packaged I/O callbacks provided, for example, by
-.Xr archive_read_open_memory 3 ,
+\fBarchive_read_open_memory\fP(3),
and
-.Xr archive_read_open_fd 3 .
+\fBarchive_read_open_fd\fP(3).
The compression layer calls the I/O layer to
read bytes and decompresses them for the format layer.
The format layer unpacks a stream of uncompressed bytes and
creates
-.Nm archive_entry
+\fBarchive_entry\fP
objects from the incoming data.
The API layer tracks overall state
(for example, it prevents clients from reading data before reading a header)
@@ -99,34 +69,31 @@ Similarly, the format handlers are polled to see which handler
is the best for each archive.
(Prior to 2.4.0, the format bidders were invoked for each
entry, but this design hindered error recovery.)
-.Ss I/O Layer and Client Callbacks
+.SS I/O Layer and Client Callbacks
The read API goes to some lengths to be nice to clients.
As a result, there are few restrictions on the behavior of
the client callbacks.
-.Pp
The client read callback is expected to provide a block
of data on each call.
A zero-length return does indicate end of file, but otherwise
blocks may be as small as one byte or as large as the entire file.
In particular, blocks may be of different sizes.
-.Pp
The client skip callback returns the number of bytes actually
skipped, which may be much smaller than the skip requested.
The only requirement is that the skip not be larger.
In particular, clients are allowed to return zero for any
skip that they don't want to handle.
The skip callback must never be invoked with a negative value.
-.Pp
Keep in mind that not all clients are reading from disk:
clients reading from networks may provide different-sized
blocks on every request and cannot skip at all;
advanced clients may use
-.Xr mmap 2
+\fBmmap\fP(2)
to read the entire file into memory at once and return the
entire file to libarchive as a single block;
other clients may begin asynchronous I/O operations for the
next block on each request.
-.Ss Decompresssion Layer
+.SS Decompresssion Layer
The decompression layer not only handles decompression,
it also buffers data so that the format handlers see a
much nicer I/O model.
@@ -137,49 +104,61 @@ that much data.
If more data is immediately available, it should return more:
the format layer handles bulk data reads by asking for a minimum
of one byte and then copying as much data as is available.
-.Pp
A subsequent call to the
-.Fn consume
+.nh
+\fBconsume\fP
+.hy
+();
function advances the read pointer.
Note that data returned from a
-.Fn read_ahead
+.nh
+\fBread_ahead\fP
+.hy
+();
call is guaranteed to remain in place until
the next call to
-.Fn read_ahead .
+.nh
+\fBread_ahead\fP
+.hy
+(.);
Intervening calls to
-.Fn consume
+.nh
+\fBconsume\fP
+.hy
+();
should not cause the data to move.
-.Pp
Skip requests must always be handled exactly.
Decompression handlers that cannot seek forward should
not register a skip handler;
the API layer fills in a generic skip handler that reads and discards data.
-.Pp
A decompression handler has a specific lifecycle:
-.Bl -tag -compact -width indent
-.It Registration/Configuration
+.TP
+Registration/Configuration
When the client invokes the public support function,
the decompression handler invokes the internal
-.Fn __archive_read_register_compression
+.nh
+\fB__archive_read_register_compression\fP
+.hy
+();
function to provide bid and initialization functions.
This function returns
-.Cm NULL
+\fBNULL\fP
on error or else a pointer to a
-.Cm struct decompressor_t .
+\fBstruct\fP decompressor_t.
This structure contains a
-.Va void * config
+\fIvoid\fP * config
slot that can be used for storing any customization information.
-.It Bid
+.TP
+Bid
The bid function is invoked with a pointer and size of a block of data.
The decompressor can access its config data
through the
-.Va decompressor
+\fIdecompressor\fP
element of the
-.Cm archive_read
+\fBarchive_read\fP
object.
The bid function is otherwise stateless.
In particular, it must not perform any I/O operations.
-.Pp
The value returned by the bid function indicates its suitability
for handling this data stream.
A bid of zero will ensure that this decompressor is never invoked.
@@ -191,18 +170,19 @@ byte, bid 19.
Note that the initial block may be very short;
be careful to only inspect the data you are given.
(The current decompressors require two bytes for correct bidding.)
-.It Initialize
+.TP
+Initialize
The winning bidder will have its init function called.
This function should initialize the remaining slots of the
-.Va struct decompressor_t
+\fIstruct\fP decompressor_t
object pointed to by the
-.Va decompressor
+\fIdecompressor\fP
element of the
-.Va archive_read
+\fIarchive_read\fP
object.
In particular, it should allocate any working data it needs
in the
-.Va data
+\fIdata\fP
slot of that structure.
The init function is called with the block of data that
was used for tasting.
@@ -210,34 +190,42 @@ At this point, the decompressor is responsible for all I/O
requests to the client callbacks.
The decompressor is free to read more data as and when
necessary.
-.It Satisfy I/O requests
+.TP
+Satisfy I/O requests
The format handler will invoke the
-.Va read_ahead ,
-.Va consume ,
+\fIread_ahead\fP,
+\fIconsume\fP,
and
-.Va skip
+\fIskip\fP
functions as needed.
-.It Finish
+.TP
+Finish
The finish method is called only once when the archive is closed.
It should release anything stored in the
-.Va data
+\fIdata\fP
and
-.Va config
+\fIconfig\fP
slots of the
-.Va decompressor
+\fIdecompressor\fP
object.
It should not invoke the client close callback.
-.El
-.Ss Format Layer
+.SS Format Layer
The read formats have a similar lifecycle to the decompression handlers:
-.Bl -tag -compact -width indent
-.It Registration
+.TP
+Registration
Allocate your private data and initialize your pointers.
-.It Bid
+.TP
+Bid
Formats bid by invoking the
-.Fn read_ahead
+.nh
+\fBread_ahead\fP
+.hy
+();
decompression method but not calling the
-.Fn consume
+.nh
+\fBconsume\fP
+.hy
+();
method.
This allows each bidder to look ahead in the input stream.
Bidders should not look further ahead than necessary, as long
@@ -247,7 +235,8 @@ Most formats only require a few hundred bytes of look ahead;
look aheads of a few kilobytes are reasonable.
(The ISO9660 reader sometimes looks ahead by 48k, which
should be considered an upper limit.)
-.It Read header
+.TP
+Read header
The header read is usually the most complex part of any format.
There are a few strategies worth mentioning:
For formats such as tar or cpio, reading and parsing the header is
@@ -258,7 +247,8 @@ memory and store that data, sorted by the location of the file
data.
Subsequent header read requests will skip forward to the
beginning of the file data and return the corresponding header.
-.It Read Data
+.TP
+Read Data
The read data interface supports sparse files; this requires that
each call return a block of data specifying the file offset and
size.
@@ -269,55 +259,59 @@ Generally, you will want to request one byte,
examine the return value to see how much data is available, and
possibly trim that to the amount you can use.
You should invoke consume for each block just before you return it.
-.It Skip All Data
+.TP
+Skip All Data
The skip data call should skip over all file data and trailing padding.
This is called automatically by the API layer just before each
header read.
It is also called in response to the client calling the public
-.Fn data_skip
+.nh
+\fBdata_skip\fP
+.hy
+();
function.
-.It Cleanup
+.TP
+Cleanup
On cleanup, the format should release all of its allocated memory.
-.El
-.Ss API Layer
+.SS API Layer
XXX to do XXX
-.Sh WRITE ARCHITECTURE
+.SH WRITE ARCHITECTURE
The write API has a similar set of four layers:
an API layer, a format layer, a compression layer, and an I/O layer.
The registration here is much simpler because only
one format and one compression can be registered at a time.
-.Ss I/O Layer and Client Callbacks
+.SS I/O Layer and Client Callbacks
XXX To be written XXX
-.Ss Compression Layer
+.SS Compression Layer
XXX To be written XXX
-.Ss Format Layer
+.SS Format Layer
XXX To be written XXX
-.Ss API Layer
+.SS API Layer
XXX To be written XXX
-.Sh WRITE_DISK ARCHITECTURE
+.SH WRITE_DISK ARCHITECTURE
The write_disk API is intended to look just like the write API
to clients.
Since it does not handle multiple formats or compression, it
is not layered internally.
-.Sh GENERAL SERVICES
+.SH GENERAL SERVICES
The
-.Nm archive_read ,
-.Nm archive_write ,
+\fBarchive_read\fP,
+\fBarchive_write\fP,
and
-.Nm archive_write_disk
+\fBarchive_write_disk\fP
objects all contain an initial
-.Nm archive
+\fBarchive\fP
object which provides common support for a set of standard services.
(Recall that ANSI/ISO C90 guarantees that you can cast freely between
a pointer to a structure and a pointer to the first element of that
structure.)
The
-.Nm archive
+\fBarchive\fP
object has a magic value that indicates which API this object
is associated with,
slots for storing error information,
and function pointers for virtualized API functions.
-.Sh MISCELLANEOUS NOTES
+.SH MISCELLANEOUS NOTES
Connecting existing archiving libraries into libarchive is generally
quite difficult.
In particular, many existing libraries strongly assume that you
@@ -325,7 +319,6 @@ are reading from a file; they seek forwards and backwards as necessary
to locate various pieces of information.
In contrast, libarchive never seeks backwards in its input, which
sometimes requires very different approaches.
-.Pp
For example, libarchive's ISO9660 support operates very differently
from most ISO9660 readers.
The libarchive support utilizes a work-queue design that
@@ -337,7 +330,6 @@ items are added to the list.
This design relies heavily on the ISO9660 image being optimized so that
directories always occur earlier on the disk than the files they
describe.
-.Pp
Depending on the specific format, such approaches may not be possible.
The ZIP format specification, for example, allows archivers to store
key information only at the end of the file.
@@ -346,21 +338,21 @@ be read without seeking.
Fortunately, such archives are very rare, and libarchive can read
most ZIP archives, though it cannot always extract as much information
as a dedicated ZIP program.
-.Sh SEE ALSO
-.Xr archive 3 ,
-.Xr archive_entry 3 ,
-.Xr archive_read 3 ,
-.Xr archive_write 3 ,
-.Xr archive_write_disk 3
-.Sh HISTORY
+.SH SEE ALSO
+\fBarchive\fP(3),
+\fBarchive_entry\fP(3),
+\fBarchive_read\fP(3),
+\fBarchive_write\fP(3),
+\fBarchive_write_disk\fP(3)
+.SH HISTORY
The
-.Nm libarchive
+\fBlibarchive\fP
library first appeared in
-.Fx 5.3 .
-.Sh AUTHORS
-.An -nosplit
+FreeBSD 5.3.
+.SH AUTHORS
+-nosplit
The
-.Nm libarchive
+\fBlibarchive\fP
library was written by
-.An Tim Kientzle Aq kientzle@acm.org .
-.Sh BUGS
+Tim Kientzle <kientzle@acm.org.>
+.SH BUGS
diff --git a/archivers/libarchive/files/doc/man/mtree.5 b/archivers/libarchive/files/doc/man/mtree.5
index 613de6a5dae..10ad85b2158 100644
--- a/archivers/libarchive/files/doc/man/mtree.5
+++ b/archivers/libarchive/files/doc/man/mtree.5
@@ -1,51 +1,18 @@
-.\" Copyright (c) 1989, 1990, 1993
-.\" The Regents of the University of California. 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.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
-.\"
-.\" From: @(#)mtree.8 8.2 (Berkeley) 12/11/93
-.\" $FreeBSD$
-.\"
-.Dd August 20, 2007
-.Dt MTREE 5
-.Os
-.Sh NAME
-.Nm mtree
-.Nd format of mtree dir heirarchy files
-.Sh DESCRIPTION
+.TH MTREE 5 "August 20, 2007" ""
+.SH NAME
+\fBmtree\fP
+\- format of mtree dir heirarchy files
+.SH DESCRIPTION
The
-.Nm
+\fBmtree\fP
format is a textual format that describes a collection of filesystem objects.
Such files are typically used to create or verify directory heirarchies.
-.Ss General Format
+.SS General Format
An
-.Nm
+\fBmtree\fP
file consists of a series of lines, each providing information
about a single filesystem object.
Leading whitespace is always ignored.
-.Pp
When encoding file or pathnames, any backslash character or
character outside of the 95 printable ASCII characters must be
encoded as a a backslash followed by three
@@ -53,72 +20,75 @@ octal digits.
When reading mtree files, any appearance of a backslash
followed by three octal digits should be converted into the
corresponding character.
-.Pp
Each line is interpreted independently as one of the following types:
-.Bl -tag -width Cm
-.It Signature
+.TP
+Signature
The first line of any mtree file must begin with
-.Dq #mtree .
+``#mtree''.
If a file contains any full path entries, the first line should
begin with
-.Dq #mtree v2.0 ,
+``#mtree v2.0'',
otherwise, the first line should begin with
-.Dq #mtree v1.0 .
-.It Blank
+``#mtree v1.0''.
+.TP
+Blank
Blank lines are ignored.
-.It Comment
+.TP
+Comment
Lines beginning with
-.Cm #
+\fB#\fP
are ignored.
-.It Special
+.TP
+Special
Lines beginning with
-.Cm /
+\fB/\fP
are special commands that influence
the interpretation of later lines.
-.It Relative
+.TP
+Relative
If the first whitespace-delimited word has no
-.Cm /
+\fB/\fP
characters,
it is the name of a file in the current directory.
Any relative entry that describes a directory changes the
current directory.
-.It dot-dot
+.TP
+dot-dot
As a special case, a relative entry with the filename
-.Pa ..
+\fI\& ..\fP
changes the current directory to the parent directory.
Options on dot-dot entries are always ignored.
-.It Full
+.TP
+Full
If the first whitespace-delimited word has a
-.Cm /
+\fB/\fP
character after
the first character, it is the pathname of a file relative to the
starting directory.
There can be multiple full entries describing the same file.
-.El
-.Pp
Some tools that process
-.Nm
+\fBmtree\fP
files may require that multiple lines describing the same file
occur consecutively.
It is not permitted for the same file to be mentioned using
both a relative and a full file specification.
-.Ss Special commands
+.SS Special commands
Two special commands are currently defined:
-.Bl -tag -width Cm
-.It Cm /set
+.TP
+\fB/set\fP
This command defines default values for one or more keywords.
It is followed on the same line by one or more whitespace-separated
keyword definitions.
These definitions apply to all following files that do not specify
a value for that keyword.
-.It Cm /unset
+.TP
+\fB/unset\fP
This command removes any default value set by a previous
-.Cm /set
+\fB/set\fP
command.
It is followed on the same line by one or more keywords
separated by whitespace.
-.El
-.Ss Keywords
+.SS Keywords
After the filename, a full or relative entry consists of zero
or more whitespace-separated keyword definitions.
Each such definitions consists of a key from the following
@@ -126,145 +96,169 @@ list immediately followed by an '=' sign
and a value.
Software programs reading mtree files should warn about
unrecognized keywords.
-.Pp
Currently supported keywords are as follows:
-.Bl -tag -width Cm
-.It Cm cksum
+.TP
+\fBcksum\fP
The checksum of the file using the default algorithm specified by
the
-.Xr cksum 1
+\fBcksum\fP(1)
utility.
-.It Cm contents
+.TP
+\fBcontents\fP
The full pathname of a file whose contents should be
compared to the contents of this file.
-.It Cm flags
+.TP
+\fBflags\fP
The file flags as a symbolic name.
See
-.Xr chflags 1
+\fBchflags\fP(1)
for information on these names.
If no flags are to be set the string
-.Dq none
+``none''
may be used to override the current default.
-.It Cm ignore
+.TP
+\fBignore\fP
Ignore any file hierarchy below this file.
-.It Cm gid
+.TP
+\fBgid\fP
The file group as a numeric value.
-.It Cm gname
+.TP
+\fBgname\fP
The file group as a symbolic name.
-.It Cm md5
+.TP
+\fBmd5\fP
The MD5 message digest of the file.
-.It Cm md5digest
+.TP
+\fBmd5digest\fP
A synonym for
-.Cm md5 .
-.It Cm sha1
+\fBmd5\fP.
+.TP
+\fBsha1\fP
The
-.Tn FIPS
+Tn FIPS
160-1
-.Pq Dq Tn SHA-1
+(``Tn SHA-1'')
message digest of the file.
-.It Cm sha1digest
+.TP
+\fBsha1digest\fP
A synonym for
-.Cm sha1 .
-.It Cm sha256
+\fBsha1\fP.
+.TP
+\fBsha256\fP
The
-.Tn FIPS
+Tn FIPS
180-2
-.Pq Dq Tn SHA-256
+(``Tn SHA-256'')
message digest of the file.
-.It Cm sha256digest
+.TP
+\fBsha256digest\fP
A synonym for
-.Cm sha256 .
-.It Cm ripemd160digest
+\fBsha256\fP.
+.TP
+\fBripemd160digest\fP
The
-.Tn RIPEMD160
+Tn RIPEMD160
message digest of the file.
-.It Cm rmd160
+.TP
+\fBrmd160\fP
A synonym for
-.Cm ripemd160digest .
-.It Cm rmd160digest
+\fBripemd160digest\fP.
+.TP
+\fBrmd160digest\fP
A synonym for
-.Cm ripemd160digest .
-.It Cm mode
+\fBripemd160digest\fP.
+.TP
+\fBmode\fP
The current file's permissions as a numeric (octal) or symbolic
value.
-.It Cm nlink
+.TP
+\fBnlink\fP
The number of hard links the file is expected to have.
-.It Cm nochange
+.TP
+\fBnochange\fP
Make sure this file or directory exists but otherwise ignore all attributes.
-.It Cm uid
+.TP
+\fBuid\fP
The file owner as a numeric value.
-.It Cm uname
+.TP
+\fBuname\fP
The file owner as a symbolic name.
-.It Cm size
+.TP
+\fBsize\fP
The size, in bytes, of the file.
-.It Cm link
+.TP
+\fBlink\fP
The file the symbolic link is expected to reference.
-.It Cm time
+.TP
+\fBtime\fP
The last modification time of the file.
-.It Cm type
+.TP
+\fBtype\fP
The type of the file; may be set to any one of the following:
-.Pp
-.Bl -tag -width Cm -compact
-.It Cm block
+.TP
+\fBblock\fP
block special device
-.It Cm char
+.TP
+\fBchar\fP
character special device
-.It Cm dir
+.TP
+\fBdir\fP
directory
-.It Cm fifo
+.TP
+\fBfifo\fP
fifo
-.It Cm file
+.TP
+\fBfile\fP
regular file
-.It Cm link
+.TP
+\fBlink\fP
symbolic link
-.It Cm socket
+.TP
+\fBsocket\fP
socket
-.El
-.El
-.Pp
-.Sh SEE ALSO
-.Xr cksum 1 ,
-.Xr find 1 ,
-.Xr mtree 8
-.Sh BUGS
+.SH SEE ALSO
+\fBcksum\fP(1),
+\fBfind\fP(1),
+\fBmtree\fP(8)
+.SH BUGS
The
-.Fx
+FreeBSD
implementation of mtree does not currently support
the
-.Nm
+\fBmtree\fP
2.0
format.
The requirement for a
-.Dq #mtree
+``#mtree''
signature line is new and not yet widely implemented.
-.Sh HISTORY
+.SH HISTORY
The
-.Nm
+\fBmtree\fP
utility appeared in
-.Bx 4.3 Reno .
+Bx 4.3 Reno.
The
-.Tn MD5
+Tn MD5
digest capability was added in
-.Fx 2.1 ,
+FreeBSD 2.1,
in response to the widespread use of programs which can spoof
-.Xr cksum 1 .
+\fBcksum\fP(1).
The
-.Tn SHA-1
+Tn SHA-1
and
-.Tn RIPEMD160
+Tn RIPEMD160
digests were added in
-.Fx 4.0 ,
+FreeBSD 4.0,
as new attacks have demonstrated weaknesses in
-.Tn MD5 .
+Tn MD5.
The
-.Tn SHA-256
+Tn SHA-256
digest was added in
-.Fx 6.0 .
+FreeBSD 6.0.
Support for file flags was added in
-.Fx 4.0 ,
+FreeBSD 4.0,
and mostly comes from
-.Nx .
+NetBSD.
The
-.Dq full
+``full''
entry format was added by
-.Nx .
+NetBSD.
diff --git a/archivers/libarchive/files/doc/man/tar.5 b/archivers/libarchive/files/doc/man/tar.5
index ab39df3338a..3b4414fc4a0 100644
--- a/archivers/libarchive/files/doc/man/tar.5
+++ b/archivers/libarchive/files/doc/man/tar.5
@@ -1,82 +1,52 @@
-.\" Copyright (c) 2003-2007 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: src/lib/libarchive/tar.5,v 1.17 2007/01/09 08:05:56 kientzle Exp $
-.\"
-.Dd May 20, 2004
-.Dt TAR 5
-.Os
-.Sh NAME
-.Nm tar
-.Nd format of tape archive files
-.Sh DESCRIPTION
+.TH TAR 5 "May 20, 2004" ""
+.SH NAME
+\fBtar\fP
+\- format of tape archive files
+.SH DESCRIPTION
The
-.Nm
+\fBtar\fP
archive format collects any number of files, directories, and other
file system objects (symbolic links, device nodes, etc.) into a single
stream of bytes.
The format was originally designed to be used with
tape drives that operate with fixed-size blocks, but is widely used as
a general packaging mechanism.
-.Ss General Format
+.SS General Format
A
-.Nm
+\fBtar\fP
archive consists of a series of 512-byte records.
Each file system object requires a header record which stores basic metadata
(pathname, owner, permissions, etc.) and zero or more records containing any
file data.
The end of the archive is indicated by two records consisting
entirely of zero bytes.
-.Pp
For compatibility with tape drives that use fixed block sizes,
programs that read or write tar files always read or write a fixed
number of records with each I/O operation.
These
-.Dq blocks
+``blocks''
are always a multiple of the record size.
The most common block size\(emand the maximum supported by historic
implementations\(emis 10240 bytes or 20 records.
(Note: the terms
-.Dq block
+``block''
and
-.Dq record
+``record''
here are not entirely standard; this document follows the
convention established by John Gilmore in documenting
-.Nm pdtar . )
-.Ss Old-Style Archive Format
+\fBpdtar\fP.)
+.SS Old-Style Archive Format
The original tar archive format has been extended many times to
include additional information that various implementors found
necessary.
This section describes the variant implemented by the tar command
included in
-.At v7 ,
+At v7,
which is one of the earliest widely-used versions of the tar program.
-.Pp
The header record for an old-style
-.Nm
+\fBtar\fP
archive consists of the following:
-.Bd -literal -offset indent
+.RS
struct header_old_tar {
char name[100];
char mode[8];
@@ -89,34 +59,39 @@ struct header_old_tar {
char linkname[100];
char pad[255];
};
-.Ed
+.RE
All unused bytes in the header record are filled with nulls.
-.Bl -tag -width indent
-.It Va name
+.TP
+\fIname\fP
Pathname, stored as a null-terminated string.
Early tar implementations only stored regular files (including
hardlinks to those files).
One common early convention used a trailing "/" character to indicate
a directory name, allowing directory permissions and owner information
to be archived and restored.
-.It Va mode
+.TP
+\fImode\fP
File mode, stored as an octal number in ASCII.
-.It Va uid , Va gid
+.TP
+\fIuid\fP, \fIgid\fP
User id and group id of owner, as octal numbers in ASCII.
-.It Va size
+.TP
+\fIsize\fP
Size of file, as octal number in ASCII.
For regular files only, this indicates the amount of data
that follows the header.
In particular, this field was ignored by early tar implementations
when extracting hardlinks.
Modern writers should always store a zero length for hardlink entries.
-.It Va mtime
+.TP
+\fImtime\fP
Modification time of file, as an octal number in ASCII.
This indicates the number of seconds since the start of the epoch,
00:00:00 UTC January 1, 1970.
Note that negative values should be avoided
here, as they are handled inconsistently.
-.It Va checksum
+.TP
+\fIchecksum\fP
Header checksum, stored as an octal number in ASCII.
To compute the checksum, set the checksum field to all spaces,
then sum all bytes in the header using unsigned arithmetic.
@@ -127,25 +102,24 @@ for the checksum field, which can cause interoperability problems
when transferring archives between systems.
Modern robust readers compute the checksum both ways and accept the
header if either computation matches.
-.It Va linkflag , Va linkname
+.TP
+\fIlinkflag\fP, \fIlinkname\fP
In order to preserve hardlinks and conserve tape, a file
with multiple links is only written to the archive the first
time it is encountered.
The next time it is encountered, the
-.Va linkflag
+\fIlinkflag\fP
is set to an ASCII
-.Sq 1
+Sq 1
and the
-.Va linkname
+\fIlinkname\fP
field holds the first name under which this file appears.
(Note that regular files have a null value in the
-.Va linkflag
+\fIlinkflag\fP
field.)
-.El
-.Pp
Early tar implementations varied in how they terminated these fields.
The tar command in
-.At v7
+At v7
used the following conventions (this is also documented in early BSD manpages):
the pathname must be null-terminated;
the mode, uid, and gid fields must end in a space and a null byte;
@@ -153,45 +127,43 @@ the size and mtime fields must end in a space;
the checksum is terminated by a null and a space.
Early implementations filled the numeric fields with leading spaces.
This seems to have been common practice until the
-.St -p1003.1-88
+IEEE Std 1003.1-1988 (``POSIX.1'')
standard was released.
For best portability, modern implementations should fill the numeric
fields with leading zeros.
-.Ss Pre-POSIX Archives
+.SS Pre-POSIX Archives
An early draft of
-.St -p1003.1-88
+IEEE Std 1003.1-1988 (``POSIX.1'')
served as the basis for John Gilmore's
-.Nm pdtar
+\fBpdtar\fP
program and many system implementations from the late 1980s
and early 1990s.
These archives generally follow the POSIX ustar
format described below with the following variations:
-.Bl -bullet -compact -width indent
-.It
+.IP \(bu
The magic value is
-.Dq ustar\ \&
+``ustar\ \&''
(note the following space).
The version field contains a space character followed by a null.
-.It
+.IP \(bu
The numeric fields are generally filled with leading spaces
(not leading zeros as recommended in the final standard).
-.It
+.IP \(bu
The prefix field is often not used, limiting pathnames to
the 100 characters of old-style archives.
-.El
-.Ss POSIX ustar Archives
-.St -p1003.1-88
+.SS POSIX ustar Archives
+IEEE Std 1003.1-1988 (``POSIX.1'')
defined a standard tar file format to be read and written
by compliant implementations of
-.Xr tar 1 .
+\fBtar\fP(1).
This format is often called the
-.Dq ustar
+``ustar''
format, after the magic value used
in the header.
(The name is an acronym for
-.Dq Unix Standard TAR . )
+``Unix Standard TAR''.)
It extends the historic format with new fields:
-.Bd -literal -offset indent
+.RS
struct header_posix_ustar {
char name[100];
char mode[8];
@@ -211,32 +183,40 @@ struct header_posix_ustar {
char prefix[155];
char pad[12];
};
-.Ed
-.Bl -tag -width indent
-.It Va typeflag
+.RE
+.TP
+\fItypeflag\fP
Type of entry.
POSIX extended the earlier
-.Va linkflag
+\fIlinkflag\fP
field with several new type values:
-.Bl -tag -width indent -compact
-.It Dq 0
+.TP
+``0''
Regular file.
NULL should be treated as a synonym, for compatibility purposes.
-.It Dq 1
+.TP
+``1''
Hard link.
-.It Dq 2
+.TP
+``2''
Symbolic link.
-.It Dq 3
+.TP
+``3''
Character device node.
-.It Dq 4
+.TP
+``4''
Block device node.
-.It Dq 5
+.TP
+``5''
Directory.
-.It Dq 6
+.TP
+``6''
FIFO node.
-.It Dq 7
+.TP
+``7''
Reserved.
-.It Other
+.TP
+Other
A POSIX-compliant implementation must treat any unrecognized typeflag value
as a regular file.
In particular, writers should ensure that all entries
@@ -244,9 +224,8 @@ have a valid filename so that they can be restored by readers that do not
support the corresponding extension.
Uppercase letters "A" through "Z" are reserved for custom extensions.
Note that sockets and whiteout entries are not archivable.
-.El
It is worth noting that the
-.Va size
+\fIsize\fP
field, in particular, has different meanings depending on the type.
For regular files, of course, it indicates the amount of data
following the header.
@@ -255,86 +234,86 @@ files in the directory, for use by operating systems that pre-allocate
directory space.
For all other types, it should be set to zero by writers and ignored
by readers.
-.It Va magic
+.TP
+\fImagic\fP
Contains the magic value
-.Dq ustar
+``ustar''
followed by a NULL byte to indicate that this is a POSIX standard archive.
Full compliance requires the uname and gname fields be properly set.
-.It Va version
+.TP
+\fIversion\fP
Version.
This should be
-.Dq 00
+``00''
(two copies of the ASCII digit zero) for POSIX standard archives.
-.It Va uname , Va gname
+.TP
+\fIuname\fP, \fIgname\fP
User and group names, as null-terminated ASCII strings.
These should be used in preference to the uid/gid values
when they are set and the corresponding names exist on
the system.
-.It Va devmajor , Va devminor
+.TP
+\fIdevmajor\fP, \fIdevminor\fP
Major and minor numbers for character device or block device entry.
-.It Va prefix
+.TP
+\fIprefix\fP
First part of pathname.
If the pathname is too long to fit in the 100 bytes provided by the standard
format, it can be split at any
-.Pa /
+\fI/\fP
character with the first portion going here.
If the prefix field is not empty, the reader will prepend
the prefix value and a
-.Pa /
+\fI/\fP
character to the regular name field to obtain the full pathname.
-.El
-.Pp
Note that all unused bytes must be set to
-.Dv NULL .
-.Pp
+.BR NULL.
Field termination is specified slightly differently by POSIX
than by previous implementations.
The
-.Va magic ,
-.Va uname ,
+\fImagic\fP,
+\fIuname\fP,
and
-.Va gname
+\fIgname\fP
fields must have a trailing
-.Dv NULL .
+.BR NULL.
The
-.Va pathname ,
-.Va linkname ,
+\fIpathname\fP,
+\fIlinkname\fP,
and
-.Va prefix
+\fIprefix\fP
fields must have a trailing
-.Dv NULL
+.BR NULL
unless they fill the entire field.
(In particular, it is possible to store a 256-character pathname if it
happens to have a
-.Pa /
+\fI/\fP
as the 156th character.)
POSIX requires numeric fields to be zero-padded in the front, and allows
them to be terminated with either space or
-.Dv NULL
+.BR NULL
characters.
-.Pp
Currently, most tar implementations comply with the ustar
format, occasionally extending it by adding new fields to the
blank area at the end of the header record.
-.Ss Pax Interchange Format
+.SS Pax Interchange Format
There are many attributes that cannot be portably stored in a
POSIX ustar archive.
-.St -p1003.1-2001
+IEEE Std 1003.1-2001 (``POSIX.1'')
defined a
-.Dq pax interchange format
+``pax interchange format''
that uses two new types of entries to hold text-formatted
metadata that applies to following entries.
Note that a pax interchange format archive is a ustar archive in every
respect.
The new data is stored in ustar-compatible archive entries that use the
-.Dq x
+``x''
or
-.Dq g
+``g''
typeflag.
In particular, older implementations that do not fully support these
extensions will extract the metadata into regular files, where the
metadata can be examined as necessary.
-.Pp
An entry in a pax interchange format archive consists of one or
two standard ustar entries, each with its own header and data.
The first optional entry stores the extended attributes
@@ -348,39 +327,48 @@ sign, a value string, and a new line.
The decimal number indicates the length of the entire line, including the
initial length field and the trailing newline.
An example of such a field is:
-.Dl 25 ctime=1084839148.1212\en
+.RS
+25 ctime=1084839148.1212\en
+.RE
Keys in all lowercase are standard keys.
Vendors can add their own keys by prefixing them with an all uppercase
vendor name and a period.
Note that, unlike the historic header, numeric values are stored using
decimal, not octal.
A description of some common keys follows:
-.Bl -tag -width indent
-.It Cm atime , Cm ctime , Cm mtime
+.TP
+\fBatime\fP, \fBctime\fP, \fBmtime\fP
File access, inode change, and modification times.
These fields can be negative or include a decimal point and a fractional value.
-.It Cm uname , Cm uid , Cm gname , Cm gid
+.TP
+\fBuname\fP, \fBuid\fP, \fBgname\fP, \fBgid\fP
User name, group name, and numeric UID and GID values.
The user name and group name stored here are encoded in UTF8
and can thus include non-ASCII characters.
The UID and GID fields can be of arbitrary length.
-.It Cm linkpath
+.TP
+\fBlinkpath\fP
The full path of the linked-to file.
Note that this is encoded in UTF8 and can thus include non-ASCII characters.
-.It Cm path
+.TP
+\fBpath\fP
The full pathname of the entry.
Note that this is encoded in UTF8 and can thus include non-ASCII characters.
-.It Cm realtime.* , Cm security.*
+.TP
+\fBrealtime.*\fP, \fBsecurity.*\fP
These keys are reserved and may be used for future standardization.
-.It Cm size
+.TP
+\fBsize\fP
The size of the file.
Note that there is no length limit on this field, allowing conforming
archives to store files much larger than the historic 8GB limit.
-.It Cm SCHILY.*
+.TP
+\fBSCHILY.*\fP
Vendor-specific attributes used by Joerg Schilling's
-.Nm star
+\fBstar\fP
implementation.
-.It Cm SCHILY.acl.access , Cm SCHILY.acl.default
+.TP
+\fBSCHILY.acl.access\fP, \fBSCHILY.acl.default\fP
Stores the access and default ACLs as textual strings in a format
that is an extension of the format specified by POSIX.1e draft 17.
In particular, each user or group access specification can include a fourth
@@ -388,35 +376,37 @@ colon-separated field with the numeric UID or GID.
This allows ACLs to be restored on systems that may not have complete
user or group information available (such as when NIS/YP or LDAP services
are temporarily unavailable).
-.It Cm SCHILY.devminor , Cm SCHILY.devmajor
+.TP
+\fBSCHILY.devminor\fP, \fBSCHILY.devmajor\fP
The full minor and major numbers for device nodes.
-.It Cm SCHILY.dev, Cm SCHILY.ino , Cm SCHILY.nlinks
+.TP
+\fBSCHILY.dev,\fP \fBSCHILY.ino\fP, \fBSCHILY.nlinks\fP
The device number, inode number, and link count for the entry.
In particular, note that a pax interchange format archive using Joerg
Schilling's
-.Cm SCHILY.*
+\fBSCHILY.*\fP
extensions can store all of the data from
-.Va struct stat .
-.It Cm LIBARCHIVE.xattr. Ns Ar namespace Ns . Ns Ar key
+\fIstruct\fP stat.
+.TP
+\fBLIBARCHIVE.xattr.\fP \fInamespace\fP.\fIkey\fP
Libarchive stores POSIX.1e-style extended attributes using
keys of this form.
The
-.Ar key
+\fIkey\fP
value is URL-encoded:
All non-ASCII characters and the two special characters
-.Dq =
+``=''
and
-.Dq %
+``%''
are encoded as
-.Dq %
+``%''
followed by two uppercase hexadecimal digits.
The value of this key is the extended attribute value
encoded in base 64.
XXX Detail the base-64 format here XXX
-.It Cm VENDOR.*
+.TP
+\fBVENDOR.*\fP
XXX document other vendor-specific extensions XXX
-.El
-.Pp
Any values stored in an extended attribute override the corresponding
values in the regular tar header.
Note that compliant readers should ignore the regular fields when they
@@ -429,25 +419,23 @@ All text fields are encoded in UTF8.
Compliant writers should store only portable 7-bit ASCII characters in
the standard ustar header and use extended
attributes whenever a text value contains non-ASCII characters.
-.Pp
In addition to the
-.Cm x
+\fBx\fP
entry described above, the pax interchange format
also supports a
-.Cm g
+\fBg\fP
entry.
The
-.Cm g
+\fBg\fP
entry is identical in format, but specifies attributes that serve as
defaults for all subsequent archive entries.
The
-.Cm g
+\fBg\fP
entry is not widely used.
-.Pp
Besides the new
-.Cm x
+\fBx\fP
and
-.Cm g
+\fBg\fP
entries, the pax interchange format has a few other minor variations
from the earlier ustar format.
The most troubling one is that hardlinks are permitted to have
@@ -456,7 +444,7 @@ This allows readers to restore any hardlink to a file without
having to rewind the archive to find an earlier entry.
However, it creates complications for robust readers, as it is no longer
clear whether or not they should ignore the size field for hardlink entries.
-.Ss GNU Tar Archives
+.SS GNU Tar Archives
The GNU tar program started with a pre-POSIX format similar to that
described earlier and has extended it using several different mechanisms:
It added new fields to the empty space in the header (some of which was later
@@ -464,15 +452,15 @@ used by POSIX for conflicting purposes);
it allowed the header to be continued over multiple records;
and it defined new entries that modify following entries
(similar in principle to the
-.Cm x
+\fBx\fP
entry described above, but each GNU special entry is single-purpose,
unlike the general-purpose
-.Cm x
+\fBx\fP
entry).
As a result, GNU tar archives are not POSIX compatible, although
more lenient POSIX-compliant readers can successfully extract most
GNU tar archives.
-.Bd -literal -offset indent
+.RS
struct header_gnu_tar {
char name[100];
char mode[8];
@@ -502,17 +490,18 @@ struct header_gnu_tar {
char realsize[12];
char pad[17];
};
-.Ed
-.Bl -tag -width indent
-.It Va typeflag
+.RE
+.TP
+\fItypeflag\fP
GNU tar uses the following special entry types, in addition to
those defined by POSIX:
-.Bl -tag -width indent
-.It "7"
+.TP
+"7"
GNU tar treats type "7" records identically to type "0" records,
except on one obscure RTOS where they are used to indicate the
pre-allocation of a contiguous file on disk.
-.It "D"
+.TP
+"D"
This indicates a directory entry.
Unlike the POSIX-standard "5"
typeflag, the header is followed by data records listing the names
@@ -526,16 +515,18 @@ The purpose of this
entry is to support incremental backups; a program restoring from
such an archive may wish to delete files on disk that did not exist
in the directory when the archive was made.
-.Pp
Note that the "D" typeflag specifically violates POSIX, which requires
that unrecognized typeflags be restored as normal files.
In this case, restoring the "D" entry as a file could interfere
with subsequent creation of the like-named directory.
-.It "K"
+.TP
+"K"
The data for this entry is a long linkname for the following regular entry.
-.It "L"
+.TP
+"L"
The data for this entry is a long pathname for the following regular entry.
-.It "M"
+.TP
+"M"
This is a continuation of the last file on the previous volume.
GNU multi-volume archives guarantee that each volume begins with a valid
entry header.
@@ -545,70 +536,77 @@ The "M" typeflag indicates that this entry continues an existing file.
Such entries can only occur as the first or second entry
in an archive (the latter only if the first entry is a volume label).
The
-.Va size
+\fIsize\fP
field specifies the size of this entry.
The
-.Va offset
+\fIoffset\fP
field at bytes 369-380 specifies the offset where this file fragment
begins.
The
-.Va realsize
+\fIrealsize\fP
field specifies the total size of the file (which must equal
-.Va size
+\fIsize\fP
plus
-.Va offset ) .
+\fIoffset\fP).
When extracting, GNU tar checks that the header file name is the one it is
expecting, that the header offset is in the correct sequence, and that
the sum of offset and size is equal to realsize.
FreeBSD's version of GNU tar does not handle the corner case of an
archive's being continued in the middle of a long name or other
extension header.
-.It "N"
+.TP
+"N"
Type "N" records are no longer generated by GNU tar.
They contained a
list of files to be renamed or symlinked after extraction; this was
originally used to support long names.
The contents of this record
are a text description of the operations to be done, in the form
-.Dq Rename %s to %s\en
+``Rename %s to %s\en''
or
-.Dq Symlink %s to %s\en ;
+``Symlink %s to %s\en ;''
in either case, both
filenames are escaped using K&R C syntax.
-.It "S"
+.TP
+"S"
This is a
-.Dq sparse
+``sparse''
regular file.
Sparse files are stored as a series of fragments.
The header contains a list of fragment offset/length pairs.
If more than four such entries are required, the header is
extended as necessary with
-.Dq extra
+``extra''
header extensions (an older format that is no longer used), or
-.Dq sparse
+``sparse''
extensions.
-.It "V"
+.TP
+"V"
The
-.Va name
+\fIname\fP
field should be interpreted as a tape/volume header name.
This entry should generally be ignored on extraction.
-.El
-.It Va magic
+.TP
+\fImagic\fP
The magic field holds the five characters
-.Dq ustar
+``ustar''
followed by a space.
Note that POSIX ustar archives have a trailing null.
-.It Va version
+.TP
+\fIversion\fP
The version field holds a space character followed by a null.
Note that POSIX ustar archives use two copies of the ASCII digit
-.Dq 0 .
-.It Va atime , Va ctime
+``0''.
+.TP
+\fIatime\fP, \fIctime\fP
The time the file was last accessed and the time of
last change of file information, stored in octal as with
-.Va mtime .
-.It Va longnames
+\fImtime\fP.
+.TP
+\fIlongnames\fP
This field is apparently no longer used.
-.It Sparse Va offset / Va numbytes
+.TP
+Sparse \fIoffset\fP / \fInumbytes\fP
Each such structure specifies a single fragment of a sparse
file.
The two fields store values as octal numbers.
@@ -617,13 +615,14 @@ in the archive.
On extraction, the list of fragments is collected from the
header (including any extension headers), and the data
is then read and written to the file at appropriate offsets.
-.It Va isextended
+.TP
+\fIisextended\fP
If this is set to non-zero, the header will be followed by additional
-.Dq sparse header
+``sparse header''
records.
Each such record contains information about as many as 21 additional
sparse blocks as shown here:
-.Bd -literal -offset indent
+.RS
struct gnu_sparse_header {
struct {
char offset[12];
@@ -632,48 +631,45 @@ struct gnu_sparse_header {
char isextended[1];
char padding[7];
};
-.Ed
-.It Va realsize
+.RE
+.TP
+\fIrealsize\fP
A binary representation of the file's complete size, with a much larger range
than the POSIX file size.
In particular, with
-.Cm M
+\fBM\fP
type files, the current entry is only a portion of the file.
In that case, the POSIX size field will indicate the size of this
entry; the
-.Va realsize
+\fIrealsize\fP
field will indicate the total size of the file.
-.El
-.Ss Solaris Tar
+.SS Solaris Tar
XXX More Details Needed XXX
-.Pp
Solaris tar (beginning with SunOS XXX 5.7 ?? XXX) supports an
-.Dq extended
+``extended''
format that is fundamentally similar to pax interchange format,
with the following differences:
-.Bl -bullet -compact -width indent
-.It
+.IP \(bu
Extended attributes are stored in an entry whose type is
-.Cm X ,
+\fBX\fP,
not
-.Cm x ,
+\fBx\fP,
as used by pax interchange format.
The detailed format of this entry appears to be the same
as detailed above for the
-.Cm x
+\fBx\fP
entry.
-.It
+.IP \(bu
An additional
-.Cm A
+\fBA\fP
entry is used to store an ACL for the following regular entry.
The body of this entry contains a seven-digit octal number
(whose value is 01000000 plus the number of ACL entries)
followed by a zero byte, followed by the
textual ACL description.
-.El
-.Ss Other Extensions
+.SS Other Extensions
One common extension, utilized by GNU tar, star, and other newer
-.Nm
+\fBtar\fP
implementations, permits binary numbers in the standard numeric
fields.
This is flagged by setting the high bit of the first character.
@@ -685,46 +681,45 @@ Joerg Schilling's star program supports this extension for
all numeric fields.
Note that this extension is largely obsoleted by the extended attribute
record provided by the pax interchange format.
-.Pp
Another early GNU extension allowed base-64 values rather
than octal.
This extension was short-lived and such archives are almost never seen.
However, there is still code in GNU tar to support them; this code is
responsible for a very cryptic warning message that is sometimes seen when
GNU tar encounters a damaged archive.
-.Sh SEE ALSO
-.Xr ar 1 ,
-.Xr pax 1 ,
-.Xr tar 1
-.Sh STANDARDS
+.SH SEE ALSO
+\fBar\fP(1),
+\fBpax\fP(1),
+\fBtar\fP(1)
+.SH STANDARDS
The
-.Nm tar
+\fBtar\fP
utility is no longer a part of POSIX or the Single Unix Standard.
It last appeared in
-.St -susv2 .
+Version 2 of the Single UNIX Specification (``SUSv2'').
It has been supplanted in subsequent standards by
-.Xr pax 1 .
+\fBpax\fP(1).
The ustar format is currently part of the specification for the
-.Xr pax 1
+\fBpax\fP(1)
utility.
The pax interchange file format is new with
-.St -p1003.1-2001 .
-.Sh HISTORY
+IEEE Std 1003.1-2001 (``POSIX.1'').
+.SH HISTORY
A
-.Nm tar
+\fBtar\fP
command appeared in Seventh Edition Unix, which was released in January, 1979.
It replaced the
-.Nm tp
+\fBtp\fP
program from Fourth Edition Unix which in turn replaced the
-.Nm tap
+\fBtap\fP
program from First Edition Unix.
John Gilmore's
-.Nm pdtar
+\fBpdtar\fP
public-domain implementation (circa 1987) was highly influential
and formed the basis of
-.Nm GNU tar .
+\fBGNU\fP tar.
Joerg Shilling's
-.Nm star
+\fBstar\fP
archiver is another open-source (GPL) archiver (originally developed
circa 1985) which features complete support for pax interchange
format.
diff --git a/archivers/libarchive/files/doc/mdoc2man.awk b/archivers/libarchive/files/doc/mdoc2man.awk
new file mode 100644
index 00000000000..c71e52861c6
--- /dev/null
+++ b/archivers/libarchive/files/doc/mdoc2man.awk
@@ -0,0 +1,328 @@
+#!/usr/bin/awk
+#
+# Copyright (c) 2003 Peter Stuge <stuge-mdoc2man@cdy.org>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+# Dramatically overhauled by Tim Kientzle. This version almost
+# handles library-style pages with Fn, Ft, etc commands. Still
+# a lot of problems...
+
+BEGIN {
+ displaylines = 0
+ trailer = ""
+ out = ""
+ sep = ""
+ nextsep = " "
+}
+
+# Add a word with appropriate preceding whitespace
+# Maintain a short queue of the expected upcoming word separators.
+function add(str) {
+ out=out sep str
+ sep = nextsep
+ nextsep = " "
+}
+
+# Add a word with no following whitespace
+# Use for opening punctuation such as '('
+function addopen(str) {
+ add(str)
+ sep = ""
+}
+
+# Add a word with no preceding whitespace
+# Use for closing punctuation such as ')' or '.'
+function addclose(str) {
+ sep = ""
+ add(str)
+}
+
+# Add a word with no space before or after
+# Use for separating punctuation such as '='
+function addpunct(str) {
+ sep = ""
+ add(str)
+ sep = ""
+}
+
+# Emit the current line so far
+function endline() {
+ addclose(trailer)
+ trailer = ""
+ if(length(out) > 0) {
+ print out
+ out=""
+ }
+ if(displaylines > 0) {
+ displaylines = displaylines - 1
+ if (displaylines == 0)
+ dispend()
+ }
+ # First word on next line has no preceding whitespace
+ sep = ""
+}
+
+function linecmd(cmd) {
+ endline()
+ add(cmd)
+ endline()
+}
+
+function breakline() {
+ linecmd(".br")
+}
+
+# Start an indented display
+function dispstart() {
+ linecmd(".RS")
+}
+
+# End an indented display
+function dispend() {
+ linecmd(".RE")
+}
+
+# Collect rest of input line
+function wtail() {
+ retval=""
+ while(w<nwords) {
+ if(length(retval))
+ retval=retval " "
+ retval=retval words[++w]
+ }
+ return retval
+}
+
+! /^\./ {
+ out = $0
+ endline()
+ next
+}
+
+/^\.\\"/ { next }
+
+{
+ sub("^\\.","")
+ nwords=split($0,words)
+ # TODO: Instead of iterating 'w' over the array, have a separate
+ # function that returns 'next word' and use that. This will allow
+ # proper handling of double-quoted arguments as well.
+ for(w=1;w<=nwords;w++) {
+ if(match(words[w],"^Li$")) { # Literal; rest of line is unformatted
+ dispstart()
+ displaylines = 1
+ } else if(match(words[w],"^Dl$")) { # Display literal
+ dispstart()
+ displaylines = 1
+ } else if(match(words[w],"^Bd$")) { # Begin display
+ if(match(words[w+1],"-literal")) {
+ dispstart()
+ displaylines=10000
+ w=nwords
+ }
+ } else if(match(words[w],"^Ed$")) { # End display
+ displaylines = 0
+ dispend()
+ } else if(match(words[w],"^Ns$")) { # Suppress space after next word
+ nextsep = ""
+ } else if(match(words[w],"^No$")) { # Normal text
+ add(words[++w])
+ } else if(match(words[w],"^Dq$")) { # Quote
+ addopen("``")
+ add(words[++w])
+ while(w<nwords&&!match(words[w+1],"^[\\.,]"))
+ add(words[++w])
+ addclose("''")
+ } else if(match(words[w],"^Oo$")) {
+ addopen("[")
+ } else if(match(words[w],"^Oc$")) {
+ addclose("]")
+ } else if(match(words[w],"^Ao$")) {
+ addopen("<")
+ } else if(match(words[w],"^Ac$")) {
+ addclose(">")
+ } else if(match(words[w],"^Dd$")) {
+ date=wtail()
+ next
+ } else if(match(words[w],"^Dt$")) {
+ id=wtail()
+ next
+ } else if(match(words[w],"^Ox$")) {
+ add("OpenBSD")
+ } else if(match(words[w],"^Fx$")) {
+ add("FreeBSD")
+ } else if(match(words[w],"^Nx$")) {
+ add("NetBSD")
+ } else if(match(words[w],"^St$")) {
+ if (match(words[w+1], "^-p1003.1$")) {
+ w++
+ add("IEEE Std 1003.1 (``POSIX.1'')")
+ } else if(match(words[w+1], "^-p1003.1-96$")) {
+ w++
+ add("ISO/IEC 9945-1:1996 (``POSIX.1'')")
+ } else if(match(words[w+1], "^-p1003.1-88$")) {
+ w++
+ add("IEEE Std 1003.1-1988 (``POSIX.1'')")
+ } else if(match(words[w+1], "^-p1003.1-2001$")) {
+ w++
+ add("IEEE Std 1003.1-2001 (``POSIX.1'')")
+ } else if(match(words[w+1], "^-susv2$")) {
+ w++
+ add("Version 2 of the Single UNIX Specification (``SUSv2'')")
+ }
+ } else if(match(words[w],"^Ex$")) {
+ if (match(words[w+1], "^-std$")) {
+ w++
+ add("The \\fB" name "\\fP utility exits 0 on success, and >0 if an error occurs.")
+ }
+ } else if(match(words[w],"^Os$")) {
+ add(".TH " id " \"" date "\" \"" wtail() "\"")
+ } else if(match(words[w],"^Sh$")) {
+ add(".SH")
+ section=words[w+1]
+ } else if(match(words[w],"^Xr$")) {
+ add("\\fB" words[++w] "\\fP(" words[++w] ")" words[++w])
+ } else if(match(words[w],"^Nm$")) {
+ if(match(section,"SYNOPSIS"))
+ breakline()
+ if(w>1)
+ n=name
+ else {
+ n=words[++w]
+ if(!length(name))
+ name=n
+ }
+ if(!length(n))
+ n=name
+ add("\\fB" n "\\fP")
+ } else if(match(words[w],"^Nd$")) {
+ add("\\- " wtail())
+ } else if(match(words[w],"^Fl$")) {
+ add("\\fB\\-" words[++w] "\\fP")
+ } else if(match(words[w],"^Ar$")) {
+ addopen("\\fI")
+ if(w==nwords)
+ add("file ...\\fP")
+ else {
+ add(words[++w] "\\fP")
+ while(match(words[w+1],"^\\|$"))
+ add(words[++w] " \\fI" words[++w] "\\fP")
+ }
+ } else if(match(words[w],"^Cm$")) {
+ add("\\fB" words[++w] "\\fP")
+ } else if(match(words[w],"^Op$")) {
+ addopen("[")
+ option=1
+ trailer="]" trailer
+ } else if(match(words[w],"^Pp$")) {
+ endline()
+ } else if(match(words[w],"^An$")) {
+ endline()
+ } else if(match(words[w],"^Ss$")) {
+ add(".SS")
+ } else if(match(words[w],"^Ft$")) {
+ addopen("\\fI")
+ trailer = "\\fP" trailer
+ displaylines = 1
+ } else if(match(words[w],"^Fn$")) {
+ # Using '.nh' to suppress hyphenation doesn't really work...
+ # TODO: Fix this.
+ add(".nh")
+ endline()
+ addopen("\\fB")
+ w++
+ add(words[w])
+ addclose("\\fP")
+ endline()
+ add(".hy")
+ endline()
+ addpunct("(")
+ # This is broken; Fn should peek ahead and put each double-quoted
+ # arg in .Ty and be smarter about following punct.
+ trailer = ");" trailer
+ } else if(match(words[w],"^Va$")) {
+ w++
+ add("\\fI" words[w] "\\fP")
+ } else if(match(words[w],"^In$")) {
+ w++
+ add("\\fB#include <" words[w] ">\\fP")
+ breakline()
+ } else if(match(words[w],"^Pa$")) {
+ addopen("\\fI")
+ w++
+ if(match(words[w],"^\\."))
+ add("\\&")
+ add(words[w] "\\fP")
+ } else if(match(words[w],"^Dv$")) {
+ add(".BR")
+ } else if(match(words[w],"^Em|Ev$")) {
+ add(".IR")
+ } else if(match(words[w],"^Pq$")) {
+ addopen("(")
+ trailer=")" trailer
+ } else if(match(words[w],"^Aq$")) {
+ addopen("<")
+ trailer=">" trailer
+ } else if(match(words[w],"^Brq$")) {
+ addopen("{")
+ trailer="}" trailer
+ } else if(match(words[w],"^S[xy]$")) {
+ add(".B " wtail())
+ } else if(match(words[w],"^Ic$")) {
+ add("\\fB")
+ trailer="\\fP" trailer
+ } else if(match(words[w],"^Bl$")) {
+ oldoptlist=optlist
+ if(match(words[w+1],"-bullet"))
+ optlist=1
+ else if(match(words[w+1],"-enum")) {
+ optlist=2
+ enum=0
+ } else if(match(words[w+1],"-tag"))
+ optlist=3
+ else if(match(words[w+1],"-item"))
+ optlist=4
+ else if(match(words[w+1],"-bullet"))
+ optlist=1
+ w=nwords
+ } else if(match(words[w],"^El$")) {
+ optlist=oldoptlist
+ } else if(match(words[w],"^It$")&&optlist) {
+ if(optlist==1)
+ add(".IP \\(bu")
+ else if(optlist==2)
+ add(".IP " ++enum ".")
+ else if(optlist==3) {
+ add(".TP")
+ endline()
+ if(match(words[w+1],"^Pa$|^Ev$")) {
+ add(".B")
+ w++
+ }
+ } else if(optlist==4)
+ add(".IP")
+ } else if(match(words[w],"^[=]$")) {
+ addpunct(words[w])
+ } else if(match(words[w],"^[\[{(]$")) {
+ addopen(words[w])
+ } else if(match(words[w],"^[\\\])}.,;:]$")) {
+ addclose(words[w])
+ } else {
+ add(words[w])
+ }
+ }
+ if(match(out,"^\\.[^a-zA-Z]"))
+ sub("^\\.","",out)
+ endline()
+}
diff --git a/archivers/libarchive/files/doc/text/Makefile b/archivers/libarchive/files/doc/text/Makefile
new file mode 100644
index 00000000000..a70eb1825c6
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/Makefile
@@ -0,0 +1,42 @@
+
+all: archive_entry.3 archive_read.3 archive_util.3 archive_write.3 archive_write_disk.3 cpio.5 libarchive-formats.5 libarchive.3 libarchive_internals.3 mtree.5 tar.5 bsdtar.1 bsdcpio.1
+
+
+archive_entry.3: ../../libarchive/archive_entry.3
+ nroff -mdoc ../../libarchive/archive_entry.3 | col -b > archive_entry.3
+
+archive_read.3: ../../libarchive/archive_read.3
+ nroff -mdoc ../../libarchive/archive_read.3 | col -b > archive_read.3
+
+archive_util.3: ../../libarchive/archive_util.3
+ nroff -mdoc ../../libarchive/archive_util.3 | col -b > archive_util.3
+
+archive_write.3: ../../libarchive/archive_write.3
+ nroff -mdoc ../../libarchive/archive_write.3 | col -b > archive_write.3
+
+archive_write_disk.3: ../../libarchive/archive_write_disk.3
+ nroff -mdoc ../../libarchive/archive_write_disk.3 | col -b > archive_write_disk.3
+
+cpio.5: ../../libarchive/cpio.5
+ nroff -mdoc ../../libarchive/cpio.5 | col -b > cpio.5
+
+libarchive-formats.5: ../../libarchive/libarchive-formats.5
+ nroff -mdoc ../../libarchive/libarchive-formats.5 | col -b > libarchive-formats.5
+
+libarchive.3: ../../libarchive/libarchive.3
+ nroff -mdoc ../../libarchive/libarchive.3 | col -b > libarchive.3
+
+libarchive_internals.3: ../../libarchive/libarchive_internals.3
+ nroff -mdoc ../../libarchive/libarchive_internals.3 | col -b > libarchive_internals.3
+
+mtree.5: ../../libarchive/mtree.5
+ nroff -mdoc ../../libarchive/mtree.5 | col -b > mtree.5
+
+tar.5: ../../libarchive/tar.5
+ nroff -mdoc ../../libarchive/tar.5 | col -b > tar.5
+
+bsdtar.1: ../../tar/bsdtar.1
+ nroff -mdoc ../../tar/bsdtar.1 | col -b > bsdtar.1
+
+bsdcpio.1: ../../cpio/bsdcpio.1
+ nroff -mdoc ../../cpio/bsdcpio.1 | col -b > bsdcpio.1
diff --git a/archivers/libarchive/files/doc/text/archive_entry.3 b/archivers/libarchive/files/doc/text/archive_entry.3
new file mode 100644
index 00000000000..5201c4f6d5b
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/archive_entry.3
@@ -0,0 +1,350 @@
+archive_entry(3) FreeBSD Library Functions Manual archive_entry(3)
+
+NAME
+ archive_entry_acl_add_entry, archive_entry_acl_add_entry_w,
+ archive_entry_acl_clear, archive_entry_acl_count, archive_entry_acl_next,
+ archive_entry_acl_next_w, archive_entry_acl_reset,
+ archive_entry_acl_text_w, archive_entry_atime, archive_entry_atime_nsec,
+ archive_entry_clear, archive_entry_clone,
+ archive_entry_copy_fflags_text_w, archive_entry_copy_gname,
+ archive_entry_copy_gname_w, archive_entry_copy_hardlink,
+ archive_entry_copy_hardlink_w, archive_entry_copy_pathname_w,
+ archive_entry_copy_stat, archive_entry_copy_symlink,
+ archive_entry_copy_symlink_w, archive_entry_copy_uname,
+ archive_entry_copy_uname_w, archive_entry_dev, archive_entry_devmajor,
+ archive_entry_devminor, archive_entry_filetype, archive_entry_fflags,
+ archive_entry_fflags_text, archive_entry_free, archive_entry_gid,
+ archive_entry_gname, archive_entry_hardlink, archive_entry_ino,
+ archive_entry_mode, archive_entry_mtime, archive_entry_mtime_nsec,
+ archive_entry_nlink, archive_entry_new, archive_entry_pathname,
+ archive_entry_pathname_w, archive_entry_rdev, archive_entry_rdevmajor,
+ archive_entry_rdevminor, archive_entry_set_atime,
+ archive_entry_set_ctime, archive_entry_set_dev,
+ archive_entry_set_devmajor, archive_entry_set_devminor,
+ archive_entry_set_filetype, archive_entry_set_fflags,
+ archive_entry_set_gid, archive_entry_set_gname,
+ archive_entry_set_hardlink, archive_entry_set_link,
+ archive_entry_set_mode, archive_entry_set_mtime,
+ archive_entry_set_pathname, archive_entry_set_rdevmajor,
+ archive_entry_set_rdevminor, archive_entry_set_size,
+ archive_entry_set_symlink, archive_entry_set_uid,
+ archive_entry_set_uname, archive_entry_size, archive_entry_stat,
+ archive_entry_symlink, archive_entry_uid, archive_entry_uname -- func-
+ tions for manipulating archive entry descriptions
+
+SYNOPSIS
+ #include <archive_entry.h>
+
+ void
+ archive_entry_acl_add_entry(struct archive_entry *, int type,
+ int permset, int tag, int qual, const char *name);
+
+ void
+ archive_entry_acl_add_entry_w(struct archive_entry *, int type,
+ int permset, int tag, int qual, const wchar_t *name);
+
+ void
+ archive_entry_acl_clear(struct archive_entry *);
+
+ int
+ archive_entry_acl_count(struct archive_entry *, int type);
+
+ int
+ archive_entry_acl_next(struct archive_entry *, int want_type, int *type,
+ int *permset, int *tag, int *qual, const char **name);
+
+ int
+ archive_entry_acl_next_w(struct archive_entry *, int want_type,
+ int *type, int *permset, int *tag, int *qual, const wchar_t **name);
+
+ int
+ archive_entry_acl_reset(struct archive_entry *, int want_type);
+
+ const wchar_t *
+ archive_entry_acl_text_w(struct archive_entry *, int flags);
+
+ time_t
+ archive_entry_atime(struct archive_entry *);
+
+ long
+ archive_entry_atime_nsec(struct archive_entry *);
+
+ struct archive_entry *
+ archive_entry_clear(struct archive_entry *);
+
+ struct archive_entry *
+ archive_entry_clone(struct archive_entry *);
+
+ const wchar_t *
+ archive_entry_copy_fflags_text_w(struct archive_entry *,
+ const wchar_t *);
+
+ void
+ archive_entry_copy_gname(struct archive_entry *, const char *);
+
+ void
+ archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *);
+
+ void
+ archive_entry_copy_hardlink(struct archive_entry *, const char *);
+
+ void
+ archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *);
+
+ void
+ archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *);
+
+ void
+ archive_entry_copy_stat(struct archive_entry *, const struct stat *);
+
+ void
+ archive_entry_copy_symlink(struct archive_entry *, const char *);
+
+ void
+ archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *);
+
+ void
+ archive_entry_copy_uname(struct archive_entry *, const char *);
+
+ void
+ archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *);
+
+ dev_t
+ archive_entry_dev(struct archive_entry *);
+
+ dev_t
+ archive_entry_devmajor(struct archive_entry *);
+
+ dev_t
+ archive_entry_devminor(struct archive_entry *);
+
+ mode_t
+ archive_entry_filetype(struct archive_entry *);
+
+ void
+ archive_entry_fflags(struct archive_entry *, unsigned long *set,
+ unsigned long *clear);
+
+ const char *
+ archive_entry_fflags_text(struct archive_entry *);
+
+ void
+ archive_entry_free(struct archive_entry *);
+
+ const char *
+ archive_entry_gname(struct archive_entry *);
+
+ const char *
+ archive_entry_hardlink(struct archive_entry *);
+
+ ino_t
+ archive_entry_ino(struct archive_entry *);
+
+ mode_t
+ archive_entry_mode(struct archive_entry *);
+
+ time_t
+ archive_entry_mtime(struct archive_entry *);
+
+ long
+ archive_entry_mtime_nsec(struct archive_entry *);
+
+ unsigned int
+ archive_entry_nlink(struct archive_entry *);
+
+ struct archive_entry *
+ archive_entry_new(void);
+
+ const char *
+ archive_entry_pathname(struct archive_entry *);
+
+ const wchar_t *
+ archive_entry_pathname_w(struct archive_entry *);
+
+ dev_t
+ archive_entry_rdev(struct archive_entry *);
+
+ dev_t
+ archive_entry_rdevmajor(struct archive_entry *);
+
+ dev_t
+ archive_entry_rdevminor(struct archive_entry *);
+
+ void
+ archive_entry_set_dev(struct archive_entry *, dev_t);
+
+ void
+ archive_entry_set_devmajor(struct archive_entry *, dev_t);
+
+ void
+ archive_entry_set_devminor(struct archive_entry *, dev_t);
+
+ void
+ archive_entry_set_filetype(struct archive_entry *, unsigned int);
+
+ void
+ archive_entry_set_fflags(struct archive_entry *, unsigned long set,
+ unsigned long clear);
+
+ void
+ archive_entry_set_gid(struct archive_entry *, gid_t);
+
+ void
+ archive_entry_set_gname(struct archive_entry *, const char *);
+
+ void
+ archive_entry_set_hardlink(struct archive_entry *, const char *);
+
+ void
+ archive_entry_set_ino(struct archive_entry *, unsigned long);
+
+ void
+ archive_entry_set_link(struct archive_entry *, const char *);
+
+ void
+ archive_entry_set_mode(struct archive_entry *, mode_t);
+
+ void
+ archive_entry_set_mtime(struct archive_entry *, time_t, long nanos);
+
+ void
+ archive_entry_set_nlink(struct archive_entry *, unsigned int);
+
+ void
+ archive_entry_set_pathname(struct archive_entry *, const char *);
+
+ void
+ archive_entry_set_rdev(struct archive_entry *, dev_t);
+
+ void
+ archive_entry_set_rdevmajor(struct archive_entry *, dev_t);
+
+ void
+ archive_entry_set_rdevminor(struct archive_entry *, dev_t);
+
+ void
+ archive_entry_set_size(struct archive_entry *, int64_t);
+
+ void
+ archive_entry_set_symlink(struct archive_entry *, const char *);
+
+ void
+ archive_entry_set_uid(struct archive_entry *, uid_t);
+
+ void
+ archive_entry_set_uname(struct archive_entry *, const char *);
+
+ int64_t
+ archive_entry_size(struct archive_entry *);
+
+ const struct stat *
+ archive_entry_stat(struct archive_entry *);
+
+ const char *
+ archive_entry_symlink(struct archive_entry *);
+
+ const char *
+ archive_entry_uname(struct archive_entry *);
+
+DESCRIPTION
+ These functions create and manipulate data objects that represent entries
+ within an archive. You can think of a struct archive_entry as a heavy-
+ duty version of struct stat: it includes everything from struct stat plus
+ associated pathname, textual group and user names, etc. These objects
+ are used by libarchive(3) to represent the metadata associated with a
+ particular entry in an archive.
+
+ Create and Destroy
+ There are functions to allocate, destroy, clear, and copy archive_entry
+ objects:
+ archive_entry_clear()
+ Erases the object, resetting all internal fields to the same
+ state as a newly-created object. This is provided to allow you
+ to quickly recycle objects without thrashing the heap.
+ archive_entry_clone()
+ A deep copy operation; all text fields are duplicated.
+ archive_entry_free()
+ Releases the struct archive_entry object.
+ archive_entry_new()
+ Allocate and return a blank struct archive_entry object.
+
+ Set and Get Functions
+ Most of the functions here set or read entries in an object. Such func-
+ tions have one of the following forms:
+ archive_entry_set_XXXX()
+ Stores the provided data in the object. In particular, for
+ strings, the pointer is stored, not the referenced string.
+ archive_entry_copy_XXXX()
+ As above, except that the referenced data is copied into the
+ object.
+ archive_entry_XXXX()
+ Returns the specified data. In the case of strings, a const-
+ qualified pointer to the string is returned.
+ String data can be set or accessed as wide character strings or normal
+ char strings. The functions that use wide character strings are suffixed
+ with _w. Note that these are different representations of the same data:
+ For example, if you store a narrow string and read the corresponding wide
+ string, the object will transparently convert formats using the current
+ locale. Similarly, if you store a wide string and then store a narrow
+ string for the same data, the previously-set wide string will be dis-
+ carded in favor of the new data.
+
+ There are a few set/get functions that merit additional description:
+ archive_entry_set_link()
+ This function sets the symlink field if it is already set. Oth-
+ erwise, it sets the hardlink field.
+
+ File Flags
+ File flags are transparently converted between a bitmap representation
+ and a textual format. For example, if you set the bitmap and ask for
+ text, the library will build a canonical text format. However, if you
+ set a text format and request a text format, you will get back the same
+ text, even if it is ill-formed. If you need to canonicalize a textual
+ flags string, you should first set the text form, then request the bitmap
+ form, then use that to set the bitmap form. Setting the bitmap format
+ will clear the internal text representation and force it to be recon-
+ structed when you next request the text form.
+
+ The bitmap format consists of two integers, one containing bits that
+ should be set, the other specifying bits that should be cleared. Bits
+ not mentioned in either bitmap will be ignored. Usually, the bitmap of
+ bits to be cleared will be set to zero. In unusual circumstances, you
+ can force a fully-specified set of file flags by setting the bitmap of
+ flags to clear to the complement of the bitmap of flags to set. (This
+ differs from fflagstostr(3), which only includes names for set bits.)
+ Converting a bitmap to a textual string is a platform-specific operation;
+ bits that are not meaningful on the current platform will be ignored.
+
+ The canonical text format is a comma-separated list of flag names. The
+ archive_entry_copy_fflags_text_w() function parses the provided text and
+ sets the internal bitmap values. This is a platform-specific operation;
+ names that are not meaningful on the current platform will be ignored.
+ The function returns a pointer to the start of the first name that was
+ not recognized, or NULL if every name was recognized. Note that every
+ name--including names that follow an unrecognized name--will be evalu-
+ ated, and the bitmaps will be set to reflect every name that is recog-
+ nized. (In particular, this differs from strtofflags(3), which stops
+ parsing at the first unrecognized name.)
+
+ ACL Handling
+ XXX This needs serious help. XXX
+
+ An ``Access Control List'' (ACL) is a list of permissions that grant
+ access to particular users or groups beyond what would normally be pro-
+ vided by standard POSIX mode bits. The ACL handling here addresses some
+ deficiencies in the POSIX.1e draft 17 ACL specification. In particular,
+ POSIX.1e draft 17 specifies several different formats, but none of those
+ formats include both textual user/group names and numeric UIDs/GIDs.
+
+ XXX explain ACL stuff XXX
+
+SEE ALSO
+ archive(3)
+
+HISTORY
+ The libarchive library first appeared in FreeBSD 5.3.
+
+AUTHORS
+ The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+
+FreeBSD 6.0 December 15, 2003 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/archive_read.3 b/archivers/libarchive/files/doc/text/archive_read.3
new file mode 100644
index 00000000000..95b86866b06
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/archive_read.3
@@ -0,0 +1,395 @@
+archive_read(3) FreeBSD Library Functions Manual archive_read(3)
+
+NAME
+ archive_read_new, archive_read_support_compression_all,
+ archive_read_support_compression_bzip2,
+ archive_read_support_compression_compress,
+ archive_read_support_compression_gzip,
+ archive_read_support_compression_none,
+ archive_read_support_compression_program,
+ archive_read_support_format_all, archive_read_support_format_cpio,
+ archive_read_support_format_empty, archive_read_support_format_iso9660,
+ archive_read_support_format_tar, archive_read_support_format_zip,
+ archive_read_open, archive_read_open2, archive_read_open_fd,
+ archive_read_open_FILE, archive_read_open_filename,
+ archive_read_open_memory, archive_read_next_header, archive_read_data,
+ archive_read_data_block, archive_read_data_skip,
+ archive_read_data_into_buffer, archive_read_data_into_fd,
+ archive_read_extract, archive_read_extract_set_progress_callback,
+ archive_read_close, archive_read_finish -- functions for reading stream-
+ ing archives
+
+SYNOPSIS
+ #include <archive.h>
+
+ struct archive *
+ archive_read_new(void);
+
+ int
+ archive_read_support_compression_all(struct archive *);
+
+ int
+ archive_read_support_compression_bzip2(struct archive *);
+
+ int
+ archive_read_support_compression_compress(struct archive *);
+
+ int
+ archive_read_support_compression_gzip(struct archive *);
+
+ int
+ archive_read_support_compression_none(struct archive *);
+
+ int
+ archive_read_support_compression_program(struct archive *,
+ const char *cmd);
+
+ int
+ archive_read_support_format_all(struct archive *);
+
+ int
+ archive_read_support_format_cpio(struct archive *);
+
+ int
+ archive_read_support_format_empty(struct archive *);
+
+ int
+ archive_read_support_format_iso9660(struct archive *);
+
+ int
+ archive_read_support_format_tar(struct archive *);
+
+ int
+ archive_read_support_format_zip(struct archive *);
+
+ int
+ archive_read_open(struct archive *, void *client_data,
+ archive_open_callback *, archive_read_callback *,
+ archive_close_callback *);
+
+ int
+ archive_read_open2(struct archive *, void *client_data,
+ archive_open_callback *, archive_read_callback *,
+ archive_skip_callback *, archive_close_callback *);
+
+ int
+ archive_read_open_FILE(struct archive *, FILE *file);
+
+ int
+ archive_read_open_fd(struct archive *, int fd, size_t block_size);
+
+ int
+ archive_read_open_filename(struct archive *, const char *filename,
+ size_t block_size);
+
+ int
+ archive_read_open_memory(struct archive *, void *buff, size_t size);
+
+ int
+ archive_read_next_header(struct archive *, struct archive_entry **);
+
+ ssize_t
+ archive_read_data(struct archive *, void *buff, size_t len);
+
+ int
+ archive_read_data_block(struct archive *, const void **buff, size_t *len,
+ off_t *offset);
+
+ int
+ archive_read_data_skip(struct archive *);
+
+ int
+ archive_read_data_into_buffer(struct archive *, void *, ssize_t len);
+
+ int
+ archive_read_data_into_fd(struct archive *, int fd);
+
+ int
+ archive_read_extract(struct archive *, struct archive_entry *,
+ int flags);
+
+ void
+ archive_read_extract_set_progress_callback(struct archive *,
+ void (*func)(void *), void *user_data);
+
+ int
+ archive_read_close(struct archive *);
+
+ int
+ archive_read_finish(struct archive *);
+
+DESCRIPTION
+ These functions provide a complete API for reading streaming archives.
+ The general process is to first create the struct archive object, set
+ options, initialize the reader, iterate over the archive headers and
+ associated data, then close the archive and release all resources. The
+ following summary describes the functions in approximately the order they
+ would be used:
+ archive_read_new()
+ Allocates and initializes a struct archive object suitable for
+ reading from an archive.
+ archive_read_support_compression_all(),
+ archive_read_support_compression_bzip2(),
+ archive_read_support_compression_compress(),
+ archive_read_support_compression_gzip(),
+ archive_read_support_compression_none()
+ Enables auto-detection code and decompression support for the
+ specified compression. Note that ``none'' is always enabled by
+ default. For convenience, archive_read_support_compression_all()
+ enables all available decompression code.
+ archive_read_support_compression_program()
+ Data is fed through the specified external program before being
+ dearchived. Note that this disables automatic detection of the
+ compression format, so it makes no sense to specify this in con-
+ junction with any other decompression option.
+ archive_read_support_format_all(), archive_read_support_format_cpio(),
+ archive_read_support_format_empty(),
+ archive_read_support_format_iso9660(),
+ archive_read_support_format_tar,()
+ archive_read_support_format_zip()
+ Enables support---including auto-detection code---for the speci-
+ fied archive format. For example,
+ archive_read_support_format_tar() enables support for a variety
+ of standard tar formats, old-style tar, ustar, pax interchange
+ format, and many common variants. For convenience,
+ archive_read_support_format_all() enables support for all avail-
+ able formats. Only empty archives are supported by default.
+ archive_read_open()
+ The same as archive_read_open2(), except that the skip callback
+ is assumed to be NULL.
+ archive_read_open2()
+ Freeze the settings, open the archive, and prepare for reading
+ entries. This is the most generic version of this call, which
+ accepts four callback functions. Most clients will want to use
+ archive_read_open_filename(), archive_read_open_FILE(),
+ archive_read_open_fd(), or archive_read_open_memory() instead.
+ The library invokes the client-provided functions to obtain raw
+ bytes from the archive.
+ archive_read_open_FILE()
+ Like archive_read_open(), except that it accepts a FILE *
+ pointer. This function should not be used with tape drives or
+ other devices that require strict I/O blocking.
+ archive_read_open_fd()
+ Like archive_read_open(), except that it accepts a file descrip-
+ tor and block size rather than a set of function pointers. Note
+ that the file descriptor will not be automatically closed at end-
+ of-archive. This function is safe for use with tape drives or
+ other blocked devices.
+ archive_read_open_file()
+ This is a deprecated synonym for archive_read_open_filename().
+ archive_read_open_filename()
+ Like archive_read_open(), except that it accepts a simple file-
+ name and a block size. A NULL filename represents standard
+ input. This function is safe for use with tape drives or other
+ blocked devices.
+ archive_read_open_memory()
+ Like archive_read_open(), except that it accepts a pointer and
+ size of a block of memory containing the archive data.
+ archive_read_next_header()
+ Read the header for the next entry and return a pointer to a
+ struct archive_entry.
+ archive_read_data()
+ Read data associated with the header just read. Internally, this
+ is a convenience function that calls archive_read_data_block()
+ and fills any gaps with nulls so that callers see a single con-
+ tinuous stream of data.
+ archive_read_data_block()
+ Return the next available block of data for this entry. Unlike
+ archive_read_data(), the archive_read_data_block() function
+ avoids copying data and allows you to correctly handle sparse
+ files, as supported by some archive formats. The library guaran-
+ tees that offsets will increase and that blocks will not overlap.
+ Note that the blocks returned from this function can be much
+ larger than the block size read from disk, due to compression and
+ internal buffer optimizations.
+ archive_read_data_skip()
+ A convenience function that repeatedly calls
+ archive_read_data_block() to skip all of the data for this ar-
+ chive entry.
+ archive_read_data_into_buffer()
+ This function is deprecated and will be removed. Use
+ archive_read_data() instead.
+ archive_read_data_into_fd()
+ A convenience function that repeatedly calls
+ archive_read_data_block() to copy the entire entry to the pro-
+ vided file descriptor.
+ archive_read_extract(), archive_read_extract_set_skip_file()
+ A convenience function that wraps the corresponding
+ archive_write_disk(3) interfaces. The first call to
+ archive_read_extract() creates a restore object using
+ archive_write_disk_new(3) and
+ archive_write_disk_set_standard_lookup(3), then transparently
+ invokes archive_write_disk_set_options(3),
+ archive_write_header(3), archive_write_data(3), and
+ archive_write_finish_entry(3) to create the entry on disk and
+ copy data into it. The flags argument is passed unmodified to
+ archive_write_disk_set_options(3).
+ archive_read_extract_set_progress_callback()
+ Sets a pointer to a user-defined callback that can be used for
+ updating progress displays during extraction. The progress func-
+ tion will be invoked during the extraction of large regular
+ files. The progress function will be invoked with the pointer
+ provided to this call. Generally, the data pointed to should
+ include a reference to the archive object and the archive_entry
+ object so that various statistics can be retrieved for the
+ progress display.
+ archive_read_close()
+ Complete the archive and invoke the close callback.
+ archive_read_finish()
+ Invokes archive_read_close() if it was not invoked manually, then
+ release all resources. Note: In libarchive 1.x, this function
+ was declared to return void, which made it impossible to detect
+ certain errors when archive_read_close() was invoked implicitly
+ from this function. The declaration is corrected beginning with
+ libarchive 2.0.
+
+ Note that the library determines most of the relevant information about
+ the archive by inspection. In particular, it automatically detects
+ gzip(1) or bzip2(1) compression and transparently performs the appropri-
+ ate decompression. It also automatically detects the archive format.
+
+ A complete description of the struct archive and struct archive_entry
+ objects can be found in the overview manual page for libarchive(3).
+
+CLIENT CALLBACKS
+ The callback functions must match the following prototypes:
+
+ typedef ssize_t archive_read_callback(struct archive *, void
+ *client_data, const void **buffer)
+
+ typedef int archive_skip_callback(struct archive *, void
+ *client_data, size_t request)
+
+ typedef int archive_open_callback(struct archive *, void
+ *client_data)
+
+ typedef int archive_close_callback(struct archive *, void
+ *client_data)
+
+ The open callback is invoked by archive_open(). It should return
+ ARCHIVE_OK if the underlying file or data source is successfully opened.
+ If the open fails, it should call archive_set_error() to register an
+ error code and message and return ARCHIVE_FATAL.
+
+ The read callback is invoked whenever the library requires raw bytes from
+ the archive. The read callback should read data into a buffer, set the
+ const void **buffer argument to point to the available data, and return a
+ count of the number of bytes available. The library will invoke the read
+ callback again only after it has consumed this data. The library imposes
+ no constraints on the size of the data blocks returned. On end-of-file,
+ the read callback should return zero. On error, the read callback should
+ invoke archive_set_error() to register an error code and message and
+ return -1.
+
+ The skip callback is invoked when the library wants to ignore a block of
+ data. The return value is the number of bytes actually skipped, which
+ may differ from the request. If the callback cannot skip data, it should
+ return zero. If the skip callback is not provided (the function pointer
+ is NULL ), the library will invoke the read function instead and simply
+ discard the result. A skip callback can provide significant performance
+ gains when reading uncompressed archives from slow disk drives or other
+ media that can skip quickly.
+
+ The close callback is invoked by archive_close when the archive process-
+ ing is complete. The callback should return ARCHIVE_OK on success. On
+ failure, the callback should invoke archive_set_error() to register an
+ error code and message and return ARCHIVE_FATAL.
+
+EXAMPLE
+ The following illustrates basic usage of the library. In this example,
+ the callback functions are simply wrappers around the standard open(2),
+ read(2), and close(2) system calls.
+
+ void
+ list_archive(const char *name)
+ {
+ struct mydata *mydata;
+ struct archive *a;
+ struct archive_entry *entry;
+
+ mydata = malloc(sizeof(struct mydata));
+ a = archive_read_new();
+ mydata->name = name;
+ archive_read_support_compression_all(a);
+ archive_read_support_format_all(a);
+ archive_read_open(a, mydata, myopen, myread, myclose);
+ while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
+ printf("%s\n",archive_entry_pathname(entry));
+ archive_read_data_skip(a);
+ }
+ archive_read_finish(a);
+ free(mydata);
+ }
+
+ ssize_t
+ myread(struct archive *a, void *client_data, const void **buff)
+ {
+ struct mydata *mydata = client_data;
+
+ *buff = mydata->buff;
+ return (read(mydata->fd, mydata->buff, 10240));
+ }
+
+ int
+ myopen(struct archive *a, void *client_data)
+ {
+ struct mydata *mydata = client_data;
+
+ mydata->fd = open(mydata->name, O_RDONLY);
+ return (mydata->fd >= 0 ? ARCHIVE_OK : ARCHIVE_FATAL);
+ }
+
+ int
+ myclose(struct archive *a, void *client_data)
+ {
+ struct mydata *mydata = client_data;
+
+ if (mydata->fd > 0)
+ close(mydata->fd);
+ return (ARCHIVE_OK);
+ }
+
+RETURN VALUES
+ Most functions return zero on success, non-zero on error. The possible
+ return codes include: ARCHIVE_OK (the operation succeeded), ARCHIVE_WARN
+ (the operation succeeded but a non-critical error was encountered),
+ ARCHIVE_EOF (end-of-archive was encountered), ARCHIVE_RETRY (the opera-
+ tion failed but can be retried), and ARCHIVE_FATAL (there was a fatal
+ error; the archive should be closed immediately). Detailed error codes
+ and textual descriptions are available from the archive_errno() and
+ archive_error_string() functions.
+
+ archive_read_new() returns a pointer to a freshly allocated struct
+ archive object. It returns NULL on error.
+
+ archive_read_data() returns a count of bytes actually read or zero at the
+ end of the entry. On error, a value of ARCHIVE_FATAL, ARCHIVE_WARN, or
+ ARCHIVE_RETRY is returned and an error code and textual description can
+ be retrieved from the archive_errno() and archive_error_string() func-
+ tions.
+
+ The library expects the client callbacks to behave similarly. If there
+ is an error, you can use archive_set_error() to set an appropriate error
+ code and description, then return one of the non-zero values above.
+ (Note that the value eventually returned to the client may not be the
+ same; many errors that are not critical at the level of basic I/O can
+ prevent the archive from being properly read, thus most I/O errors even-
+ tually cause ARCHIVE_FATAL to be returned.)
+
+SEE ALSO
+ tar(1), archive(3), archive_util(3), tar(5)
+
+HISTORY
+ The libarchive library first appeared in FreeBSD 5.3.
+
+AUTHORS
+ The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+
+BUGS
+ Many traditional archiver programs treat empty files as valid empty ar-
+ chives. For example, many implementations of tar(1) allow you to append
+ entries to an empty file. Of course, it is impossible to determine the
+ format of an empty file by inspecting the contents, so this library
+ treats empty files as having a special ``empty'' format.
+
+FreeBSD 6.0 August 19, 2006 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/archive_util.3 b/archivers/libarchive/files/doc/text/archive_util.3
new file mode 100644
index 00000000000..28b688362ba
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/archive_util.3
@@ -0,0 +1,91 @@
+archive_util(3) FreeBSD Library Functions Manual archive_util(3)
+
+NAME
+ archive_clear_error, archive_compression, archive_compression_name,
+ archive_copy_error, archive_errno, archive_error_string, archive_format,
+ archive_format_name, archive_set_error -- libarchive utility functions
+
+SYNOPSIS
+ #include <archive.h>
+
+ void
+ archive_clear_error(struct archive *);
+
+ int
+ archive_compression(struct archive *);
+
+ const char *
+ archive_compression_name(struct archive *);
+
+ void
+ archive_copy_error(struct archive *, struct archive *);
+
+ int
+ archive_errno(struct archive *);
+
+ const char *
+ archive_error_string(struct archive *);
+
+ int
+ archive_format(struct archive *);
+
+ const char *
+ archive_format_name(struct archive *);
+
+ void
+ archive_set_error(struct archive *, int error_code, const char *fmt,
+ ...);
+
+DESCRIPTION
+ These functions provide access to various information about the struct
+ archive object used in the libarchive(3) library.
+ archive_clear_error()
+ Clears any error information left over from a previous call. Not
+ generally used in client code.
+ archive_compression()
+ Returns a numeric code indicating the current compression. This
+ value is set by archive_read_open().
+ archive_compression_name()
+ Returns a text description of the current compression suitable
+ for display.
+ archive_copy_error()
+ Copies error information from one archive to another.
+ archive_errno()
+ Returns a numeric error code (see errno(2)) indicating the reason
+ for the most recent error return.
+ archive_error_string()
+ Returns a textual error message suitable for display. The error
+ message here is usually more specific than that obtained from
+ passing the result of archive_errno() to strerror(3).
+ archive_format()
+ Returns a numeric code indicating the format of the current ar-
+ chive entry. This value is set by a successful call to
+ archive_read_next_header(). Note that it is common for this
+ value to change from entry to entry. For example, a tar archive
+ might have several entries that utilize GNU tar extensions and
+ several entries that do not. These entries will have different
+ format codes.
+ archive_format_name()
+ A textual description of the format of the current entry.
+ archive_set_error()
+ Sets the numeric error code and error description that will be
+ returned by archive_errno() and archive_error_string(). This
+ function should be used within I/O callbacks to set system-spe-
+ cific error codes and error descriptions. This function accepts
+ a printf-like format string and arguments. However, you should
+ be careful to use only the following printf format specifiers:
+ ``%c'', ``%d'', ``%jd'', ``%jo'', ``%ju'', ``%jx'', ``%ld'',
+ ``%lo'', ``%lu'', ``%lx'', ``%o'', ``%u'', ``%s'', ``%x'',
+ ``%%''. Field-width specifiers and other printf features are not
+ uniformly supported and should not be used.
+
+SEE ALSO
+ archive_read(3), archive_write(3), libarchive(3), printf(3)
+
+HISTORY
+ The libarchive library first appeared in FreeBSD 5.3.
+
+AUTHORS
+ The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+
+FreeBSD 6.0 January 8, 2005 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/archive_write.3 b/archivers/libarchive/files/doc/text/archive_write.3
new file mode 100644
index 00000000000..a16d36419bd
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/archive_write.3
@@ -0,0 +1,420 @@
+archive_write(3) FreeBSD Library Functions Manual archive_write(3)
+
+NAME
+ archive_write_new, archive_write_set_format_cpio,
+ archive_write_set_format_pax, archive_write_set_format_pax_restricted,
+ archive_write_set_format_shar, archive_write_set_format_shar_binary,
+ archive_write_set_format_ustar, archive_write_get_bytes_per_block,
+ archive_write_set_bytes_per_block, archive_write_set_bytes_in_last_block,
+ archive_write_set_compression_bzip2, archive_write_set_compression_gzip,
+ archive_write_set_compression_none,
+ archive_write_set_compression_program, archive_write_open,
+ archive_write_open_fd, archive_write_open_FILE,
+ archive_write_open_filename, archive_write_open_memory,
+ archive_write_header, archive_write_data, archive_write_finish_entry,
+ archive_write_close, archive_write_finish -- functions for creating ar-
+ chives
+
+SYNOPSIS
+ #include <archive.h>
+
+ struct archive *
+ archive_write_new(void);
+
+ int
+ archive_write_get_bytes_per_block(struct archive *);
+
+ int
+ archive_write_set_bytes_per_block(struct archive *, int bytes_per_block);
+
+ int
+ archive_write_set_bytes_in_last_block(struct archive *, int);
+
+ int
+ archive_write_set_compression_bzip2(struct archive *);
+
+ int
+ archive_write_set_compression_gzip(struct archive *);
+
+ int
+ archive_write_set_compression_none(struct archive *);
+
+ int
+ archive_write_set_compression_program(struct archive *,
+ const char * cmd);
+
+ int
+ archive_write_set_format_cpio(struct archive *);
+
+ int
+ archive_write_set_format_pax(struct archive *);
+
+ int
+ archive_write_set_format_pax_restricted(struct archive *);
+
+ int
+ archive_write_set_format_shar(struct archive *);
+
+ int
+ archive_write_set_format_shar_binary(struct archive *);
+
+ int
+ archive_write_set_format_ustar(struct archive *);
+
+ int
+ archive_write_open(struct archive *, void *client_data,
+ archive_open_callback *, archive_write_callback *,
+ archive_close_callback *);
+
+ int
+ archive_write_open_fd(struct archive *, int fd);
+
+ int
+ archive_write_open_FILE(struct archive *, FILE *file);
+
+ int
+ archive_write_open_filename(struct archive *, const char *filename);
+
+ int
+ archive_write_open_memory(struct archive *, void *buffer,
+ size_t bufferSize, size_t *outUsed);
+
+ int
+ archive_write_header(struct archive *, struct archive_entry *);
+
+ ssize_t
+ archive_write_data(struct archive *, const void *, size_t);
+
+ int
+ archive_write_finish_entry(struct archive *);
+
+ int
+ archive_write_close(struct archive *);
+
+ int
+ archive_write_finish(struct archive *);
+
+DESCRIPTION
+ These functions provide a complete API for creating streaming archive
+ files. The general process is to first create the struct archive object,
+ set any desired options, initialize the archive, append entries, then
+ close the archive and release all resources. The following summary
+ describes the functions in approximately the order they are ordinarily
+ used:
+
+ archive_write_new()
+ Allocates and initializes a struct archive object suitable for
+ writing a tar archive.
+
+ archive_write_set_bytes_per_block()
+ Sets the block size used for writing the archive data. Every
+ call to the write callback function, except possibly the last
+ one, will use this value for the length. The third parameter is
+ a boolean that specifies whether or not the final block written
+ will be padded to the full block size. If it is zero, the last
+ block will not be padded. If it is non-zero, padding will be
+ added both before and after compression. The default is to use a
+ block size of 10240 bytes and to pad the last block. Note that a
+ block size of zero will suppress internal blocking and cause
+ writes to be sent directly to the write callback as they occur.
+
+ archive_write_get_bytes_per_block()
+ Retrieve the block size to be used for writing. A value of -1
+ here indicates that the library should use default values. A
+ value of zero indicates that internal blocking is suppressed.
+
+ archive_write_set_bytes_in_last_block()
+ Sets the block size used for writing the last block. If this
+ value is zero, the last block will be padded to the same size as
+ the other blocks. Otherwise, the final block will be padded to a
+ multiple of this size. In particular, setting it to 1 will cause
+ the final block to not be padded. For compressed output, any
+ padding generated by this option is applied only after the com-
+ pression. The uncompressed data is always unpadded. The default
+ is to pad the last block to the full block size (note that
+ archive_write_open_filename() will set this based on the file
+ type). Unlike the other ``set'' functions, this function can be
+ called after the archive is opened.
+
+ archive_write_get_bytes_in_last_block()
+ Retrieve the currently-set value for last block size. A value of
+ -1 here indicates that the library should use default values.
+
+ archive_write_set_format_cpio(), archive_write_set_format_pax(),
+ archive_write_set_format_pax_restricted(),
+ archive_write_set_format_shar(),
+ archive_write_set_format_shar_binary(),
+ archive_write_set_format_ustar()
+ Sets the format that will be used for the archive. The library
+ can write POSIX octet-oriented cpio format archives, POSIX-stan-
+ dard ``pax interchange'' format archives, traditional ``shar''
+ archives, enhanced ``binary'' shar archives that store a variety
+ of file attributes and handle binary files, and POSIX-standard
+ ``ustar'' archives. The pax interchange format is a backwards-
+ compatible tar format that adds key/value attributes to each
+ entry and supports arbitrary filenames, linknames, uids, sizes,
+ etc. ``Restricted pax interchange format'' is the library
+ default; this is the same as pax format, but suppresses the pax
+ extended header for most normal files. In most cases, this will
+ result in ordinary ustar archives.
+
+ archive_write_set_compression_bzip2(),
+ archive_write_set_compression_gzip(),
+ archive_write_set_compression_none()
+ The resulting archive will be compressed as specified. Note that
+ the compressed output is always properly blocked.
+
+ archive_write_set_compression_program()
+ The archive will be fed into the specified compression program.
+ The output of that program is blocked and written to the client
+ write callbacks.
+
+ 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 pointers to three callback functions which will be
+ invoked by the compression layer to write the constructed ar-
+ chive.
+
+ archive_write_open_fd()
+ A convenience form of archive_write_open() that accepts a file
+ descriptor. The archive_write_open_fd() function is safe for use
+ with tape drives or other block-oriented devices.
+
+ archive_write_open_FILE()
+ A convenience form of archive_write_open() that accepts a FILE *
+ pointer. Note that archive_write_open_FILE() is not safe for
+ writing to tape drives or other devices that require correct
+ blocking.
+
+ archive_write_open_file()
+ A deprecated synonym for archive_write_open_filename().
+
+ archive_write_open_filename()
+ A convenience form of archive_write_open() that accepts a file-
+ name. A NULL argument indicates that the output should be writ-
+ ten to standard output; an argument of ``-'' will open a file
+ with that name. If you have not invoked
+ archive_write_set_bytes_in_last_block(), then
+ archive_write_open_filename() will adjust the last-block padding
+ depending on the file: it will enable padding when writing to
+ standard output or to a character or block device node, it will
+ disable padding otherwise. You can override this by manually
+ invoking archive_write_set_bytes_in_last_block() before calling
+ archive_write_open(). The archive_write_open_filename() function
+ is safe for use with tape drives or other block-oriented devices.
+
+ archive_write_open_memory()
+ A convenience form of archive_write_open() that accepts a pointer
+ to a block of memory that will receive the archive. The final
+ size_t * argument points to a variable that will be updated after
+ each write to reflect how much of the buffer is currently in use.
+ You should be careful to ensure that this variable remains allo-
+ cated until after the archive is closed.
+
+ archive_write_header()
+ Build and write a header using the data in the provided struct
+ archive_entry structure. See archive_entry(3) for information on
+ creating and populating struct archive_entry objects.
+
+ archive_write_data()
+ Write data corresponding to the header just written. Returns
+ number of bytes written or -1 on error.
+
+ archive_write_finish_entry()
+ Close out the entry just written. In particular, this writes out
+ the final padding required by some formats. Ordinarily, clients
+ never need to call this, as it is called automatically by
+ archive_write_next_header() and archive_write_close() as needed.
+
+ archive_write_close()
+ Complete the archive and invoke the close callback.
+
+ archive_write_finish()
+ Invokes archive_write_close() if it was not invoked manually,
+ then releases all resources. Note that this function was
+ declared to return void in libarchive 1.x, which made it impossi-
+ ble to detect errors when archive_write_close() was invoked
+ implicitly from this function. This is corrected beginning with
+ libarchive 2.0.
+ More information about the struct archive object and the overall design
+ of the library can be found in the libarchive(3) overview.
+
+IMPLEMENTATION
+ Compression support is built-in to libarchive, which uses zlib and bzlib
+ to handle gzip and bzip2 compression, respectively.
+
+CLIENT CALLBACKS
+ To use this library, you will need to define and register callback func-
+ tions that will be invoked to write data to the resulting archive. These
+ functions are registered by calling archive_write_open():
+
+ typedef int archive_open_callback(struct archive *, void
+ *client_data)
+
+ The open callback is invoked by archive_write_open(). It should return
+ ARCHIVE_OK if the underlying file or data source is successfully opened.
+ If the open fails, it should call archive_set_error() to register an
+ error code and message and return ARCHIVE_FATAL.
+
+ typedef ssize_t archive_write_callback(struct archive *, void
+ *client_data, void *buffer, size_t length)
+
+ The write callback is invoked whenever the library needs to write raw
+ bytes to the archive. For correct blocking, each call to the write call-
+ back function should translate into a single write(2) system call. This
+ is especially critical when writing archives to tape drives. On success,
+ the write callback should return the number of bytes actually written.
+ On error, the callback should invoke archive_set_error() to register an
+ error code and message and return -1.
+
+ typedef int archive_close_callback(struct archive *, void
+ *client_data)
+
+ The close callback is invoked by archive_close when the archive process-
+ ing is complete. The callback should return ARCHIVE_OK on success. On
+ failure, the callback should invoke archive_set_error() to register an
+ error code and message and return ARCHIVE_FATAL.
+
+EXAMPLE
+ The following sketch illustrates basic usage of the library. In this
+ example, the callback functions are simply wrappers around the standard
+ open(2), write(2), and close(2) system calls.
+
+ #include <sys/stat.h>
+ #include <archive.h>
+ #include <archive_entry.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ struct mydata {
+ const char *name;
+ int fd;
+ };
+
+ int
+ myopen(struct archive *a, void *client_data)
+ {
+ struct mydata *mydata = client_data;
+
+ mydata->fd = open(mydata->name, O_WRONLY | O_CREAT, 0644);
+ if (mydata->fd >= 0)
+ return (ARCHIVE_OK);
+ else
+ return (ARCHIVE_FATAL);
+ }
+
+ ssize_t
+ mywrite(struct archive *a, void *client_data, void *buff, size_t n)
+ {
+ struct mydata *mydata = client_data;
+
+ return (write(mydata->fd, buff, n));
+ }
+
+ int
+ myclose(struct archive *a, void *client_data)
+ {
+ struct mydata *mydata = client_data;
+
+ if (mydata->fd > 0)
+ close(mydata->fd);
+ return (0);
+ }
+
+ void
+ write_archive(const char *outname, const char **filename)
+ {
+ struct mydata *mydata = malloc(sizeof(struct mydata));
+ struct archive *a;
+ struct archive_entry *entry;
+ struct stat st;
+ char buff[8192];
+ int len;
+ int fd;
+
+ a = archive_write_new();
+ mydata->name = outname;
+ archive_write_set_compression_gzip(a);
+ archive_write_set_format_ustar(a);
+ archive_write_open(a, mydata, myopen, mywrite, myclose);
+ while (*filename) {
+ stat(*filename, &st);
+ entry = archive_entry_new();
+ archive_entry_copy_stat(entry, &st);
+ archive_entry_set_pathname(entry, *filename);
+ archive_write_header(a, entry);
+ fd = open(*filename, O_RDONLY);
+ len = read(fd, buff, sizeof(buff));
+ while ( len > 0 ) {
+ archive_write_data(a, buff, len);
+ len = read(fd, buff, sizeof(buff));
+ }
+ archive_entry_free(entry);
+ filename++;
+ }
+ archive_write_finish(a);
+ }
+
+ int main(int argc, const char **argv)
+ {
+ const char *outname;
+ argv++;
+ outname = argv++;
+ write_archive(outname, argv);
+ return 0;
+ }
+
+RETURN VALUES
+ Most functions return ARCHIVE_OK (zero) on success, or one of several
+ non-zero error codes for errors. Specific error codes include:
+ ARCHIVE_RETRY for operations that might succeed if retried, ARCHIVE_WARN
+ for unusual conditions that do not prevent further operations, and
+ ARCHIVE_FATAL for serious errors that make remaining operations impossi-
+ ble. The archive_errno() and archive_error_string() functions can be
+ used to retrieve an appropriate error code and a textual error message.
+
+ archive_write_new() returns a pointer to a newly-allocated struct archive
+ object.
+
+ archive_write_data() returns a count of the number of bytes actually
+ written. On error, -1 is returned and the archive_errno() and
+ archive_error_string() functions will return appropriate values. Note
+ that if the client-provided write callback function returns a non-zero
+ value, that error will be propagated back to the caller through whatever
+ API function resulted in that call, which may include
+ archive_write_header(), archive_write_data(), archive_write_close(), or
+ archive_write_finish(). The client callback can call archive_set_error()
+ to provide values that can then be retrieved by archive_errno() and
+ archive_error_string().
+
+SEE ALSO
+ tar(1), libarchive(3), tar(5)
+
+HISTORY
+ The libarchive library first appeared in FreeBSD 5.3.
+
+AUTHORS
+ The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+
+BUGS
+ There are many peculiar bugs in historic tar implementations that may
+ cause certain programs to reject archives written by this library. For
+ example, several historic implementations calculated header checksums
+ incorrectly and will thus reject valid archives; GNU tar does not fully
+ support pax interchange format; some old tar implementations required
+ specific field terminations.
+
+ The default pax interchange format eliminates most of the historic tar
+ limitations and provides a generic key/value attribute facility for ven-
+ dor-defined extensions. One oversight in POSIX is the failure to provide
+ a standard attribute for large device numbers. This library uses
+ ``SCHILY.devminor'' and ``SCHILY.devmajor'' for device numbers that
+ exceed the range supported by the backwards-compatible ustar header.
+ These keys are compatible with Joerg Schilling's star archiver. Other
+ implementations may not recognize these keys and will thus be unable to
+ correctly restore device nodes with large device numbers from archives
+ created by this library.
+
+FreeBSD 6.0 August 19, 2006 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/archive_write_disk.3 b/archivers/libarchive/files/doc/text/archive_write_disk.3
new file mode 100644
index 00000000000..18e4e50c113
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/archive_write_disk.3
@@ -0,0 +1,253 @@
+archive_write_disk(3) FreeBSD Library Functions Manual archive_write_disk(3)
+
+NAME
+ archive_write_disk_new, archive_write_disk_set_options,
+ archive_write_disk_set_skip_file, archive_write_disk_set_group_lookup,
+ archive_write_disk_set_standard_lookup,
+ archive_write_disk_set_user_lookup, archive_write_header,
+ archive_write_data, archive_write_finish_entry, archive_write_close,
+ archive_write_finish -- functions for creating objects on disk
+
+SYNOPSIS
+ #include <archive.h>
+
+ struct archive *
+ archive_write_disk_new(void);
+
+ int
+ archive_write_disk_set_options(struct archive *, int flags);
+
+ int
+ archive_write_disk_set_skip_file(struct archive *, dev_t, ino_t);
+
+ int
+ archive_write_disk_set_group_lookup(struct archive *, void *,
+ gid_t (*)(void *, const char *gname, gid_t gid),
+ void (*cleanup)(void *));
+
+ int
+ archive_write_disk_set_standard_lookup(struct archive *);
+
+ int
+ archive_write_disk_set_user_lookup(struct archive *, void *,
+ uid_t (*)(void *, const char *uname, uid_t uid),
+ void (*cleanup)(void *));
+
+ int
+ archive_write_header(struct archive *, struct archive_entry *);
+
+ ssize_t
+ archive_write_data(struct archive *, const void *, size_t);
+
+ int
+ archive_write_finish_entry(struct archive *);
+
+ int
+ archive_write_close(struct archive *);
+
+ int
+ archive_write_finish(struct archive *);
+
+DESCRIPTION
+ These functions provide a complete API for creating objects on disk from
+ struct archive_entry descriptions. They are most naturally used when
+ extracting objects from an archive using the archive_read() interface.
+ The general process is to read struct archive_entry objects from an ar-
+ chive, then write those objects to a struct archive object created using
+ the archive_write_disk() family functions. This interface is deliber-
+ ately very similar to the archive_write() interface used to write objects
+ to a streaming archive.
+
+ archive_write_disk_new()
+ Allocates and initializes a struct archive object suitable for
+ writing objects to disk.
+
+ archive_write_disk_set_skip_file()
+ Records the device and inode numbers of a file that should not be
+ overwritten. This is typically used to ensure that an extraction
+ process does not overwrite the archive from which objects are
+ being read. This capability is technically unnecessary but can
+ be a significant performance optimization in practice.
+
+ archive_write_disk_set_options()
+ The options field consists of a bitwise OR of one or more of the
+ following values:
+ ARCHIVE_EXTRACT_OWNER
+ The user and group IDs should be set on the restored
+ file. By default, the user and group IDs are not
+ restored.
+ ARCHIVE_EXTRACT_PERM
+ Full permissions (including SGID, SUID, and sticky bits)
+ should be restored exactly as specified, without obeying
+ the current umask. Note that SUID and SGID bits can only
+ be restored if the user and group ID of the object on
+ disk are correct. If ARCHIVE_EXTRACT_OWNER is not speci-
+ fied, then SUID and SGID bits will only be restored if
+ the default user and group IDs of newly-created objects
+ on disk happen to match those specified in the archive
+ entry. By default, only basic permissions are restored,
+ and umask is obeyed.
+ ARCHIVE_EXTRACT_TIME
+ The timestamps (mtime, ctime, and atime) should be
+ restored. By default, they are ignored. Note that
+ restoring of atime is not currently supported.
+ ARCHIVE_EXTRACT_NO_OVERWRITE
+ Existing files on disk will not be overwritten. By
+ default, existing regular files are truncated and over-
+ written; existing directories will have their permissions
+ updated; other pre-existing objects are unlinked and
+ recreated from scratch.
+ ARCHIVE_EXTRACT_UNLINK
+ Existing files on disk will be unlinked before any
+ attempt to create them. In some cases, this can prove to
+ be a significant performance improvement. By default,
+ existing files are truncated and rewritten, but the file
+ is not recreated. In particular, the default behavior
+ does not break existing hard links.
+ ARCHIVE_EXTRACT_ACL
+ Attempt to restore ACLs. By default, extended ACLs are
+ ignored.
+ ARCHIVE_EXTRACT_FFLAGS
+ Attempt to restore extended file flags. By default, file
+ flags are ignored.
+ ARCHIVE_EXTRACT_XATTR
+ Attempt to restore POSIX.1e extended attributes. By
+ default, they are ignored.
+ ARCHIVE_EXTRACT_SECURE_SYMLINKS
+ Refuse to extract any object whose final location would
+ be altered by a symlink on disk. This is intended to
+ help guard against a variety of mischief caused by ar-
+ chives that (deliberately or otherwise) extract files
+ outside of the current directory. The default is not to
+ perform this check. If ARCHIVE_EXTRACT_UNLINK is speci-
+ fied together with this option, the library will remove
+ any intermediate symlinks it finds and return an error
+ only if such symlink could not be removed.
+ ARCHIVE_EXTRACT_SECURE_NODOTDOT
+ Refuse to extract a path that contains a .. element any-
+ where within it. The default is to not refuse such
+ paths. Note that paths ending in .. always cause an
+ error, regardless of this flag.
+
+ archive_write_disk_set_group_lookup(),
+ archive_write_disk_set_user_lookup()
+ The struct archive_entry objects contain both names and ids that
+ can be used to identify users and groups. These names and ids
+ describe the ownership of the file itself and also appear in ACL
+ lists. By default, the library uses the ids and ignores the
+ names, but this can be overridden by registering user and group
+ lookup functions. To register, you must provide a lookup func-
+ tion which accepts both a name and id and returns a suitable id.
+ You may also provide a void * pointer to a private data structure
+ and a cleanup function for that data. The cleanup function will
+ be invoked when the struct archive object is destroyed.
+
+ archive_write_disk_set_standard_lookup()
+ This convenience function installs a standard set of user and
+ group lookup functions. These functions use getpwnam(3) and
+ getgrnam(3) to convert names to ids, defaulting to the ids if the
+ names cannot be looked up. These functions also implement a sim-
+ ple memory cache to reduce the number of calls to getpwnam(3) and
+ getgrnam(3).
+
+ archive_write_header()
+ Build and write a header using the data in the provided struct
+ archive_entry structure. See archive_entry(3) for information on
+ creating and populating struct archive_entry objects.
+
+ archive_write_data()
+ Write data corresponding to the header just written. Returns
+ number of bytes written or -1 on error.
+
+ archive_write_finish_entry()
+ Close out the entry just written. Ordinarily, clients never need
+ to call this, as it is called automatically by
+ archive_write_next_header() and archive_write_close() as needed.
+
+ archive_write_close()
+ Set any attributes that could not be set during the initial
+ restore. For example, directory timestamps are not restored ini-
+ tially because restoring a subsequent file would alter that time-
+ stamp. Similarly, non-writable directories are initially created
+ with write permissions (so that their contents can be restored).
+ The archive_write_disk_new library maintains a list of all such
+ deferred attributes and sets them when this function is invoked.
+
+ archive_write_finish()
+ Invokes archive_write_close() if it was not invoked manually,
+ then releases all resources.
+ More information about the struct archive object and the overall design
+ of the library can be found in the libarchive(3) overview. Many of these
+ functions are also documented under archive_write(3).
+
+RETURN VALUES
+ Most functions return ARCHIVE_OK (zero) on success, or one of several
+ non-zero error codes for errors. Specific error codes include:
+ ARCHIVE_RETRY for operations that might succeed if retried, ARCHIVE_WARN
+ for unusual conditions that do not prevent further operations, and
+ ARCHIVE_FATAL for serious errors that make remaining operations impossi-
+ ble. The archive_errno() and archive_error_string() functions can be
+ used to retrieve an appropriate error code and a textual error message.
+
+ archive_write_disk_new() returns a pointer to a newly-allocated struct
+ archive object.
+
+ archive_write_data() returns a count of the number of bytes actually
+ written. On error, -1 is returned and the archive_errno() and
+ archive_error_string() functions will return appropriate values.
+
+SEE ALSO
+ archive_read(3), archive_write(3), tar(1), libarchive(3)
+
+HISTORY
+ The libarchive library first appeared in FreeBSD 5.3. The
+ archive_write_disk interface was added to libarchive 2.0 and first
+ appeared in FreeBSD 6.3.
+
+AUTHORS
+ The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+
+BUGS
+ Directories are actually extracted in two distinct phases. Directories
+ are created during archive_write_header(), but final permissions are not
+ set until archive_write_close(). This separation is necessary to cor-
+ rectly handle borderline cases such as a non-writable directory contain-
+ ing files, but can cause unexpected results. In particular, directory
+ permissions are not fully restored until the archive is closed. If you
+ use chdir(2) to change the current directory between calls to
+ archive_read_extract() or before calling archive_read_close(), you may
+ confuse the permission-setting logic with the result that directory per-
+ missions are restored incorrectly.
+
+ The library attempts to create objects with filenames longer than
+ PATH_MAX by creating prefixes of the full path and changing the current
+ directory. Currently, this logic is limited in scope; the fixup pass
+ does not work correctly for such objects and the symlink security check
+ option disables the support for very long pathnames.
+
+ Restoring the path aa/../bb does create each intermediate directory. In
+ particular, the directory aa is created as well as the final object bb.
+ In theory, this can be exploited to create an entire directory heirarchy
+ with a single request. Of course, this does not work if the
+ ARCHIVE_EXTRACT_NODOTDOT option is specified.
+
+ Implicit directories are always created obeying the current umask.
+ Explicit objects are created obeying the current umask unless
+ ARCHIVE_EXTRACT_PERM is specified, in which case they current umask is
+ ignored.
+
+ SGID and SUID bits are restored only if the correct user and group could
+ be set. If ARCHIVE_EXTRACT_OWNER is not specified, then no attempt is
+ made to set the ownership. In this case, SGID and SUID bits are restored
+ only if the user and group of the final object happen to match those
+ specified in the entry.
+
+ The ``standard'' user-id and group-id lookup functions are not the
+ defaults because getgrnam(3) and getpwnam(3) are sometimes too large for
+ particular applications. The current design allows the application
+ author to use a more compact implementation when appropriate.
+
+ There should be a corresponding archive_read_disk interface that walks a
+ directory heirarchy and returns archive entry objects.
+
+FreeBSD 6.0 March 2, 2007 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/bsdcpio.1 b/archivers/libarchive/files/doc/text/bsdcpio.1
new file mode 100644
index 00000000000..d8f7102636f
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/bsdcpio.1
@@ -0,0 +1,187 @@
+BSDCPIO(1) FreeBSD General Commands Manual BSDCPIO(1)
+
+NAME
+ cpio -- copy files to and from archives
+
+SYNOPSIS
+ cpio {-i} [options] [pattern ...] [< archive]
+ cpio {-o} [options] < name-list [> archive]
+ cpio {-p} [options] dest-dir < name-list
+
+DESCRIPTION
+ cpio copies files between archives and directories. This implementation
+ can extract from tar, pax, cpio, zip, jar, ar, and ISO 9660 cdrom images
+ and can create tar, pax, cpio, ar, and shar archives.
+
+ The first option to cpio is a mode indicator from the following list:
+ -i Input. Read an archive from standard input and extract the con-
+ tents to disk or (if the -t option is specified) list the con-
+ tents to standard output. If one or more file patterns are spec-
+ ified, only files matching one of the patterns will be extracted.
+ -o Output. Read a list of filenames from standard input and produce
+ a new archive on standard output containing the specified items.
+ -p Pass-through. Read a list of filenames from standard input and
+ copy the files to the specified directory.
+
+OPTIONS
+ Unless specifically stated otherwise, options are applicable in all oper-
+ ating modes.
+
+ -a (o and p modes) Reset access times on files after they are read.
+
+ -B (o mode only) Block output to records of 5120 bytes.
+
+ -c (o mode only) Use the old POSIX portable character format.
+ Equivalent to --format odc.
+
+ -d (i and p modes) Create directories as necessary.
+
+ -f pattern
+ (i mode only) Ignore files that match pattern.
+
+ --format format
+ (o mode only) Produce the output archive in the specified format.
+ Supported formats include:
+
+ cpio Synonym for odc.
+ newc The SVR4 portable cpio format.
+ odc The old POSIX.1 portable octet-oriented cpio format.
+ pax The POSIX.1 pax format, an extension of the ustar for-
+ mat.
+ ustar The POSIX.1 tar format.
+
+ The default format is odc. See libarchive_formats(5) for more
+ complete information about the formats currently supported by the
+ underlying libarchive(3) library.
+
+ -i Input mode. See above for description.
+
+ -L (o and p modes) All symbolic links will be followed. Normally,
+ symbolic links are archived and copied as symbolic links. With
+ this option, the target of the link will be archived or copied
+ instead.
+
+ -l (p mode only) Create links from the target directory to the orig-
+ inal files, instead of copying.
+
+ -m (i and p modes) Set file modification time on created files to
+ match those in the source.
+
+ -o Output mode. See above for description.
+
+ -p Pass-through mode. See above for description.
+
+ --quiet
+ Suppress unnecessary messages.
+
+ -R [user][:][group]
+ Set the owner and/or group on files in the output. If group is
+ specified with no user (for example, -R :wheel) then the group
+ will be set but not the user. If the user is specified with a
+ trailing colon and no group (for example, -R root:) then the
+ group will be set to the user's default group. If the user is
+ specified with no trailing colon, then the user will be set but
+ not the group. In -i and -p modes, this option can only be used
+ by the super-user. (For compatibility, a period can be used in
+ place of the colon.)
+
+ -r (All modes.) Rename files interactively. For each file, a
+ prompt is written to /dev/tty containing the name of the file and
+ a line is read from /dev/tty. If the line read is blank, the
+ file is skipped. If the line contains a single period, the file
+ is processed normally. Otherwise, the line is taken to be the
+ new name of the file.
+
+ -t (i mode only) List the contents of the archive to stdout; do not
+ restore the contents to disk.
+
+ -u (i and p modes) Unconditionally overwrite existing files. Ordi-
+ narily, an older file will not overwrite a newer file on disk.
+
+ -v Print the name of each file to stderr as it is processed. With
+ -t, provide a detailed listing of each file.
+
+ --version
+ Print the program version information and exit.
+
+ -y (o mode only) Compress the archive with bzip2-compatible compres-
+ sion before writing to stdout. In input mode, this option is
+ ignored; bzip2 compression is recognized automatically on input.
+
+ -z (o mode only) Compress the archive with gzip-compatible compres-
+ sion before writing it to stdout. In input mode, this option is
+ ignored; gzip compression is recognized automatically on input.
+
+ENVIRONMENT
+ The following environment variables affect the execution of cpio:
+
+ LANG The locale to use. See environ(7) for more information.
+
+ TZ The timezone to use when displaying dates. See environ(7) for
+ more information.
+
+EXIT STATUS
+ The cpio utility exits 0 on success, and >0 if an error occurs.
+
+EXAMPLES
+ The cpio command is traditionally used to copy file heirarchies in con-
+ junction with the find(1) command. The first example here simply copies
+ all files from src to dest:
+ find src | cpio -pmud dest
+
+ By carefully selecting options to the find(1) command and combining it
+ with other standard utilities, it is possible to exercise very fine con-
+ trol over which files are copied. This next example copies files from
+ src to dest that are more than 2 days old and whose names match a partic-
+ ular pattern:
+ find src -mtime +2 | grep foo[bar] | cpio -pdmu dest
+
+ This example copies files from src to dest that are more than 2 days old
+ and which contain the word ``foobar'':
+ find src -mtime +2 | xargs grep -l foobar | cpio -pdmu dest
+
+COMPATIBILITY
+ The mode options i, o, and p and the options a, B, c, d, f, l, m, r, t,
+ u, and v comply with SUSv2.
+
+ The old POSIX.1 standard specified that only -i, -o, and -p were inter-
+ preted as command-line options. Each took a single argument of a list of
+ modifier characters. For example, the standard syntax allows -imu but
+ does not support -miu or -i -m -u, since m and u are only modifiers to
+ -i, they are not command-line options in their own right. The syntax
+ supported by this implementation is backwards-compatible with the stan-
+ dard. For best compatibility, scripts should limit themselves to the
+ standard syntax.
+
+SEE ALSO
+ bzip2(1), tar(1), gzip(1), mt(1), pax(1), libarchive(3), cpio(5),
+ libarchive-formats(5), tar(5)
+
+STANDARDS
+ There is no current POSIX standard for the cpio command; it appeared in
+ ISO/IEC 9945-1:1996 (``POSIX.1'') but was dropped from IEEE Std
+ 1003.1-2001 (``POSIX.1'').
+
+ The cpio, ustar, and pax interchange file formats are defined by IEEE Std
+ 1003.1-2001 (``POSIX.1'') for the pax command.
+
+HISTORY
+ The original cpio and find utilities were written by Dick Haight while
+ working in AT&T's Unix Support Group. They first appeared in 1977 in
+ PWB/UNIX 1.0, the ``Programmer's Work Bench'' system developed for use
+ within AT&T. They were first released outside of AT&T as part of System
+ III Unix in 1981. As a result, cpio actually predates tar, even though
+ it was not well-known outside of AT&T until some time later.
+
+ This is a complete re-implementation based on the libarchive(3) library.
+
+BUGS
+ The cpio archive format has several basic limitations: It does not store
+ user and group names, only numbers. As a result, it cannot be reliably
+ used to transfer files between systems with dissimilar user and group
+ numbering. Older cpio formats limit the user and group numbers to 16 or
+ 18 bits, which is insufficient for modern systems. The cpio archive for-
+ mats cannot support files over 4 gigabytes, except for the ``odc'' vari-
+ ant, which can support files up to 8 gigabytes.
+
+FreeBSD 6.0 December 21, 2007 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/bsdtar.1 b/archivers/libarchive/files/doc/text/bsdtar.1
new file mode 100644
index 00000000000..9a6275349ea
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/bsdtar.1
@@ -0,0 +1,441 @@
+BSDTAR(1) FreeBSD General Commands Manual BSDTAR(1)
+
+NAME
+ tar -- manipulate tape archives
+
+SYNOPSIS
+ tar [bundled-flags <args>] [<file> | <pattern> ...]
+ tar {-c} [options] [files | directories]
+ tar {-r | -u} -f archive-file [options] [files | directories]
+ tar {-t | -x} [options] [patterns]
+
+DESCRIPTION
+ tar creates and manipulates streaming archive files. This implementation
+ can extract from tar, pax, cpio, zip, jar, ar, and ISO 9660 cdrom images
+ and can create tar, pax, cpio, ar, and shar archives.
+
+ The first synopsis form shows a ``bundled'' option word. This usage is
+ provided for compatibility with historical implementations. See COMPATI-
+ BILITY below for details.
+
+ The other synopsis forms show the preferred usage. The first option to
+ tar is a mode indicator from the following list:
+ -c Create a new archive containing the specified items.
+ -r Like -c, but new entries are appended to the archive. Note that
+ this only works on uncompressed archives stored in regular files.
+ The -f option is required.
+ -t List archive contents to stdout.
+ -u Like -r, but new entries are added only if they have a modifica-
+ tion date newer than the corresponding entry in the archive.
+ Note that this only works on uncompressed archives stored in reg-
+ ular files. The -f option is required.
+ -x Extract to disk from the archive. If a file with the same name
+ appears more than once in the archive, each copy will be
+ extracted, with later copies overwriting (replacing) earlier
+ copies.
+
+ In -c, -r, or -u mode, each specified file or directory is added to the
+ archive in the order specified on the command line. By default, the con-
+ tents of each directory are also archived.
+
+ In extract or list mode, the entire command line is read and parsed
+ before the archive is opened. The pathnames or patterns on the command
+ line indicate which items in the archive should be processed. Patterns
+ are shell-style globbing patterns as documented in tcsh(1).
+
+OPTIONS
+ Unless specifically stated otherwise, options are applicable in all oper-
+ ating modes.
+
+ @archive
+ (c and r mode only) The specified archive is opened and the
+ entries in it will be appended to the current archive. As a sim-
+ ple example,
+ tar -c -f - newfile @original.tar
+ writes a new archive to standard output containing a file newfile
+ and all of the entries from original.tar. In contrast,
+ tar -c -f - newfile original.tar
+ creates a new archive with only two entries. Similarly,
+ tar -czf - --format pax @-
+ reads an archive from standard input (whose format will be deter-
+ mined automatically) and converts it into a gzip-compressed pax-
+ format archive on stdout. In this way, tar can be used to con-
+ vert archives from one format to another.
+
+ -b blocksize
+ Specify the block size, in 512-byte records, for tape drive I/O.
+ As a rule, this argument is only needed when reading from or
+ writing to tape drives, and usually not even then as the default
+ block size of 20 records (10240 bytes) is very common.
+
+ -C directory
+ In c and r mode, this changes the directory before adding the
+ following files. In x mode, change directories after opening the
+ archive but before extracting entries from the archive.
+
+ --check-links (-W check-links)
+ (c and r modes only) Issue a warning message unless all links to
+ each file are archived.
+
+ --exclude pattern (-W exclude=pattern)
+ Do not process files or directories that match the specified pat-
+ tern. Note that exclusions take precedence over patterns or
+ filenames specified on the command line.
+
+ --format format (-W format=format)
+ (c mode only) Use the specified format for the created archive.
+ Supported formats include ``cpio'', ``pax'', ``shar'', and
+ ``ustar''. Other formats may also be supported; see
+ libarchive-formats(5) for more information about currently-sup-
+ ported formats.
+
+ -f file
+ Read the archive from or write the archive to the specified file.
+ The filename can be - for standard input or standard output. If
+ not specified, the default tape device will be used. (On
+ FreeBSD, the default tape device is /dev/sa0.)
+
+ --fast-read (-W fast-read)
+ (x and t mode only) Extract or list only the first archive entry
+ that matches each pattern or filename operand. Exit as soon as
+ each specified pattern or filename has been matched. By default,
+ the archive is always read to the very end, since there can be
+ multiple entries with the same name and, by convention, later
+ entries overwrite earlier entries. This option is provided as a
+ performance optimization.
+
+ -H (c and r mode only) Symbolic links named on the command line will
+ be followed; the target of the link will be archived, not the
+ link itself.
+
+ -h (c and r mode only) Synonym for -L.
+
+ -I Synonym for -T.
+
+ --include pattern (-W include=pattern)
+ Process only files or directories that match the specified pat-
+ tern. Note that exclusions specified with --exclude take prece-
+ dence over inclusions. If no inclusions are explicitly speci-
+ fied, all entries are processed by default. The --include option
+ is especially useful when filtering archives. For example, the
+ command
+ tar -c -f new.tar --include='*foo*' @old.tgz
+ creates a new archive new.tar containing only the entries from
+ old.tgz containing the string `foo'.
+
+ -j (c mode only) Compress the resulting archive with bzip2(1). In
+ extract or list modes, this option is ignored. Note that, unlike
+ other tar implementations, this implementation recognizes bzip2
+ compression automatically when reading archives.
+
+ -k (x mode only) Do not overwrite existing files. In particular, if
+ a file appears more than once in an archive, later copies will
+ not overwrite earlier copies.
+
+ -L (c and r mode only) All symbolic links will be followed. Nor-
+ mally, symbolic links are archived as such. With this option,
+ the target of the link will be archived instead.
+
+ -l This is a synonym for the --check-links option.
+
+ -m (x mode only) Do not extract modification time. By default, the
+ modification time is set to the time stored in the archive.
+
+ -n (c, r, u modes only) Do not recursively archive the contents of
+ directories.
+
+ --newer date (-W newer=date)
+ (c, r, u modes only) Only include files and directories newer
+ than the specified date. This compares ctime entries.
+
+ --newer-mtime date (-W newer-mtime=date)
+ (c, r, u modes only) Like --newer, except it compares mtime
+ entries instead of ctime entries.
+
+ --newer-than file (-W newer-than=file)
+ (c, r, u modes only) Only include files and directories newer
+ than the specified file. This compares ctime entries.
+
+ --newer-mtime-than file (-W newer-mtime-than=file)
+ (c, r, u modes only) Like --newer-than, except it compares mtime
+ entries instead of ctime entries.
+
+ --nodump (-W nodump)
+ (c and r modes only) Honor the nodump file flag by skipping this
+ file.
+
+ --null (-W null)
+ (use with -I, -T, or -X) Filenames or patterns are separated by
+ null characters, not by newlines. This is often used to read
+ filenames output by the -print0 option to find(1).
+
+ -O (x, t modes only) In extract (-x) mode, files will be written to
+ standard out rather than being extracted to disk. In list (-t)
+ mode, the file listing will be written to stderr rather than the
+ usual stdout.
+
+ -o (x mode only) Use the user and group of the user running the pro-
+ gram rather than those specified in the archive. Note that this
+ has no significance unless -p 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 infor-
+ mation in the archive will be discarded.
+
+ --one-file-system (-W one-file-system)
+ (c, r, and u modes) Do not cross mount points.
+
+ -P Preserve pathnames. By default, absolute pathnames (those that
+ begin with a / character) have the leading slash removed both
+ when creating archives and extracting from them. Also, tar will
+ refuse to extract archive entries whose pathnames contain .. or
+ whose target directory would be altered by a symlink. This
+ option suppresses these behaviors.
+
+ -p (x mode only) Preserve file permissions. Attempt to restore the
+ full permissions, including owner, file modes, file flags and
+ ACLs, if available, for each item extracted from the archive. By
+ default, newly-created files are owned by the user running tar,
+ the file mode is restored for newly-created regular files, and
+ all other types of entries receive default permissions. If tar
+ is being run by root, the default is to restore the owner unless
+ the -o option is also specified.
+
+ --strip-components count (-W strip-components=count)
+ (x and t mode only) Remove the specified number of leading path
+ elements. Pathnames with fewer elements will be silently
+ skipped. Note that the pathname is edited after checking inclu-
+ sion/exclusion patterns but before security checks.
+
+ -T filename
+ In x or t mode, tar will read the list of names to be extracted
+ from filename. In c mode, tar will read names to be archived
+ from filename. The special name ``-C'' on a line by itself will
+ cause the current directory to be changed to the directory speci-
+ fied on the following line. Names are terminated by newlines
+ unless --null is specified. Note that --null also disables the
+ special handling of lines containing ``-C''.
+
+ -U (x mode only) Unlink files before creating them. Without this
+ option, tar overwrites existing files, which preserves existing
+ hardlinks. With this option, existing hardlinks will be broken,
+ as will any symlink that would affect the location of an
+ extracted file.
+
+ --use-compress-program program
+ Pipe the input (in x or t mode) or the output (in c mode) through
+ program instead of using the builtin compression support.
+
+ -v Produce verbose output. In create and extract modes, tar will
+ list each file name as it is read from or written to the archive.
+ In list mode, tar will produce output similar to that of ls(1).
+ Additional -v options will provide additional detail.
+
+ -W longopt=value
+ Long options (preceded by --) are only supported directly on sys-
+ tems that have the getopt_long(3) function. The -W option can be
+ used to access long options on systems that do not support this
+ function.
+
+ -w Ask for confirmation for every action.
+
+ -X filename
+ Read a list of exclusion patterns from the specified file. See
+ --exclude for more information about the handling of exclusions.
+
+ -y (c mode only) Compress the resulting archive with bzip2(1). In
+ extract or list modes, this option is ignored. Note that, unlike
+ other tar implementations, this implementation recognizes bzip2
+ compression automatically when reading archives.
+
+ -z (c mode only) Compress the resulting archive with gzip(1). In
+ extract or list modes, this option is ignored. Note that, unlike
+ other tar implementations, this implementation recognizes gzip
+ compression automatically when reading archives.
+
+ENVIRONMENT
+ The following environment variables affect the execution of tar:
+
+ LANG The locale to use. See environ(7) for more information.
+
+ TAPE The default tape device. The -f option overrides this.
+
+ TZ The timezone to use when displaying dates. See environ(7) for
+ more information.
+
+FILES
+ /dev/sa0 The default tape device, if not overridden by the TAPE envi-
+ ronment variable or the -f option.
+
+EXIT STATUS
+ The tar utility exits 0 on success, and >0 if an error occurs.
+
+EXAMPLES
+ The following creates a new archive called file.tar.gz that contains two
+ files source.c and source.h:
+ tar -czf file.tar.gz source.c source.h
+
+ To view a detailed table of contents for this archive:
+ tar -tvf file.tar.gz
+
+ To extract all entries from the archive on the default tape drive:
+ tar -x
+
+ To examine the contents of an ISO 9660 cdrom image:
+ tar -tf image.iso
+
+ To move file hierarchies, invoke tar as
+ tar -cf - -C srcdir . | tar -xpf - -C destdir
+ or more traditionally
+ cd srcdir ; tar -cf - . | (cd destdir ; tar -xpf -)
+
+ In create mode, the list of files and directories to be archived can also
+ include directory change instructions of the form -Cfoo/baz and archive
+ inclusions of the form @archive-file. For example, the command line
+ tar -c -f new.tar foo1 @old.tgz -C/tmp foo2
+ will create a new archive new.tar. tar will read the file foo1 from the
+ current directory and add it to the output archive. It will then read
+ each entry from old.tgz and add those entries to the output archive.
+ Finally, it will switch to the /tmp directory and add foo2 to the output
+ archive.
+
+ The --newer and --newer-mtime switches accept a variety of common date
+ and time specifications, including ``12 Mar 2005 7:14:29pm'',
+ ``2005-03-12 19:14'', ``5 minutes ago'', and ``19:14 PST May 1''.
+
+COMPATIBILITY
+ The bundled-arguments format is supported for compatibility with historic
+ implementations. It consists of an initial word (with no leading - char-
+ acter) in which each character indicates an option. Arguments follow as
+ separate words. The order of the arguments must match the order of the
+ corresponding characters in the bundled command word. For example,
+ tar tbf 32 file.tar
+ specifies three flags t, b, and f. The b and f flags both require argu-
+ ments, so there must be two additional items on the command line. The 32
+ is the argument to the b flag, and file.tar is the argument to the f
+ flag.
+
+ The mode options c, r, t, u, and x and the options b, f, l, m, o, v, and
+ w comply with SUSv2.
+
+ For maximum portability, scripts that invoke tar should use the bundled-
+ argument format above, should limit themselves to the c, t, and x modes,
+ and the b, f, m, v, and w options.
+
+ On systems that support getopt_long(), additional long options are avail-
+ able to improve compatibility with other tar implementations.
+
+SECURITY
+ Certain security issues are common to many archiving programs, including
+ tar. In particular, carefully-crafted archives can request that tar
+ extract files to locations outside of the target directory. This can
+ potentially be used to cause unwitting users to overwrite files they did
+ not intend to overwrite. If the archive is being extracted by the supe-
+ ruser, any file on the system can potentially be overwritten. There are
+ three ways this can happen. Although tar has mechanisms to protect
+ against each one, savvy users should be aware of the implications:
+
+ o Archive entries can have absolute pathnames. By default, tar
+ removes the leading / character from filenames before restoring
+ them to guard against this problem.
+
+ o Archive entries can have pathnames that include .. components.
+ By default, tar will not extract files containing .. components
+ in their pathname.
+
+ o Archive entries can exploit symbolic links to restore files to
+ other directories. An archive can restore a symbolic link to
+ another directory, then use that link to restore a file into that
+ directory. To guard against this, tar checks each extracted path
+ for symlinks. If the final path element is a symlink, it will be
+ removed and replaced with the archive entry. If -U is specified,
+ any intermediate symlink will also be unconditionally removed.
+ If neither -U nor -P is specified, tar will refuse to extract the
+ entry.
+ To protect yourself, you should be wary of any archives that come from
+ untrusted sources. You should examine the contents of an archive with
+ tar -tf filename
+ before extraction. You should use the -k option to ensure that tar will
+ not overwrite any existing files or the -U option to remove any pre-
+ existing files. You should generally not extract archives while running
+ with super-user privileges. Note that the -P option to tar disables the
+ security checks above and allows you to extract an archive while preserv-
+ ing any absolute pathnames, .. components, or symlinks to other directo-
+ ries.
+
+SEE ALSO
+ bzip2(1), cpio(1), gzip(1), mt(1), pax(1), shar(1), libarchive(3),
+ libarchive-formats(5), tar(5)
+
+STANDARDS
+ There is no current POSIX standard for the tar command; it appeared in
+ ISO/IEC 9945-1:1996 (``POSIX.1'') but was dropped from IEEE Std
+ 1003.1-2001 (``POSIX.1''). The options used by this implementation were
+ developed by surveying a number of existing tar implementations as well
+ as the old POSIX specification for tar and the current POSIX specifica-
+ tion for pax.
+
+ The ustar and pax interchange file formats are defined by IEEE Std
+ 1003.1-2001 (``POSIX.1'') for the pax command.
+
+HISTORY
+ A tar command appeared in Seventh Edition Unix, which was released in
+ January, 1979. There have been numerous other implementations, many of
+ which extended the file format. John Gilmore's pdtar public-domain
+ implementation (circa November, 1987) was quite influential, and formed
+ the basis of GNU tar. GNU tar was included as the standard system tar in
+ FreeBSD beginning with FreeBSD 1.0.
+
+ This is a complete re-implementation based on the libarchive(3) library.
+
+BUGS
+ This program follows ISO/IEC 9945-1:1996 (``POSIX.1'') for the definition
+ of the -l option. Note that GNU tar prior to version 1.15 treated -l as
+ a synonym for the --one-file-system option.
+
+ The -C dir option may differ from historic implementations.
+
+ All archive output is written in correctly-sized blocks, even if the out-
+ put is being compressed. Whether or not the last output block is padded
+ to a full block size varies depending on the format and the output
+ device. For tar and cpio formats, the last block of output is padded to
+ a full block size if the output is being written to standard output or to
+ a character or block device such as a tape drive. If the output is being
+ written to a regular file, the last block will not be padded. Many com-
+ pressors, including gzip(1) and bzip2(1), complain about the null padding
+ when decompressing an archive created by tar, although they still extract
+ it correctly.
+
+ The compression and decompression is implemented internally, so there may
+ be insignificant differences between the compressed output generated by
+ tar -czf - file
+ and that generated by
+ tar -cf - file | gzip
+
+ The default should be to read and write archives to the standard I/O
+ paths, but tradition (and POSIX) dictates otherwise.
+
+ The r and u modes require that the archive be uncompressed and located in
+ a regular file on disk. Other archives can be modified using c mode with
+ the @archive-file extension.
+
+ To archive a file called @foo or -foo you must specify it as ./@foo or
+ ./-foo, respectively.
+
+ In create mode, a leading ./ is always removed. A leading / is stripped
+ unless the -P option is specified.
+
+ There needs to be better support for file selection on both create and
+ extract.
+
+ There is not yet any support for multi-volume archives or for archiving
+ sparse files.
+
+ Converting between dissimilar archive formats (such as tar and cpio)
+ using the @- convention can cause hard link information to be lost.
+ (This is a consequence of the incompatible ways that different archive
+ formats store hardlink information.)
+
+ There are alternative long options for many of the short options that are
+ deliberately not documented.
+
+FreeBSD 6.0 April 13, 2004 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/cpio.5 b/archivers/libarchive/files/doc/text/cpio.5
new file mode 100644
index 00000000000..db5da1e9c9b
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/cpio.5
@@ -0,0 +1,235 @@
+CPIO(5) FreeBSD File Formats Manual CPIO(5)
+
+NAME
+ cpio -- format of cpio archive files
+
+DESCRIPTION
+ The cpio archive format collects any number of files, directories, and
+ other file system objects (symbolic links, device nodes, etc.) into a
+ single stream of bytes.
+
+ General Format
+ Each file system object in a cpio archive comprises a header record with
+ basic numeric metadata followed by the full pathname of the entry and the
+ file data. The header record stores a series of integer values that gen-
+ erally follow the fields in struct stat. (See stat(2) for details.) The
+ variants differ primarily in how they store those integers (binary,
+ octal, or hexadecimal). The header is followed by the pathname of the
+ entry (the length of the pathname is stored in the header) and any file
+ data. The end of the archive is indicated by a special record with the
+ pathname ``TRAILER!!!''.
+
+ PWB format
+ XXX Any documentation of the original PWB/UNIX 1.0 format? XXX
+
+ Old Binary Format
+ The old binary cpio format stores numbers as 2-byte and 4-byte binary
+ values. Each entry begins with a header in the following format:
+
+ struct header_old_cpio {
+ unsigned short c_magic;
+ unsigned short c_dev;
+ unsigned short c_ino;
+ unsigned short c_mode;
+ unsigned short c_uid;
+ unsigned short c_gid;
+ unsigned short c_nlink;
+ unsigned short c_rdev;
+ unsigned short c_mtime[2];
+ unsigned short c_namesize;
+ unsigned short c_filesize[2];
+ };
+
+ The unsigned short fields here are 16-bit integer values; the unsigned
+ int fields are 32-bit integer values. The fields are as follows
+
+ magic The integer value octal 070707. This value can be used to deter-
+ mine whether this archive is written with little-endian or big-
+ endian integers.
+
+ dev, ino
+ The device and inode numbers from the disk. These are used by
+ programs that read cpio archives to determine when two entries
+ refer to the same file. Programs that synthesize cpio archives
+ should be careful to set these to distinct values for each entry.
+
+ mode The mode specifies both the regular permissions and the file
+ type. It consists of several bit fields as follows:
+ 0170000 This masks the file type bits.
+ 0140000 File type value for sockets.
+ 0120000 File type value for symbolic links. For symbolic links,
+ the link body is stored as file data.
+ 0100000 File type value for regular files.
+ 0060000 File type value for block special devices.
+ 0040000 File type value for directories.
+ 0020000 File type value for character special devices.
+ 0010000 File type value for named pipes or FIFOs.
+ 0004000 SUID bit.
+ 0002000 SGID bit.
+ 0001000 Sticky bit. On some systems, this modifies the behavior
+ of executables and/or directories.
+ 0000777 The lower 9 bits specify read/write/execute permissions
+ for world, group, and user following standard POSIX con-
+ ventions.
+
+ uid, gid
+ The numeric user id and group id of the owner.
+
+ nlink The number of links to this file. Directories always have a
+ value of at least two here. Note that hardlinked files include
+ file data with every copy in the archive.
+
+ rdev For block special and character special entries, this field con-
+ tains the associated device number. For all other entry types,
+ it should be set to zero by writers and ignored by readers.
+
+ mtime Modification time of the file, indicated as the number of seconds
+ since the start of the epoch, 00:00:00 UTC January 1, 1970. The
+ four-byte integer is stored with the most-significant 16 bits
+ first followed by the least-significant 16 bits. Each of the two
+ 16 bit values are stored in machine-native byte order.
+
+ namesize
+ The number of bytes in the pathname that follows the header.
+ This count includes the trailing NULL byte.
+
+ filesize
+ The size of the file. Note that this archive format is limited
+ to four gigabyte file sizes. See mtime above for a description
+ of the storage of four-byte integers.
+
+ The pathname immediately follows the fixed header. If the namesize is
+ odd, an additional NULL byte is added after the pathname. The file data
+ is then appended, padded with NULL bytes to an even length.
+
+ Hardlinked files are not given special treatment; the full file contents
+ are included with each copy of the file.
+
+ Portable ASCII Format
+ Version 2 of the Single UNIX Specification (``SUSv2'') standardized an
+ ASCII variant that is portable across all platforms. It is commonly
+ known as the ``old character'' format or as the ``odc'' format. It
+ stores the same numeric fields as the old binary format, but represents
+ them as 6-character or 11-character octal values.
+
+ struct cpio_odc_header {
+ char c_magic[6];
+ char c_dev[6];
+ char c_ino[6];
+ char c_mode[6];
+ char c_uid[6];
+ char c_gid[6];
+ char c_nlink[6];
+ char c_rdev[6];
+ char c_mtime[11];
+ char c_namesize[6];
+ char c_filesize[11];
+ };
+
+ The fields are identical to those in the old binary format. The name and
+ file body follow the fixed header. Unlike the old binary format, there
+ is no additional padding after the pathname or file contents. If the
+ files being archived are themselves entirely ASCII, then the resulting
+ archive will be entirely ASCII, except for the NULL byte that terminates
+ the name field.
+
+ New ASCII Format
+ The "new" ASCII format uses 8-byte hexadecimal fields for all numbers and
+ separates device numbers into separate fields for major and minor num-
+ bers.
+
+ struct cpio_newc_header {
+ char c_magic[6];
+ char c_ino[8];
+ char c_mode[8];
+ char c_uid[8];
+ char c_gid[8];
+ char c_nlink[8];
+ char c_mtime[8];
+ char c_filesize[8];
+ char c_devmajor[8];
+ char c_devminor[8];
+ char c_rdevmajor[8];
+ char c_rdevminor[8];
+ char c_namesize[8];
+ char c_check[8];
+ };
+
+ Except as specified below, the fields here match those specified for the
+ old binary format above.
+
+ magic The string ``070701''.
+
+ check This field is always set to zero by writers and ignored by read-
+ ers. See the next section for more details.
+
+ The pathname is followed by NULL bytes so that the total size of the
+ fixed header plus pathname is a multiple of four. Likewise, the file
+ data is padded to a multiple of four bytes. Note that this format sup-
+ ports only 4 gigabyte files (unlike the older ASCII format, which sup-
+ ports 8 gigabyte files).
+
+ In this format, hardlinked files are handled by setting the filesize to
+ zero for each entry except the last one that appears in the archive.
+
+ New CRC Format
+ The CRC format is identical to the new ASCII format described in the pre-
+ vious section except that the magic field is set to ``070702'' and the
+ check field is set to the sum of all bytes in the file data. This sum is
+ computed treating all bytes as unsigned values and using unsigned arith-
+ metic. Only the least-significant 32 bits of the sum are stored.
+
+ HP variants
+ The cpio implementation distributed with HPUX used XXXX but stored device
+ numbers differently XXX.
+
+ Other Extensions and Variants
+ Sun Solaris uses additional file types to store extended file data,
+ including ACLs and extended attributes, as special entries in cpio ar-
+ chives.
+
+ XXX Others? XXX
+
+BUGS
+ The ``CRC'' format is mis-named, as it uses a simple checksum and not a
+ cyclic redundancy check.
+
+ The old binary format is limited to 16 bits for user id, group id,
+ device, and inode numbers. It is limited to 4 gigabyte file sizes.
+
+ The old ASCII format is limited to 18 bits for the user id, group id,
+ device, and inode numbers. It is limited to 8 gigabyte file sizes.
+
+ The new ASCII format is limited to 4 gigabyte file sizes.
+
+ None of the cpio formats store user or group names, which are essential
+ when moving files between systems with dissimilar user or group number-
+ ing.
+
+ Especially when writing older cpio variants, it may be necessary to map
+ actual device/inode values to synthesized values that fit the available
+ fields. With very large filesystems, this may be necessary even for the
+ newer formats.
+
+SEE ALSO
+ cpio(1), tar(5)
+
+STANDARDS
+ The cpio utility is no longer a part of POSIX or the Single Unix Stan-
+ dard. It last appeared in Version 2 of the Single UNIX Specification
+ (``SUSv2''). It has been supplanted in subsequent standards by pax(1).
+ The portable ASCII format is currently part of the specification for the
+ pax(1) utility.
+
+HISTORY
+ The original cpio utility was written by Dick Haight while working in
+ AT&T's Unix Support Group. It appeared in 1977 as part of PWB/UNIX 1.0,
+ the ``Programmer's Work Bench'' derived from Version 6 AT&T UNIX that was
+ used internally at AT&T. Both the old binary and old character formats
+ were in use by 1980, according to the System III source released by SCO
+ under their ``Ancient Unix'' license. The character format was adopted
+ as part of IEEE Std 1003.1-1988 (``POSIX.1''). XXX when did "newc"
+ appear? Who invented it? When did HP come out with their variant? When
+ did Sun introduce ACLs and extended attributes? XXX
+
+FreeBSD 6.0 October 5, 2007 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/libarchive-formats.5 b/archivers/libarchive/files/doc/text/libarchive-formats.5
new file mode 100644
index 00000000000..35eb2783bab
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/libarchive-formats.5
@@ -0,0 +1,180 @@
+libarchive-formats(3) FreeBSD Library Functions Manual libarchive-formats(3)
+
+NAME
+ libarchive-formats -- archive formats supported by the libarchive library
+
+DESCRIPTION
+ The libarchive(3) library reads and writes a variety of streaming archive
+ formats. Generally speaking, all of these archive formats consist of a
+ series of ``entries''. Each entry stores a single file system object,
+ such as a file, directory, or symbolic link.
+
+ The following provides a brief description of each format supported by
+ libarchive, with some information about recognized extensions or limita-
+ tions of the current library support. Note that just because a format is
+ supported by libarchive does not imply that a program that uses
+ libarchive will support that format. Applications that use libarchive
+ specify which formats they wish to support.
+
+ Tar Formats
+ The libarchive(3) library can read most tar archives. However, it only
+ writes POSIX-standard ``ustar'' and ``pax interchange'' formats.
+
+ All tar formats store each entry in one or more 512-byte records. The
+ first record is used for file metadata, including filename, timestamp,
+ and mode information, and the file data is stored in subsequent records.
+ Later variants have extended this by either appropriating undefined areas
+ of the header record, extending the header to multiple records, or by
+ storing special entries that modify the interpretation of subsequent
+ entries.
+
+ gnutar The libarchive(3) library can read GNU-format tar archives. It
+ currently supports the most popular GNU extensions, including
+ modern long filename and linkname support, as well as atime and
+ ctime data. The libarchive library does not support multi-volume
+ archives, nor the old GNU long filename format. It can read GNU
+ sparse file entries, including the new POSIX-based formats, but
+ cannot write GNU sparse file entries.
+
+ pax The libarchive(3) library can read and write POSIX-compliant pax
+ interchange format archives. Pax interchange format archives are
+ an extension of the older ustar format that adds a separate entry
+ with additional attributes stored as key/value pairs. The pres-
+ ence of this additional entry is the only difference between pax
+ interchange format and the older ustar format. The extended
+ attributes are of unlimited length and are stored as UTF-8 Uni-
+ code strings. Keywords defined in the standard are in all lower-
+ case; vendors are allowed to define custom keys by preceding them
+ with the vendor name in all uppercase. When writing pax ar-
+ chives, libarchive uses many of the SCHILY keys defined by Joerg
+ Schilling's ``star'' archiver. The libarchive library can read
+ most of the SCHILY keys. It silently ignores any keywords that
+ it does not understand.
+
+ restricted pax
+ The libarchive library can also write pax archives in which it
+ attempts to suppress the extended attributes entry whenever pos-
+ sible. The result will be identical to a ustar archive unless
+ the extended attributes entry is required to store a long file
+ name, long linkname, extended ACL, file flags, or if any of the
+ standard ustar data (user name, group name, UID, GID, etc) cannot
+ be fully represented in the ustar header. In all cases, the
+ result can be dearchived by any program that can read POSIX-com-
+ pliant pax interchange format archives. Programs that correctly
+ read ustar format (see below) will also be able to read this for-
+ mat; any extended attributes will be extracted as separate files
+ stored in PaxHeader directories.
+
+ ustar The libarchive library can both read and write this format. This
+ format has the following limitations:
+ o Device major and minor numbers are limited to 21 bits. Nodes
+ with larger numbers will not be added to the archive.
+ o Path names in the archive are limited to 255 bytes. (Shorter
+ if there is no / character in exactly the right place.)
+ o Symbolic links and hard links are stored in the archive with
+ the name of the referenced file. This name is limited to 100
+ bytes.
+ o Extended attributes, file flags, and other extended security
+ information cannot be stored.
+ o Archive entries are limited to 2 gigabytes in size.
+ Note that the pax interchange format has none of these restric-
+ tions.
+
+ The libarchive library can also read a variety of commonly-used exten-
+ sions to the basic tar format. In particular, it supports base-256 val-
+ ues in certain numeric fields. This essentially removes the limitations
+ on file size, modification time, and device numbers.
+
+ The first tar program appeared in Seventh Edition Unix in 1979. The
+ first official standard for the tar file format was the ``ustar'' (Unix
+ Standard Tar) format defined by POSIX in 1988. POSIX.1-2001 extended the
+ ustar format to create the ``pax interchange'' format.
+
+ Cpio Formats
+ The libarchive library can read a number of common cpio variants and can
+ write ``odc'' and ``newc'' format archives. A cpio archive stores each
+ entry as a fixed-size header followed by a variable-length filename and
+ variable-length data. Unlike tar, cpio does only minimal padding of the
+ header or file data. There are a variety of cpio formats, which differ
+ primarily in how they store the initial header: some store the values as
+ octal or hexadecimal numbers in ASCII, others as binary values of varying
+ byte order and length.
+
+ binary The libarchive library can read both big-endian and little-endian
+ variants of the original binary cpio format. This format used
+ 32-bit binary values for file size and mtime, and 16-bit binary
+ values for the other fields.
+
+ odc The libarchive library can both read and write this POSIX-stan-
+ dard format. This format stores the header contents as octal
+ values in ASCII. It is standard, portable, and immune from byte-
+ order confusion. File sizes and mtime are limited to 33 bits
+ (8GB file size), other fields are limited to 18 bits.
+
+ SVR4 The libarchive library can read both CRC and non-CRC variants of
+ this format. The SVR4 format uses eight-digit hexadecimal values
+ for all header fields. This limits file size to 4GB, and also
+ limits the mtime and other fields to 32 bits. The SVR4 format
+ can optionally include a CRC of the file contents, although
+ libarchive does not currently verify this CRC.
+
+ Cpio first appeared in PWB/UNIX 1.0, which was released within AT&T in
+ 1977. PWB/UNIX 1.0 formed the basis of System III Unix, released outside
+ of AT&T in 1981. This makes cpio older than tar, although cpio was not
+ included in Version 7 AT&T Unix. As a result, the tar command became
+ much better known in universities and research groups that used Version
+ 7. The combination of the find and cpio utilities provided very precise
+ control over file selection. Unfortunately, the format has many limita-
+ tions that make it unsuitable for widespread use. Only the POSIX format
+ permits files over 4GB, and its 18-bit limit for most other fields makes
+ it unsuitable for modern systems. In addition, cpio formats only store
+ numeric UID/GID values (not usernames and group names), which can make it
+ very difficult to correctly transfer archives across systems with dissim-
+ ilar user numbering.
+
+ Shar Formats
+ A ``shell archive'' is a shell script that, when executed on a POSIX-com-
+ pliant system, will recreate a collection of file system objects. The
+ libarchive library can write two different kinds of shar archives:
+
+ shar The traditional shar format uses a limited set of POSIX commands,
+ including echo(1), mkdir(1), and sed(1). It is suitable for
+ portably archiving small collections of plain text files. How-
+ ever, it is not generally well-suited for large archives (many
+ implementations of sh(1) have limits on the size of a script) nor
+ should it be used with non-text files.
+
+ shardump
+ This format is similar to shar but encodes files using
+ uuencode(1) so that the result will be a plain text file regard-
+ less of the file contents. It also includes additional shell
+ commands that attempt to reproduce as many file attributes as
+ possible, including owner, mode, and flags. The additional com-
+ mands used to restore file attributes make shardump archives less
+ portable than plain shar archives.
+
+ ISO9660 format
+ Libarchive can read and extract from files containing ISO9660-compliant
+ CDROM images. It also has partial support for Rockridge extensions. In
+ many cases, this can remove the need to burn a physical CDROM. It also
+ avoids security and complexity issues that come with virtual mounts and
+ loopback devices.
+
+ Zip format
+ Libarchive can extract from most zip format archives. It currently only
+ supports uncompressed entries and entries compressed with the ``deflate''
+ algorithm. Older zip compression algorithms are not supported.
+
+ Archive (library) file format
+ The Unix archive format (commonly created by the ar(1) archiver) is a
+ general-purpose format which is used almost exclusively for object files
+ to be read by the link editor ld(1). The ar format has never been stan-
+ dardised. 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.
+
+SEE ALSO
+ ar(1), cpio(1), mkisofs(1), shar(1), tar(1), zip(1), zlib(3), cpio(5),
+ mtree(5), tar(5)
+
+FreeBSD 6.0 April 27, 2004 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/libarchive.3 b/archivers/libarchive/files/doc/text/libarchive.3
new file mode 100644
index 00000000000..f4925f08ae8
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/libarchive.3
@@ -0,0 +1,185 @@
+LIBARCHIVE(3) FreeBSD Library Functions Manual LIBARCHIVE(3)
+
+NAME
+ libarchive -- functions for reading and writing streaming archives
+
+LIBRARY
+ Streaming Archive Library (libarchive, -larchive)
+
+OVERVIEW
+ The libarchive library provides a flexible interface for reading and
+ writing streaming archive files such as tar and cpio. The library is
+ inherently stream-oriented; readers serially iterate through the archive,
+ writers serially add things to the archive. In particular, note that
+ there is no built-in support for random access nor for in-place modifica-
+ tion.
+
+ When reading an archive, the library automatically detects the format and
+ the compression. The library currently has read support for:
+ o old-style tar archives,
+ o most variants of the POSIX ``ustar'' format,
+ o the POSIX ``pax interchange'' format,
+ o GNU-format tar archives,
+ o most common cpio archive formats,
+ o ISO9660 CD images (with or without RockRidge extensions),
+ o Zip archives.
+ The library automatically detects archives compressed with gzip(1),
+ bzip2(1), or compress(1) and decompresses them transparently.
+
+ When writing an archive, you can specify the compression to be used and
+ the format to use. The library can write
+ o POSIX-standard ``ustar'' archives,
+ o POSIX ``pax interchange format'' archives,
+ o POSIX octet-oriented cpio archives,
+ o two different variants of shar archives.
+ Pax interchange format is an extension of the tar archive format that
+ eliminates essentially all of the limitations of historic tar formats in
+ a standard fashion that is supported by POSIX-compliant pax(1) implemen-
+ tations on many systems as well as several newer implementations of
+ tar(1). Note that the default write format will suppress the pax
+ extended attributes for most entries; explicitly requesting pax format
+ will enable those attributes for all entries.
+
+ The read and write APIs are accessed through the archive_read_XXX() func-
+ tions and the archive_write_XXX() functions, respectively, and either can
+ be used independently of the other.
+
+ The rest of this manual page provides an overview of the library opera-
+ tion. More detailed information can be found in the individual manual
+ pages for each API or utility function.
+
+READING AN ARCHIVE
+ To read an archive, you must first obtain an initialized struct archive
+ object from archive_read_new(). You can then modify this object for the
+ desired operations with the various archive_read_set_XXX() and
+ archive_read_support_XXX() functions. In particular, you will need to
+ invoke appropriate archive_read_support_XXX() functions to enable the
+ corresponding compression and format support. Note that these latter
+ functions perform two distinct operations: they cause the corresponding
+ support code to be linked into your program, and they enable the corre-
+ sponding auto-detect code. Unless you have specific constraints, you
+ will generally want to invoke archive_read_support_compression_all() and
+ archive_read_support_format_all() to enable auto-detect for all formats
+ and compression types currently supported by the library.
+
+ Once you have prepared the struct archive object, you call
+ archive_read_open() to actually open the archive and prepare it for read-
+ ing. There are several variants of this function; the most basic expects
+ you to provide pointers to several functions that can provide blocks of
+ bytes from the archive. There are convenience forms that allow you to
+ specify a filename, file descriptor, FILE * object, or a block of memory
+ from which to read the archive data. Note that the core library makes no
+ assumptions about the size of the blocks read; callback functions are
+ free to read whatever block size is most appropriate for the medium.
+
+ Each archive entry consists of a header followed by a certain amount of
+ data. You can obtain the next header with archive_read_next_header(),
+ which returns a pointer to an struct archive_entry structure with infor-
+ mation about the current archive element. If the entry is a regular
+ file, then the header will be followed by the file data. You can use
+ archive_read_data() (which works much like the read(2) system call) to
+ read this data from the archive. You may prefer to use the higher-level
+ archive_read_data_skip(), which reads and discards the data for this
+ entry, archive_read_data_to_buffer(), which reads the data into an in-
+ memory buffer, archive_read_data_to_file(), which copies the data to the
+ provided file descriptor, or archive_read_extract(), which recreates the
+ specified entry on disk and copies data from the archive. In particular,
+ note that archive_read_extract() uses the struct archive_entry structure
+ that you provide it, which may differ from the entry just read from the
+ archive. In particular, many applications will want to override the
+ pathname, file permissions, or ownership.
+
+ Once you have finished reading data from the archive, you should call
+ archive_read_close() to close the archive, then call
+ archive_read_finish() to release all resources, including all memory
+ allocated by the library.
+
+ The archive_read(3) manual page provides more detailed calling informa-
+ tion for this API.
+
+WRITING AN ARCHIVE
+ You use a similar process to write an archive. The archive_write_new()
+ function creates an archive object useful for writing, the various
+ archive_write_set_XXX() functions are used to set parameters for writing
+ the archive, and archive_write_open() completes the setup and opens the
+ archive for writing.
+
+ Individual archive entries are written in a three-step process: You first
+ initialize a struct archive_entry structure with information about the
+ new entry. At a minimum, you should set the pathname of the entry and
+ provide a struct stat with a valid st_mode field, which specifies the
+ type of object and st_size field, which specifies the size of the data
+ portion of the object. The archive_write_header() function actually
+ writes the header data to the archive. You can then use
+ archive_write_data() to write the actual data.
+
+ After all entries have been written, use the archive_write_finish() func-
+ tion to release all resources.
+
+ The archive_write(3) manual page provides more detailed calling informa-
+ tion for this API.
+
+DESCRIPTION
+ Detailed descriptions of each function are provided by the corresponding
+ manual pages.
+
+ All of the functions utilize an opaque struct archive datatype that pro-
+ vides access to the archive contents.
+
+ The struct archive_entry structure contains a complete description of a
+ single archive entry. It uses an opaque interface that is fully docu-
+ mented in archive_entry(3).
+
+ Users familiar with historic formats should be aware that the newer vari-
+ ants have eliminated most restrictions on the length of textual fields.
+ Clients should not assume that filenames, link names, user names, or
+ group names are limited in length. In particular, pax interchange format
+ can easily accommodate pathnames in arbitrary character sets that exceed
+ PATH_MAX.
+
+RETURN VALUES
+ Most functions return zero on success, non-zero on error. The return
+ value indicates the general severity of the error, ranging from
+ ARCHIVE_WARN, which indicates a minor problem that should probably be
+ reported to the user, to ARCHIVE_FATAL, which indicates a serious problem
+ that will prevent any further operations on this archive. On error, the
+ archive_errno() function can be used to retrieve a numeric error code
+ (see errno(2)). The archive_error_string() returns a textual error mes-
+ sage suitable for display.
+
+ archive_read_new() and archive_write_new() return pointers to an allo-
+ cated and initialized struct archive object.
+
+ archive_read_data() and archive_write_data() return a count of the number
+ of bytes actually read or written. A value of zero indicates the end of
+ the data for this entry. A negative value indicates an error, in which
+ case the archive_errno() and archive_error_string() functions can be used
+ to obtain more information.
+
+ENVIRONMENT
+ There are character set conversions within the archive_entry(3) functions
+ that are impacted by the currently-selected locale.
+
+SEE ALSO
+ tar(1), archive_entry(3), archive_read(3), archive_util(3),
+ archive_write(3), tar(5)
+
+HISTORY
+ The libarchive library first appeared in FreeBSD 5.3.
+
+AUTHORS
+ The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+
+BUGS
+ Some archive formats support information that is not supported by struct
+ archive_entry. Such information cannot be fully archived or restored
+ using this library. This includes, for example, comments, character
+ sets, or the arbitrary key/value pairs that can appear in pax interchange
+ format archives.
+
+ Conversely, of course, not all of the information that can be stored in
+ an struct archive_entry is supported by all formats. For example, cpio
+ formats do not support nanosecond timestamps; old tar formats do not sup-
+ port large device numbers.
+
+FreeBSD 6.0 August 19, 2006 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/libarchive_internals.3 b/archivers/libarchive/files/doc/text/libarchive_internals.3
new file mode 100644
index 00000000000..4e398a1b3dc
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/libarchive_internals.3
@@ -0,0 +1,248 @@
+LIBARCHIVE(3) FreeBSD Library Functions Manual LIBARCHIVE(3)
+
+NAME
+ libarchive_internals -- description of libarchive internal interfaces
+
+OVERVIEW
+ The libarchive library provides a flexible interface for reading and
+ writing streaming archive files such as tar and cpio. Internally, it
+ follows a modular layered design that should make it easy to add new ar-
+ chive and compression formats.
+
+GENERAL ARCHITECTURE
+ Externally, libarchive exposes most operations through an opaque, object-
+ style interface. The archive_entry(1) objects store information about a
+ single filesystem object. The rest of the library provides facilities to
+ write archive_entry(1) objects to archive files, read them from archive
+ files, and write them to disk. (There are plans to add a facility to
+ read archive_entry(1) objects from disk as well.)
+
+ The read and write APIs each have four layers: a public API layer, a for-
+ mat layer that understands the archive file format, a compression layer,
+ and an I/O layer. The I/O layer is completely exposed to clients who can
+ replace it entirely with their own functions.
+
+ In order to provide as much consistency as possible for clients, some
+ public functions are virtualized. Eventually, it should be possible for
+ clients to open an archive or disk writer, and then use a single set of
+ code to select and write entries, regardless of the target.
+
+READ ARCHITECTURE
+ From the outside, clients use the archive_read(3) API to manipulate an
+ archive object to read entries and bodies from an archive stream. Inter-
+ nally, the archive object is cast to an archive_read object, which holds
+ all read-specific data. The API has four layers: The lowest layer is the
+ I/O layer. This layer can be overridden by clients, but most clients use
+ the packaged I/O callbacks provided, for example, by
+ archive_read_open_memory(3), and archive_read_open_fd(3). The compres-
+ sion layer calls the I/O layer to read bytes and decompresses them for
+ the format layer. The format layer unpacks a stream of uncompressed
+ bytes and creates archive_entry objects from the incoming data. The API
+ layer tracks overall state (for example, it prevents clients from reading
+ data before reading a header) and invokes the format and compression
+ layer operations through registered function pointers. In particular,
+ the API layer drives the format-detection process: When opening the ar-
+ chive, it reads an initial block of data and offers it to each registered
+ compression handler. The one with the highest bid is initialized with
+ the first block. Similarly, the format handlers are polled to see which
+ handler is the best for each archive. (Prior to 2.4.0, the format bid-
+ ders were invoked for each entry, but this design hindered error recov-
+ ery.)
+
+ I/O Layer and Client Callbacks
+ The read API goes to some lengths to be nice to clients. As a result,
+ there are few restrictions on the behavior of the client callbacks.
+
+ The client read callback is expected to provide a block of data on each
+ call. A zero-length return does indicate end of file, but otherwise
+ blocks may be as small as one byte or as large as the entire file. In
+ particular, blocks may be of different sizes.
+
+ The client skip callback returns the number of bytes actually skipped,
+ which may be much smaller than the skip requested. The only requirement
+ is that the skip not be larger. In particular, clients are allowed to
+ return zero for any skip that they don't want to handle. The skip call-
+ back must never be invoked with a negative value.
+
+ Keep in mind that not all clients are reading from disk: clients reading
+ from networks may provide different-sized blocks on every request and
+ cannot skip at all; advanced clients may use mmap(2) to read the entire
+ file into memory at once and return the entire file to libarchive as a
+ single block; other clients may begin asynchronous I/O operations for the
+ next block on each request.
+
+ Decompresssion Layer
+ The decompression layer not only handles decompression, it also buffers
+ data so that the format handlers see a much nicer I/O model. The decom-
+ pression API is a two stage peek/consume model. A read_ahead request
+ specifies a minimum read amount; the decompression layer must provide a
+ pointer to at least that much data. If more data is immediately avail-
+ able, it should return more: the format layer handles bulk data reads by
+ asking for a minimum of one byte and then copying as much data as is
+ available.
+
+ A subsequent call to the consume() function advances the read pointer.
+ Note that data returned from a read_ahead() call is guaranteed to remain
+ in place until the next call to read_ahead(). Intervening calls to
+ consume() should not cause the data to move.
+
+ Skip requests must always be handled exactly. Decompression handlers
+ that cannot seek forward should not register a skip handler; the API
+ layer fills in a generic skip handler that reads and discards data.
+
+ A decompression handler has a specific lifecycle:
+ Registration/Configuration
+ When the client invokes the public support function, the decom-
+ pression handler invokes the internal
+ __archive_read_register_compression() function to provide bid and
+ initialization functions. This function returns NULL on error or
+ else a pointer to a struct decompressor_t. This structure con-
+ tains a void * config slot that can be used for storing any cus-
+ tomization information.
+ Bid The bid function is invoked with a pointer and size of a block of
+ data. The decompressor can access its config data through the
+ decompressor element of the archive_read object. The bid func-
+ tion is otherwise stateless. In particular, it must not perform
+ any I/O operations.
+
+ The value returned by the bid function indicates its suitability
+ for handling this data stream. A bid of zero will ensure that
+ this decompressor is never invoked. Return zero if magic number
+ checks fail. Otherwise, your initial implementation should
+ return the number of bits actually checked. For example, if you
+ verify two full bytes and three bits of another byte, bid 19.
+ Note that the initial block may be very short; be careful to only
+ inspect the data you are given. (The current decompressors
+ require two bytes for correct bidding.)
+ Initialize
+ The winning bidder will have its init function called. This
+ function should initialize the remaining slots of the struct
+ decompressor_t object pointed to by the decompressor element of
+ the archive_read object. In particular, it should allocate any
+ working data it needs in the data slot of that structure. The
+ init function is called with the block of data that was used for
+ tasting. At this point, the decompressor is responsible for all
+ I/O requests to the client callbacks. The decompressor is free
+ to read more data as and when necessary.
+ Satisfy I/O requests
+ The format handler will invoke the read_ahead, consume, and skip
+ functions as needed.
+ Finish The finish method is called only once when the archive is closed.
+ It should release anything stored in the data and config slots of
+ the decompressor object. It should not invoke the client close
+ callback.
+
+ Format Layer
+ The read formats have a similar lifecycle to the decompression handlers:
+ Registration
+ Allocate your private data and initialize your pointers.
+ Bid Formats bid by invoking the read_ahead() decompression method but
+ not calling the consume() method. This allows each bidder to
+ look ahead in the input stream. Bidders should not look further
+ ahead than necessary, as long look aheads put pressure on the
+ decompression layer to buffer lots of data. Most formats only
+ require a few hundred bytes of look ahead; look aheads of a few
+ kilobytes are reasonable. (The ISO9660 reader sometimes looks
+ ahead by 48k, which should be considered an upper limit.)
+ Read header
+ The header read is usually the most complex part of any format.
+ There are a few strategies worth mentioning: For formats such as
+ tar or cpio, reading and parsing the header is straightforward
+ since headers alternate with data. For formats that store all
+ header data at the beginning of the file, the first header read
+ request may have to read all headers into memory and store that
+ data, sorted by the location of the file data. Subsequent header
+ read requests will skip forward to the beginning of the file data
+ and return the corresponding header.
+ Read Data
+ The read data interface supports sparse files; this requires that
+ each call return a block of data specifying the file offset and
+ size. This may require you to carefully track the location so
+ that you can return accurate file offsets for each read. Remem-
+ ber that the decompressor will return as much data as it has.
+ Generally, you will want to request one byte, examine the return
+ value to see how much data is available, and possibly trim that
+ to the amount you can use. You should invoke consume for each
+ block just before you return it.
+ Skip All Data
+ The skip data call should skip over all file data and trailing
+ padding. This is called automatically by the API layer just
+ before each header read. It is also called in response to the
+ client calling the public data_skip() function.
+ Cleanup
+ On cleanup, the format should release all of its allocated mem-
+ ory.
+
+ API Layer
+ XXX to do XXX
+
+WRITE ARCHITECTURE
+ The write API has a similar set of four layers: an API layer, a format
+ layer, a compression layer, and an I/O layer. The registration here is
+ much simpler because only one format and one compression can be regis-
+ tered at a time.
+
+ I/O Layer and Client Callbacks
+ XXX To be written XXX
+
+ Compression Layer
+ XXX To be written XXX
+
+ Format Layer
+ XXX To be written XXX
+
+ API Layer
+ XXX To be written XXX
+
+WRITE_DISK ARCHITECTURE
+ The write_disk API is intended to look just like the write API to
+ clients. Since it does not handle multiple formats or compression, it is
+ not layered internally.
+
+GENERAL SERVICES
+ The archive_read, archive_write, and archive_write_disk objects all con-
+ tain an initial archive object which provides common support for a set of
+ standard services. (Recall that ANSI/ISO C90 guarantees that you can
+ cast freely between a pointer to a structure and a pointer to the first
+ element of that structure.) The archive object has a magic value that
+ indicates which API this object is associated with, slots for storing
+ error information, and function pointers for virtualized API functions.
+
+MISCELLANEOUS NOTES
+ Connecting existing archiving libraries into libarchive is generally
+ quite difficult. In particular, many existing libraries strongly assume
+ that you are reading from a file; they seek forwards and backwards as
+ necessary to locate various pieces of information. In contrast,
+ libarchive never seeks backwards in its input, which sometimes requires
+ very different approaches.
+
+ For example, libarchive's ISO9660 support operates very differently from
+ most ISO9660 readers. The libarchive support utilizes a work-queue
+ design that keeps a list of known entries sorted by their location in the
+ input. Whenever libarchive's ISO9660 implementation is asked for the
+ next header, checks this list to find the next item on the disk. Direc-
+ tories are parsed when they are encountered and new items are added to
+ the list. This design relies heavily on the ISO9660 image being opti-
+ mized so that directories always occur earlier on the disk than the files
+ they describe.
+
+ Depending on the specific format, such approaches may not be possible.
+ The ZIP format specification, for example, allows archivers to store key
+ information only at the end of the file. In theory, it is possible to
+ create ZIP archives that cannot be read without seeking. Fortunately,
+ such archives are very rare, and libarchive can read most ZIP archives,
+ though it cannot always extract as much information as a dedicated ZIP
+ program.
+
+SEE ALSO
+ archive(3), archive_entry(3), archive_read(3), archive_write(3),
+ archive_write_disk(3)
+
+HISTORY
+ The libarchive library first appeared in FreeBSD 5.3.
+
+AUTHORS
+ The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+
+BUGS
+FreeBSD 6.0 April 16, 2007 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/mtree.5 b/archivers/libarchive/files/doc/text/mtree.5
new file mode 100644
index 00000000000..1e5eb4f42b0
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/mtree.5
@@ -0,0 +1,158 @@
+MTREE(5) FreeBSD File Formats Manual MTREE(5)
+
+NAME
+ mtree -- format of mtree dir heirarchy files
+
+DESCRIPTION
+ The mtree format is a textual format that describes a collection of
+ filesystem objects. Such files are typically used to create or verify
+ directory heirarchies.
+
+ General Format
+ An mtree file consists of a series of lines, each providing information
+ about a single filesystem object. Leading whitespace is always ignored.
+
+ When encoding file or pathnames, any backslash character or character
+ outside of the 95 printable ASCII characters must be encoded as a a back-
+ slash followed by three octal digits. When reading mtree files, any
+ appearance of a backslash followed by three octal digits should be con-
+ verted into the corresponding character.
+
+ Each line is interpreted independently as one of the following types:
+
+ Signature The first line of any mtree file must begin with ``#mtree''.
+ If a file contains any full path entries, the first line
+ should begin with ``#mtree v2.0'', otherwise, the first line
+ should begin with ``#mtree v1.0''.
+
+ Blank Blank lines are ignored.
+
+ Comment Lines beginning with # are ignored.
+
+ Special Lines beginning with / are special commands that influence
+ the interpretation of later lines.
+
+ Relative If the first whitespace-delimited word has no / characters,
+ it is the name of a file in the current directory. Any rela-
+ tive entry that describes a directory changes the current
+ directory.
+
+ dot-dot As a special case, a relative entry with the filename ..
+ changes the current directory to the parent directory.
+ Options on dot-dot entries are always ignored.
+
+ Full If the first whitespace-delimited word has a / character
+ after the first character, it is the pathname of a file rela-
+ tive to the starting directory. There can be multiple full
+ entries describing the same file.
+
+ Some tools that process mtree files may require that multiple lines
+ describing the same file occur consecutively. It is not permitted for
+ the same file to be mentioned using both a relative and a full file spec-
+ ification.
+
+ Special commands
+ Two special commands are currently defined:
+
+ /set This command defines default values for one or more keywords.
+ It is followed on the same line by one or more whitespace-
+ separated keyword definitions. These definitions apply to
+ all following files that do not specify a value for that key-
+ word.
+
+ /unset This command removes any default value set by a previous /set
+ command. It is followed on the same line by one or more key-
+ words separated by whitespace.
+
+ Keywords
+ After the filename, a full or relative entry consists of zero or more
+ whitespace-separated keyword definitions. Each such definitions consists
+ of a key from the following list immediately followed by an '=' sign and
+ a value. Software programs reading mtree files should warn about unrec-
+ ognized keywords.
+
+ Currently supported keywords are as follows:
+
+ cksum The checksum of the file using the default algorithm speci-
+ fied by the cksum(1) utility.
+
+ contents The full pathname of a file whose contents should be compared
+ to the contents of this file.
+
+ flags The file flags as a symbolic name. See chflags(1) for infor-
+ mation on these names. If no flags are to be set the string
+ ``none'' may be used to override the current default.
+
+ ignore Ignore any file hierarchy below this file.
+
+ gid The file group as a numeric value.
+
+ gname The file group as a symbolic name.
+
+ md5 The MD5 message digest of the file.
+
+ md5digest A synonym for md5.
+
+ sha1 The FIPS 160-1 (``SHA-1'') message digest of the file.
+
+ sha1digest A synonym for sha1.
+
+ sha256 The FIPS 180-2 (``SHA-256'') message digest of the file.
+
+ sha256digest
+ A synonym for sha256.
+
+ ripemd160digest
+ The RIPEMD160 message digest of the file.
+
+ rmd160 A synonym for ripemd160digest.
+
+ rmd160digest
+ A synonym for ripemd160digest.
+
+ mode The current file's permissions as a numeric (octal) or sym-
+ bolic value.
+
+ nlink The number of hard links the file is expected to have.
+
+ nochange Make sure this file or directory exists but otherwise ignore
+ all attributes.
+
+ uid The file owner as a numeric value.
+
+ uname The file owner as a symbolic name.
+
+ size The size, in bytes, of the file.
+
+ link The file the symbolic link is expected to reference.
+
+ time The last modification time of the file.
+
+ type The type of the file; may be set to any one of the following:
+
+ block block special device
+ char character special device
+ dir directory
+ fifo fifo
+ file regular file
+ link symbolic link
+ socket socket
+
+SEE ALSO
+ cksum(1), find(1), mtree(8)
+
+BUGS
+ The FreeBSD implementation of mtree does not currently support the mtree
+ 2.0 format. The requirement for a ``#mtree'' signature line is new and
+ not yet widely implemented.
+
+HISTORY
+ The mtree utility appeared in 4.3BSD-Reno. The MD5 digest capability was
+ added in FreeBSD 2.1, in response to the widespread use of programs which
+ can spoof cksum(1). The SHA-1 and RIPEMD160 digests were added in
+ FreeBSD 4.0, as new attacks have demonstrated weaknesses in MD5. The
+ SHA-256 digest was added in FreeBSD 6.0. Support for file flags was
+ added in FreeBSD 4.0, and mostly comes from NetBSD. The ``full'' entry
+ format was added by NetBSD.
+
+FreeBSD 6.0 August 20, 2007 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/text/tar.5 b/archivers/libarchive/files/doc/text/tar.5
new file mode 100644
index 00000000000..24b77e15984
--- /dev/null
+++ b/archivers/libarchive/files/doc/text/tar.5
@@ -0,0 +1,534 @@
+TAR(5) FreeBSD File Formats Manual TAR(5)
+
+NAME
+ tar -- format of tape archive files
+
+DESCRIPTION
+ The tar archive format collects any number of files, directories, and
+ other file system objects (symbolic links, device nodes, etc.) into a
+ single stream of bytes. The format was originally designed to be used
+ with tape drives that operate with fixed-size blocks, but is widely used
+ as a general packaging mechanism.
+
+ General Format
+ A tar archive consists of a series of 512-byte records. Each file system
+ object requires a header record which stores basic metadata (pathname,
+ owner, permissions, etc.) and zero or more records containing any file
+ data. The end of the archive is indicated by two records consisting
+ entirely of zero bytes.
+
+ For compatibility with tape drives that use fixed block sizes, programs
+ that read or write tar files always read or write a fixed number of
+ records with each I/O operation. These ``blocks'' are always a multiple
+ of the record size. The most common block size--and the maximum sup-
+ ported by historic implementations--is 10240 bytes or 20 records. (Note:
+ the terms ``block'' and ``record'' here are not entirely standard; this
+ document follows the convention established by John Gilmore in document-
+ ing pdtar.)
+
+ Old-Style Archive Format
+ The original tar archive format has been extended many times to include
+ additional information that various implementors found necessary. This
+ section describes the variant implemented by the tar command included in
+ Version 7 AT&T UNIX, which is one of the earliest widely-used versions of
+ the tar program.
+
+ The header record for an old-style tar archive consists of the following:
+
+ struct header_old_tar {
+ char name[100];
+ char mode[8];
+ char uid[8];
+ char gid[8];
+ char size[12];
+ char mtime[12];
+ char checksum[8];
+ char linkflag[1];
+ char linkname[100];
+ char pad[255];
+ };
+ All unused bytes in the header record are filled with nulls.
+
+ name Pathname, stored as a null-terminated string. Early tar imple-
+ mentations only stored regular files (including hardlinks to
+ those files). One common early convention used a trailing "/"
+ character to indicate a directory name, allowing directory per-
+ missions and owner information to be archived and restored.
+
+ mode File mode, stored as an octal number in ASCII.
+
+ uid, gid
+ User id and group id of owner, as octal numbers in ASCII.
+
+ size Size of file, as octal number in ASCII. For regular files only,
+ this indicates the amount of data that follows the header. In
+ particular, this field was ignored by early tar implementations
+ when extracting hardlinks. Modern writers should always store a
+ zero length for hardlink entries.
+
+ mtime Modification time of file, as an octal number in ASCII. This
+ indicates the number of seconds since the start of the epoch,
+ 00:00:00 UTC January 1, 1970. Note that negative values should
+ be avoided here, as they are handled inconsistently.
+
+ checksum
+ Header checksum, stored as an octal number in ASCII. To compute
+ the checksum, set the checksum field to all spaces, then sum all
+ bytes in the header using unsigned arithmetic. This field should
+ be stored as six octal digits followed by a null and a space
+ character. Note that many early implementations of tar used
+ signed arithmetic for the checksum field, which can cause inter-
+ operability problems when transferring archives between systems.
+ Modern robust readers compute the checksum both ways and accept
+ the header if either computation matches.
+
+ linkflag, linkname
+ In order to preserve hardlinks and conserve tape, a file with
+ multiple links is only written to the archive the first time it
+ is encountered. The next time it is encountered, the linkflag is
+ set to an ASCII `1' and the linkname field holds the first name
+ under which this file appears. (Note that regular files have a
+ null value in the linkflag field.)
+
+ Early tar implementations varied in how they terminated these fields.
+ The tar command in Version 7 AT&T UNIX used the following conventions
+ (this is also documented in early BSD manpages): the pathname must be
+ null-terminated; the mode, uid, and gid fields must end in a space and a
+ null byte; the size and mtime fields must end in a space; the checksum is
+ terminated by a null and a space. Early implementations filled the
+ numeric fields with leading spaces. This seems to have been common prac-
+ tice until the IEEE Std 1003.1-1988 (``POSIX.1'') standard was released.
+ For best portability, modern implementations should fill the numeric
+ fields with leading zeros.
+
+ Pre-POSIX Archives
+ An early draft of IEEE Std 1003.1-1988 (``POSIX.1'') served as the basis
+ for John Gilmore's pdtar program and many system implementations from the
+ late 1980s and early 1990s. These archives generally follow the POSIX
+ ustar format described below with the following variations:
+ o The magic value is ``ustar '' (note the following space). The
+ version field contains a space character followed by a null.
+ o The numeric fields are generally filled with leading spaces (not
+ leading zeros as recommended in the final standard).
+ o The prefix field is often not used, limiting pathnames to the 100
+ characters of old-style archives.
+
+ POSIX ustar Archives
+ IEEE Std 1003.1-1988 (``POSIX.1'') defined a standard tar file format to
+ be read and written by compliant implementations of tar(1). This format
+ is often called the ``ustar'' format, after the magic value used in the
+ header. (The name is an acronym for ``Unix Standard TAR''.) It extends
+ the historic format with new fields:
+
+ struct header_posix_ustar {
+ char name[100];
+ char mode[8];
+ char uid[8];
+ char gid[8];
+ char size[12];
+ char mtime[12];
+ char checksum[8];
+ char typeflag[1];
+ char linkname[100];
+ char magic[6];
+ char version[2];
+ char uname[32];
+ char gname[32];
+ char devmajor[8];
+ char devminor[8];
+ char prefix[155];
+ char pad[12];
+ };
+
+ typeflag
+ Type of entry. POSIX extended the earlier linkflag field with
+ several new type values:
+ ``0'' Regular file. NULL should be treated as a synonym, for
+ compatibility purposes.
+ ``1'' Hard link.
+ ``2'' Symbolic link.
+ ``3'' Character device node.
+ ``4'' Block device node.
+ ``5'' Directory.
+ ``6'' FIFO node.
+ ``7'' Reserved.
+ Other A POSIX-compliant implementation must treat any unrecog-
+ nized typeflag value as a regular file. In particular,
+ writers should ensure that all entries have a valid file-
+ name so that they can be restored by readers that do not
+ support the corresponding extension. Uppercase letters
+ "A" through "Z" are reserved for custom extensions. Note
+ that sockets and whiteout entries are not archivable.
+ It is worth noting that the size field, in particular, has dif-
+ ferent meanings depending on the type. For regular files, of
+ course, it indicates the amount of data following the header.
+ For directories, it may be used to indicate the total size of all
+ files in the directory, for use by operating systems that pre-
+ allocate directory space. For all other types, it should be set
+ to zero by writers and ignored by readers.
+
+ magic Contains the magic value ``ustar'' followed by a NULL byte to
+ indicate that this is a POSIX standard archive. Full compliance
+ requires the uname and gname fields be properly set.
+
+ version
+ Version. This should be ``00'' (two copies of the ASCII digit
+ zero) for POSIX standard archives.
+
+ uname, gname
+ User and group names, as null-terminated ASCII strings. These
+ should be used in preference to the uid/gid values when they are
+ set and the corresponding names exist on the system.
+
+ devmajor, devminor
+ Major and minor numbers for character device or block device
+ entry.
+
+ prefix First part of pathname. If the pathname is too long to fit in
+ the 100 bytes provided by the standard format, it can be split at
+ any / character with the first portion going here. If the prefix
+ field is not empty, the reader will prepend the prefix value and
+ a / character to the regular name field to obtain the full path-
+ name.
+
+ Note that all unused bytes must be set to NULL.
+
+ Field termination is specified slightly differently by POSIX than by pre-
+ vious implementations. The magic, uname, and gname fields must have a
+ trailing NULL. The pathname, linkname, and prefix fields must have a
+ trailing NULL unless they fill the entire field. (In particular, it is
+ possible to store a 256-character pathname if it happens to have a / as
+ the 156th character.) POSIX requires numeric fields to be zero-padded in
+ the front, and allows them to be terminated with either space or NULL
+ characters.
+
+ Currently, most tar implementations comply with the ustar format, occa-
+ sionally extending it by adding new fields to the blank area at the end
+ of the header record.
+
+ Pax Interchange Format
+ There are many attributes that cannot be portably stored in a POSIX ustar
+ archive. IEEE Std 1003.1-2001 (``POSIX.1'') defined a ``pax interchange
+ format'' that uses two new types of entries to hold text-formatted meta-
+ data that applies to following entries. Note that a pax interchange for-
+ mat archive is a ustar archive in every respect. The new data is stored
+ in ustar-compatible archive entries that use the ``x'' or ``g'' typeflag.
+ In particular, older implementations that do not fully support these
+ extensions will extract the metadata into regular files, where the meta-
+ data can be examined as necessary.
+
+ An entry in a pax interchange format archive consists of one or two stan-
+ dard ustar entries, each with its own header and data. The first
+ optional entry stores the extended attributes for the following entry.
+ This optional first entry has an "x" typeflag and a size field that indi-
+ cates the total size of the extended attributes. The extended attributes
+ themselves are stored as a series of text-format lines encoded in the
+ portable UTF-8 encoding. Each line consists of a decimal number, a
+ space, a key string, an equals sign, a value string, and a new line. The
+ decimal number indicates the length of the entire line, including the
+ initial length field and the trailing newline. An example of such a
+ field is:
+ 25 ctime=1084839148.1212\n
+ Keys in all lowercase are standard keys. Vendors can add their own keys
+ by prefixing them with an all uppercase vendor name and a period. Note
+ that, unlike the historic header, numeric values are stored using deci-
+ mal, not octal. A description of some common keys follows:
+
+ atime, ctime, mtime
+ File access, inode change, and modification times. These fields
+ can be negative or include a decimal point and a fractional
+ value.
+
+ uname, uid, gname, gid
+ User name, group name, and numeric UID and GID values. The user
+ name and group name stored here are encoded in UTF8 and can thus
+ include non-ASCII characters. The UID and GID fields can be of
+ arbitrary length.
+
+ linkpath
+ The full path of the linked-to file. Note that this is encoded
+ in UTF8 and can thus include non-ASCII characters.
+
+ path The full pathname of the entry. Note that this is encoded in
+ UTF8 and can thus include non-ASCII characters.
+
+ realtime.*, security.*
+ These keys are reserved and may be used for future standardiza-
+ tion.
+
+ size The size of the file. Note that there is no length limit on this
+ field, allowing conforming archives to store files much larger
+ than the historic 8GB limit.
+
+ SCHILY.*
+ Vendor-specific attributes used by Joerg Schilling's star imple-
+ mentation.
+
+ SCHILY.acl.access, SCHILY.acl.default
+ Stores the access and default ACLs as textual strings in a format
+ that is an extension of the format specified by POSIX.1e draft
+ 17. In particular, each user or group access specification can
+ include a fourth colon-separated field with the numeric UID or
+ GID. This allows ACLs to be restored on systems that may not
+ have complete user or group information available (such as when
+ NIS/YP or LDAP services are temporarily unavailable).
+
+ SCHILY.devminor, SCHILY.devmajor
+ The full minor and major numbers for device nodes.
+
+ SCHILY.dev, SCHILY.ino, SCHILY.nlinks
+ The device number, inode number, and link count for the entry.
+ In particular, note that a pax interchange format archive using
+ Joerg Schilling's SCHILY.* extensions can store all of the data
+ from struct stat.
+
+ LIBARCHIVE.xattr.namespace.key
+ Libarchive stores POSIX.1e-style extended attributes using keys
+ of this form. The key value is URL-encoded: All non-ASCII char-
+ acters and the two special characters ``='' and ``%'' are encoded
+ as ``%'' followed by two uppercase hexadecimal digits. The value
+ of this key is the extended attribute value encoded in base 64.
+ XXX Detail the base-64 format here XXX
+
+ VENDOR.*
+ XXX document other vendor-specific extensions XXX
+
+ Any values stored in an extended attribute override the corresponding
+ values in the regular tar header. Note that compliant readers should
+ ignore the regular fields when they are overridden. This is important,
+ as existing archivers are known to store non-compliant values in the
+ standard header fields in this situation. There are no limits on length
+ for any of these fields. In particular, numeric fields can be arbitrar-
+ ily large. All text fields are encoded in UTF8. Compliant writers
+ should store only portable 7-bit ASCII characters in the standard ustar
+ header and use extended attributes whenever a text value contains non-
+ ASCII characters.
+
+ In addition to the x entry described above, the pax interchange format
+ also supports a g entry. The g entry is identical in format, but speci-
+ fies attributes that serve as defaults for all subsequent archive
+ entries. The g entry is not widely used.
+
+ Besides the new x and g entries, the pax interchange format has a few
+ other minor variations from the earlier ustar format. The most troubling
+ one is that hardlinks are permitted to have data following them. This
+ allows readers to restore any hardlink to a file without having to rewind
+ the archive to find an earlier entry. However, it creates complications
+ for robust readers, as it is no longer clear whether or not they should
+ ignore the size field for hardlink entries.
+
+ GNU Tar Archives
+ The GNU tar program started with a pre-POSIX format similar to that
+ described earlier and has extended it using several different mechanisms:
+ It added new fields to the empty space in the header (some of which was
+ later used by POSIX for conflicting purposes); it allowed the header to
+ be continued over multiple records; and it defined new entries that mod-
+ ify following entries (similar in principle to the x entry described
+ above, but each GNU special entry is single-purpose, unlike the general-
+ purpose x entry). As a result, GNU tar archives are not POSIX compati-
+ ble, although more lenient POSIX-compliant readers can successfully
+ extract most GNU tar archives.
+
+ struct header_gnu_tar {
+ char name[100];
+ char mode[8];
+ char uid[8];
+ char gid[8];
+ char size[12];
+ char mtime[12];
+ char checksum[8];
+ char typeflag[1];
+ char linkname[100];
+ char magic[6];
+ char version[2];
+ char uname[32];
+ char gname[32];
+ char devmajor[8];
+ char devminor[8];
+ char atime[12];
+ char ctime[12];
+ char offset[12];
+ char longnames[4];
+ char unused[1];
+ struct {
+ char offset[12];
+ char numbytes[12];
+ } sparse[4];
+ char isextended[1];
+ char realsize[12];
+ char pad[17];
+ };
+
+ typeflag
+ GNU tar uses the following special entry types, in addition to
+ those defined by POSIX:
+
+ 7 GNU tar treats type "7" records identically to type "0"
+ records, except on one obscure RTOS where they are used
+ to indicate the pre-allocation of a contiguous file on
+ disk.
+
+ D This indicates a directory entry. Unlike the POSIX-stan-
+ dard "5" typeflag, the header is followed by data records
+ listing the names of files in this directory. Each name
+ is preceded by an ASCII "Y" if the file is stored in this
+ archive or "N" if the file is not stored in this archive.
+ Each name is terminated with a null, and an extra null
+ marks the end of the name list. The purpose of this
+ entry is to support incremental backups; a program
+ restoring from such an archive may wish to delete files
+ on disk that did not exist in the directory when the ar-
+ chive was made.
+
+ Note that the "D" typeflag specifically violates POSIX,
+ which requires that unrecognized typeflags be restored as
+ normal files. In this case, restoring the "D" entry as a
+ file could interfere with subsequent creation of the
+ like-named directory.
+
+ K The data for this entry is a long linkname for the fol-
+ lowing regular entry.
+
+ L The data for this entry is a long pathname for the fol-
+ lowing regular entry.
+
+ M This is a continuation of the last file on the previous
+ volume. GNU multi-volume archives guarantee that each
+ volume begins with a valid entry header. To ensure this,
+ a file may be split, with part stored at the end of one
+ volume, and part stored at the beginning of the next vol-
+ ume. The "M" typeflag indicates that this entry contin-
+ ues an existing file. Such entries can only occur as the
+ first or second entry in an archive (the latter only if
+ the first entry is a volume label). The size field spec-
+ ifies the size of this entry. The offset field at bytes
+ 369-380 specifies the offset where this file fragment
+ begins. The realsize field specifies the total size of
+ the file (which must equal size plus offset). When
+ extracting, GNU tar checks that the header file name is
+ the one it is expecting, that the header offset is in the
+ correct sequence, and that the sum of offset and size is
+ equal to realsize. FreeBSD's version of GNU tar does not
+ handle the corner case of an archive's being continued in
+ the middle of a long name or other extension header.
+
+ N Type "N" records are no longer generated by GNU tar.
+ They contained a list of files to be renamed or symlinked
+ after extraction; this was originally used to support
+ long names. The contents of this record are a text
+ description of the operations to be done, in the form
+ ``Rename %s to %s\n'' or ``Symlink %s to %s\n''; in
+ either case, both filenames are escaped using K&R C syn-
+ tax.
+
+ S This is a ``sparse'' regular file. Sparse files are
+ stored as a series of fragments. The header contains a
+ list of fragment offset/length pairs. If more than four
+ such entries are required, the header is extended as nec-
+ essary with ``extra'' header extensions (an older format
+ that is no longer used), or ``sparse'' extensions.
+
+ V The name field should be interpreted as a tape/volume
+ header name. This entry should generally be ignored on
+ extraction.
+
+ magic The magic field holds the five characters ``ustar'' followed by a
+ space. Note that POSIX ustar archives have a trailing null.
+
+ version
+ The version field holds a space character followed by a null.
+ Note that POSIX ustar archives use two copies of the ASCII digit
+ ``0''.
+
+ atime, ctime
+ The time the file was last accessed and the time of last change
+ of file information, stored in octal as with mtime.
+
+ longnames
+ This field is apparently no longer used.
+
+ Sparse offset / numbytes
+ Each such structure specifies a single fragment of a sparse file.
+ The two fields store values as octal numbers. The fragments are
+ each padded to a multiple of 512 bytes in the archive. On
+ extraction, the list of fragments is collected from the header
+ (including any extension headers), and the data is then read and
+ written to the file at appropriate offsets.
+
+ isextended
+ If this is set to non-zero, the header will be followed by addi-
+ tional ``sparse header'' records. Each such record contains
+ information about as many as 21 additional sparse blocks as shown
+ here:
+
+ struct gnu_sparse_header {
+ struct {
+ char offset[12];
+ char numbytes[12];
+ } sparse[21];
+ char isextended[1];
+ char padding[7];
+ };
+
+ realsize
+ A binary representation of the file's complete size, with a much
+ larger range than the POSIX file size. In particular, with M
+ type files, the current entry is only a portion of the file. In
+ that case, the POSIX size field will indicate the size of this
+ entry; the realsize field will indicate the total size of the
+ file.
+
+ Solaris Tar
+ XXX More Details Needed XXX
+
+ Solaris tar (beginning with SunOS XXX 5.7 ?? XXX) supports an
+ ``extended'' format that is fundamentally similar to pax interchange for-
+ mat, with the following differences:
+ o Extended attributes are stored in an entry whose type is X, not
+ x, as used by pax interchange format. The detailed format of
+ this entry appears to be the same as detailed above for the x
+ entry.
+ o An additional A entry is used to store an ACL for the following
+ regular entry. The body of this entry contains a seven-digit
+ octal number (whose value is 01000000 plus the number of ACL
+ entries) followed by a zero byte, followed by the textual ACL
+ description.
+
+ Other Extensions
+ One common extension, utilized by GNU tar, star, and other newer tar
+ implementations, permits binary numbers in the standard numeric fields.
+ This is flagged by setting the high bit of the first character. This
+ permits 95-bit values for the length and time fields and 63-bit values
+ for the uid, gid, and device numbers. GNU tar supports this extension
+ for the length, mtime, ctime, and atime fields. Joerg Schilling's star
+ program supports this extension for all numeric fields. Note that this
+ extension is largely obsoleted by the extended attribute record provided
+ by the pax interchange format.
+
+ Another early GNU extension allowed base-64 values rather than octal.
+ This extension was short-lived and such archives are almost never seen.
+ However, there is still code in GNU tar to support them; this code is
+ responsible for a very cryptic warning message that is sometimes seen
+ when GNU tar encounters a damaged archive.
+
+SEE ALSO
+ ar(1), pax(1), tar(1)
+
+STANDARDS
+ The tar utility is no longer a part of POSIX or the Single Unix Standard.
+ It last appeared in Version 2 of the Single UNIX Specification
+ (``SUSv2''). It has been supplanted in subsequent standards by pax(1).
+ The ustar format is currently part of the specification for the pax(1)
+ utility. The pax interchange file format is new with IEEE Std
+ 1003.1-2001 (``POSIX.1'').
+
+HISTORY
+ A tar command appeared in Seventh Edition Unix, which was released in
+ January, 1979. It replaced the tp program from Fourth Edition Unix which
+ in turn replaced the tap program from First Edition Unix. John Gilmore's
+ pdtar public-domain implementation (circa 1987) was highly influential
+ and formed the basis of GNU tar. Joerg Shilling's star archiver is
+ another open-source (GPL) archiver (originally developed circa 1985)
+ which features complete support for pax interchange format.
+
+FreeBSD 6.0 May 20, 2004 FreeBSD 6.0
diff --git a/archivers/libarchive/files/doc/update.sh b/archivers/libarchive/files/doc/update.sh
new file mode 100755
index 00000000000..644b90a9a2d
--- /dev/null
+++ b/archivers/libarchive/files/doc/update.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+#
+# Simple script to repopulate the 'doc' tree from
+# the mdoc man pages stored in each project.
+#
+
+# Remove existing manpages from the doc tree
+chmod -R +w man text
+rm -f man/*.[135]
+rm -f text/*.[135]
+
+# Build Makefile in 'man' directory
+cd man
+echo > Makefile
+echo "default: all" >>Makefile
+echo >>Makefile
+all="all:"
+for d in libarchive tar cpio; do
+ for f in ../../$d/*.[135]; do
+ echo >> Makefile
+ echo `basename $f`: ../mdoc2man.awk $f >> Makefile
+ echo " awk -f ../mdoc2man.awk < $f > `basename $f`" >> Makefile
+ all="$all `basename $f`"
+ done
+done
+echo $all >>Makefile
+cd ..
+
+# Rebuild Makefile in 'text' directory
+cd text
+echo > Makefile
+echo "$all" >>Makefile
+echo >>Makefile
+for d in libarchive tar cpio; do
+ for f in ../../$d/*.[135]; do
+ echo >> Makefile
+ echo `basename $f`: $f >> Makefile
+ echo " nroff -mdoc $f | col -b > `basename $f`" >> Makefile
+ done
+done
+cd ..
+
+# Convert all of the manpages to -man format.
+(cd man && make)
+# Format all of the manpages to text
+(cd text && make)
diff --git a/archivers/libarchive/files/libarchive/archive.h.in b/archivers/libarchive/files/libarchive/archive.h.in
index e21a7105e7c..d76c85e51bd 100644
--- a/archivers/libarchive/files/libarchive/archive.h.in
+++ b/archivers/libarchive/files/libarchive/archive.h.in
@@ -22,7 +22,7 @@
* (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: src/lib/libarchive/archive.h.in,v 1.46 2007/07/06 15:36:37 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive.h.in,v 1.47 2007/12/30 04:58:21 kientzle Exp $
*/
#ifndef ARCHIVE_H_INCLUDED
diff --git a/archivers/libarchive/files/libarchive/archive_endian.h b/archivers/libarchive/files/libarchive/archive_endian.h
new file mode 100644
index 00000000000..259f5de91ea
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/archive_endian.h
@@ -0,0 +1,142 @@
+/*-
+ * Copyright (c) 2002 Thomas Moestl <tmm@FreeBSD.org>
+ * 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: src/lib/libarchive/archive_endian.h,v 1.2 2008/02/26 07:17:47 kientzle Exp $
+ *
+ * Borrowed from FreeBSD's <sys/endian.h>
+ */
+
+#ifndef ARCHIVE_ENDIAN_H_INCLUDED
+#define ARCHIVE_ENDIAN_H_INCLUDED
+
+/* Alignment-agnostic encode/decode bytestream to/from little/big endian. */
+
+static inline uint16_t
+archive_be16dec(const void *pp)
+{
+ unsigned char const *p = (unsigned char const *)pp;
+
+ return ((p[0] << 8) | p[1]);
+}
+
+static inline uint32_t
+archive_be32dec(const void *pp)
+{
+ unsigned char const *p = (unsigned char const *)pp;
+
+ return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
+}
+
+static inline uint64_t
+archive_be64dec(const void *pp)
+{
+ unsigned char const *p = (unsigned char const *)pp;
+
+ return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
+}
+
+static inline uint16_t
+archive_le16dec(const void *pp)
+{
+ unsigned char const *p = (unsigned char const *)pp;
+
+ return ((p[1] << 8) | p[0]);
+}
+
+static inline uint32_t
+archive_le32dec(const void *pp)
+{
+ unsigned char const *p = (unsigned char const *)pp;
+
+ return ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);
+}
+
+static inline uint64_t
+archive_le64dec(const void *pp)
+{
+ unsigned char const *p = (unsigned char const *)pp;
+
+ return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
+}
+
+static inline void
+archive_be16enc(void *pp, uint16_t u)
+{
+ unsigned char *p = (unsigned char *)pp;
+
+ p[0] = (u >> 8) & 0xff;
+ p[1] = u & 0xff;
+}
+
+static inline void
+archive_be32enc(void *pp, uint32_t u)
+{
+ unsigned char *p = (unsigned char *)pp;
+
+ p[0] = (u >> 24) & 0xff;
+ p[1] = (u >> 16) & 0xff;
+ p[2] = (u >> 8) & 0xff;
+ p[3] = u & 0xff;
+}
+
+static inline void
+archive_be64enc(void *pp, uint64_t u)
+{
+ unsigned char *p = (unsigned char *)pp;
+
+ archive_be32enc(p, u >> 32);
+ archive_be32enc(p + 4, u & 0xffffffff);
+}
+
+static inline void
+archive_le16enc(void *pp, uint16_t u)
+{
+ unsigned char *p = (unsigned char *)pp;
+
+ p[0] = u & 0xff;
+ p[1] = (u >> 8) & 0xff;
+}
+
+static inline void
+archive_le32enc(void *pp, uint32_t u)
+{
+ unsigned char *p = (unsigned char *)pp;
+
+ p[0] = u & 0xff;
+ p[1] = (u >> 8) & 0xff;
+ p[2] = (u >> 16) & 0xff;
+ p[3] = (u >> 24) & 0xff;
+}
+
+static inline void
+archive_le64enc(void *pp, uint64_t u)
+{
+ unsigned char *p = (unsigned char *)pp;
+
+ archive_le32enc(p, u & 0xffffffff);
+ archive_le32enc(p + 4, u >> 32);
+}
+
+#endif
diff --git a/archivers/libarchive/files/libarchive/archive_entry.c b/archivers/libarchive/files/libarchive/archive_entry.c
index 5c78c92f111..a6c9b4496c1 100644
--- a/archivers/libarchive/files/libarchive/archive_entry.c
+++ b/archivers/libarchive/files/libarchive/archive_entry.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.44 2007/07/15 19:10:34 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.45 2007/12/30 04:58:21 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -207,6 +207,8 @@ aes_get_mbs(struct aes *aes)
static const wchar_t *
aes_get_wcs(struct aes *aes)
{
+ int r;
+
if (aes->aes_wcs == NULL && aes->aes_mbs == NULL)
return NULL;
if (aes->aes_wcs == NULL && aes->aes_mbs != NULL) {
@@ -221,8 +223,13 @@ aes_get_wcs(struct aes *aes)
aes->aes_wcs = aes->aes_wcs_alloc;
if (aes->aes_wcs == NULL)
__archive_errx(1, "No memory for aes_get_wcs()");
- mbstowcs(aes->aes_wcs_alloc, aes->aes_mbs, wcs_length);
+ r = mbstowcs(aes->aes_wcs_alloc, aes->aes_mbs, wcs_length);
aes->aes_wcs_alloc[wcs_length] = 0;
+ if (r == -1) {
+ /* Conversion failed, don't lie to our clients. */
+ free(aes->aes_wcs_alloc);
+ aes->aes_wcs = aes->aes_wcs_alloc = NULL;
+ }
}
return (aes->aes_wcs);
}
@@ -307,6 +314,8 @@ aes_copy_wcs_len(struct aes *aes, const wchar_t *wcs, size_t len)
struct archive_entry *
archive_entry_clear(struct archive_entry *entry)
{
+ if (entry == NULL)
+ return (NULL);
aes_clean(&entry->ae_fflags_text);
aes_clean(&entry->ae_gname);
aes_clean(&entry->ae_hardlink);
@@ -752,6 +761,28 @@ archive_entry_set_link(struct archive_entry *entry, const char *target)
aes_set_mbs(&entry->ae_hardlink, target);
}
+/* Set symlink if symlink is already set, else set hardlink. */
+void
+archive_entry_copy_link(struct archive_entry *entry, const char *target)
+{
+ if (entry->ae_symlink.aes_mbs != NULL ||
+ entry->ae_symlink.aes_wcs != NULL)
+ aes_copy_mbs(&entry->ae_symlink, target);
+ else
+ aes_copy_mbs(&entry->ae_hardlink, target);
+}
+
+/* Set symlink if symlink is already set, else set hardlink. */
+void
+archive_entry_copy_link_w(struct archive_entry *entry, const wchar_t *target)
+{
+ if (entry->ae_symlink.aes_mbs != NULL ||
+ entry->ae_symlink.aes_wcs != NULL)
+ aes_copy_wcs(&entry->ae_symlink, target);
+ else
+ aes_copy_wcs(&entry->ae_hardlink, target);
+}
+
void
archive_entry_set_mode(struct archive_entry *entry, mode_t m)
{
@@ -1143,7 +1174,7 @@ const wchar_t *
archive_entry_acl_text_w(struct archive_entry *entry, int flags)
{
int count;
- int length;
+ size_t length;
const wchar_t *wname;
const wchar_t *prefix;
wchar_t separator;
diff --git a/archivers/libarchive/files/libarchive/archive_entry.h b/archivers/libarchive/files/libarchive/archive_entry.h
index 33c5649a9f1..cebd55ba8ae 100644
--- a/archivers/libarchive/files/libarchive/archive_entry.h
+++ b/archivers/libarchive/files/libarchive/archive_entry.h
@@ -22,7 +22,7 @@
* (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: src/lib/libarchive/archive_entry.h,v 1.23 2007/07/15 19:10:34 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.24 2007/12/30 04:58:21 kientzle Exp $
*/
#ifndef ARCHIVE_ENTRY_H_INCLUDED
@@ -37,7 +37,6 @@
extern "C" {
#endif
-
/*
* Description of an archive entry.
*
@@ -57,7 +56,25 @@ extern "C" {
struct archive_entry;
/*
- * File-type constants. These are returned from archive_entry_filetype().
+ * File-type constants. These are returned from archive_entry_filetype()
+ * and passed to archive_entry_set_filetype().
+ *
+ * These values match S_XXX defines on every platform I've checked,
+ * including Windows, AIX, Linux, Solaris, and BSD. They're
+ * (re)defined here because platforms generally don't define the ones
+ * they don't support. For example, Windows doesn't define S_IFLNK or
+ * S_IFBLK. Instead of having a mass of conditional logic and system
+ * checks to define any S_XXX values that aren't supported locally,
+ * I've just defined a new set of such constants so that
+ * libarchive-based applications can manipulate and identify archive
+ * entries properly even if the hosting platform can't store them on
+ * disk.
+ *
+ * These values are also used directly within some portable formats,
+ * such as cpio. If you find a platform that varies from these, the
+ * correct solution is to leave these alone and translate from these
+ * portable values to platform-native values when entries are read from
+ * or written to disk.
*/
#define AE_IFMT 0170000
#define AE_IFREG 0100000
@@ -91,7 +108,8 @@ dev_t archive_entry_devmajor(struct archive_entry *);
dev_t archive_entry_devminor(struct archive_entry *);
mode_t archive_entry_filetype(struct archive_entry *);
void archive_entry_fflags(struct archive_entry *,
- unsigned long *set, unsigned long *clear);
+ unsigned long * /* set */,
+ unsigned long * /* clear */);
const char *archive_entry_fflags_text(struct archive_entry *);
gid_t archive_entry_gid(struct archive_entry *);
const char *archive_entry_gname(struct archive_entry *);
@@ -130,7 +148,7 @@ void archive_entry_set_devmajor(struct archive_entry *, dev_t);
void archive_entry_set_devminor(struct archive_entry *, dev_t);
void archive_entry_set_filetype(struct archive_entry *, unsigned int);
void archive_entry_set_fflags(struct archive_entry *,
- unsigned long set, unsigned long clear);
+ unsigned long /* set */, unsigned long /* clear */);
/* Returns pointer to start of first invalid token, or NULL if none. */
/* Note that all recognized tokens are processed, regardless. */
const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *,
@@ -144,6 +162,8 @@ void archive_entry_copy_hardlink(struct archive_entry *, const char *);
void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *);
void archive_entry_set_ino(struct archive_entry *, unsigned long);
void archive_entry_set_link(struct archive_entry *, const char *);
+void archive_entry_copy_link(struct archive_entry *, const char *);
+void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *);
void archive_entry_set_mode(struct archive_entry *, mode_t);
void archive_entry_set_mtime(struct archive_entry *, time_t, long);
void archive_entry_set_nlink(struct archive_entry *, unsigned int);
@@ -182,6 +202,13 @@ void archive_entry_copy_stat(struct archive_entry *, const struct stat *);
* = there are many different ACL text formats
* = would like to be able to read/convert archives containing ACLs
* on platforms that lack ACL libraries
+ *
+ * This last point, in particular, forces me to implement a reasonably
+ * complete set of ACL support routines.
+ *
+ * TODO: Extend this to support NFSv4/NTFS permissions. That should
+ * allow full ACL support on Mac OS, in particular, which uses
+ * POSIX.1e-style interfaces to manipulate NFSv4/NTFS permissions.
*/
/*
@@ -216,21 +243,24 @@ void archive_entry_copy_stat(struct archive_entry *, const struct stat *);
*/
void archive_entry_acl_clear(struct archive_entry *);
void archive_entry_acl_add_entry(struct archive_entry *,
- int type, int permset, int tag, int qual, const char *name);
+ int /* type */, int /* permset */, int /* tag */,
+ int /* qual */, const char * /* name */);
void archive_entry_acl_add_entry_w(struct archive_entry *,
- int type, int permset, int tag, int qual, const wchar_t *name);
+ int /* type */, int /* permset */, int /* tag */,
+ int /* qual */, const wchar_t * /* name */);
/*
* To retrieve the ACL, first "reset", then repeatedly ask for the
* "next" entry. The want_type parameter allows you to request only
* access entries or only default entries.
*/
-int archive_entry_acl_reset(struct archive_entry *, int want_type);
-int archive_entry_acl_next(struct archive_entry *, int want_type,
- int *type, int *permset, int *tag, int *qual, const char **name);
-int archive_entry_acl_next_w(struct archive_entry *, int want_type,
- int *type, int *permset, int *tag, int *qual,
- const wchar_t **name);
+int archive_entry_acl_reset(struct archive_entry *, int /* want_type */);
+int archive_entry_acl_next(struct archive_entry *, int /* want_type */,
+ int * /* type */, int * /* permset */, int * /* tag */,
+ int * /* qual */, const char ** /* name */);
+int archive_entry_acl_next_w(struct archive_entry *, int /* want_type */,
+ int * /* type */, int * /* permset */, int * /* tag */,
+ int * /* qual */, const wchar_t ** /* name */);
/*
* Construct a text-format ACL. The flags argument is a bitmask that
@@ -245,10 +275,11 @@ int archive_entry_acl_next_w(struct archive_entry *, int want_type,
*/
#define ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 1024
#define ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 2048
-const wchar_t *archive_entry_acl_text_w(struct archive_entry *, int flags);
+const wchar_t *archive_entry_acl_text_w(struct archive_entry *,
+ int /* flags */);
/* Return a count of entries matching 'want_type' */
-int archive_entry_acl_count(struct archive_entry *, int want_type);
+int archive_entry_acl_count(struct archive_entry *, int /* want_type */);
/*
* Private ACL parser. This is private because it handles some
@@ -259,9 +290,12 @@ int archive_entry_acl_count(struct archive_entry *, int want_type);
* this interface are likely to be surprised when it changes.
*
* You were warned!
+ *
+ * TODO: Move this declaration out of the public header and into
+ * a private header. Warnings above are silly.
*/
int __archive_entry_acl_parse_w(struct archive_entry *,
- const wchar_t *, int type);
+ const wchar_t *, int /* type */);
/*
* extended attributes
@@ -269,7 +303,8 @@ int __archive_entry_acl_parse_w(struct archive_entry *,
void archive_entry_xattr_clear(struct archive_entry *);
void archive_entry_xattr_add_entry(struct archive_entry *,
- const char *name, const void *value, size_t size);
+ const char * /* name */, const void * /* value */,
+ size_t /* size */);
/*
* To retrieve the xattr list, first "reset", then repeatedly ask for the
@@ -279,29 +314,94 @@ void archive_entry_xattr_add_entry(struct archive_entry *,
int archive_entry_xattr_count(struct archive_entry *);
int archive_entry_xattr_reset(struct archive_entry *);
int archive_entry_xattr_next(struct archive_entry *,
- const char **name, const void **value, size_t *);
+ const char ** /* name */, const void ** /* value */, size_t *);
/*
* Utility to detect hardlinks.
*
- * The 'struct archive_hardlink_lookup' is a cache of entry
- * names and dev/ino numbers. Here's how to use it:
- * 1. Create a lookup object with archive_hardlink_lookup_new()
- * 2. Hand each archive_entry to archive_hardlink_lookup().
- * That function will return NULL (this is not a hardlink to
- * a previous entry) or the pathname of the first entry
- * that matched this.
- * 3. Use archive_hardlink_lookup_free() to release the cache.
+ * The 'struct archive_entry_linkresolver' is a cache of archive entries
+ * for files with multiple links. Here's how to use it:
+ * 1. Create a lookup object with archive_entry_linkresolver_new()
+ * 2. Set the appropriate strategy.
+ * 3. Hand each archive_entry to archive_entry_linkify().
+ * That function will return 0, 1, or 2 entries that should
+ * be written.
+ * 4. Call archive_entry_linkify(resolver, NULL) until
+ * no more entries are returned.
+ * 5. Call archive_entry_link_resolver_free(resolver) to free resources.
+ *
+ * The entries returned have their hardlink and size fields updated
+ * appropriately. If an entry is passed in that does not refer to
+ * a file with multiple links, it is returned unchanged. The intention
+ * is that you should be able to simply filter all entries through
+ * this machine.
*
* To make things more efficient, be sure that each entry has a valid
* nlinks value. The hardlink cache uses this to track when all links
* have been found. If the nlinks value is zero, it will keep every
* name in the cache indefinitely, which can use a lot of memory.
+ *
+ * Note that archive_entry_size() is reset to zero if the file
+ * body should not be written to the archive. Pay attention!
*/
struct archive_entry_linkresolver;
+/*
+ * This machine supports three different strategies for marking
+ * hardlinks. The names come from the best-known
+ * formats that rely on each strategy:
+ *
+ * "Old cpio" is the simplest, it always returns any entry unmodified.
+ * As far as I know, only cpio formats use this. Old cpio archives
+ * store every link with the full body; the onus is on the dearchiver
+ * to detect and properly link the files as they are restored.
+ * "tar" is also pretty simple; it caches a copy the first time it sees
+ * any link. Subsequent appearances are modified to be hardlink
+ * references without any body to the first one. Used by all tar
+ * formats, although the newest tar formats permit the "old cpio" strategy
+ * as well. This strategy is very simple for the dearchiver,
+ * and reasonably straightforward for the archiver.
+ * "new cpio" is trickier. It stores the body only with the last
+ * occurrence. The complication is that we might not
+ * see every link to a particular file in a single session, so
+ * there's no easy way to know when we've seen the last occurrence.
+ * The solution here is to queue one link until we see the next.
+ * At the end of the session, you can enumerate any remaining
+ * entries by calling archive_entry_linkify(NULL) and store those
+ * bodies. If you have a file with three links l1, l2, and l3,
+ * you'll get the following behavior if you see all three links:
+ * linkify(l1) => NULL (the resolver stores l1 internally)
+ * linkify(l2) => l1 (resolver stores l2, you write l1)
+ * linkify(l3) => l2, l3 (all links seen, you can write both).
+ * If you only see l1 and l2, you'll get this behavior:
+ * linkify(l1) => NULL
+ * linkify(l2) => l1
+ * linkify(NULL) => l2 (at end, you retrieve remaining links)
+ * As the name suggests, this strategy is used by newer cpio variants.
+ * It's noticably more complex for the archiver, slightly more complex
+ * for the dearchiver than the tar strategy, but makes it straightforward
+ * to restore a file using any link by simply continuing to scan until
+ * you see a link that is stored with a body. In contrast, the tar
+ * strategy requires you to rescan the archive from the beginning to
+ * correctly extract an arbitrary link.
+ */
+#define ARCHIVE_ENTRY_LINKIFY_LIKE_TAR 0
+#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 1
+#define ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO 2
+
struct archive_entry_linkresolver *archive_entry_linkresolver_new(void);
+void archive_entry_linkresolver_set_strategy(
+ struct archive_entry_linkresolver *, int /* strategy */);
void archive_entry_linkresolver_free(struct archive_entry_linkresolver *);
+void archive_entry_linkify(struct archive_entry_linkresolver *,
+ struct archive_entry **, struct archive_entry **);
+
+/*
+ * DEPRECATED: This will be removed in libarchive 3.0. It was an
+ * early attempt at providing library-level hardlink recognition
+ * support, but it only handles the tar strategy and cannot easily
+ * be extended, so it's being replaced with the "linkify" function.
+ */
const char *archive_entry_linkresolve(struct archive_entry_linkresolver *,
struct archive_entry *);
diff --git a/archivers/libarchive/files/libarchive/archive_entry_link_resolver.c b/archivers/libarchive/files/libarchive/archive_entry_link_resolver.c
index 0f07e068e07..37131ff325d 100644
--- a/archivers/libarchive/files/libarchive/archive_entry_link_resolver.c
+++ b/archivers/libarchive/files/libarchive/archive_entry_link_resolver.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_link_resolver.c,v 1.1 2007/12/30 04:58:21 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -42,133 +42,194 @@ __FBSDID("$FreeBSD$");
#include "archive_entry.h"
+/*
+ * This is mostly a pretty straightforward hash table implementation.
+ * The only interesting bit is the different strategies used to
+ * match up links. These strategies match those used by various
+ * archiving formats:
+ * tar - content stored with first link, remainder refer back to it.
+ * This requires us to match each subsequent link up with the
+ * first appearance.
+ * cpio - Old cpio just stored body with each link, match-ups were
+ * implicit. This is trivial.
+ * new cpio - New cpio only stores body with last link, match-ups
+ * are implicit. This is actually quite tricky; see the notes
+ * below.
+ */
+
/* Initial size of link cache. */
#define links_cache_initial_size 1024
+struct links_entry {
+ struct links_entry *next;
+ struct links_entry *previous;
+ int links; /* # links not yet seen */
+ int hash;
+ struct archive_entry *entry;
+};
+
struct archive_entry_linkresolver {
- char *last_name;
+ struct links_entry **buckets;
+ struct links_entry *spare;
unsigned long number_entries;
size_t number_buckets;
- struct links_entry **buckets;
+ int strategy;
};
-struct links_entry {
- struct links_entry *next;
- struct links_entry *previous;
- int links;
- dev_t dev;
- ino_t ino;
- char *name;
-};
+static struct links_entry *find_entry(struct archive_entry_linkresolver *,
+ struct archive_entry *);
+static void grow_hash(struct archive_entry_linkresolver *);
+static void insert_entry(struct archive_entry_linkresolver *,
+ struct archive_entry *);
struct archive_entry_linkresolver *
archive_entry_linkresolver_new(void)
{
- struct archive_entry_linkresolver *links_cache;
+ struct archive_entry_linkresolver *res;
size_t i;
- links_cache = malloc(sizeof(struct archive_entry_linkresolver));
- if (links_cache == NULL)
+ res = malloc(sizeof(struct archive_entry_linkresolver));
+ if (res == NULL)
return (NULL);
- memset(links_cache, 0, sizeof(struct archive_entry_linkresolver));
- links_cache->number_buckets = links_cache_initial_size;
- links_cache->buckets = malloc(links_cache->number_buckets *
- sizeof(links_cache->buckets[0]));
- if (links_cache->buckets == NULL) {
- free(links_cache);
+ memset(res, 0, sizeof(struct archive_entry_linkresolver));
+ res->number_buckets = links_cache_initial_size;
+ res->buckets = malloc(res->number_buckets *
+ sizeof(res->buckets[0]));
+ if (res->buckets == NULL) {
+ free(res);
return (NULL);
}
- for (i = 0; i < links_cache->number_buckets; i++)
- links_cache->buckets[i] = NULL;
- return (links_cache);
+ for (i = 0; i < res->number_buckets; i++)
+ res->buckets[i] = NULL;
+ return (res);
+}
+
+void
+archive_entry_linkresolver_set_strategy(struct archive_entry_linkresolver *res,
+ int strategy)
+{
+ res->strategy = strategy;
}
void
-archive_entry_linkresolver_free(struct archive_entry_linkresolver *links_cache)
+archive_entry_linkresolver_free(struct archive_entry_linkresolver *res)
{
size_t i;
- if (links_cache->buckets == NULL)
+ if (res->buckets == NULL)
return;
- for (i = 0; i < links_cache->number_buckets; i++) {
- while (links_cache->buckets[i] != NULL) {
- struct links_entry *lp = links_cache->buckets[i]->next;
- if (links_cache->buckets[i]->name != NULL)
- free(links_cache->buckets[i]->name);
- free(links_cache->buckets[i]);
- links_cache->buckets[i] = lp;
+ for (i = 0; i < res->number_buckets; i++) {
+ while (res->buckets[i] != NULL) {
+ struct links_entry *lp = res->buckets[i]->next;
+ archive_entry_free(res->buckets[i]->entry);
+ free(res->buckets[i]);
+ res->buckets[i] = lp;
}
}
- free(links_cache->buckets);
- links_cache->buckets = NULL;
+ free(res->buckets);
+ res->buckets = NULL;
}
+/* Always uses tar-like semantics. */
const char *
-archive_entry_linkresolve(struct archive_entry_linkresolver *links_cache,
+archive_entry_linkresolve(struct archive_entry_linkresolver *res,
struct archive_entry *entry)
{
- struct links_entry *le, **new_buckets;
- int hash;
- size_t i, new_size;
- dev_t dev;
- ino_t ino;
- int nlinks;
+ struct links_entry *le;
+ /* If it has only one link, then we're done. */
+ if (archive_entry_nlink(entry) == 1)
+ return (NULL);
- /* Free a held name. */
- free(links_cache->last_name);
- links_cache->last_name = NULL;
+ /* Look it up in the hash. */
+ le = find_entry(res, entry);
+ if (le != NULL)
+ return (archive_entry_pathname(le->entry));
+ /* If it's not there, insert it. */
+ insert_entry(res, entry);
+ return (NULL);
+}
- /* If the links cache overflowed and got flushed, don't bother. */
- if (links_cache->buckets == NULL)
- return (NULL);
+void
+archive_entry_linkify(struct archive_entry_linkresolver *res,
+ struct archive_entry **e, struct archive_entry **f)
+{
+ struct links_entry *le;
+ struct archive_entry *t;
- dev = archive_entry_dev(entry);
- ino = archive_entry_ino(entry);
- nlinks = archive_entry_nlink(entry);
+ *f = NULL; /* Default: Don't return a second entry. */
- /* An entry with one link can't be a hard link. */
- if (nlinks == 1)
- return (NULL);
+ /* If it has only one link, then we're done. */
+ if (archive_entry_nlink(*e) == 1)
+ return;
- /* If the links cache is getting too full, enlarge the hash table. */
- if (links_cache->number_entries > links_cache->number_buckets * 2)
- {
- /* Try to enlarge the bucket list. */
- new_size = links_cache->number_buckets * 2;
- new_buckets = malloc(new_size * sizeof(struct links_entry *));
-
- if (new_buckets != NULL) {
- memset(new_buckets, 0,
- new_size * sizeof(struct links_entry *));
- for (i = 0; i < links_cache->number_buckets; i++) {
- while (links_cache->buckets[i] != NULL) {
- /* Remove entry from old bucket. */
- le = links_cache->buckets[i];
- links_cache->buckets[i] = le->next;
-
- /* Add entry to new bucket. */
- hash = (le->dev ^ le->ino) % new_size;
-
- if (new_buckets[hash] != NULL)
- new_buckets[hash]->previous =
- le;
- le->next = new_buckets[hash];
- le->previous = NULL;
- new_buckets[hash] = le;
- }
+ switch (res->strategy) {
+ case ARCHIVE_ENTRY_LINKIFY_LIKE_TAR:
+ le = find_entry(res, *e);
+ if (le != NULL) {
+ archive_entry_set_size(*e, 0);
+ archive_entry_set_hardlink(*e,
+ archive_entry_pathname(le->entry));
+ } else
+ insert_entry(res, *e);
+ return;
+ case ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO:
+ /* This one is trivial. */
+ return;
+ case ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO:
+ le = find_entry(res, *e);
+ if (le != NULL) {
+ t = *e;
+ *e = le->entry;
+ le->entry = t;
+ archive_entry_set_size(*e, 0);
+ archive_entry_set_hardlink(*e,
+ archive_entry_pathname(le->entry));
+ if (le->links == 0) {
+ *f = le->entry;
}
- free(links_cache->buckets);
- links_cache->buckets = new_buckets;
- links_cache->number_buckets = new_size;
+ } else {
+ insert_entry(res, *e);
+ *e = NULL;
}
+ return;
+ default:
+ break;
}
+ return;
+}
+
+static struct links_entry *
+find_entry(struct archive_entry_linkresolver *res,
+ struct archive_entry *entry)
+{
+ struct links_entry *le;
+ int hash, bucket;
+ dev_t dev;
+ ino_t ino;
+
+ /* Free a held entry. */
+ if (res->spare != NULL) {
+ archive_entry_free(res->spare->entry);
+ free(res->spare);
+ res->spare = NULL;
+ }
+
+ /* If the links cache overflowed and got flushed, don't bother. */
+ if (res->buckets == NULL)
+ return (NULL);
+
+ dev = archive_entry_dev(entry);
+ ino = archive_entry_ino(entry);
+ hash = dev ^ ino;
/* Try to locate this entry in the links cache. */
- hash = ( dev ^ ino ) % links_cache->number_buckets;
- for (le = links_cache->buckets[hash]; le != NULL; le = le->next) {
- if (le->dev == dev && le->ino == ino) {
+ bucket = hash % res->number_buckets;
+ for (le = res->buckets[bucket]; le != NULL; le = le->next) {
+ if (le->hash == hash
+ && dev == archive_entry_dev(le->entry)
+ && ino == archive_entry_ino(le->entry)) {
/*
* Decrement link count each time and release
* the entry if it hits zero. This saves
@@ -177,46 +238,91 @@ archive_entry_linkresolve(struct archive_entry_linkresolver *links_cache,
*/
--le->links;
if (le->links > 0)
- return (le->name);
- /*
- * When we release the entry, save the name
- * until the next call.
- */
- links_cache->last_name = le->name;
- /*
- * Release the entry.
- */
+ return (le);
+ /* Remove it from this hash bucket. */
if (le->previous != NULL)
le->previous->next = le->next;
if (le->next != NULL)
le->next->previous = le->previous;
- if (links_cache->buckets[hash] == le)
- links_cache->buckets[hash] = le->next;
- links_cache->number_entries--;
- free(le);
- return (links_cache->last_name);
+ if (res->buckets[bucket] == le)
+ res->buckets[bucket] = le->next;
+ res->number_entries--;
+ /* Defer freeing this entry. */
+ res->spare = le;
+ return (le);
}
}
+ return (NULL);
+}
+
+static void
+insert_entry(struct archive_entry_linkresolver *res,
+ struct archive_entry *entry)
+{
+ struct links_entry *le;
+ int hash, bucket;
/* Add this entry to the links cache. */
le = malloc(sizeof(struct links_entry));
if (le == NULL)
- return (NULL);
- le->name = strdup(archive_entry_pathname(entry));
- if (le->name == NULL) {
+ return;
+ le->entry = archive_entry_clone(entry);
+ if (le->entry == NULL) {
free(le);
- return (NULL);
+ return;
}
+ /* If the links cache is getting too full, enlarge the hash table. */
+ if (res->number_entries > res->number_buckets * 2)
+ grow_hash(res);
+
+ hash = archive_entry_dev(entry) ^ archive_entry_ino(entry);
+ bucket = hash % res->number_buckets;
+
/* If we could allocate the entry, record it. */
- if (links_cache->buckets[hash] != NULL)
- links_cache->buckets[hash]->previous = le;
- links_cache->number_entries++;
- le->next = links_cache->buckets[hash];
+ if (res->buckets[bucket] != NULL)
+ res->buckets[bucket]->previous = le;
+ res->number_entries++;
+ le->next = res->buckets[bucket];
le->previous = NULL;
- links_cache->buckets[hash] = le;
- le->dev = dev;
- le->ino = ino;
- le->links = nlinks - 1;
- return (NULL);
+ res->buckets[bucket] = le;
+ le->hash = hash;
+ le->links = archive_entry_nlink(entry) - 1;
+}
+
+static void
+grow_hash(struct archive_entry_linkresolver *res)
+{
+ struct links_entry *le, **new_buckets;
+ size_t new_size;
+ size_t i, bucket;
+
+ /* Try to enlarge the bucket list. */
+ new_size = res->number_buckets * 2;
+ new_buckets = malloc(new_size * sizeof(struct links_entry *));
+
+ if (new_buckets != NULL) {
+ memset(new_buckets, 0,
+ new_size * sizeof(struct links_entry *));
+ for (i = 0; i < res->number_buckets; i++) {
+ while (res->buckets[i] != NULL) {
+ /* Remove entry from old bucket. */
+ le = res->buckets[i];
+ res->buckets[i] = le->next;
+
+ /* Add entry to new bucket. */
+ bucket = le->hash % new_size;
+
+ if (new_buckets[bucket] != NULL)
+ new_buckets[bucket]->previous =
+ le;
+ le->next = new_buckets[bucket];
+ le->previous = NULL;
+ new_buckets[bucket] = le;
+ }
+ }
+ free(res->buckets);
+ res->buckets = new_buckets;
+ res->number_buckets = new_size;
+ }
}
diff --git a/archivers/libarchive/files/libarchive/archive_entry_private.h b/archivers/libarchive/files/libarchive/archive_entry_private.h
index 50ad7b9064b..57fe29600ac 100644
--- a/archivers/libarchive/files/libarchive/archive_entry_private.h
+++ b/archivers/libarchive/files/libarchive/archive_entry_private.h
@@ -22,7 +22,7 @@
* (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: src/lib/libarchive/archive_entry_private.h,v 1.1 2007/05/29 01:00:18 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_entry_private.h,v 1.2 2007/12/30 04:58:21 kientzle Exp $
*/
#ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
diff --git a/archivers/libarchive/files/libarchive/archive_entry_strmode.c b/archivers/libarchive/files/libarchive/archive_entry_strmode.c
index 1a018734bce..dc08d9721a6 100644
--- a/archivers/libarchive/files/libarchive/archive_entry_strmode.c
+++ b/archivers/libarchive/files/libarchive/archive_entry_strmode.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.2 2008/02/19 05:49:02 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -65,15 +65,15 @@ archive_entry_strmode(struct archive_entry *entry)
bp[i+1] = '-';
if (mode & S_ISUID) {
- if (mode & S_IXUSR) bp[3] = 's';
+ if (mode & 0100) bp[3] = 's';
else bp[3] = 'S';
}
if (mode & S_ISGID) {
- if (mode & S_IXGRP) bp[6] = 's';
+ if (mode & 0010) bp[6] = 's';
else bp[6] = 'S';
}
if (mode & S_ISVTX) {
- if (mode & S_IXOTH) bp[9] = 't';
+ if (mode & 0001) bp[9] = 't';
else bp[9] = 'T';
}
if (archive_entry_acl_count(entry, ARCHIVE_ENTRY_ACL_TYPE_ACCESS))
diff --git a/archivers/libarchive/files/libarchive/archive_platform.h b/archivers/libarchive/files/libarchive/archive_platform.h
index 193a52cc674..b14ccd8206b 100644
--- a/archivers/libarchive/files/libarchive/archive_platform.h
+++ b/archivers/libarchive/files/libarchive/archive_platform.h
@@ -22,7 +22,7 @@
* (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: src/lib/libarchive/archive_platform.h,v 1.27 2007/05/29 01:00:18 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_platform.h,v 1.29 2008/02/19 06:06:13 kientzle Exp $
*/
/*
@@ -36,7 +36,10 @@
#ifndef ARCHIVE_PLATFORM_H_INCLUDED
#define ARCHIVE_PLATFORM_H_INCLUDED
-#if defined(PLATFORM_CONFIG_H)
+#ifdef _WIN32
+#include "config_windows.h"
+#include "archive_windows.h"
+#elif defined(PLATFORM_CONFIG_H)
/* Use hand-built config.h in environments that need it. */
#include PLATFORM_CONFIG_H
#elif defined(HAVE_CONFIG_H)
diff --git a/archivers/libarchive/files/libarchive/archive_read.c b/archivers/libarchive/files/libarchive/archive_read.c
index 7803fd2f9fe..19be77569c1 100644
--- a/archivers/libarchive/files/libarchive/archive_read.c
+++ b/archivers/libarchive/files/libarchive/archive_read.c
@@ -32,7 +32,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.35 2007/05/29 01:00:18 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.37 2008/01/03 17:54:26 des Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -741,3 +741,14 @@ __archive_read_register_compression(struct archive_read *a,
__archive_errx(1, "Not enough slots for compression registration");
return (NULL); /* Never actually executed. */
}
+
+/* used internally to simplify read-ahead */
+const void *
+__archive_read_ahead(struct archive_read *a, size_t len)
+{
+ const void *h;
+
+ if ((a->decompressor->read_ahead)(a, &h, len) < (ssize_t)len)
+ return (NULL);
+ return (h);
+}
diff --git a/archivers/libarchive/files/libarchive/archive_read_extract.c b/archivers/libarchive/files/libarchive/archive_read_extract.c
index 423ff7dd3c5..bb5add7bbdc 100644
--- a/archivers/libarchive/files/libarchive/archive_read_extract.c
+++ b/archivers/libarchive/files/libarchive/archive_read_extract.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.59 2007/05/29 01:00:18 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.60 2008/01/18 04:53:45 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -67,6 +67,7 @@ get_extract(struct archive_read *a)
archive_set_error(&a->archive, ENOMEM, "Can't extract");
return (NULL);
}
+ memset(a->extract, 0, sizeof(*a->extract));
a->extract->ad = archive_write_disk_new();
if (a->extract->ad == NULL) {
archive_set_error(&a->archive, ENOMEM, "Can't extract");
@@ -130,11 +131,13 @@ archive_read_extract_set_progress_callback(struct archive *_a,
static int
copy_data(struct archive *ar, struct archive *aw)
{
- int r;
+ off_t offset;
const void *buff;
+ struct extract *extract;
size_t size;
- off_t offset;
+ int r;
+ extract = get_extract((struct archive_read *)ar);
for (;;) {
r = archive_read_data_block(ar, &buff, &size, &offset);
if (r == ARCHIVE_EOF)
@@ -149,6 +152,9 @@ copy_data(struct archive *ar, struct archive *aw)
"%s", archive_error_string(aw));
return (r);
}
+ if (extract->extract_progress)
+ (extract->extract_progress)
+ (extract->extract_progress_user_data);
}
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_open_filename.c b/archivers/libarchive/files/libarchive/archive_read_open_filename.c
index 02e7902f3a8..3d6376fbcfa 100644
--- a/archivers/libarchive/files/libarchive/archive_read_open_filename.c
+++ b/archivers/libarchive/files/libarchive/archive_read_open_filename.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_filename.c,v 1.20 2007/06/26 03:06:48 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_filename.c,v 1.21 2008/02/19 06:10:48 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -47,6 +47,10 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_filename.c,v 1.20 2007/
#include "archive.h"
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
struct read_file_data {
int fd;
size_t block_size;
@@ -113,7 +117,7 @@ file_open(struct archive *a, void *client_data)
return (ARCHIVE_FATAL);
}
if (mine->filename[0] != '\0')
- mine->fd = open(mine->filename, O_RDONLY);
+ mine->fd = open(mine->filename, O_RDONLY | O_BINARY);
else
mine->fd = 0; /* Fake "open" for stdin. */
if (mine->fd < 0) {
diff --git a/archivers/libarchive/files/libarchive/archive_read_private.h b/archivers/libarchive/files/libarchive/archive_read_private.h
index f0f52021132..90fb7db12e6 100644
--- a/archivers/libarchive/files/libarchive/archive_read_private.h
+++ b/archivers/libarchive/files/libarchive/archive_read_private.h
@@ -22,7 +22,7 @@
* (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: src/lib/libarchive/archive_read_private.h,v 1.3 2007/05/29 01:00:18 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/archive_read_private.h,v 1.4 2008/01/03 17:54:26 des Exp $
*/
#ifndef ARCHIVE_READ_PRIVATE_H_INCLUDED
@@ -173,4 +173,7 @@ struct decompressor_t
int (*bid)(const void *, size_t),
int (*init)(struct archive_read *, const void *, size_t));
+const void
+ *__archive_read_ahead(struct archive_read *, size_t);
+
#endif
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c
index aa664d10b19..372eff09541 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_bzip2.c
@@ -25,7 +25,7 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_bzip2.c,v 1.16 2007/05/29 01:00:18 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_bzip2.c,v 1.17 2008/02/19 05:44:59 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -145,7 +145,7 @@ init(struct archive_read *a, const void *buff, size_t n)
(void)buff; /* UNUSED */
(void)n; /* UNUSED */
- archive_set_error(a, -1,
+ archive_set_error(&a->archive, -1,
"This version of libarchive was compiled without bzip2 support");
return (ARCHIVE_FATAL);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c
index 89784b8dfcc..2dac54da0cd 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_gzip.c
@@ -25,7 +25,7 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_gzip.c,v 1.15 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_gzip.c,v 1.16 2008/02/19 05:44:59 kientzle Exp $");
#ifdef HAVE_ERRNO_H
@@ -146,7 +146,7 @@ init(struct archive_read *a, const void *buff, size_t n)
(void)buff; /* UNUSED */
(void)n; /* UNUSED */
- archive_set_error(a, -1,
+ archive_set_error(&a->archive, -1,
"This version of libarchive was compiled without gzip support");
return (ARCHIVE_FATAL);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_none.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_none.c
index 1cafd8385a5..3f17756abae 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_compression_none.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_none.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_none.c,v 1.18 2007/10/27 22:45:40 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_none.c,v 1.19 2007/12/30 04:58:21 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_all.c b/archivers/libarchive/files/libarchive/archive_read_support_format_all.c
index c9165c89453..24e31ef54f5 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_all.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_all.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_all.c,v 1.9 2007/04/07 05:54:23 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_all.c,v 1.10 2007/12/30 04:58:21 kientzle Exp $");
#include "archive.h"
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_ar.c b/archivers/libarchive/files/libarchive/archive_read_support_format_ar.c
index 5fad4aea038..a74791c6dae 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_ar.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_ar.c
@@ -26,7 +26,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_ar.c,v 1.6 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_ar.c,v 1.8 2008/02/19 05:54:24 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -268,8 +268,7 @@ archive_read_format_ar_read_header(struct archive_read *a,
/* This must come before any call to _read_ahead. */
ar_parse_common_header(ar, entry, h);
archive_entry_copy_pathname(entry, filename);
- archive_entry_set_mode(entry,
- S_IFREG | (archive_entry_mode(entry) & 0777));
+ archive_entry_set_filetype(entry, AE_IFREG);
/* Get the size of the filename table. */
number = ar_atol10(h + AR_size_offset, AR_size_size);
if (number > SIZE_MAX) {
@@ -375,8 +374,7 @@ archive_read_format_ar_read_header(struct archive_read *a,
/* Parse the time, owner, mode, size fields. */
r = ar_parse_common_header(ar, entry, h);
/* Force the file type to a regular file. */
- archive_entry_set_mode(entry,
- S_IFREG | (archive_entry_mode(entry) & 0777));
+ archive_entry_set_filetype(entry, AE_IFREG);
return (r);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c b/archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c
index 1ede8b622b2..2c50abc6b88 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_cpio.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_cpio.c,v 1.24 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_cpio.c,v 1.26 2008/01/15 04:56:48 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -321,10 +321,12 @@ static int
is_hex(const char *p, size_t len)
{
while (len-- > 0) {
- if (*p < '0' || (*p > '9' && *p < 'a') || *p > 'f') {
+ if ((*p >= '0' && *p <= '9')
+ || (*p >= 'a' && *p <= 'f')
+ || (*p >= 'A' && *p <= 'F'))
+ ++p;
+ else
return (0);
- }
- ++p;
}
return (1);
}
@@ -741,7 +743,7 @@ record_hardlink(struct cpio *cpio, struct archive_entry *entry)
*/
for (le = cpio->links_head; le; le = le->next) {
if (le->dev == dev && le->ino == ino) {
- archive_entry_set_hardlink(entry, le->name);
+ archive_entry_copy_hardlink(entry, le->name);
if (--le->links <= 0) {
if (le->previous != NULL)
@@ -750,6 +752,7 @@ record_hardlink(struct cpio *cpio, struct archive_entry *entry)
le->next->previous = le->previous;
if (cpio->links_head == le)
cpio->links_head = le->next;
+ free(le->name);
free(le);
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c b/archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c
index d2419eac66f..d333f0ccb4e 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_iso9660.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1.23 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1.25 2008/02/19 06:02:01 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -181,6 +181,7 @@ struct file_info {
time_t mtime; /* File last modified time. */
time_t atime; /* File last accessed time. */
time_t ctime; /* File creation time. */
+ uint64_t rdev; /* Device number */
mode_t mode;
uid_t uid;
gid_t gid;
@@ -360,6 +361,8 @@ archive_read_format_iso9660_read_header(struct archive_read *a,
archive_entry_set_mtime(entry, file->mtime, 0);
archive_entry_set_ctime(entry, file->ctime, 0);
archive_entry_set_atime(entry, file->atime, 0);
+ /* N.B.: Rock Ridge supports 64-bit device numbers. */
+ archive_entry_set_rdev(entry, (dev_t)file->rdev);
archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
archive_string_empty(&iso9660->pathname);
archive_entry_set_pathname(entry,
@@ -675,6 +678,14 @@ parse_rockridge(struct iso9660 *iso9660, struct file_info *file,
*/
break;
}
+ if (p[0] == 'P' && p[1] == 'N' && version == 1) {
+ if (data_length == 16) {
+ file->rdev = toi(data,4);
+ file->rdev <<= 32;
+ file->rdev |= toi(data + 8, 4);
+ }
+ break;
+ }
if (p[0] == 'P' && p[1] == 'X' && version == 1) {
/*
* PX extension comprises:
@@ -1053,24 +1064,28 @@ time_from_tm(struct tm *t)
if (t->tm_isdst)
t->tm_hour -= 1;
return (mktime(t)); /* Re-convert. */
-#else
- /*
- * If you don't have tm_gmtoff, let's try resetting the timezone
- * (yecch!).
- */
+#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV) && defined(HAVE_TZSET)
+ /* No timegm() and no tm_gmtoff, let's try forcing mktime() to UTC. */
time_t ret;
char *tz;
+ /* Reset the timezone, remember the old one. */
tz = getenv("TZ");
setenv("TZ", "UTC 0", 1);
tzset();
+
ret = mktime(t);
+
+ /* Restore the previous timezone. */
if (tz)
setenv("TZ", tz, 1);
else
unsetenv("TZ");
tzset();
return ret;
+#else
+ /* <sigh> We have no choice but to use localtime instead of UTC. */
+ return (mktime(t));
#endif
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c b/archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c
index e6ac99f6bfb..7db6db3377a 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_mtree.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_mtree.c,v 1.2 2008/02/19 06:07:10 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -50,6 +50,10 @@ __FBSDID("$FreeBSD$");
#include "archive_read_private.h"
#include "archive_string.h"
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
struct mtree_entry {
struct mtree_entry *next;
char *name;
@@ -371,7 +375,8 @@ read_header(struct archive_read *a, struct archive_entry *entry)
* the contents file on disk.)
*/
if (archive_strlen(&mtree->contents_name) > 0) {
- mtree->fd = open(mtree->contents_name.s, O_RDONLY);
+ mtree->fd = open(mtree->contents_name.s,
+ O_RDONLY | O_BINARY);
if (mtree->fd < 0) {
archive_set_error(&a->archive, errno,
"Can't open content=\"%s\"",
@@ -380,7 +385,8 @@ read_header(struct archive_read *a, struct archive_entry *entry)
}
} else {
/* If the specified path opens, use it. */
- mtree->fd = open(mtree->current_dir.s, O_RDONLY);
+ mtree->fd = open(mtree->current_dir.s,
+ O_RDONLY | O_BINARY);
/* But don't fail if it's not there. */
}
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c b/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c
index 6d6ee309571..26b2abbe578 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_tar.c,v 1.62 2007/10/24 04:01:31 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_tar.c,v 1.65 2008/01/31 07:41:45 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -144,8 +144,8 @@ struct sparse_block {
struct tar {
struct archive_string acl_text;
- struct archive_string entry_name;
- struct archive_string entry_linkname;
+ struct archive_string entry_pathname;
+ struct archive_string entry_linkpath;
struct archive_string entry_uname;
struct archive_string entry_gname;
struct archive_string longlink;
@@ -153,6 +153,7 @@ struct tar {
struct archive_string pax_header;
struct archive_string pax_global;
struct archive_string line;
+ int pax_hdrcharset_binary;
wchar_t *pax_entry;
size_t pax_entry_length;
int header_recursion_depth;
@@ -169,9 +170,9 @@ struct tar {
char sparse_gnu_pending;
};
-static size_t UTF8_mbrtowc(wchar_t *pwc, const char *s, size_t n);
+static ssize_t UTF8_mbrtowc(wchar_t *pwc, const char *s, size_t n);
static int archive_block_is_null(const unsigned char *p);
-static char *base64_decode(const wchar_t *, size_t, size_t *);
+static char *base64_decode(const char *, size_t, size_t *);
static void gnu_add_sparse_entry(struct tar *,
off_t offset, off_t remaining);
static void gnu_clear_sparse_list(struct tar *);
@@ -179,7 +180,7 @@ static int gnu_sparse_old_read(struct archive_read *, struct tar *,
const struct archive_entry_header_gnutar *header);
static void gnu_sparse_old_parse(struct tar *,
const struct gnu_sparse *sparse, int length);
-static int gnu_sparse_01_parse(struct tar *, const wchar_t *);
+static int gnu_sparse_01_parse(struct tar *, const char *);
static ssize_t gnu_sparse_10_read(struct archive_read *, struct tar *);
static int header_Solaris_ACL(struct archive_read *, struct tar *,
struct archive_entry *, const void *);
@@ -210,24 +211,23 @@ static int archive_read_format_tar_read_header(struct archive_read *,
struct archive_entry *);
static int checksum(struct archive_read *, const void *);
static int pax_attribute(struct tar *, struct archive_entry *,
- wchar_t *key, wchar_t *value);
+ char *key, char *value);
static int pax_header(struct archive_read *, struct tar *,
struct archive_entry *, char *attr);
-static void pax_time(const wchar_t *, int64_t *sec, long *nanos);
+static void pax_time(const char *, int64_t *sec, long *nanos);
static ssize_t readline(struct archive_read *, struct tar *, const char **,
ssize_t limit);
static int read_body_to_string(struct archive_read *, struct tar *,
struct archive_string *, const void *h);
static int64_t tar_atol(const char *, unsigned);
-static int64_t tar_atol10(const wchar_t *, unsigned);
+static int64_t tar_atol10(const char *, unsigned);
static int64_t tar_atol256(const char *, unsigned);
static int64_t tar_atol8(const char *, unsigned);
static int tar_read_header(struct archive_read *, struct tar *,
struct archive_entry *);
static int tohex(int c);
static char *url_decode(const char *);
-static int utf8_decode(wchar_t *, const char *, size_t length);
-static char *wide_to_narrow(const wchar_t *wval);
+static wchar_t *utf8_decode(struct tar *, const char *, size_t length);
int
archive_read_support_format_gnutar(struct archive *a)
@@ -271,13 +271,15 @@ archive_read_format_tar_cleanup(struct archive_read *a)
tar = (struct tar *)(a->format->data);
gnu_clear_sparse_list(tar);
archive_string_free(&tar->acl_text);
- archive_string_free(&tar->entry_name);
- archive_string_free(&tar->entry_linkname);
+ archive_string_free(&tar->entry_pathname);
+ archive_string_free(&tar->entry_linkpath);
archive_string_free(&tar->entry_uname);
archive_string_free(&tar->entry_gname);
archive_string_free(&tar->line);
archive_string_free(&tar->pax_global);
archive_string_free(&tar->pax_header);
+ archive_string_free(&tar->longname);
+ archive_string_free(&tar->longlink);
free(tar->pax_entry);
free(tar);
(a->format->data) = NULL;
@@ -293,24 +295,8 @@ archive_read_format_tar_bid(struct archive_read *a)
const void *h;
const struct archive_entry_header_ustar *header;
- /*
- * If we're already reading a non-tar file, don't
- * bother to bid.
- */
- if (a->archive.archive_format != 0 &&
- (a->archive.archive_format & ARCHIVE_FORMAT_BASE_MASK) !=
- ARCHIVE_FORMAT_TAR)
- return (0);
bid = 0;
- /*
- * If we're already reading a tar format, start the bid at 1 as
- * a failsafe.
- */
- if ((a->archive.archive_format & ARCHIVE_FORMAT_BASE_MASK) ==
- ARCHIVE_FORMAT_TAR)
- bid++;
-
/* Now let's look at the actual header and see if it matches. */
if (a->decompressor->read_ahead != NULL)
bytes_read = (a->decompressor->read_ahead)(a, &h, 512);
@@ -322,13 +308,14 @@ archive_read_format_tar_bid(struct archive_read *a)
return (0);
/* If it's an end-of-archive mark, we can handle it. */
- if ((*(const char *)h) == 0 && archive_block_is_null((const unsigned char *)h)) {
- /* If it's a known tar file, end-of-archive is definite. */
- if ((a->archive.archive_format & ARCHIVE_FORMAT_BASE_MASK) ==
- ARCHIVE_FORMAT_TAR)
- return (512);
- /* Empty archive? */
- return (1);
+ if ((*(const char *)h) == 0
+ && archive_block_is_null((const unsigned char *)h)) {
+ /*
+ * Usually, I bid the number of bits verified, but
+ * in this case, 4096 seems excessive so I picked 10 as
+ * an arbitrary but reasonable-seeming value.
+ */
+ return (10);
}
/* If it's not an end-of-archive mark, it must have a valid checksum.*/
@@ -588,6 +575,10 @@ tar_read_header(struct archive_read *a, struct tar *tar,
if (bytes > 0)
(a->decompressor->consume)(a, bytes);
archive_set_error(&a->archive, 0, NULL);
+ if (a->archive.archive_format_name == NULL) {
+ a->archive.archive_format = ARCHIVE_FORMAT_TAR;
+ a->archive.archive_format_name = "tar";
+ }
return (ARCHIVE_EOF);
}
@@ -775,16 +766,9 @@ header_Solaris_ACL(struct archive_read *a, struct tar *tar,
while (*p != '\0' && p < acl + size)
p++;
- wp = (wchar_t *)malloc((p - acl + 1) * sizeof(wchar_t));
- if (wp == NULL) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate work buffer for ACL parsing");
- return (ARCHIVE_FATAL);
- }
- utf8_decode(wp, acl, p - acl);
+ wp = utf8_decode(tar, acl, p - acl);
err = __archive_entry_acl_parse_w(entry, wp,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
- free(wp);
return (err);
}
@@ -804,7 +788,7 @@ header_longlink(struct archive_read *a, struct tar *tar,
if ((err != ARCHIVE_OK) && (err != ARCHIVE_WARN))
return (err);
/* Set symlink if symlink already set, else hardlink. */
- archive_entry_set_link(entry, tar->longlink.s);
+ archive_entry_copy_link(entry, tar->longlink.s);
return (ARCHIVE_OK);
}
@@ -824,7 +808,7 @@ header_longname(struct archive_read *a, struct tar *tar,
err = tar_read_header(a, tar, entry);
if ((err != ARCHIVE_OK) && (err != ARCHIVE_WARN))
return (err);
- archive_entry_set_pathname(entry, tar->longname.s);
+ archive_entry_copy_pathname(entry, tar->longname.s);
return (ARCHIVE_OK);
}
@@ -916,10 +900,10 @@ header_common(struct archive_read *a, struct tar *tar,
header = (const struct archive_entry_header_ustar *)h;
if (header->linkname[0])
- archive_strncpy(&(tar->entry_linkname), header->linkname,
+ archive_strncpy(&(tar->entry_linkpath), header->linkname,
sizeof(header->linkname));
else
- archive_string_empty(&(tar->entry_linkname));
+ archive_string_empty(&(tar->entry_linkpath));
/* Parse out the numeric fields (all are octal) */
archive_entry_set_mode(entry, tar_atol(header->mode, sizeof(header->mode)));
@@ -935,7 +919,7 @@ header_common(struct archive_read *a, struct tar *tar,
switch (tartype) {
case '1': /* Hard link */
- archive_entry_set_hardlink(entry, tar->entry_linkname.s);
+ archive_entry_copy_hardlink(entry, tar->entry_linkpath.s);
/*
* The following may seem odd, but: Technically, tar
* does not store the file type for a "hard link"
@@ -952,36 +936,52 @@ header_common(struct archive_read *a, struct tar *tar,
* A tricky point: Traditionally, tar readers have
* ignored the size field when reading hardlink
* entries, and some writers put non-zero sizes even
- * though the body is empty. POSIX.1-2001 broke with
- * this tradition by permitting hardlink entries to
- * store valid bodies in pax interchange format, but
- * not in ustar format. Since there is no hard and
- * fast way to distinguish pax interchange from
- * earlier archives (the 'x' and 'g' entries are
- * optional, after all), we need a heuristic. Here, I
- * use the bid function to test whether or not there's
- * a valid header following. Of course, if we know
- * this is pax interchange format, then we must obey
- * the size.
- *
- * This heuristic will only fail for a pax interchange
- * archive that is storing hardlink bodies, no pax
- * extended attribute entries have yet occurred, and
- * we encounter a hardlink entry for a file that is
- * itself an uncompressed tar archive.
+ * though the body is empty. POSIX blessed this
+ * convention in the 1988 standard, but broke with
+ * this tradition in 2001 by permitting hardlink
+ * entries to store valid bodies in pax interchange
+ * format, but not in ustar format. Since there is no
+ * hard and fast way to distinguish pax interchange
+ * from earlier archives (the 'x' and 'g' entries are
+ * optional, after all), we need a heuristic.
*/
- if (archive_entry_size(entry) > 0 &&
- a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE &&
- archive_read_format_tar_bid(a) > 50) {
+ if (archive_entry_size(entry) == 0) {
+ /* If the size is already zero, we're done. */
+ } else if (a->archive.archive_format
+ == ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE) {
+ /* Definitely pax extended; must obey hardlink size. */
+ } else if (a->archive.archive_format == ARCHIVE_FORMAT_TAR
+ || a->archive.archive_format == ARCHIVE_FORMAT_TAR_GNUTAR)
+ {
+ /* Old-style or GNU tar: we must ignore the size. */
+ archive_entry_set_size(entry, 0);
+ tar->entry_bytes_remaining = 0;
+ } else if (archive_read_format_tar_bid(a) > 50) {
+ /*
+ * We don't know if it's pax: If the bid
+ * function sees a valid ustar header
+ * immediately following, then let's ignore
+ * the hardlink size.
+ */
archive_entry_set_size(entry, 0);
tar->entry_bytes_remaining = 0;
}
+ /*
+ * TODO: There are still two cases I'd like to handle:
+ * = a ustar non-pax archive with a hardlink entry at
+ * end-of-archive. (Look for block of nulls following?)
+ * = a pax archive that has not seen any pax headers
+ * and has an entry which is a hardlink entry storing
+ * a body containing an uncompressed tar archive.
+ * The first is worth addressing; I don't see any reliable
+ * way to deal with the second possibility.
+ */
break;
case '2': /* Symlink */
archive_entry_set_filetype(entry, AE_IFLNK);
archive_entry_set_size(entry, 0);
tar->entry_bytes_remaining = 0;
- archive_entry_set_symlink(entry, tar->entry_linkname.s);
+ archive_entry_copy_symlink(entry, tar->entry_linkpath.s);
break;
case '3': /* Character device */
archive_entry_set_filetype(entry, AE_IFCHR);
@@ -1053,8 +1053,8 @@ header_old_tar(struct archive_read *a, struct tar *tar,
/* Copy filename over (to ensure null termination). */
header = (const struct archive_entry_header_ustar *)h;
- archive_strncpy(&(tar->entry_name), header->name, sizeof(header->name));
- archive_entry_set_pathname(entry, tar->entry_name.s);
+ archive_strncpy(&(tar->entry_pathname), header->name, sizeof(header->name));
+ archive_entry_copy_pathname(entry, tar->entry_pathname.s);
/* Grab rest of common fields */
header_common(a, tar, entry, h);
@@ -1125,7 +1125,7 @@ header_ustar(struct archive_read *a, struct tar *tar,
header = (const struct archive_entry_header_ustar *)h;
/* Copy name into an internal buffer to ensure null-termination. */
- as = &(tar->entry_name);
+ as = &(tar->entry_pathname);
if (header->prefix[0]) {
archive_strncpy(as, header->prefix, sizeof(header->prefix));
if (as->s[archive_strlen(as) - 1] != '/')
@@ -1134,7 +1134,7 @@ header_ustar(struct archive_read *a, struct tar *tar,
} else
archive_strncpy(as, header->name, sizeof(header->name));
- archive_entry_set_pathname(entry, as->s);
+ archive_entry_copy_pathname(entry, as->s);
/* Handle rest of common fields. */
header_common(a, tar, entry, h);
@@ -1142,11 +1142,11 @@ header_ustar(struct archive_read *a, struct tar *tar,
/* Handle POSIX ustar fields. */
archive_strncpy(&(tar->entry_uname), header->uname,
sizeof(header->uname));
- archive_entry_set_uname(entry, tar->entry_uname.s);
+ archive_entry_copy_uname(entry, tar->entry_uname.s);
archive_strncpy(&(tar->entry_gname), header->gname,
sizeof(header->gname));
- archive_entry_set_gname(entry, tar->entry_gname.s);
+ archive_entry_copy_gname(entry, tar->entry_gname.s);
/* Parse out device numbers only for char and block specials. */
if (header->typeflag[0] == '3' || header->typeflag[0] == '4') {
@@ -1173,10 +1173,16 @@ pax_header(struct archive_read *a, struct tar *tar,
{
size_t attr_length, l, line_length;
char *line, *p;
- wchar_t *key, *wp, *value;
+ char *key, *value;
+ wchar_t *wp;
int err, err2;
attr_length = strlen(attr);
+ tar->pax_hdrcharset_binary = 0;
+ archive_string_empty(&(tar->entry_gname));
+ archive_string_empty(&(tar->entry_linkpath));
+ archive_string_empty(&(tar->entry_pathname));
+ archive_string_empty(&(tar->entry_uname));
err = ARCHIVE_OK;
while (attr_length > 0) {
/* Parse decimal length field at start of line. */
@@ -1219,49 +1225,24 @@ pax_header(struct archive_read *a, struct tar *tar,
return (ARCHIVE_WARN);
}
- /* Ensure pax_entry buffer is big enough. */
- if (tar->pax_entry_length <= line_length) {
- wchar_t *old_entry = tar->pax_entry;
-
- if (tar->pax_entry_length <= 0)
- tar->pax_entry_length = 1024;
- while (tar->pax_entry_length <= line_length + 1)
- tar->pax_entry_length *= 2;
-
- old_entry = tar->pax_entry;
- tar->pax_entry = (wchar_t *)realloc(tar->pax_entry,
- tar->pax_entry_length * sizeof(wchar_t));
- if (tar->pax_entry == NULL) {
- free(old_entry);
- archive_set_error(&a->archive, ENOMEM,
- "No memory");
- return (ARCHIVE_FATAL);
- }
- }
-
- /* Decode UTF-8 to wchar_t, null-terminate result. */
- if (utf8_decode(tar->pax_entry, p,
- line_length - (p - attr) - 1)) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Invalid UTF8 character in pax extended attribute");
- err = err_combine(err, ARCHIVE_WARN);
- }
+ /* Null-terminate the line. */
+ attr[line_length - 1] = '\0';
- /* Null-terminate 'key' value. */
- wp = key = tar->pax_entry;
- if (key[0] == L'=')
+ /* Find end of key and null terminate it. */
+ key = p;
+ if (key[0] == '=')
return (-1);
- while (*wp && *wp != L'=')
- ++wp;
- if (*wp == L'\0') {
+ while (*p && *p != '=')
+ ++p;
+ if (*p == '\0') {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Invalid pax extended attributes");
return (ARCHIVE_WARN);
}
- *wp = 0;
+ *p = '\0';
/* Identify null-terminated 'value' portion. */
- value = wp + 1;
+ value = p + 1;
/* Identify this attribute and set it in the entry. */
err2 = pax_attribute(tar, entry, key, value);
@@ -1271,33 +1252,77 @@ pax_header(struct archive_read *a, struct tar *tar,
attr += line_length;
attr_length -= line_length;
}
+ if (archive_strlen(&(tar->entry_gname)) > 0) {
+ value = tar->entry_gname.s;
+ if (tar->pax_hdrcharset_binary)
+ archive_entry_copy_gname(entry, value);
+ else {
+ wp = utf8_decode(tar, value, strlen(value));
+ if (wp == NULL)
+ archive_entry_copy_gname(entry, value);
+ else
+ archive_entry_copy_gname_w(entry, wp);
+ }
+ }
+ if (archive_strlen(&(tar->entry_linkpath)) > 0) {
+ value = tar->entry_linkpath.s;
+ if (tar->pax_hdrcharset_binary)
+ archive_entry_copy_link(entry, value);
+ else {
+ wp = utf8_decode(tar, value, strlen(value));
+ if (wp == NULL)
+ archive_entry_copy_link(entry, value);
+ else
+ archive_entry_copy_link_w(entry, wp);
+ }
+ }
+ if (archive_strlen(&(tar->entry_pathname)) > 0) {
+ value = tar->entry_pathname.s;
+ if (tar->pax_hdrcharset_binary)
+ archive_entry_copy_pathname(entry, value);
+ else {
+ wp = utf8_decode(tar, value, strlen(value));
+ if (wp == NULL)
+ archive_entry_copy_pathname(entry, value);
+ else
+ archive_entry_copy_pathname_w(entry, wp);
+ }
+ }
+ if (archive_strlen(&(tar->entry_uname)) > 0) {
+ value = tar->entry_uname.s;
+ if (tar->pax_hdrcharset_binary)
+ archive_entry_copy_uname(entry, value);
+ else {
+ wp = utf8_decode(tar, value, strlen(value));
+ if (wp == NULL)
+ archive_entry_copy_uname(entry, value);
+ else
+ archive_entry_copy_uname_w(entry, wp);
+ }
+ }
return (err);
}
static int
pax_attribute_xattr(struct archive_entry *entry,
- wchar_t *name, wchar_t *value)
+ char *name, char *value)
{
- char *name_decoded, *name_narrow;
+ char *name_decoded;
void *value_decoded;
size_t value_len;
- if (wcslen(name) < 18 || (wcsncmp(name, L"LIBARCHIVE.xattr.", 17)) != 0)
+ if (strlen(name) < 18 || (strncmp(name, "LIBARCHIVE.xattr.", 17)) != 0)
return 3;
name += 17;
/* URL-decode name */
- name_narrow = wide_to_narrow(name);
- if (name_narrow == NULL)
- return 2;
- name_decoded = url_decode(name_narrow);
- free(name_narrow);
+ name_decoded = url_decode(name);
if (name_decoded == NULL)
return 2;
/* Base-64 decode value */
- value_decoded = base64_decode(value, wcslen(value), &value_len);
+ value_decoded = base64_decode(value, strlen(value), &value_len);
if (value_decoded == NULL) {
free(name_decoded);
return 1;
@@ -1326,22 +1351,23 @@ pax_attribute_xattr(struct archive_entry *entry,
*/
static int
pax_attribute(struct tar *tar, struct archive_entry *entry,
- wchar_t *key, wchar_t *value)
+ char *key, char *value)
{
int64_t s;
long n;
+ wchar_t *wp;
switch (key[0]) {
case 'G':
/* GNU "0.0" sparse pax format. */
- if (wcscmp(key, L"GNU.sparse.numblocks") == 0) {
+ if (strcmp(key, "GNU.sparse.numblocks") == 0) {
tar->sparse_offset = -1;
tar->sparse_numbytes = -1;
tar->sparse_gnu_major = 0;
tar->sparse_gnu_minor = 0;
}
- if (wcscmp(key, L"GNU.sparse.offset") == 0) {
- tar->sparse_offset = tar_atol10(value, wcslen(value));
+ if (strcmp(key, "GNU.sparse.offset") == 0) {
+ tar->sparse_offset = tar_atol10(value, strlen(value));
if (tar->sparse_numbytes != -1) {
gnu_add_sparse_entry(tar,
tar->sparse_offset, tar->sparse_numbytes);
@@ -1349,8 +1375,8 @@ pax_attribute(struct tar *tar, struct archive_entry *entry,
tar->sparse_numbytes = -1;
}
}
- if (wcscmp(key, L"GNU.sparse.numbytes") == 0) {
- tar->sparse_numbytes = tar_atol10(value, wcslen(value));
+ if (strcmp(key, "GNU.sparse.numbytes") == 0) {
+ tar->sparse_numbytes = tar_atol10(value, strlen(value));
if (tar->sparse_numbytes != -1) {
gnu_add_sparse_entry(tar,
tar->sparse_offset, tar->sparse_numbytes);
@@ -1358,13 +1384,13 @@ pax_attribute(struct tar *tar, struct archive_entry *entry,
tar->sparse_numbytes = -1;
}
}
- if (wcscmp(key, L"GNU.sparse.size") == 0) {
- tar->realsize = tar_atol10(value, wcslen(value));
+ if (strcmp(key, "GNU.sparse.size") == 0) {
+ tar->realsize = tar_atol10(value, strlen(value));
archive_entry_set_size(entry, tar->realsize);
}
/* GNU "0.1" sparse pax format. */
- if (wcscmp(key, L"GNU.sparse.map") == 0) {
+ if (strcmp(key, "GNU.sparse.map") == 0) {
tar->sparse_gnu_major = 0;
tar->sparse_gnu_minor = 1;
if (gnu_sparse_01_parse(tar, value) != ARCHIVE_OK)
@@ -1372,18 +1398,23 @@ pax_attribute(struct tar *tar, struct archive_entry *entry,
}
/* GNU "1.0" sparse pax format */
- if (wcscmp(key, L"GNU.sparse.major") == 0) {
- tar->sparse_gnu_major = tar_atol10(value, wcslen(value));
+ if (strcmp(key, "GNU.sparse.major") == 0) {
+ tar->sparse_gnu_major = tar_atol10(value, strlen(value));
tar->sparse_gnu_pending = 1;
}
- if (wcscmp(key, L"GNU.sparse.minor") == 0) {
- tar->sparse_gnu_minor = tar_atol10(value, wcslen(value));
+ if (strcmp(key, "GNU.sparse.minor") == 0) {
+ tar->sparse_gnu_minor = tar_atol10(value, strlen(value));
tar->sparse_gnu_pending = 1;
}
- if (wcscmp(key, L"GNU.sparse.name") == 0)
- archive_entry_copy_pathname_w(entry, value);
- if (wcscmp(key, L"GNU.sparse.realsize") == 0) {
- tar->realsize = tar_atol10(value, wcslen(value));
+ if (strcmp(key, "GNU.sparse.name") == 0) {
+ wp = utf8_decode(tar, value, strlen(value));
+ if (wp != NULL)
+ archive_entry_copy_pathname_w(entry, wp);
+ else
+ archive_entry_copy_pathname(entry, value);
+ }
+ if (strcmp(key, "GNU.sparse.realsize") == 0) {
+ tar->realsize = tar_atol10(value, strlen(value));
archive_entry_set_size(entry, tar->realsize);
}
break;
@@ -1394,85 +1425,107 @@ pax_attribute(struct tar *tar, struct archive_entry *entry,
if (strcmp(key, "LIBARCHIVE.xxxxxxx")==0)
archive_entry_set_xxxxxx(entry, value);
*/
- if (wcsncmp(key, L"LIBARCHIVE.xattr.", 17)==0)
+ if (strncmp(key, "LIBARCHIVE.xattr.", 17)==0)
pax_attribute_xattr(entry, key, value);
break;
case 'S':
/* We support some keys used by the "star" archiver */
- if (wcscmp(key, L"SCHILY.acl.access")==0)
- __archive_entry_acl_parse_w(entry, value,
+ if (strcmp(key, "SCHILY.acl.access")==0) {
+ wp = utf8_decode(tar, value, strlen(value));
+ /* TODO: if (wp == NULL) */
+ __archive_entry_acl_parse_w(entry, wp,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
- else if (wcscmp(key, L"SCHILY.acl.default")==0)
- __archive_entry_acl_parse_w(entry, value,
+ } else if (strcmp(key, "SCHILY.acl.default")==0) {
+ wp = utf8_decode(tar, value, strlen(value));
+ /* TODO: if (wp == NULL) */
+ __archive_entry_acl_parse_w(entry, wp,
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
- else if (wcscmp(key, L"SCHILY.devmajor")==0)
- archive_entry_set_rdevmajor(entry, tar_atol10(value, wcslen(value)));
- else if (wcscmp(key, L"SCHILY.devminor")==0)
- archive_entry_set_rdevminor(entry, tar_atol10(value, wcslen(value)));
- else if (wcscmp(key, L"SCHILY.fflags")==0)
- archive_entry_copy_fflags_text_w(entry, value);
- else if (wcscmp(key, L"SCHILY.dev")==0)
- archive_entry_set_dev(entry, tar_atol10(value, wcslen(value)));
- else if (wcscmp(key, L"SCHILY.ino")==0)
- archive_entry_set_ino(entry, tar_atol10(value, wcslen(value)));
- else if (wcscmp(key, L"SCHILY.nlink")==0)
- archive_entry_set_nlink(entry, tar_atol10(value, wcslen(value)));
- else if (wcscmp(key, L"SCHILY.realsize")==0) {
- tar->realsize = tar_atol10(value, wcslen(value));
+ } else if (strcmp(key, "SCHILY.devmajor")==0) {
+ archive_entry_set_rdevmajor(entry,
+ tar_atol10(value, strlen(value)));
+ } else if (strcmp(key, "SCHILY.devminor")==0) {
+ archive_entry_set_rdevminor(entry,
+ tar_atol10(value, strlen(value)));
+ } else if (strcmp(key, "SCHILY.fflags")==0) {
+ wp = utf8_decode(tar, value, strlen(value));
+ /* TODO: if (wp == NULL) */
+ archive_entry_copy_fflags_text_w(entry, wp);
+ } else if (strcmp(key, "SCHILY.dev")==0) {
+ archive_entry_set_dev(entry,
+ tar_atol10(value, strlen(value)));
+ } else if (strcmp(key, "SCHILY.ino")==0) {
+ archive_entry_set_ino(entry,
+ tar_atol10(value, strlen(value)));
+ } else if (strcmp(key, "SCHILY.nlink")==0) {
+ archive_entry_set_nlink(entry,
+ tar_atol10(value, strlen(value)));
+ } else if (strcmp(key, "SCHILY.realsize")==0) {
+ tar->realsize = tar_atol10(value, strlen(value));
archive_entry_set_size(entry, tar->realsize);
}
break;
case 'a':
- if (wcscmp(key, L"atime")==0) {
+ if (strcmp(key, "atime")==0) {
pax_time(value, &s, &n);
archive_entry_set_atime(entry, s, n);
}
break;
case 'c':
- if (wcscmp(key, L"ctime")==0) {
+ if (strcmp(key, "ctime")==0) {
pax_time(value, &s, &n);
archive_entry_set_ctime(entry, s, n);
- } else if (wcscmp(key, L"charset")==0) {
+ } else if (strcmp(key, "charset")==0) {
/* TODO: Publish charset information in entry. */
- } else if (wcscmp(key, L"comment")==0) {
+ } else if (strcmp(key, "comment")==0) {
/* TODO: Publish comment in entry. */
}
break;
case 'g':
- if (wcscmp(key, L"gid")==0)
- archive_entry_set_gid(entry, tar_atol10(value, wcslen(value)));
- else if (wcscmp(key, L"gname")==0)
- archive_entry_copy_gname_w(entry, value);
+ if (strcmp(key, "gid")==0) {
+ archive_entry_set_gid(entry,
+ tar_atol10(value, strlen(value)));
+ } else if (strcmp(key, "gname")==0) {
+ archive_strcpy(&(tar->entry_gname), value);
+ }
+ break;
+ case 'h':
+ if (strcmp(key, "hdrcharset") == 0) {
+ if (strcmp(value, "BINARY") == 0)
+ tar->pax_hdrcharset_binary = 1;
+ else if (strcmp(value, "ISO-IR 10646 2000 UTF-8") == 0)
+ tar->pax_hdrcharset_binary = 0;
+ else {
+ /* TODO: Warn about unsupported hdrcharset */
+ }
+ }
break;
case 'l':
/* pax interchange doesn't distinguish hardlink vs. symlink. */
- if (wcscmp(key, L"linkpath")==0) {
- if (archive_entry_hardlink(entry))
- archive_entry_copy_hardlink_w(entry, value);
- else
- archive_entry_copy_symlink_w(entry, value);
+ if (strcmp(key, "linkpath")==0) {
+ archive_strcpy(&(tar->entry_linkpath), value);
}
break;
case 'm':
- if (wcscmp(key, L"mtime")==0) {
+ if (strcmp(key, "mtime")==0) {
pax_time(value, &s, &n);
archive_entry_set_mtime(entry, s, n);
}
break;
case 'p':
- if (wcscmp(key, L"path")==0)
- archive_entry_copy_pathname_w(entry, value);
+ if (strcmp(key, "path")==0) {
+ archive_strcpy(&(tar->entry_pathname), value);
+ }
break;
case 'r':
/* POSIX has reserved 'realtime.*' */
break;
case 's':
/* POSIX has reserved 'security.*' */
- /* Someday: if (wcscmp(key, L"security.acl")==0) { ... } */
- if (wcscmp(key, L"size")==0) {
+ /* Someday: if (strcmp(key, "security.acl")==0) { ... } */
+ if (strcmp(key, "size")==0) {
/* "size" is the size of the data in the entry. */
tar->entry_bytes_remaining
- = tar_atol10(value, wcslen(value));
+ = tar_atol10(value, strlen(value));
/*
* But, "size" is not necessarily the size of
* the file on disk; if this is a sparse file,
@@ -1490,10 +1543,12 @@ pax_attribute(struct tar *tar, struct archive_entry *entry,
}
break;
case 'u':
- if (wcscmp(key, L"uid")==0)
- archive_entry_set_uid(entry, tar_atol10(value, wcslen(value)));
- else if (wcscmp(key, L"uname")==0)
- archive_entry_copy_uname_w(entry, value);
+ if (strcmp(key, "uid")==0) {
+ archive_entry_set_uid(entry,
+ tar_atol10(value, strlen(value)));
+ } else if (strcmp(key, "uname")==0) {
+ archive_strcpy(&(tar->entry_uname), value);
+ }
break;
}
return (0);
@@ -1505,7 +1560,7 @@ pax_attribute(struct tar *tar, struct archive_entry *entry,
* parse a decimal time value, which may include a fractional portion
*/
static void
-pax_time(const wchar_t *p, int64_t *ps, long *pn)
+pax_time(const char *p, int64_t *ps, long *pn)
{
char digit;
int64_t s;
@@ -1573,9 +1628,9 @@ header_gnutar(struct archive_read *a, struct tar *tar,
/* Copy filename over (to ensure null termination). */
header = (const struct archive_entry_header_gnutar *)h;
- archive_strncpy(&(tar->entry_name), header->name,
+ archive_strncpy(&(tar->entry_pathname), header->name,
sizeof(header->name));
- archive_entry_set_pathname(entry, tar->entry_name.s);
+ archive_entry_copy_pathname(entry, tar->entry_pathname.s);
/* Fields common to ustar and GNU */
/* XXX Can the following be factored out since it's common
@@ -1583,11 +1638,11 @@ header_gnutar(struct archive_read *a, struct tar *tar,
* header_common, perhaps? */
archive_strncpy(&(tar->entry_uname),
header->uname, sizeof(header->uname));
- archive_entry_set_uname(entry, tar->entry_uname.s);
+ archive_entry_copy_uname(entry, tar->entry_uname.s);
archive_strncpy(&(tar->entry_gname),
header->gname, sizeof(header->gname));
- archive_entry_set_gname(entry, tar->entry_gname.s);
+ archive_entry_copy_gname(entry, tar->entry_gname.s);
/* Parse out device numbers only for char and block specials */
if (header->typeflag[0] == '3' || header->typeflag[0] == '4') {
@@ -1741,9 +1796,9 @@ gnu_sparse_old_parse(struct tar *tar,
*/
static int
-gnu_sparse_01_parse(struct tar *tar, const wchar_t *p)
+gnu_sparse_01_parse(struct tar *tar, const char *p)
{
- const wchar_t *e;
+ const char *e;
off_t offset = -1, size = -1;
for (;;) {
@@ -1778,12 +1833,11 @@ gnu_sparse_01_parse(struct tar *tar, const wchar_t *p)
* don't support this format will extract the block map along with the
* data and a separate post-process can restore the sparseness.
*
- * Unfortunately, GNU tar 1.16 adds bogus padding to the end of the
- * entry that depends on the size of the map; this means we have to
- * parse the sparse map when we read the header (otherwise, entry_skip
- * will fail). This is why sparse_10_read is called from read_header
- * above, instead of at the beginning of read_data, where it "should"
- * go.
+ * Unfortunately, GNU tar 1.16 had a bug that added unnecessary
+ * padding to the body of the file when using this format. GNU tar
+ * 1.17 corrected this bug without bumping the version number, so
+ * it's not possible to support both variants. This code supports
+ * the later variant at the expense of not supporting the former.
*
* This variant also replaced GNU.sparse.size with GNU.sparse.realsize
* and introduced the GNU.sparse.major/GNU.sparse.minor attributes.
@@ -1947,7 +2001,7 @@ tar_atol8(const char *p, unsigned char_cnt)
* it does obey locale.
*/
static int64_t
-tar_atol10(const wchar_t *p, unsigned char_cnt)
+tar_atol10(const char *p, unsigned char_cnt)
{
int64_t l, limit, last_digit_limit;
int base, digit, sign;
@@ -1980,10 +2034,7 @@ tar_atol10(const wchar_t *p, unsigned char_cnt)
/*
* Parse a base-256 integer. This is just a straight signed binary
* value in big-endian order, except that the high-order bit is
- * ignored. Remember that "int64_t" may or may not be exactly 64
- * bits; the implementation here tries to avoid making any assumptions
- * about the actual size of an int64_t. It does assume we're using
- * twos-complement arithmetic, though.
+ * ignored.
*/
static int64_t
tar_atol256(const char *_p, unsigned char_cnt)
@@ -2081,15 +2132,38 @@ readline(struct archive_read *a, struct tar *tar, const char **start,
}
}
-static int
-utf8_decode(wchar_t *dest, const char *src, size_t length)
+static wchar_t *
+utf8_decode(struct tar *tar, const char *src, size_t length)
{
- size_t n;
+ wchar_t *dest;
+ ssize_t n;
int err;
+ /* Ensure pax_entry buffer is big enough. */
+ if (tar->pax_entry_length <= length) {
+ wchar_t *old_entry = tar->pax_entry;
+
+ if (tar->pax_entry_length <= 0)
+ tar->pax_entry_length = 1024;
+ while (tar->pax_entry_length <= length + 1)
+ tar->pax_entry_length *= 2;
+
+ old_entry = tar->pax_entry;
+ tar->pax_entry = (wchar_t *)realloc(tar->pax_entry,
+ tar->pax_entry_length * sizeof(wchar_t));
+ if (tar->pax_entry == NULL) {
+ free(old_entry);
+ /* TODO: Handle this error. */
+ return (NULL);
+ }
+ }
+
+ dest = tar->pax_entry;
err = 0;
while (length > 0) {
n = UTF8_mbrtowc(dest, src, length);
+ if (n < 0)
+ return (NULL);
if (n == 0)
break;
dest++;
@@ -2097,13 +2171,13 @@ utf8_decode(wchar_t *dest, const char *src, size_t length)
length -= n;
}
*dest++ = L'\0';
- return (err);
+ return (tar->pax_entry);
}
/*
* Copied and simplified from FreeBSD libc/locale.
*/
-static size_t
+static ssize_t
UTF8_mbrtowc(wchar_t *pwc, const char *s, size_t n)
{
int ch, i, len, mask;
@@ -2130,22 +2204,14 @@ UTF8_mbrtowc(wchar_t *pwc, const char *s, size_t n)
} else if ((ch & 0xf8) == 0xf0) {
mask = 0x07;
len = 4;
- } else if ((ch & 0xfc) == 0xf8) {
- mask = 0x03;
- len = 5;
- } else if ((ch & 0xfe) == 0xfc) {
- mask = 0x01;
- len = 6;
} else {
- /* Invalid first byte; convert to '?' */
- *pwc = '?';
- return (1);
+ /* Invalid first byte. */
+ return (-1);
}
if (n < (size_t)len) {
- /* Invalid first byte; convert to '?' */
- *pwc = '?';
- return (1);
+ /* Valid first byte but truncated. */
+ return (-2);
}
/*
@@ -2191,7 +2257,7 @@ UTF8_mbrtowc(wchar_t *pwc, const char *s, size_t n)
* omits line breaks; RFC1341 used for MIME requires both.)
*/
static char *
-base64_decode(const wchar_t *src, size_t len, size_t *out_len)
+base64_decode(const char *s, size_t len, size_t *out_len)
{
static const unsigned char digits[64] = {
'A','B','C','D','E','F','G','H','I','J','K','L','M','N',
@@ -2201,6 +2267,7 @@ base64_decode(const wchar_t *src, size_t len, size_t *out_len)
'4','5','6','7','8','9','+','/' };
static unsigned char decode_table[128];
char *out, *d;
+ const unsigned char *src = (const unsigned char *)s;
/* If the decode table is not yet initialized, prepare it. */
if (decode_table[digits[1]] != 1) {
@@ -2261,43 +2328,6 @@ base64_decode(const wchar_t *src, size_t len, size_t *out_len)
return (out);
}
-/*
- * This is a little tricky because the C99 standard wcstombs()
- * function returns the number of bytes that were converted,
- * not the number that should be converted. As a result,
- * we can never accurately size the output buffer (without
- * doing a tedious output size calculation in advance).
- * This approach (try a conversion, then try again if it fails)
- * will almost always succeed on the first try, and is thus
- * much faster, at the cost of sometimes requiring multiple
- * passes while we expand the buffer.
- */
-static char *
-wide_to_narrow(const wchar_t *wval)
-{
- int converted_length;
- /* Guess an output buffer size and try the conversion. */
- int alloc_length = wcslen(wval) * 3;
- char *mbs_val = (char *)malloc(alloc_length + 1);
- if (mbs_val == NULL)
- return (NULL);
- converted_length = wcstombs(mbs_val, wval, alloc_length);
-
- /* If we exhausted the buffer, resize and try again. */
- while (converted_length >= alloc_length) {
- free(mbs_val);
- alloc_length *= 2;
- mbs_val = (char *)malloc(alloc_length + 1);
- if (mbs_val == NULL)
- return (NULL);
- converted_length = wcstombs(mbs_val, wval, alloc_length);
- }
-
- /* Ensure a trailing null and return the final string. */
- mbs_val[alloc_length] = '\0';
- return (mbs_val);
-}
-
static char *
url_decode(const char *in)
{
diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c b/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c
index f5d97adb064..09e7411be86 100644
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.15 2007/10/12 04:08:28 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.21 2008/02/26 07:17:47 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.15
#include "archive_entry.h"
#include "archive_private.h"
#include "archive_read_private.h"
+#include "archive_endian.h"
struct zip {
/* entry_bytes_remaining is the number of bytes we expect. */
@@ -121,11 +122,6 @@ static int archive_read_format_zip_read_data(struct archive_read *,
static int archive_read_format_zip_read_data_skip(struct archive_read *a);
static int archive_read_format_zip_read_header(struct archive_read *,
struct archive_entry *);
-static int i2(const char *);
-static int i4(const char *);
-static unsigned int u2(const char *);
-static unsigned int u4(const char *);
-static uint64_t u8(const char *);
static int zip_read_data_deflate(struct archive_read *a, const void **buff,
size_t *size, off_t *offset);
static int zip_read_data_none(struct archive_read *a, const void **buff,
@@ -166,18 +162,12 @@ archive_read_support_format_zip(struct archive *_a)
static int
archive_read_format_zip_bid(struct archive_read *a)
{
- int bytes_read;
- int bid = 0;
- const void *h;
const char *p;
+ const void *buff;
+ size_t bytes_avail;
- if (a->archive.archive_format == ARCHIVE_FORMAT_ZIP)
- bid += 1;
-
- bytes_read = (a->decompressor->read_ahead)(a, &h, 4);
- if (bytes_read < 4)
- return (-1);
- p = (const char *)h;
+ if ((p = __archive_read_ahead(a, 4)) == NULL)
+ return (-1);
/*
* Bid of 30 here is: 16 bits for "PK",
@@ -188,20 +178,116 @@ archive_read_format_zip_bid(struct archive_read *a)
if ((p[2] == '\001' && p[3] == '\002')
|| (p[2] == '\003' && p[3] == '\004')
|| (p[2] == '\005' && p[3] == '\006')
- || (p[2] == '\007' && p[3] == '\010'))
+ || (p[2] == '\007' && p[3] == '\010')
+ || (p[2] == '0' && p[3] == '0'))
return (30);
}
+
+ /*
+ * Attempt to handle self-extracting archives
+ * by noting a PE header and searching forward
+ * up to 64k for a 'PK\003\004' marker.
+ */
+ if (p[0] == 'M' && p[1] == 'Z') {
+ /*
+ * TODO: Additional checks that this really is a PE
+ * file before we invoke the 128k lookahead below.
+ * No point in allocating a bigger lookahead buffer
+ * if we don't need to.
+ */
+ /*
+ * TODO: Of course, the compression layer lookahead
+ * buffers aren't dynamically sized yet; they should be.
+ */
+ bytes_avail = (a->decompressor->read_ahead)(a, &buff, 128*1024);
+ p = (const char *)buff;
+
+ /*
+ * TODO: Optimize by jumping forward based on values
+ * in the PE header. Note that we don't need to be
+ * exact, but we mustn't skip too far. The search
+ * below will compensate if we undershoot. Skipping
+ * will also reduce the chance of false positives
+ * (which is not really all that high to begin with,
+ * so maybe skipping isn't really necessary).
+ */
+
+ while (p < bytes_avail + (const char *)buff) {
+ if (p[0] == 'P' && p[1] == 'K' /* "PK" signature */
+ && p[2] == 3 && p[3] == 4 /* File entry */
+ && p[8] == 8 /* compression == deflate */
+ && p[9] == 0 /* High byte of compression */
+ )
+ {
+ return (30);
+ }
+ ++p;
+ }
+ }
+
return (0);
}
+/*
+ * Search forward for a "PK\003\004" file header. This handles the
+ * case of self-extracting archives, where there is an executable
+ * prepended to the ZIP archive.
+ */
+static int
+skip_sfx(struct archive_read *a)
+{
+ const void *h;
+ const char *p, *q;
+ size_t skip, bytes;
+
+ /*
+ * TODO: We should be able to skip forward by a bunch
+ * by lifting some values from the PE header. We don't
+ * need to be exact (we're still going to search forward
+ * to find the header), but it will speed things up and
+ * reduce the chance of a false positive.
+ */
+ for (;;) {
+ bytes = (a->decompressor->read_ahead)(a, &h, 4096);
+ if (bytes < 4)
+ return (ARCHIVE_FATAL);
+ p = h;
+ q = p + bytes;
+
+ /*
+ * Scan ahead until we find something that looks
+ * like the zip header.
+ */
+ while (p + 4 < q) {
+ switch (p[3]) {
+ case '\004':
+ /* TODO: Additional verification here. */
+ if (memcmp("PK\003\004", p, 4) == 0) {
+ skip = p - (const char *)h;
+ (a->decompressor->consume)(a, skip);
+ return (ARCHIVE_OK);
+ }
+ p += 4;
+ break;
+ case '\003': p += 1; break;
+ case 'K': p += 2; break;
+ case 'P': p += 3; break;
+ default: p += 4; break;
+ }
+ }
+ skip = p - (const char *)h;
+ (a->decompressor->consume)(a, skip);
+ }
+}
+
static int
archive_read_format_zip_read_header(struct archive_read *a,
struct archive_entry *entry)
{
- int bytes_read;
const void *h;
const char *signature;
struct zip *zip;
+ int r = ARCHIVE_OK, r1;
a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
if (a->archive.archive_format_name == NULL)
@@ -213,17 +299,43 @@ archive_read_format_zip_read_header(struct archive_read *a,
zip->end_of_entry_cleanup = 0;
zip->entry_uncompressed_bytes_read = 0;
zip->entry_compressed_bytes_read = 0;
- bytes_read = (a->decompressor->read_ahead)(a, &h, 4);
- if (bytes_read < 4)
+ if ((h = __archive_read_ahead(a, 4)) == NULL)
return (ARCHIVE_FATAL);
signature = (const char *)h;
+ if (signature[0] == 'M' && signature[1] == 'Z') {
+ /* This is an executable? Must be self-extracting... */
+ r = skip_sfx(a);
+ if (r < ARCHIVE_WARN)
+ return (r);
+ if ((h = __archive_read_ahead(a, 4)) == NULL)
+ return (ARCHIVE_FATAL);
+ signature = (const char *)h;
+ }
+
if (signature[0] != 'P' || signature[1] != 'K') {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Bad ZIP file");
return (ARCHIVE_FATAL);
}
+ /*
+ * "PK00" signature is used for "split" archives that
+ * only have a single segment. This means we can just
+ * skip the PK00; the first real file header should follow.
+ */
+ if (signature[2] == '0' && signature[3] == '0') {
+ (a->decompressor->consume)(a, 4);
+ if ((h = __archive_read_ahead(a, 4)) == NULL)
+ return (ARCHIVE_FATAL);
+ signature = (const char *)h;
+ if (signature[0] != 'P' || signature[1] != 'K') {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Bad ZIP file");
+ return (ARCHIVE_FATAL);
+ }
+ }
+
if (signature[2] == '\001' && signature[3] == '\002') {
/* Beginning of central directory. */
return (ARCHIVE_EOF);
@@ -231,7 +343,10 @@ archive_read_format_zip_read_header(struct archive_read *a,
if (signature[2] == '\003' && signature[3] == '\004') {
/* Regular file entry. */
- return (zip_read_file_header(a, entry, zip));
+ r1 = zip_read_file_header(a, entry, zip);
+ if (r1 != ARCHIVE_OK)
+ return (r1);
+ return (r);
}
if (signature[2] == '\005' && signature[3] == '\006') {
@@ -261,21 +376,17 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
{
const struct zip_file_header *p;
const void *h;
- int bytes_read;
- bytes_read =
- (a->decompressor->read_ahead)(a, &h, sizeof(struct zip_file_header));
- if (bytes_read < (int)sizeof(struct zip_file_header)) {
+ if ((p = __archive_read_ahead(a, sizeof *p)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file header");
return (ARCHIVE_FATAL);
}
- p = (const struct zip_file_header *)h;
zip->version = p->version[0];
zip->system = p->version[1];
- zip->flags = i2(p->flags);
- zip->compression = i2(p->compression);
+ zip->flags = archive_le16dec(p->flags);
+ zip->compression = archive_le16dec(p->compression);
if (zip->compression <
sizeof(compression_names)/sizeof(compression_names[0]))
zip->compression_name = compression_names[zip->compression];
@@ -287,25 +398,24 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
zip->mode = 0;
zip->uid = 0;
zip->gid = 0;
- zip->crc32 = i4(p->crc32);
- zip->filename_length = i2(p->filename_length);
- zip->extra_length = i2(p->extra_length);
- zip->uncompressed_size = u4(p->uncompressed_size);
- zip->compressed_size = u4(p->compressed_size);
+ zip->crc32 = archive_le32dec(p->crc32);
+ zip->filename_length = archive_le16dec(p->filename_length);
+ zip->extra_length = archive_le16dec(p->extra_length);
+ zip->uncompressed_size = archive_le32dec(p->uncompressed_size);
+ zip->compressed_size = archive_le32dec(p->compressed_size);
(a->decompressor->consume)(a, sizeof(struct zip_file_header));
/* Read the filename. */
- bytes_read = (a->decompressor->read_ahead)(a, &h, zip->filename_length);
- if (bytes_read < zip->filename_length) {
+ if ((h = __archive_read_ahead(a, zip->filename_length)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file header");
return (ARCHIVE_FATAL);
}
if (archive_string_ensure(&zip->pathname, zip->filename_length) == NULL)
__archive_errx(1, "Out of memory");
- archive_strncpy(&zip->pathname, (const char *)h, zip->filename_length);
+ archive_strncpy(&zip->pathname, h, zip->filename_length);
(a->decompressor->consume)(a, zip->filename_length);
archive_entry_set_pathname(entry, zip->pathname.s);
@@ -315,8 +425,7 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
zip->mode = AE_IFREG | 0777;
/* Read the extra data. */
- bytes_read = (a->decompressor->read_ahead)(a, &h, zip->extra_length);
- if (bytes_read < zip->extra_length) {
+ if ((h = __archive_read_ahead(a, zip->extra_length)) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP file header");
return (ARCHIVE_FATAL);
@@ -337,7 +446,8 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
zip->entry_offset = 0;
/* If there's no body, force read_data() to return EOF immediately. */
- if (zip->entry_bytes_remaining < 1)
+ if (0 == (zip->flags & ZIP_LENGTH_AT_END)
+ && zip->entry_bytes_remaining < 1)
zip->end_of_entry = 1;
/* Set up a more descriptive format name. */
@@ -386,21 +496,18 @@ archive_read_format_zip_read_data(struct archive_read *a,
if (zip->end_of_entry) {
if (!zip->end_of_entry_cleanup) {
if (zip->flags & ZIP_LENGTH_AT_END) {
- const void *h;
const char *p;
- int bytes_read =
- (a->decompressor->read_ahead)(a, &h, 16);
- if (bytes_read < 16) {
+
+ if ((p = __archive_read_ahead(a, 16)) == NULL) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated ZIP end-of-file record");
return (ARCHIVE_FATAL);
}
- p = (const char *)h;
- zip->crc32 = i4(p + 4);
- zip->compressed_size = u4(p + 8);
- zip->uncompressed_size = u4(p + 12);
- bytes_read = (a->decompressor->consume)(a, 16);
+ zip->crc32 = archive_le32dec(p + 4);
+ zip->compressed_size = archive_le32dec(p + 8);
+ zip->uncompressed_size = archive_le32dec(p + 12);
+ (a->decompressor->consume)(a, 16);
}
/* Check file size, CRC against these values. */
@@ -695,37 +802,6 @@ archive_read_format_zip_cleanup(struct archive_read *a)
return (ARCHIVE_OK);
}
-static int
-i2(const char *p)
-{
- return ((0xff & (int)p[0]) + 256 * (0xff & (int)p[1]));
-}
-
-
-static int
-i4(const char *p)
-{
- return ((0xffff & i2(p)) + 0x10000 * (0xffff & i2(p+2)));
-}
-
-static unsigned int
-u2(const char *p)
-{
- return ((0xff & (unsigned int)p[0]) + 256 * (0xff & (unsigned int)p[1]));
-}
-
-static unsigned int
-u4(const char *p)
-{
- return u2(p) + 0x10000 * u2(p+2);
-}
-
-static uint64_t
-u8(const char *p)
-{
- return u4(p) + 0x100000000LL * u4(p+4);
-}
-
/*
* The extra data is stored as a list of
* id1+size1+data1 + id2+size2+data2 ...
@@ -738,8 +814,8 @@ process_extra(const void* extra, struct zip* zip)
const char *p = (const char *)extra;
while (offset < zip->extra_length - 4)
{
- unsigned short headerid = u2(p + offset);
- unsigned short datasize = u2(p + offset + 2);
+ unsigned short headerid = archive_le16dec(p + offset);
+ unsigned short datasize = archive_le16dec(p + offset + 2);
offset += 4;
if (offset + datasize > zip->extra_length)
break;
@@ -751,9 +827,9 @@ process_extra(const void* extra, struct zip* zip)
case 0x0001:
/* Zip64 extended information extra field. */
if (datasize >= 8)
- zip->uncompressed_size = u8(p + offset);
+ zip->uncompressed_size = archive_le64dec(p + offset);
if (datasize >= 16)
- zip->compressed_size = u8(p + offset + 8);
+ zip->compressed_size = archive_le64dec(p + offset + 8);
break;
case 0x5455:
{
@@ -766,11 +842,12 @@ process_extra(const void* extra, struct zip* zip)
{
#ifdef DEBUG
fprintf(stderr, "mtime: %lld -> %d\n",
- (long long)zip->mtime, i4(p + offset));
+ (long long)zip->mtime,
+ archive_le32dec(p + offset));
#endif
if (datasize < 4)
break;
- zip->mtime = i4(p + offset);
+ zip->mtime = archive_le32dec(p + offset);
offset += 4;
datasize -= 4;
}
@@ -778,7 +855,7 @@ process_extra(const void* extra, struct zip* zip)
{
if (datasize < 4)
break;
- zip->atime = i4(p + offset);
+ zip->atime = archive_le32dec(p + offset);
offset += 4;
datasize -= 4;
}
@@ -786,7 +863,7 @@ process_extra(const void* extra, struct zip* zip)
{
if (datasize < 4)
break;
- zip->ctime = i4(p + offset);
+ zip->ctime = archive_le32dec(p + offset);
offset += 4;
datasize -= 4;
}
@@ -796,12 +873,13 @@ process_extra(const void* extra, struct zip* zip)
/* Info-ZIP Unix Extra Field (type 2) "Ux". */
#ifdef DEBUG
fprintf(stderr, "uid %d gid %d\n",
- i2(p + offset), i2(p + offset + 2));
+ archive_le16dec(p + offset),
+ archive_le16dec(p + offset + 2));
#endif
if (datasize >= 2)
- zip->uid = i2(p + offset);
+ zip->uid = archive_le16dec(p + offset);
if (datasize >= 4)
- zip->gid = i2(p + offset + 2);
+ zip->gid = archive_le16dec(p + offset + 2);
break;
default:
break;
diff --git a/archivers/libarchive/files/libarchive/archive_util.c b/archivers/libarchive/files/libarchive/archive_util.c
index 2bc2844abcb..413199a360f 100644
--- a/archivers/libarchive/files/libarchive/archive_util.c
+++ b/archivers/libarchive/files/libarchive/archive_util.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_util.c,v 1.15 2007/07/06 15:36:38 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_util.c,v 1.16 2007/12/30 04:58:21 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/archivers/libarchive/files/libarchive/archive_write_disk.c b/archivers/libarchive/files/libarchive/archive_write_disk.c
index ec220869074..dfb6d35aec8 100644
--- a/archivers/libarchive/files/libarchive/archive_write_disk.c
+++ b/archivers/libarchive/files/libarchive/archive_write_disk.c
@@ -25,7 +25,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.17 2007/09/21 04:52:42 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.22 2008/02/19 05:39:35 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -45,6 +45,9 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.17 2007/09/21 04
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
+#ifdef HAVE_SYS_UTIME_H
+#include <sys/utime.h>
+#endif
#ifdef HAVE_EXT2FS_EXT2_FS_H
#include <ext2fs/ext2_fs.h> /* for Linux file flags */
@@ -89,6 +92,10 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.17 2007/09/21 04
#include "archive_entry.h"
#include "archive_private.h"
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
struct fixup_entry {
struct fixup_entry *next;
mode_t mode;
@@ -171,6 +178,8 @@ struct archive_write_disk {
int fd;
/* Current offset for writing data to the file. */
off_t offset;
+ /* Maximum size of file. */
+ off_t filesize;
/* Dir we were in before this restore; only for deep paths. */
int restore_pwd;
/* Mode we should use for this entry; affected by _PERM and umask. */
@@ -302,6 +311,7 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
a->offset = 0;
a->uid = a->user_uid;
a->mode = archive_entry_mode(a->entry);
+ a->filesize = archive_entry_size(a->entry);
archive_strcpy(&(a->_name_data), archive_entry_pathname(a->entry));
a->name = a->_name_data.s;
archive_clear_error(&a->archive);
@@ -425,8 +435,10 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
* If it's not open, tell our client not to try writing.
* In particular, dirs, links, etc, don't get written to.
*/
- if (a->fd < 0)
+ if (a->fd < 0) {
archive_entry_set_size(entry, 0);
+ a->filesize = 0;
+ }
done:
/* Restore the user's umask before returning. */
umask(a->user_umask);
@@ -451,6 +463,7 @@ _archive_write_data_block(struct archive *_a,
{
struct archive_write_disk *a = (struct archive_write_disk *)_a;
ssize_t bytes_written = 0;
+ int r = ARCHIVE_OK;
__archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_DATA, "archive_write_disk_block");
@@ -470,7 +483,13 @@ _archive_write_data_block(struct archive *_a,
}
/* Write the data. */
- while (size > 0) {
+ while (size > 0 && a->offset < a->filesize) {
+ if ((off_t)(a->offset + size) > a->filesize) {
+ size = (size_t)(a->filesize - a->offset);
+ archive_set_error(&a->archive, errno,
+ "Write request too large");
+ r = ARCHIVE_WARN;
+ }
bytes_written = write(a->fd, buff, size);
if (bytes_written < 0) {
archive_set_error(&a->archive, errno, "Write failed");
@@ -479,13 +498,14 @@ _archive_write_data_block(struct archive *_a,
size -= bytes_written;
a->offset += bytes_written;
}
- return (ARCHIVE_OK);
+ return (r);
}
static ssize_t
_archive_write_data(struct archive *_a, const void *buff, size_t size)
{
struct archive_write_disk *a = (struct archive_write_disk *)_a;
+ off_t offset;
int r;
__archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
@@ -493,10 +513,11 @@ _archive_write_data(struct archive *_a, const void *buff, size_t size)
if (a->fd < 0)
return (ARCHIVE_OK);
+ offset = a->offset;
r = _archive_write_data_block(_a, buff, size, a->offset);
if (r < ARCHIVE_OK)
return (r);
- return (size);
+ return (a->offset - offset);
}
static int
@@ -622,7 +643,9 @@ archive_write_disk_new(void)
a->archive.vtable = archive_write_disk_vtable();
a->lookup_uid = trivial_lookup_uid;
a->lookup_gid = trivial_lookup_gid;
+#ifdef HAVE_GETEUID
a->user_uid = geteuid();
+#endif /* HAVE_GETEUID */
if (archive_string_ensure(&a->path_safe, 512) == NULL) {
free(a);
return (NULL);
@@ -653,7 +676,7 @@ edit_deep_directories(struct archive_write_disk *a)
return;
/* Try to record our starting dir. */
- a->restore_pwd = open(".", O_RDONLY);
+ a->restore_pwd = open(".", O_RDONLY | O_BINARY);
if (a->restore_pwd < 0)
return;
@@ -691,6 +714,14 @@ restore_entry(struct archive_write_disk *a)
int ret = ARCHIVE_OK, en;
if (a->flags & ARCHIVE_EXTRACT_UNLINK && !S_ISDIR(a->mode)) {
+ /*
+ * TODO: Fix this. Apparently, there are platforms
+ * that still allow root to hose the entire filesystem
+ * by unlinking a dir. The S_ISDIR() test above
+ * prevents us from using unlink() here if the new
+ * object is a dir, but that doesn't mean the old
+ * object isn't a dir.
+ */
if (unlink(a->name) == 0) {
/* We removed it, we're done. */
} else if (errno == ENOENT) {
@@ -829,8 +860,20 @@ create_filesystem_object(struct archive_write_disk *a)
/* We identify hard/symlinks according to the link names. */
/* Since link(2) and symlink(2) don't handle modes, we're done here. */
linkname = archive_entry_hardlink(a->entry);
- if (linkname != NULL)
- return link(linkname, a->name) ? errno : 0;
+ if (linkname != NULL) {
+ r = link(linkname, a->name) ? errno : 0;
+ /*
+ * New cpio and pax formats allow hardlink entries
+ * to carry data, so we may have to open the file
+ * for hardlink entries.
+ */
+ if (r == 0 && a->filesize > 0) {
+ a->fd = open(a->name, O_WRONLY | O_TRUNC | O_BINARY);
+ if (a->fd < 0)
+ r = errno;
+ }
+ return (r);
+ }
linkname = archive_entry_symlink(a->entry);
if (linkname != NULL)
return symlink(linkname, a->name) ? errno : 0;
@@ -850,24 +893,38 @@ create_filesystem_object(struct archive_write_disk *a)
*/
mode = final_mode & 0777;
- switch (a->mode & S_IFMT) {
+ switch (a->mode & AE_IFMT) {
default:
/* POSIX requires that we fall through here. */
/* FALLTHROUGH */
- case S_IFREG:
+ case AE_IFREG:
a->fd = open(a->name,
- O_WRONLY | O_CREAT | O_EXCL, mode);
+ O_WRONLY | O_CREAT | O_EXCL | O_BINARY, mode);
r = (a->fd < 0);
break;
- case S_IFCHR:
+ case AE_IFCHR:
+#ifdef HAVE_MKNOD
+ /* Note: we use AE_IFCHR for the case label, and
+ * S_IFCHR for the mknod() call. This is correct. */
r = mknod(a->name, mode | S_IFCHR,
archive_entry_rdev(a->entry));
+#else
+ /* TODO: Find a better way to warn about our inability
+ * to restore a char device node. */
+ return (EINVAL);
+#endif /* HAVE_MKNOD */
break;
- case S_IFBLK:
+ case AE_IFBLK:
+#ifdef HAVE_MKNOD
r = mknod(a->name, mode | S_IFBLK,
archive_entry_rdev(a->entry));
+#else
+ /* TODO: Find a better way to warn about our inability
+ * to restore a block device node. */
+ return (EINVAL);
+#endif /* HAVE_MKNOD */
break;
- case S_IFDIR:
+ case AE_IFDIR:
mode = (mode | MINIMUM_DIR_MODE) & MAXIMUM_DIR_MODE;
r = mkdir(a->name, mode);
if (r == 0) {
@@ -880,8 +937,14 @@ create_filesystem_object(struct archive_write_disk *a)
a->todo &= ~TODO_MODE;
}
break;
- case S_IFIFO:
+ case AE_IFIFO:
+#ifdef HAVE_MKFIFO
r = mkfifo(a->name, mode);
+#else
+ /* TODO: Find a better way to warn about our inability
+ * to restore a fifo. */
+ return (EINVAL);
+#endif /* HAVE_MKFIFO */
break;
}
@@ -1427,28 +1490,34 @@ set_ownership(struct archive_write_disk *a)
}
#ifdef HAVE_FCHOWN
- if (a->fd >= 0 && fchown(a->fd, a->uid, a->gid) == 0)
- goto success;
+ /* If we have an fd, we can avoid a race. */
+ if (a->fd >= 0 && fchown(a->fd, a->uid, a->gid) == 0) {
+ /* We've set owner and know uid/gid are correct. */
+ a->todo &= ~(TODO_OWNER | TODO_SGID_CHECK | TODO_SUID_CHECK);
+ return (ARCHIVE_OK);
+ }
#endif
+ /* We prefer lchown() but will use chown() if that's all we have. */
+ /* Of course, if we have neither, this will always fail. */
#ifdef HAVE_LCHOWN
- if (lchown(a->name, a->uid, a->gid) == 0)
- goto success;
-#else
- if (!S_ISLNK(a->mode) && chown(a->name, a->uid, a->gid) == 0)
- goto success;
+ if (lchown(a->name, a->uid, a->gid) == 0) {
+ /* We've set owner and know uid/gid are correct. */
+ a->todo &= ~(TODO_OWNER | TODO_SGID_CHECK | TODO_SUID_CHECK);
+ return (ARCHIVE_OK);
+ }
+#elif HAVE_CHOWN
+ if (!S_ISLNK(a->mode) && chown(a->name, a->uid, a->gid) == 0) {
+ /* We've set owner and know uid/gid are correct. */
+ a->todo &= ~(TODO_OWNER | TODO_SGID_CHECK | TODO_SUID_CHECK);
+ return (ARCHIVE_OK);
+ }
#endif
archive_set_error(&a->archive, errno,
"Can't set user=%d/group=%d for %s", a->uid, a->gid,
a->name);
return (ARCHIVE_WARN);
-success:
- a->todo &= ~TODO_OWNER;
- /* We know the user/group are correct now. */
- a->todo &= ~TODO_SGID_CHECK;
- a->todo &= ~TODO_SUID_CHECK;
- return (ARCHIVE_OK);
}
#ifdef HAVE_UTIMES
@@ -1786,7 +1855,7 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
/* If we weren't given an fd, open it ourselves. */
if (myfd < 0)
- myfd = open(name, O_RDONLY|O_NONBLOCK);
+ myfd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY);
if (myfd < 0)
return (ARCHIVE_OK);
diff --git a/archivers/libarchive/files/libarchive/archive_write_open_filename.c b/archivers/libarchive/files/libarchive/archive_write_open_filename.c
index fcaaaca4a68..72eeb54053d 100644
--- a/archivers/libarchive/files/libarchive/archive_write_open_filename.c
+++ b/archivers/libarchive/files/libarchive/archive_write_open_filename.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_filename.c,v 1.19 2007/01/09 08:05:56 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_filename.c,v 1.20 2008/02/19 05:46:58 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -47,6 +47,10 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_filename.c,v 1.19 2007
#include "archive.h"
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
struct write_file_data {
int fd;
char filename[1];
@@ -95,7 +99,7 @@ file_open(struct archive *a, void *client_data)
struct stat st;
mine = (struct write_file_data *)client_data;
- flags = O_WRONLY | O_CREAT | O_TRUNC;
+ flags = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY;
/*
* Open the file.
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c
index 0883ea1de2f..272ae26e520 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_bzip2.c
@@ -28,7 +28,7 @@
/* Don't compile this if we don't have bzlib. */
#if HAVE_BZLIB_H
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_bzip2.c,v 1.12 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_bzip2.c,v 1.13 2007/12/30 04:58:21 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -320,6 +320,10 @@ drive_compressor(struct archive_write *a, struct private_data *state, int finish
state->stream.avail_out = bytes_written;
}
+ /* If there's nothing to do, we're done. */
+ if (!finishing && state->stream.avail_in == 0)
+ return (ARCHIVE_OK);
+
ret = BZ2_bzCompress(&(state->stream),
finishing ? BZ_FINISH : BZ_RUN);
@@ -339,7 +343,9 @@ drive_compressor(struct archive_write *a, struct private_data *state, int finish
/* Any other return value indicates an error */
archive_set_error(&a->archive,
ARCHIVE_ERRNO_PROGRAMMER,
- "Bzip2 compression failed");
+ "Bzip2 compression failed;"
+ " BZ2_bzCompress() returned %d",
+ ret);
return (ARCHIVE_FATAL);
}
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c
index 56a0a11fd92..18abbdf67b5 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_gzip.c
@@ -28,7 +28,7 @@
/* Don't compile this if we don't have zlib. */
#if HAVE_ZLIB_H
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_gzip.c,v 1.14 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_gzip.c,v 1.16 2008/02/21 03:21:50 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -106,6 +106,21 @@ archive_compressor_gzip_init(struct archive_write *a)
return (ret);
}
+ /*
+ * The next check is a temporary workaround until the gzip
+ * code can be overhauled some. The code should not require
+ * that compressed_buffer_size == bytes_per_block. Removing
+ * this assumption will allow us to compress larger chunks at
+ * a time, which should improve overall performance
+ * marginally. As a minor side-effect, such a cleanup would
+ * allow us to support truly arbitrary block sizes.
+ */
+ if (a->bytes_per_block < 10) {
+ archive_set_error(&a->archive, EINVAL,
+ "GZip compressor requires a minimum 10 byte block size");
+ return (ARCHIVE_FATAL);
+ }
+
state = (struct private_data *)malloc(sizeof(*state));
if (state == NULL) {
archive_set_error(&a->archive, ENOMEM,
@@ -114,6 +129,10 @@ archive_compressor_gzip_init(struct archive_write *a)
}
memset(state, 0, sizeof(*state));
+ /*
+ * See comment above. We should set compressed_buffer_size to
+ * max(bytes_per_block, 65536), but the code can't handle that yet.
+ */
state->compressed_buffer_size = a->bytes_per_block;
state->compressed = (unsigned char *)malloc(state->compressed_buffer_size);
state->crc = crc32(0L, NULL, 0);
@@ -378,6 +397,10 @@ drive_compressor(struct archive_write *a, struct private_data *state, int finish
state->stream.avail_out = bytes_written;
}
+ /* If there's nothing to do, we're done. */
+ if (!finishing && state->stream.avail_in == 0)
+ return (ARCHIVE_OK);
+
ret = deflate(&(state->stream),
finishing ? Z_FINISH : Z_NO_FLUSH );
@@ -396,7 +419,9 @@ drive_compressor(struct archive_write *a, struct private_data *state, int finish
default:
/* Any other return value indicates an error. */
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "GZip compression failed");
+ "GZip compression failed:"
+ " deflate() call returned status %d",
+ ret);
return (ARCHIVE_FATAL);
}
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_compression_none.c b/archivers/libarchive/files/libarchive/archive_write_set_compression_none.c
index bb8555ef4eb..bdecb240d9f 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_compression_none.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_compression_none.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_none.c,v 1.15 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_none.c,v 1.16 2007/12/30 04:58:22 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c b/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c
index 404b651311e..2e77f1bd89a 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c
@@ -26,7 +26,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_ar.c,v 1.3 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_ar.c,v 1.5 2008/01/31 08:11:01 kaiw Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -75,6 +75,7 @@ static int archive_write_ar_header(struct archive_write *,
static ssize_t archive_write_ar_data(struct archive_write *,
const void *buff, size_t s);
static int archive_write_ar_destroy(struct archive_write *);
+static int archive_write_ar_finish(struct archive_write *);
static int archive_write_ar_finish_entry(struct archive_write *);
static const char *ar_basename(const char *path);
static int format_octal(int64_t v, char *p, int s);
@@ -126,7 +127,7 @@ archive_write_set_format_ar(struct archive_write *a)
a->format_write_header = archive_write_ar_header;
a->format_write_data = archive_write_ar_data;
- a->format_finish = NULL;
+ a->format_finish = archive_write_ar_finish;
a->format_destroy = archive_write_ar_destroy;
a->format_finish_entry = archive_write_ar_finish_entry;
return (ARCHIVE_OK);
@@ -398,6 +399,23 @@ archive_write_ar_destroy(struct archive_write *a)
}
static int
+archive_write_ar_finish(struct archive_write *a)
+{
+ int ret;
+
+ /*
+ * If we haven't written anything yet, we need to write
+ * the ar global header now to make it a valid ar archive.
+ */
+ if (a->archive.file_position == 0) {
+ ret = (a->compressor.write)(a, "!<arch>\n", 8);
+ return (ret);
+ }
+
+ return (ARCHIVE_OK);
+}
+
+static int
archive_write_ar_finish_entry(struct archive_write *a)
{
struct ar_w *ar;
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c b/archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c
index c8a6a7ac5ec..45cb4e74b64 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_cpio.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_cpio.c,v 1.12 2007/10/12 04:11:31 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_cpio.c,v 1.13 2007/12/30 04:58:22 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c b/archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c
index e50544b45f3..d11176c1c1e 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_cpio_newc.c
@@ -25,7 +25,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_cpio_newc.c,v 1.2 2007/10/12 04:11:31 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_cpio_newc.c,v 1.3 2008/01/23 05:43:25 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -176,9 +176,15 @@ archive_write_newc_header(struct archive_write *a, struct archive_entry *entry)
cpio->entry_bytes_remaining = archive_entry_size(entry);
cpio->padding = 3 & (-cpio->entry_bytes_remaining);
+
/* Write the symlink now. */
- if (p != NULL && *p != '\0')
+ if (p != NULL && *p != '\0') {
ret = (a->compressor.write)(a, p, strlen(p));
+ if (ret != ARCHIVE_OK)
+ return (ARCHIVE_FATAL);
+ pad = 0x3 & -strlen(p);
+ ret = (a->compressor.write)(a, "\0\0\0", pad);
+ }
return (ret);
}
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_pax.c b/archivers/libarchive/files/libarchive/archive_write_set_format_pax.c
index cedbfd75c96..4604d99a6e8 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_pax.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_pax.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_pax.c,v 1.41 2007/05/29 01:00:19 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_pax.c,v 1.42 2007/12/30 04:58:22 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -383,19 +383,25 @@ archive_write_pax_header(struct archive_write *a,
struct archive_entry *entry_original)
{
struct archive_entry *entry_main;
- const char *linkname, *p;
+ const char *p;
char *t;
- const char *hardlink;
const wchar_t *wp;
const char *suffix_start;
int need_extension, r, ret;
struct pax *pax;
+ const char *hdrcharset = NULL;
+ const char *hardlink;
+ const char *path = NULL, *linkpath = NULL;
+ const char *uname = NULL, *gname = NULL;
+ const wchar_t *path_w = NULL, *linkpath_w = NULL;
+ const wchar_t *uname_w = NULL, *gname_w = NULL;
char paxbuff[512];
char ustarbuff[512];
char ustar_entry_name[256];
char pax_entry_name[256];
+ ret = ARCHIVE_OK;
need_extension = 0;
pax = (struct pax *)a->format_data;
@@ -442,53 +448,109 @@ archive_write_pax_header(struct archive_write *a,
archive_string_empty(&(pax->pax_header)); /* Blank our work area. */
/*
+ * First, check the name fields and see if any of them
+ * require binary coding. If any of them does, then all of
+ * them do.
+ */
+ hdrcharset = NULL;
+ path = archive_entry_pathname(entry_main);
+ path_w = archive_entry_pathname_w(entry_main);
+ if (path != NULL && path_w == NULL) {
+ archive_set_error(&a->archive, EILSEQ,
+ "Can't translate pathname '%s' to UTF-8", path);
+ ret = ARCHIVE_WARN;
+ hdrcharset = "BINARY";
+ }
+ uname = archive_entry_uname(entry_main);
+ uname_w = archive_entry_uname_w(entry_main);
+ if (uname != NULL && uname_w == NULL) {
+ archive_set_error(&a->archive, EILSEQ,
+ "Can't translate uname '%s' to UTF-8", uname);
+ ret = ARCHIVE_WARN;
+ hdrcharset = "BINARY";
+ }
+ gname = archive_entry_gname(entry_main);
+ gname_w = archive_entry_uname_w(entry_main);
+ if (gname != NULL && gname_w == NULL) {
+ archive_set_error(&a->archive, EILSEQ,
+ "Can't translate gname '%s' to UTF-8", gname);
+ ret = ARCHIVE_WARN;
+ hdrcharset = "BINARY";
+ }
+ linkpath = hardlink;
+ if (linkpath != NULL) {
+ linkpath_w = archive_entry_hardlink_w(entry_main);
+ } else {
+ linkpath = archive_entry_symlink(entry_main);
+ if (linkpath != NULL)
+ linkpath_w = archive_entry_symlink_w(entry_main);
+ }
+ if (linkpath != NULL && linkpath_w == NULL) {
+ archive_set_error(&a->archive, EILSEQ,
+ "Can't translate linkpath '%s' to UTF-8", linkpath);
+ ret = ARCHIVE_WARN;
+ hdrcharset = "BINARY";
+ }
+
+ /* Store the header encoding first, to be nice to readers. */
+ if (hdrcharset != NULL)
+ add_pax_attr(&(pax->pax_header), "hdrcharset", hdrcharset);
+
+ /*
* Determining whether or not the name is too big is ugly
* because of the rules for dividing names between 'name' and
* 'prefix' fields. Here, I pick out the longest possible
* suffix, then test whether the remaining prefix is too long.
*/
- wp = archive_entry_pathname_w(entry_main);
- p = archive_entry_pathname(entry_main);
- if (strlen(p) <= 100) /* Short enough for just 'name' field */
- suffix_start = p; /* Record a zero-length prefix */
+ if (strlen(path) <= 100) /* Short enough for just 'name' field */
+ suffix_start = path; /* Record a zero-length prefix */
else
/* Find the largest suffix that fits in 'name' field. */
- suffix_start = strchr(p + strlen(p) - 100 - 1, '/');
+ suffix_start = strchr(path + strlen(path) - 100 - 1, '/');
/*
* If name is too long, or has non-ASCII characters, add
- * 'path' to pax extended attrs.
+ * 'path' to pax extended attrs. (Note that an unconvertible
+ * name must have non-ASCII characters.)
*/
- if (suffix_start == NULL || suffix_start - p > 155 || has_non_ASCII(wp)) {
- add_pax_attr_w(&(pax->pax_header), "path", wp);
+ if (suffix_start == NULL || suffix_start - path > 155
+ || path_w == NULL || has_non_ASCII(path_w)) {
+ if (path_w == NULL || hdrcharset != NULL)
+ /* Can't do UTF-8, so store it raw. */
+ add_pax_attr(&(pax->pax_header), "path", path);
+ else
+ add_pax_attr_w(&(pax->pax_header), "path", path_w);
archive_entry_set_pathname(entry_main,
- build_ustar_entry_name(ustar_entry_name, p, strlen(p), NULL));
+ build_ustar_entry_name(ustar_entry_name,
+ path, strlen(path), NULL));
need_extension = 1;
}
- /* If link name is too long or has non-ASCII characters, add
- * 'linkpath' to pax extended attrs. */
- linkname = hardlink;
- if (linkname == NULL)
- linkname = archive_entry_symlink(entry_main);
-
- if (linkname != NULL) {
- /* There is a link name, get the wide version as well. */
- if (hardlink != NULL)
- wp = archive_entry_hardlink_w(entry_main);
- else
- wp = archive_entry_symlink_w(entry_main);
-
- /* If the link is long or has a non-ASCII character,
- * store it as a pax extended attribute. */
- if (strlen(linkname) > 100 || has_non_ASCII(wp)) {
- add_pax_attr_w(&(pax->pax_header), "linkpath", wp);
- if (hardlink != NULL)
- archive_entry_set_hardlink(entry_main,
- "././@LongHardLink");
+ if (linkpath != NULL) {
+ /* If link name is too long or has non-ASCII characters, add
+ * 'linkpath' to pax extended attrs. */
+ if (strlen(linkpath) > 100 || linkpath_w == NULL
+ || linkpath_w == NULL || has_non_ASCII(linkpath_w)) {
+ if (linkpath_w == NULL || hdrcharset != NULL)
+ /* If the linkpath is not convertible
+ * to wide, or we're encoding in
+ * binary anyway, store it raw. */
+ add_pax_attr(&(pax->pax_header),
+ "linkpath", linkpath);
else
- archive_entry_set_symlink(entry_main,
- "././@LongSymLink");
+ /* If the link is long or has a
+ * non-ASCII character, store it as a
+ * pax extended attribute. */
+ add_pax_attr_w(&(pax->pax_header),
+ "linkpath", linkpath_w);
+ if (strlen(linkpath) > 100) {
+ if (hardlink != NULL)
+ archive_entry_set_hardlink(entry_main,
+ "././@LongHardLink");
+ else
+ archive_entry_set_symlink(entry_main,
+ "././@LongSymLink");
+ }
need_extension = 1;
}
}
@@ -509,12 +571,20 @@ archive_write_pax_header(struct archive_write *a,
/* If group name is too large or has non-ASCII characters, add
* 'gname' to pax extended attrs. */
- p = archive_entry_gname(entry_main);
- wp = archive_entry_gname_w(entry_main);
- if (p != NULL && (strlen(p) > 31 || has_non_ASCII(wp))) {
- add_pax_attr_w(&(pax->pax_header), "gname", wp);
- archive_entry_set_gname(entry_main, NULL);
- need_extension = 1;
+ if (gname != NULL) {
+ if (strlen(gname) > 31
+ || gname_w == NULL
+ || has_non_ASCII(gname_w))
+ {
+ if (gname_w == NULL || hdrcharset != NULL) {
+ add_pax_attr(&(pax->pax_header),
+ "gname", gname);
+ } else {
+ add_pax_attr_w(&(pax->pax_header),
+ "gname", gname_w);
+ }
+ need_extension = 1;
+ }
}
/* If numeric UID is too large, add 'uid' to pax extended attrs. */
@@ -524,14 +594,21 @@ archive_write_pax_header(struct archive_write *a,
need_extension = 1;
}
- /* If user name is too large, add 'uname' to pax extended attrs. */
- /* TODO: If uname has non-ASCII characters, use pax attribute. */
- p = archive_entry_uname(entry_main);
- wp = archive_entry_uname_w(entry_main);
- if (p != NULL && (strlen(p) > 31 || has_non_ASCII(wp))) {
- add_pax_attr_w(&(pax->pax_header), "uname", wp);
- archive_entry_set_uname(entry_main, NULL);
- need_extension = 1;
+ /* Add 'uname' to pax extended attrs if necessary. */
+ if (uname != NULL) {
+ if (strlen(uname) > 31
+ || uname_w == NULL
+ || has_non_ASCII(uname_w))
+ {
+ if (uname_w == NULL || hdrcharset != NULL) {
+ add_pax_attr(&(pax->pax_header),
+ "uname", uname);
+ } else {
+ add_pax_attr_w(&(pax->pax_header),
+ "uname", uname_w);
+ }
+ need_extension = 1;
+ }
}
/*
@@ -733,7 +810,6 @@ archive_write_pax_header(struct archive_write *a,
__archive_write_format_header_ustar(a, ustarbuff, entry_main, -1, 0);
/* If we built any extended attributes, write that entry first. */
- ret = ARCHIVE_OK;
if (archive_strlen(&(pax->pax_header)) > 0) {
struct archive_entry *pax_attr_entry;
time_t s;
@@ -793,13 +869,13 @@ archive_write_pax_header(struct archive_write *a,
/* Standard ustar doesn't support ctime. */
archive_entry_set_ctime(pax_attr_entry, 0, 0);
- ret = __archive_write_format_header_ustar(a, paxbuff,
+ r = __archive_write_format_header_ustar(a, paxbuff,
pax_attr_entry, 'x', 1);
archive_entry_free(pax_attr_entry);
/* Note that the 'x' header shouldn't ever fail to format */
- if (ret != 0) {
+ if (r != 0) {
const char *msg = "archive_write_pax_header: "
"'x' header failed?! This can't happen.\n";
write(2, msg, strlen(msg));
@@ -986,12 +1062,19 @@ build_ustar_entry_name(char *dest, const char *src, size_t src_length,
* The ustar header for the pax extended attributes must have a
* reasonable name: SUSv3 suggests 'dirname'/PaxHeader/'filename'
*
- * Joerg Schiling has argued that this is unnecessary because, in practice,
- * if the pax extended attributes get extracted as regular files, noone is
- * going to bother reading those attributes to manually restore them.
- * Based on this, 'star' uses /tmp/PaxHeader/'basename' as the ustar header
- * name. This is a tempting argument, but I'm not entirely convinced.
- * I'm also uncomfortable with the fact that "/tmp" is a Unix-ism.
+ * Joerg Schilling has argued that this is unnecessary because, in
+ * practice, if the pax extended attributes get extracted as regular
+ * files, noone is going to bother reading those attributes to
+ * manually restore them. Based on this, 'star' uses
+ * /tmp/PaxHeader/'basename' as the ustar header name. This is a
+ * tempting argument, in part because it's simpler than the SUSv3
+ * recommendation, but I'm not entirely convinced. I'm also
+ * uncomfortable with the fact that "/tmp" is a Unix-ism.
+ *
+ * GNU tar uses 'dirname'/PaxHeader.<pid>/'filename', where the PID is
+ * the PID of the archiving process. This seems unnecessarily complex
+ * to me, as I don't see much value to separating the headers from
+ * extracting multiple versions of an archive.
*
* The following routine implements the SUSv3 recommendation, and is
* much simpler because build_ustar_entry_name() above already does
diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c b/archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c
index 287afe0657c..a7d26c90579 100644
--- a/archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c
+++ b/archivers/libarchive/files/libarchive/archive_write_set_format_ustar.c
@@ -24,7 +24,7 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_ustar.c,v 1.24 2007/06/11 05:17:30 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_ustar.c,v 1.25 2007/12/30 04:58:22 kientzle Exp $");
#ifdef HAVE_ERRNO_H
diff --git a/archivers/libarchive/files/libarchive/config_freebsd.h b/archivers/libarchive/files/libarchive/config_freebsd.h
index 1b9126058aa..83a85996a84 100644
--- a/archivers/libarchive/files/libarchive/config_freebsd.h
+++ b/archivers/libarchive/files/libarchive/config_freebsd.h
@@ -22,7 +22,7 @@
* (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: src/lib/libarchive/config_freebsd.h,v 1.5 2007/05/29 01:00:20 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/config_freebsd.h,v 1.6 2008/02/19 05:40:28 kientzle Exp $
*/
/* FreeBSD 5.0 and later have ACL support. */
@@ -37,6 +37,7 @@
#define HAVE_BZLIB_H 1
#define HAVE_CHFLAGS 1
+#define HAVE_CHOWN 1
#define HAVE_DECL_INT64_MAX 1
#define HAVE_DECL_INT64_MIN 1
#define HAVE_DECL_SIZE_MAX 1
@@ -53,6 +54,7 @@
#define HAVE_FCNTL_H 1
#define HAVE_FSEEKO 1
#define HAVE_FUTIMES 1
+#define HAVE_GETEUID 1
#define HAVE_GRP_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_LCHFLAGS 1
@@ -65,10 +67,12 @@
#define HAVE_MEMSET 1
#define HAVE_MKDIR 1
#define HAVE_MKFIFO 1
+#define HAVE_MKNOD 1
#define HAVE_POLL 1
#define HAVE_POLL_H 1
#define HAVE_PWD_H 1
#define HAVE_SELECT 1
+#define HAVE_SETENV 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRCHR 1
@@ -87,9 +91,12 @@
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TYPES_H 1
+#undef HAVE_SYS_UTIME_H
#define HAVE_SYS_WAIT_H 1
#define HAVE_TIMEGM 1
+#define HAVE_TZSET 1
#define HAVE_UNISTD_H 1
+#define HAVE_UNSETENV 1
#define HAVE_UTIME 1
#define HAVE_UTIMES 1
#define HAVE_UTIME_H 1
diff --git a/archivers/libarchive/files/libarchive/config_windows.h b/archivers/libarchive/files/libarchive/config_windows.h
index fa55c8e306d..c5200655b14 100644
--- a/archivers/libarchive/files/libarchive/config_windows.h
+++ b/archivers/libarchive/files/libarchive/config_windows.h
@@ -1,168 +1,510 @@
-/*-
- * Copyright (c) 2003-2006 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
- * in this position and unchanged.
- * 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(S) ``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(S) 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$
- */
-
-/* Start of configuration for native Win32 with Visual Studio. */
-/* TODO: Fix this. */
-#undef HAVE_ACL_CREATE_ENTRY
-#undef HAVE_ACL_INIT
-#undef HAVE_ACL_SET_FD
-#undef HAVE_ACL_SET_FD_NP
-#undef HAVE_ACL_SET_FILE
-#undef HAVE_ACL_USER
-#undef HAVE_BZLIB_H
-#undef HAVE_CHFLAGS
-#define HAVE_DECL_INT64_MAX 1
-#define HAVE_DECL_INT64_MIN 1
-#define HAVE_DECL_SIZE_MAX 1
-#define HAVE_DECL_STRERROR_R 1
-#define HAVE_DECL_UINT32_MAX 1
-#define HAVE_DECL_UINT64_MAX 1
-#define HAVE_EFTYPE 1
-#define HAVE_EILSEQ 1
-#define HAVE_ERRNO_H 1
-#undef HAVE_FCHDIR
-#undef HAVE_FCHFLAGS
-#undef HAVE_FCHMOD
-#undef HAVE_FCHOWN
-#define HAVE_FCNTL_H 1
-#undef HAVE_FSEEKO
-#undef HAVE_FUTIMES
-#undef HAVE_GRP_H
-#undef HAVE_INTTYPES_H
-#undef HAVE_LCHFLAGS
-#undef HAVE_LCHMOD
-#undef HAVE_LCHOWN
-#define HAVE_LIMITS_H 1
-#undef HAVE_LUTIMES
-#define HAVE_MALLOC 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMORY_H 1
-#define HAVE_MEMSET 1
-#define HAVE_MKDIR 1
-#undef HAVE_MKFIFO
-#undef HAVE_PATHS_H
-#undef HAVE_POLL
-#undef HAVE_POLL_H
-#undef HAVE_PWD_H
-#undef HAVE_SELECT
-#undef HAVE_STDINT_H
-#define HAVE_STDLIB_H 1
-#define HAVE_STRCHR 1
-#define HAVE_STRDUP 1
-#define HAVE_STRERROR 1
-#undef HAVE_STRERROR_R
-#define HAVE_STRINGS_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRRCHR 1
-#undef HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-#undef HAVE_STRUCT_STAT_ST_RDEV
-#undef HAVE_STRUCT_TM_TM_GMTOFF
-#undef HAVE_SYS_ACL_H
-#undef HAVE_SYS_IOCTL_H
-#undef HAVE_SYS_SELECT_H
-#define HAVE_SYS_STAT_H 1
-#undef HAVE_SYS_TIME_H
-#define HAVE_SYS_TYPES_H 1
-#undef HAVE_SYS_WAIT_H
-#undef HAVE_TIMEGM
-#undef HAVE_UNISTD_H
-#undef HAVE_UTIME
-#undef HAVE_UTIMES
-#undef HAVE_UTIME_H
-#define HAVE_WCHAR_H 1
-#define HAVE_WCSCPY 1
-#define HAVE_WCSLEN 1
-#define HAVE_WMEMCMP 1
-#define HAVE_WMEMCPY 1
-#undef HAVE_ZLIB_H
-#define STDC_HEADERS 1
-#define TIME_WITH_SYS_TIME 1
-
-/*
- * TODO: libarchive relies heavily on having the file type
- * encoded as part of the mode value. Windows kind-of, sort-of
- * supports this, but the following needs to be carefully compared
- * to Windows conventions and quite possibly changed extensively.
- */
-#define S_IFIFO 0010000 /* named pipe (fifo) */
-//#define S_IFCHR 0020000 /* character special */
-//#define S_IFDIR 0040000 /* directory */
-#define S_IFBLK 0060000 /* block special */
-//#define S_IFREG 0100000 /* regular */
-#define S_IFLNK 0120000 /* symbolic link */
-#define S_IFSOCK 0140000 /* socket */
-#define S_ISVTX 0001000 /* save swapped text even after use */
-//#define S_ISUID
-//#define S_ISGID
-//#define PATH_MAX
-#define S_IRWXU 0700
-#define S_IRWXG 0070
-#define S_IRWXO 0007
-#define S_ISDIR(m) (((m) & 0170000) == S_IFDIR) /* directory */
-#define S_ISCHR(m) (((m) & 0170000) == S_IFCHR) /* char special */
-#define S_ISBLK(m) (((m) & 0170000) == S_IFBLK) /* block special */
-#define S_ISREG(m) (((m) & 0170000) == S_IFREG) /* regular file */
-#define S_ISFIFO(m) (((m) & 0170000) == S_IFIFO) /* fifo or socket */
-#define S_ISLNK(m) (((m) & 0170000) == S_IFLNK) /* symbolic link */
-#define S_ISSOCK(m) (((m) & 0170000) == S_IFSOCK) /* socket */
-
-/* Basic definitions for system and integer types. */
-typedef int uid_t;
-typedef int gid_t;
-typedef int id_t;
-typedef unsigned short mode_t;
-typedef unsigned _int64 uint64_t;
-typedef unsigned _int16 uint16_t;
-typedef uint64_t uintmax_t;
-typedef _int64 intmax_t;
-
-/* Replacement for major/minor/makedev. */
-#define major(x) ((int)(0x00ff & ((x) >> 8)))
-#define minor(x) ((int)(0xffff00ff & (x)))
-#define makedev(maj,min) ((0xff00 & ((maj)<<8))|(0xffff00ff & (min)))
-
-#define EFTYPE 7
-#define STDERR_FILENO 2
-
-/* Alias the Windows _function to the POSIX equivalent. */
-#include <io.h>
-#define write _write
-#define read _read
-#define lseek _lseek
-#define open _open
-#define chdir _chdir
-#define mkdir _mkdir
-#define close _close
-
-/* TODO: Fix the code, don't suppress the warnings. */
-#pragma warning(disable:4996)
-#pragma warning(disable:4244)
-#pragma warning(disable:4305)
-#pragma warning(disable:4267)
-
-/* End of Win32/Visual Studio definitions. */
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+#ifndef CONFIG_H_INCLUDED
+#define CONFIG_H_INCLUDED
+
+/* Version number of bsdcpio */
+#define BSDCPIO_VERSION_STRING "0.3.0"
+
+/* Version number of bsdtar */
+#define BSDTAR_VERSION_STRING "2.4.12"
+
+/* Define to 1 if you have the `acl_create_entry' function. */
+/* #undef HAVE_ACL_CREATE_ENTRY */
+
+/* Define to 1 if you have the `acl_get_perm' function. */
+/* #undef HAVE_ACL_GET_PERM */
+
+/* Define to 1 if you have the `acl_get_perm_np' function. */
+/* #undef HAVE_ACL_GET_PERM_NP */
+
+/* Define to 1 if you have the `acl_init' function. */
+/* #undef HAVE_ACL_INIT */
+
+/* Define to 1 if the system has the type `acl_permset_t'. */
+/* #undef HAVE_ACL_PERMSET_T */
+
+/* Define to 1 if you have the `acl_set_fd' function. */
+/* #undef HAVE_ACL_SET_FD */
+
+/* Define to 1 if you have the `acl_set_fd_np' function. */
+/* #undef HAVE_ACL_SET_FD_NP */
+
+/* Define to 1 if you have the `acl_set_file' function. */
+/* #undef HAVE_ACL_SET_FILE */
+
+/* True for systems with POSIX ACL support */
+/* #undef HAVE_ACL_USER */
+
+/* Define to 1 if you have the <attr/xattr.h> header file. */
+/* #undef HAVE_ATTR_XATTR_H */
+
+/* Define to 1 if you have the <bzlib.h> header file. */
+/* #undef HAVE_BZLIB_H */
+
+/* Define to 1 if you have the `chflags' function. */
+/* #undef HAVE_CHFLAGS */
+
+/* Define to 1 if you have the `chown' function. */
+/* #undef HAVE_CHOWN */
+
+/* Define to 1 if you have the declaration of `INT64_MAX', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_INT64_MAX */
+
+/* Define to 1 if you have the declaration of `INT64_MIN', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_INT64_MIN */
+
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
+ */
+/* #undef HAVE_DECL_OPTARG */
+
+/* Define to 1 if you have the declaration of `optind', and to 0 if you don't.
+ */
+/* #undef HAVE_DECL_OPTIND */
+
+/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
+ don't. */
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+#define HAVE_DECL_SIZE_MAX 1
+#else
+/* #undef HAVE_DECL_SIZE_MAX */
+#endif
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_STRERROR_R */
+
+/* Define to 1 if you have the declaration of `UINT32_MAX', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_UINT32_MAX */
+
+/* Define to 1 if you have the declaration of `UINT64_MAX', and to 0 if you
+ don't. */
+/* #undef HAVE_DECL_UINT64_MAX */
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_DIRENT_H */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+/* #undef HAVE_DOPRNT */
+
+/* Define to 1 if nl_langinfo supports D_MD_ORDER */
+/* #undef HAVE_D_MD_ORDER */
+
+/* A possible errno value for invalid file format errors */
+#define HAVE_EFTYPE 1
+
+/* A possible errno value for invalid file format errors */
+#define HAVE_EILSEQ 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the <ext2fs/ext2_fs.h> header file. */
+/* #undef HAVE_EXT2FS_EXT2_FS_H */
+
+/* Define to 1 if you have the `fchdir' function. */
+/* #undef HAVE_FCHDIR */
+
+/* Define to 1 if you have the `fchflags' function. */
+/* #undef HAVE_FCHFLAGS */
+
+/* Define to 1 if you have the `fchmod' function. */
+/* #undef HAVE_FCHMOD */
+
+/* Define to 1 if you have the `fchown' function. */
+/* #undef HAVE_FCHOWN */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if your system has a working POSIX `fnmatch' function. */
+/* #undef HAVE_FNMATCH */
+
+/* Define to 1 if fnmatch(3) supports the FNM_LEADING_DIR flag */
+/* #undef HAVE_FNM_LEADING_DIR */
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+/* #undef HAVE_FSEEKO */
+
+/* Define to 1 if you have the `fsetxattr' function. */
+/* #undef HAVE_FSETXATTR */
+
+/* Define to 1 if you have the `ftruncate' function. */
+/* #undef HAVE_FTRUNCATE */
+
+/* Define to 1 if you have the `futimes' function. */
+/* #undef HAVE_FUTIMES */
+
+/* Define to 1 if you have the `geteuid' function. */
+/* #undef HAVE_GETEUID */
+
+/* Define to 1 if you have the `getopt_long' function. */
+/* #undef HAVE_GETOPT_LONG */
+
+/* Define to 1 if you have the `getxattr' function. */
+/* #undef HAVE_GETXATTR */
+
+/* Define to 1 if you have the <grp.h> header file. */
+/* #undef HAVE_GRP_H */
+
+/* Define to 1 if the system has the type `intmax_t'. */
+/* #undef HAVE_INTMAX_T */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+/* #undef HAVE_INTTYPES_H */
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+/* #undef HAVE_LANGINFO_H */
+
+/* Define to 1 if you have the `lchflags' function. */
+/* #undef HAVE_LCHFLAGS */
+
+/* Define to 1 if you have the `lchmod' function. */
+/* #undef HAVE_LCHMOD */
+
+/* Define to 1 if you have the `lchown' function. */
+/* #undef HAVE_LCHOWN */
+
+/* Define to 1 if you have the `lgetxattr' function. */
+/* #undef HAVE_LGETXATTR */
+
+/* Define to 1 if you have the `acl' library (-lacl). */
+/* #undef HAVE_LIBACL */
+
+/* Define to 1 if you have the `attr' library (-lattr). */
+/* #undef HAVE_LIBATTR */
+
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+/* #undef HAVE_LIBBZ2 */
+
+/* Define to 1 if you have the `z' library (-lz). */
+/* #undef HAVE_LIBZ */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the <linux/ext2_fs.h> header file. */
+/* #undef HAVE_LINUX_EXT2_FS_H */
+
+/* Define to 1 if you have the <linux/fs.h> header file. */
+/* #undef HAVE_LINUX_FS_H */
+
+/* Define to 1 if you have the `listxattr' function. */
+/* #undef HAVE_LISTXATTR */
+
+/* Define to 1 if you have the `llistxattr' function. */
+/* #undef HAVE_LLISTXATTR */
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if the system has the type `long long int'. */
+#define HAVE_LONG_LONG_INT 1
+
+/* Define to 1 if you have the `lsetxattr' function. */
+/* #undef HAVE_LSETXATTR */
+
+/* Define to 1 if `lstat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+/* #undef HAVE_LSTAT_EMPTY_STRING_BUG */
+
+/* Define to 1 if you have the `lutimes' function. */
+/* #undef HAVE_LUTIMES */
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `mkdir' function. */
+#define HAVE_MKDIR 1
+
+/* Define to 1 if you have the `mkfifo' function. */
+/* #undef HAVE_MKFIFO */
+
+/* Define to 1 if you have the `mknod' function. */
+/* #undef HAVE_MKNOD */
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+/* #undef HAVE_NL_LANGINFO */
+
+/* Define to 1 if you have the <paths.h> header file. */
+/* #undef HAVE_PATHS_H */
+
+/* Define to 1 if you have the `poll' function. */
+/* #undef HAVE_POLL */
+
+/* Define to 1 if you have the <poll.h> header file. */
+/* #undef HAVE_POLL_H */
+
+/* Define to 1 if you have the <pwd.sh.h> header file. */
+/* #undef HAVE_PWD_H */
+
+/* Define to 1 if you have the `select' function. */
+/* #undef HAVE_SELECT */
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+/* #undef HAVE_STAT_EMPTY_STRING_BUG */
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+/* #undef HAVE_STDINT_H */
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strerror_r' function. */
+/* #undef HAVE_STRERROR_R */
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strrchr' function. */
+#define HAVE_STRRCHR 1
+
+/* Define to 1 if `st_mtimespec.tv_nsec' is member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC */
+
+/* Define to 1 if `st_mtim.tv_nsec' is member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC */
+
+/* Define to 1 if `st_rdev' is member of `struct stat'. */
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+
+/* Define to 1 if `tm_gmtoff' is member of `struct tm'. */
+/* #undef HAVE_STRUCT_TM_TM_GMTOFF */
+
+/* Define to 1 if you have the <sys/acl.h> header file. */
+/* #undef HAVE_SYS_ACL_H */
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+/* #undef HAVE_SYS_PARAM_H */
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+/* #undef HAVE_SYS_POLL_H */
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+/* #undef HAVE_SYS_SELECT_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+/* #undef HAVE_SYS_TIME_H */
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/utime.h> header file. */
+#define HAVE_SYS_UTIME_H 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to 1 if you have the `timegm' function. */
+/* #undef HAVE_TIMEGM */
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if the system has the type `uintmax_t'. */
+/* #undef HAVE_UINTMAX_T */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define to 1 if the system has the type `unsigned long long'. */
+#define HAVE_UNSIGNED_LONG_LONG 1
+
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+
+/* Define to 1 if you have the `utime' function. */
+#define HAVE_UTIME 1
+
+/* Define to 1 if you have the `utimes' function. */
+/* #undef HAVE_UTIMES */
+
+/* Define to 1 if you have the <utime.h> header file. */
+/* #undef HAVE_UTIME_H */
+
+/* Define to 1 if you have the `vprintf' function. */
+#define HAVE_VPRINTF 1
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define to 1 if you have the `wcscpy' function. */
+#define HAVE_WCSCPY 1
+
+/* Define to 1 if you have the `wcslen' function. */
+#define HAVE_WCSLEN 1
+
+/* Define to 1 if you have the `wmemcmp' function. */
+/* #undef HAVE_WMEMCMP */
+
+/* Define to 1 if you have the `wmemcpy' function. */
+/* #undef HAVE_WMEMCPY */
+
+/* Define to 1 if you have the <zlib.h> header file. */
+/* #undef HAVE_ZLIB_H */
+
+/* Version number of libarchive as a single integer */
+#define LIBARCHIVE_VERSION "2004012"
+
+/* Version number of libarchive */
+#define LIBARCHIVE_VERSION_STRING "2.4.12"
+
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+ slash. */
+/* #undef LSTAT_FOLLOWS_SLASHED_SYMLINK */
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
+ */
+/* #undef MAJOR_IN_MKDEV */
+
+/* Define to 1 if `major', `minor', and `makedev' are declared in
+ <sysmacros.h>. */
+/* #undef MAJOR_IN_SYSMACROS */
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Name of package */
+#define PACKAGE "libarchive"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "kientzle@freebsd.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libarchive"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "libarchive 2.4.12"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libarchive"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.4.12"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if strerror_r returns char *. */
+/* #undef STRERROR_R_CHAR_P */
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Version number of package */
+#define VERSION "2.4.12"
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+/* #undef _LARGEFILE_SOURCE */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT64_T */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+//#define gid_t int
+
+/* Define to `unsigned long' if <sys/types.h> does not define. */
+#define id_t int
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#define int64_t long long
+
+/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
+ not define. */
+#define intmax_t long long
+
+/* Define to `int' if <sys/types.h> does not define. */
+//#define mode_t unsigned short
+
+/* Define to `long long' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+//#define uid_t int
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+#define uint64_t unsigned long long
+
+/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
+ do not define. */
+#define uintmax_t unsigned long long
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef uintptr_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#define pid_t unsigned int
+
+#define uint32_t unsigned long
+#define uint16_t unsigned short
+//#define ssize_t long
+
+#endif /* CONFIG_H_INCLUDED */
diff --git a/archivers/libarchive/files/libarchive/cpio.5 b/archivers/libarchive/files/libarchive/cpio.5
index 2f298332d18..9dbdc6d8408 100644
--- a/archivers/libarchive/files/libarchive/cpio.5
+++ b/archivers/libarchive/files/libarchive/cpio.5
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
+.\" $FreeBSD: src/lib/libarchive/cpio.5,v 1.1 2007/12/30 04:58:22 kientzle Exp $
.\"
.Dd October 5, 2007
.Dt CPIO 5
diff --git a/archivers/libarchive/files/libarchive/filter_fork.c b/archivers/libarchive/files/libarchive/filter_fork.c
index c71cf6883ff..8cad9e2f098 100644
--- a/archivers/libarchive/files/libarchive/filter_fork.c
+++ b/archivers/libarchive/files/libarchive/filter_fork.c
@@ -25,7 +25,7 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/filter_fork.c,v 1.1 2007/05/29 01:00:20 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/filter_fork.c,v 1.2 2007/12/30 04:58:22 kientzle Exp $");
#if defined(HAVE_POLL)
# if defined(HAVE_POLL_H)
diff --git a/archivers/libarchive/files/libarchive/libarchive-formats.5 b/archivers/libarchive/files/libarchive/libarchive-formats.5
index 0606a5ba1d0..0346d8f5aff 100644
--- a/archivers/libarchive/files/libarchive/libarchive-formats.5
+++ b/archivers/libarchive/files/libarchive/libarchive-formats.5
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libarchive/libarchive-formats.5,v 1.14 2007/04/05 05:07:53 kientzle Exp $
+.\" $FreeBSD: src/lib/libarchive/libarchive-formats.5,v 1.15 2007/12/30 04:58:22 kientzle Exp $
.\"
.Dd April 27, 2004
.Dt libarchive-formats 3
diff --git a/archivers/libarchive/files/libarchive/libarchive_internals.3 b/archivers/libarchive/files/libarchive/libarchive_internals.3
index a84c9406d34..9a42b76d4e6 100644
--- a/archivers/libarchive/files/libarchive/libarchive_internals.3
+++ b/archivers/libarchive/files/libarchive/libarchive_internals.3
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/lib/libarchive/libarchive_internals.3,v 1.1 2007/05/29 01:00:20 kientzle Exp $
+.\" $FreeBSD: src/lib/libarchive/libarchive_internals.3,v 1.2 2007/12/30 04:58:22 kientzle Exp $
.\"
.Dd April 16, 2007
.Dt LIBARCHIVE 3
diff --git a/archivers/libarchive/files/libarchive/test/list.h b/archivers/libarchive/files/libarchive/test/list.h
index 0b221fcec97..fdd56335dc9 100644
--- a/archivers/libarchive/files/libarchive/test/list.h
+++ b/archivers/libarchive/files/libarchive/test/list.h
@@ -2,8 +2,14 @@ DEFINE_TEST(test_acl_basic)
DEFINE_TEST(test_acl_pax)
DEFINE_TEST(test_archive_api_feature)
DEFINE_TEST(test_bad_fd)
+DEFINE_TEST(test_compat_gtar)
+DEFINE_TEST(test_compat_tar_hardlink)
+DEFINE_TEST(test_compat_zip)
+DEFINE_TEST(test_empty_write)
DEFINE_TEST(test_entry)
DEFINE_TEST(test_entry_strmode)
+DEFINE_TEST(test_link_resolver)
+DEFINE_TEST(test_pax_filename_encoding)
DEFINE_TEST(test_read_compress_program)
DEFINE_TEST(test_read_data_large)
DEFINE_TEST(test_read_extract)
@@ -35,6 +41,7 @@ DEFINE_TEST(test_tar_filenames)
DEFINE_TEST(test_tar_large)
DEFINE_TEST(test_write_compress_program)
DEFINE_TEST(test_write_disk)
+DEFINE_TEST(test_write_disk_hardlink)
DEFINE_TEST(test_write_disk_perms)
DEFINE_TEST(test_write_disk_secure)
DEFINE_TEST(test_write_format_ar)
diff --git a/archivers/libarchive/files/libarchive/test/main.c b/archivers/libarchive/files/libarchive/test/main.c
index 4585c2631db..0b56cc64156 100644
--- a/archivers/libarchive/files/libarchive/test/main.c
+++ b/archivers/libarchive/files/libarchive/test/main.c
@@ -24,15 +24,23 @@
*/
/*
- * Various utility routines useful for test programs.
- * Each test program is linked against this file.
+ * This same file is used pretty much verbatim for all test harnesses.
+ *
+ * The next line is used to define various environment variables, etc.
+ *
+ * The tar and cpio test harnesses are identical except for this line;
+ * the libarchive test harness omits some code that is needed only for
+ * testing standalone executables.
*/
+#define PROGRAM "LIBARCHIVE"
+
#include <errno.h>
+#include <locale.h>
#include <stdarg.h>
#include <time.h>
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.8 2007/07/31 05:03:27 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.10 2008/02/19 05:52:30 kientzle Exp $");
/*
* "list.h" is simply created by "grep DEFINE_TEST"; it has
@@ -60,6 +68,8 @@ static int quiet_flag = 0;
static int failures = 0;
/* Cumulative count of skipped component tests. */
static int skips = 0;
+/* Cumulative count of assertions. */
+static int assertions = 0;
/*
* My own implementation of the standard assert() macro emits the
@@ -86,7 +96,6 @@ static struct line {
int count;
} failed_lines[1000];
-
/*
* Count this failure; return the number of previous failures.
*/
@@ -116,21 +125,26 @@ previous_failures(const char *filename, int line)
}
/*
- * Inform user that we're skipping a test.
+ * Copy arguments into file-local variables.
*/
-static const char *skipped_filename;
-static int skipped_line;
-void skipping_setup(const char *filename, int line)
+static const char *test_filename;
+static int test_line;
+static void *test_extra;
+void test_setup(const char *filename, int line)
{
- skipped_filename = filename;
- skipped_line = line;
+ test_filename = filename;
+ test_line = line;
}
+
+/*
+ * Inform user that we're skipping a test.
+ */
void
test_skipping(const char *fmt, ...)
{
va_list ap;
- if (previous_failures(skipped_filename, skipped_line))
+ if (previous_failures(test_filename, test_line))
return;
va_start(ap, fmt);
@@ -209,19 +223,21 @@ failure(const char *fmt, ...)
}
/* Generic assert() just displays the failed condition. */
-void
+int
test_assert(const char *file, int line, int value, const char *condition, void *extra)
{
+ ++assertions;
if (value) {
msg[0] = '\0';
- return;
+ return (value);
}
failures ++;
if (previous_failures(file, line))
- return;
+ return (value);
fprintf(stderr, "%s:%d: Assertion failed\n", file, line);
fprintf(stderr, " Condition: %s\n", condition);
report_failure(extra);
+ return (value);
}
/* assertEqualInt() displays the values of the two integers. */
@@ -229,6 +245,7 @@ void
test_assert_equal_int(const char *file, int line,
int v1, const char *e1, int v2, const char *e2, void *extra)
{
+ ++assertions;
if (v1 == v2) {
msg[0] = '\0';
return;
@@ -250,6 +267,7 @@ test_assert_equal_string(const char *file, int line,
const char *v2, const char *e2,
void *extra)
{
+ ++assertions;
if (v1 == NULL || v2 == NULL) {
if (v1 == v2) {
msg[0] = '\0';
@@ -276,6 +294,7 @@ test_assert_equal_wstring(const char *file, int line,
const wchar_t *v2, const char *e2,
void *extra)
{
+ ++assertions;
if (wcscmp(v1, v2) == 0) {
msg[0] = '\0';
return;
@@ -290,15 +309,52 @@ test_assert_equal_wstring(const char *file, int line,
report_failure(extra);
}
-/* assertEqualMem() displays the values of the two strings. */
+/*
+ * Pretty standard hexdump routine. As a bonus, if ref != NULL, then
+ * any bytes in p that differ from ref will be highlighted with '_'
+ * before and after the hex value.
+ */
+static void
+hexdump(const char *p, const char *ref, size_t l, size_t offset)
+{
+ size_t i, j;
+ char sep;
+
+ for(i=0; i < l; i+=16) {
+ fprintf(stderr, "%04x", i + offset);
+ sep = ' ';
+ for (j = 0; j < 16 && i + j < l; j++) {
+ if (ref != NULL && p[i + j] != ref[i + j])
+ sep = '_';
+ fprintf(stderr, "%c%02x", sep, p[i+j]);
+ if (ref != NULL && p[i + j] == ref[i + j])
+ sep = ' ';
+ }
+ for (; j < 16; j++) {
+ fprintf(stderr, "%c ", sep);
+ sep = ' ';
+ }
+ fprintf(stderr, "%c", sep);
+ for (j=0; j < 16 && i + j < l; j++) {
+ int c = p[i + j];
+ if (c >= ' ' && c <= 126)
+ fprintf(stderr, "%c", c);
+ else
+ fprintf(stderr, ".");
+ }
+ fprintf(stderr, "\n");
+ }
+}
+
+/* assertEqualMem() displays the values of the two memory blocks. */
+/* TODO: For long blocks, hexdump the first bytes that actually differ. */
void
test_assert_equal_mem(const char *file, int line,
const char *v1, const char *e1,
const char *v2, const char *e2,
size_t l, const char *ld, void *extra)
{
- unsigned int i;
-
+ ++assertions;
if (v1 == NULL || v2 == NULL) {
if (v1 == v2) {
msg[0] = '\0';
@@ -314,31 +370,69 @@ test_assert_equal_mem(const char *file, int line,
fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n",
file, line);
fprintf(stderr, " size %s = %d\n", ld, (int)l);
- fprintf(stderr, " %s = ", e1);
- for(i=0; i < 32 && i < l; i++) {
- int c = v1[i];
- if (c >= ' ' && c <= 126)
- fprintf(stderr, "'%c'", c);
- else
- fprintf(stderr, "0x%02x", c);
- if (i < l)
- fprintf(stderr, ", ");
- }
- fprintf(stderr, "\n");
- fprintf(stderr, " %s = ", e2);
- for(i=0; i < 32 && i < l; i++) {
- int c = v2[i];
- if (c >= ' ' && c <= 126)
- fprintf(stderr, "'%c'", c);
- else
- fprintf(stderr, "0x%02x", c);
- if (i < l)
- fprintf(stderr, ", ");
- }
+ fprintf(stderr, " Dump of %s\n", e1);
+ hexdump(v1, v2, l < 32 ? l : 32, 0);
+ fprintf(stderr, " Dump of %s\n", e2);
+ hexdump(v2, v1, l < 32 ? l : 32, 0);
fprintf(stderr, "\n");
report_failure(extra);
}
+void
+test_assert_empty_file(const char *f1fmt, ...)
+{
+ char f1[1024];
+ struct stat st;
+ va_list ap;
+
+ va_start(ap, f1fmt);
+ vsprintf(f1, f1fmt, ap);
+ va_end(ap);
+
+ if (stat(f1, &st) != 0) {
+ fprintf(stderr, "%s:%d: Could not stat: %s\n", test_filename, test_line, f1);
+ report_failure(NULL);
+ } else if (st.st_size > 0) {
+ fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1);
+ fprintf(stderr, " File size: %d\n", (int)st.st_size);
+ report_failure(NULL);
+ }
+}
+
+/* assertEqualFile() asserts that two files have the same contents. */
+/* TODO: hexdump the first bytes that actually differ. */
+void
+test_assert_equal_file(const char *f1, const char *f2pattern, ...)
+{
+ char f2[1024];
+ va_list ap;
+ char buff1[1024];
+ char buff2[1024];
+ int fd1, fd2;
+ int n1, n2;
+
+ va_start(ap, f2pattern);
+ vsprintf(f2, f2pattern, ap);
+ va_end(ap);
+
+ fd1 = open(f1, O_RDONLY);
+ fd2 = open(f2, O_RDONLY);
+ for (;;) {
+ n1 = read(fd1, buff1, sizeof(buff1));
+ n2 = read(fd2, buff2, sizeof(buff2));
+ if (n1 != n2)
+ break;
+ if (n1 == 0 && n2 == 0)
+ return;
+ if (memcmp(buff1, buff2, n1) != 0)
+ break;
+ }
+ fprintf(stderr, "%s:%d: Files are not identical\n", test_filename, test_line);
+ fprintf(stderr, " file1=\"%s\"\n", f1);
+ fprintf(stderr, " file2=\"%s\"\n", f2);
+ report_failure(test_extra);
+}
+
/*
* Call standard system() call, but build up the command line using
@@ -412,8 +506,8 @@ slurpfile(size_t * sizep, const char *fmt, ...)
/*
* "list.h" is automatically generated; it just has a lot of lines like:
* DEFINE_TEST(function_name)
- * The common "test.h" includes it to declare all of the test functions.
- * We reuse it here to define a list of all tests to run.
+ * It's used above to declare all of the test functions.
+ * We reuse it here to define a list of all tests (functions and names).
*/
#undef DEFINE_TEST
#define DEFINE_TEST(n) { n, #n },
@@ -457,6 +551,8 @@ static int test_run(int i, const char *tmpdir)
tests[i].name);
exit(1);
}
+ /* Explicitly reset the locale before each test. */
+ setlocale(LC_ALL, "C");
/* Run the actual test. */
(*tests[i].func)();
/* Summarize the results of this test. */
@@ -490,6 +586,7 @@ int main(int argc, char **argv)
static const int limit = sizeof(tests) / sizeof(tests[0]);
int i, tests_run = 0, tests_failed = 0, opt;
time_t now;
+ char *refdir_alloc = NULL;
char *progname, *p;
char tmpdir[256];
char tmpdir_timestamp[256];
@@ -506,7 +603,7 @@ int main(int argc, char **argv)
}
/* Get the directory holding test files from environment. */
- refdir = getenv("LIBARCHIVE_TEST_FILES");
+ refdir = getenv(PROGRAM "_TEST_FILES");
/*
* Parse options.
@@ -556,7 +653,7 @@ int main(int argc, char **argv)
*/
if (refdir == NULL) {
systemf("/bin/pwd > %s/refdir", tmpdir);
- refdir = slurpfile(NULL, "%s/refdir", tmpdir);
+ refdir = refdir_alloc = slurpfile(NULL, "%s/refdir", tmpdir);
p = refdir + strlen(refdir);
while (p[-1] == '\n') {
--p;
@@ -603,10 +700,14 @@ int main(int argc, char **argv)
*/
if (!quiet_flag) {
printf("\n");
- printf("%d of %d test groups reported failures\n",
+ printf("%d of %d tests reported failures\n",
tests_failed, tests_run);
- printf(" Total of %d individual tests failed.\n", failures);
- printf(" Total of %d individual tests were skipped.\n", skips);
+ printf(" Total of %d assertions checked.\n", assertions);
+ printf(" Total of %d assertions failed.\n", failures);
+ printf(" Total of %d assertions skipped.\n", skips);
}
+
+ free(refdir_alloc);
+
return (tests_failed);
}
diff --git a/archivers/libarchive/files/libarchive/test/read_open_memory.c b/archivers/libarchive/files/libarchive/test/read_open_memory.c
index 8be3d63eaef..aacb0123fda 100644
--- a/archivers/libarchive/files/libarchive/test/read_open_memory.c
+++ b/archivers/libarchive/files/libarchive/test/read_open_memory.c
@@ -24,7 +24,7 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/read_open_memory.c,v 1.1 2007/07/13 15:12:52 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/read_open_memory.c,v 1.2 2008/01/01 22:28:04 kientzle Exp $");
#include <errno.h>
#include <stdlib.h>
diff --git a/archivers/libarchive/files/libarchive/test/test.h b/archivers/libarchive/files/libarchive/test/test.h
index 940b0274bf5..72d611d77d1 100644
--- a/archivers/libarchive/files/libarchive/test/test.h
+++ b/archivers/libarchive/files/libarchive/test/test.h
@@ -22,7 +22,7 @@
* (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: src/lib/libarchive/test/test.h,v 1.6 2007/07/14 17:52:01 kientzle Exp $
+ * $FreeBSD: src/lib/libarchive/test/test.h,v 1.8 2008/02/19 05:52:30 kientzle Exp $
*/
/* Every test program should #include "test.h" as the first thing. */
@@ -31,8 +31,9 @@
* The goal of this file (and the matching test.c) is to
* simplify the very repetitive test-*.c test programs.
*/
-
+#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
+#endif
#include <errno.h>
#include <fcntl.h>
@@ -40,7 +41,9 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#ifndef _WIN32
#include <unistd.h>
+#endif
#include <wchar.h>
#ifdef USE_DMALLOC
@@ -90,6 +93,14 @@
/* As above, but raw blocks of bytes. */
#define assertEqualMem(v1, v2, l) \
test_assert_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
+/* Assert two files are the same; allow printf-style expansion of second name.
+ * See below for comments about variable arguments here...
+ */
+#define assertEqualFile \
+ test_setup(__FILE__, __LINE__);test_assert_equal_file
+/* Assert that a file is empty; supports printf-style arguments. */
+#define assertEmptyFile \
+ test_setup(__FILE__, __LINE__);test_assert_empty_file
/*
* This would be simple with C99 variadic macros, but I don't want to
@@ -98,13 +109,15 @@
* but effective.
*/
#define skipping \
- skipping_setup(__FILE__, __LINE__);test_skipping
+ test_setup(__FILE__, __LINE__);test_skipping
/* Function declarations. These are defined in test_utility.c. */
void failure(const char *fmt, ...);
-void skipping_setup(const char *, int);
+void test_setup(const char *, int);
void test_skipping(const char *fmt, ...);
-void test_assert(const char *, int, int, const char *, void *);
+int test_assert(const char *, int, int, const char *, void *);
+void test_assert_empty_file(const char *, ...);
+void test_assert_equal_file(const char *, const char *, ...);
void test_assert_equal_int(const char *, int, int, const char *, int, const char *, void *);
void test_assert_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
void test_assert_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_gtar.c b/archivers/libarchive/files/libarchive/test/test_compat_gtar.c
new file mode 100644
index 00000000000..3451a76ebbc
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_gtar.c
@@ -0,0 +1,110 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_gtar.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $");
+
+/*
+ * Verify our ability to read sample files created by GNU tar.
+ * It should be easy to add any new sample files sent in by users
+ * to this collection of tests.
+ */
+
+/* Copy this function for each test file and adjust it accordingly. */
+
+/*
+ * test_compat_gtar_1.tgz exercises reading long filenames and
+ * symlink targets stored in the GNU tar format.
+ */
+static void
+test_compat_gtar_1(void)
+{
+ char name[1024];
+ struct archive_entry *ae;
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ sprintf(name, "%s/test_compat_gtar_1.tgz", refdir);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
+
+ /* Read first entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString(
+ "12345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890",
+ archive_entry_pathname(ae));
+ assertEqualInt(1197179003, archive_entry_mtime(ae));
+ assertEqualInt(1000, archive_entry_uid(ae));
+ assertEqualString("tim", archive_entry_uname(ae));
+ assertEqualInt(1000, archive_entry_gid(ae));
+ assertEqualString("tim", archive_entry_gname(ae));
+ assertEqualInt(0100644, archive_entry_mode(ae));
+
+ /* Read second entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString(
+ "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij"
+ "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij"
+ "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij"
+ "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij",
+ archive_entry_pathname(ae));
+ assertEqualString(
+ "12345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890",
+ archive_entry_symlink(ae));
+ assertEqualInt(1197179043, archive_entry_mtime(ae));
+ assertEqualInt(1000, archive_entry_uid(ae));
+ assertEqualString("tim", archive_entry_uname(ae));
+ assertEqualInt(1000, archive_entry_gid(ae));
+ assertEqualString("tim", archive_entry_gname(ae));
+ assertEqualInt(0120755, archive_entry_mode(ae));
+
+ /* Verify the end-of-archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_GZIP);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+#if ARCHIVE_API_VERSION > 1
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+#else
+ archive_read_finish(a);
+#endif
+}
+
+
+DEFINE_TEST(test_compat_gtar)
+{
+ test_compat_gtar_1();
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_gtar_1.tgz.uu b/archivers/libarchive/files/libarchive/test/test_compat_gtar_1.tgz.uu
new file mode 100644
index 00000000000..f088a4a5fe6
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_gtar_1.tgz.uu
@@ -0,0 +1,9 @@
+begin 644 test_compat_gtar_1.tgz
+M'XL(`,N`6T<``^W62PZ",!`&X!YE3@`SI:6Z<R^7\(&*+Q+%>'W+PJB)43=4
+MJO^W:1.Z:#KYATG2)!T5]7Y95/N-Z@:UF)ZO7B9"-TPD[%@4%1W=Y\'IV$P.
+M1.I0U\VK<^=566Y#7"@LT9FQN1L,.>[=M]\Q5@%JHX0Y-Z;-NSC+]^LM\S[R
+M.G?,XC(B+:Q949"B7O/?5+N7Y]Y]CU32U_[OZS_NZ#X/T/][T\/1_\/K;?XQ
+M_P4QF<[FY6*YJM9Q[[[]CK$*4!O_CV%G[6?SGS9^_C/&:I]_'6(X_?/Y#P``
+4````````````?L\%KFMT6@`H````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink.c b/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink.c
new file mode 100644
index 00000000000..103b349da0e
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink.c
@@ -0,0 +1,104 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink.c,v 1.1 2008/01/31 07:47:38 kientzle Exp $");
+
+/*
+ * Background: There are two written standards for the tar file format.
+ * The first is the POSIX 1988 "ustar" format, the second is the 2001
+ * "pax extended" format that builds on the "ustar" format by adding
+ * support for generic additional attributes. Buried in the details
+ * is one frustrating incompatibility: The 1988 standard says that
+ * tar readers MUST ignore the size field on hardlink entries; the
+ * 2001 standard says that tar readers MUST obey the size field on
+ * hardlink entries. libarchive tries to navigate this particular
+ * minefield by using auto-detect logic to guess whether it should
+ * or should not obey the size field.
+ *
+ * This test tries to probe the boundaries of such handling; the test
+ * archives here were adapted from real archives created by real
+ * tar implementations that are (as of early 2008) apparently still
+ * in use.
+ */
+
+static void
+test_compat_tar_hardlink_1(void)
+{
+ char name[1024];
+ struct archive_entry *ae;
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ sprintf(name, "%s/test_compat_tar_hardlink_1.tar", refdir);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
+
+ /* Read first entry, which is a regular file. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("xmcd-3.3.2/docs_d/READMf",
+ archive_entry_pathname(ae));
+ assertEqualString(NULL, archive_entry_hardlink(ae));
+ assertEqualInt(321, archive_entry_size(ae));
+ assertEqualInt(1082575645, archive_entry_mtime(ae));
+ assertEqualInt(1851, archive_entry_uid(ae));
+ assertEqualInt(3, archive_entry_gid(ae));
+ assertEqualInt(0100444, archive_entry_mode(ae));
+
+ /* Read second entry, which is a hard link at the end of archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("xmcd-3.3.2/README",
+ archive_entry_pathname(ae));
+ assertEqualString(
+ "xmcd-3.3.2/docs_d/READMf",
+ archive_entry_hardlink(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualInt(1082575645, archive_entry_mtime(ae));
+ assertEqualInt(1851, archive_entry_uid(ae));
+ assertEqualInt(3, archive_entry_gid(ae));
+ assertEqualInt(0100444, archive_entry_mode(ae));
+
+ /* Verify the end-of-archive. */
+ /*
+ * This failed in libarchive 2.4.12 because the tar reader
+ * tried to obey the size field for the hard link and ended
+ * up running past the end of the file.
+ */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
+DEFINE_TEST(test_compat_tar_hardlink)
+{
+ test_compat_tar_hardlink_1();
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink_1.tar.uu b/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink_1.tar.uu
new file mode 100644
index 00000000000..95dba54c256
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_tar_hardlink_1.tar.uu
@@ -0,0 +1,39 @@
+$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink_1.tar.uu,v 1.1 2008/01/31 07:47:38 kientzle Exp $
+begin 644 test_compat_tar_hardlink_1.tar
+M>&UC9"TS+C,N,B]D;V-S7V0O4D5!1$UF````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````"`@(#0T-"``("`S-#<S(``@("`@(#,@`"`@("`@("`@-3`Q
+M(#$P,#0Q-30U-#,U("`@-S8U-``@````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!X>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
+M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
+M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
+M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
+M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
+M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
+M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
+M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'@`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````'AM8V0M,RXS+C(O
+M4D5!1$U%````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````@
+M("`T-#0@`"`@,S0W,R``("`@("`S(``@("`@("`@(#4P,2`Q,#`T,34T-30S
+M-2`@,3(R,#<`(#%X;6-D+3,N,RXR+V1O8W-?9"]214%$368`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+&````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_zip.c b/archivers/libarchive/files/libarchive/test/test_compat_zip.c
new file mode 100644
index 00000000000..0f6d1d00b1b
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_zip.c
@@ -0,0 +1,69 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_zip.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $");
+
+/* Copy this function for each test file and adjust it accordingly. */
+static void
+test_compat_zip_1(void)
+{
+ char name[1024];
+ struct archive_entry *ae;
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ sprintf(name, "%s/test_compat_zip_1.zip", refdir);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
+
+ /* Read first entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("META-INF/MANIFEST.MF", archive_entry_pathname(ae));
+
+ /* Read second entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("tmp.class", archive_entry_pathname(ae));
+
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ZIP);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+#if ARCHIVE_API_VERSION > 1
+ assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+#else
+ archive_read_finish(a);
+#endif
+}
+
+
+DEFINE_TEST(test_compat_zip)
+{
+ test_compat_zip_1();
+}
+
+
diff --git a/archivers/libarchive/files/libarchive/test/test_compat_zip_1.zip.uu b/archivers/libarchive/files/libarchive/test/test_compat_zip_1.zip.uu
new file mode 100644
index 00000000000..e13a6cac29d
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_compat_zip_1.zip.uu
@@ -0,0 +1,14 @@
+begin 644 test_compat_zip_1.zip
+M4$L#!!0`"``(``B$@S<````````````````4````345402U)3D8O34%.249%
+M4U0N34;S3<S+3$LM+M$-2RTJSLS/LU(PU#/@Y7+,0Q)Q+$A,SDA5`(H!)<U!
+MTLY%J8DEJ2FZ3I56"BF9B4DY^;J&>J9Z!O$&YKI)!H8*&L&E>0J^F<E%^<65
+MQ26IN<4*GGG)>IJ\7+Q<`%!+!PAHTY\490```'$```!02P,$%``(``@`"(2#
+M-P````````````````D```!T;7`N8VQA<W,[]6_7/@8&!D,&+G8&#G8&3BX&
+M1@86'@8V!E9&!F8-S3!&!C:;S+S,$CN@L'-^2BHC@T!68EFB?DYB7KJ^?U)6
+M:G()4&%);@&#(@,34"\(,`(AT``@R0[D"8+Y#`RL6ML9F#>"%3```%!+!P@+
+M(*8V:````'8```!02P$"%``4``@`"``(A(,W:-.?%&4```!Q````%```````
+M````````````````345402U)3D8O34%.249%4U0N34902P$"%``4``@`"``(
+MA(,W"R"F-F@```!V````"0````````````````"G````=&UP+F-L87-S4$L%
+J!@`````"``(`>0```$8!```7`%!R;T=U87)D+"!V97)S:6]N(#0N,"XQ
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_empty_write.c b/archivers/libarchive/files/libarchive/test/test_empty_write.c
new file mode 100644
index 00000000000..540ddf110ba
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_empty_write.c
@@ -0,0 +1,118 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_empty_write.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $");
+
+DEFINE_TEST(test_empty_write)
+{
+ char buff[32768];
+ struct archive_entry *ae;
+ struct archive *a;
+ size_t used;
+
+ /*
+ * Exercise a zero-byte write to a gzip-compressed archive.
+ */
+
+ /* Create a new archive in memory. */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertA(0 == archive_write_set_compression_gzip(a));
+ assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
+ /* Write a file to it. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 0);
+ assertA(0 == archive_write_header(a, ae));
+
+ /* THE TEST: write zero bytes to this entry. */
+ /* This used to crash. */
+ assertEqualIntA(a, 0, archive_write_data(a, "", 0));
+
+ /* Close out the archive. */
+ assertA(0 == archive_write_close(a));
+#if ARCHIVE_API_VERSION > 1
+ assertA(0 == archive_write_finish(a));
+#else
+ archive_write_finish(a);
+#endif
+
+
+ /*
+ * Again, with bzip2 compression.
+ */
+
+ /* Create a new archive in memory. */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertA(0 == archive_write_set_compression_bzip2(a));
+ assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
+ /* Write a file to it. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 0);
+ assertA(0 == archive_write_header(a, ae));
+
+ /* THE TEST: write zero bytes to this entry. */
+ assertEqualIntA(a, 0, archive_write_data(a, "", 0));
+
+ /* Close out the archive. */
+ assertA(0 == archive_write_close(a));
+#if ARCHIVE_API_VERSION > 1
+ assertA(0 == archive_write_finish(a));
+#else
+ archive_write_finish(a);
+#endif
+
+
+ /*
+ * For good measure, one more time with no compression.
+ */
+
+ /* Create a new archive in memory. */
+ assert((a = archive_write_new()) != NULL);
+ assertA(0 == archive_write_set_format_ustar(a));
+ assertA(0 == archive_write_set_compression_none(a));
+ assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
+ /* Write a file to it. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 0);
+ assertA(0 == archive_write_header(a, ae));
+
+ /* THE TEST: write zero bytes to this entry. */
+ assertEqualIntA(a, 0, archive_write_data(a, "", 0));
+
+ /* Close out the archive. */
+ assertA(0 == archive_write_close(a));
+#if ARCHIVE_API_VERSION > 1
+ assertA(0 == archive_write_finish(a));
+#else
+ archive_write_finish(a);
+#endif
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_entry.c b/archivers/libarchive/files/libarchive/test/test_entry.c
index cb66a85a8c0..bf41aac4891 100644
--- a/archivers/libarchive/files/libarchive/test/test_entry.c
+++ b/archivers/libarchive/files/libarchive/test/test_entry.c
@@ -25,6 +25,8 @@
#include "test.h"
__FBSDID("$FreeBSD: src/lib/libarchive/test/test_entry.c,v 1.2 2007/07/06 15:43:11 kientzle Exp $");
+#include <locale.h>
+
/*
* Most of these tests are system-independent, though a few depend on
* features of the local system. Such tests are conditionalized on
@@ -670,6 +672,39 @@ DEFINE_TEST(test_entry)
#endif
#endif
+ /*
+ * Exercise the character-conversion logic, if we can.
+ */
+ failure("Can't exercise charset-conversion logic.");
+ if (assert(NULL != setlocale(LC_ALL, "de_DE.UTF-8"))) {
+ /* A filename that cannot be converted to wide characters. */
+ archive_entry_copy_pathname(e, "abc\314\214mno\374xyz");
+ failure("Converting invalid chars to Unicode should fail.");
+ assert(NULL == archive_entry_pathname_w(e));
+ //failure("Converting invalid chars to UTF-8 should fail.");
+ //assert(NULL == archive_entry_pathname_utf8(e));
+
+ /* A group name that cannot be converted. */
+ archive_entry_copy_gname(e, "abc\314\214mno\374xyz");
+ failure("Converting invalid chars to Unicode should fail.");
+ assert(NULL == archive_entry_gname_w(e));
+
+ /* A user name that cannot be converted. */
+ archive_entry_copy_uname(e, "abc\314\214mno\374xyz");
+ failure("Converting invalid chars to Unicode should fail.");
+ assert(NULL == archive_entry_uname_w(e));
+
+ /* A hardlink target that cannot be converted. */
+ archive_entry_copy_hardlink(e, "abc\314\214mno\374xyz");
+ failure("Converting invalid chars to Unicode should fail.");
+ assert(NULL == archive_entry_hardlink_w(e));
+
+ /* A symlink target that cannot be converted. */
+ archive_entry_copy_symlink(e, "abc\314\214mno\374xyz");
+ failure("Converting invalid chars to Unicode should fail.");
+ assert(NULL == archive_entry_symlink_w(e));
+ }
+
/* Release the experimental entry. */
archive_entry_free(e);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_entry_strmode.c b/archivers/libarchive/files/libarchive/test/test_entry_strmode.c
index 43b01b42232..2941c4a4c38 100644
--- a/archivers/libarchive/files/libarchive/test/test_entry_strmode.c
+++ b/archivers/libarchive/files/libarchive/test/test_entry_strmode.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_entry_strmode.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $");
DEFINE_TEST(test_entry_strmode)
{
diff --git a/archivers/libarchive/files/libarchive/test/test_link_resolver.c b/archivers/libarchive/files/libarchive/test/test_link_resolver.c
new file mode 100644
index 00000000000..24827b0f222
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_link_resolver.c
@@ -0,0 +1,222 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+static void test_link_resolver_basic(void)
+{
+ struct archive_entry *entry;
+ struct archive_entry_linkresolver *resolver;
+
+ /* Initialize the resolver. */
+ assert(NULL != (resolver = archive_entry_linkresolver_new()));
+
+ /* Create an entry with only 1 link and try to register it. */
+ assert(NULL != (entry = archive_entry_new()));
+ archive_entry_set_pathname(entry, "test1");
+ archive_entry_set_ino(entry, 1);
+ archive_entry_set_dev(entry, 2);
+ archive_entry_set_nlink(entry, 1);
+
+ /* Shouldn't match anything. */
+ assertEqualString(NULL, archive_entry_linkresolve(resolver, entry));
+ /* Still shouldn't match anything. */
+ assertEqualString(NULL, archive_entry_linkresolve(resolver, entry));
+
+ archive_entry_set_nlink(entry, 2);
+ archive_entry_set_ino(entry, 2);
+ /* Shouldn't match, since we haven't seen it before. */
+ assertEqualString(NULL, archive_entry_linkresolve(resolver, entry));
+ /* Should match, since we have seen it once before. */
+ archive_entry_set_pathname(entry, "test2");
+ assertEqualString("test1", archive_entry_linkresolve(resolver, entry));
+ /* Should not match, since we've seen both links. */
+ assertEqualString(NULL, archive_entry_linkresolve(resolver, entry));
+
+ archive_entry_free(entry);
+ archive_entry_linkresolver_free(resolver);
+}
+
+static void test_linkify_tar(void)
+{
+ struct archive_entry *entry, *e2;
+ struct archive_entry_linkresolver *resolver;
+
+ /* Initialize the resolver. */
+ assert(NULL != (resolver = archive_entry_linkresolver_new()));
+ archive_entry_linkresolver_set_strategy(resolver,
+ ARCHIVE_ENTRY_LINKIFY_LIKE_TAR);
+
+ /* Create an entry with only 1 link and try to linkify it. */
+ assert(NULL != (entry = archive_entry_new()));
+ archive_entry_set_pathname(entry, "test1");
+ archive_entry_set_ino(entry, 1);
+ archive_entry_set_dev(entry, 2);
+ archive_entry_set_nlink(entry, 1);
+ archive_entry_set_size(entry, 10);
+ archive_entry_linkify(resolver, &entry, &e2);
+
+ /* Shouldn't have been changed. */
+ assert(e2 == NULL);
+ assertEqualInt(10, archive_entry_size(entry));
+ assertEqualString("test1", archive_entry_pathname(entry));
+
+ /* Now, try again with an entry that has 2 links. */
+ archive_entry_set_pathname(entry, "test2");
+ archive_entry_set_nlink(entry, 2);
+ archive_entry_set_ino(entry, 2);
+ archive_entry_linkify(resolver, &entry, &e2);
+ /* Shouldn't be altered, since it wasn't seen before. */
+ assert(e2 == NULL);
+ assertEqualString("test2", archive_entry_pathname(entry));
+ assertEqualString(NULL, archive_entry_hardlink(entry));
+ assertEqualInt(10, archive_entry_size(entry));
+
+ /* Match again and make sure it does get altered. */
+ archive_entry_linkify(resolver, &entry, &e2);
+ assert(e2 == NULL);
+ assertEqualString("test2", archive_entry_pathname(entry));
+ assertEqualString("test2", archive_entry_hardlink(entry));
+ assertEqualInt(0, archive_entry_size(entry));
+
+
+ archive_entry_free(entry);
+ archive_entry_linkresolver_free(resolver);
+}
+
+static void test_linkify_old_cpio(void)
+{
+ struct archive_entry *entry, *e2;
+ struct archive_entry_linkresolver *resolver;
+
+ /* Initialize the resolver. */
+ assert(NULL != (resolver = archive_entry_linkresolver_new()));
+ archive_entry_linkresolver_set_strategy(resolver,
+ ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO);
+
+ /* Create an entry with 2 link and try to linkify it. */
+ assert(NULL != (entry = archive_entry_new()));
+ archive_entry_set_pathname(entry, "test1");
+ archive_entry_set_ino(entry, 1);
+ archive_entry_set_dev(entry, 2);
+ archive_entry_set_nlink(entry, 2);
+ archive_entry_set_size(entry, 10);
+ archive_entry_linkify(resolver, &entry, &e2);
+
+ /* Shouldn't have been changed. */
+ assert(e2 == NULL);
+ assertEqualInt(10, archive_entry_size(entry));
+ assertEqualString("test1", archive_entry_pathname(entry));
+
+ /* Still shouldn't be matched. */
+ archive_entry_linkify(resolver, &entry, &e2);
+ assert(e2 == NULL);
+ assertEqualString("test1", archive_entry_pathname(entry));
+ assertEqualString(NULL, archive_entry_hardlink(entry));
+ assertEqualInt(10, archive_entry_size(entry));
+
+ archive_entry_free(entry);
+ archive_entry_linkresolver_free(resolver);
+}
+
+static void test_linkify_new_cpio(void)
+{
+ struct archive_entry *entry, *e2;
+ struct archive_entry_linkresolver *resolver;
+
+ /* Initialize the resolver. */
+ assert(NULL != (resolver = archive_entry_linkresolver_new()));
+ archive_entry_linkresolver_set_strategy(resolver,
+ ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO);
+
+ /* Create an entry with only 1 link and try to linkify it. */
+ assert(NULL != (entry = archive_entry_new()));
+ archive_entry_set_pathname(entry, "test1");
+ archive_entry_set_ino(entry, 1);
+ archive_entry_set_dev(entry, 2);
+ archive_entry_set_nlink(entry, 1);
+ archive_entry_set_size(entry, 10);
+ archive_entry_linkify(resolver, &entry, &e2);
+
+ /* Shouldn't have been changed. */
+ assert(e2 == NULL);
+ assertEqualInt(10, archive_entry_size(entry));
+ assertEqualString("test1", archive_entry_pathname(entry));
+
+ /* Now, try again with an entry that has 3 links. */
+ archive_entry_set_pathname(entry, "test2");
+ archive_entry_set_nlink(entry, 3);
+ archive_entry_set_ino(entry, 2);
+ archive_entry_linkify(resolver, &entry, &e2);
+
+ /* First time, it just gets swallowed. */
+ assert(entry == NULL);
+ assert(e2 == NULL);
+
+ /* Match again. */
+ assert(NULL != (entry = archive_entry_new()));
+ archive_entry_set_pathname(entry, "test3");
+ archive_entry_set_ino(entry, 2);
+ archive_entry_set_dev(entry, 2);
+ archive_entry_set_nlink(entry, 2);
+ archive_entry_set_size(entry, 10);
+ archive_entry_linkify(resolver, &entry, &e2);
+
+ /* Should get back "test2" and nothing else. */
+ assertEqualString("test2", archive_entry_pathname(entry));
+ assertEqualInt(0, archive_entry_size(entry));
+ archive_entry_free(entry);
+ assert(NULL == e2);
+ archive_entry_free(e2); /* This should be a no-op. */
+
+ /* Match a third time. */
+ assert(NULL != (entry = archive_entry_new()));
+ archive_entry_set_pathname(entry, "test4");
+ archive_entry_set_ino(entry, 2);
+ archive_entry_set_dev(entry, 2);
+ archive_entry_set_nlink(entry, 3);
+ archive_entry_set_size(entry, 10);
+ archive_entry_linkify(resolver, &entry, &e2);
+
+ /* Should get back "test3". */
+ assertEqualString("test3", archive_entry_pathname(entry));
+ assertEqualInt(0, archive_entry_size(entry));
+
+ /* Since "test4" was the last link, should get it back also. */
+ assertEqualString("test4", archive_entry_pathname(e2));
+ assertEqualInt(10, archive_entry_size(e2));
+
+ archive_entry_free(entry);
+ archive_entry_free(e2);
+ archive_entry_linkresolver_free(resolver);
+}
+
+DEFINE_TEST(test_link_resolver)
+{
+ test_link_resolver_basic();
+ test_linkify_tar();
+ test_linkify_old_cpio();
+ test_linkify_new_cpio();
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.c b/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.c
new file mode 100644
index 00000000000..770c6e3b136
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_pax_filename_encoding.c
@@ -0,0 +1,132 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+#include <locale.h>
+
+/*
+ * Pax interchange is supposed to encode filenames into
+ * UTF-8. Of course, that's not always possible. This
+ * test is intended to verify that filenames always get
+ * stored and restored correctly, regardless of the encodings.
+ */
+
+DEFINE_TEST(test_pax_filename_encoding)
+{
+ char buff[65536];
+ /*
+ * \314\214 is a valid 2-byte UTF-8 sequence.
+ * \374 is invalid in UTF-8.
+ */
+ char filename[] = "abc\314\214mno\374xyz";
+ char longname[] = "abc\314\214mno\374xyz"
+ "/abc\314\214mno\374xyz/abcdefghijklmnopqrstuvwxyz"
+ "/abc\314\214mno\374xyz/abcdefghijklmnopqrstuvwxyz"
+ "/abc\314\214mno\374xyz/abcdefghijklmnopqrstuvwxyz"
+ "/abc\314\214mno\374xyz/abcdefghijklmnopqrstuvwxyz"
+ "/abc\314\214mno\374xyz/abcdefghijklmnopqrstuvwxyz"
+ "/abc\314\214mno\374xyz/abcdefghijklmnopqrstuvwxyz"
+ ;
+ size_t used;
+ struct archive *a;
+ struct archive_entry *entry;
+
+ /*
+ * We need a starting locale which has invalid sequences.
+ * de_DE.UTF-8 seems to be commonly supported.
+ */
+ /* If it doesn't exist, just warn and return. */
+ failure("We need a suitable locale for the encoding tests.");
+ if (!assert(NULL != setlocale(LC_ALL, "de_DE.UTF-8")))
+ return;
+
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, 0, archive_write_set_format_pax(a));
+ assertEqualIntA(a, 0, archive_write_set_compression_none(a));
+ assertEqualIntA(a, 0, archive_write_set_bytes_per_block(a, 0));
+ assertEqualInt(0,
+ archive_write_open_memory(a, buff, sizeof(buff), &used));
+
+ assert((entry = archive_entry_new()) != NULL);
+ /* Set pathname, gname, uname, hardlink to nonconvertible values. */
+ archive_entry_copy_pathname(entry, filename);
+ archive_entry_copy_gname(entry, filename);
+ archive_entry_copy_uname(entry, filename);
+ archive_entry_copy_hardlink(entry, filename);
+ archive_entry_set_filetype(entry, AE_IFREG);
+ failure("This should generate a warning for nonconvertible names.");
+ assertEqualInt(ARCHIVE_WARN, archive_write_header(a, entry));
+ archive_entry_free(entry);
+
+ assert((entry = archive_entry_new()) != NULL);
+ /* Set path, gname, uname, and symlink to nonconvertible values. */
+ archive_entry_copy_pathname(entry, filename);
+ archive_entry_copy_gname(entry, filename);
+ archive_entry_copy_uname(entry, filename);
+ archive_entry_copy_symlink(entry, filename);
+ archive_entry_set_filetype(entry, AE_IFLNK);
+ failure("This should generate a warning for nonconvertible names.");
+ assertEqualInt(ARCHIVE_WARN, archive_write_header(a, entry));
+ archive_entry_free(entry);
+
+ assert((entry = archive_entry_new()) != NULL);
+ /* Set pathname to a very long nonconvertible value. */
+ archive_entry_copy_pathname(entry, longname);
+ archive_entry_set_filetype(entry, AE_IFREG);
+ failure("This should generate a warning for nonconvertible names.");
+ assertEqualInt(ARCHIVE_WARN, archive_write_header(a, entry));
+ archive_entry_free(entry);
+
+ assertEqualInt(0, archive_write_close(a));
+ assertEqualInt(0, archive_write_finish(a));
+
+ /*
+ * Now read the entries back.
+ */
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(0, archive_read_support_format_tar(a));
+ assertEqualInt(0, archive_read_open_memory(a, buff, used));
+
+ assertEqualInt(0, archive_read_next_header(a, &entry));
+ assertEqualString(filename, archive_entry_pathname(entry));
+ assertEqualString(filename, archive_entry_gname(entry));
+ assertEqualString(filename, archive_entry_uname(entry));
+ assertEqualString(filename, archive_entry_hardlink(entry));
+
+ assertEqualInt(0, archive_read_next_header(a, &entry));
+ assertEqualString(filename, archive_entry_pathname(entry));
+ assertEqualString(filename, archive_entry_gname(entry));
+ assertEqualString(filename, archive_entry_uname(entry));
+ assertEqualString(filename, archive_entry_symlink(entry));
+
+ assertEqualInt(0, archive_read_next_header(a, &entry));
+ assertEqualString(longname, archive_entry_pathname(entry));
+
+ assertEqualInt(0, archive_read_close(a));
+ assertEqualInt(0, archive_read_finish(a));
+}
+
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c
index c6eb8312165..1d80ef96a6a 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_cpio_odc.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_odc.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_odc.c,v 1.2 2008/01/01 22:28:04 kientzle Exp $");
static unsigned char archive[] = {
'0','7','0','7','0','7','0','0','2','0','2','5','0','7','4','6','6','1','0',
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c
index 60ad5ba64cd..ef3c5d25d30 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_gtar_sparse.c,v 1.6 2007/08/18 21:53:25 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_gtar_sparse.c,v 1.7 2008/01/01 22:28:04 kientzle Exp $");
struct contents {
@@ -171,570 +171,6 @@ struct archive_contents {
{ NULL, NULL }
};
-
-/* Old GNU tar sparse format, as created by gtar 1.13 */
-static unsigned char archive_old_gtar_1_13[] = {
-31,139,8,0,30,'%',193,'F',0,3,237,215,'K','n',219,'H',20,133,'a',246,'N',
-180,129,6,170,'n',189,22,210,'+',208,' ',131,12,146,14,',','g',255,'}',201,
-192,142,17,29,'(','A',159,24,'l',160,255,207,3,219,'e',193,186,'$',127,241,
-'q',251,'r','}',186,'}',216,222,'U',169,165,204,222,183,'R','J',']',163,188,
-253,190,139,252,'u',171,'e',206,18,17,189,205,'m','_',')',177,']',254,'z',
-223,177,190,249,'z','{',190,'>',']','.',219,243,199,'O',15,'_',247,179,191,
-255,'k',251,'.','h',179,231,'>','z',221,'#',175,'?',231,'^',10,177,'^',219,
-':',188,172,239,'K',15,223,160,246,'o',175,250,253,211,'_',127,255,191,196,
-255,8,253,0,231,185,29,215,255,'x',215,247,'x','x',253,175,'=',218,221,245,
-'?','j',31,'\\',255,31,'\\',255,'[','o','j','}','E',233,'?',174,255,'Q',202,
-'X','u',212,213,212,'M',194,'~',167,213,'J',31,226,191,197,'\\','e',138,245,
-22,163,'/',181,158,27,161,182,162,'G',12,181,21,'}',214,170,182,'"','G',29,
-'w','[',177,175,143,'Y',213,156,'3','c','Q','s',206,209,170,154,'s',213,':',
-139,'Z',207,157,'-',230,220,227,157,'b',206,154,'{','-',196,156,185,15,218,
-20,'s',214,',','=',196,156,'5',223,'s',138,'9','k',180,213,196,156,'5','V',
-30,'O',177,190,'G',161,230,'l','+',214,'}',21,175,199,191,246,'V',155,154,
-183,207,181,212,188,'#','f','S',243,142,'c',171,239,215,'g','4','U','w',157,
-'3','T',221,'G',196,'j',191,230,'f',23,'1','g',228,';','w','1','g',148,172,
-'H',204,25,181,198,16,'s','F','~','F','T',191,217,196,'R',253,230,185,'j',
-170,'~',143,143,147,154,'3',15,'O','U','s',246,220,0,'5','g',238,132,'P',
-'s',246,'5',167,154,'s',180,161,250,141,177,218,'}',191,223,143,127,30,205,
-'P',29,31,31,127,'5',239,218,191,212,250,'<','6',227,199,245,150,19,'7','1',
-'o','+','3',255,145,'X',175,'Q','U',199,'-',247,210,'}',199,251,233,168,'N',
-213,239,'q',154,18,'s',182,204,189,171,'9','s',247,21,'5','g',198,219,213,
-156,'=',207,130,'j',206,145,225,169,'9',247,'U','5','g','^',247,'T',191,'/',
-167,211,251,245,181,134,154,'3',15,'s','U','s',230,'^',27,15,142,127,223,
-247,136,152,'7','?','<','U','u',220,'3','z',213,'q',207,15,180,234,248,'8',
-253,139,'y','{',134,'7',197,188,'=','s',12,177,'_',243,206,' ',239,'"',196,
-'z',207,'3',134,154,'3','?',133,170,223,'>',242,'D',172,230,28,'#','T',191,
-199,'e','J',205,'9','3','/','5','g','~','l',154,154,'s','e','0','b',206,177,
-167,'\'',230,28,185,'G','U',191,251,177,'W',253,142,'<',209,171,'~',143,203,
-233,131,227,'?',242,196,'t',127,215,176,175,175,'P',247,5,'#','s','Q',247,
-5,'#',195,'T',247,5,'#',15,180,234,'8','O',218,']','u',156,135,161,169,142,
-143,203,191,154,'s',238,'W',0,181,190,127,137,245,227,'f',232,205,'z',145,
-'7','F',248,'%','<',191,195,'A','?','p',208,15,28,244,3,7,253,192,'A','?',
-'p',184,253,208,31,28,244,3,7,253,192,'A','?','p',208,15,28,244,3,7,253,192,
-193,243,'?',206,'D','?','p',208,15,28,244,3,7,253,192,'A','?','p',208,15,
-28,'<',255,227,'L',244,3,7,253,192,'A','?','p',208,15,28,244,3,7,253,192,
-193,243,'?',206,'D','?','p',208,15,28,244,3,7,253,192,'A','?','p',208,15,
-28,'<',255,227,'L',244,3,7,253,192,'A','?','p',208,15,28,244,3,7,253,192,
-193,243,'?',206,'D','?','p',208,15,28,244,3,7,253,192,'A','?','p',208,15,
-28,'<',255,227,'L',244,3,7,253,192,'A','?','p',208,15,28,244,3,7,253,192,
-193,243,'?',206,'D','?','p',208,15,28,244,3,7,253,192,'A','?','p',208,15,
-28,'<',255,227,'L',244,3,7,253,192,'A','?','p',208,15,28,244,3,7,253,192,
-193,243,'?',206,'D','?','p',208,15,28,244,3,7,253,192,'A','?','p',208,15,
-28,'<',255,227,'L',244,3,7,253,192,'A','?','p',208,15,28,244,3,7,253,192,
-193,243,'?',206,'D','?','p',208,15,28,244,227,249,252,247,231,'?','o','_',
-174,'O',183,15,239,247,30,165,150,'2','{',223,'J',')','u',141,242,246,251,
-139,173,150,'9','K','D',244,'6',243,245,'5',127,218,'.',229,253,'F',250,238,
-235,237,249,250,'t',185,'l',207,31,'?','=','|',221,207,254,14,0,0,0,0,0,0,
-0,255,'1',255,0,178,'s',140,'2',0,240,0,0};
-
-
-#if ARCHIVE_VERSION_STAMP >= 1009000
-/* libarchive < 1.9 does not support this. */
-/* GNU tar "posix" sparse format 0.0, as created by gtar 1.17 */
-static unsigned char archive_0_0_gtar_1_17[] = {
-31,139,8,0,31,'%',193,'F',0,3,237,217,207,'n',218,'X',20,199,'q',214,'<',
-5,'/','0',228,222,'s','}',255,'x',193,'z',186,26,'u',211,7,240,164,174,20,
-205,'$',169,'0',145,'2',243,244,'5','%',205,144,200,193,'p',14,141,203,232,
-251,217,'P','A',14,'8','9',191,'[',253,',',150,'W',31,155,199,15,'m',243,
-185,']','w',203,232,156,148,171,238,'k',179,238,218,217,249,184,'^',170,170,
-237,163,207,209,237,'?','~','W','9',153,'y',151,146,19,145,'*',228,153,243,
-161,'J','2','[','<',158,241,26,222,244,208,'m',154,'u',127,')',214,247,'y',
-250,']',158,31,'/',132,228,197,239,127,'|','Z',238,'v',190,236,'n',254,'m',
-'W',193,'W','1','K',153,'K',218,127,233,238,225,246,207,191,239,175,255,234,
-'V','a','.','e',255,149,251,'/','_',186,'v',179,170,'{','!',205,'_',190,225,
-'v',234,159,'M',219,173,162,151,185,212,3,'c',190,31,'+','Y','N',158,'{',
-190,202,'8','8',231,230,226,22,205,230,230,182,']','y','_',178,'K',193,'e',
-191,'}',238,250,229,'s','n','>',245,6,166,'u',246,195,'>','`',228,252,203,
-246,184,252,'w',254,'S',127,254,'}',14,'a',182,'x',151,'C',244,227,252,247,
-177,'8',248,'s','c',175,'_',232,249,183,'j',166,190,0,'\\','4',242,'3',173,
-229,'[',253,'O',206,247,25,135,255,255,247,193,247,157,239,'U',255,139,'1',
-210,255,222,195,203,'*',247,189,255,213,245,'n','/',3,149,'l','W',0,235,250,
-151,'h',128,178,157,'s',229,244,230,216,207,229,170,':','y',174,234,231,'R',
-'q','\'',207,197,237,156,'?',253,239,146,250,185,24,'O',255,187,148,']',2,
-'O',159,'S',238,175,30,223,'_','p','C','{','w',227,11,28,30,244,227,27,28,
-30,148,241,21,14,15,134,241,29,14,15,'V',227,'K',28,30,'L',227,'[','|','c',
-'p','|',141,195,131,'Y',187,199,162,221,'c',173,220,163,'8',229,30,197,'+',
-247,'(',162,220,163,'T',202,'=','J',165,220,163,'D',229,30,'%',')',247,'(',
-'Y',187,199,162,221,'c',173,220,'c','p',202,'=',6,'Q',238,'1',136,'r',143,
-'!','(',247,24,'*',229,30,'C','T',238,'1','$',229,30,'C',214,238,177,'(',
-247,248,'t',28,'O',191,212,202,')',247,'X',29,209,'o',134,7,143,'(','8',195,
-131,'G','4',156,225,193,'#','*',206,240,224,17,29,'g','x',240,136,146,'3',
-'<','x','D',203,'y','c','P',187,'G','m',207,137,218,158,19,181,'=','\'','j',
-'{','N',212,246,156,168,237,'9','Q',219,'s',162,182,231,'D','m',207,137,218,
-158,19,181,'=','\'','i','{','N',210,246,156,164,237,'9','I',219,'s',146,182,
-231,'$','m',207,'I',218,158,147,180,'=','\'','i','{','N',210,246,156,172,
-237,'9','Y',219,'s',178,182,231,'d','m',207,201,218,158,147,181,'=','\'',
-'k','{','N',214,246,156,172,237,'9','E',219,'s',138,182,231,20,'m',207,')',
-218,158,'S',180,'=',167,'h','{','N',209,246,156,162,237,'9','E',219,'s',138,
-182,231,20,'m',207,169,181,'=',167,214,246,156,'Z',219,'s','j','m',207,169,
-181,'=',167,214,246,156,'Z',219,'s','j','m',207,169,'G','z',142,175,3,'_',
-174,255,'_',236,150,'{',198,'/','{',6,28,252,254,199,'W',18,156,127,245,253,
-191,'8','I','|',255,127,9,248,254,22,22,228,7,22,228,7,22,228,7,22,228,7,
-22,228,7,22,214,252,144,'?','X',144,31,'X',144,31,'X',144,31,'X',144,31,'X',
-144,31,'X',144,31,'X','p',255,143,')',145,31,'X',144,31,'X',144,31,'X',144,
-31,'X',144,31,'X',144,31,'X','p',255,143,')',145,31,'X',144,31,'X',144,31,
-'X',144,31,'X',144,31,'X',144,31,'X','p',255,143,')',145,31,'X',144,31,'X',
-144,31,'X',144,31,'X',144,31,'X',144,31,'X','p',255,143,')',145,31,'X',144,
-31,'X',144,31,'X',144,31,'X',144,31,'X',144,31,'X','p',255,143,')',145,31,
-'X',144,31,'X',144,31,'X',144,31,'X',144,31,'X',144,31,'X','p',255,143,')',
-145,31,'X',144,31,'X',144,31,'X',144,31,'X',144,31,'X',144,31,'X','p',255,
-143,')',145,31,'X',144,31,'X',144,31,'X',144,31,'X',144,31,'X',144,31,'X',
-'p',255,143,')',145,31,'X',144,31,'X',144,31,'X',144,31,'X',144,31,'X',144,
-31,'X','p',255,143,')',145,31,'X',144,31,'X',144,31,'X',144,31,'X',144,31,
-'X',144,31,'X','p',255,143,')',145,31,'X',144,31,'X',144,31,'X',144,31,'X',
-144,31,'X',144,31,'X','p',255,143,')',145,31,'X',144,31,'X',144,31,155,229,
-213,199,230,241,'C',219,'|','n',215,221,'2',':','\'',229,234,238,254,238,
-183,238,'k',179,238,218,'3','}',134,235,165,170,218,'>',250,28,221,254,227,
-'N',255,'o',239,'R','r','"','R',133,'<','s',190,146,232,'g',139,199,'3','}',
-254,'A',15,221,166,'Y',247,151,'b','}',159,167,'_',229,249,241,'B',136,'[',
-'4',155,155,219,'v',229,'}',201,'.',5,151,221,188,127,238,250,245,'s','S',
-'_','\'','~',142,179,31,246,1,163,231,223,237,159,255,212,159,127,137,210,
-159,255,'w','9','D','?',206,127,31,248,131,'?','7',246,250,133,158,127,0,
-0,0,0,0,0,0,0,0,0,0,0,0,192,'e',250,6,'X',180,13,'8',0,24,1,0};
-#endif
-
-#if ARCHIVE_VERSION_STAMP >= 1009000
-/* libarchive < 1.9 does not support this. */
-/* GNU tar "posix" sparse format 0.1, as created by gtar 1.17 */
-static unsigned char archive_0_1_gtar_1_17[] = {
-31,139,8,0,31,'%',193,'F',0,3,237,215,205,'n',26,'W',24,135,'q',214,'\\',
-5,23,224,194,249,'>','3',11,182,'m','V','U',164,170,23,'0','u','f','a','%',
-'v',',',198,150,172,'^','}',135,15,'\'',127,187,9,'T','z',137,167,'D',207,
-'o',195,4,'l','^','0',207,'!',231,',','W',239,187,167,'w','}',247,161,223,
-12,203,236,'\\',244,171,225,190,219,12,253,236,'|',220,168,164,180,189,245,
-'5',';',189,221,9,'9',204,188,'+',197,133,16,'R',172,'3',231,'c',202,'u',
-182,'x',':',227,'k',248,174,199,225,161,219,140,'/',197,250,'<',135,247,242,
-229,246,'B',132,186,248,237,247,'?',151,251,207,'|','9',220,252,221,175,163,
-31,255,250,161,153,135,162,15,221,'=',222,254,245,233,243,245,199,'a',29,
-'_','?',210,221,246,235,253,245,'<','{','}',228,182,187,'_',183,163,'X',174,
-178,15,'W','~',188,'l','j',216,']',31,134,'\\',185,'y','p',139,238,225,'f',
-'|',10,239,155,234,'J','t',213,'o',239,187,'~','y',159,155,'O',253,151,250,
-'9','-','W',227,231,245,199,238,227,250,245,230,'S',255,'C',190,2,'N',172,
-255,176,']','.','_',215,127,25,215,127,246,169,204,22,'o',178,136,158,215,
-255,152,219,209,159,';',245,248,133,174,127,171,'n',234,23,128,139,'F','?',
-211,'Z','~','o',255,23,206,'7',227,212,247,127,241,178,255,'K','n',187,255,
-203,'1',179,255,'{',11,161,249,215,254,175,'m','w',239,'`',220,133,213,'o',
-'o',0,219,246,245,'C','_','w',128,'a',238,'C','[',254,227,'&','0','l',175,
-']',179,223,16,142,215,'5',165,221,'u',26,175,'K',227,'v',215,'y','{',237,
-247,191,'[',198,235,156,247,191,219,236,255,206,251,'k','y',254,'V',158,223,
-';',25,224,189,'L',240,'A','F',248,'(','3','|',146,'!',190,200,20,'_',244,
-'m','T',157,211,232,156,'V',230,4,'\'','s',130,151,'9','!',200,156,144,'d',
-'N','H','2','\'','d',253,'{',21,153,19,170,206,'i','t','N','+','s',162,147,
-'9','1',200,156,24,'d','N',140,186,'9','O',250,193,'d',153,19,139,204,137,
-'U',231,'4','2',231,240,'v',220,225,31,'2','\'',233,231,159,'4',128,244,162,
-0,'M',' ','i',3,'I','#','H','Z','A',210,12,146,'v',144,181,131,172,29,'d',
-237,' ','k',7,'Y',';',200,218,'A',214,14,178,'v',144,181,131,172,29,20,237,
-160,'h',7,'E',';','(',218,'A',209,14,138,'v','P',180,131,162,29,20,237,160,
-'h',7,'U',';',168,218,'A',213,14,170,'v','P',181,131,170,29,'T',237,160,'j',
-7,'U',';','h',180,131,'F',';','h',180,131,'F',';','h',180,131,'F',';','h',
-180,131,230,197,151,193,139,'o',3,237,160,209,14,'Z',237,160,213,14,'Z',237,
-160,213,14,'Z',237,160,213,14,'Z',237,160,213,14,218,231,14,'|',27,255,231,
-231,219,'c',231,191,'s','m',1,142,254,255,239,'S',136,206,191,'>',255,133,
-228,'9',255,']',2,246,239,176,160,31,'X',208,15,',',232,7,22,244,3,11,250,
-129,133,181,31,250,131,5,253,192,130,'~','`','A','?',176,160,31,'X',208,15,
-',',232,7,22,156,255,'1','%',250,129,5,253,192,130,'~','`','A','?',176,160,
-31,'X',208,15,',','8',255,'c','J',244,3,11,250,129,5,253,192,130,'~','`',
-'A','?',176,160,31,'X','p',254,199,148,232,7,22,244,3,11,250,129,5,253,192,
-130,'~','`','A','?',176,224,252,143,')',209,15,',',232,7,22,244,3,11,250,
-129,5,253,192,130,'~','`',193,249,31,'S',162,31,'X',208,15,',',232,7,22,244,
-3,11,250,129,5,253,192,130,243,'?',166,'D','?',176,160,31,'X',208,15,',',
-232,7,22,244,3,11,250,129,5,231,127,'L',137,'~','`','A','?',176,160,31,'X',
-208,15,',',232,7,22,244,3,11,206,255,152,18,253,192,130,'~','`','A','?',176,
-160,31,'X',208,15,',',232,7,22,156,255,'1','%',250,129,5,253,192,130,'~',
-'`','A','?',176,160,31,'X',208,15,',','8',255,'c','J',244,3,11,250,129,5,
-253,192,130,'~','`','A','?',176,160,31,'X','p',254,199,148,232,7,22,244,3,
-11,250,177,'Y',174,222,'w','O',239,250,238,'C',191,25,150,217,185,232,'W',
-'w',159,239,'~',25,238,187,205,208,159,'i',134,27,149,148,182,183,190,'f',
-167,183,'{',227,181,'w',165,184,16,'B','J',227,253,'>',133,152,'g',139,167,
-'3',205,'?',234,'q','x',232,'6',227,'K',177,'>',207,225,173,'|',185,189,16,
-193,'-',186,135,155,219,'~',237,'}','S',']',137,174,186,249,'x',223,245,235,
-251,166,'~',157,248,'1',206,190,216,191,225,228,250,'w',178,254,'c',25,215,
-127,200,193,207,22,'o',178,136,158,215,255,24,252,209,159,';',245,248,133,
-174,127,0,0,0,0,0,240,243,251,7,233,'Q','N','O',0,240,0,0};
-#endif
-
-#if ARCHIVE_VERSION_STAMP >= 1009000
-/* libarchive < 1.9 does not support this. */
-/* GNU tar "posix" sparse format 1.0, as created by gtar 1.17 */
-static unsigned char archive_1_0_gtar_1_17[] = {
-31,139,8,0,' ','%',193,'F',0,3,237,215,205,'n',26,'I',20,134,'a',214,'\\',
-5,'7',16,168,255,234,'^','x',155,'d',21,'E',138,230,2,'Z','I','/',24,197,
-'N',4,142,'d',205,213,'O',1,182,245,217,178,'A',163,'C',220,131,242,'>',155,
-'n',183,'m',14,'?','o',161,174,229,234,243,'p',247,'q',28,190,141,155,237,
-'2',';',23,211,'j',251,'s',216,'l',199,217,249,184,166,164,180,';',250,154,
-157,30,247,130,207,'3',239,'J','q','!',132,148,218,'u',31,'S',142,179,197,
-221,25,159,195,171,'~','m','o',135,'M','{','*',214,199,185,127,'-',143,199,
-11,17,194,226,195,167,191,150,135,207,'|','y','=',252,253,'c','s',229,231,
-207,174,174,'o',218,'U','7',15,'E',175,222,12,215,227,213,225,'|',30,189,
-254,'f','3',14,223,183,235,127,198,171,232,'S',174,161,155,7,183,24,'n',215,
-237,207,189,239,170,'+',209,'U',191,187,246,245,233,'5','7',159,250,205,248,
-3,'-','W',237,131,251,178,255,220,222,175,191,143,191,229,'+',224,196,250,
-143,187,229,242,184,254,'c','i',235,'?',251,28,'f',139,'7','Y','D',15,235,
-191,181,'x',244,239,'N',253,254,'B',215,127,156,247,'M',',',243,236,195,220,
-183,211,174,134,253,249,195,218,'e','U',226,136,'a',234,'\'',128,139,'F',
-'?',211,'Z',190,'v',255,31,206,'7',227,244,253,127,'}','~',255,159,'c',229,
-254,255,'-',252,167,251,255,250,202,253,127,187,'[',8,'/','n',0,250,'~',255,
-'f',248,23,'v',0,129,29,192,255,193,177,251,255,'s','}',5,28,']',255,237,
-'6','3',':',255,252,254,'?',164,202,253,255,'[',232,251,215,'6',0,'a','w',
-238,186,195,'f',160,157,215,148,246,231,169,157,151,206,237,207,243,238,220,
-31,254,183,180,243,156,15,255,219,29,222,132,195,185,'<','~','/',143,239,
-157,12,240,'^','&',248,' ','#','|',148,25,'>',201,16,'_','d',138,'/',250,
-'2',170,206,233,'t','N','/','s',130,147,'9',193,203,156,16,'d','N','H','2',
-'\'','$',153,19,178,190,'_','E',230,132,170,'s',':',157,211,203,156,232,'d',
-'N',12,'2','\'',6,153,19,163,'n',204,146,'~','0','Y',230,196,'"','s','b',
-213,'9',157,204,185,127,'9',238,254,7,153,147,244,243,'O',26,'@','z','R',
-128,'&',144,180,129,164,17,'$',173,' ','i',6,'I',';',200,218,'A',214,14,178,
-'v',144,181,131,172,29,'d',237,' ','k',7,'Y',';',200,218,'A',214,14,138,'v',
-'P',180,131,162,29,20,237,160,'h',7,'E',';','(',218,'A',209,14,138,'v','P',
-180,131,170,29,'T',237,160,'j',7,'U',';',168,218,'A',213,14,170,'v','P',181,
-131,170,29,'t',218,'A',167,29,'t',218,'A',167,29,'t',218,'A',167,29,'t',218,
-'A',247,228,203,224,201,183,129,'v',208,'i',7,189,'v',208,'k',7,189,'v',208,
-'k',7,189,'v',208,'k',7,189,'v',208,'k',7,253,'C',7,190,143,220,'o','X',177,
-127,131,5,253,192,130,'~','`','A','?',176,160,31,'X',208,15,',',172,253,208,
-31,',',232,7,22,244,3,11,250,129,5,253,192,130,'~','`','A','?',176,'`',255,
-143,')',209,15,',',232,7,22,244,3,11,250,129,5,253,192,130,'~','`',193,254,
-31,'S',162,31,'X',208,15,',',232,7,22,244,3,11,250,129,5,253,192,130,253,
-'?',166,'D','?',176,160,31,'X',208,15,',',232,7,22,244,3,11,250,129,5,251,
-127,'L',137,'~','`','A','?',176,160,31,'X',208,15,',',232,7,22,244,3,11,246,
-255,152,18,253,192,130,'~','`','A','?',176,160,31,'X',208,15,',',232,7,22,
-236,255,'1','%',250,129,5,253,192,130,'~','`','A','?',176,160,31,'X',208,
-15,',',216,255,'c','J',244,3,11,250,129,5,253,192,130,'~','`','A','?',176,
-160,31,'X',176,255,199,148,232,7,22,244,3,11,250,129,5,253,192,130,'~','`',
-'A','?',176,'`',255,143,')',209,15,',',232,7,22,244,3,11,250,129,5,253,192,
-130,'~','`',193,254,31,'S',162,31,'X',208,15,',',232,7,22,244,3,11,250,129,
-5,253,192,130,253,'?',166,'D','?',176,160,31,'X',208,143,205,'r',245,'y',
-184,251,'8',14,223,198,205,'v',153,157,139,'i','u',243,227,230,221,246,231,
-176,217,142,'g',154,225,154,146,210,238,232,'k','v','z','<','h',231,222,149,
-226,'B',8,')',181,235,'>',133,'v','X',220,157,'i',254,'Q',191,182,183,195,
-166,'=',21,235,227,220,191,148,199,227,133,8,'n','1',220,174,175,199,'+',
-239,187,234,'J','t',213,205,219,181,175,207,175,'M',253,'<',241,'{',156,'}',
-177,191,224,228,250,'w',178,254,'c','i',235,'?',228,224,'g',139,'7','Y','D',
-15,235,191,5,127,244,239,'N',253,254,'B',215,'?',0,0,0,128,'?',199,191,200,
-'e','(',171,0,240,0,0};
-#endif
-
-
-/*
- * The following test archive is a little odd. First, it's uncompressed,
- * because that exercises some of the block reassembly code a little harder.
- * Second, it includes some leading comments prior to the sparse block
- * description. GNU tar doesn't do this, but I think it should, so I
- * want to ensure that libarchive correctly ignores such comments.
- */
-#if ARCHIVE_VERSION_STAMP >= 1009000
-
-/* Because it's uncompressed, I've made this archive a bit simpler. */
-struct archive_contents files_1_0b[] = {
- { "sparse", archive_contents_sparse },
- { "non-sparse", archive_contents_nonsparse },
- { NULL, NULL }
-};
-
-static unsigned char archive_1_0b[] = {
-'.','/','P','a','x','H','e','a','d','e','r','s','.','7','5','4','7','/','s',
-'p','a','r','s','e',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,'0','0','0','0','6','4','4',0,'0','0','0','1','7',
-'5','0',0,'0','0','0','1','7','5','0',0,'0','0','0','0','0','0','0','0','2',
-'1','5',0,'1','0','6','5','7','4','5','4','6','1','3',0,'0','1','3','4','2',
-'5',0,' ','x',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s',
-'t','a','r',0,'0','0',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,'0','0','0','0','0','0','0',0,'0','0','0','0','0','0','0',0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,'2','2',' ','G','N','U','.','s','p','a','r','s',
-'e','.','m','a','j','o','r','=','1',10,'2','2',' ','G','N','U','.','s','p',
-'a','r','s','e','.','m','i','n','o','r','=','0',10,'2','6',' ','G','N','U',
-'.','s','p','a','r','s','e','.','n','a','m','e','=','s','p','a','r','s','e',
-10,'3','1',' ','G','N','U','.','s','p','a','r','s','e','.','r','e','a','l',
-'s','i','z','e','=','3','1','4','5','7','2','8',10,'2','0',' ','a','t','i',
-'m','e','=','1','1','8','6','8','7','9','7','9','9',10,'2','0',' ','c','t',
-'i','m','e','=','1','1','8','6','8','7','9','5','2','8',10,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'.','/','G',
-'N','U','S','p','a','r','s','e','F','i','l','e','.','7','5','4','7','/','s',
-'p','a','r','s','e',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,'0','0','0','0','6','4','4',0,'0','0','0','1','7','5','0',
-0,'0','0','0','1','7','5','0',0,'0','0','0','0','0','0','0','3','0','0','0',
-0,'1','0','6','5','7','4','5','4','0','5','0',0,'0','1','5','1','1','2',0,
-' ','0',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a',
-'r',0,'0','0','t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,'0','0','0','0','0','0','0',0,'0','0','0','0','0','0','0',0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-
-/* 32 added bytes containing extra comments at beginning of sparse block */
-'#','!','g','n','u','-','s','p','a','r','s','e','-','f','o','r','m','a',
-'t',10,'#','f','o','r','m','a','t',':','1','.','0',10,
-
-'3',10,'9','9','9','9','3','6',10,'5','1','2',
-10,'1','9','9','9','8','7','2',10,'5','1','2',10,'3','1','4','5','7','2',
-'8',10,'0',10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-
-/* 32 removed bytes to preserve alignment. */
-/* 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, */
-0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'a',0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'a',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'.','/','P','a',
-'x','H','e','a','d','e','r','s','.','7','5','4','7','/','n','o','n','-','s',
-'p','a','r','s','e',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,'0','0','0','0','6','4','4',0,'0','0','0','1','7','5','0',
-0,'0','0','0','1','7','5','0',0,'0','0','0','0','0','0','0','0','0','5','0',
-0,'1','0','6','5','7','4','5','4','6','1','3',0,'0','1','4','2','1','2',0,
-' ','x',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a',
-'r',0,'0','0',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0',
-'0','0','0','0','0',0,'0','0','0','0','0','0','0',0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,'2','0',' ','a','t','i','m','e','=','1','1','8','6','8','7',
-'9','7','9','9',10,'2','0',' ','c','t','i','m','e','=','1','1','8','6','8',
-'7','9','5','4','4',10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,'n','o','n','-','s','p','a','r','s','e',0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,'0','0','0','0','6','4','4',0,'0','0','0','1','7','5','0',0,'0','0','0',
-'1','7','5','0',0,'0','0','0','0','0','0','0','0','0','0','1',0,'1','0','6',
-'5','7','4','5','4','0','7','0',0,'0','1','2','5','3','1',0,' ','0',0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a','r',0,'0','0',
-'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'t',
-'i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0',
-'0','0','0','0','0',0,'0','0','0','0','0','0','0',0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,'a',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
-#endif
-
/*
* A tricky piece of code that verifies the contents of a sparse
* archive entry against a description as defined at the top of this
@@ -742,29 +178,25 @@ static unsigned char archive_1_0b[] = {
*/
#define min(a,b) ((a) < (b) ? (a) : (b))
-/*
- * A convenience wrapper that adds the size of the buffer and the
- * name of the buffer to any call.
- */
-#define verify_archive(buffer, contents) \
- _verify_archive(buffer, sizeof(buffer), #buffer, contents)
-
static void
-_verify_archive(void *buffer, size_t length, const char *name,
- struct archive_contents *ac)
+verify_archive_file(const char *name, struct archive_contents *ac)
{
+ char path[512];
struct archive_entry *ae;
- struct archive *a;
int err;
/* data, size, offset of next expected block. */
struct contents expect;
/* data, size, offset of block read from archive. */
struct contents actual;
+ struct archive *a;
+
+ sprintf(path, "%s/%s", refdir, name);
assert((a = archive_read_new()) != NULL);
assert(0 == archive_read_support_compression_all(a));
assert(0 == archive_read_support_format_tar(a));
- assert(0 == read_open_memory(a, buffer, length, 3));
+ failure("Can't open %s", path);
+ assert(0 == archive_read_open_filename(a, path, 3));
while (ac->filename != NULL) {
struct contents *cts = ac->contents;
@@ -839,35 +271,51 @@ _verify_archive(void *buffer, size_t length, const char *name,
#endif
}
+
DEFINE_TEST(test_read_format_gtar_sparse)
{
- /*
- FILE *t = fopen("archive_1_0.tgz", "w");
- fwrite(archive_1_0, sizeof(archive_1_0), 1, t);
- fclose(t);
- */
-
- verify_archive(archive_old_gtar_1_13, files);
+ /* Two archives that use the "GNU tar sparse format". */
+ verify_archive_file("test_read_format_gtar_sparse_1_13.tgz", files);
+ verify_archive_file("test_read_format_gtar_sparse_1_17.tgz", files);
/*
- * libarchive < 1.9 doesn't support the newer sparse formats
- * from GNU tar 1.15 and 1.16.
+ * libarchive < 1.9 doesn't support the newer --posix sparse formats
+ * from GNU tar 1.15 and later.
*/
#if ARCHIVE_VERSION_STAMP < 1009000
- skipping("read support for GNUtar sparse format 0.0");
-#else
- verify_archive(archive_0_0_gtar_1_17, files);
-#endif
-#if ARCHIVE_VERSION_STAMP < 1009000
- skipping("read support for GNUtar sparse format 0.1");
+ skipping("read support for GNUtar --posix sparse formats");
#else
- verify_archive(archive_0_1_gtar_1_17, files);
-#endif
-#if ARCHIVE_VERSION_STAMP < 1009000
- skipping("read support for GNUtar sparse format 1.0");
-#else
- verify_archive(archive_1_0_gtar_1_17, files);
- verify_archive(archive_1_0b, files_1_0b);
+ /*
+ * An archive created by GNU tar 1.17 using --posix --sparse-format=0.1
+ */
+ verify_archive_file(
+ "test_read_format_gtar_sparse_1_17_posix00.tgz",
+ files);
+ /*
+ * An archive created by GNU tar 1.17 using --posix --sparse-format=0.1
+ */
+ verify_archive_file(
+ "test_read_format_gtar_sparse_1_17_posix01.tgz",
+ files);
+ /*
+ * An archive created by GNU tar 1.17 using --posix --sparse-format=1.0
+ */
+ verify_archive_file(
+ "test_read_format_gtar_sparse_1_17_posix10.tgz",
+ files);
+ /*
+ * The last test archive here is a little odd. First, it's
+ * uncompressed, because that exercises some of the block
+ * reassembly code a little harder. Second, it includes some
+ * leading comments prior to the sparse block description.
+ * GNU tar doesn't do this, but I think it should, so I want
+ * to ensure that libarchive correctly ignores such comments.
+ * Dump the file, looking for "#!gnu-sparse-format" starting
+ * at byte 0x600.
+ */
+ verify_archive_file(
+ "test_read_format_gtar_sparse_1_17_posix10_modified.tar",
+ files);
#endif
}
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu
new file mode 100644
index 00000000000..a298e59fa08
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu
@@ -0,0 +1,26 @@
+begin 644 test_read_format_gtar_sparse_1_13.tgz
+M'XL(`&&";$<``^W72VX;1Q2%X<Y.N($`=>NYD*Q``P\\L&.(\OYSNP/)LGE`
+M!SDF.D#^SP,G94&\7?VS']<O3\_7#]M#E2AE]KZ54F*-\O[O7<W_W:*LUJ)$
+M]%R/M>;:+G\\=JR_?;V^/#U?+MO+QT]W?^YG__ZO[5O09L\]>MN1M__.7:IB
+M/=HZO*[O2W<_('?U\.NG?_KUOQ+_(_0#G.=ZW/_K0S_C[OT_>FW?W?]C*[5&
+M:]S_[]S_6V]J?=72?US_K92Q8L1JZB%A?_YJI0_QV^I<98KU5D=?:CT/0AU%
+MKW6HH^@S0AU%CCINCF)?'S/4G#/Z4'/.T4+-N2)F4>NYV6+./=XIYHS<M2KF
+MS#UH4\R9:=<JYHS\S"GFC-I6$W-&77D^Q?H>A9JSK;INJW@[_]%;-#5OG_D8
+M+M9'G4W-.XZCOEV?M:FZ8\ZJZCXB5ON:AUW$G#4_N8LY:\F*Q)PUH@XQ9\WO
+MB.HWFUBJWUHS8+'?Q]=)S9FG)]2</0]`S9F;4-6<?<VIYAQMJ'[K6.VVWV_G
+M/\]F51T?7W\U[]K_J/5Y',:/ZRTG;F+>5F;^(K$>^]5?K8]UV_%^.8JI^CTN
+M4V+.O,VTKN;,[2MJSHRWJSE[7@75G"/#4W/NJVK.F1LD]OGU<GJ[OM90<^9I
+M#C5G[MJX<_[[OB-BWOSRA.JX9_2JXYY?:-7Q<?D7\_8,;XIY>^98Q;[VW*BI
+MYNQYQ5!SYK=0]=M'7HC5G&-4U>]QFU)SSLQ+S9E?FZ;F7!F,F'/LZ8DY1^ZH
+MZG<_]ZK?D1=ZU>]Q.[US_D=>F&Z?&O;U5=5SP=B?T]2\&:9Z+AAYHE7'>='N
+MJN,\#4UU?-S^U9QSOP.H]?V/6#\>AMZM%_E@A'^$]W<XZ`<.^H&#?N"@'SCH
+M!PZW'_J#@W[@H!\XZ`<.^H&#?N"@'SAX_\>9Z`<.^H&#?N"@'SCH!P[Z@8/W
+M?YR)?N"@'SCH!P[Z@8-^X*`?.'C_QYGH!P[Z@8-^X*`?..@'#OJ!@_=_G(E^
+MX*`?..@'#OJ!@W[@H!\X>/_'F>@'#OJ!@W[@H!\XZ`<.^H&#]W^<B7[@H!\X
+MZ`<.^H&#?N"@'SAX_\>9Z`<.^H&#?N"@'SCH!P[Z@8/W?YR)?N"@'SCH!P[Z
+M@8-^X*`?.'C_QYGH!P[Z@8-^X*`?..@'#OJ!@_=_G(E^X*`?..@'#OJ!@W[@
+MH!\X>/_'F>@'#OJ!@WX\G__\_/OUR]/S]</C/J-$*;/WK902:Y3W?[_:HJS6
+MHD3TR)^/&F6[E,>-],W7Z\O3\^6RO7S\=/?G?O;O`````````/`?\Q>.)E`.
+$`/``````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu
new file mode 100644
index 00000000000..3f3127124a1
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu
@@ -0,0 +1,26 @@
+begin 644 test_read_format_gtar_sparse_1_17.tgz
+M'XL(`&&";$<``^W776X3611%83,33Z"E>^[O0'H$?N"!!V@4A_GWJ8*$".\V
+MK=Y8U1+KB\#H)L2G;BV77=?/EZ?K^]-#E31[WQYCC?+V<5/SSRG*:BU*1,_U
+M6"O:Z?SG8\?ZZLOU^?)T/I^>/WR\^W,_^_Y_MFU!FSVV7?BV(Z__SEVJ8CTW
+M:?>ROO_[WA.\_H=?[O+K?R5^(_1SK.M^_:\/?8Z[U__HM95X<_V/4ZDU6N7Z
+M_\_7_]9Z4^NKEO[C^KM2QHH1:]MF]>RY_WV(WU;G*E.LMSKZ4NMY$.HH>JU#
+M'46?$>HH<M1Q<Q3;^IBAYIS1AYISCA9JSA4QBUK/S19SYL.<8L[(7:MBSMR#
+M-L6<F7:M8L[(YYQBSJAM-3%GU)7G4ZQO4:@YVZKKMHK7\Q^]15/S]KF6FG?4
+MV=2\8S_JV_59FZH[YJRJ[CUBM:]YV$7,6?.9NYBSEJQ(S%DCZA!SUGR-J'ZS
+MB:7ZK34#%ON]OYS4G'EZ0LW9\P#4G+D)5<W9UYQJSM&&ZK>.U6[[_7[^\VQ6
+MU?'^\E?SKNU+K<_],'Y<;SEQ$_.V,O,7B?7(J[_8UY:[=-OQ=CF*J?K=+U-B
+MSGR;:5W-F=M7U)P9;U=S]KP*JCE'AJ?FW%;5G#,W2.SSR^7T=GVMH>;,TQQJ
+MSMRU<>?\]VU'Q+SYX@G5<<_H5<<]7]"JX_WR+^;M&=X4\_;,L8I][;E14\W9
+M\XJAYLQ7H>JWC[P0JSG'J*K?_6U*S3DS+S5GOFR:FG-E,&+.L:4GYARYHZK?
+M[=RK?D=>Z%6_^]OIG?,_\L)T^ZEA6U]5?2X8V^<T-6^&J3X7C#S1JN.\:'?5
+M<9Z&ICK>W_[5G'-[!U#KVY=8WS\,O5DO\H,1_A7NW^"@'SCH!P[Z@8-^X*`?
+M.-Q^Z`\.^H&#?N"@'SCH!P[Z@8-^X.#^'T>B'SCH!P[Z@8-^X*`?..@'#N[_
+M<23Z@8-^X*`?..@'#OJ!@W[@X/X?1Z(?..@'#OJ!@W[@H!\XZ`<.[O]Q)/J!
+M@W[@H!\XZ`<.^H&#?N#@_A]'HA\XZ`<.^H&#?N"@'SCH!P[N_W$D^H&#?N"@
+M'SCH!P[Z@8-^X.#^'T>B'SCH!P[Z@8-^X*`?..@'#N[_<23Z@8-^X*`?..@'
+M#OJ!@W[@X/X?1Z(?..@'#OJ!@W[@H!\XZ`<.[O]Q)/J!@W[@H!\XZ`<.^H&#
+M?N#@_A]'HA\XZ`<.^O%\^NO3']?/EZ?K^\<]1TFS]^TQUBAO'U^<HJS6HD3T
+M..7?M:S3N3QNI.^^7)\O3^?SZ?G#Q[L_][/O`P````````#P/_(W91GI)`#P
+"````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu
new file mode 100644
index 00000000000..41038960bc9
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu
@@ -0,0 +1,29 @@
+begin 644 test_read_format_gtar_sparse_1_17_posix00.tgz
+M'XL(`&*";$<``^W9S6[;1A2&8:UU%;Z!RO/#^5MHW:R*;'H!K,,`06L[$&7`
+M[=5W%#FN'(Q-Z1S5K-#W642!E&/3/M\$'\'5]<?^\</0?QHVX\KG&,KU^+7?
+MC,/B?$P5NV[W:E,PAZ_?=,8MK$G>6V-MYQ;&^BZ9Q=7C&:_A50_CMM_42]%^
+MG:>?Y?GU0KAT]?,OOZ[V.U^-7_X:UMYV(;F\=/'PH[N'V]_^N+_Y?5S[I<N'
+MG]Q__CP.VW6I?%R^_(*[J3^WP[@.UBU=:8S9.I:3.WGN^2I#<\XLG;GJMU]N
+MA[6U);MZ:<;NWKMY^9Y9SKV!>9W]L#=,G'^W.R[_G/_ZOK7)U?/_+H?H^_FO
+ML7CSWTU]?J'G7ZN?^P)PT<C/O%:O]3]WON_Q]O__UEN??NQ_(7KZWWMX6>6^
+M];]2]GMI5+)]`2SE/]$`W6[.Y-.;8YU+77?R7%?G8C8GSX7=G#W]]Q+K7`BG
+M_U[R/H&GSPGW5Z;WYTUK[V9Z@>U!.[W!]J";7F%[T$_OL#W832^Q/1BGM_C*
+MX/0:VX-)NL<LW6,1[M$9X1Z=%>[1.>$>72?<H^N$>W1!N$<7A7MT2;K'+-UC
+M$>[1&^$>O1/NT3OA'KT7[M%WPCWZ(-RCC\(]^B3=8Q;N\>DXGGZIG1'NL3NB
+MW[0'CR@X[<$C&DY[\(B*TQX\HN.T!X\H.>W!(UK.*X/2/4I[3I#VG"#M.4':
+M<X*TYP1ISPG2GA.D/2=(>TZ0]IP@[3E1VG.BM.=$:<^)TIX3I3TG2GM.E/:<
+M*.TY4=ISHK3G)&G/2=*>DZ0])TE[3I+VG"3M.4G:<Y*TYR1IS\G2GI.E/2=+
+M>TZ6]IPL[3E9VG.RM.=D:<_)TIZ3I3TG2WM.D?:<(NTY1=ISBK3G%&G/*=*>
+M4Z0]ITA[3IGH.;;XQL-UUWBX;O_G#]<OP'ZY9WS8T_#F\Q_;.6_LP?,?NS#6
+MU;=Y_G\)>'X+#?(##?(##?(##?(##?(##6U^R!\TR`\TR`\TR`\TR`\TR`\T
+MR`\TN/_'G,@/-,@/-,@/-,@/-,@/-,@/-+C_QYS(#S3(#S3(#S3(#S3(#S3(
+M#S2X_\><R`\TR`\TR`\TR`\TR`\TR`\TN/_'G,@/-,@/-,@/-,@/-,@/-,@/
+M-+C_QYS(#S3(#S3(#S3(#S3(#S3(#S2X_\><R`\TR`\TR`\TR`\TR`\TR`\T
+MN/_'G,@/-,@/-,@/-,@/-,@/-,@/-+C_QYS(#S3(#S3(#S3(#S3(#S3(#S2X
+M_\><R`\TR`\TR`\TR`\TR`\TR`\TN/_'G,@/-,@/-,@/-,@/-,@/-,@/-+C_
+MQYS(#S3(#S3(C\[J^F/_^&'H/PV;<>5S#.7Z[O[NI_%KOQF',WT/4\6NV[W:
+M%,SAZU[]NS7)>VNL[=S"U#]"6EP]GNG[O^EAW/:;>BG:K_/THSR_7@AGKOKM
+ME]MA;6W)KOAH[+*^=_/C>W-?)_X=9S_L#9/GWQR>?UO/OPNFGO]W.43?SW\-
+B_)O_;NKS"SW_`````````````````(#+]#?B%\M:`!@!````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu
new file mode 100644
index 00000000000..6d7963ed4f9
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu
@@ -0,0 +1,27 @@
+begin 644 test_read_format_gtar_sparse_1_17_posix01.tgz
+M'XL(`&*";$<``^W7WVX:1QB&<8ZY"B[`Q?/-OYT]X+3-416IZ@5L'0ZLQHX%
+MMF3UZKN`';]V&SO21[PB>GXG;,#F`_,,F5F>?QSN/ZR'3^O-=IE:K7:^O1DV
+MV_7L>,*HYKR[M:X$O=V+)<XL="E9,,MQ%BSEFF>+^R.^AF^ZV]X.F_&E>)_G
+MX;U\O3T1L5O\]ON?R\-GOMQ>_K->)<NEBVT>JSYT?7?UU^<O%W]O5^GE(\/5
+M>G6XGA?31ZZ&FU4_2O6L6#RS\;)U<7_],.0LS&-8#+>7XU.8]2V./QOB[KZ+
+MY_>%^=1_J9_3\GS\O/[8?UR_7GY>_Y"O@#?6?]PMEZ?U/]YOQ<:OA,6[+*+'
+M]3_F]NK/O?7XB:Y_KV'J%X"31C_36GYK_Q>/-^.M[_]JNO]+N_U?*<;^[SW$
+M]I_]7]_OWX'-G^\-GS:`??_RH:<=8)Q;[.MW;@+C[CJTPX9PO.YRWE_G\;JV
+ML+\NNVL[_&X=KTLY_&X[_)T/U_+\O3R_!1E@)A,LR@A+,L.R#+$J4ZSJV^AT
+M3M,YO<R)0>9$DSDQRIR894[,,B<6_7M5F1,[G=-T3B]S4I`Y*<J<%&5.2KHY
+MS_K!%)F3JLQ)G<YI,N?A[82'?\B<K)]_U@#RLP(T@:P-9(T@:P59,\C:0=$.
+MBG90M(.B'13MH&@'13LHVD'1#HIV4+6#JAU4[:!J!U4[J-I!U0ZJ=E"U@ZH=
+M=-I!IQUTVD&G'73:0:<==-I!IQUTVD'3#IIVT+2#IATT[:!I!TT[:,^^#)Y]
+M&V@'33OHM8->.^BU@UX[Z+6#7COHM8->.^@?.[`^?>?YUB8ZW[YV_CO6%N#5
+M__\MQQ1,_O^WW?DOYLKY[Q2P?X<'_<"#?N!!/_"@'WC0#SR\_=`?/.@''O0#
+M#_J!!_W`@W[@03_PX/R/*=$//.@''O0##_J!!_W`@W[@P?D?4Z(?>-`//.@'
+M'O0##_J!!_W`@_,_ID0_\*`?>-`//.@''O0##_J!!^=_3(E^X$$_\*`?>-`/
+M/.@''O0##\[_F!+]P(-^X$$_\*`?>-`//.@''IS_,27Z@0?]P(-^X$$_\*`?
+M>-`//#C_8TKT`P_Z@0?]P(-^X$$_\*`?>'#^QY3H!Q[T`P_Z@0?]P(-^X$$_
+M\.#\CRG1#SSH!Q[T`P_Z@0?]P(-^X,'Y'U.B'WC0#SSH!Q[T`P_Z@0?]P(/S
+M/Z9$/_"@'WC0C\_R_.-P_V$]?%IOMLO4:K7SZR_7OVQOALUV?:09851SWMU:
+M5X+>'HS7%KJ4+)CE-`N68['9XOY(\U]UM[T=-N-+\3[/PUOY>GLB8E@,MY=7
+MZY59WV*?:K#Y>-_%R_NF?IWX,8Z^V/_'F^L_Z/JW<?W'$KK9XET6T>/Z'X-_
+9]>?>>OQ$US\``````/CY_0O4#S!&`/``````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu
new file mode 100644
index 00000000000..c74c08fb3ed
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu
@@ -0,0 +1,27 @@
+begin 644 test_read_format_gtar_sparse_1_17_posix10.tgz
+M'XL(`&.";$<``^W7RV[;5A1&88WU%'J!RN=^&7B:9E0$*/H`1,*!B]@))`<P
+M\O2A)#O];=@RBJV8$+*^"1G*T=9E'8%G??%AN'L_#I_&S78=6RGQ8OMUV&S'
+MQ>FX24EI=_0U.SWN!9\7WM48O?,^Q87S,96R6-V=\#6\Z-OV=MA,+\7Z//?O
+MY>?Q3(2P^O.O?]:'[WQ]/?S[97/IET^N7MU,5]TR%+UZ,UR/EX?S9?3ZR&8<
+M/F^OOH^7T:=<0UL&MQINKZ8_][ZWT&-Q87?MX^-K;CGWA_$;6E],7]S?^^_M
+MW=7G\9?\!+RR_N-NN?RW_J?K/ON<%ZLW640/ZW]J\>C?O?;XF:[_N.R36);9
+MAZ6?3EL-^_.'M<NJQ!'#W"\`9XU^YK5^Z?X_G&[&Z_?_]>G]?\Z!^_^W\+_N
+M_^L+]__3W4)X=@/0^_[#\,_L`.(S.P#/O<9;.W;_?ZJ?@*/K?[K-C,[+^O>[
+M^_^0(_?_;Z'WES8`87?NVF$S,)W7E/;G:3HOS>W/\^[<'_YOF<ZGG^W]>3M\
+M"(=S>?XNS^^=#/!>)O@@(WR4&3[)$%]DBB_Z-JK.:3JGRYS@9$[P,B<$F1.2
+MS`E)YH2LGU>1.:'JG*9SNLR)3N;$('-BD#DQZL8LZ1>394XL,B=6G=-DSOW;
+M<??_D#E)O_^D`:1'!6@"21M(&D'2"I)FD+2#K!UD[2!K!UD[R-I!U@ZR=I"U
+M@ZP=9.V@:`=%.RC:0=$.BG90M(.B'13MH&@'13NHVD'5#JIV4+6#JAU4[:!J
+M!U4[J-I!TPZ:=M"T@Z8=-.V@:0=-.VB/?@P>_1IH!TT[Z-I!UPZZ=M"U@ZX=
+M=.V@:P==.^@/'?@>N=^P8O\&"_J!!?W`@GY@03^PH!]86/NA/UC0#RSH!Q;T
+M`POZ@07]P()^8,'^'W.B'UC0#RSH!Q;T`POZ@07]P(+]/^9$/["@'UC0#RSH
+M!Q;T`POZ@07[?\R)?F!!/["@'UC0#RSH!Q;T`POV_Y@3_<""?F!!/["@'UC0
+M#RSH!Q;L_S$G^H$%_<""?F!!/["@'UC0#RS8_V-.]`,+^H$%_<""?F!!/["@
+M'UBP_\><Z`<6]`,+^H$%_<""?F!!/[!@_X\YT0\LZ`<6]`,+^H$%_<""?F#!
+M_A]SHA]8T`\LZ`<6]`,+^H$%_<""_3_F1#^PH!]8T`\LZ`<6]`,+^H$%^W_,
+MB7Y@03^PH!^;]<6'X>[].'P:-]MU;*7$BYLO-W]LOPZ;[7BB&6Y24MH=?<U.
+MCP?3N7<U1N^\3W'A?`HY+E9W)YI_U+?M[;"97HKU>>[?RL_CF0AN-=Q>78^7
+MWO<6>BS.+Z=K'Y]>F_MUXM<X^6)_QJOKW^GZ]]/Z#]G5Q>I-%M'#^I^"/_IW
+5KSU^INL?````P._C!\JB`&$`\```
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
new file mode 100644
index 00000000000..cf8fd77cc0c
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
@@ -0,0 +1,1369 @@
+begin 644 test_read_format_gtar_sparse_1_17_posix10_modified.tar
+M+B]087A(96%D97)S+C,X-C8S+W-P87)S90``````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`P,C$U
+M`#$P-S,S,3`Q,30S`#`Q,S0V-@`@>```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,```````
+M````````````````````````````````````````````````````````````
+M```````````````````P,#`P,#`P`#`P,#`P,#``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````R,B!'3E4N<W!A<G-E+FUA:F]R/3$*,C(@1TY5
+M+G-P87)S92YM:6YO<CTP"C(V($=.52YS<&%R<V4N;F%M93US<&%R<V4*,S$@
+M1TY5+G-P87)S92YR96%L<VEZ93TS,30U-S(X"C(P(&%T:6UE/3$Q.3@R.3,V
+M,#(*,C`@8W1I;64],3$Y.#(Y,S8P,`H`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````"XO1TY54W!A<G-E
+M1FEL92XS.#8V,R]S<&%R<V4`````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#`P,S`P,``Q,#<S,S$P,3$T
+M,``P,34Q-34`(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!T:6T`````````````````
+M`````````````````````'1I;0``````````````````````````````````
+M````,#`P,#`P,``P,#`P,#`P````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````(R%G;G4M<W!A<G-E+69O<FUA=`HC9F]R;6%T.C$N,`HS"CDY.3DS
+M-@HU,3(*,3DY.3@W,@HU,3(*,S$T-3<R.`HP"@``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````+B]087A(96%D97)S+C,X-C8S+W-P87)S93(`````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P
+M`#`P,#`P,#`P,C$W`#$P-S,S,3`Q,30S`#`Q,S4U,@`@>```````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!U
+M<W1A<@`P,```````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,#`P`#`P,#`P,#``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````R,B!'3E4N<W!A<G-E+FUA
+M:F]R/3$*,C(@1TY5+G-P87)S92YM:6YO<CTP"C(W($=.52YS<&%R<V4N;F%M
+M93US<&%R<V4R"C,R($=.52YS<&%R<V4N<F5A;'-I>F4].3DP,#`P,#$*,C`@
+M871I;64],3$Y.#(Y,S8P,PHR,"!C=&EM93TQ,3DX,CDS-C`Q"@``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`"XO1TY54W!A<G-E1FEL92XS.#8V,R]S<&%R<V4R````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`P-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#$T-3,P
+M,0`Q,#<S,S$P,3$T,0`P,34R-3,`(#``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````=7-T87(`,#!T:6T`
+M`````````````````````````````````````'1I;0``````````````````
+M````````````````````,#`P,#`P,``P,#`P,#`P````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````.3D*.3DY.3,V"C4Q,@HQ.3DY.#<R"C4Q,@HR
+M.3DY.#`X"C4Q,@HS.3DY-S0T"C4Q,@HT.3DY-C@P"C4Q,@HU.3DY-C$V"C4Q
+M,@HV.3DY-34R"C4Q,@HX,#`P,#`P"C4Q,@HX.3DY.3,V"C4Q,@HY.3DY.#<R
+M"C4Q,@HQ,#DY.3@P.`HU,3(*,3$Y.3DW-#0*-3$R"C$R.3DY-C@P"C4Q,@HQ
+M,SDY.38Q-@HU,3(*,30Y.3DU-3(*-3$R"C$V,#`P,#`P"C4Q,@HQ-CDY.3DS
+M-@HU,3(*,3<Y.3DX-S(*-3$R"C$X.3DY.#`X"C4Q,@HQ.3DY.3<T-`HU,3(*
+M,C`Y.3DV.#`*-3$R"C(Q.3DY-C$V"C4Q,@HR,CDY.34U,@HU,3(*,C0P,#`P
+M,#`*-3$R"C(T.3DY.3,V"C4Q,@HR-3DY.3@W,@HU,3(*,C8Y.3DX,#@*-3$R
+M"C(W.3DY-S0T"C4Q,@HR.#DY.38X,`HU,3(*,CDY.3DV,38*-3$R"C,P.3DY
+M-34R"C4Q,@HS,C`P,#`P,`HU,3(*,S(Y.3DY,S8*-3$R"C,S.3DY.#<R"C4Q
+M,@HS-#DY.3@P.`HU,3(*,S4Y.3DW-#0*-3$R"C,V.3DY-C@P"C4Q,@HS-SDY
+M.38Q-@HU,3(*,S@Y.3DU-3(*-3$R"C0P,#`P,#`P"C4Q,@HT,#DY.3DS-@HU
+M,3(*-#$Y.3DX-S(*-3$R"C0R.3DY.#`X"C4Q,@HT,SDY.3<T-`HU,3(*-#0Y
+M.3DV.#`*-3$R"C0U.3DY-C$V"C4Q,@HT-CDY.34U,@HU,3(*-#@P,#`P,#`*
+M-3$R"C0X.3DY.3,V"C4Q,@HT.3DY.3@W,@HU,3(*-3`Y.3DX,#@*-3$R"C4Q
+M.3DY-S0T"C4Q,@HU,CDY.38X,`HU,3(*-3,Y.3DV,38*-3$R"C4T.3DY-34R
+M"C4Q,@HU-C`P,#`P,`HU,3(*-38Y.3DY,S8*-3$R"C4W.3DY.#<R"C4Q,@HU
+M.#DY.3@P.`HU,3(*-3DY.3DW-#0*-3$R"C8P.3DY-C@P"C4Q,@HV,3DY.38Q
+M-@HU,3(*-C(Y.3DU-3(*-3$R"C8T,#`P,#`P"C4Q,@HV-#DY.3DS-@HU,3(*
+M-C4Y.3DX-S(*-3$R"C8V.3DY.#`X"C4Q,@HV-SDY.3<T-`HU,3(*-C@Y.3DV
+M.#`*-3$R"C8Y.3DY-C$V"C4Q,@HW,#DY.34U,@HU,3(*-S(P,#`P,#`*-3$R
+M"C<R.3DY.3,V"C4Q,@HW,SDY.3@W,@HU,3(*-S0Y.3DX,#@*-3$R"C<U.3DY
+M-S0T"C4Q,@HW-CDY.38X,`HU,3(*-S<Y.3DV,38*-3$R"C<X.3DY-34R"C4Q
+M,@HX,#`P,#`P,`HU,3(*.#`Y.3DY,S8*-3$R"C@Q.3DY.#<R"C4Q,@HX,CDY
+M.3@P.`HU,3(*.#,Y.3DW-#0*-3$R"C@T.3DY-C@P"C4Q,@HX-3DY.38Q-@HU
+M,3(*.#8Y.3DU-3(*-3$R"C@X,#`P,#`P"C4Q,@HX.#DY.3DS-@HU,3(*.#DY
+M.3DX-S(*-3$R"CDP.3DY.#`X"C4Q,@HY,3DY.3<T-`HU,3(*.3(Y.3DV.#`*
+M-3$R"CDS.3DY-C$V"C4Q,@HY-#DY.34U,@HU,3(*.38P,#`P,#`*-3$R"CDV
+M.3DY.3,V"C4Q,@HY-SDY.3@W,@HU,3(*.3@Y.3DX,#@*,3DS"@``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````&$`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!A````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````!A````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````!A````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``!A````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!A````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````80``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````80``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````80``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````80``````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&$`````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````&$`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````&$`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````&$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&$`````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!A````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!A````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!A````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````!A````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````!A````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````80``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````80``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````80``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````80``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````80``
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&$`````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````&$`````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&$`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````&$`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````&$`
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!A````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````!A````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````!A````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!A
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````80``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````80``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````80``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````80``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M80``````````````````````````````````````````````````````````
+M`````````````````````````&$`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````&$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&$`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````&$`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````+B]0
+M87A(96%D97)S+C,X-C8S+VYO;BUS<&%R<V4`````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````#`P,#`V-#0`,#`P,3<U,``P,#`Q-S4P`#`P,#`P,#`P,#4P`#$P
+M-S,S,3`Q,30S`#`Q-#(U,P`@>```````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!U<W1A<@`P,```````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`P,#`P`#`P,#`P,#``````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````R,"!A=&EM93TQ,3DX,CDS-C`Q"C(P(&-T:6UE/3$Q
+M.3@R.3,V,#$*````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````&YO;BUS<&%R<V4`````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````P,#`P
+M-C0T`#`P,#$W-3``,#`P,3<U,``P,#`P,#`P,#`P,``Q,#<S,S$P,3$T,0`P
+M,3(U,#<`(#``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````=7-T87(`,#!T:6T`````````````````````
+M`````````````````'1I;0``````````````````````````````````````
+M,#`P,#`P,``P,#`P,#`P````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+/````````````````````
+`
+end
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c
index 2a888af3586..107024f5ede 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_isorr_bz2.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_isorr_bz2.c,v 1.2 2007/05/29 01:00:21 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_isorr_bz2.c,v 1.3 2008/01/01 22:28:04 kientzle Exp $");
/*
Execute the following to rebuild the data for this program:
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_mtree.c b/archivers/libarchive/files/libarchive/test/test_read_format_mtree.c
index fa20c35dc74..e5165d31fbe 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_mtree.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_mtree.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_mtree.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $");
/* Single entry with a hardlink. */
static unsigned char archive[] = {
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_tar.c b/archivers/libarchive/files/libarchive/test/test_read_format_tar.c
index c3b5212d8e7..1de08495ca9 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_tar.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_tar.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tar.c,v 1.2 2007/07/14 05:35:17 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tar.c,v 1.3 2008/01/13 23:50:30 kientzle Exp $");
/*
* Each of these archives is a short archive with a single entry. The
@@ -36,6 +36,52 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tar.c,v 1.2 2007/07
* '2' is a symlink, '5' is a dir, etc.
*/
+/* Empty archive. */
+static unsigned char archiveEmpty[] = {
+ /* 512 zero bytes */
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0
+};
+
+static void verifyEmpty(void)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_compression_all(a));
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_open_memory(a, archiveEmpty, 512));
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE);
+ failure("512 zero bytes should be recognized as a tar archive.");
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR);
+
+ assert(0 == archive_read_close(a));
+#if ARCHIVE_API_VERSION > 1
+ assert(0 == archive_read_finish(a));
+#else
+ archive_read_finish(a);
+#endif
+}
+
/* Single entry with a hardlink. */
static unsigned char archive1[] = {
'h','a','r','d','l','i','n','k',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -411,6 +457,7 @@ static void verify(unsigned char *d, size_t s,
DEFINE_TEST(test_read_format_tar)
{
+ verifyEmpty();
verify(archive1, sizeof(archive1), verify1,
ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR);
verify(archive2, sizeof(archive2), verify2,
diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_zip.c b/archivers/libarchive/files/libarchive/test/test_read_format_zip.c
index ce065097e42..9829217fc41 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_format_zip.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_format_zip.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_zip.c,v 1.2 2007/05/29 01:00:21 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_zip.c,v 1.3 2008/01/01 22:28:04 kientzle Exp $");
static unsigned char archive[] = {
'P','K',3,4,10,0,0,0,0,0,'Y','f',179,'6',0,0,0,0,0,0,0,0,0,0,0,0,4,0,21,0,
diff --git a/archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c b/archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c
index 2b169c83900..5e2c9c536b4 100644
--- a/archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c
+++ b/archivers/libarchive/files/libarchive/test/test_read_pax_truncated.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_pax_truncated.c,v 1.1 2007/07/13 15:14:35 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_pax_truncated.c,v 1.2 2008/01/01 22:28:04 kientzle Exp $");
DEFINE_TEST(test_read_pax_truncated)
{
diff --git a/archivers/libarchive/files/libarchive/test/test_tar_filenames.c b/archivers/libarchive/files/libarchive/test/test_tar_filenames.c
index de0b1d0351e..8b83b527733 100644
--- a/archivers/libarchive/files/libarchive/test/test_tar_filenames.c
+++ b/archivers/libarchive/files/libarchive/test/test_tar_filenames.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_filenames.c,v 1.7 2007/07/14 17:52:01 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_filenames.c,v 1.8 2008/01/01 22:28:04 kientzle Exp $");
/*
* Exercise various lengths of filenames in tar archives,
diff --git a/archivers/libarchive/files/libarchive/test/test_tar_large.c b/archivers/libarchive/files/libarchive/test/test_tar_large.c
index 29e0c833562..c675ac1ee04 100644
--- a/archivers/libarchive/files/libarchive/test/test_tar_large.c
+++ b/archivers/libarchive/files/libarchive/test/test_tar_large.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_large.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $");
#include <errno.h>
#include <stdlib.h>
@@ -91,10 +91,11 @@ memory_write(struct archive *a, void *_private, const void *buff, size_t size)
(void)a;
/*
- * Since libarchive has zero-copy behavior, if you give a pointer
- * to filedata to the library, a pointer into that data will
- * pop out here. This way, we can tell the difference between
- * filedata and library header and metadata.
+ * Since libarchive tries to behave in a zero-copy manner, if
+ * you give a pointer to filedata to the library, a pointer
+ * into that data will (usually) pop out here. This way, we
+ * can tell the difference between filedata and library header
+ * and metadata.
*/
if ((const char *)filedata <= (const char *)buff
&& (const char *)buff < (const char *)filedata + filedatasize) {
@@ -303,5 +304,6 @@ DEFINE_TEST(test_tar_large)
archive_read_finish(a);
#endif
+ free(memdata.buff);
free(filedata);
}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk.c b/archivers/libarchive/files/libarchive/test/test_write_disk.c
index 4cac97681a7..480cf29b566 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_disk.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk.c,v 1.6 2007/09/21 04:52:43 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk.c,v 1.8 2008/01/23 05:47:08 kientzle Exp $");
#if ARCHIVE_VERSION_STAMP >= 1009000
@@ -60,6 +60,24 @@ static void create_reg_file(struct archive_entry *ae, const char *msg)
/* Write the entry to disk. */
assert((ad = archive_write_disk_new()) != NULL);
failure("%s", msg);
+ /*
+ * A touchy API design issue: archive_write_data() does (as of
+ * 2.4.12) enforce the entry size as a limit on the data
+ * written to the file. This was not enforced prior to
+ * 2.4.12. The change was prompted by the refined
+ * hardlink-restore semantics introduced at that time. In
+ * short, libarchive needs to know whether a "hardlink entry"
+ * is going to overwrite the contents so that it can know
+ * whether or not to open the file for writing. This implies
+ * that there is a fundamental semantic difference between an
+ * entry with a zero size and one with a non-zero size in the
+ * case of hardlinks and treating the hardlink case
+ * differently from the regular file case is just asking for
+ * trouble. So, a zero size must always mean that no data
+ * will be accepted, which is consistent with the file size in
+ * the entry being a maximum size.
+ */
+ archive_entry_set_size(ae, sizeof(data));
assertEqualIntA(ad, 0, archive_write_header(ad, ae));
assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
@@ -92,6 +110,11 @@ static void create_reg_file2(struct archive_entry *ae, const char *msg)
/* Write the entry to disk. */
assert((ad = archive_write_disk_new()) != NULL);
failure("%s", msg);
+ /*
+ * See above for an explanation why this next call
+ * is necessary.
+ */
+ archive_entry_set_size(ae, datasize);
assertEqualIntA(ad, 0, archive_write_header(ad, ae));
for (i = 0; i < datasize - 999; i += 1000) {
assertEqualIntA(ad, ARCHIVE_OK,
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_hardlink.c b/archivers/libarchive/files/libarchive/test/test_write_disk_hardlink.c
new file mode 100644
index 00000000000..b21c44b2384
--- /dev/null
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk_hardlink.c
@@ -0,0 +1,165 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_hardlink.c,v 1.1 2008/01/18 05:05:58 kientzle Exp $");
+
+#define UMASK 022
+
+/*
+ * Exercise hardlink recreation.
+ */
+DEFINE_TEST(test_write_disk_hardlink)
+{
+#if ARCHIVE_VERSION_STAMP < 1009000
+ skipping("archive_write_disk_hardlink tests");
+#else
+ static const char data[]="abcdefghijklmnopqrstuvwxyz";
+ struct archive *ad;
+ struct archive_entry *ae;
+ struct stat st, st2;
+
+ /* Force the umask to something predictable. */
+ umask(UMASK);
+
+ /* Write entries to disk. */
+ assert((ad = archive_write_disk_new()) != NULL);
+
+ /*
+ * First, use a tar-like approach; a regular file, then
+ * a separate "hardlink" entry.
+ */
+
+ /* Regular file. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link1a");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, sizeof(data));
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_free(ae);
+
+ /* Link. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link1b");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 0);
+ archive_entry_copy_hardlink(ae, "link1a");
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(0, archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_free(ae);
+
+ /*
+ * Second, try an old-cpio-like approach; a regular file, then
+ * another identical one (which has been marked hardlink).
+ */
+
+ /* Regular file. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link2a");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, sizeof(data));
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_free(ae);
+
+ /* Link. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link2b");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, sizeof(data));
+ archive_entry_copy_hardlink(ae, "link2a");
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_free(ae);
+
+ /*
+ * Finally, try a new-cpio-like approach, where the initial
+ * regular file is empty and the hardlink has the data.
+ */
+
+ /* Regular file. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link3a");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 0);
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(0, archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_free(ae);
+
+ /* Link. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, "link3b");
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, sizeof(data));
+ archive_entry_copy_hardlink(ae, "link3a");
+ assertEqualIntA(ad, 0, archive_write_header(ad, ae));
+ assertEqualInt(sizeof(data), archive_write_data(ad, data, sizeof(data)));
+ assertEqualIntA(ad, 0, archive_write_finish_entry(ad));
+ archive_entry_free(ae);
+ assertEqualInt(0, archive_write_finish(ad));
+
+ /* Test the entries on disk. */
+ assert(0 == stat("link1a", &st));
+ assertEqualInt(st.st_mode, (S_IFREG | 0755) & ~UMASK);
+ assertEqualInt(st.st_size, sizeof(data));
+ assertEqualInt(st.st_nlink, 2);
+
+ assert(0 == stat("link1b", &st2));
+ assertEqualInt(st2.st_mode, (S_IFREG | 0755) & ~UMASK);
+ assertEqualInt(st2.st_size, sizeof(data));
+ assertEqualInt(st2.st_nlink, 2);
+ assertEqualInt(st.st_ino, st2.st_ino);
+ assertEqualInt(st.st_dev, st2.st_dev);
+
+ assert(0 == stat("link2a", &st));
+ assertEqualInt(st.st_mode, (S_IFREG | 0755) & ~UMASK);
+ assertEqualInt(st.st_size, sizeof(data));
+ assertEqualInt(st.st_nlink, 2);
+
+ assert(0 == stat("link2b", &st2));
+ assertEqualInt(st2.st_mode, (S_IFREG | 0755) & ~UMASK);
+ assertEqualInt(st2.st_size, sizeof(data));
+ assertEqualInt(st2.st_nlink, 2);
+ assertEqualInt(st.st_ino, st2.st_ino);
+ assertEqualInt(st.st_dev, st2.st_dev);
+
+ assert(0 == stat("link3a", &st));
+ assertEqualInt(st.st_mode, (S_IFREG | 0755) & ~UMASK);
+ assertEqualInt(st.st_size, sizeof(data));
+ assertEqualInt(st.st_nlink, 2);
+
+ assert(0 == stat("link3b", &st2));
+ assertEqualInt(st2.st_mode, (S_IFREG | 0755) & ~UMASK);
+ assertEqualInt(st2.st_size, sizeof(data));
+ assertEqualInt(st2.st_nlink, 2);
+ assertEqualInt(st.st_ino, st2.st_ino);
+ assertEqualInt(st.st_dev, st2.st_dev);
+#endif
+}
diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c b/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c
index af568a0b283..4c03c75b491 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_perms.c,v 1.7 2007/08/12 17:35:05 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_perms.c,v 1.8 2008/01/01 22:28:04 kientzle Exp $");
#if ARCHIVE_VERSION_STAMP >= 1009000
@@ -244,16 +244,18 @@ DEFINE_TEST(test_write_disk_perms)
failure("Opportunistic SUID failure shouldn't return error.");
assertEqualInt(0, archive_write_finish_entry(a));
- assert(archive_entry_clear(ae) != NULL);
- archive_entry_copy_pathname(ae, "file_bad_suid2");
- archive_entry_set_mode(ae, S_IFREG | S_ISUID | 0742);
- archive_entry_set_uid(ae, getuid() + 1);
- archive_write_disk_set_options(a,
- ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_OWNER);
- assertA(0 == archive_write_header(a, ae));
- /* Owner change should fail here. */
- failure("Non-opportunistic SUID failure should return error.");
- assertEqualInt(ARCHIVE_WARN, archive_write_finish_entry(a));
+ if (getuid() != 0) {
+ assert(archive_entry_clear(ae) != NULL);
+ archive_entry_copy_pathname(ae, "file_bad_suid2");
+ archive_entry_set_mode(ae, S_IFREG | S_ISUID | 0742);
+ archive_entry_set_uid(ae, getuid() + 1);
+ archive_write_disk_set_options(a,
+ ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_OWNER);
+ assertA(0 == archive_write_header(a, ae));
+ /* Owner change should fail here. */
+ failure("Non-opportunistic SUID failure should return error.");
+ assertEqualInt(ARCHIVE_WARN, archive_write_finish_entry(a));
+ }
/* Write a regular file with ARCHIVE_EXTRACT_PERM & SGID bit */
assert(archive_entry_clear(ae) != NULL);
@@ -403,10 +405,13 @@ DEFINE_TEST(test_write_disk_perms)
failure("file_bad_suid: st.st_mode=%o", st.st_mode);
assert((st.st_mode & 07777) == (0742));
- /* SUID bit should NOT have been set here. */
- assert(0 == stat("file_bad_suid2", &st));
- failure("file_bad_suid2: st.st_mode=%o", st.st_mode);
- assert((st.st_mode & 07777) == (0742));
+ /* Some things don't fail if you're root, so suppress this. */
+ if (getuid() != 0) {
+ /* SUID bit should NOT have been set here. */
+ assert(0 == stat("file_bad_suid2", &st));
+ failure("file_bad_suid2: st.st_mode=%o", st.st_mode);
+ assert((st.st_mode & 07777) == (0742));
+ }
/* SGID should be set here. */
assert(0 == stat("file_perm_sgid", &st));
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_cpio.c b/archivers/libarchive/files/libarchive/test/test_write_format_cpio.c
index 7319d0c3cec..dbb9775597a 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_cpio.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_cpio.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_cpio.c,v 1.3 2007/10/12 04:11:31 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_cpio.c,v 1.4 2008/01/01 22:28:04 kientzle Exp $");
/* The version stamp macro was introduced after cpio write support. */
#if ARCHIVE_VERSION_STAMP >= 1009000
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c
index 733e4ab26cd..431097b2476 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_newc.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_cpio_newc.c,v 1.2 2008/01/23 05:43:26 kientzle Exp $");
static int
@@ -68,6 +68,8 @@ DEFINE_TEST(test_write_format_cpio_newc)
* Add various files to it.
* TODO: Extend this to cover more filetypes.
*/
+
+ /* Regular file */
assert((entry = archive_entry_new()) != NULL);
archive_entry_set_mtime(entry, 1, 10);
archive_entry_set_pathname(entry, "file");
@@ -82,6 +84,7 @@ DEFINE_TEST(test_write_format_cpio_newc)
archive_entry_free(entry);
assertEqualIntA(a, 10, archive_write_data(a, "1234567890", 10));
+ /* Directory */
assert((entry = archive_entry_new()) != NULL);
archive_entry_set_mtime(entry, 2, 20);
archive_entry_set_pathname(entry, "dir");
@@ -92,6 +95,22 @@ DEFINE_TEST(test_write_format_cpio_newc)
archive_entry_free(entry);
assertEqualIntA(a, 0, archive_write_data(a, "1234567890", 10));
+ /* Symlink */
+ assert((entry = archive_entry_new()) != NULL);
+ archive_entry_set_mtime(entry, 3, 30);
+ archive_entry_set_pathname(entry, "lnk");
+ archive_entry_set_mode(entry, S_IFLNK | 0664);
+ archive_entry_set_size(entry, 0);
+ archive_entry_set_uid(entry, 83);
+ archive_entry_set_gid(entry, 93);
+ archive_entry_set_dev(entry, 13);
+ archive_entry_set_ino(entry, 88);
+ archive_entry_set_nlink(entry, 1);
+ archive_entry_set_symlink(entry,"a");
+ assertEqualIntA(a, 0, archive_write_header(a, entry));
+ archive_entry_free(entry);
+
+
#if ARCHIVE_API_VERSION > 1
assert(0 == archive_write_finish(a));
#else
@@ -122,7 +141,7 @@ DEFINE_TEST(test_write_format_cpio_newc)
assertEqualMem(e + 110, "file\0\0", 6); /* Name contents */
assertEqualMem(e + 116, "1234567890", 10); /* File body */
assertEqualMem(e + 126, "\0\0", 2); /* Pad to multiple of 4 */
- e += 128;
+ e += 128; /* Must be multiple of four here! */
/* Second entry is "dir" */
assert(is_hex(e, 110));
@@ -142,7 +161,27 @@ DEFINE_TEST(test_write_format_cpio_newc)
assertEqualMem(e + 102, "00000000", 8); /* CRC */
assertEqualMem(e + 110, "dir\0", 4); /* name */
assertEqualMem(e + 114, "\0\0", 2); /* Pad to multiple of 4 */
- e += 116;
+ e += 116; /* Must be multiple of four here! */
+
+ /* Third entry is "lnk" */
+ assert(is_hex(e, 110)); /* Entire header is hex digits. */
+ assertEqualMem(e + 0, "070701", 6); /* Magic */
+ assertEqualMem(e + 6, "00000058", 8); /* ino */
+ assertEqualMem(e + 14, "0000a1b4", 8); /* Mode */
+ assertEqualMem(e + 22, "00000053", 8); /* uid */
+ assertEqualMem(e + 30, "0000005d", 8); /* gid */
+ assertEqualMem(e + 38, "00000001", 8); /* nlink */
+ assertEqualMem(e + 46, "00000003", 8); /* mtime */
+ assertEqualMem(e + 54, "00000001", 8); /* File size */
+ assertEqualMem(e + 62, "00000000", 8); /* devmajor */
+ assertEqualMem(e + 70, "0000000d", 8); /* devminor */
+ assertEqualMem(e + 78, "00000000", 8); /* rdevmajor */
+ assertEqualMem(e + 86, "00000000", 8); /* rdevminor */
+ assertEqualMem(e + 94, "00000004", 8); /* Name size */
+ assertEqualMem(e + 102, "00000000", 8); /* CRC */
+ assertEqualMem(e + 110, "lnk\0\0\0", 6); /* Name contents */
+ assertEqualMem(e + 116, "a\0\0\0", 4); /* File body + pad */
+ e += 120; /* Must be multiple of four here! */
/* TODO: Verify other types of entries. */
@@ -164,7 +203,7 @@ DEFINE_TEST(test_write_format_cpio_newc)
assertEqualMem(e + 102, "00000000", 8); /* CRC */
assertEqualMem(e + 110, "TRAILER!!!\0", 11); /* Name */
assertEqualMem(e + 121, "\0\0\0", 3); /* Pad to multiple of 4 bytes */
- e += 124;
+ e += 124; /* Must be multiple of four here! */
assertEqualInt(used, e - buff);
diff --git a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c
index 796dd7eace9..e6ed7eed778 100644
--- a/archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c
+++ b/archivers/libarchive/files/libarchive/test/test_write_format_cpio_odc.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_cpio_odc.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $");
static int
diff --git a/archivers/libarchive/files/tar/bsdtar.1 b/archivers/libarchive/files/tar/bsdtar.1
index db6a10aa1ca..ec22160d998 100644
--- a/archivers/libarchive/files/tar/bsdtar.1
+++ b/archivers/libarchive/files/tar/bsdtar.1
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/usr.bin/tar/bsdtar.1,v 1.35 2007/05/29 05:39:10 kientzle Exp $
+.\" $FreeBSD: src/usr.bin/tar/bsdtar.1,v 1.37 2008/01/22 07:23:44 kientzle Exp $
.\"
.Dd April 13, 2004
.Dt BSDTAR 1
@@ -232,16 +232,9 @@ All symbolic links will be followed.
Normally, symbolic links are archived as such.
With this option, the target of the link will be archived instead.
.It Fl l
-If
-.Ev POSIXLY_CORRECT
-is specified in the environment, this is a synonym for the
+This is a synonym for the
.Fl -check-links
option.
-Otherwise, an error will be displayed.
-Users who desire behavior compatible with GNU tar should use
-the
-.Fl -one-file-system
-option instead.
.It Fl m
(x mode only)
Do not extract modification time.
@@ -422,11 +415,6 @@ The locale to use.
See
.Xr environ 7
for more information.
-.It Ev POSIXLY_CORRECT
-If this environment variable is defined, the
-.Fl l
-option will be interpreted in accordance with
-.St -p1003.1-96 .
.It Ev TAPE
The default tape device.
The
@@ -681,13 +669,16 @@ This is a complete re-implementation based on the
.Xr libarchive 3
library.
.Sh BUGS
-POSIX and GNU violently disagree about the meaning of the
+This program follows
+.St -p1003.1-96
+for the definition of the
.Fl l
option.
-Because of the potential for disaster if someone expects
-one behavior and gets the other, the
+Note that GNU tar prior to version 1.15 treated
.Fl l
-option is deliberately broken in this implementation.
+as a synonym for the
+.Fl -one-file-system
+option.
.Pp
The
.Fl C Pa dir
diff --git a/archivers/libarchive/files/tar/bsdtar.c b/archivers/libarchive/files/tar/bsdtar.c
index d20a60dffa6..fbc66c1d739 100644
--- a/archivers/libarchive/files/tar/bsdtar.c
+++ b/archivers/libarchive/files/tar/bsdtar.c
@@ -24,7 +24,7 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/bsdtar.c,v 1.77 2007/09/09 00:07:18 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/bsdtar.c,v 1.79 2008/01/22 07:23:44 kientzle Exp $");
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
@@ -391,19 +391,9 @@ main(int argc, char **argv)
case 'L': /* BSD convention */
bsdtar->symlink_mode = 'L';
break;
- case 'l': /* SUSv2 and GNU conflict badly here */
- if (getenv("POSIXLY_CORRECT") != NULL) {
- /* User has asked for POSIX/SUS behavior. */
- bsdtar->option_warn_links = 1;
- } else {
- fprintf(stderr,
-"Error: -l has different behaviors in different tar programs.\n");
- fprintf(stderr,
-" For the GNU behavior, use --one-file-system instead.\n");
- fprintf(stderr,
-" For the POSIX behavior, use --check-links instead.\n");
- usage(bsdtar);
- }
+ case 'l': /* SUSv2 and GNU tar beginning with 1.16 */
+ /* GNU tar 1.13 used -l for --one-file-system */
+ bsdtar->option_warn_links = 1;
break;
case 'm': /* SUSv2 */
bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_TIME;
diff --git a/archivers/libarchive/files/tar/bsdtar.h b/archivers/libarchive/files/tar/bsdtar.h
index 50f61681a82..fb10678702f 100644
--- a/archivers/libarchive/files/tar/bsdtar.h
+++ b/archivers/libarchive/files/tar/bsdtar.h
@@ -22,7 +22,7 @@
* (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: src/usr.bin/tar/bsdtar.h,v 1.28 2007/05/29 05:39:10 kientzle Exp $
+ * $FreeBSD: src/usr.bin/tar/bsdtar.h,v 1.29 2008/01/02 00:21:27 kientzle Exp $
*/
#include "bsdtar_platform.h"
diff --git a/archivers/libarchive/files/tar/bsdtar_platform.h b/archivers/libarchive/files/tar/bsdtar_platform.h
index 66852ca7525..ccb9d3c0257 100644
--- a/archivers/libarchive/files/tar/bsdtar_platform.h
+++ b/archivers/libarchive/files/tar/bsdtar_platform.h
@@ -22,7 +22,7 @@
* (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: src/usr.bin/tar/bsdtar_platform.h,v 1.24 2007/04/12 04:45:32 kientzle Exp $
+ * $FreeBSD: src/usr.bin/tar/bsdtar_platform.h,v 1.25 2008/01/02 00:23:00 kientzle Exp $
*/
/*
diff --git a/archivers/libarchive/files/tar/read.c b/archivers/libarchive/files/tar/read.c
index a942e85b189..edda317b6af 100644
--- a/archivers/libarchive/files/tar/read.c
+++ b/archivers/libarchive/files/tar/read.c
@@ -24,7 +24,7 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.34 2007/07/20 01:24:49 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.35 2008/01/02 00:21:27 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/archivers/libarchive/files/tar/test/main.c b/archivers/libarchive/files/tar/test/main.c
new file mode 100644
index 00000000000..c8495c6c7ed
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/main.c
@@ -0,0 +1,731 @@
+/*
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+
+/*
+ * This same file is used pretty much verbatim for all test harnesses.
+ *
+ * The next line is used to define various environment variables, etc.
+ *
+ * The tar and cpio test harnesses are identical except for this line;
+ * the libarchive test harness omits some code that is needed only for
+ * testing standalone executables.
+ */
+#define PROGRAM "BSDTAR"
+
+/*
+ * Various utility routines useful for test programs.
+ * Each test program is linked against this file.
+ */
+#include <errno.h>
+#include <stdarg.h>
+#include <time.h>
+
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * "list.h" is simply created by "grep DEFINE_TEST"; it has
+ * a line like
+ * DEFINE_TEST(test_function)
+ * for each test.
+ * Include it here with a suitable DEFINE_TEST to declare all of the
+ * test functions.
+ */
+#undef DEFINE_TEST
+#define DEFINE_TEST(name) void name(void);
+#include "list.h"
+
+/* Interix doesn't define these in a standard header. */
+#if __INTERIX__
+extern char *optarg;
+extern int optind;
+#endif
+
+/* Default is to crash and try to force a core dump on failure. */
+static int dump_on_failure = 1;
+/* Default is to print some basic information about each test. */
+static int quiet_flag = 0;
+/* Cumulative count of component failures. */
+static int failures = 0;
+/* Cumulative count of skipped component tests. */
+static int skips = 0;
+/* Cumulative count of assertions. */
+static int assertions = 0;
+
+/*
+ * My own implementation of the standard assert() macro emits the
+ * message in the same format as GCC (file:line: message).
+ * It also includes some additional useful information.
+ * This makes it a lot easier to skim through test failures in
+ * Emacs. ;-)
+ *
+ * It also supports a few special features specifically to simplify
+ * test harnesses:
+ * failure(fmt, args) -- Stores a text string that gets
+ * printed if the following assertion fails, good for
+ * explaining subtle tests.
+ */
+static char msg[4096];
+
+/*
+ * For each test source file, we remember how many times each
+ * failure was reported.
+ */
+static const char *failed_filename;
+static struct line {
+ int line;
+ int count;
+} failed_lines[1000];
+
+/*
+ * Count this failure; return the number of previous failures.
+ */
+static int
+previous_failures(const char *filename, int line)
+{
+ unsigned int i;
+ int count;
+
+ if (failed_filename == NULL || strcmp(failed_filename, filename) != 0)
+ memset(failed_lines, 0, sizeof(failed_lines));
+ failed_filename = filename;
+
+ for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
+ if (failed_lines[i].line == line) {
+ count = failed_lines[i].count;
+ failed_lines[i].count++;
+ return (count);
+ }
+ if (failed_lines[i].line == 0) {
+ failed_lines[i].line = line;
+ failed_lines[i].count = 1;
+ return (0);
+ }
+ }
+ return (0);
+}
+
+/*
+ * Copy arguments into file-local variables.
+ */
+static const char *test_filename;
+static int test_line;
+static void *test_extra;
+void test_setup(const char *filename, int line)
+{
+ test_filename = filename;
+ test_line = line;
+}
+
+/*
+ * Inform user that we're skipping a test.
+ */
+void
+test_skipping(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (previous_failures(test_filename, test_line))
+ return;
+
+ va_start(ap, fmt);
+ fprintf(stderr, " *** SKIPPING: ");
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
+ va_end(ap);
+ ++skips;
+}
+
+/* Common handling of failed tests. */
+static void
+report_failure(void *extra)
+{
+ if (msg[0] != '\0') {
+ fprintf(stderr, " Description: %s\n", msg);
+ msg[0] = '\0';
+ }
+
+ (void)extra; /* UNUSED */
+
+ if (dump_on_failure) {
+ fprintf(stderr,
+ " *** forcing core dump so failure can be debugged ***\n");
+ *(char *)(NULL) = 0;
+ exit(1);
+ }
+}
+
+/*
+ * Summarize repeated failures in the just-completed test file.
+ * The reports above suppress multiple failures from the same source
+ * line; this reports on any tests that did fail multiple times.
+ */
+static int
+summarize_comparator(const void *a0, const void *b0)
+{
+ const struct line *a = a0, *b = b0;
+ if (a->line == 0 && b->line == 0)
+ return (0);
+ if (a->line == 0)
+ return (1);
+ if (b->line == 0)
+ return (-1);
+ return (a->line - b->line);
+}
+
+static void
+summarize(void)
+{
+ unsigned int i;
+
+ qsort(failed_lines, sizeof(failed_lines)/sizeof(failed_lines[0]),
+ sizeof(failed_lines[0]), summarize_comparator);
+ for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
+ if (failed_lines[i].line == 0)
+ break;
+ if (failed_lines[i].count > 1)
+ fprintf(stderr, "%s:%d: Failed %d times\n",
+ failed_filename, failed_lines[i].line,
+ failed_lines[i].count);
+ }
+ /* Clear the failure history for the next file. */
+ memset(failed_lines, 0, sizeof(failed_lines));
+}
+
+/* Set up a message to display only after a test fails. */
+void
+failure(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vsprintf(msg, fmt, ap);
+ va_end(ap);
+}
+
+/* Generic assert() just displays the failed condition. */
+void
+test_assert(const char *file, int line, int value, const char *condition, void *extra)
+{
+ ++assertions;
+ if (value) {
+ msg[0] = '\0';
+ return;
+ }
+ failures ++;
+ if (previous_failures(file, line))
+ return;
+ fprintf(stderr, "%s:%d: Assertion failed\n", file, line);
+ fprintf(stderr, " Condition: %s\n", condition);
+ report_failure(extra);
+}
+
+/* assertEqualInt() displays the values of the two integers. */
+void
+test_assert_equal_int(const char *file, int line,
+ int v1, const char *e1, int v2, const char *e2, void *extra)
+{
+ ++assertions;
+ if (v1 == v2) {
+ msg[0] = '\0';
+ return;
+ }
+ failures ++;
+ if (previous_failures(file, line))
+ return;
+ fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n",
+ file, line);
+ fprintf(stderr, " %s=%d\n", e1, v1);
+ fprintf(stderr, " %s=%d\n", e2, v2);
+ report_failure(extra);
+}
+
+/* assertEqualString() displays the values of the two strings. */
+void
+test_assert_equal_string(const char *file, int line,
+ const char *v1, const char *e1,
+ const char *v2, const char *e2,
+ void *extra)
+{
+ ++assertions;
+ if (v1 == NULL || v2 == NULL) {
+ if (v1 == v2) {
+ msg[0] = '\0';
+ return;
+ }
+ } else if (strcmp(v1, v2) == 0) {
+ msg[0] = '\0';
+ return;
+ }
+ failures ++;
+ if (previous_failures(file, line))
+ return;
+ fprintf(stderr, "%s:%d: Assertion failed: Strings not equal\n",
+ file, line);
+ fprintf(stderr, " %s = \"%s\"\n", e1, v1);
+ fprintf(stderr, " %s = \"%s\"\n", e2, v2);
+ report_failure(extra);
+}
+
+/* assertEqualWString() displays the values of the two strings. */
+void
+test_assert_equal_wstring(const char *file, int line,
+ const wchar_t *v1, const char *e1,
+ const wchar_t *v2, const char *e2,
+ void *extra)
+{
+ ++assertions;
+ if (wcscmp(v1, v2) == 0) {
+ msg[0] = '\0';
+ return;
+ }
+ failures ++;
+ if (previous_failures(file, line))
+ return;
+ fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n",
+ file, line);
+ fwprintf(stderr, L" %s = \"%ls\"\n", e1, v1);
+ fwprintf(stderr, L" %s = \"%ls\"\n", e2, v2);
+ report_failure(extra);
+}
+
+/*
+ * Pretty standard hexdump routine. As a bonus, if ref != NULL, then
+ * any bytes in p that differ from ref will be highlighted with '_'
+ * before and after the hex value.
+ */
+static void
+hexdump(const char *p, const char *ref, size_t l, size_t offset)
+{
+ size_t i, j;
+ char sep;
+
+ for(i=0; i < l; i+=16) {
+ fprintf(stderr, "%04x", i + offset);
+ sep = ' ';
+ for (j = 0; j < 16 && i + j < l; j++) {
+ if (ref != NULL && p[i + j] != ref[i + j])
+ sep = '_';
+ fprintf(stderr, "%c%02x", sep, p[i+j]);
+ if (ref != NULL && p[i + j] == ref[i + j])
+ sep = ' ';
+ }
+ for (; j < 16; j++) {
+ fprintf(stderr, "%c ", sep);
+ sep = ' ';
+ }
+ fprintf(stderr, "%c", sep);
+ for (j=0; j < 16 && i + j < l; j++) {
+ int c = p[i + j];
+ if (c >= ' ' && c <= 126)
+ fprintf(stderr, "%c", c);
+ else
+ fprintf(stderr, ".");
+ }
+ fprintf(stderr, "\n");
+ }
+}
+
+/* assertEqualMem() displays the values of the two memory blocks. */
+/* TODO: For long blocks, hexdump the first bytes that actually differ. */
+void
+test_assert_equal_mem(const char *file, int line,
+ const char *v1, const char *e1,
+ const char *v2, const char *e2,
+ size_t l, const char *ld, void *extra)
+{
+ ++assertions;
+ if (v1 == NULL || v2 == NULL) {
+ if (v1 == v2) {
+ msg[0] = '\0';
+ return;
+ }
+ } else if (memcmp(v1, v2, l) == 0) {
+ msg[0] = '\0';
+ return;
+ }
+ failures ++;
+ if (previous_failures(file, line))
+ return;
+ fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n",
+ file, line);
+ fprintf(stderr, " size %s = %d\n", ld, (int)l);
+ fprintf(stderr, " Dump of %s\n", e1);
+ hexdump(v1, v2, l < 32 ? l : 32, 0);
+ fprintf(stderr, " Dump of %s\n", e2);
+ hexdump(v2, v1, l < 32 ? l : 32, 0);
+ fprintf(stderr, "\n");
+ report_failure(extra);
+}
+
+void
+test_assert_empty_file(const char *f1fmt, ...)
+{
+ char f1[1024];
+ struct stat st;
+ va_list ap;
+
+ va_start(ap, f1fmt);
+ vsprintf(f1, f1fmt, ap);
+ va_end(ap);
+
+ if (stat(f1, &st) != 0) {
+ fprintf(stderr, "%s:%d: Could not stat: %s\n", test_filename, test_line, f1);
+ report_failure(NULL);
+ } else if (st.st_size > 0) {
+ fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1);
+ fprintf(stderr, " File size: %d\n", (int)st.st_size);
+ report_failure(NULL);
+ }
+}
+
+/* assertEqualFile() asserts that two files have the same contents. */
+/* TODO: hexdump the first bytes that actually differ. */
+void
+test_assert_equal_file(const char *f1, const char *f2pattern, ...)
+{
+ char f2[1024];
+ va_list ap;
+ char buff1[1024];
+ char buff2[1024];
+ int fd1, fd2;
+ int n1, n2;
+
+ va_start(ap, f2pattern);
+ vsprintf(f2, f2pattern, ap);
+ va_end(ap);
+
+ fd1 = open(f1, O_RDONLY);
+ fd2 = open(f2, O_RDONLY);
+ for (;;) {
+ n1 = read(fd1, buff1, sizeof(buff1));
+ n2 = read(fd2, buff2, sizeof(buff2));
+ if (n1 != n2)
+ break;
+ if (n1 == 0 && n2 == 0)
+ return;
+ if (memcmp(buff1, buff2, n1) != 0)
+ break;
+ }
+ fprintf(stderr, "%s:%d: Files are not identical\n", test_filename, test_line);
+ fprintf(stderr, " file1=\"%s\"\n", f1);
+ fprintf(stderr, " file2=\"%s\"\n", f2);
+ report_failure(test_extra);
+}
+
+
+/*
+ * Call standard system() call, but build up the command line using
+ * sprintf() conventions.
+ */
+int
+systemf(const char *fmt, ...)
+{
+ char buff[8192];
+ va_list ap;
+ int r;
+
+ va_start(ap, fmt);
+ vsprintf(buff, fmt, ap);
+ r = system(buff);
+ va_end(ap);
+ return (r);
+}
+
+/*
+ * Slurp a file into memory for ease of comparison and testing.
+ * Returns size of file in 'sizep' if non-NULL, null-terminates
+ * data in memory for ease of use.
+ */
+char *
+slurpfile(size_t * sizep, const char *fmt, ...)
+{
+ char filename[8192];
+ struct stat st;
+ va_list ap;
+ char *p;
+ ssize_t bytes_read;
+ int fd;
+ int r;
+
+ va_start(ap, fmt);
+ vsprintf(filename, fmt, ap);
+ va_end(ap);
+
+ fd = open(filename, O_RDONLY);
+ if (fd < 0) {
+ /* Note: No error; non-existent file is okay here. */
+ return (NULL);
+ }
+ r = fstat(fd, &st);
+ if (r != 0) {
+ fprintf(stderr, "Can't stat file %s\n", filename);
+ close(fd);
+ return (NULL);
+ }
+ p = malloc(st.st_size + 1);
+ if (p == NULL) {
+ fprintf(stderr, "Can't allocate %ld bytes of memory to read file %s\n", (long int)st.st_size, filename);
+ close(fd);
+ return (NULL);
+ }
+ bytes_read = read(fd, p, st.st_size);
+ if (bytes_read < st.st_size) {
+ fprintf(stderr, "Can't read file %s\n", filename);
+ close(fd);
+ free(p);
+ return (NULL);
+ }
+ p[st.st_size] = '\0';
+ if (sizep != NULL)
+ *sizep = (size_t)st.st_size;
+ close(fd);
+ return (p);
+}
+
+/*
+ * "list.h" is automatically generated; it just has a lot of lines like:
+ * DEFINE_TEST(function_name)
+ * It's used above to declare all of the test functions.
+ * We reuse it here to define a list of all tests (functions and names).
+ */
+#undef DEFINE_TEST
+#define DEFINE_TEST(n) { n, #n },
+struct { void (*func)(void); const char *name; } tests[] = {
+ #include "list.h"
+};
+
+/*
+ * Each test is run in a private work dir. Those work dirs
+ * do have consistent and predictable names, in case a group
+ * of tests need to collaborate. However, there is no provision
+ * for requiring that tests run in a certain order.
+ */
+static int test_run(int i, const char *tmpdir)
+{
+ int failures_before = failures;
+
+ if (!quiet_flag)
+ printf("%d: %s\n", i, tests[i].name);
+ /*
+ * Always explicitly chdir() in case the last test moved us to
+ * a strange place.
+ */
+ if (chdir(tmpdir)) {
+ fprintf(stderr,
+ "ERROR: Couldn't chdir to temp dir %s\n",
+ tmpdir);
+ exit(1);
+ }
+ /* Create a temp directory for this specific test. */
+ if (mkdir(tests[i].name, 0755)) {
+ fprintf(stderr,
+ "ERROR: Couldn't create temp dir ``%s''\n",
+ tests[i].name);
+ exit(1);
+ }
+ /* Chdir() to that work directory. */
+ if (chdir(tests[i].name)) {
+ fprintf(stderr,
+ "ERROR: Couldn't chdir to temp dir ``%s''\n",
+ tests[i].name);
+ exit(1);
+ }
+ /* Run the actual test. */
+ (*tests[i].func)();
+ /* Summarize the results of this test. */
+ summarize();
+ /* Return appropriate status. */
+ return (failures == failures_before ? 0 : 1);
+}
+
+static void usage(const char *program)
+{
+ static const int limit = sizeof(tests) / sizeof(tests[0]);
+ int i;
+
+ printf("Usage: %s [options] <test> <test> ...\n", program);
+ printf("Default is to run all tests.\n");
+ printf("Otherwise, specify the numbers of the tests you wish to run.\n");
+ printf("Options:\n");
+ printf(" -k Keep running after failures.\n");
+ printf(" Default: Core dump after any failure.\n");
+ printf(" -p <path> Path to executable to be tested.\n");
+ printf(" Default: path taken from " PROGRAM " environment variable.\n");
+ printf(" -q Quiet.\n");
+ printf(" -r <dir> Path to dir containing reference files.\n");
+ printf(" Default: Current directory.\n");
+ printf("Available tests:\n");
+ for (i = 0; i < limit; i++)
+ printf(" %d: %s\n", i, tests[i].name);
+ exit(1);
+}
+
+int main(int argc, char **argv)
+{
+ static const int limit = sizeof(tests) / sizeof(tests[0]);
+ int i, tests_run = 0, tests_failed = 0, opt;
+ time_t now;
+ char *refdir_alloc = NULL;
+ char *progname, *p;
+ char tmpdir[256];
+ char tmpdir_timestamp[256];
+
+ /*
+ * Name of this program, used to build root of our temp directory
+ * tree.
+ */
+ progname = p = argv[0];
+ while (*p != '\0') {
+ if (*p == '/')
+ progname = p + 1;
+ ++p;
+ }
+
+ /* Get the target program from environment, if available. */
+ testprog = getenv(PROGRAM);
+
+ /* Allow -k to be controlled through the environment. */
+ if (getenv(PROGRAM "_KEEP_GOING") != NULL)
+ dump_on_failure = 0;
+
+ /* Get the directory holding test files from environment. */
+ refdir = getenv(PROGRAM "_TEST_FILES");
+
+ /*
+ * Parse options.
+ */
+ while ((opt = getopt(argc, argv, "kp:qr:")) != -1) {
+ switch (opt) {
+ case 'k':
+ dump_on_failure = 0;
+ break;
+ case 'p':
+ testprog = optarg;
+ break;
+ case 'q':
+ quiet_flag++;
+ break;
+ case 'r':
+ refdir = optarg;
+ break;
+ case '?':
+ default:
+ usage(progname);
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ /*
+ * Sanity-check that our options make sense.
+ */
+ if (testprog == NULL)
+ usage(progname);
+
+
+ /*
+ * Create a temp directory for the following tests.
+ * Include the time the tests started as part of the name,
+ * to make it easier to track the results of multiple tests.
+ */
+ now = time(NULL);
+ for (i = 0; i < 1000; i++) {
+ strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
+ "%Y-%m-%dT%H.%M.%S",
+ localtime(&now));
+ sprintf(tmpdir, "/tmp/%s.%s-%03d", progname, tmpdir_timestamp, i);
+ if (mkdir(tmpdir,0755) == 0)
+ break;
+ if (errno == EEXIST)
+ continue;
+ fprintf(stderr, "ERROR: Unable to create temp directory %s\n",
+ tmpdir);
+ exit(1);
+ }
+
+ /*
+ * If the user didn't specify a directory for locating
+ * reference files, use the current directory for that.
+ */
+ if (refdir == NULL) {
+ systemf("/bin/pwd > %s/refdir", tmpdir);
+ refdir = refdir_alloc = slurpfile(NULL, "%s/refdir", tmpdir);
+ p = refdir + strlen(refdir);
+ while (p[-1] == '\n') {
+ --p;
+ *p = '\0';
+ }
+ }
+
+ /*
+ * Banner with basic information.
+ */
+ if (!quiet_flag) {
+ printf("Running tests in: %s\n", tmpdir);
+ printf("Reference files will be read from: %s\n", refdir);
+ printf("Running tests on: %s\n", testprog);
+ }
+
+ /*
+ * Run some or all of the individual tests.
+ */
+ if (argc == 0) {
+ /* Default: Run all tests. */
+ for (i = 0; i < limit; i++) {
+ if (test_run(i, tmpdir))
+ tests_failed++;
+ tests_run++;
+ }
+ } else {
+ while (*(argv) != NULL) {
+ i = atoi(*argv);
+ if (**argv < '0' || **argv > '9' || i < 0 || i >= limit) {
+ printf("*** INVALID Test %s\n", *argv);
+ usage(progname);
+ } else {
+ if (test_run(i, tmpdir))
+ tests_failed++;
+ tests_run++;
+ }
+ argv++;
+ }
+ }
+
+ /*
+ * Report summary statistics.
+ */
+ if (!quiet_flag) {
+ printf("\n");
+ printf("%d of %d tests reported failures\n",
+ tests_failed, tests_run);
+ printf(" Total of %d assertions checked.\n", assertions);
+ printf(" Total of %d assertions failed.\n", failures);
+ printf(" Total of %d assertions skipped.\n", skips);
+ }
+
+ free(refdir_alloc);
+
+ return (tests_failed);
+}
diff --git a/archivers/libarchive/files/tar/test/old/config.sh b/archivers/libarchive/files/tar/test/old/config.sh
new file mode 100755
index 00000000000..2d884f84096
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/old/config.sh
@@ -0,0 +1,75 @@
+#
+# Copyright (c) 2007 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(S) ``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(S) 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: src/usr.bin/tar/test/config.sh,v 1.2 2007/03/11 19:33:45 kientzle Exp $
+
+THISDIR=`cd \`dirname $0\`;/bin/pwd`
+
+# TESTDIR defaults to /tmp/bsdtar- + the name of the script
+if [ -z "$TESTDIR" ]; then
+ TESTDIR=/tmp/bsdtar-`echo $0 | sed -e 's|.*/||' -e 's|\.sh||' -e 's/[^a-z0-9_-]/_/g'`
+fi
+
+# Find bsdtar
+# The first three paths here are the usual locations of a bsdtar
+# that has just been built. The remaining paths might find a bsdtar
+# installed on the local system somewhere.
+if [ -z "$BSDTAR" ]; then
+ for T in "$THISDIR/../bsdtar" "$THISDIR/../../bsdtar" \
+ "/usr/obj`dirname $THISDIR`/bsdtar" "/usr/local/bin/bsdtar" \
+ "/usr/bin/bsdtar" "/usr/bin/tar" "bsdtar" "tar"
+ do
+ if ( /bin/sh -c "$T --version" | grep "bsdtar" ) >/dev/null 2>&1; then
+ BSDTAR="$T"
+ break
+ fi
+ done
+fi
+
+# Find GNU tar
+if [ -z "$GTAR" ]; then
+ for T in gtar gnutar tar /usr/local/bin/gtar* /usr/local/bin/gnutar* /usr/bin/gtar* /usr/bin/gnutar*
+ do
+ if ( /bin/sh -c "$T --version" | grep "GNU tar" ) >/dev/null 2>&1; then
+ GTAR="$T"
+ break
+ fi
+ done
+fi
+
+# Find CPIO
+if [ -z "$CPIO" ]; then
+ CPIO=cpio
+fi
+
+echo BSDTAR=$BSDTAR '('`$BSDTAR --version`')'
+echo GTAR=$GTAR '('`$GTAR --version | head -n 1`')'
+echo CPIO=$CPIO '('`$CPIO --version`')'
+
+# Remove and recreate the directory we'll use for these tests
+rm -rf $TESTDIR
+mkdir -p $TESTDIR || exit 1
+cd $TESTDIR || exit 1
+echo TESTDIR=$TESTDIR
+
diff --git a/archivers/libarchive/files/tar/test/old/test-acl.sh b/archivers/libarchive/files/tar/test/old/test-acl.sh
new file mode 100755
index 00000000000..818607dcd13
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/old/test-acl.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+# Copyright (c) 2007 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(S) ``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(S) 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: src/usr.bin/tar/test/test-acl.sh,v 1.1 2007/03/11 10:36:42 kientzle Exp $
+
+# Exercise copying of ACLs
+echo "ACL handling"
+# Basic test configuration
+TESTDIR=/mnt/da0/acl-test
+. `dirname $0`/config.sh
+
+# Create some files with ACLs
+mkdir original
+cd original
+touch a
+chmod 664 a
+setfacl -m user:bin:rw- -m group:78:r-x a \
+ || echo XXX failed to set access ACL on a XXX
+mkdir d
+chmod 775 d
+setfacl -m user:daemon:rw- -m group:78:r-x d \
+ || echo XXX failed to set access ACL on d XXX
+setfacl -d -m user::rw- -m group::rw- -m other::rw- -m group:79:r-- d \
+ || echo XXX failed to set default ACL on d XXX
+cd ..
+
+# Copy the dir with -p
+echo " -p preserves ACLs"
+mkdir copy
+(cd original && ${BSDTAR} -cf - .) | (cd copy; ${BSDTAR} -xpf -)
+
+# Verify the ACLs
+cd copy
+if [ "user::rw- user:bin:rw- group::rw- group:78:r-x mask::rwx other::r--" \
+ = "`echo \`getfacl -q a\``" ]; then
+ # It matches!!
+else
+ echo XXX a has wrong ACL XXX `getfacl -q a`
+fi
+
+if [ "user::rwx user:daemon:rw- group::rwx group:78:r-x mask::rwx other::r-x" \
+ = "`echo \`getfacl -q d\``" ]; then
+ # It matches!!
+else
+ echo XXX d has wrong ACL XXX `getfacl -q d`
+fi
+
+
+if [ "user::rw- group::rw- group:79:r-- mask::rw- other::rw-" \
+ = "`echo \`getfacl -q -d d\``" ]; then
+ # It matches!!
+else
+ echo XXX d has wrong ACL XXX `getfacl -q -d d`
+fi
+
diff --git a/archivers/libarchive/files/tar/test/old/test-basic.sh b/archivers/libarchive/files/tar/test/old/test-basic.sh
new file mode 100755
index 00000000000..0564bc7220b
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/old/test-basic.sh
@@ -0,0 +1,432 @@
+#!/bin/sh
+# Copyright (c) 2007 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(S) ``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(S) 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: src/usr.bin/tar/test/test-basic.sh,v 1.5 2007/04/18 04:35:17 kientzle Exp $
+
+# Generate a dir tree with various data and copy it using
+# a variety of tools and flags. This mostly checks that
+# we can read archives we write and those written by gtar
+# and cpio.
+
+echo "Basic archiving/copy interoperability tests"
+# Basic configuration
+. `dirname $0`/config.sh
+
+# We need some files to archive; generate some random files and files
+# with very long names and other special attributes
+mkdir -p original
+cd original
+# Create some long files with random text data
+for f in f0 f1 f2 f3 f4 f5 f6 f7 f8 f9; do
+ dd if=/dev/urandom bs=1k count=100 2>/dev/null | od > $f
+done
+# A sparse file
+dd if=/dev/zero of=sparse bs=1 count=1 oseek=100000 2>/dev/null
+# Files with long names
+touch a
+touch ab
+touch abc
+touch abcd
+touch abcde
+touch abcdef
+touch abcdefg
+touch abcdefgh
+touch abcdefghi
+touch abcdefghij
+touch abcdefghijk
+touch abcdefghijkl
+touch abcdefghijklm
+touch abcdefghijklmn
+touch abcdefghijklmno
+touch abcdefghijklmnop
+touch abcdefghijklmnopq
+touch abcdefghijklmnopqr
+touch abcdefghijklmnopqrs
+touch abcdefghijklmnopqrst
+touch abcdefghijklmnopqrstu
+touch abcdefghijklmnopqrstuv
+touch abcdefghijklmnopqrstuvw
+touch abcdefghijklmnopqrstuvwx
+touch abcdefghijklmnopqrstuvwxy
+touch abcdefghijklmnopqrstuvwxyz
+
+touch abcdefghijklmnopqrstuvwxyza
+touch abcdefghijklmnopqrstuvwxyzab
+touch abcdefghijklmnopqrstuvwxyzabc
+touch abcdefghijklmnopqrstuvwxyzabcd
+touch abcdefghijklmnopqrstuvwxyzabcde
+touch abcdefghijklmnopqrstuvwxyzabcdef
+touch abcdefghijklmnopqrstuvwxyzabcdefg
+touch abcdefghijklmnopqrstuvwxyzabcdefgh
+touch abcdefghijklmnopqrstuvwxyzabcdefghi
+touch abcdefghijklmnopqrstuvwxyzabcdefghij
+touch abcdefghijklmnopqrstuvwxyzabcdefghijk
+touch abcdefghijklmnopqrstuvwxyzabcdefghijkl
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklm
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmn
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmno
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnop
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopq
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyza
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzab
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcde
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklm
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmn
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnop
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopq
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrst
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvw
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy
+touch abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+
+# A file with a long pathname
+mkdir -p 1abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+cd ..
+
+# Basic test of archiving/dearchiving
+echo " bsdtar -c | bsdtar -x"
+mkdir copy-default
+(cd original && ${BSDTAR} -cf - .) | (cd copy-default; ${BSDTAR} -xf -)
+(diff -r original copy-default || echo XXX FAILED XXX 1>&2) | head
+
+# Exercise gzip compression (test compressed output with gunzip -t
+echo " bsdtar -cz | gunzip -t"
+(cd original && ${BSDTAR} -czf - .) | gunzip -tq
+
+# Ensure our compression works with gunzip program
+echo " bsdtar -cz | gunzip | bsdtar -x"
+mkdir copy-gzip2
+(cd original && ${BSDTAR} -czf - .) | gunzip -q | (cd copy-gzip2; ${BSDTAR} -xf -)
+(diff -r original copy-gzip2 || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure our decompression works with gzip program
+echo " bsdtar -c | gzip | bsdtar -x"
+mkdir copy-gunzip
+(cd original && ${BSDTAR} -cf - .) | gzip | (cd copy-gunzip; ${BSDTAR} -xf -)
+(diff -r original copy-gunzip || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure our gzip compression/decompression work with each other
+echo " bsdtar -cz | bsdtar -x"
+mkdir copy-gzip-gunzip
+(cd original && ${BSDTAR} -czf - .) | (cd copy-gzip-gunzip; ${BSDTAR} -xf -)
+(diff -r original copy-gzip-gunzip || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure our decompression works with bzip2 program
+echo " bsdtar -c | bzip2 | bsdtar -x"
+mkdir copy-bunzip
+(cd original && ${BSDTAR} -cf - .) | bzip2 | (cd copy-bunzip; ${BSDTAR} -xf -)
+(diff -r original copy-bunzip || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure our compression works with bunzip2 program
+echo " bsdtar -cy | bunzip2 | bsdtar -x"
+mkdir copy-bzip2
+(cd original && ${BSDTAR} -cyf - .) | bunzip2 -q | (cd copy-bzip2; ${BSDTAR} -xf -)
+(diff -r original copy-bzip2 || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure our bzip2 compression/decompression work with each other
+echo " bsdtar -cy | bsdtar -x"
+mkdir copy-bzip2-bunzip2
+(cd original && ${BSDTAR} -cyf - .) | (cd copy-bzip2-bunzip2; ${BSDTAR} -xf -)
+(diff -r original copy-bzip2-bunzip2 || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure that archive listing works
+echo " bsdtar -c | bsdtar -t"
+(cd original && find .) | sort > list-original
+(cd original && ${BSDTAR} -cf - .) | ${BSDTAR} -tf - | sed 's|/$||' | sort > list-default
+(diff list-original list-default || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure that listing of deflated archives works
+echo " bsdtar -cz | bsdtar -t"
+(cd original && ${BSDTAR} -czf - .) | ${BSDTAR} -tf - | sed 's|/$||' | sort > list-gzip
+(diff list-original list-gzip || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure that listing of bzip2ed archives works
+echo " bsdtar -cy | bsdtar -t"
+(cd original && ${BSDTAR} -cyf - .) | ${BSDTAR} -tf - | sed 's|/$||' | sort > list-bzip2
+(diff list-original list-bzip2 || echo XXX FAILED XXX 1>&2) | head
+
+# Filtering exercises different areas of the library.
+echo " Convert tar archive to a tar archive"
+mkdir filter-tar-tar
+(cd original && ${BSDTAR} -cf - .) | ${BSDTAR} -cf - @- | (cd filter-tar-tar; ${BSDTAR} -xf -)
+(diff -r original filter-tar-tar || echo XXX FAILED XXX 1>&2) | head
+
+# Make sure that reading and writing a tar archive doesn't change it.
+echo " bsdtar -cf- @- | cmp"
+(cd original && ${BSDTAR} -cf - .) > original.tar
+${BSDTAR} -cf - @- < original.tar | cmp - original.tar || echo XXX FAILED XXX
+
+# Filtering as format conversion
+echo " Convert tar archive to cpio archive"
+mkdir filter-tar-cpio
+(cd original && ${BSDTAR} -cf - .) | ${BSDTAR} -cf - --format=cpio @- | (cd filter-tar-cpio; ${BSDTAR} -xf -)
+(diff -r original filter-tar-cpio || echo XXX FAILED XXX 1>&2) | head
+
+# Test basic --include selection logic
+echo " Convert tar to cpio with selection"
+mkdir filter-tar-selected
+(cd original && ${BSDTAR} -cf - .) | ${BSDTAR} -cf - --format=cpio --include=./f3 @- | (cd filter-tar-selected; ${BSDTAR} -xf -)
+(diff -r original/f3 filter-tar-selected/f3 || echo XXX FAILED XXX 1>&2) | head
+# Should be no files in copy except for 'f3'
+(cd filter-tar-selected ; ls | grep -v f3 | grep .) && echo XXX FAILED XXX
+
+# Test --include with wildcards
+echo " Convert tar to cpio selecting with wildcards"
+mkdir filter-tar-selected2
+(cd original && ${BSDTAR} -cf - .) | ${BSDTAR} -cf - --format=cpio --include='./f*' @- | (cd filter-tar-selected2; ${BSDTAR} -xf -)
+for f in f1 f2 f3 f4 f5 f6 f7 f8 f9; do
+ (diff -r original/$f filter-tar-selected2/$f || echo XXX FAILED XXX 1>&2) | head
+done
+# Should be no files in copy except for 'f[0-9]'
+(cd filter-tar-selected2 ; ls | grep -v 'f[0-9]' | grep .) && echo XXX FAILED XXX
+
+# Check read/write of basic odc cpio format
+echo " bsdtar -c --format=cpio | bsdtar -x"
+mkdir copy-cpio
+(cd original && ${BSDTAR} -cf - --format cpio .) | (cd copy-cpio; ${BSDTAR} -xf -)
+(diff -r original copy-cpio || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure we can read gtar archives
+echo " gtar -c | bsdtar -x"
+mkdir copy-gtar
+(cd original && ${GTAR} -cf - .) | (cd copy-gtar; ${BSDTAR} -xf -)
+(diff -r original copy-gtar || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure we can read svr4crc cpio archives
+echo " cpio -H crc | bsdtar -x"
+mkdir copy-svr4crc
+(cd original && find . | ${CPIO} -o -H crc 2>/dev/null) | (cd copy-svr4crc; ${BSDTAR} -xf -)
+(diff -r original copy-svr4crc || echo XXX FAILED XXX 1>&2) | head
+
+# Ensure we generate proper shar output
+echo " bsdtar -c --format=shar | /bin/sh"
+mkdir copy-shar
+(cd original && ${BSDTAR} -cf - --format=shar --exclude=sparse .) | (cd copy-shar; /bin/sh >/dev/null)
+(diff -r --exclude=sparse original copy-shar || echo XXX FAILED XXX 1>&2) | head
+
+# Check that -u (update) picks up no new files
+echo " bsdtar -u doesn't pick up unchanged files"
+(cd original && ${BSDTAR} -cf ../test-u.tar -b 1 .)
+cp test-u.tar test-u1.tar
+(cd original && ${BSDTAR} -uf ../test-u1.tar .)
+(diff test-u.tar test-u1.tar || echo XXX FAILED XXX 1>&2) | head
+
+# Check that -u (update) does pick up actual changed files
+echo " bsdtar -u does pick up changed files"
+(cd original && echo hello >>f0)
+cp test-u.tar test-u2.tar
+(cd original && ${BSDTAR} -uf ../test-u2.tar .)
+# All this really tests is that the archive did change.
+cmp -s test-u.tar test-u2.tar && echo XXX FAILED XXX
+# Now, unpack the archive and verify the contents (including the change to f0)
+mkdir copy-u-test2
+(cd copy-u-test2 && ${BSDTAR} -xf ../test-u2.tar)
+(diff -r original copy-u-test2 || echo XXX FAILED XXX 1>&2) | head
diff --git a/archivers/libarchive/files/tar/test/old/test-deep-dir.sh b/archivers/libarchive/files/tar/test/old/test-deep-dir.sh
new file mode 100755
index 00000000000..22cf1c8f826
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/old/test-deep-dir.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+# Copyright (c) 2007 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(S) ``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(S) 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: src/usr.bin/tar/test/test-deep-dir.sh,v 1.1 2007/03/11 10:36:42 kientzle Exp $
+
+# Stress the deep directory logic; the actual depth here seems to
+# be limited by the shell. This should be restructured to get around
+# that limit (possibly by using perl to build the deep tree?)
+echo Deep directory tests
+
+# Basic test configuration
+. `dirname $0`/config.sh
+
+# Create a deep dir (shell seems to be limited by PATH_MAX)
+mkdir original
+cd original
+I=0
+while [ $I -lt 200 ]
+do
+ mkdir a$I
+ cd a$I
+ I=$(($I + 1))
+done
+while [ $I -gt 0 ] ; do cd ..; I=$(($I - 1)); done
+cd ..
+
+# Copy this using bsdtar
+echo " tar -c | tar -x"
+mkdir copy
+(cd original; ${BSDTAR} -cf - .) | (cd copy; ${BSDTAR} -xf -)
+diff -r original copy || echo XXX FAILURE XXX
+
+# Copy gtar->bsdtar
+echo " gtar -c | tar -x"
+mkdir copy-gtar
+(cd original; ${GTAR} -cf - .) | (cd copy-gtar; ${BSDTAR} -xf -)
+diff -r original copy-gtar || echo XXX FAILURE XXX
+cd ..
+
diff --git a/archivers/libarchive/files/tar/test/old/test-flags.sh b/archivers/libarchive/files/tar/test/old/test-flags.sh
new file mode 100755
index 00000000000..bfbf542163c
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/old/test-flags.sh
@@ -0,0 +1,74 @@
+#!/bin/sh
+# Copyright (c) 2007 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(S) ``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(S) 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: src/usr.bin/tar/test/test-flags.sh,v 1.1 2007/03/11 10:36:42 kientzle Exp $
+
+# Exercise copying of file flags
+echo "File Flag handling"
+# Basic test configuration
+. `dirname $0`/config.sh
+
+# Create some files with various flags set
+mkdir original
+FLAGS='uchg opaque nodump uappnd'
+for f in $FLAGS; do
+ touch original/test.$f
+ chflags $f original/test.$f
+done
+#ls -ol ${TESTDIR}/original
+
+# Copy the dir with -p
+echo " -p preserves flags"
+mkdir copy
+(cd original && ${BSDTAR} -cf - .) | (cd copy; ${BSDTAR} -xpf -)
+# Verify that the flags are set
+for f in $FLAGS; do
+ [ "$f" = `ls -ol copy/test.$f | awk '{print $5}'` ] \
+ || echo XXX FAIL: $f not preserved with -p XXX
+done
+#ls -ol ${TESTDIR}/copy
+
+# Copy the dir without -p
+echo " flags omitted without -p"
+mkdir copy2
+(cd original && ${BSDTAR} -cf - .) | (cd copy2; ${BSDTAR} -xf -)
+# Verify that the flags are not set
+for f in $FLAGS; do
+ [ "$f" = `ls -ol copy2/test.$f | awk '{print $5}'` ] \
+ && echo XXX FAIL: $f copied without -p XXX
+done
+#ls -ol ${TESTDIR}/copy2
+
+# Strip off the flags so we can clean this directory on the next test
+for f in $FLAGS; do
+ if [ $f = 'nodump' ]; then
+ chflags dump original/test.$f
+ chflags dump copy/test.$f
+ else
+ chflags no$f original/test.$f
+ chflags no$f copy/test.$f
+ fi
+done
+cd ..
+
diff --git a/archivers/libarchive/files/tar/test/old/test-nodump.sh b/archivers/libarchive/files/tar/test/old/test-nodump.sh
new file mode 100755
index 00000000000..1d21b49032d
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/old/test-nodump.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# Copyright (c) 2007 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(S) ``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(S) 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: src/usr.bin/tar/test/test-nodump.sh,v 1.1 2007/03/11 10:36:42 kientzle Exp $
+
+# Test that archiving obeys the 'nodump' flag
+echo "Verify 'nodump'"
+# Basic test configuration
+. `dirname $0`/config.sh
+
+# Create some sample files, 'b' is marked nodump
+mkdir original
+cd original
+touch a
+touch b
+touch c
+# 'chflags' on FreeBSD, 'chattr' on Linux
+( chflags nodump b || chattr +d b ) >/dev/null 2>&1 || echo XXX NO chflags/chattr command XXX
+
+# Copy files with --nodump
+cd ..
+mkdir copy
+(cd original && ${BSDTAR} -cf - --nodump .) | (cd copy; ${BSDTAR} -xf -)
+
+# Verify that 'b' wasn't copied
+echo " File marked nodump wasn't copied"
+if [ -e copy/b ] ; then echo XXX Copied nodump file XXX; fi
+echo " File not marked nodump was copied"
+if [ \! -e copy/a ] ; then echo XXX Failed to copy non-nodump file a XXX; fi
+diff -r --exclude=b original copy || echo XXX FAILURE XXX
+cd ..
diff --git a/archivers/libarchive/files/tar/test/old/test-overwrite.sh b/archivers/libarchive/files/tar/test/old/test-overwrite.sh
new file mode 100755
index 00000000000..b9208905b57
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/old/test-overwrite.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+# Copyright (c) 2007 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(S) ``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(S) 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: src/usr.bin/tar/test/test-overwrite.sh,v 1.1 2007/03/11 10:36:42 kientzle Exp $
+
+echo "Test overwrite avoidance"
+. `dirname $0`/config.sh
+
+# Create a file with some data.
+# This ensures that test.tar actually has some data in it
+# by the time tar tries to add it to itself.
+dd if=/dev/urandom of=a bs=1k count=100 >/dev/null 2>&1
+
+# Now try to implicitly add archive to itself
+${BSDTAR} -cf test.tar . || echo XXX FAILED XXX
+
+# Create another file
+dd if=/dev/urandom of=b bs=1k count=100 >/dev/null 2>&1
+
+# Try again.
+${BSDTAR} -cf test.tar . || echo XXX FAILED XXX
+
+# Extract the archive and check that the two files got archived, despite the warning
+mkdir compare
+cd compare
+${BSDTAR} -xf ../test.tar
+cmp a ../a || echo XXX a didn't archive correctly XXX
+cmp b ../b || echo XXX b didn't archive correctly XXX
+
+# TODO: Test overwrite avoidance on extract
diff --git a/archivers/libarchive/files/tar/test/old/test-utf8.sh b/archivers/libarchive/files/tar/test/old/test-utf8.sh
new file mode 100755
index 00000000000..c1b18a69048
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/old/test-utf8.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Copyright (c) 2007 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(S) ``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(S) 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: src/usr.bin/tar/test/test-utf8.sh,v 1.1 2007/03/11 10:36:42 kientzle Exp $
+
+echo "Test UTF8 filenames"
+. `dirname $0`/config.sh
+
+# Create some files with names in UTF8
+export LC_ALL=en_US.UTF-8
+touch "Greek: Γειά σας"
+touch "Hebrew: שלום"
+touch "Russian: Здравствуйте!"
+touch "Japanese: �����, コンニチハ"
+touch "Chinese: ��"
+
+tar -cf test.tar .
+
+# TODO: Verify the resulting archive \ No newline at end of file
diff --git a/archivers/libarchive/files/tar/test/test.h b/archivers/libarchive/files/tar/test/test.h
new file mode 100644
index 00000000000..a19d44c2184
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test.h
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2003-2006 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(S) ``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(S) 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: src/lib/libarchive/test/test.h,v 1.6 2007/07/14 17:52:01 kientzle Exp $
+ */
+
+/* Every test program should #include "test.h" as the first thing. */
+
+/*
+ * The goal of this file (and the matching test.c) is to
+ * simplify the very repetitive test-*.c test programs.
+ */
+
+#define _FILE_OFFSET_BITS 64
+
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <wchar.h>
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
+
+#if defined(HAVE_CONFIG_H)
+/* Most POSIX platforms use the 'configure' script to build config.h */
+#include "../../config.h"
+#elif defined(__FreeBSD__)
+/* Building as part of FreeBSD system requires a pre-built config.h. */
+#include "../config_freebsd.h"
+#elif defined(_WIN32)
+/* Win32 can't run the 'configure' script. */
+#include "../config_windows.h"
+#else
+/* Warn if the library hasn't been (automatically or manually) configured. */
+#error Oops: No config.h and no pre-built configuration in test.h.
+#endif
+
+/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
+#ifdef __FreeBSD__
+#include <sys/cdefs.h> /* For __FBSDID */
+#else
+#define __FBSDID(a) /* null */
+#endif
+
+/*
+ * Redefine DEFINE_TEST for use in defining the test functions.
+ */
+#undef DEFINE_TEST
+#define DEFINE_TEST(name) void name(void); void name(void)
+
+/* An implementation of the standard assert() macro */
+#define assert(e) test_assert(__FILE__, __LINE__, (e), #e, NULL)
+
+/* Assert two integers are the same. Reports value of each one if not. */
+#define assertEqualInt(v1,v2) \
+ test_assert_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+
+/* Assert two strings are the same. Reports value of each one if not. */
+#define assertEqualString(v1,v2) \
+ test_assert_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+/* As above, but v1 and v2 are wchar_t * */
+#define assertEqualWString(v1,v2) \
+ test_assert_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+/* As above, but raw blocks of bytes. */
+#define assertEqualMem(v1, v2, l) \
+ test_assert_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
+/* Assert two files are the same; allow printf-style expansion of second name.
+ * See below for comments about variable arguments here...
+ */
+#define assertEqualFile \
+ test_setup(__FILE__, __LINE__);test_assert_equal_file
+/* Assert that a file is empty; supports printf-style arguments. */
+#define assertEmptyFile \
+ test_setup(__FILE__, __LINE__);test_assert_empty_file
+
+/*
+ * This would be simple with C99 variadic macros, but I don't want to
+ * require that. Instead, I insert a function call before each
+ * skipping() call to pass the file and line information down. Crude,
+ * but effective.
+ */
+#define skipping \
+ test_setup(__FILE__, __LINE__);test_skipping
+
+/* Function declarations. These are defined in test_utility.c. */
+void failure(const char *fmt, ...);
+void test_setup(const char *, int);
+void test_skipping(const char *fmt, ...);
+void test_assert(const char *, int, int, const char *, void *);
+void test_assert_empty_file(const char *, ...);
+void test_assert_equal_file(const char *, const char *, ...);
+void test_assert_equal_int(const char *, int, int, const char *, int, const char *, void *);
+void test_assert_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *);
+void test_assert_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
+void test_assert_equal_mem(const char *, int, const char *, const char *, const char *, const char *, size_t, const char *, void *);
+
+/* Like sprintf, then system() */
+int systemf(const char * fmt, ...);
+
+/* Suck file into string allocated via malloc(). Call free() when done. */
+/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
+char *slurpfile(size_t *, const char *fmt, ...);
+
+/*
+ * Global vars
+ */
+
+/* Directory holding reference files. */
+char *refdir;
+
+/*
+ * Special interfaces for bsdtar test harness.
+ */
+
+/* Pathname of exe to be tested. */
+char *testprog;
+
diff --git a/archivers/libarchive/files/tar/test/test_basic.c b/archivers/libarchive/files/tar/test/test_basic.c
new file mode 100644
index 00000000000..50be2890c0e
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_basic.c
@@ -0,0 +1,158 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+
+static void
+basic_tar(const char *target, const char *pack_options, const char *unpack_options)
+{
+ struct stat st, st2;
+ char buff[128];
+ int r;
+
+ assertEqualInt(0, mkdir(target, 0775));
+
+ /* Use the tar program to create an archive. */
+ r = systemf("%s cf - %s `cat filelist` >%s/archive 2>%s/pack.err", testprog, pack_options, target, target);
+ failure("Error invoking %s cf -", testprog, pack_options);
+ assertEqualInt(r, 0);
+
+ chdir(target);
+
+ /* Verify that nothing went to stderr. */
+ assertEmptyFile("pack.err");
+
+ /*
+ * Use tar to unpack the archive into another directory.
+ */
+ r = systemf("%s xf archive %s >unpack.out 2>unpack.err", testprog, unpack_options);
+ failure("Error invoking %s xf archive %s", testprog, unpack_options);
+ assertEqualInt(r, 0);
+
+ /* Verify that nothing went to stderr. */
+ assertEmptyFile("unpack.err");
+
+ /*
+ * Verify unpacked files.
+ */
+
+ /* Regular file with 2 links. */
+ r = lstat("file", &st);
+ failure("Failed to stat file %s/file, errno=%d", target, errno);
+ assertEqualInt(r, 0);
+ if (r == 0) {
+ assert(S_ISREG(st.st_mode));
+ assertEqualInt(0644, st.st_mode & 0777);
+ assertEqualInt(10, st.st_size);
+ failure("file %s/file", target);
+ assertEqualInt(2, st.st_nlink);
+ }
+
+ /* Another name for the same file. */
+ r = lstat("linkfile", &st2);
+ failure("Failed to stat file %s/linkfile, errno=%d", target, errno);
+ assertEqualInt(r, 0);
+ if (r == 0) {
+ assert(S_ISREG(st2.st_mode));
+ assertEqualInt(0644, st2.st_mode & 0777);
+ assertEqualInt(10, st2.st_size);
+ failure("file %s/linkfile", target);
+ assertEqualInt(2, st2.st_nlink);
+ /* Verify that the two are really hardlinked. */
+ assertEqualInt(st.st_dev, st2.st_dev);
+ failure("%s/linkfile and %s/file aren't really hardlinks", target, target);
+ assertEqualInt(st.st_ino, st2.st_ino);
+ }
+
+ /* Symlink */
+ r = lstat("symlink", &st);
+ failure("Failed to stat file %s/symlink, errno=%d", target, errno);
+ assertEqualInt(r, 0);
+ if (r == 0) {
+ failure("symlink should be a symlink; actual mode is %o",
+ st.st_mode);
+ assert(S_ISLNK(st.st_mode));
+ if (S_ISLNK(st.st_mode)) {
+ r = readlink("symlink", buff, sizeof(buff));
+ assertEqualInt(r, 4);
+ buff[r] = '\0';
+ assertEqualString(buff, "file");
+ }
+ }
+
+ /* dir */
+ r = lstat("dir", &st);
+ if (r == 0) {
+ assertEqualInt(r, 0);
+ assert(S_ISDIR(st.st_mode));
+ assertEqualInt(0775, st.st_mode & 0777);
+ }
+
+ chdir("..");
+}
+
+DEFINE_TEST(test_basic)
+{
+ int fd;
+ int filelist;
+ int oldumask;
+
+ oldumask = umask(0);
+
+ /*
+ * Create an assortment of files on disk.
+ */
+ filelist = open("filelist", O_CREAT | O_WRONLY, 0644);
+
+ /* File with 10 bytes content. */
+ fd = open("file", O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(10, write(fd, "123456789", 10));
+ close(fd);
+ write(filelist, "file\n", 5);
+
+ /* hardlink to above file. */
+ assertEqualInt(0, link("file", "linkfile"));
+ write(filelist, "linkfile\n", 9);
+
+ /* Symlink to above file. */
+ assertEqualInt(0, symlink("file", "symlink"));
+ write(filelist, "symlink\n", 8);
+
+ /* Directory. */
+ assertEqualInt(0, mkdir("dir", 0775));
+ write(filelist, "dir\n", 4);
+ /* All done. */
+ close(filelist);
+
+ /* Archive/dearchive with a variety of options. */
+ basic_tar("copy", "", "");
+ /* tar doesn't handle cpio symlinks correctly */
+ /* basic_tar("copy_odc", "--format=odc", ""); */
+ basic_tar("copy_ustar", "--format=ustar", "");
+
+ umask(oldumask);
+}
diff --git a/archivers/libarchive/files/tar/test/test_copy.c b/archivers/libarchive/files/tar/test/test_copy.c
new file mode 100644
index 00000000000..83fbd76440f
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_copy.c
@@ -0,0 +1,279 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+static void
+create_tree(void)
+{
+ char buff[260];
+ char buff2[260];
+ int i;
+ int fd;
+
+ assertEqualInt(0, mkdir("original", 0775));
+ chdir("original");
+
+ buff[0] = 'f';
+ buff[1] = '_';
+ for (i = 0; i < 200; i++) {
+ /* Create a file named "f_abcdef..." */
+ buff[i + 2] = 'a' + (i % 26);
+ buff[i + 3] = '\0';
+ fd = open(buff, O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ assertEqualInt(i + 3, write(fd, buff, strlen(buff)));
+ close(fd);
+
+ /* Create a link named "l_abcdef..." to the above. */
+ strcpy(buff2, buff);
+ buff2[0] = 'l';
+ assertEqualInt(0, link(buff, buff2));
+
+ /* Create a link named "m_abcdef..." to the above. */
+ strcpy(buff2, buff);
+ buff2[0] = 'm';
+ assertEqualInt(0, link(buff, buff2));
+
+ /* Create a symlink named "s_abcdef..." to the above. */
+ buff2[0] = 's';
+ assertEqualInt(0, symlink(buff, buff2));
+
+ /* Create a dir named "d_abcdef...". */
+ buff2[0] = 'd';
+ assertEqualInt(0, mkdir(buff2, 0775));
+ }
+
+ chdir("..");
+}
+
+#define LIMIT_NONE 0
+#define LIMIT_USTAR 1
+
+static void
+verify_tree(int limit)
+{
+ struct stat st, st2;
+ char buff[260];
+ char buff2[260];
+ int i, r;
+ int fd;
+ int len;
+ const char *p;
+ DIR *d;
+ struct dirent *de;
+
+ /* Generate the names we know should be there and verify them. */
+ for (i = 0; i < 200; i++) {
+ /* Verify a file named "f_abcdef..." */
+ buff[0] = 'f';
+ buff[1] = '_';
+ buff[i + 2] = 'a' + (i % 26);
+ buff[i + 3] = '\0';
+ if (limit != LIMIT_USTAR || strlen(buff) <= 100) {
+ fd = open(buff, O_RDONLY);
+ failure("Couldn't open \"%s\": %s",
+ buff, strerror(errno));
+ assert(fd >= 0);
+ len = read(fd, buff2, i + 10);
+ close(fd);
+ assertEqualInt(len, i + 3);
+ /* Verify contents of 'buff2' */
+ buff2[len] = '\0';
+ assertEqualString(buff, buff2);
+ /* stat() file and get dev/ino for next check */
+ assertEqualInt(0, lstat(buff, &st));
+ }
+
+ /*
+ * ustar allows 100 chars for links, and we have
+ * "original/" as part of the name, so the link
+ * names here can't exceed 91 chars.
+ */
+ if (limit != LIMIT_USTAR || strlen(buff) <= 91) {
+ /* Verify hardlink "l_abcdef..." */
+ buff[0] = 'l';
+ assertEqualInt(0, (r = lstat(buff, &st2)));
+ if (r == 0) {
+ assertEqualInt(st2.st_dev, st.st_dev);
+ assertEqualInt(st2.st_ino, st.st_ino);
+ }
+
+ /* Verify hardlink "m_abcdef..." */
+ buff[0] = 'm';
+ assertEqualInt(0, (r = lstat(buff, &st2)));
+ if (r == 0) {
+ assertEqualInt(st2.st_dev, st.st_dev);
+ assertEqualInt(st2.st_ino, st.st_ino);
+ }
+ }
+
+ /*
+ * Symlink text doesn't include the 'original/' prefix,
+ * so the limit here is 100 characters.
+ */
+ /* Verify symlink "s_abcdef..." */
+ buff[0] = 's';
+ if (limit != LIMIT_USTAR || strlen(buff) <= 100) {
+ /* This is a symlink. */
+ assertEqualInt(0, lstat(buff, &st2));
+ assert(S_ISLNK(st2.st_mode));
+ /* This is a symlink to the file above. */
+ assertEqualInt(0, stat(buff, &st2));
+ assertEqualInt(st2.st_dev, st.st_dev);
+ assertEqualInt(st2.st_ino, st.st_ino);
+ }
+
+ /* Verify dir "d_abcdef...". */
+ buff[0] = 'd';
+ if (limit != LIMIT_USTAR || strlen(buff) <= 100) {
+ /* This is a dir. */
+ assertEqualInt(0, lstat(buff, &st2));
+ assert(S_ISDIR(st2.st_mode));
+ /* TODO: opendir/readdir this directory and
+ * make sure it's empty.
+ */
+ }
+ }
+
+ /* Now make sure nothing is there that shouldn't be. */
+ d = opendir(".");
+ while ((de = readdir(d)) != NULL) {
+ p = de->d_name;
+ switch(p[0]) {
+ case 'l': case 'm':
+ if (limit == LIMIT_USTAR)
+ assert(strlen(p) <= 91);
+ case 'd': case 'f': case 's':
+ if (limit == LIMIT_USTAR)
+ assert(strlen(p) <= 100);
+ /* Our files have very particular filename patterns. */
+ assert(p[1] == '_' && p[2] == 'a');
+ assert(p[2] == 'a');
+ p += 2;
+ for (i = 0; p[i] != '\0' && i < 200; i++)
+ assert(p[i] == 'a' + (i % 26));
+ assert(p[i] == '\0');
+ break;
+ case '.':
+ assert(p[1] == '\0' || (p[1] == '.' && p[2] == '\0'));
+ break;
+ default:
+ failure("File %s shouldn't be here", p);
+ assert(0);
+ }
+
+ }
+ closedir(d);
+}
+
+static void
+copy_basic(void)
+{
+ int r;
+
+ assertEqualInt(0, mkdir("plain", 0775));
+ chdir("plain");
+
+ /*
+ * Use the tar program to create an archive.
+ */
+ r = systemf("%s cf archive -C .. original >pack.out 2>pack.err",
+ testprog);
+ failure("Error invoking \"%s cf\"", testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that nothing went to stdout or stderr. */
+ assertEmptyFile("pack.err");
+ assertEmptyFile("pack.out");
+
+ /*
+ * Use tar to unpack the archive into another directory.
+ */
+ r = systemf("%s xf archive >unpack.out 2>unpack.err", testprog);
+ failure("Error invoking %s xf archive", testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that nothing went to stdout or stderr. */
+ assertEmptyFile("unpack.err");
+ assertEmptyFile("unpack.out");
+
+ chdir("original");
+ verify_tree(LIMIT_NONE);
+ chdir("../..");
+}
+
+static void
+copy_ustar(void)
+{
+ const char *target = "ustar";
+ int r;
+
+ assertEqualInt(0, mkdir(target, 0775));
+ chdir(target);
+
+ /*
+ * Use the tar program to create an archive.
+ */
+ r = systemf("%s cf archive --format=ustar -C .. original >pack.out 2>pack.err",
+ testprog);
+ failure("Error invoking \"%s cf\"", testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that nothing went to stdout. */
+ assertEmptyFile("pack.out");
+
+ /*
+ * Use tar to unpack the archive into another directory.
+ */
+ r = systemf("%s xf archive >unpack.out 2>unpack.err", testprog);
+ failure("Error invoking %s xf archive", testprog);
+ assertEqualInt(r, 0);
+
+ /* Verify that nothing went to stdout or stderr. */
+ assertEmptyFile("unpack.err");
+ assertEmptyFile("unpack.out");
+
+ chdir("original");
+ verify_tree(LIMIT_USTAR);
+ chdir("../..");
+}
+
+DEFINE_TEST(test_copy)
+{
+ int oldumask;
+
+ oldumask = umask(0);
+
+ create_tree(); /* Create sample files in "original" dir. */
+
+ /* Test simple "tar -c | tar -x" pipeline copy. */
+ copy_basic();
+
+ /* Same, but constrain to ustar format. */
+ copy_ustar();
+
+ umask(oldumask);
+}
diff --git a/archivers/libarchive/files/tar/test/test_getdate.c b/archivers/libarchive/files/tar/test/test_getdate.c
new file mode 100644
index 00000000000..7ed447b9c26
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_getdate.c
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Verify that the getdate() function works.
+ */
+
+time_t get_date(const char *);
+
+DEFINE_TEST(test_getdate)
+{
+ assertEqualInt(0, get_date("Jan 1, 1970 UTC"));
+ /* TODO: Lots more tests here. */
+}
diff --git a/archivers/libarchive/files/tar/test/test_help.c b/archivers/libarchive/files/tar/test/test_help.c
new file mode 100644
index 00000000000..c547dbc4799
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_help.c
@@ -0,0 +1,81 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Test that "--help", "-h", and "-W help" options all work and
+ * generate reasonable output.
+ */
+
+static int
+in_first_line(const char *p, const char *substring)
+{
+ size_t l = strlen(substring);
+
+ while (*p != '\0' && *p != '\n') {
+ if (memcmp(p, substring, l) == 0)
+ return (1);
+ ++p;
+ }
+ return (0);
+}
+
+DEFINE_TEST(test_help)
+{
+ int r;
+ char *p;
+ size_t plen;
+
+ /* Exercise --help option. */
+ r = systemf("%s --help >help.stdout 2>help.stderr", testprog);
+ failure("--help should generate nothing to stderr.");
+ assertEmptyFile("help.stderr");
+ /* Help message should start with name of program. */
+ p = slurpfile(&plen, "help.stdout");
+ failure("Help output should be long enough.");
+ assert(plen >= 6);
+ failure("First line of help output should contain 'bsdtar': %s", p);
+ assert(in_first_line(p, "bsdtar"));
+ /*
+ * TODO: Extend this check to further verify that --help output
+ * looks approximately right.
+ */
+ free(p);
+
+ /* -h option should generate the same output. */
+ r = systemf("%s -h >h.stdout 2>h.stderr", testprog);
+ failure("-h should generate nothing to stderr.");
+ assertEmptyFile("h.stderr");
+ failure("stdout should be same for -h and --help");
+ assertEqualFile("h.stdout", "help.stdout");
+
+ /* -W help should be another synonym. */
+ r = systemf("%s -W help >Whelp.stdout 2>Whelp.stderr", testprog);
+ failure("-W help should generate nothing to stderr.");
+ assertEmptyFile("Whelp.stderr");
+ failure("stdout should be same for -W help and --help");
+ assertEqualFile("Whelp.stdout", "help.stdout");
+}
diff --git a/archivers/libarchive/files/tar/test/test_stdio.c b/archivers/libarchive/files/tar/test/test_stdio.c
new file mode 100644
index 00000000000..2d24ae35032
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_stdio.c
@@ -0,0 +1,124 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_stdio)
+{
+ int fd;
+ int filelist;
+ int oldumask;
+ int r;
+
+ oldumask = umask(0);
+
+ /*
+ * Create a couple of files on disk.
+ */
+ filelist = open("filelist", O_CREAT | O_WRONLY, 0644);
+ /* File */
+ fd = open("f", O_CREAT | O_WRONLY, 0644);
+ assert(fd >= 0);
+ write(fd, "f\n", 2);
+ close(fd);
+ write(filelist, "f\n", 2);
+ /* Link to above file. */
+ assertEqualInt(0, link("f", "l"));
+ write(filelist, "l\n", 2);
+ close(filelist);
+
+ /*
+ * Archive/dearchive with a variety of options, verifying
+ * stdio paths.
+ */
+
+ /* 'cf' should generate no output unless there's an error. */
+ r = systemf("%s cf archive f l >cf.out 2>cf.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("cf.out");
+ assertEmptyFile("cf.err");
+
+ /* 'cvf' should generate file list on stderr, empty stdout. */
+ r = systemf("%s cvf archive f l >cvf.out 2>cvf.err", testprog);
+ assertEqualInt(r, 0);
+ failure("'cv' writes filenames to stderr, nothing to stdout (SUSv2)\n"
+ "Note that GNU tar writes the file list to stdout by default.");
+ assertEmptyFile("cvf.out");
+ /* TODO: Verify cvf.err has file list in SUSv2-prescribed format. */
+
+ /* 'cvf -' should generate file list on stderr, archive on stdout. */
+ r = systemf("%s cvf - f l >cvf-.out 2>cvf-.err", testprog);
+ assertEqualInt(r, 0);
+ failure("cvf - should write archive to stdout");
+ /* TODO: Verify cvf-.out has archive. */
+ failure("cvf - should write file list to stderr (SUSv2)");
+ /* TODO: Verify cvf-.err has verbose file list. */
+
+ /* 'tf' should generate file list on stdout, empty stderr. */
+ r = systemf("%s tf archive >tf.out 2>tf.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("tf.err");
+ failure("'t' mode should write results to stdout");
+ /* TODO: Verify tf.out has file list. */
+
+ /* 'tvf' should generate file list on stdout, empty stderr. */
+ r = systemf("%s tvf archive >tvf.out 2>tvf.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("tvf.err");
+ failure("'tv' mode should write results to stdout");
+ /* TODO: Verify tvf.out has file list. */
+
+ /* 'tvf -' uses stdin, file list on stdout, empty stderr. */
+ r = systemf("%s tvf - < archive >tvf-.out 2>tvf-.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("tvf-.err");
+ /* TODO: Verify tvf-.out has file list. */
+
+ /* Basic 'xf' should generate no output on stdout or stderr. */
+ r = systemf("%s xf archive >xf.out 2>xf.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("xf.err");
+ assertEmptyFile("xf.out");
+
+ /* 'xvf' should generate list on stderr, empty stdout. */
+ r = systemf("%s xvf archive >xvf.out 2>xvf.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("xvf.out");
+ /* TODO: Verify xvf.err */
+
+ /* 'xvOf' should generate list on stderr, file contents on stdout. */
+ r = systemf("%s xvOf archive >xvOf.out 2>xvOf.err", testprog);
+ assertEqualInt(r, 0);
+ /* TODO: Verify xvOf.out */
+ /* TODO: Verify xvf.err */
+
+ /* 'xvf -' should generate list on stderr, empty stdout. */
+ r = systemf("%s xvf - < archive >xvf-.out 2>xvf-.err", testprog);
+ assertEqualInt(r, 0);
+ assertEmptyFile("xvf-.out");
+ /* TODO: Verify xvf-.err */
+
+ umask(oldumask);
+}
diff --git a/archivers/libarchive/files/tar/test/test_version.c b/archivers/libarchive/files/tar/test/test_version.c
new file mode 100644
index 00000000000..5ac6f882f0b
--- /dev/null
+++ b/archivers/libarchive/files/tar/test/test_version.c
@@ -0,0 +1,73 @@
+/*-
+ * Copyright (c) 2003-2007 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(S) ``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(S) 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.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Test that --version option works and generates reasonable output.
+ */
+
+DEFINE_TEST(test_version)
+{
+ int r;
+ char *p, *q;
+ size_t s;
+
+
+ r = systemf("%s --version >version.stdout 2>version.stderr", testprog);
+ /* --version should generate nothing to stdout. */
+ assertEmptyFile("version.stderr");
+ /* Verify format of version message. */
+ q = p = slurpfile(&s, "version.stdout");
+ /* Version message should start with name of program, then space. */
+ assert(s > 6);
+ assertEqualMem(q, "bsdtar ", 7);
+ q += 7; s -= 7;
+ /* Version number is a series of digits and periods. */
+ while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
+ ++q;
+ --s;
+ }
+ /* Version number terminated by space. */
+ assert(s > 1);
+ assert(*q == ' ');
+ ++q; --s;
+ /* Separator. */
+ assertEqualMem(q, "- ", 2);
+ q += 2; s -= 2;
+ /* libarchive name and version number */
+ assert(s > 11);
+ assertEqualMem(q, "libarchive ", 11);
+ q += 11; s -= 11;
+ /* Version number is a series of digits and periods. */
+ while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
+ ++q;
+ --s;
+ }
+ /* All terminated by a newline. */
+ assert(s >= 1);
+ assertEqualMem(q, "\n", 1);
+ free(p);
+}
diff --git a/archivers/libarchive/files/tar/util.c b/archivers/libarchive/files/tar/util.c
index c43e461eb29..68ff8d8f5e3 100644
--- a/archivers/libarchive/files/tar/util.c
+++ b/archivers/libarchive/files/tar/util.c
@@ -24,7 +24,7 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.17 2007/04/18 04:36:11 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.18 2008/01/02 00:21:27 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/archivers/libarchive/files/tar/write.c b/archivers/libarchive/files/tar/write.c
index f25b6857d4f..3b8cc51585d 100644
--- a/archivers/libarchive/files/tar/write.c
+++ b/archivers/libarchive/files/tar/write.c
@@ -24,7 +24,7 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.63 2007/05/29 05:39:10 kientzle Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.64 2008/02/19 05:27:17 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -1543,7 +1543,7 @@ test_for_append(struct bsdtar *bsdtar)
if (stat(bsdtar->filename, &s) != 0)
return;
- if (!S_ISREG(s.st_mode))
+ if (!S_ISREG(s.st_mode) && !S_ISBLK(s.st_mode))
bsdtar_errc(bsdtar, 1, 0,
"Cannot append to %s: not a regular file.",
bsdtar->filename);
diff --git a/archivers/libarchive/files/version b/archivers/libarchive/files/version
index 9183195ace7..9c846566f75 100644
--- a/archivers/libarchive/files/version
+++ b/archivers/libarchive/files/version
@@ -1 +1 @@
-2.4.0 \ No newline at end of file
+2.4.13 \ No newline at end of file