diff options
| -rw-r--r-- | libarchive/Makefile | 2 | ||||
| -rw-r--r-- | libarchive/libarchive-2.4.17/COPYING | 26 | ||||
| -rw-r--r-- | libarchive/libarchive-2.4.17/cpio/test/test_option_a.c | 128 | ||||
| -rw-r--r-- | libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_mtree.c | 711 | ||||
| -rw-r--r-- | libarchive/libarchive-2.4.17/libarchive/archive_string.c | 126 | ||||
| -rw-r--r-- | libarchive/libarchive-2.4.17/libarchive/test/test_pax_filename_encoding.c | 134 | ||||
| -rw-r--r-- | libarchive/libarchive-2.4.17/libarchive/test/test_read_format_isorr_bz2.c | 183 | ||||
| -rw-r--r-- | libarchive/libarchive-2.4.17/tar/getdate.c | 1370 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.4.17/tar/test/old/config.sh | 75 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.4.17/tar/test/old/test-acl.sh | 76 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.4.17/tar/test/old/test-basic.sh | 432 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.4.17/tar/test/old/test-deep-dir.sh | 60 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.4.17/tar/test/old/test-flags.sh | 74 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.4.17/tar/test/old/test-nodump.sh | 52 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.4.17/tar/test/old/test-overwrite.sh | 51 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.4.17/tar/test/old/test-utf8.sh | 40 | ||||
| -rw-r--r-- | libarchive/libarchive-2.4.17/version | 1 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/COPYING | 60 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/INSTALL (renamed from libarchive/libarchive-2.4.17/INSTALL) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/Makefile.am (renamed from libarchive/libarchive-2.4.17/Makefile.am) | 150 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/Makefile.in (renamed from libarchive/libarchive-2.4.17/Makefile.in) | 1318 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/NEWS (renamed from libarchive/libarchive-2.4.17/NEWS) | 82 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/README (renamed from libarchive/libarchive-2.4.17/README) | 1 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/aclocal.m4 (renamed from libarchive/libarchive-2.4.17/aclocal.m4) | 0 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.5.5/config.aux/compile (renamed from libarchive/libarchive-2.4.17/config.aux/compile) | 0 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.5.5/config.aux/config.guess (renamed from libarchive/libarchive-2.4.17/config.aux/config.guess) | 0 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.5.5/config.aux/config.sub (renamed from libarchive/libarchive-2.4.17/config.aux/config.sub) | 0 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.5.5/config.aux/depcomp (renamed from libarchive/libarchive-2.4.17/config.aux/depcomp) | 0 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.5.5/config.aux/install-sh (renamed from libarchive/libarchive-2.4.17/config.aux/install-sh) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/config.aux/ltmain.sh (renamed from libarchive/libarchive-2.4.17/config.aux/ltmain.sh) | 0 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.5.5/config.aux/missing (renamed from libarchive/libarchive-2.4.17/config.aux/missing) | 0 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.5.5/config.aux/ylwrap (renamed from libarchive/libarchive-2.4.17/config.aux/ylwrap) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/config.h.in (renamed from libarchive/libarchive-2.4.17/config.h.in) | 38 | ||||
| -rwxr-xr-x | libarchive/libarchive-2.5.5/configure (renamed from libarchive/libarchive-2.4.17/configure) | 532 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/configure.ac (renamed from libarchive/libarchive-2.4.17/configure.ac) | 101 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/contrib/README (renamed from libarchive/libarchive-2.4.17/contrib/README) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/contrib/libarchive.1aix53.spec (renamed from libarchive/libarchive-2.4.17/contrib/libarchive.1aix53.spec) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/contrib/libarchive.spec (renamed from libarchive/libarchive-2.4.17/contrib/libarchive.spec) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/contrib/libarchive_autodetect-st_lib_archive.m4 (renamed from libarchive/libarchive-2.4.17/contrib/libarchive_autodetect-st_lib_archive.m4) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/contrib/psota-benchmark/results.txt | 122 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/contrib/psota-benchmark/tcp.sh | 104 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/bsdcpio.1 (renamed from libarchive/libarchive-2.4.17/cpio/bsdcpio.1) | 46 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/cmdline.c (renamed from libarchive/libarchive-2.4.17/cpio/cmdline.c) | 15 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/cpio.c (renamed from libarchive/libarchive-2.4.17/cpio/cpio.c) | 498 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/cpio.h (renamed from libarchive/libarchive-2.4.17/cpio/cpio.h) | 20 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/cpio_platform.h (renamed from libarchive/libarchive-2.4.17/cpio/cpio_platform.h) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/err.c (renamed from libarchive/libarchive-2.4.17/cpio/err.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/matching.c (renamed from libarchive/libarchive-2.4.17/cpio/matching.c) | 15 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/matching.h (renamed from libarchive/libarchive-2.4.17/cpio/matching.h) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/pathmatch.c (renamed from libarchive/libarchive-2.4.17/cpio/pathmatch.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/pathmatch.h (renamed from libarchive/libarchive-2.4.17/cpio/pathmatch.h) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/list.h (renamed from libarchive/libarchive-2.4.17/cpio/test/list.h) | 1 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/main.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/main.c) | 377 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test.h (renamed from libarchive/libarchive-2.4.17/tar/test/test.h) | 70 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_0.c | 62 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_basic.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_basic.c) | 109 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_format_newc.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_format_newc.c) | 73 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat.c) | 21 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.bin.uu (renamed from libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.bin.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.crc.uu (renamed from libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.crc.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.newc.uu (renamed from libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.newc.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.ustar.uu (renamed from libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.ustar.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_B.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_B.c) | 8 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_L.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_L.c) | 16 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_a.c | 159 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_c.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_c.c) | 11 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_d.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_d.c) | 8 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_ell.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_ell.c) | 4 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_f.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_f.c) | 3 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_f.cpio.uu (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_f.cpio.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_help.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_help.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_m.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_m.c) | 6 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_m.cpio.uu (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_m.cpio.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_t.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_t.c) | 11 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_t.cpio.uu (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_t.cpio.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_t.stdout.uu (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_t.stdout.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_tv.stdout.uu (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_tv.stdout.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_u.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_u.c) | 19 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_version.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_version.c) | 27 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_y.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_y.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_option_z.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_option_z.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_owner_parse.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_owner_parse.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/cpio/test/test_pathmatch.c (renamed from libarchive/libarchive-2.4.17/cpio/test/test_pathmatch.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/Makefile (renamed from libarchive/libarchive-2.4.17/doc/man/Makefile) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/archive_entry.3 (renamed from libarchive/libarchive-2.4.17/doc/man/archive_entry.3) | 100 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/archive_read.3 (renamed from libarchive/libarchive-2.4.17/doc/man/archive_read.3) | 156 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/archive_util.3 (renamed from libarchive/libarchive-2.4.17/doc/man/archive_util.3) | 10 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/archive_write.3 (renamed from libarchive/libarchive-2.4.17/doc/man/archive_write.3) | 77 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/archive_write_disk.3 (renamed from libarchive/libarchive-2.4.17/doc/man/archive_write_disk.3) | 30 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/bsdcpio.1 (renamed from libarchive/libarchive-2.4.17/doc/man/bsdcpio.1) | 54 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/bsdtar.1 (renamed from libarchive/libarchive-2.4.17/doc/man/bsdtar.1) | 104 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/cpio.5 (renamed from libarchive/libarchive-2.4.17/doc/man/cpio.5) | 10 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/libarchive-formats.5 (renamed from libarchive/libarchive-2.4.17/doc/man/libarchive-formats.5) | 8 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/libarchive.3 (renamed from libarchive/libarchive-2.4.17/doc/man/libarchive.3) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/libarchive_internals.3 (renamed from libarchive/libarchive-2.4.17/doc/man/libarchive_internals.3) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/mtree.5 (renamed from libarchive/libarchive-2.4.17/doc/man/mtree.5) | 79 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/man/tar.5 (renamed from libarchive/libarchive-2.4.17/doc/man/tar.5) | 12 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/mdoc2man.awk (renamed from libarchive/libarchive-2.4.17/doc/mdoc2man.awk) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/Makefile (renamed from libarchive/libarchive-2.4.17/doc/text/Makefile) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/archive_entry.3 (renamed from libarchive/libarchive-2.4.17/doc/text/archive_entry.3) | 63 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/archive_read.3 (renamed from libarchive/libarchive-2.4.17/doc/text/archive_read.3) | 29 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/archive_util.3 (renamed from libarchive/libarchive-2.4.17/doc/text/archive_util.3) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/archive_write.3 (renamed from libarchive/libarchive-2.4.17/doc/text/archive_write.3) | 15 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/archive_write_disk.3 (renamed from libarchive/libarchive-2.4.17/doc/text/archive_write_disk.3) | 5 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/bsdcpio.1 (renamed from libarchive/libarchive-2.4.17/doc/text/bsdcpio.1) | 48 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/bsdtar.1 (renamed from libarchive/libarchive-2.4.17/doc/text/bsdtar.1) | 92 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/cpio.5 (renamed from libarchive/libarchive-2.4.17/doc/text/cpio.5) | 18 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/libarchive-formats.5 (renamed from libarchive/libarchive-2.4.17/doc/text/libarchive-formats.5) | 6 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/libarchive.3 (renamed from libarchive/libarchive-2.4.17/doc/text/libarchive.3) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/libarchive_internals.3 (renamed from libarchive/libarchive-2.4.17/doc/text/libarchive_internals.3) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/mtree.5 (renamed from libarchive/libarchive-2.4.17/doc/text/mtree.5) | 46 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/doc/text/tar.5 (renamed from libarchive/libarchive-2.4.17/doc/text/tar.5) | 12 | ||||
| -rw-r--r--[-rwxr-xr-x] | libarchive/libarchive-2.5.5/doc/update.sh (renamed from libarchive/libarchive-2.4.17/doc/update.sh) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/examples/minitar/README (renamed from libarchive/libarchive-2.4.17/examples/minitar/README) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/examples/minitar/minitar.c (renamed from libarchive/libarchive-2.4.17/examples/minitar/minitar.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/examples/minitar/tree.c (renamed from libarchive/libarchive-2.4.17/examples/minitar/tree.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/examples/minitar/tree.h (renamed from libarchive/libarchive-2.4.17/examples/minitar/tree.h) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/examples/tarfilter.c (renamed from libarchive/libarchive-2.4.17/examples/tarfilter.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/examples/untar.c (renamed from libarchive/libarchive-2.4.17/examples/untar.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive.h.in) | 370 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_check_magic.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_check_magic.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_endian.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive_endian.h) | 16 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_entry.3 (renamed from libarchive/libarchive-2.4.17/libarchive/archive_entry.3) | 71 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_entry.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_entry.c) | 417 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_entry.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive_entry.h) | 285 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_entry_copy_stat.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_entry_copy_stat.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_entry_link_resolver.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_entry_link_resolver.c) | 173 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_entry_private.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive_entry_private.h) | 30 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_entry_stat.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_entry_stat.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_entry_strmode.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_entry_strmode.c) | 10 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_platform.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive_platform.h) | 5 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_private.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive_private.h) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read.3 (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read.3) | 107 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read.c) | 17 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_data_into_fd.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_data_into_fd.c) | 12 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_extract.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_extract.c) | 30 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_open_fd.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_open_fd.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_open_file.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_open_file.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_open_filename.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_open_filename.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_open_memory.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_open_memory.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_private.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_private.h) | 50 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_all.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_all.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_bzip2.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_bzip2.c) | 34 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_compress.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_compress.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_gzip.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_gzip.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_none.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_none.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_program.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_program.c) | 30 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_all.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_all.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_ar.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_ar.c) | 85 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_cpio.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_cpio.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_empty.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_empty.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_iso9660.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_iso9660.c) | 61 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_mtree.c | 1298 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_tar.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_tar.c) | 92 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_zip.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_zip.c) | 29 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_string.c | 365 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_string.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive_string.h) | 34 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_string_sprintf.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_string_sprintf.c) | 12 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_util.3 (renamed from libarchive/libarchive-2.4.17/libarchive/archive_util.3) | 9 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_util.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_util.c) | 26 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_virtual.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_virtual.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_windows.c | 188 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_windows.h | 152 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write.3 (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write.3) | 50 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write.c) | 9 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_disk.3 (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_disk.3) | 25 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_disk.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_disk.c) | 190 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_disk_private.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_disk_private.h) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_disk_set_standard_lookup.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_disk_set_standard_lookup.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_open_fd.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_open_fd.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_open_file.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_open_file.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_open_filename.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_open_filename.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_open_memory.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_open_memory.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_private.h (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_private.h) | 9 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_bzip2.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_bzip2.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_compress.c | 494 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_gzip.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_gzip.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_none.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_none.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_program.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_program.c) | 29 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_format.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_format.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_ar.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_ar.c) | 25 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_by_name.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_by_name.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_cpio.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_cpio.c) | 6 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_cpio_newc.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_cpio_newc.c) | 6 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_pax.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_pax.c) | 123 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_shar.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_shar.c) | 10 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_ustar.c (renamed from libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_ustar.c) | 74 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/config_freebsd.h (renamed from libarchive/libarchive-2.4.17/libarchive/config_freebsd.h) | 10 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/config_windows.h (renamed from libarchive/libarchive-2.4.17/libarchive/config_windows.h) | 1192 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/cpio.5 (renamed from libarchive/libarchive-2.4.17/libarchive/cpio.5) | 14 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/filter_fork.c (renamed from libarchive/libarchive-2.4.17/libarchive/filter_fork.c) | 42 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/filter_fork.h (renamed from libarchive/libarchive-2.4.17/libarchive/filter_fork.h) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/libarchive-formats.5 (renamed from libarchive/libarchive-2.4.17/libarchive/libarchive-formats.5) | 10 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/libarchive.3 (renamed from libarchive/libarchive-2.4.17/libarchive/libarchive.3) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/libarchive_internals.3 (renamed from libarchive/libarchive-2.4.17/libarchive/libarchive_internals.3) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/mtree.5 (renamed from libarchive/libarchive-2.4.17/libarchive/mtree.5) | 59 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/tar.5 (renamed from libarchive/libarchive-2.4.17/libarchive/tar.5) | 14 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/list.h (renamed from libarchive/libarchive-2.4.17/libarchive/test/list.h) | 8 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/main.c (renamed from libarchive/libarchive-2.4.17/cpio/test/main.c) | 264 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/read_open_memory.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/read_open_memory.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test.h (renamed from libarchive/libarchive-2.4.17/libarchive/test/test.h) | 63 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_acl_basic.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_acl_basic.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_acl_pax.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_acl_pax.c) | 14 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_archive_api_feature.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_archive_api_feature.c) | 27 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_bad_fd.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_bad_fd.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_compat_gtar.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_compat_gtar.c) | 6 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_compat_gtar_1.tgz.uu (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_compat_gtar_1.tgz.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_compat_tar_hardlink.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_compat_tar_hardlink.c) | 6 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_compat_tar_hardlink_1.tar.uu (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_compat_tar_hardlink_1.tar.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_compat_zip.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_compat_zip.c) | 6 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_compat_zip_1.zip.uu (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_compat_zip_1.zip.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_empty_write.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_empty_write.c) | 5 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_entry.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_entry.c) | 82 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_entry_strmode.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_entry_strmode.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_link_resolver.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_link_resolver.c) | 61 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_pax_filename_encoding.c | 297 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_pax_filename_encoding.tar.gz.uu | 10 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_compress_program.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_compress_program.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_data_large.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_data_large.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_extract.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_extract.c) | 29 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_ar.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_ar.c) | 6 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin_Z.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin_Z.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin_bz2.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin_bz2.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin_gz.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin_gz.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_odc.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_odc.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_svr4_gzip.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_svr4_gzip.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_svr4c_Z.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_svr4c_Z.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_empty.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_empty.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_gz.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_gz.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse.c) | 9 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_iso_gz.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_iso_gz.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_isorr_bz2.c | 141 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu | 22 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_mtree.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_mtree.c) | 12 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_pax_bz2.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_pax_bz2.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tar.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar_empty_filename.c | 66 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar_empty_filename.tar.uu | 38 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tbz.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tbz.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tgz.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tgz.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tz.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tz.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_zip.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_format_zip.c) | 22 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_format_zip.zip.uu | 13 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_large.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_large.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_pax_truncated.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_pax_truncated.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_position.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_position.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_read_truncated.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_read_truncated.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_tar_filenames.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_tar_filenames.c) | 36 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_tar_large.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_tar_large.c) | 7 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_ustar_filenames.c | 183 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_compress.c | 102 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_compress_program.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_compress_program.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_disk.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_disk.c) | 8 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_disk_hardlink.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_disk_hardlink.c) | 18 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_disk_perms.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_disk_perms.c) | 8 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_disk_secure.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_disk_secure.c) | 6 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_format_ar.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_format_ar.c) | 9 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio_empty.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio_empty.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio_newc.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio_newc.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio_odc.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio_odc.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_format_shar_empty.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_format_shar_empty.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_format_tar.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar_empty.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_format_tar_empty.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar_ustar.c | 342 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/libarchive/test/test_write_open_memory.c (renamed from libarchive/libarchive-2.4.17/libarchive/test/test_write_open_memory.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/bsdtar.1 (renamed from libarchive/libarchive-2.4.17/tar/bsdtar.1) | 88 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/bsdtar.c (renamed from libarchive/libarchive-2.4.17/tar/bsdtar.c) | 60 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/bsdtar.h (renamed from libarchive/libarchive-2.4.17/tar/bsdtar.h) | 19 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/bsdtar_platform.h (renamed from libarchive/libarchive-2.4.17/tar/bsdtar_platform.h) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/getdate.c | 2344 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/getdate.y (renamed from libarchive/libarchive-2.4.17/tar/getdate.y) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/matching.c (renamed from libarchive/libarchive-2.4.17/tar/matching.c) | 27 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/read.c (renamed from libarchive/libarchive-2.4.17/tar/read.c) | 48 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/siginfo.c | 147 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/subst.c | 287 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/main.c (renamed from libarchive/libarchive-2.4.17/tar/test/main.c) | 375 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test.h (renamed from libarchive/libarchive-2.4.17/cpio/test/test.h) | 55 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test_0.c | 62 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test_basic.c (renamed from libarchive/libarchive-2.4.17/tar/test/test_basic.c) | 2 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test_copy.c (renamed from libarchive/libarchive-2.4.17/tar/test/test_copy.c) | 227 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test_getdate.c (renamed from libarchive/libarchive-2.4.17/tar/test/test_getdate.c) | 2 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test_help.c (renamed from libarchive/libarchive-2.4.17/tar/test/test_help.c) | 2 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test_option_T.c | 142 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test_patterns.c | 47 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test_stdio.c (renamed from libarchive/libarchive-2.4.17/tar/test/test_stdio.c) | 2 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/test/test_version.c (renamed from libarchive/libarchive-2.4.17/tar/test/test_version.c) | 22 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/tree.c (renamed from libarchive/libarchive-2.4.17/tar/tree.c) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/tree.h (renamed from libarchive/libarchive-2.4.17/tar/tree.h) | 0 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/util.c (renamed from libarchive/libarchive-2.4.17/tar/util.c) | 64 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/tar/write.c (renamed from libarchive/libarchive-2.4.17/tar/write.c) | 346 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/version | 1 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/windows/mvcpp.nt | 117 | ||||
| -rw-r--r-- | libarchive/libarchive-2.5.5/windows/wccpp.nt | 107 |
301 files changed, 13773 insertions, 7747 deletions
diff --git a/libarchive/Makefile b/libarchive/Makefile index fc6f941..34eea3f 100644 --- a/libarchive/Makefile +++ b/libarchive/Makefile @@ -3,7 +3,7 @@ DESTDIR = /usr INSTALL=install -c INSTALL_DATA = ${INSTALL} -m 644 DIR_COMMON=../common/ -DIR_LIBARCHIVE=./libarchive-2.4.17 +DIR_LIBARCHIVE=./libarchive-2.5.5 # compiler options CC = gcc diff --git a/libarchive/libarchive-2.4.17/COPYING b/libarchive/libarchive-2.4.17/COPYING deleted file mode 100644 index 6128d17..0000000 --- a/libarchive/libarchive-2.4.17/COPYING +++ /dev/null @@ -1,26 +0,0 @@ -All of the C source code and documentation in this package is subject -to the following: - -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. diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_a.c b/libarchive/libarchive-2.4.17/cpio/test/test_option_a.c deleted file mode 100644 index 39118d7..0000000 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_a.c +++ /dev/null @@ -1,128 +0,0 @@ -/*- - * 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; - int f; - char buff[64]; - - /* 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); - - /* Sanity check; verify that atimes really do get modified. */ - f = open("f0", O_RDONLY); - assertEqualInt(1, read(f,buff, 1)); - assertEqualInt(0, close(f)); - assertEqualInt(0, stat("f0", &st)); - if (st.st_atime == 1) { - skipping("Cannot verify -a option\n" - " Your system appears to not support atime."); - } - else - { - /* - * If this disk is mounted noatime, then we can't - * verify correct operation without -a. - */ - - /* 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); - } - - /* - * We can, of course, still verify that the atime is unchanged - * when using the -a option. - */ - - /* 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/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_mtree.c b/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_mtree.c deleted file mode 100644 index 7db6db3..0000000 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_mtree.c +++ /dev/null @@ -1,711 +0,0 @@ -/*- - * 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 "archive_platform.h" -__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> -#endif -#ifdef HAVE_ERRNO_H -#include <errno.h> -#endif -#ifdef HAVE_FCNTL_H -#include <fcntl.h> -#endif -#include <stddef.h> -/* #include <stdint.h> */ /* See archive_platform.h */ -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#include "archive.h" -#include "archive_entry.h" -#include "archive_private.h" -#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; - char *option_start; - char *option_end; - char full; - char used; -}; - -struct mtree { - struct archive_string line; - size_t buffsize; - char *buff; - off_t offset; - int fd; - int filetype; - int archive_format; - const char *archive_format_name; - struct mtree_entry *entries; - struct mtree_entry *this_entry; - struct archive_string current_dir; - struct archive_string contents_name; -}; - -static int cleanup(struct archive_read *); -static int mtree_bid(struct archive_read *); -static void parse_escapes(char *, struct mtree_entry *); -static int parse_setting(struct archive_read *, struct mtree *, - struct archive_entry *, char *, char *); -static int read_data(struct archive_read *a, - const void **buff, size_t *size, off_t *offset); -static ssize_t readline(struct archive_read *, struct mtree *, char **, ssize_t); -static int skip(struct archive_read *a); -static int read_header(struct archive_read *, - struct archive_entry *); -static int64_t mtree_atol10(char **); -static int64_t mtree_atol8(char **); - -int -archive_read_support_format_mtree(struct archive *_a) -{ - struct archive_read *a = (struct archive_read *)_a; - struct mtree *mtree; - int r; - - mtree = (struct mtree *)malloc(sizeof(*mtree)); - if (mtree == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate mtree data"); - return (ARCHIVE_FATAL); - } - memset(mtree, 0, sizeof(*mtree)); - mtree->fd = -1; - - r = __archive_read_register_format(a, mtree, - mtree_bid, read_header, read_data, skip, cleanup); - - if (r != ARCHIVE_OK) - free(mtree); - return (ARCHIVE_OK); -} - -static int -cleanup(struct archive_read *a) -{ - struct mtree *mtree; - struct mtree_entry *p, *q; - - mtree = (struct mtree *)(a->format->data); - p = mtree->entries; - while (p != NULL) { - q = p->next; - free(p->name); - /* - * Note: option_start, option_end are pointers into - * the block that p->name points to. So we should - * not try to free them! - */ - free(p); - p = q; - } - archive_string_free(&mtree->line); - archive_string_free(&mtree->current_dir); - archive_string_free(&mtree->contents_name); - free(mtree->buff); - free(mtree); - (a->format->data) = NULL; - return (ARCHIVE_OK); -} - - -static int -mtree_bid(struct archive_read *a) -{ - struct mtree *mtree; - ssize_t bytes_read; - const void *h; - const char *signature = "#mtree"; - const char *p; - int bid; - - mtree = (struct mtree *)(a->format->data); - - /* Now let's look at the actual header and see if it matches. */ - bytes_read = (a->decompressor->read_ahead)(a, &h, strlen(signature)); - - if (bytes_read <= 0) - return (bytes_read); - - p = h; - bid = 0; - while (bytes_read > 0 && *signature != '\0') { - if (*p != *signature) - return (bid = 0); - bid += 8; - p++; - signature++; - bytes_read--; - } - return (bid); -} - -/* - * The extended mtree format permits multiple lines specifying - * attributes for each file. Practically speaking, that means we have - * to read the entire mtree file into memory up front. - */ -static int -read_mtree(struct archive_read *a, struct mtree *mtree) -{ - ssize_t len; - char *p; - struct mtree_entry *mentry; - struct mtree_entry *last_mentry = NULL; - - mtree->archive_format = ARCHIVE_FORMAT_MTREE_V1; - mtree->archive_format_name = "mtree"; - - for (;;) { - len = readline(a, mtree, &p, 256); - if (len == 0) { - mtree->this_entry = mtree->entries; - return (ARCHIVE_OK); - } - if (len < 0) - return (len); - /* Leading whitespace is never significant, ignore it. */ - while (*p == ' ' || *p == '\t') { - ++p; - --len; - } - /* Skip content lines and blank lines. */ - if (*p == '#') - continue; - if (*p == '\r' || *p == '\n' || *p == '\0') - continue; - mentry = malloc(sizeof(*mentry)); - if (mentry == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate memory"); - return (ARCHIVE_FATAL); - } - memset(mentry, 0, sizeof(*mentry)); - /* Add this entry to list. */ - if (last_mentry == NULL) { - last_mentry = mtree->entries = mentry; - } else { - last_mentry->next = mentry; - } - last_mentry = mentry; - - /* Copy line over onto heap. */ - mentry->name = malloc(len + 1); - if (mentry->name == NULL) { - free(mentry); - archive_set_error(&a->archive, ENOMEM, - "Can't allocate memory"); - return (ARCHIVE_FATAL); - } - strcpy(mentry->name, p); - mentry->option_end = mentry->name + len; - /* Find end of name. */ - p = mentry->name; - while (*p != ' ' && *p != '\n' && *p != '\0') - ++p; - *p++ = '\0'; - parse_escapes(mentry->name, mentry); - /* Find start of options and record it. */ - while (p < mentry->option_end && (*p == ' ' || *p == '\t')) - ++p; - mentry->option_start = p; - /* Null terminate each separate option. */ - while (++p < mentry->option_end) - if (*p == ' ' || *p == '\t' || *p == '\n') - *p = '\0'; - } -} - -static int -read_header(struct archive_read *a, struct archive_entry *entry) -{ - struct stat st; - struct mtree *mtree; - struct mtree_entry *mentry, *mentry2; - char *p, *q; - int r = ARCHIVE_OK, r1; - - mtree = (struct mtree *)(a->format->data); - - if (mtree->fd >= 0) { - close(mtree->fd); - mtree->fd = -1; - } - - if (mtree->entries == NULL) { - r = read_mtree(a, mtree); - if (r != ARCHIVE_OK) - return (r); - } - - a->archive.archive_format = mtree->archive_format; - a->archive.archive_format_name = mtree->archive_format_name; - - for (;;) { - mentry = mtree->this_entry; - if (mentry == NULL) { - mtree->this_entry = NULL; - return (ARCHIVE_EOF); - } - mtree->this_entry = mentry->next; - if (mentry->used) - continue; - mentry->used = 1; - if (strcmp(mentry->name, "..") == 0) { - if (archive_strlen(&mtree->current_dir) > 0) { - /* Roll back current path. */ - p = mtree->current_dir.s - + mtree->current_dir.length - 1; - while (p >= mtree->current_dir.s && *p != '/') - --p; - if (p >= mtree->current_dir.s) - --p; - mtree->current_dir.length - = p - mtree->current_dir.s + 1; - } - continue; - } - - mtree->filetype = AE_IFREG; - - /* Parse options. */ - p = mentry->option_start; - while (p < mentry->option_end) { - q = p + strlen(p); - r1 = parse_setting(a, mtree, entry, p, q); - if (r1 != ARCHIVE_OK) - r = r1; - p = q + 1; - } - - if (mentry->full) { - archive_entry_copy_pathname(entry, mentry->name); - /* - * "Full" entries are allowed to have multiple - * lines and those lines aren't required to be - * adjacent. We don't support multiple lines - * for "relative" entries nor do we make any - * attempt to merge data from separate - * "relative" and "full" entries. (Merging - * "relative" and "full" entries would require - * dealing with pathname canonicalization, - * which is a very tricky subject.) - */ - mentry2 = mentry->next; - while (mentry2 != NULL) { - if (mentry2->full - && !mentry2->used - && strcmp(mentry->name, mentry2->name) == 0) { - /* - * Add those options as well; - * later lines override - * earlier ones. - */ - p = mentry2->option_start; - while (p < mentry2->option_end) { - q = p + strlen(p); - r1 = parse_setting(a, mtree, entry, p, q); - if (r1 != ARCHIVE_OK) - r = r1; - p = q + 1; - } - mentry2->used = 1; - } - mentry2 = mentry2->next; - } - } else { - /* - * Relative entries require us to construct - * the full path and possibly update the - * current directory. - */ - size_t n = archive_strlen(&mtree->current_dir); - if (n > 0) - archive_strcat(&mtree->current_dir, "/"); - archive_strcat(&mtree->current_dir, mentry->name); - archive_entry_copy_pathname(entry, mtree->current_dir.s); - if (archive_entry_filetype(entry) != AE_IFDIR) - mtree->current_dir.length = n; - } - - /* - * Try to open and stat the file to get the real size. - * It would be nice to avoid this here so that getting - * a listing of an mtree wouldn't require opening - * every referenced contents file. But then we - * wouldn't know the actual contents size, so I don't - * see a really viable way around this. (Also, we may - * want to someday pull other unspecified info from - * the contents file on disk.) - */ - if (archive_strlen(&mtree->contents_name) > 0) { - 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\"", - mtree->contents_name.s); - r = ARCHIVE_WARN; - } - } else { - /* If the specified path opens, use it. */ - mtree->fd = open(mtree->current_dir.s, - O_RDONLY | O_BINARY); - /* But don't fail if it's not there. */ - } - - /* - * If there is a contents file on disk, use that size; - * otherwise leave it as-is (it might have been set from - * the mtree size= keyword). - */ - if (mtree->fd >= 0) { - fstat(mtree->fd, &st); - archive_entry_set_size(entry, st.st_size); - } - - return r; - } -} - -static int -parse_setting(struct archive_read *a, struct mtree *mtree, struct archive_entry *entry, char *key, char *end) -{ - char *val; - - - if (end == key) - return (ARCHIVE_OK); - if (*key == '\0') - return (ARCHIVE_OK); - - val = strchr(key, '='); - if (val == NULL) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, - "Malformed attribute \"%s\" (%d)", key, key[0]); - return (ARCHIVE_WARN); - } - - *val = '\0'; - ++val; - - switch (key[0]) { - case 'c': - if (strcmp(key, "content") == 0) { - parse_escapes(val, NULL); - archive_strcpy(&mtree->contents_name, val); - break; - } - case 'g': - if (strcmp(key, "gid") == 0) { - archive_entry_set_gid(entry, mtree_atol10(&val)); - break; - } - if (strcmp(key, "gname") == 0) { - archive_entry_copy_gname(entry, val); - break; - } - case 'm': - if (strcmp(key, "mode") == 0) { - if (val[0] == '0') { - archive_entry_set_perm(entry, - mtree_atol8(&val)); - } else - archive_set_error(&a->archive, - ARCHIVE_ERRNO_FILE_FORMAT, - "Symbolic mode \"%s\" unsupported", val); - break; - } - case 't': - if (strcmp(key, "type") == 0) { - switch (val[0]) { - case 'b': - if (strcmp(val, "block") == 0) { - mtree->filetype = AE_IFBLK; - break; - } - case 'c': - if (strcmp(val, "char") == 0) { - mtree->filetype = AE_IFCHR; - break; - } - case 'd': - if (strcmp(val, "dir") == 0) { - mtree->filetype = AE_IFDIR; - break; - } - case 'f': - if (strcmp(val, "fifo") == 0) { - mtree->filetype = AE_IFIFO; - break; - } - if (strcmp(val, "file") == 0) { - mtree->filetype = AE_IFREG; - break; - } - case 'l': - if (strcmp(val, "link") == 0) { - mtree->filetype = AE_IFLNK; - break; - } - default: - archive_set_error(&a->archive, - ARCHIVE_ERRNO_FILE_FORMAT, - "Unrecognized file type \"%s\"", val); - return (ARCHIVE_WARN); - } - archive_entry_set_filetype(entry, mtree->filetype); - break; - } - if (strcmp(key, "time") == 0) { - archive_entry_set_mtime(entry, mtree_atol10(&val), 0); - break; - } - case 'u': - if (strcmp(key, "uid") == 0) { - archive_entry_set_uid(entry, mtree_atol10(&val)); - break; - } - if (strcmp(key, "uname") == 0) { - archive_entry_copy_uname(entry, val); - break; - } - default: - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, - "Unrecognized key %s=%s", key, val); - return (ARCHIVE_WARN); - } - return (ARCHIVE_OK); -} - -static int -read_data(struct archive_read *a, const void **buff, size_t *size, off_t *offset) -{ - ssize_t bytes_read; - struct mtree *mtree; - - mtree = (struct mtree *)(a->format->data); - if (mtree->fd < 0) { - *buff = NULL; - *offset = 0; - *size = 0; - return (ARCHIVE_EOF); - } - if (mtree->buff == NULL) { - mtree->buffsize = 64 * 1024; - mtree->buff = malloc(mtree->buffsize); - if (mtree->buff == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate memory"); - } - } - - *buff = mtree->buff; - *offset = mtree->offset; - bytes_read = read(mtree->fd, mtree->buff, mtree->buffsize); - if (bytes_read < 0) { - archive_set_error(&a->archive, errno, "Can't read"); - return (ARCHIVE_WARN); - } - if (bytes_read == 0) { - *size = 0; - return (ARCHIVE_EOF); - } - mtree->offset += bytes_read; - *size = (size_t)bytes_read; - return (ARCHIVE_OK); -} - -/* Skip does nothing except possibly close the contents file. */ -static int -skip(struct archive_read *a) -{ - struct mtree *mtree; - - mtree = (struct mtree *)(a->format->data); - if (mtree->fd >= 0) { - close(mtree->fd); - mtree->fd = -1; - } - return (ARCHIVE_OK); -} - -/* - * Since parsing octal escapes always makes strings shorter, - * we can always do this conversion in-place. - */ -static void -parse_escapes(char *src, struct mtree_entry *mentry) -{ - char *dest = src; - char c; - - while (*src != '\0') { - c = *src++; - if (c == '/' && mentry != NULL) - mentry->full = 1; - if (c == '\\') { - if (src[0] >= '0' && src[0] <= '3' - && src[1] >= '0' && src[1] <= '7' - && src[2] >= '0' && src[2] <= '7') { - c = (src[0] - '0') << 6; - c |= (src[1] - '0') << 3; - c |= (src[2] - '0'); - src += 3; - } - } - *dest++ = c; - } - *dest = '\0'; -} - -/* - * Note that this implementation does not (and should not!) obey - * locale settings; you cannot simply substitute strtol here, since - * it does obey locale. - */ -static int64_t -mtree_atol8(char **p) -{ - int64_t l, limit, last_digit_limit; - int digit, base; - - base = 8; - limit = INT64_MAX / base; - last_digit_limit = INT64_MAX % base; - - l = 0; - digit = **p - '0'; - while (digit >= 0 && digit < base) { - if (l>limit || (l == limit && digit > last_digit_limit)) { - l = INT64_MAX; /* Truncate on overflow. */ - break; - } - l = (l * base) + digit; - digit = *++(*p) - '0'; - } - return (l); -} - -/* - * Note that this implementation does not (and should not!) obey - * locale settings; you cannot simply substitute strtol here, since - * it does obey locale. - */ -static int64_t -mtree_atol10(char **p) -{ - int64_t l, limit, last_digit_limit; - int base, digit, sign; - - base = 10; - limit = INT64_MAX / base; - last_digit_limit = INT64_MAX % base; - - if (**p == '-') { - sign = -1; - ++(*p); - } else - sign = 1; - - l = 0; - digit = **p - '0'; - while (digit >= 0 && digit < base) { - if (l > limit || (l == limit && digit > last_digit_limit)) { - l = UINT64_MAX; /* Truncate on overflow. */ - break; - } - l = (l * base) + digit; - digit = *++(*p) - '0'; - } - return (sign < 0) ? -l : l; -} - -/* - * Returns length of line (including trailing newline) - * or negative on error. 'start' argument is updated to - * point to first character of line. - */ -static ssize_t -readline(struct archive_read *a, struct mtree *mtree, char **start, ssize_t limit) -{ - ssize_t bytes_read; - ssize_t total_size = 0; - const void *t; - const char *s; - void *p; - - /* Accumulate line in a line buffer. */ - for (;;) { - /* Read some more. */ - bytes_read = (a->decompressor->read_ahead)(a, &t, 1); - if (bytes_read == 0) - return (0); - if (bytes_read < 0) - return (ARCHIVE_FATAL); - s = t; /* Start of line? */ - p = memchr(t, '\n', bytes_read); - /* If we found '\n', trim the read. */ - if (p != NULL) { - bytes_read = 1 + ((const char *)p) - s; - } - if (total_size + bytes_read + 1 > limit) { - archive_set_error(&a->archive, - ARCHIVE_ERRNO_FILE_FORMAT, - "Line too long"); - return (ARCHIVE_FATAL); - } - if (archive_string_ensure(&mtree->line, - total_size + bytes_read + 1) == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate working buffer"); - return (ARCHIVE_FATAL); - } - memcpy(mtree->line.s + total_size, t, bytes_read); - (a->decompressor->consume)(a, bytes_read); - total_size += bytes_read; - /* Null terminate. */ - mtree->line.s[total_size] = '\0'; - /* If we found '\n', clean up and return. */ - if (p != NULL) { - *start = mtree->line.s; - return (total_size); - } - } -} diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_string.c b/libarchive/libarchive-2.4.17/libarchive/archive_string.c deleted file mode 100644 index 7e43b36..0000000 --- a/libarchive/libarchive-2.4.17/libarchive/archive_string.c +++ /dev/null @@ -1,126 +0,0 @@ -/*- - * 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 "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_string.c,v 1.11 2007/07/15 19:13:59 kientzle Exp $"); - -/* - * Basic resizable string support, to simplify manipulating arbitrary-sized - * strings while minimizing heap activity. - */ - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#include "archive_private.h" -#include "archive_string.h" - -struct archive_string * -__archive_string_append(struct archive_string *as, const char *p, size_t s) -{ - if (__archive_string_ensure(as, as->length + s + 1) == NULL) - __archive_errx(1, "Out of memory"); - memcpy(as->s + as->length, p, s); - as->s[as->length + s] = 0; - as->length += s; - return (as); -} - -void -__archive_string_copy(struct archive_string *dest, struct archive_string *src) -{ - if (__archive_string_ensure(dest, src->length + 1) == NULL) - __archive_errx(1, "Out of memory"); - memcpy(dest->s, src->s, src->length); - dest->length = src->length; - dest->s[dest->length] = 0; -} - -void -__archive_string_free(struct archive_string *as) -{ - as->length = 0; - as->buffer_length = 0; - if (as->s != NULL) - free(as->s); -} - -/* Returns NULL on any allocation failure. */ -struct archive_string * -__archive_string_ensure(struct archive_string *as, size_t s) -{ - if (as->s && (s <= as->buffer_length)) - return (as); - - if (as->buffer_length < 32) - as->buffer_length = 32; - while (as->buffer_length < s) - as->buffer_length *= 2; - as->s = (char *)realloc(as->s, as->buffer_length); - if (as->s == NULL) - return (NULL); - return (as); -} - -struct archive_string * -__archive_strncat(struct archive_string *as, const char *p, size_t n) -{ - size_t s; - const char *pp; - - /* Like strlen(p), except won't examine positions beyond p[n]. */ - s = 0; - pp = p; - while (*pp && s < n) { - pp++; - s++; - } - return (__archive_string_append(as, p, s)); -} - -struct archive_string * -__archive_strappend_char(struct archive_string *as, char c) -{ - return (__archive_string_append(as, &c, 1)); -} - -struct archive_string * -__archive_strappend_int(struct archive_string *as, int d, int base) -{ - static const char *digits = "0123456789abcdef"; - - if (d < 0) { - __archive_strappend_char(as, '-'); - d = -d; - } - if (d >= base) - __archive_strappend_int(as, d/base, base); - __archive_strappend_char(as, digits[d % base]); - return (as); -} diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_pax_filename_encoding.c b/libarchive/libarchive-2.4.17/libarchive/test/test_pax_filename_encoding.c deleted file mode 100644 index fb8fead..0000000 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_pax_filename_encoding.c +++ /dev/null @@ -1,134 +0,0 @@ -/*- - * 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. */ - if (NULL == setlocale(LC_ALL, "de_DE.UTF-8")) { - skipping("invalid encoding tests require a suitable locale;" - " de_DE.UTF-8 not available on this system"); - 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/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_isorr_bz2.c b/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_isorr_bz2.c deleted file mode 100644 index 107024f..0000000 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_isorr_bz2.c +++ /dev/null @@ -1,183 +0,0 @@ -/*- - * 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_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: - tail -n +5 test-read_format-isorr_bz2.c | /bin/sh - -rm -rf /tmp/iso -mkdir /tmp/iso -mkdir /tmp/iso/dir -echo "hello" >/tmp/iso/file -ln /tmp/iso/file /tmp/iso/hardlink -(cd /tmp/iso; ln -s file symlink) -TZ=utc touch -afhm -t 197001010000.01 /tmp/iso /tmp/iso/file /tmp/iso/dir -TZ=utc touch -afhm -t 196912312359.58 /tmp/iso/symlink -mkhybrid -R -uid 1 -gid 2 /tmp/iso | bzip2 > data.iso.bz2 -cat data.iso.bz2 | ./maketest.pl > data.c -exit 1 - */ - -static unsigned char archive[] = { -'B','Z','h','9','1','A','Y','&','S','Y','G',11,4,'c',0,0,199,255,221,255, -255,203,252,221,'c',251,248,'?',255,223,224,167,255,222,'&','!',234,'$',0, -'0',1,' ',0,'D',2,129,8,192,3,14,'2','3','$',19,184,'J',' ','F',168,244,201, -149,'6','Q',226,155,'S',212,209,160,'h','4','i',160,26,13,0,244,134,212,0, -218,'O',212,153,1,144,244,128,148,' ',147,13,' ',213,'=','1','\'',169,166, -128,'=','!',233,0,208,0,26,0,0,30,160,'h',0,'4','z',130,180,163,'@',0,0,4, -211,0,0,0,2,'b','`',0,0,0,0,0,8,146,133,'F',154,'y','A',163,'A',161,163,'@', -'z',134,'C','C','F',131,'F','@',0,0,0,0,6,154,26,'Q',24,234,180,'P',172,251, -'=',2,'P','H','&','Y','o',130,28,'"',229,210,247,227,248,200,'?','6',161, -'?',170,'H',172,'"','H','I',16,'2','"','&',148,'G',133,'T','z',224,1,215, -' ',0,191,184,10,160,24,248,180,183,244,156,'K',202,133,208,'U',5,'6','C', -26,144,'H',168,'H','H','(','"',151,'@','m',223,'(','P',169,'e',145,148,'6', -237,235,7,227,204,']','k','{',241,187,227,244,251,':','a','L',138,'#','R', -'"',221,'_',239,')',140,'*','*',172,'Q',16,1,16,207,166,251,233,'Z',169,'4', -'_',195,'a',14,18,231,'}',14,139,137,'e',213,185,'T',194,'D','`',25,'$',187, -208,'%','c',162,'~',181,'@',204,'2',238,'P',161,213,127,'I',169,3,' ','o', -6,161,16,128,'F',214,'S','m',6,244,11,229,'Z','y','.',176,'q',' ',248,167, -204,26,193,'q',211,241,214,133,221,212,'I','`',28,244,'N','N','f','H','9', -'w',245,209,'*',20,26,208,'h','(',194,156,192,'l',';',192,'X','T',151,177, -209,'0',156,16,'=',20,'k',184,144,'z',26,'j',133,194,'9',227,'<','[','^', -17,'w','p',225,220,248,'>',205,'>','[',19,'5',155,17,175,28,28,168,175,'n', -'\'','c','w',27,222,204,'k','n','x','I',23,237,'c',145,11,184,'A','(',1,169, -'0',180,189,134,'\\','Y','x',187,'C',151,'d','k','y','-','L',218,138,'s', -'*','(',12,'h',242,'*',17,'E','L',202,146,138,'l','0',217,160,'9','.','S', -214,198,143,'3','&',237,'=','t','P',168,214,210,'`','p','J',181,'H',138,149, -'1','B',206,22,164,'[','O','A',172,134,224,179,219,166,184,'X',185,'W',154, -219,19,161,'Y',184,220,237,147,'9',191,237,'&','i','_',226,146,205,160,'@', -'b',182,';',3,'!',183,'J','t',161,160,178,173,'S',235,':','2',159,':',245, -'{','U',174,'P',142,'G','(',')',9,168,185,'A','U',231,193,'g',213,'e',12, -'X',223,22,249,')',152,237,'G',150,156,3,201,245,212,'2',218,209,177,196, -235,'_','~',137,24,31,196,232,'B',172,'w',159,24,'n',156,150,225,'1','y', -22,'#',138,193,227,232,169,170,166,179,1,11,182,'i',')',160,180,198,175,128, -249,167,5,194,142,183,'f',134,206,180,'&','E','!','[',31,195,':',192,'s', -232,187,'N',131,'Y',137,243,15,'y',12,'J',163,'-',242,'5',197,151,130,163, -240,220,'T',161,'L',159,141,159,152,'4',18,128,'.','^',250,168,200,163,'P', -231,'Y','w','F','U',186,'x',190,16,'0',228,22,'9','F','t',168,157,'i',190, -'+',246,141,142,18,' ','M',174,197,'O',165,'m',224,27,'b',150,'|','W','H', -196,'.','*','Q','$',225,'I','-',148,169,'F',7,197,'m','-',130,153,0,158,21, -'(',221,221,226,206,'g',13,159,163,'y',176,'~',158,'k','4','q','d','s',177, -'7',14,217,'1',173,206,228,'t',250,200,170,162,'d','2','Z','$','e',168,224, -223,129,174,229,165,187,252,203,'-',28,'`',207,183,'-','/',127,196,230,131, -'B',30,237,' ',8,26,194,'O',132,'L','K','\\',144,'L','c',1,10,176,192,'c', -0,244,2,168,3,0,'+',233,186,16,17,'P',17,129,252,'2',0,2,154,247,255,166, -'.',228,138,'p',161,' ',142,22,8,198}; - -DEFINE_TEST(test_read_format_isorr_bz2) -{ - struct archive_entry *ae; - struct archive *a; - const void *p; - size_t size; - off_t offset; - assert((a = archive_read_new()) != NULL); - assert(0 == archive_read_support_compression_all(a)); - assert(0 == archive_read_support_format_all(a)); - assert(0 == archive_read_open_memory(a, archive, sizeof(archive))); - - /* First entry is '.' root directory. */ - assert(0 == archive_read_next_header(a, &ae)); - assertEqualString(".", archive_entry_pathname(ae)); - assert(S_ISDIR(archive_entry_stat(ae)->st_mode)); - assertEqualInt(2048, archive_entry_size(ae)); - assertEqualInt(1, archive_entry_mtime(ae)); - assertEqualInt(0, archive_entry_mtime_nsec(ae)); - assertEqualInt(1, archive_entry_ctime(ae)); - assertEqualInt(0, archive_entry_stat(ae)->st_nlink); - assertEqualInt(0, archive_entry_uid(ae)); - assertEqualIntA(a, ARCHIVE_EOF, - archive_read_data_block(a, &p, &size, &offset)); - assertEqualInt(size, 0); - - /* A directory. */ - assert(0 == archive_read_next_header(a, &ae)); - assertEqualString("dir", archive_entry_pathname(ae)); - assert(S_ISDIR(archive_entry_stat(ae)->st_mode)); - assert(2048 == archive_entry_size(ae)); - assert(1 == archive_entry_mtime(ae)); - assert(1 == archive_entry_atime(ae)); - assert(2 == archive_entry_stat(ae)->st_nlink); - assert(1 == archive_entry_uid(ae)); - assert(2 == archive_entry_gid(ae)); - - /* A regular file. */ - assert(0 == archive_read_next_header(a, &ae)); - assertEqualString("file", archive_entry_pathname(ae)); - assert(S_ISREG(archive_entry_stat(ae)->st_mode)); - assert(6 == archive_entry_size(ae)); - assert(0 == archive_read_data_block(a, &p, &size, &offset)); - assert(6 == size); - assert(0 == offset); - assert(0 == memcmp(p, "hello\n", 6)); - assert(1 == archive_entry_mtime(ae)); - assert(1 == archive_entry_atime(ae)); - assert(2 == archive_entry_stat(ae)->st_nlink); - assert(1 == archive_entry_uid(ae)); - assert(2 == archive_entry_gid(ae)); - - /* A hardlink to the regular file. */ - assert(0 == archive_read_next_header(a, &ae)); - assertEqualString("hardlink", archive_entry_pathname(ae)); - assert(S_ISREG(archive_entry_stat(ae)->st_mode)); - assertEqualString("file", archive_entry_hardlink(ae)); - assert(6 == archive_entry_size(ae)); - assert(1 == archive_entry_mtime(ae)); - assert(1 == archive_entry_atime(ae)); - assert(2 == archive_entry_stat(ae)->st_nlink); - assert(1 == archive_entry_uid(ae)); - assert(2 == archive_entry_gid(ae)); - - /* A symlink to the regular file. */ - assert(0 == archive_read_next_header(a, &ae)); - assertEqualString("symlink", archive_entry_pathname(ae)); - assert(S_ISLNK(archive_entry_stat(ae)->st_mode)); - assertEqualString("file", archive_entry_symlink(ae)); - assert(0 == archive_entry_size(ae)); - assert(-2 == archive_entry_mtime(ae)); - assert(-2 == archive_entry_atime(ae)); - assert(1 == archive_entry_stat(ae)->st_nlink); - assert(1 == archive_entry_uid(ae)); - assert(2 == archive_entry_gid(ae)); - - /* End of archive. */ - assert(ARCHIVE_EOF == archive_read_next_header(a, &ae)); - - /* Verify archive format. */ - assert(archive_compression(a) == ARCHIVE_COMPRESSION_BZIP2); - assert(archive_format(a) == ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); - - /* Close the archive. */ - assert(0 == archive_read_close(a)); -#if ARCHIVE_API_VERSION > 1 - assert(0 == archive_read_finish(a)); -#else - archive_read_finish(a); -#endif -} - - diff --git a/libarchive/libarchive-2.4.17/tar/getdate.c b/libarchive/libarchive-2.4.17/tar/getdate.c deleted file mode 100644 index 31a0dfe..0000000 --- a/libarchive/libarchive-2.4.17/tar/getdate.c +++ /dev/null @@ -1,1370 +0,0 @@ -#include <stdlib.h> -#ifndef lint -#ifdef __unused -__unused -#endif -static char const -yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003/02/12 18:03:55 davidc Exp $"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYLEX yylex() -#define YYEMPTY -1 -#define yyclearin (yychar=(YYEMPTY)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING() (yyerrflag!=0) -#if defined(__cplusplus) || __STDC__ -static int yygrowstack(void); -#else -static int yygrowstack(); -#endif -#define YYPREFIX "yy" -#line 2 "getdate.y" -/* - * March 2005: Further modified and simplified by Tim Kientzle: - * Eliminate minutes-based calculations (just do everything in - * seconds), have lexer only recognize unsigned integers (handle '+' - * and '-' characters in grammar), combine tables into one table with - * explicit abbreviation notes, do am/pm adjustments in the grammar - * (eliminate some state variables and post-processing). Among other - * things, these changes eliminated two shift/reduce conflicts. (Went - * from 10 to 8.) - * All of Tim Kientzle's changes to this file are public domain. - */ - -/* -** Originally written by Steven M. Bellovin <smb@research.att.com> while -** at the University of North Carolina at Chapel Hill. Later tweaked by -** a couple of people on Usenet. Completely overhauled by Rich $alz -** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990; -** -** This grammar has 10 shift/reduce conflicts. -** -** This code is in the public domain and has no copyright. -*/ -/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */ -/* SUPPRESS 288 on yyerrlab *//* Label unused */ - -#ifdef __FreeBSD__ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/tar/getdate.y,v 1.9 2007/07/20 01:27:50 kientzle Exp $"); -#endif - -#include <ctype.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> - -#define yyparse getdate_yyparse -#define yylex getdate_yylex -#define yyerror getdate_yyerror - -static int yyparse(void); -static int yylex(void); -static int yyerror(const char *); - -time_t get_date(char *); - -#define EPOCH 1970 -#define HOUR(x) ((time_t)(x) * 60) -#define SECSPERDAY (24L * 60L * 60L) - -/* -** Daylight-savings mode: on, off, or not yet known. -*/ -typedef enum _DSTMODE { - DSTon, DSToff, DSTmaybe -} DSTMODE; - -/* -** Meridian: am or pm. -*/ -enum { tAM, tPM }; - -/* -** Global variables. We could get rid of most of these by using a good -** union as the yacc stack. (This routine was originally written before -** yacc had the %union construct.) Maybe someday; right now we only use -** the %union very rarely. -*/ -static char *yyInput; - -static DSTMODE yyDSTmode; -static time_t yyDayOrdinal; -static time_t yyDayNumber; -static int yyHaveDate; -static int yyHaveDay; -static int yyHaveRel; -static int yyHaveTime; -static int yyHaveZone; -static time_t yyTimezone; -static time_t yyDay; -static time_t yyHour; -static time_t yyMinutes; -static time_t yyMonth; -static time_t yySeconds; -static time_t yyYear; -static time_t yyRelMonth; -static time_t yyRelSeconds; - -#line 92 "getdate.y" -typedef union { - time_t Number; -} YYSTYPE; -#line 117 "getdate.c" -#define YYERRCODE 256 -#define tAGO 257 -#define tDAY 258 -#define tDAYZONE 259 -#define tAMPM 260 -#define tMONTH 261 -#define tMONTH_UNIT 262 -#define tSEC_UNIT 263 -#define tUNUMBER 264 -#define tZONE 265 -#define tDST 266 -const short yylhs[] = { -1, - 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, - 2, 2, 2, 8, 8, 3, 3, 3, 5, 5, - 5, 4, 4, 4, 4, 4, 4, 4, 4, 6, - 6, 9, 9, 9, 9, 9, 9, 9, 9, 7, -}; -const short yylen[] = { 2, - 0, 2, 1, 1, 1, 1, 1, 1, 2, 1, - 2, 3, 3, 3, 5, 1, 1, 2, 1, 2, - 2, 3, 5, 5, 5, 2, 4, 2, 3, 2, - 1, 3, 3, 2, 1, 3, 3, 2, 1, 1, -}; -const short yydefred[] = { 1, - 0, 0, 17, 0, 39, 35, 0, 0, 0, 0, - 2, 3, 4, 5, 6, 7, 8, 0, 0, 20, - 0, 21, 9, 0, 38, 34, 0, 0, 0, 18, - 0, 0, 11, 0, 0, 30, 0, 29, 0, 0, - 0, 0, 37, 33, 36, 32, 12, 13, 27, 0, - 0, 0, 0, 25, 24, 15, 23, -}; -const short yydgoto[] = { 1, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -}; -const short yysindex[] = { 0, - -43, -40, 0, -259, 0, 0, -35, -252, -253, -248, - 0, 0, 0, 0, 0, 0, 0, -30, -237, 0, - -23, 0, 0, -242, 0, 0, -258, -240, -238, 0, - -255, -244, 0, -236, -235, 0, -234, 0, -18, -14, - -26, -13, 0, 0, 0, 0, 0, 0, 0, -229, - -228, -227, -226, 0, 0, 0, 0, -}; -const short yyrindex[] = { 0, - 0, 9, 0, 0, 0, 0, 64, 17, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 57, 25, 0, - 33, 0, 0, 49, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 41, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -}; -const short yygindex[] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; -#define YYTABLESIZE 329 -const short yytable[] = { 9, - 14, 10, 39, 20, 21, 40, 43, 44, 19, 27, - 31, 29, 34, 30, 35, 32, 16, 45, 46, 36, - 37, 38, 28, 41, 31, 42, 50, 47, 48, 49, - 51, 52, 26, 53, 54, 55, 56, 57, 0, 0, - 22, 0, 0, 14, 0, 14, 0, 0, 28, 0, - 0, 19, 0, 19, 0, 0, 10, 0, 0, 16, - 0, 16, 0, 40, 0, 0, 0, 31, 0, 31, - 0, 0, 0, 0, 0, 26, 0, 26, 0, 0, - 0, 0, 0, 22, 0, 22, 0, 0, 0, 0, - 0, 28, 0, 28, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 3, 0, 4, 5, 6, - 7, 8, 22, 0, 23, 24, 25, 26, 0, 33, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, - 14, 14, 14, 14, 14, 14, 19, 19, 0, 19, - 19, 19, 19, 19, 16, 16, 0, 16, 16, 16, - 16, 16, 31, 31, 0, 31, 31, 31, 31, 31, - 26, 26, 0, 26, 26, 26, 26, 26, 22, 22, - 0, 22, 22, 22, 22, 22, 28, 28, 0, 28, - 28, 28, 0, 28, 10, 10, 0, 10, 10, 10, - 10, 10, 40, 0, 0, 0, 0, 40, 40, -}; -const short yycheck[] = { 43, - 0, 45, 261, 44, 264, 264, 262, 263, 0, 45, - 264, 47, 43, 266, 45, 264, 0, 262, 263, 257, - 44, 264, 58, 264, 0, 264, 45, 264, 264, 264, - 45, 58, 0, 47, 264, 264, 264, 264, -1, -1, - 0, -1, -1, 43, -1, 45, -1, -1, 0, -1, - -1, 43, -1, 45, -1, -1, 0, -1, -1, 43, - -1, 45, -1, 0, -1, -1, -1, 43, -1, 45, - -1, -1, -1, -1, -1, 43, -1, 45, -1, -1, - -1, -1, -1, 43, -1, 45, -1, -1, -1, -1, - -1, 43, -1, 45, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 258, 259, -1, 261, 262, 263, - 264, 265, 258, -1, 260, 261, 262, 263, -1, 260, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 258, 259, - 260, 261, 262, 263, 264, 265, 258, 259, -1, 261, - 262, 263, 264, 265, 258, 259, -1, 261, 262, 263, - 264, 265, 258, 259, -1, 261, 262, 263, 264, 265, - 258, 259, -1, 261, 262, 263, 264, 265, 258, 259, - -1, 261, 262, 263, 264, 265, 258, 259, -1, 261, - 262, 263, -1, 265, 258, 259, -1, 261, 262, 263, - 264, 265, 259, -1, -1, -1, -1, 264, 265, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 266 -#if YYDEBUG -const char * const yyname[] = { -"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,"'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,"':'",0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"tAGO","tDAY", -"tDAYZONE","tAMPM","tMONTH","tMONTH_UNIT","tSEC_UNIT","tUNUMBER","tZONE","tDST", -}; -const char * const yyrule[] = { -"$accept : spec", -"spec :", -"spec : spec item", -"item : time", -"item : zone", -"item : date", -"item : day", -"item : rel", -"item : number", -"time : tUNUMBER tAMPM", -"time : bare_time", -"time : bare_time tAMPM", -"time : bare_time '+' tUNUMBER", -"time : bare_time '-' tUNUMBER", -"bare_time : tUNUMBER ':' tUNUMBER", -"bare_time : tUNUMBER ':' tUNUMBER ':' tUNUMBER", -"zone : tZONE", -"zone : tDAYZONE", -"zone : tZONE tDST", -"day : tDAY", -"day : tDAY ','", -"day : tUNUMBER tDAY", -"date : tUNUMBER '/' tUNUMBER", -"date : tUNUMBER '/' tUNUMBER '/' tUNUMBER", -"date : tUNUMBER '-' tUNUMBER '-' tUNUMBER", -"date : tUNUMBER '-' tMONTH '-' tUNUMBER", -"date : tMONTH tUNUMBER", -"date : tMONTH tUNUMBER ',' tUNUMBER", -"date : tUNUMBER tMONTH", -"date : tUNUMBER tMONTH tUNUMBER", -"rel : relunit tAGO", -"rel : relunit", -"relunit : '-' tUNUMBER tSEC_UNIT", -"relunit : '+' tUNUMBER tSEC_UNIT", -"relunit : tUNUMBER tSEC_UNIT", -"relunit : tSEC_UNIT", -"relunit : '-' tUNUMBER tMONTH_UNIT", -"relunit : '+' tUNUMBER tMONTH_UNIT", -"relunit : tUNUMBER tMONTH_UNIT", -"relunit : tMONTH_UNIT", -"number : tUNUMBER", -}; -#endif -#if YYDEBUG -#include <stdio.h> -#endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif -#define YYINITSTACKSIZE 200 -int yydebug; -int yynerrs; -int yyerrflag; -int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; -YYSTYPE yylval; -short *yyss; -short *yysslim; -YYSTYPE *yyvs; -int yystacksize; -#line 328 "getdate.y" - -static struct TABLE { - size_t abbrev; - const char *name; - int type; - time_t value; -} const TimeWords[] = { - /* am/pm */ - { 0, "am", tAMPM, tAM }, - { 0, "pm", tAMPM, tPM }, - - /* Month names. */ - { 3, "january", tMONTH, 1 }, - { 3, "february", tMONTH, 2 }, - { 3, "march", tMONTH, 3 }, - { 3, "april", tMONTH, 4 }, - { 3, "may", tMONTH, 5 }, - { 3, "june", tMONTH, 6 }, - { 3, "july", tMONTH, 7 }, - { 3, "august", tMONTH, 8 }, - { 3, "september", tMONTH, 9 }, - { 3, "october", tMONTH, 10 }, - { 3, "november", tMONTH, 11 }, - { 3, "december", tMONTH, 12 }, - - /* Days of the week. */ - { 2, "sunday", tDAY, 0 }, - { 3, "monday", tDAY, 1 }, - { 2, "tuesday", tDAY, 2 }, - { 3, "wednesday", tDAY, 3 }, - { 2, "thursday", tDAY, 4 }, - { 2, "friday", tDAY, 5 }, - { 2, "saturday", tDAY, 6 }, - - /* Timezones: Offsets are in minutes. */ - { 0, "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */ - { 0, "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */ - { 0, "utc", tZONE, HOUR( 0) }, - { 0, "wet", tZONE, HOUR( 0) }, /* Western European */ - { 0, "bst", tDAYZONE, HOUR( 0) }, /* British Summer */ - { 0, "wat", tZONE, HOUR( 1) }, /* West Africa */ - { 0, "at", tZONE, HOUR( 2) }, /* Azores */ - /* { 0, "bst", tZONE, HOUR( 3) }, */ /* Brazil Standard: Conflict */ - /* { 0, "gst", tZONE, HOUR( 3) }, */ /* Greenland Standard: Conflict*/ - { 0, "nft", tZONE, HOUR(3)+30 }, /* Newfoundland */ - { 0, "nst", tZONE, HOUR(3)+30 }, /* Newfoundland Standard */ - { 0, "ndt", tDAYZONE, HOUR(3)+30 }, /* Newfoundland Daylight */ - { 0, "ast", tZONE, HOUR( 4) }, /* Atlantic Standard */ - { 0, "adt", tDAYZONE, HOUR( 4) }, /* Atlantic Daylight */ - { 0, "est", tZONE, HOUR( 5) }, /* Eastern Standard */ - { 0, "edt", tDAYZONE, HOUR( 5) }, /* Eastern Daylight */ - { 0, "cst", tZONE, HOUR( 6) }, /* Central Standard */ - { 0, "cdt", tDAYZONE, HOUR( 6) }, /* Central Daylight */ - { 0, "mst", tZONE, HOUR( 7) }, /* Mountain Standard */ - { 0, "mdt", tDAYZONE, HOUR( 7) }, /* Mountain Daylight */ - { 0, "pst", tZONE, HOUR( 8) }, /* Pacific Standard */ - { 0, "pdt", tDAYZONE, HOUR( 8) }, /* Pacific Daylight */ - { 0, "yst", tZONE, HOUR( 9) }, /* Yukon Standard */ - { 0, "ydt", tDAYZONE, HOUR( 9) }, /* Yukon Daylight */ - { 0, "hst", tZONE, HOUR(10) }, /* Hawaii Standard */ - { 0, "hdt", tDAYZONE, HOUR(10) }, /* Hawaii Daylight */ - { 0, "cat", tZONE, HOUR(10) }, /* Central Alaska */ - { 0, "ahst", tZONE, HOUR(10) }, /* Alaska-Hawaii Standard */ - { 0, "nt", tZONE, HOUR(11) }, /* Nome */ - { 0, "idlw", tZONE, HOUR(12) }, /* Intl Date Line West */ - { 0, "cet", tZONE, -HOUR(1) }, /* Central European */ - { 0, "met", tZONE, -HOUR(1) }, /* Middle European */ - { 0, "mewt", tZONE, -HOUR(1) }, /* Middle European Winter */ - { 0, "mest", tDAYZONE, -HOUR(1) }, /* Middle European Summer */ - { 0, "swt", tZONE, -HOUR(1) }, /* Swedish Winter */ - { 0, "sst", tDAYZONE, -HOUR(1) }, /* Swedish Summer */ - { 0, "fwt", tZONE, -HOUR(1) }, /* French Winter */ - { 0, "fst", tDAYZONE, -HOUR(1) }, /* French Summer */ - { 0, "eet", tZONE, -HOUR(2) }, /* Eastern Eur, USSR Zone 1 */ - { 0, "bt", tZONE, -HOUR(3) }, /* Baghdad, USSR Zone 2 */ - { 0, "it", tZONE, -HOUR(3)-30 },/* Iran */ - { 0, "zp4", tZONE, -HOUR(4) }, /* USSR Zone 3 */ - { 0, "zp5", tZONE, -HOUR(5) }, /* USSR Zone 4 */ - { 0, "ist", tZONE, -HOUR(5)-30 },/* Indian Standard */ - { 0, "zp6", tZONE, -HOUR(6) }, /* USSR Zone 5 */ - /* { 0, "nst", tZONE, -HOUR(6.5) }, */ /* North Sumatra: Conflict */ - /* { 0, "sst", tZONE, -HOUR(7) }, */ /* So Sumatra, USSR 6: Conflict */ - { 0, "wast", tZONE, -HOUR(7) }, /* West Australian Standard */ - { 0, "wadt", tDAYZONE, -HOUR(7) }, /* West Australian Daylight */ - { 0, "jt", tZONE, -HOUR(7)-30 },/* Java (3pm in Cronusland!)*/ - { 0, "cct", tZONE, -HOUR(8) }, /* China Coast, USSR Zone 7 */ - { 0, "jst", tZONE, -HOUR(9) }, /* Japan Std, USSR Zone 8 */ - { 0, "cast", tZONE, -HOUR(9)-30 },/* Central Australian Std */ - { 0, "cadt", tDAYZONE, -HOUR(9)-30 },/* Central Australian Daylt */ - { 0, "east", tZONE, -HOUR(10) }, /* Eastern Australian Std */ - { 0, "eadt", tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylt */ - { 0, "gst", tZONE, -HOUR(10) }, /* Guam Std, USSR Zone 9 */ - { 0, "nzt", tZONE, -HOUR(12) }, /* New Zealand */ - { 0, "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */ - { 0, "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */ - { 0, "idle", tZONE, -HOUR(12) }, /* Intl Date Line East */ - - { 0, "dst", tDST, 0 }, - - /* Time units. */ - { 4, "years", tMONTH_UNIT, 12 }, - { 5, "months", tMONTH_UNIT, 1 }, - { 9, "fortnights", tSEC_UNIT, 14 * 24 * 60 * 60 }, - { 4, "weeks", tSEC_UNIT, 7 * 24 * 60 * 60 }, - { 3, "days", tSEC_UNIT, 1 * 24 * 60 * 60 }, - { 4, "hours", tSEC_UNIT, 60 * 60 }, - { 3, "minutes", tSEC_UNIT, 60 }, - { 3, "seconds", tSEC_UNIT, 1 }, - - /* Relative-time words. */ - { 0, "tomorrow", tSEC_UNIT, 1 * 24 * 60 * 60 }, - { 0, "yesterday", tSEC_UNIT, -1 * 24 * 60 * 60 }, - { 0, "today", tSEC_UNIT, 0 }, - { 0, "now", tSEC_UNIT, 0 }, - { 0, "last", tUNUMBER, -1 }, - { 0, "this", tSEC_UNIT, 0 }, - { 0, "next", tUNUMBER, 2 }, - { 0, "first", tUNUMBER, 1 }, - { 0, "1st", tUNUMBER, 1 }, -/* { 0, "second", tUNUMBER, 2 }, */ - { 0, "2nd", tUNUMBER, 2 }, - { 0, "third", tUNUMBER, 3 }, - { 0, "3rd", tUNUMBER, 3 }, - { 0, "fourth", tUNUMBER, 4 }, - { 0, "4th", tUNUMBER, 4 }, - { 0, "fifth", tUNUMBER, 5 }, - { 0, "5th", tUNUMBER, 5 }, - { 0, "sixth", tUNUMBER, 6 }, - { 0, "seventh", tUNUMBER, 7 }, - { 0, "eighth", tUNUMBER, 8 }, - { 0, "ninth", tUNUMBER, 9 }, - { 0, "tenth", tUNUMBER, 10 }, - { 0, "eleventh", tUNUMBER, 11 }, - { 0, "twelfth", tUNUMBER, 12 }, - { 0, "ago", tAGO, 1 }, - - /* Military timezones. */ - { 0, "a", tZONE, HOUR( 1) }, - { 0, "b", tZONE, HOUR( 2) }, - { 0, "c", tZONE, HOUR( 3) }, - { 0, "d", tZONE, HOUR( 4) }, - { 0, "e", tZONE, HOUR( 5) }, - { 0, "f", tZONE, HOUR( 6) }, - { 0, "g", tZONE, HOUR( 7) }, - { 0, "h", tZONE, HOUR( 8) }, - { 0, "i", tZONE, HOUR( 9) }, - { 0, "k", tZONE, HOUR( 10) }, - { 0, "l", tZONE, HOUR( 11) }, - { 0, "m", tZONE, HOUR( 12) }, - { 0, "n", tZONE, HOUR(- 1) }, - { 0, "o", tZONE, HOUR(- 2) }, - { 0, "p", tZONE, HOUR(- 3) }, - { 0, "q", tZONE, HOUR(- 4) }, - { 0, "r", tZONE, HOUR(- 5) }, - { 0, "s", tZONE, HOUR(- 6) }, - { 0, "t", tZONE, HOUR(- 7) }, - { 0, "u", tZONE, HOUR(- 8) }, - { 0, "v", tZONE, HOUR(- 9) }, - { 0, "w", tZONE, HOUR(-10) }, - { 0, "x", tZONE, HOUR(-11) }, - { 0, "y", tZONE, HOUR(-12) }, - { 0, "z", tZONE, HOUR( 0) }, - - /* End of table. */ - { 0, NULL, 0, 0 } -}; - - - - -/* ARGSUSED */ -static int -yyerror(const char *s) -{ - (void)s; - return 0; -} - -static time_t -ToSeconds(time_t Hours, time_t Minutes, time_t Seconds) -{ - if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59) - return -1; - if (Hours < 0 || Hours > 23) - return -1; - return (Hours * 60L + Minutes) * 60L + Seconds; -} - - -/* Year is either - * A number from 0 to 99, which means a year from 1970 to 2069, or - * The actual year (>=100). */ -static time_t -Convert(time_t Month, time_t Day, time_t Year, - time_t Hours, time_t Minutes, time_t Seconds, DSTMODE DSTmode) -{ - static int DaysInMonth[12] = { - 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 - }; - time_t tod; - time_t Julian; - int i; - - if (Year < 69) - Year += 2000; - else if (Year < 100) - Year += 1900; - DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) - ? 29 : 28; - /* Checking for 2038 bogusly assumes that time_t is 32 bits. But - I'm too lazy to try to check for time_t overflow in another way. */ - if (Year < EPOCH || Year > 2038 - || Month < 1 || Month > 12 - /* Lint fluff: "conversion from long may lose accuracy" */ - || Day < 1 || Day > DaysInMonth[(int)--Month]) - return -1; - - Julian = Day - 1; - for (i = 0; i < Month; i++) - Julian += DaysInMonth[i]; - for (i = EPOCH; i < Year; i++) - Julian += 365 + (i % 4 == 0); - Julian *= SECSPERDAY; - Julian += yyTimezone * 60L; - if ((tod = ToSeconds(Hours, Minutes, Seconds)) < 0) - return -1; - Julian += tod; - if (DSTmode == DSTon - || (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst)) - Julian -= 60 * 60; - return Julian; -} - - -static time_t -DSTcorrect(time_t Start, time_t Future) -{ - time_t StartDay; - time_t FutureDay; - - StartDay = (localtime(&Start)->tm_hour + 1) % 24; - FutureDay = (localtime(&Future)->tm_hour + 1) % 24; - return (Future - Start) + (StartDay - FutureDay) * 60L * 60L; -} - - -static time_t -RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber) -{ - struct tm *tm; - time_t now; - - now = Start; - tm = localtime(&now); - now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7); - now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1); - return DSTcorrect(Start, now); -} - - -static time_t -RelativeMonth(time_t Start, time_t RelMonth) -{ - struct tm *tm; - time_t Month; - time_t Year; - - if (RelMonth == 0) - return 0; - tm = localtime(&Start); - Month = 12 * (tm->tm_year + 1900) + tm->tm_mon + RelMonth; - Year = Month / 12; - Month = Month % 12 + 1; - return DSTcorrect(Start, - Convert(Month, (time_t)tm->tm_mday, Year, - (time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec, - DSTmaybe)); -} - -static int -yylex(void) -{ - char c; - char buff[64]; - - for ( ; ; ) { - while (isspace((unsigned char)*yyInput)) - yyInput++; - - /* Skip parenthesized comments. */ - if (*yyInput == '(') { - int Count = 0; - do { - c = *yyInput++; - if (c == '\0') - return c; - if (c == '(') - Count++; - else if (c == ')') - Count--; - } while (Count > 0); - continue; - } - - /* Try the next token in the word table first. */ - /* This allows us to match "2nd", for example. */ - { - char *src = yyInput; - const struct TABLE *tp; - unsigned i = 0; - - /* Force to lowercase and strip '.' characters. */ - while (*src != '\0' - && (isalnum((unsigned char)*src) || *src == '.') - && i < sizeof(buff)-1) { - if (*src != '.') { - if (isupper((unsigned char)*src)) - buff[i++] = tolower((unsigned char)*src); - else - buff[i++] = *src; - } - src++; - } - buff[i++] = '\0'; - - /* - * Find the first match. If the word can be - * abbreviated, make sure we match at least - * the minimum abbreviation. - */ - for (tp = TimeWords; tp->name; tp++) { - size_t abbrev = tp->abbrev; - if (abbrev == 0) - abbrev = strlen(tp->name); - if (strlen(buff) >= abbrev - && strncmp(tp->name, buff, strlen(buff)) - == 0) { - /* Skip over token. */ - yyInput = src; - /* Return the match. */ - yylval.Number = tp->value; - return tp->type; - } - } - } - - /* - * Not in the word table, maybe it's a number. Note: - * Because '-' and '+' have other special meanings, I - * don't deal with signed numbers here. - */ - if (isdigit((unsigned char)(c = *yyInput))) { - for (yylval.Number = 0; isdigit((unsigned char)(c = *yyInput++)); ) - yylval.Number = 10 * yylval.Number + c - '0'; - yyInput--; - return (tUNUMBER); - } - - return (*yyInput++); - } -} - -#define TM_YEAR_ORIGIN 1900 - -/* Yield A - B, measured in seconds. */ -static long -difftm (struct tm *a, struct tm *b) -{ - int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); - int by = b->tm_year + (TM_YEAR_ORIGIN - 1); - int days = ( - /* difference in day of year */ - a->tm_yday - b->tm_yday - /* + intervening leap days */ - + ((ay >> 2) - (by >> 2)) - - (ay/100 - by/100) - + ((ay/100 >> 2) - (by/100 >> 2)) - /* + difference in years * 365 */ - + (long)(ay-by) * 365 - ); - return (60*(60*(24*days + (a->tm_hour - b->tm_hour)) - + (a->tm_min - b->tm_min)) - + (a->tm_sec - b->tm_sec)); -} - -time_t -get_date(char *p) -{ - struct tm *tm; - struct tm gmt, *gmt_ptr; - time_t Start; - time_t tod; - time_t nowtime; - long tzone; - - memset(&gmt, 0, sizeof(gmt)); - yyInput = p; - - (void)time (&nowtime); - - gmt_ptr = gmtime (&nowtime); - if (gmt_ptr != NULL) { - /* Copy, in case localtime and gmtime use the same buffer. */ - gmt = *gmt_ptr; - } - - if (! (tm = localtime (&nowtime))) - return -1; - - if (gmt_ptr != NULL) - tzone = difftm (&gmt, tm) / 60; - else - /* This system doesn't understand timezones; fake it. */ - tzone = 0; - if(tm->tm_isdst) - tzone += 60; - - yyYear = tm->tm_year + 1900; - yyMonth = tm->tm_mon + 1; - yyDay = tm->tm_mday; - yyTimezone = tzone; - yyDSTmode = DSTmaybe; - yyHour = 0; - yyMinutes = 0; - yySeconds = 0; - yyRelSeconds = 0; - yyRelMonth = 0; - yyHaveDate = 0; - yyHaveDay = 0; - yyHaveRel = 0; - yyHaveTime = 0; - yyHaveZone = 0; - - if (yyparse() - || yyHaveTime > 1 || yyHaveZone > 1 - || yyHaveDate > 1 || yyHaveDay > 1) - return -1; - - if (yyHaveDate || yyHaveTime || yyHaveDay) { - Start = Convert(yyMonth, yyDay, yyYear, - yyHour, yyMinutes, yySeconds, yyDSTmode); - if (Start < 0) - return -1; - } else { - Start = nowtime; - if (!yyHaveRel) - Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) + tm->tm_sec; - } - - Start += yyRelSeconds; - Start += RelativeMonth(Start, yyRelMonth); - - if (yyHaveDay && !yyHaveDate) { - tod = RelativeDate(Start, yyDayOrdinal, yyDayNumber); - Start += tod; - } - - /* Have to do *something* with a legitimate -1 so it's - * distinguishable from the error return value. (Alternately - * could set errno on error.) */ - return Start == -1 ? 0 : Start; -} - - -#if defined(TEST) - -/* ARGSUSED */ -int -main(int argc, char **argv) -{ - time_t d; - - while (*++argv != NULL) { - (void)printf("Input: %s\n", *argv); - d = get_date(*argv); - if (d == -1) - (void)printf("Bad format - couldn't convert.\n"); - else - (void)printf("Output: %s\n", ctime(&d)); - } - exit(0); - /* NOTREACHED */ -} -#endif /* defined(TEST) */ -#line 814 "getdate.c" -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack() -{ - int newsize, i; - short *newss; - YYSTYPE *newvs; - - if ((newsize = yystacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - i = yyssp - yyss; - newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) : - (short *)malloc(newsize * sizeof *newss); - if (newss == NULL) - return -1; - yyss = newss; - yyssp = newss + i; - newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) : - (YYSTYPE *)malloc(newsize * sizeof *newvs); - if (newvs == NULL) - return -1; - yyvs = newvs; - yyvsp = newvs + i; - yystacksize = newsize; - yysslim = yyss + newsize - 1; - return 0; -} - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -#ifndef YYPARSE_PARAM -#if defined(__cplusplus) || __STDC__ -#define YYPARSE_PARAM_ARG void -#define YYPARSE_PARAM_DECL -#else /* ! ANSI-C/C++ */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* ANSI-C/C++ */ -#else /* YYPARSE_PARAM */ -#ifndef YYPARSE_PARAM_TYPE -#define YYPARSE_PARAM_TYPE void * -#endif -#if defined(__cplusplus) || __STDC__ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM_TYPE YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* ! ANSI-C/C++ */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM; -#endif /* ANSI-C/C++ */ -#endif /* ! YYPARSE_PARAM */ - -int -yyparse (YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG"))) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - if (yyss == NULL && yygrowstack()) goto yyoverflow; - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if ((yyn = yydefred[yystate])) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yysslim && yygrowstack()) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#if defined(lint) || defined(__GNUC__) - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#if defined(lint) || defined(__GNUC__) - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yysslim && yygrowstack()) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 3: -#line 108 "getdate.y" -{ yyHaveTime++; } -break; -case 4: -#line 109 "getdate.y" -{ yyHaveZone++; } -break; -case 5: -#line 110 "getdate.y" -{ yyHaveDate++; } -break; -case 6: -#line 111 "getdate.y" -{ yyHaveDay++; } -break; -case 7: -#line 112 "getdate.y" -{ yyHaveRel++; } -break; -case 9: -#line 116 "getdate.y" -{ - /* "7am" */ - yyHour = yyvsp[-1].Number; - if (yyHour == 12) - yyHour = 0; - yyMinutes = 0; - yySeconds = 0; - if (yyvsp[0].Number == tPM) - yyHour += 12; - } -break; -case 10: -#line 126 "getdate.y" -{ - /* "7:12:18" "19:17" */ - } -break; -case 11: -#line 129 "getdate.y" -{ - /* "7:12pm", "12:20:13am" */ - if (yyHour == 12) - yyHour = 0; - if (yyvsp[0].Number == tPM) - yyHour += 12; - } -break; -case 12: -#line 136 "getdate.y" -{ - /* "7:14+0700" */ - yyDSTmode = DSToff; - yyTimezone = - (yyvsp[0].Number % 100 + (yyvsp[0].Number / 100) * 60); - } -break; -case 13: -#line 141 "getdate.y" -{ - /* "19:14:12-0530" */ - yyDSTmode = DSToff; - yyTimezone = + (yyvsp[0].Number % 100 + (yyvsp[0].Number / 100) * 60); - } -break; -case 14: -#line 148 "getdate.y" -{ - yyHour = yyvsp[-2].Number; - yyMinutes = yyvsp[0].Number; - yySeconds = 0; - } -break; -case 15: -#line 153 "getdate.y" -{ - yyHour = yyvsp[-4].Number; - yyMinutes = yyvsp[-2].Number; - yySeconds = yyvsp[0].Number; - } -break; -case 16: -#line 160 "getdate.y" -{ - yyTimezone = yyvsp[0].Number; - yyDSTmode = DSToff; - } -break; -case 17: -#line 164 "getdate.y" -{ - yyTimezone = yyvsp[0].Number; - yyDSTmode = DSTon; - } -break; -case 18: -#line 168 "getdate.y" -{ - yyTimezone = yyvsp[-1].Number; - yyDSTmode = DSTon; - } -break; -case 19: -#line 174 "getdate.y" -{ - yyDayOrdinal = 1; - yyDayNumber = yyvsp[0].Number; - } -break; -case 20: -#line 178 "getdate.y" -{ - /* "tue," "wednesday," */ - yyDayOrdinal = 1; - yyDayNumber = yyvsp[-1].Number; - } -break; -case 21: -#line 183 "getdate.y" -{ - /* "second tues" "3 wed" */ - yyDayOrdinal = yyvsp[-1].Number; - yyDayNumber = yyvsp[0].Number; - } -break; -case 22: -#line 190 "getdate.y" -{ - /* "1/15" */ - yyMonth = yyvsp[-2].Number; - yyDay = yyvsp[0].Number; - } -break; -case 23: -#line 195 "getdate.y" -{ - if (yyvsp[-4].Number >= 13) { - /* First number is big: 2004/01/29, 99/02/17 */ - yyYear = yyvsp[-4].Number; - yyMonth = yyvsp[-2].Number; - yyDay = yyvsp[0].Number; - } else if ((yyvsp[0].Number >= 13) || (yyvsp[-2].Number >= 13)) { - /* Last number is big: 01/07/98 */ - /* Middle number is big: 01/29/04 */ - yyMonth = yyvsp[-4].Number; - yyDay = yyvsp[-2].Number; - yyYear = yyvsp[0].Number; - } else { - /* No significant clues: 02/03/04 */ - yyMonth = yyvsp[-4].Number; - yyDay = yyvsp[-2].Number; - yyYear = yyvsp[0].Number; - } - } -break; -case 24: -#line 214 "getdate.y" -{ - /* ISO 8601 format. yyyy-mm-dd. */ - yyYear = yyvsp[-4].Number; - yyMonth = yyvsp[-2].Number; - yyDay = yyvsp[0].Number; - } -break; -case 25: -#line 220 "getdate.y" -{ - if (yyvsp[-4].Number > 31) { - /* e.g. 1992-Jun-17 */ - yyYear = yyvsp[-4].Number; - yyMonth = yyvsp[-2].Number; - yyDay = yyvsp[0].Number; - } else { - /* e.g. 17-JUN-1992. */ - yyDay = yyvsp[-4].Number; - yyMonth = yyvsp[-2].Number; - yyYear = yyvsp[0].Number; - } - } -break; -case 26: -#line 233 "getdate.y" -{ - /* "May 3" */ - yyMonth = yyvsp[-1].Number; - yyDay = yyvsp[0].Number; - } -break; -case 27: -#line 238 "getdate.y" -{ - /* "June 17, 2001" */ - yyMonth = yyvsp[-3].Number; - yyDay = yyvsp[-2].Number; - yyYear = yyvsp[0].Number; - } -break; -case 28: -#line 244 "getdate.y" -{ - /* "12 Sept" */ - yyDay = yyvsp[-1].Number; - yyMonth = yyvsp[0].Number; - } -break; -case 29: -#line 249 "getdate.y" -{ - /* "12 Sept 1997" */ - yyDay = yyvsp[-2].Number; - yyMonth = yyvsp[-1].Number; - yyYear = yyvsp[0].Number; - } -break; -case 30: -#line 257 "getdate.y" -{ - yyRelSeconds = -yyRelSeconds; - yyRelMonth = -yyRelMonth; - } -break; -case 32: -#line 264 "getdate.y" -{ - /* "-3 hours" */ - yyRelSeconds -= yyvsp[-1].Number * yyvsp[0].Number; - } -break; -case 33: -#line 268 "getdate.y" -{ - /* "+1 minute" */ - yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number; - } -break; -case 34: -#line 272 "getdate.y" -{ - /* "1 day" */ - yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number; - } -break; -case 35: -#line 276 "getdate.y" -{ - /* "hour" */ - yyRelSeconds += yyvsp[0].Number; - } -break; -case 36: -#line 280 "getdate.y" -{ - /* "-3 months" */ - yyRelMonth -= yyvsp[-1].Number * yyvsp[0].Number; - } -break; -case 37: -#line 284 "getdate.y" -{ - /* "+5 years" */ - yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number; - } -break; -case 38: -#line 288 "getdate.y" -{ - /* "2 years" */ - yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number; - } -break; -case 39: -#line 292 "getdate.y" -{ - /* "6 months" */ - yyRelMonth += yyvsp[0].Number; - } -break; -case 40: -#line 298 "getdate.y" -{ - if (yyHaveTime && yyHaveDate && !yyHaveRel) - yyYear = yyvsp[0].Number; - else { - if(yyvsp[0].Number>10000) { - /* "20040301" */ - yyHaveDate++; - yyDay= (yyvsp[0].Number)%100; - yyMonth= (yyvsp[0].Number/100)%100; - yyYear = yyvsp[0].Number/10000; - } - else { - /* "513" is same as "5:13" */ - yyHaveTime++; - if (yyvsp[0].Number < 100) { - yyHour = yyvsp[0].Number; - yyMinutes = 0; - } - else { - yyHour = yyvsp[0].Number / 100; - yyMinutes = yyvsp[0].Number % 100; - } - yySeconds = 0; - } - } - } -break; -#line 1315 "getdate.c" - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yysslim && yygrowstack()) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); -} diff --git a/libarchive/libarchive-2.4.17/tar/test/old/config.sh b/libarchive/libarchive-2.4.17/tar/test/old/config.sh deleted file mode 100755 index 2d884f8..0000000 --- a/libarchive/libarchive-2.4.17/tar/test/old/config.sh +++ /dev/null @@ -1,75 +0,0 @@ -# -# 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/libarchive/libarchive-2.4.17/tar/test/old/test-acl.sh b/libarchive/libarchive-2.4.17/tar/test/old/test-acl.sh deleted file mode 100755 index 818607d..0000000 --- a/libarchive/libarchive-2.4.17/tar/test/old/test-acl.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/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/libarchive/libarchive-2.4.17/tar/test/old/test-basic.sh b/libarchive/libarchive-2.4.17/tar/test/old/test-basic.sh deleted file mode 100755 index 0564bc7..0000000 --- a/libarchive/libarchive-2.4.17/tar/test/old/test-basic.sh +++ /dev/null @@ -1,432 +0,0 @@ -#!/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/libarchive/libarchive-2.4.17/tar/test/old/test-deep-dir.sh b/libarchive/libarchive-2.4.17/tar/test/old/test-deep-dir.sh deleted file mode 100755 index 22cf1c8..0000000 --- a/libarchive/libarchive-2.4.17/tar/test/old/test-deep-dir.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/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/libarchive/libarchive-2.4.17/tar/test/old/test-flags.sh b/libarchive/libarchive-2.4.17/tar/test/old/test-flags.sh deleted file mode 100755 index bfbf542..0000000 --- a/libarchive/libarchive-2.4.17/tar/test/old/test-flags.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/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/libarchive/libarchive-2.4.17/tar/test/old/test-nodump.sh b/libarchive/libarchive-2.4.17/tar/test/old/test-nodump.sh deleted file mode 100755 index 1d21b49..0000000 --- a/libarchive/libarchive-2.4.17/tar/test/old/test-nodump.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/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/libarchive/libarchive-2.4.17/tar/test/old/test-overwrite.sh b/libarchive/libarchive-2.4.17/tar/test/old/test-overwrite.sh deleted file mode 100755 index b920890..0000000 --- a/libarchive/libarchive-2.4.17/tar/test/old/test-overwrite.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/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/libarchive/libarchive-2.4.17/tar/test/old/test-utf8.sh b/libarchive/libarchive-2.4.17/tar/test/old/test-utf8.sh deleted file mode 100755 index c1b18a6..0000000 --- a/libarchive/libarchive-2.4.17/tar/test/old/test-utf8.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/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/libarchive/libarchive-2.4.17/version b/libarchive/libarchive-2.4.17/version deleted file mode 100644 index b29b920..0000000 --- a/libarchive/libarchive-2.4.17/version +++ /dev/null @@ -1 +0,0 @@ -2.4.17
\ No newline at end of file diff --git a/libarchive/libarchive-2.5.5/COPYING b/libarchive/libarchive-2.5.5/COPYING new file mode 100644 index 0000000..ec7d6c4 --- /dev/null +++ b/libarchive/libarchive-2.5.5/COPYING @@ -0,0 +1,60 @@ +The libarchive distribution as a whole is Copyright by Tim Kientzle +and is subject to the copyright notice reproduced at the bottom of +this file. + +Each individual file in this distribution should have a clear +copyright/licensing statement at the beginning of the file. If any do +not, please let me know and I will rectify it. The following is +intended to summarize the copyright status of the individual files; +the actual statements in the files are controlling. + +* Except as listed below, all C sources (including .c and .h files) + and documentation files are subject to the copyright notice reproduced + at the bottom of this file. + +* The following source files are also subject in whole or in part to + a 3-clause UC Regents copyright; please read the individual source + files for details: + libarchive/archive_entry.c + libarchive/archive_read_support_compression_compress.c + libarchive/archive_write_set_compression_compress.c + libarchive/mtree.5 + tar/matching.c + +* The following source files are in the public domain: + tar/getdate.y + +* The build files---including Makefiles, configure scripts, + and auxiliary scripts used as part of the compile process---have + widely varying licensing terms. Please check individual files before + distributing them to see if those restrictions apply to you. + +I intend for all new source code to use the license below and hope over +time to replace code with other licenses with new implementations that +do use the license below. The varying licensing of the build scripts +seems to be an unavoidable mess. + + +Copyright (c) 2003-2008 <author(s)> +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. diff --git a/libarchive/libarchive-2.4.17/INSTALL b/libarchive/libarchive-2.5.5/INSTALL index 6da53c3..6da53c3 100644 --- a/libarchive/libarchive-2.4.17/INSTALL +++ b/libarchive/libarchive-2.5.5/INSTALL diff --git a/libarchive/libarchive-2.4.17/Makefile.am b/libarchive/libarchive-2.5.5/Makefile.am index ca8a7aa..5430f4f 100644 --- a/libarchive/libarchive-2.4.17/Makefile.am +++ b/libarchive/libarchive-2.5.5/Makefile.am @@ -8,7 +8,7 @@ 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 tar/test/list.h cpio/test/list.h $(libarchive_test_REFFILES) $(bsdcpio_test_REFFILES) +BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h # # What to test: We always test libarchive, test bsdtar and bsdcpio only @@ -25,8 +25,9 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio # EXTRA_DIST= version \ contrib \ + doc \ examples \ - doc \ + windows \ $(libarchive_EXTRA_DIST) \ $(libarchive_test_EXTRA_DIST) \ $(bsdtar_EXTRA_DIST) \ @@ -43,31 +44,33 @@ dist-hook: rm -f `find $(distdir) -name '*.out'` rm -f `find $(distdir) -name '*.core'` -rm -f $(distdir)/*/Makefile $(distdir)/*/*/Makefile - cd $(distdir)/doc && ./update.sh + cd $(distdir)/doc && /bin/sh 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 -rf .ref -rm -rf autom4te.cache/ -rm -f *~ + -[ -f libarchive/Makefile ] && cd libarchive && make clean + -[ -f libarchive/test/Makefile ] && cd libarchive/test && make clean + -[ -f tar/Makefile ] && cd tar && make clean + -[ -f tar/test/Makefile ] && cd tar/test && make clean + -[ -f cpio/Makefile ] && cd cpio && make clean + -[ -f cpio/test/Makefile ] && cd cpio/test && make clean # # Libarchive headers, source, etc. # # -include_HEADERS= libarchive/archive_entry.h -# Note: archive.h is built from archive.h.in, so don't -# include archive.h in the distfile, but do install it. -nodist_include_HEADERS= libarchive/archive.h +include_HEADERS= libarchive/archive.h libarchive/archive_entry.h libarchive_la_SOURCES= \ libarchive/archive_check_magic.c \ @@ -118,6 +121,7 @@ libarchive_la_SOURCES= \ libarchive/archive_write_open_memory.c \ libarchive/archive_write_private.h \ libarchive/archive_write_set_compression_bzip2.c \ + libarchive/archive_write_set_compression_compress.c \ libarchive/archive_write_set_compression_gzip.c \ libarchive/archive_write_set_compression_none.c \ libarchive/archive_write_set_compression_program.c \ @@ -134,9 +138,9 @@ libarchive_la_SOURCES= \ libarchive/filter_fork.c \ libarchive/filter_fork.h -# archive.h ends up in the build directory, so make sure we can find it. -libarchive_la_CPPFLAGS= -I$(top_builddir)/libarchive -libarchive_la_LDFLAGS= -version-info $(ARCHIVE_LIBTOOL_VERSION) +# cygwin barfs without -no-undefined; I don't know what it does or +# whether it helps or hurts other platforms... +libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION) # Manpages to install libarchive_man_MANS= \ @@ -153,8 +157,10 @@ libarchive_man_MANS= \ libarchive/tar.5 # Additional libarchive files to include in the distribution -libarchive_EXTRA_DIST= \ - libarchive/test/list.h \ +libarchive_EXTRA_DIST= \ + libarchive/test/list.h \ + libarchive/archive_windows.c \ + libarchive/archive_windows.h \ $(libarchive_man_MANS) # @@ -198,6 +204,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_format_mtree.c \ libarchive/test/test_read_format_pax_bz2.c \ libarchive/test/test_read_format_tar.c \ + libarchive/test/test_read_format_tar_empty_filename.c \ libarchive/test/test_read_format_tbz.c \ libarchive/test/test_read_format_tgz.c \ libarchive/test/test_read_format_tz.c \ @@ -208,6 +215,8 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_truncated.c \ libarchive/test/test_tar_filenames.c \ libarchive/test/test_tar_large.c \ + libarchive/test/test_ustar_filenames.c \ + libarchive/test/test_write_compress.c \ libarchive/test/test_write_compress_program.c \ libarchive/test/test_write_disk.c \ libarchive/test/test_write_disk_hardlink.c \ @@ -221,9 +230,10 @@ libarchive_test_SOURCES= \ libarchive/test/test_write_format_shar_empty.c \ libarchive/test/test_write_format_tar.c \ libarchive/test/test_write_format_tar_empty.c \ + libarchive/test/test_write_format_tar_ustar.c \ libarchive/test/test_write_open_memory.c -libarchive_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test +libarchive_test_CPPFLAGS= -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test # The "list.h" file just lists all of the tests defined in all of the sources. # Building it automatically provides a sanity-check on libarchive_test_SOURCES @@ -231,57 +241,23 @@ libarchive_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchiv 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_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test 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_pax_filename_encoding.tar.gz.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 + libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu \ + libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu \ + libarchive/test/test_read_format_tar_empty_filename.tar.uu \ + libarchive/test/test_read_format_zip.zip.uu -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 # # @@ -296,14 +272,14 @@ bsdtar_SOURCES= \ tar/getdate.y \ tar/matching.c \ tar/read.c \ + tar/siginfo.c \ + tar/subst.c \ tar/tree.c \ tar/tree.h \ tar/util.c \ tar/write.c -bsdtar_DEPENDENCIES= libarchive.la \ - libarchive/archive_entry.h \ - libarchive/archive.h +bsdtar_DEPENDENCIES= libarchive.la if STATIC_BSDTAR bsdtar_static= -static @@ -333,24 +309,24 @@ bsdtar_test_SOURCES= \ tar/getdate.c \ tar/test/main.c \ tar/test/test.h \ + tar/test/test_0.c \ tar/test/test_basic.c \ tar/test/test_copy.c \ tar/test/test_getdate.c \ tar/test/test_help.c \ + tar/test/test_option_T.c \ + tar/test/test_patterns.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 +bsdtar_test_CPPFLAGS= -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` +bsdtar_TESTS_ENVIRONMENT= BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test else bsdtar_test_programs= bsdtar_TESTS_ENVIRONMENT= @@ -374,9 +350,7 @@ bsdcpio_SOURCES= \ cpio/pathmatch.c \ cpio/pathmatch.h -bsdcpio_DEPENDENCIES = libarchive.la \ - libarchive/archive_entry.h \ - libarchive/archive.h +bsdcpio_DEPENDENCIES = libarchive.la if STATIC_BSDCPIO @@ -411,6 +385,7 @@ bsdcpio_test_SOURCES= \ cpio/pathmatch.c \ cpio/test/main.c \ cpio/test/test.h \ + cpio/test/test_0.c \ cpio/test/test_basic.c \ cpio/test/test_format_newc.c \ cpio/test/test_gcpio_compat.c \ @@ -431,30 +406,19 @@ bsdcpio_test_SOURCES= \ cpio/test/test_owner_parse.c \ cpio/test/test_pathmatch.c -bsdcpio_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_builddir)/cpio/test +bsdcpio_test_CPPFLAGS= -I$(top_builddir)/libarchive -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_builddir);/bin/pwd` +bsdcpio_TESTS_ENVIRONMENT= BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test 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 \ @@ -465,31 +429,3 @@ bsdcpio_test_EXTRA_DIST= \ 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/libarchive/libarchive-2.4.17/Makefile.in b/libarchive/libarchive-2.5.5/Makefile.in index 6960f4c..2467299 100644 --- a/libarchive/libarchive-2.4.17/Makefile.in +++ b/libarchive/libarchive-2.5.5/Makefile.in @@ -41,21 +41,20 @@ 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 \ - $(srcdir)/config.h.in $(top_srcdir)/configure \ - $(top_srcdir)/libarchive/archive.h.in COPYING INSTALL NEWS \ - config.aux/compile config.aux/config.guess \ + $(srcdir)/config.h.in $(top_srcdir)/configure COPYING INSTALL \ + NEWS config.aux/compile config.aux/config.guess \ config.aux/config.sub config.aux/depcomp config.aux/install-sh \ config.aux/ltmain.sh config.aux/missing config.aux/ylwrap \ tar/getdate.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/version $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = libarchive/archive.h +CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -64,64 +63,60 @@ am__vpath_adj = case $$p in \ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \ - "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(includedir)" \ - "$(DESTDIR)$(includedir)" + "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libarchive_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp -am_libarchive_la_OBJECTS = \ - libarchive/libarchive_la-archive_check_magic.lo \ - libarchive/libarchive_la-archive_entry.lo \ - libarchive/libarchive_la-archive_entry_copy_stat.lo \ - libarchive/libarchive_la-archive_entry_link_resolver.lo \ - libarchive/libarchive_la-archive_entry_stat.lo \ - libarchive/libarchive_la-archive_entry_strmode.lo \ - libarchive/libarchive_la-archive_read.lo \ - libarchive/libarchive_la-archive_read_data_into_fd.lo \ - libarchive/libarchive_la-archive_read_extract.lo \ - libarchive/libarchive_la-archive_read_open_fd.lo \ - libarchive/libarchive_la-archive_read_open_file.lo \ - libarchive/libarchive_la-archive_read_open_filename.lo \ - libarchive/libarchive_la-archive_read_open_memory.lo \ - libarchive/libarchive_la-archive_read_support_compression_all.lo \ - libarchive/libarchive_la-archive_read_support_compression_bzip2.lo \ - libarchive/libarchive_la-archive_read_support_compression_compress.lo \ - libarchive/libarchive_la-archive_read_support_compression_gzip.lo \ - libarchive/libarchive_la-archive_read_support_compression_none.lo \ - libarchive/libarchive_la-archive_read_support_compression_program.lo \ - libarchive/libarchive_la-archive_read_support_format_all.lo \ - libarchive/libarchive_la-archive_read_support_format_ar.lo \ - libarchive/libarchive_la-archive_read_support_format_cpio.lo \ - libarchive/libarchive_la-archive_read_support_format_empty.lo \ - libarchive/libarchive_la-archive_read_support_format_iso9660.lo \ - libarchive/libarchive_la-archive_read_support_format_mtree.lo \ - libarchive/libarchive_la-archive_read_support_format_tar.lo \ - libarchive/libarchive_la-archive_read_support_format_zip.lo \ - libarchive/libarchive_la-archive_string.lo \ - libarchive/libarchive_la-archive_string_sprintf.lo \ - libarchive/libarchive_la-archive_util.lo \ - libarchive/libarchive_la-archive_virtual.lo \ - libarchive/libarchive_la-archive_write.lo \ - libarchive/libarchive_la-archive_write_disk.lo \ - libarchive/libarchive_la-archive_write_disk_set_standard_lookup.lo \ - libarchive/libarchive_la-archive_write_open_fd.lo \ - libarchive/libarchive_la-archive_write_open_file.lo \ - libarchive/libarchive_la-archive_write_open_filename.lo \ - libarchive/libarchive_la-archive_write_open_memory.lo \ - libarchive/libarchive_la-archive_write_set_compression_bzip2.lo \ - libarchive/libarchive_la-archive_write_set_compression_gzip.lo \ - libarchive/libarchive_la-archive_write_set_compression_none.lo \ - libarchive/libarchive_la-archive_write_set_compression_program.lo \ - libarchive/libarchive_la-archive_write_set_format.lo \ - libarchive/libarchive_la-archive_write_set_format_ar.lo \ - libarchive/libarchive_la-archive_write_set_format_by_name.lo \ - libarchive/libarchive_la-archive_write_set_format_cpio.lo \ - libarchive/libarchive_la-archive_write_set_format_cpio_newc.lo \ - libarchive/libarchive_la-archive_write_set_format_pax.lo \ - libarchive/libarchive_la-archive_write_set_format_shar.lo \ - libarchive/libarchive_la-archive_write_set_format_ustar.lo \ - libarchive/libarchive_la-filter_fork.lo +am_libarchive_la_OBJECTS = libarchive/archive_check_magic.lo \ + libarchive/archive_entry.lo \ + libarchive/archive_entry_copy_stat.lo \ + libarchive/archive_entry_link_resolver.lo \ + libarchive/archive_entry_stat.lo \ + libarchive/archive_entry_strmode.lo libarchive/archive_read.lo \ + libarchive/archive_read_data_into_fd.lo \ + libarchive/archive_read_extract.lo \ + libarchive/archive_read_open_fd.lo \ + libarchive/archive_read_open_file.lo \ + libarchive/archive_read_open_filename.lo \ + libarchive/archive_read_open_memory.lo \ + libarchive/archive_read_support_compression_all.lo \ + libarchive/archive_read_support_compression_bzip2.lo \ + libarchive/archive_read_support_compression_compress.lo \ + libarchive/archive_read_support_compression_gzip.lo \ + libarchive/archive_read_support_compression_none.lo \ + libarchive/archive_read_support_compression_program.lo \ + libarchive/archive_read_support_format_all.lo \ + libarchive/archive_read_support_format_ar.lo \ + libarchive/archive_read_support_format_cpio.lo \ + libarchive/archive_read_support_format_empty.lo \ + libarchive/archive_read_support_format_iso9660.lo \ + libarchive/archive_read_support_format_mtree.lo \ + libarchive/archive_read_support_format_tar.lo \ + libarchive/archive_read_support_format_zip.lo \ + libarchive/archive_string.lo \ + libarchive/archive_string_sprintf.lo \ + libarchive/archive_util.lo libarchive/archive_virtual.lo \ + libarchive/archive_write.lo libarchive/archive_write_disk.lo \ + libarchive/archive_write_disk_set_standard_lookup.lo \ + libarchive/archive_write_open_fd.lo \ + libarchive/archive_write_open_file.lo \ + libarchive/archive_write_open_filename.lo \ + libarchive/archive_write_open_memory.lo \ + libarchive/archive_write_set_compression_bzip2.lo \ + libarchive/archive_write_set_compression_compress.lo \ + libarchive/archive_write_set_compression_gzip.lo \ + libarchive/archive_write_set_compression_none.lo \ + libarchive/archive_write_set_compression_program.lo \ + libarchive/archive_write_set_format.lo \ + libarchive/archive_write_set_format_ar.lo \ + libarchive/archive_write_set_format_by_name.lo \ + libarchive/archive_write_set_format_cpio.lo \ + libarchive/archive_write_set_format_cpio_newc.lo \ + libarchive/archive_write_set_format_pax.lo \ + libarchive/archive_write_set_format_shar.lo \ + libarchive/archive_write_set_format_ustar.lo \ + libarchive/filter_fork.lo libarchive_la_OBJECTS = $(am_libarchive_la_OBJECTS) libarchive_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -144,6 +139,7 @@ am_bsdcpio_test_OBJECTS = cpio/bsdcpio_test-cmdline.$(OBJEXT) \ cpio/bsdcpio_test-err.$(OBJEXT) \ cpio/bsdcpio_test-pathmatch.$(OBJEXT) \ cpio/test/bsdcpio_test-main.$(OBJEXT) \ + cpio/test/bsdcpio_test-test_0.$(OBJEXT) \ cpio/test/bsdcpio_test-test_basic.$(OBJEXT) \ cpio/test/bsdcpio_test-test_format_newc.$(OBJEXT) \ cpio/test/bsdcpio_test-test_gcpio_compat.$(OBJEXT) \ @@ -167,7 +163,8 @@ bsdcpio_test_OBJECTS = $(am_bsdcpio_test_OBJECTS) bsdcpio_test_LDADD = $(LDADD) am_bsdtar_OBJECTS = tar/bsdtar-bsdtar.$(OBJEXT) \ tar/bsdtar-getdate.$(OBJEXT) tar/bsdtar-matching.$(OBJEXT) \ - tar/bsdtar-read.$(OBJEXT) tar/bsdtar-tree.$(OBJEXT) \ + tar/bsdtar-read.$(OBJEXT) tar/bsdtar-siginfo.$(OBJEXT) \ + tar/bsdtar-subst.$(OBJEXT) tar/bsdtar-tree.$(OBJEXT) \ tar/bsdtar-util.$(OBJEXT) tar/bsdtar-write.$(OBJEXT) bsdtar_OBJECTS = $(am_bsdtar_OBJECTS) bsdtar_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @@ -175,10 +172,13 @@ bsdtar_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ $(LDFLAGS) -o $@ am_bsdtar_test_OBJECTS = tar/bsdtar_test-getdate.$(OBJEXT) \ tar/test/bsdtar_test-main.$(OBJEXT) \ + tar/test/bsdtar_test-test_0.$(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_option_T.$(OBJEXT) \ + tar/test/bsdtar_test-test_patterns.$(OBJEXT) \ tar/test/bsdtar_test-test_stdio.$(OBJEXT) \ tar/test/bsdtar_test-test_version.$(OBJEXT) bsdtar_test_OBJECTS = $(am_bsdtar_test_OBJECTS) @@ -223,6 +223,7 @@ am__objects_1 = \ libarchive/libarchive_test-archive_write_open_filename.$(OBJEXT) \ libarchive/libarchive_test-archive_write_open_memory.$(OBJEXT) \ libarchive/libarchive_test-archive_write_set_compression_bzip2.$(OBJEXT) \ + libarchive/libarchive_test-archive_write_set_compression_compress.$(OBJEXT) \ libarchive/libarchive_test-archive_write_set_compression_gzip.$(OBJEXT) \ libarchive/libarchive_test-archive_write_set_compression_none.$(OBJEXT) \ libarchive/libarchive_test-archive_write_set_compression_program.$(OBJEXT) \ @@ -269,6 +270,7 @@ am_libarchive_test_OBJECTS = $(am__objects_1) \ libarchive/test/libarchive_test-test_read_format_mtree.$(OBJEXT) \ libarchive/test/libarchive_test-test_read_format_pax_bz2.$(OBJEXT) \ libarchive/test/libarchive_test-test_read_format_tar.$(OBJEXT) \ + libarchive/test/libarchive_test-test_read_format_tar_empty_filename.$(OBJEXT) \ libarchive/test/libarchive_test-test_read_format_tbz.$(OBJEXT) \ libarchive/test/libarchive_test-test_read_format_tgz.$(OBJEXT) \ libarchive/test/libarchive_test-test_read_format_tz.$(OBJEXT) \ @@ -279,6 +281,8 @@ am_libarchive_test_OBJECTS = $(am__objects_1) \ libarchive/test/libarchive_test-test_read_truncated.$(OBJEXT) \ libarchive/test/libarchive_test-test_tar_filenames.$(OBJEXT) \ libarchive/test/libarchive_test-test_tar_large.$(OBJEXT) \ + libarchive/test/libarchive_test-test_ustar_filenames.$(OBJEXT) \ + libarchive/test/libarchive_test-test_write_compress.$(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) \ @@ -292,6 +296,7 @@ am_libarchive_test_OBJECTS = $(am__objects_1) \ libarchive/test/libarchive_test-test_write_format_shar_empty.$(OBJEXT) \ libarchive/test/libarchive_test-test_write_format_tar.$(OBJEXT) \ libarchive/test/libarchive_test-test_write_format_tar_empty.$(OBJEXT) \ + libarchive/test/libarchive_test-test_write_format_tar_ustar.$(OBJEXT) \ libarchive/test/libarchive_test-test_write_open_memory.$(OBJEXT) libarchive_test_OBJECTS = $(am_libarchive_test_OBJECTS) libarchive_test_LDADD = $(LDADD) @@ -323,8 +328,7 @@ man5dir = $(mandir)/man5 NROFF = nroff MANS = $(man_MANS) includeHEADERS_INSTALL = $(INSTALL_HEADER) -nodist_includeHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(include_HEADERS) $(nodist_include_HEADERS) +HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -341,7 +345,6 @@ distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ -ARCHIVE_H_INCLUDE_INTTYPES_H = @ARCHIVE_H_INCLUDE_INTTYPES_H@ ARCHIVE_LIBTOOL_VERSION = @ARCHIVE_LIBTOOL_VERSION@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -376,7 +379,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ -LIBARCHIVE_VERSION = @LIBARCHIVE_VERSION@ +LIBARCHIVE_VERSION_NUMBER = @LIBARCHIVE_VERSION_NUMBER@ LIBARCHIVE_VERSION_STRING = @LIBARCHIVE_VERSION_STRING@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ @@ -458,7 +461,7 @@ 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 tar/test/list.h cpio/test/list.h $(libarchive_test_REFFILES) $(bsdcpio_test_REFFILES) +BUILT_SOURCES = libarchive/test/list.h tar/test/list.h cpio/test/list.h 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 @@ -468,8 +471,9 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio # EXTRA_DIST = version \ contrib \ + doc \ examples \ - doc \ + windows \ $(libarchive_EXTRA_DIST) \ $(libarchive_test_EXTRA_DIST) \ $(bsdtar_EXTRA_DIST) \ @@ -481,7 +485,6 @@ EXTRA_DIST = version \ # # 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 \ @@ -492,10 +495,7 @@ DISTCLEANFILES = tar/getdate.c tar/getdate.h \ # Libarchive headers, source, etc. # # -include_HEADERS = libarchive/archive_entry.h -# Note: archive.h is built from archive.h.in, so don't -# include archive.h in the distfile, but do install it. -nodist_include_HEADERS = libarchive/archive.h +include_HEADERS = libarchive/archive.h libarchive/archive_entry.h libarchive_la_SOURCES = \ libarchive/archive_check_magic.c \ libarchive/archive_endian.h \ @@ -545,6 +545,7 @@ libarchive_la_SOURCES = \ libarchive/archive_write_open_memory.c \ libarchive/archive_write_private.h \ libarchive/archive_write_set_compression_bzip2.c \ + libarchive/archive_write_set_compression_compress.c \ libarchive/archive_write_set_compression_gzip.c \ libarchive/archive_write_set_compression_none.c \ libarchive/archive_write_set_compression_program.c \ @@ -562,9 +563,9 @@ libarchive_la_SOURCES = \ libarchive/filter_fork.h -# archive.h ends up in the build directory, so make sure we can find it. -libarchive_la_CPPFLAGS = -I$(top_builddir)/libarchive -libarchive_la_LDFLAGS = -version-info $(ARCHIVE_LIBTOOL_VERSION) +# cygwin barfs without -no-undefined; I don't know what it does or +# whether it helps or hurts other platforms... +libarchive_la_LDFLAGS = -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION) # Manpages to install libarchive_man_MANS = \ @@ -583,7 +584,9 @@ libarchive_man_MANS = \ # Additional libarchive files to include in the distribution libarchive_EXTRA_DIST = \ - libarchive/test/list.h \ + libarchive/test/list.h \ + libarchive/archive_windows.c \ + libarchive/archive_windows.h \ $(libarchive_man_MANS) @@ -628,6 +631,7 @@ libarchive_test_SOURCES = \ libarchive/test/test_read_format_mtree.c \ libarchive/test/test_read_format_pax_bz2.c \ libarchive/test/test_read_format_tar.c \ + libarchive/test/test_read_format_tar_empty_filename.c \ libarchive/test/test_read_format_tbz.c \ libarchive/test/test_read_format_tgz.c \ libarchive/test/test_read_format_tz.c \ @@ -638,6 +642,8 @@ libarchive_test_SOURCES = \ libarchive/test/test_read_truncated.c \ libarchive/test/test_tar_filenames.c \ libarchive/test/test_tar_large.c \ + libarchive/test/test_ustar_filenames.c \ + libarchive/test/test_write_compress.c \ libarchive/test/test_write_compress_program.c \ libarchive/test/test_write_disk.c \ libarchive/test/test_write_disk_hardlink.c \ @@ -651,31 +657,25 @@ libarchive_test_SOURCES = \ libarchive/test/test_write_format_shar_empty.c \ libarchive/test/test_write_format_tar.c \ libarchive/test/test_write_format_tar_empty.c \ + libarchive/test/test_write_format_tar_ustar.c \ libarchive/test/test_write_open_memory.c -libarchive_test_CPPFLAGS = -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test -libarchive_TESTS_ENVIRONMENT = LIBARCHIVE_TEST_FILES=`cd $(top_builddir);/bin/pwd` +libarchive_test_CPPFLAGS = -I$(top_builddir)/libarchive -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test +libarchive_TESTS_ENVIRONMENT = LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test 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_pax_filename_encoding.tar.gz.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 + libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu \ + libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu \ + libarchive/test/test_read_format_tar_empty_filename.tar.uu \ + libarchive/test/test_read_format_zip.zip.uu # @@ -690,15 +690,14 @@ bsdtar_SOURCES = \ tar/getdate.y \ tar/matching.c \ tar/read.c \ + tar/siginfo.c \ + tar/subst.c \ tar/tree.c \ tar/tree.h \ tar/util.c \ tar/write.c -bsdtar_DEPENDENCIES = libarchive.la \ - libarchive/archive_entry.h \ - libarchive/archive.h - +bsdtar_DEPENDENCIES = libarchive.la @STATIC_BSDTAR_FALSE@bsdtar_static = @STATIC_BSDTAR_TRUE@bsdtar_static = -static bsdtar_LDADD = libarchive.la @@ -719,21 +718,21 @@ bsdtar_test_SOURCES = \ tar/getdate.c \ tar/test/main.c \ tar/test/test.h \ + tar/test/test_0.c \ tar/test/test_basic.c \ tar/test/test_copy.c \ tar/test/test_getdate.c \ tar/test/test_help.c \ + tar/test/test_option_T.c \ + tar/test/test_patterns.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 +bsdtar_test_CPPFLAGS = -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` +@BUILD_BSDTAR_TRUE@bsdtar_TESTS_ENVIRONMENT = BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test # # @@ -751,10 +750,7 @@ bsdcpio_SOURCES = \ cpio/pathmatch.c \ cpio/pathmatch.h -bsdcpio_DEPENDENCIES = libarchive.la \ - libarchive/archive_entry.h \ - libarchive/archive.h - +bsdcpio_DEPENDENCIES = libarchive.la @STATIC_BSDCPIO_FALSE@bsdcpio_static = @STATIC_BSDCPIO_TRUE@bsdcpio_static = -static bsdcpio_LDADD = libarchive.la @@ -780,6 +776,7 @@ bsdcpio_test_SOURCES = \ cpio/pathmatch.c \ cpio/test/main.c \ cpio/test/test.h \ + cpio/test/test_0.c \ cpio/test/test_basic.c \ cpio/test/test_format_newc.c \ cpio/test/test_gcpio_compat.c \ @@ -800,22 +797,11 @@ bsdcpio_test_SOURCES = \ cpio/test/test_owner_parse.c \ cpio/test/test_pathmatch.c -bsdcpio_test_CPPFLAGS = -I$(top_srcdir)/libarchive -I$(top_builddir)/cpio/test +bsdcpio_test_CPPFLAGS = -I$(top_builddir)/libarchive -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_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 - +@BUILD_BSDCPIO_TRUE@bsdcpio_TESTS_ENVIRONMENT = BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test bsdcpio_test_EXTRA_DIST = \ cpio/test/test_gcpio_compat_ref.bin.uu \ cpio/test/test_gcpio_compat_ref.crc.uu \ @@ -882,8 +868,6 @@ $(srcdir)/config.h.in: $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 -libarchive/archive.h: $(top_builddir)/config.status $(top_srcdir)/libarchive/archive.h.in - cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @@ -917,153 +901,135 @@ libarchive/$(am__dirstamp): libarchive/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) libarchive/$(DEPDIR) @: > libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_check_magic.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_check_magic.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_entry.lo: libarchive/$(am__dirstamp) \ +libarchive/archive_entry.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_entry_copy_stat.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_entry_copy_stat.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_entry_link_resolver.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_entry_link_resolver.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_entry_stat.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_entry_stat.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_entry_strmode.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_entry_strmode.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read.lo: libarchive/$(am__dirstamp) \ +libarchive/archive_read.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_data_into_fd.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_read_data_into_fd.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_extract.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_read_extract.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_open_fd.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_read_open_fd.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_open_file.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_read_open_file.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_open_filename.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_read_open_filename.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_open_memory.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_read_open_memory.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_compression_all.lo: \ +libarchive/archive_read_support_compression_all.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_compression_bzip2.lo: \ +libarchive/archive_read_support_compression_bzip2.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_compression_compress.lo: \ +libarchive/archive_read_support_compression_compress.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_compression_gzip.lo: \ +libarchive/archive_read_support_compression_gzip.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_compression_none.lo: \ +libarchive/archive_read_support_compression_none.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_compression_program.lo: \ +libarchive/archive_read_support_compression_program.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_format_all.lo: \ +libarchive/archive_read_support_format_all.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_format_ar.lo: \ +libarchive/archive_read_support_format_ar.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_format_cpio.lo: \ +libarchive/archive_read_support_format_cpio.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_format_empty.lo: \ +libarchive/archive_read_support_format_empty.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_format_iso9660.lo: \ +libarchive/archive_read_support_format_iso9660.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_format_mtree.lo: \ +libarchive/archive_read_support_format_mtree.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_format_tar.lo: \ +libarchive/archive_read_support_format_tar.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_read_support_format_zip.lo: \ +libarchive/archive_read_support_format_zip.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_string.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_string.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_string_sprintf.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_string_sprintf.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_util.lo: libarchive/$(am__dirstamp) \ +libarchive/archive_util.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_virtual.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_virtual.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write.lo: libarchive/$(am__dirstamp) \ +libarchive/archive_write.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_disk.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_write_disk.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_disk_set_standard_lookup.lo: \ +libarchive/archive_write_disk_set_standard_lookup.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_open_fd.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_write_open_fd.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_open_file.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_write_open_file.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_open_filename.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_write_open_filename.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_open_memory.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_write_open_memory.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_compression_bzip2.lo: \ +libarchive/archive_write_set_compression_bzip2.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_compression_gzip.lo: \ +libarchive/archive_write_set_compression_compress.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_compression_none.lo: \ +libarchive/archive_write_set_compression_gzip.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_compression_program.lo: \ +libarchive/archive_write_set_compression_none.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_format.lo: \ +libarchive/archive_write_set_compression_program.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_format_ar.lo: \ - libarchive/$(am__dirstamp) \ +libarchive/archive_write_set_format.lo: libarchive/$(am__dirstamp) \ + libarchive/$(DEPDIR)/$(am__dirstamp) +libarchive/archive_write_set_format_ar.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_format_by_name.lo: \ +libarchive/archive_write_set_format_by_name.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_format_cpio.lo: \ +libarchive/archive_write_set_format_cpio.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_format_cpio_newc.lo: \ +libarchive/archive_write_set_format_cpio_newc.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_format_pax.lo: \ +libarchive/archive_write_set_format_pax.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_format_shar.lo: \ +libarchive/archive_write_set_format_shar.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-archive_write_set_format_ustar.lo: \ +libarchive/archive_write_set_format_ustar.lo: \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) -libarchive/libarchive_la-filter_fork.lo: libarchive/$(am__dirstamp) \ +libarchive/filter_fork.lo: libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) libarchive.la: $(libarchive_la_OBJECTS) $(libarchive_la_DEPENDENCIES) $(libarchive_la_LINK) -rpath $(libdir) $(libarchive_la_OBJECTS) $(libarchive_la_LIBADD) $(LIBS) @@ -1135,6 +1101,8 @@ cpio/test/$(DEPDIR)/$(am__dirstamp): @: > cpio/test/$(DEPDIR)/$(am__dirstamp) cpio/test/bsdcpio_test-main.$(OBJEXT): cpio/test/$(am__dirstamp) \ cpio/test/$(DEPDIR)/$(am__dirstamp) +cpio/test/bsdcpio_test-test_0.$(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): \ @@ -1190,6 +1158,10 @@ tar/bsdtar-matching.$(OBJEXT): tar/$(am__dirstamp) \ tar/$(DEPDIR)/$(am__dirstamp) tar/bsdtar-read.$(OBJEXT): tar/$(am__dirstamp) \ tar/$(DEPDIR)/$(am__dirstamp) +tar/bsdtar-siginfo.$(OBJEXT): tar/$(am__dirstamp) \ + tar/$(DEPDIR)/$(am__dirstamp) +tar/bsdtar-subst.$(OBJEXT): tar/$(am__dirstamp) \ + tar/$(DEPDIR)/$(am__dirstamp) tar/bsdtar-tree.$(OBJEXT): tar/$(am__dirstamp) \ tar/$(DEPDIR)/$(am__dirstamp) tar/bsdtar-util.$(OBJEXT): tar/$(am__dirstamp) \ @@ -1209,6 +1181,8 @@ tar/test/$(DEPDIR)/$(am__dirstamp): @: > 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_0.$(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) \ @@ -1217,6 +1191,10 @@ 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_option_T.$(OBJEXT): \ + tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp) +tar/test/bsdtar_test-test_patterns.$(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) \ @@ -1341,6 +1319,9 @@ libarchive/libarchive_test-archive_write_open_memory.$(OBJEXT): \ libarchive/libarchive_test-archive_write_set_compression_bzip2.$(OBJEXT): \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) +libarchive/libarchive_test-archive_write_set_compression_compress.$(OBJEXT): \ + libarchive/$(am__dirstamp) \ + libarchive/$(DEPDIR)/$(am__dirstamp) libarchive/libarchive_test-archive_write_set_compression_gzip.$(OBJEXT): \ libarchive/$(am__dirstamp) \ libarchive/$(DEPDIR)/$(am__dirstamp) @@ -1482,6 +1463,9 @@ libarchive/test/libarchive_test-test_read_format_pax_bz2.$(OBJEXT): \ libarchive/test/libarchive_test-test_read_format_tar.$(OBJEXT): \ libarchive/test/$(am__dirstamp) \ libarchive/test/$(DEPDIR)/$(am__dirstamp) +libarchive/test/libarchive_test-test_read_format_tar_empty_filename.$(OBJEXT): \ + libarchive/test/$(am__dirstamp) \ + libarchive/test/$(DEPDIR)/$(am__dirstamp) libarchive/test/libarchive_test-test_read_format_tbz.$(OBJEXT): \ libarchive/test/$(am__dirstamp) \ libarchive/test/$(DEPDIR)/$(am__dirstamp) @@ -1512,6 +1496,12 @@ libarchive/test/libarchive_test-test_tar_filenames.$(OBJEXT): \ libarchive/test/libarchive_test-test_tar_large.$(OBJEXT): \ libarchive/test/$(am__dirstamp) \ libarchive/test/$(DEPDIR)/$(am__dirstamp) +libarchive/test/libarchive_test-test_ustar_filenames.$(OBJEXT): \ + libarchive/test/$(am__dirstamp) \ + libarchive/test/$(DEPDIR)/$(am__dirstamp) +libarchive/test/libarchive_test-test_write_compress.$(OBJEXT): \ + libarchive/test/$(am__dirstamp) \ + libarchive/test/$(DEPDIR)/$(am__dirstamp) libarchive/test/libarchive_test-test_write_compress_program.$(OBJEXT): \ libarchive/test/$(am__dirstamp) \ libarchive/test/$(DEPDIR)/$(am__dirstamp) @@ -1551,6 +1541,9 @@ libarchive/test/libarchive_test-test_write_format_tar.$(OBJEXT): \ libarchive/test/libarchive_test-test_write_format_tar_empty.$(OBJEXT): \ libarchive/test/$(am__dirstamp) \ libarchive/test/$(DEPDIR)/$(am__dirstamp) +libarchive/test/libarchive_test-test_write_format_tar_ustar.$(OBJEXT): \ + libarchive/test/$(am__dirstamp) \ + libarchive/test/$(DEPDIR)/$(am__dirstamp) libarchive/test/libarchive_test-test_write_open_memory.$(OBJEXT): \ libarchive/test/$(am__dirstamp) \ libarchive/test/$(DEPDIR)/$(am__dirstamp) @@ -1569,6 +1562,7 @@ mostlyclean-compile: -rm -f cpio/bsdcpio_test-err.$(OBJEXT) -rm -f cpio/bsdcpio_test-pathmatch.$(OBJEXT) -rm -f cpio/test/bsdcpio_test-main.$(OBJEXT) + -rm -f cpio/test/bsdcpio_test-test_0.$(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) @@ -1588,108 +1582,110 @@ mostlyclean-compile: -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 libarchive/libarchive_la-archive_check_magic.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_check_magic.lo - -rm -f libarchive/libarchive_la-archive_entry.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_entry.lo - -rm -f libarchive/libarchive_la-archive_entry_copy_stat.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_entry_copy_stat.lo - -rm -f libarchive/libarchive_la-archive_entry_link_resolver.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_entry_link_resolver.lo - -rm -f libarchive/libarchive_la-archive_entry_stat.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_entry_stat.lo - -rm -f libarchive/libarchive_la-archive_entry_strmode.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_entry_strmode.lo - -rm -f libarchive/libarchive_la-archive_read.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read.lo - -rm -f libarchive/libarchive_la-archive_read_data_into_fd.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_data_into_fd.lo - -rm -f libarchive/libarchive_la-archive_read_extract.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_extract.lo - -rm -f libarchive/libarchive_la-archive_read_open_fd.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_open_fd.lo - -rm -f libarchive/libarchive_la-archive_read_open_file.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_open_file.lo - -rm -f libarchive/libarchive_la-archive_read_open_filename.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_open_filename.lo - -rm -f libarchive/libarchive_la-archive_read_open_memory.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_open_memory.lo - -rm -f libarchive/libarchive_la-archive_read_support_compression_all.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_compression_all.lo - -rm -f libarchive/libarchive_la-archive_read_support_compression_bzip2.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_compression_bzip2.lo - -rm -f libarchive/libarchive_la-archive_read_support_compression_compress.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_compression_compress.lo - -rm -f libarchive/libarchive_la-archive_read_support_compression_gzip.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_compression_gzip.lo - -rm -f libarchive/libarchive_la-archive_read_support_compression_none.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_compression_none.lo - -rm -f libarchive/libarchive_la-archive_read_support_compression_program.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_compression_program.lo - -rm -f libarchive/libarchive_la-archive_read_support_format_all.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_format_all.lo - -rm -f libarchive/libarchive_la-archive_read_support_format_ar.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_format_ar.lo - -rm -f libarchive/libarchive_la-archive_read_support_format_cpio.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_format_cpio.lo - -rm -f libarchive/libarchive_la-archive_read_support_format_empty.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_format_empty.lo - -rm -f libarchive/libarchive_la-archive_read_support_format_iso9660.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_format_iso9660.lo - -rm -f libarchive/libarchive_la-archive_read_support_format_mtree.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_format_mtree.lo - -rm -f libarchive/libarchive_la-archive_read_support_format_tar.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_format_tar.lo - -rm -f libarchive/libarchive_la-archive_read_support_format_zip.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_read_support_format_zip.lo - -rm -f libarchive/libarchive_la-archive_string.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_string.lo - -rm -f libarchive/libarchive_la-archive_string_sprintf.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_string_sprintf.lo - -rm -f libarchive/libarchive_la-archive_util.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_util.lo - -rm -f libarchive/libarchive_la-archive_virtual.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_virtual.lo - -rm -f libarchive/libarchive_la-archive_write.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write.lo - -rm -f libarchive/libarchive_la-archive_write_disk.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_disk.lo - -rm -f libarchive/libarchive_la-archive_write_disk_set_standard_lookup.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_disk_set_standard_lookup.lo - -rm -f libarchive/libarchive_la-archive_write_open_fd.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_open_fd.lo - -rm -f libarchive/libarchive_la-archive_write_open_file.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_open_file.lo - -rm -f libarchive/libarchive_la-archive_write_open_filename.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_open_filename.lo - -rm -f libarchive/libarchive_la-archive_write_open_memory.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_open_memory.lo - -rm -f libarchive/libarchive_la-archive_write_set_compression_bzip2.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_compression_bzip2.lo - -rm -f libarchive/libarchive_la-archive_write_set_compression_gzip.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_compression_gzip.lo - -rm -f libarchive/libarchive_la-archive_write_set_compression_none.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_compression_none.lo - -rm -f libarchive/libarchive_la-archive_write_set_compression_program.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_compression_program.lo - -rm -f libarchive/libarchive_la-archive_write_set_format.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_format.lo - -rm -f libarchive/libarchive_la-archive_write_set_format_ar.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_format_ar.lo - -rm -f libarchive/libarchive_la-archive_write_set_format_by_name.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_format_by_name.lo - -rm -f libarchive/libarchive_la-archive_write_set_format_cpio.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_format_cpio.lo - -rm -f libarchive/libarchive_la-archive_write_set_format_cpio_newc.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_format_cpio_newc.lo - -rm -f libarchive/libarchive_la-archive_write_set_format_pax.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_format_pax.lo - -rm -f libarchive/libarchive_la-archive_write_set_format_shar.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_format_shar.lo - -rm -f libarchive/libarchive_la-archive_write_set_format_ustar.$(OBJEXT) - -rm -f libarchive/libarchive_la-archive_write_set_format_ustar.lo - -rm -f libarchive/libarchive_la-filter_fork.$(OBJEXT) - -rm -f libarchive/libarchive_la-filter_fork.lo + -rm -f libarchive/archive_check_magic.$(OBJEXT) + -rm -f libarchive/archive_check_magic.lo + -rm -f libarchive/archive_entry.$(OBJEXT) + -rm -f libarchive/archive_entry.lo + -rm -f libarchive/archive_entry_copy_stat.$(OBJEXT) + -rm -f libarchive/archive_entry_copy_stat.lo + -rm -f libarchive/archive_entry_link_resolver.$(OBJEXT) + -rm -f libarchive/archive_entry_link_resolver.lo + -rm -f libarchive/archive_entry_stat.$(OBJEXT) + -rm -f libarchive/archive_entry_stat.lo + -rm -f libarchive/archive_entry_strmode.$(OBJEXT) + -rm -f libarchive/archive_entry_strmode.lo + -rm -f libarchive/archive_read.$(OBJEXT) + -rm -f libarchive/archive_read.lo + -rm -f libarchive/archive_read_data_into_fd.$(OBJEXT) + -rm -f libarchive/archive_read_data_into_fd.lo + -rm -f libarchive/archive_read_extract.$(OBJEXT) + -rm -f libarchive/archive_read_extract.lo + -rm -f libarchive/archive_read_open_fd.$(OBJEXT) + -rm -f libarchive/archive_read_open_fd.lo + -rm -f libarchive/archive_read_open_file.$(OBJEXT) + -rm -f libarchive/archive_read_open_file.lo + -rm -f libarchive/archive_read_open_filename.$(OBJEXT) + -rm -f libarchive/archive_read_open_filename.lo + -rm -f libarchive/archive_read_open_memory.$(OBJEXT) + -rm -f libarchive/archive_read_open_memory.lo + -rm -f libarchive/archive_read_support_compression_all.$(OBJEXT) + -rm -f libarchive/archive_read_support_compression_all.lo + -rm -f libarchive/archive_read_support_compression_bzip2.$(OBJEXT) + -rm -f libarchive/archive_read_support_compression_bzip2.lo + -rm -f libarchive/archive_read_support_compression_compress.$(OBJEXT) + -rm -f libarchive/archive_read_support_compression_compress.lo + -rm -f libarchive/archive_read_support_compression_gzip.$(OBJEXT) + -rm -f libarchive/archive_read_support_compression_gzip.lo + -rm -f libarchive/archive_read_support_compression_none.$(OBJEXT) + -rm -f libarchive/archive_read_support_compression_none.lo + -rm -f libarchive/archive_read_support_compression_program.$(OBJEXT) + -rm -f libarchive/archive_read_support_compression_program.lo + -rm -f libarchive/archive_read_support_format_all.$(OBJEXT) + -rm -f libarchive/archive_read_support_format_all.lo + -rm -f libarchive/archive_read_support_format_ar.$(OBJEXT) + -rm -f libarchive/archive_read_support_format_ar.lo + -rm -f libarchive/archive_read_support_format_cpio.$(OBJEXT) + -rm -f libarchive/archive_read_support_format_cpio.lo + -rm -f libarchive/archive_read_support_format_empty.$(OBJEXT) + -rm -f libarchive/archive_read_support_format_empty.lo + -rm -f libarchive/archive_read_support_format_iso9660.$(OBJEXT) + -rm -f libarchive/archive_read_support_format_iso9660.lo + -rm -f libarchive/archive_read_support_format_mtree.$(OBJEXT) + -rm -f libarchive/archive_read_support_format_mtree.lo + -rm -f libarchive/archive_read_support_format_tar.$(OBJEXT) + -rm -f libarchive/archive_read_support_format_tar.lo + -rm -f libarchive/archive_read_support_format_zip.$(OBJEXT) + -rm -f libarchive/archive_read_support_format_zip.lo + -rm -f libarchive/archive_string.$(OBJEXT) + -rm -f libarchive/archive_string.lo + -rm -f libarchive/archive_string_sprintf.$(OBJEXT) + -rm -f libarchive/archive_string_sprintf.lo + -rm -f libarchive/archive_util.$(OBJEXT) + -rm -f libarchive/archive_util.lo + -rm -f libarchive/archive_virtual.$(OBJEXT) + -rm -f libarchive/archive_virtual.lo + -rm -f libarchive/archive_write.$(OBJEXT) + -rm -f libarchive/archive_write.lo + -rm -f libarchive/archive_write_disk.$(OBJEXT) + -rm -f libarchive/archive_write_disk.lo + -rm -f libarchive/archive_write_disk_set_standard_lookup.$(OBJEXT) + -rm -f libarchive/archive_write_disk_set_standard_lookup.lo + -rm -f libarchive/archive_write_open_fd.$(OBJEXT) + -rm -f libarchive/archive_write_open_fd.lo + -rm -f libarchive/archive_write_open_file.$(OBJEXT) + -rm -f libarchive/archive_write_open_file.lo + -rm -f libarchive/archive_write_open_filename.$(OBJEXT) + -rm -f libarchive/archive_write_open_filename.lo + -rm -f libarchive/archive_write_open_memory.$(OBJEXT) + -rm -f libarchive/archive_write_open_memory.lo + -rm -f libarchive/archive_write_set_compression_bzip2.$(OBJEXT) + -rm -f libarchive/archive_write_set_compression_bzip2.lo + -rm -f libarchive/archive_write_set_compression_compress.$(OBJEXT) + -rm -f libarchive/archive_write_set_compression_compress.lo + -rm -f libarchive/archive_write_set_compression_gzip.$(OBJEXT) + -rm -f libarchive/archive_write_set_compression_gzip.lo + -rm -f libarchive/archive_write_set_compression_none.$(OBJEXT) + -rm -f libarchive/archive_write_set_compression_none.lo + -rm -f libarchive/archive_write_set_compression_program.$(OBJEXT) + -rm -f libarchive/archive_write_set_compression_program.lo + -rm -f libarchive/archive_write_set_format.$(OBJEXT) + -rm -f libarchive/archive_write_set_format.lo + -rm -f libarchive/archive_write_set_format_ar.$(OBJEXT) + -rm -f libarchive/archive_write_set_format_ar.lo + -rm -f libarchive/archive_write_set_format_by_name.$(OBJEXT) + -rm -f libarchive/archive_write_set_format_by_name.lo + -rm -f libarchive/archive_write_set_format_cpio.$(OBJEXT) + -rm -f libarchive/archive_write_set_format_cpio.lo + -rm -f libarchive/archive_write_set_format_cpio_newc.$(OBJEXT) + -rm -f libarchive/archive_write_set_format_cpio_newc.lo + -rm -f libarchive/archive_write_set_format_pax.$(OBJEXT) + -rm -f libarchive/archive_write_set_format_pax.lo + -rm -f libarchive/archive_write_set_format_shar.$(OBJEXT) + -rm -f libarchive/archive_write_set_format_shar.lo + -rm -f libarchive/archive_write_set_format_ustar.$(OBJEXT) + -rm -f libarchive/archive_write_set_format_ustar.lo + -rm -f libarchive/filter_fork.$(OBJEXT) + -rm -f libarchive/filter_fork.lo -rm -f libarchive/libarchive_test-archive_check_magic.$(OBJEXT) -rm -f libarchive/libarchive_test-archive_entry.$(OBJEXT) -rm -f libarchive/libarchive_test-archive_entry_copy_stat.$(OBJEXT) @@ -1729,6 +1725,7 @@ mostlyclean-compile: -rm -f libarchive/libarchive_test-archive_write_open_filename.$(OBJEXT) -rm -f libarchive/libarchive_test-archive_write_open_memory.$(OBJEXT) -rm -f libarchive/libarchive_test-archive_write_set_compression_bzip2.$(OBJEXT) + -rm -f libarchive/libarchive_test-archive_write_set_compression_compress.$(OBJEXT) -rm -f libarchive/libarchive_test-archive_write_set_compression_gzip.$(OBJEXT) -rm -f libarchive/libarchive_test-archive_write_set_compression_none.$(OBJEXT) -rm -f libarchive/libarchive_test-archive_write_set_compression_program.$(OBJEXT) @@ -1774,6 +1771,7 @@ mostlyclean-compile: -rm -f libarchive/test/libarchive_test-test_read_format_mtree.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_read_format_pax_bz2.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_read_format_tar.$(OBJEXT) + -rm -f libarchive/test/libarchive_test-test_read_format_tar_empty_filename.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_read_format_tbz.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_read_format_tgz.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_read_format_tz.$(OBJEXT) @@ -1784,6 +1782,8 @@ mostlyclean-compile: -rm -f libarchive/test/libarchive_test-test_read_truncated.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_tar_filenames.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_tar_large.$(OBJEXT) + -rm -f libarchive/test/libarchive_test-test_ustar_filenames.$(OBJEXT) + -rm -f libarchive/test/libarchive_test-test_write_compress.$(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) @@ -1797,20 +1797,26 @@ mostlyclean-compile: -rm -f libarchive/test/libarchive_test-test_write_format_shar_empty.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_write_format_tar.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_write_format_tar_empty.$(OBJEXT) + -rm -f libarchive/test/libarchive_test-test_write_format_tar_ustar.$(OBJEXT) -rm -f libarchive/test/libarchive_test-test_write_open_memory.$(OBJEXT) -rm -f tar/bsdtar-bsdtar.$(OBJEXT) -rm -f tar/bsdtar-getdate.$(OBJEXT) -rm -f tar/bsdtar-matching.$(OBJEXT) -rm -f tar/bsdtar-read.$(OBJEXT) + -rm -f tar/bsdtar-siginfo.$(OBJEXT) + -rm -f tar/bsdtar-subst.$(OBJEXT) -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_0.$(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_option_T.$(OBJEXT) + -rm -f tar/test/bsdtar_test-test_patterns.$(OBJEXT) -rm -f tar/test/bsdtar_test-test_stdio.$(OBJEXT) -rm -f tar/test/bsdtar_test-test_version.$(OBJEXT) @@ -1826,6 +1832,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio_test-err.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_0.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@ @@ -1845,57 +1852,58 @@ distclean-compile: @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@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@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_entry_link_resolver.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_entry_stat.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_entry_strmode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_data_into_fd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_extract.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_open_fd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_open_file.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_open_filename.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_open_memory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_all.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_bzip2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_compress.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_gzip.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_none.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_program.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_all.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_ar.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_cpio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_empty.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_iso9660.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_mtree.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_tar.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_zip.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_string.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_string_sprintf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_util.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_virtual.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_disk.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_disk_set_standard_lookup.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_open_fd.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_open_file.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_open_filename.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_open_memory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_bzip2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_gzip.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_none.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_program.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_ar.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_by_name.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_cpio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_cpio_newc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_pax.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_shar.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_ustar.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_la-filter_fork.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_check_magic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_copy_stat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_link_resolver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_stat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_entry_strmode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_data_into_fd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_extract.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_open_fd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_open_file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_open_filename.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_open_memory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_all.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_bzip2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_compress.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_gzip.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_none.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_compression_program.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_all.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_ar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_cpio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_empty.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_iso9660.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_mtree.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_tar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_read_support_format_zip.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_string.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_string_sprintf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_virtual.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_disk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_disk_set_standard_lookup.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_open_fd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_open_file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_open_filename.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_open_memory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_compression_bzip2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_compression_compress.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_compression_gzip.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_compression_none.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_compression_program.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_ar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_by_name.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_cpio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_cpio_newc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_pax.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_shar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/archive_write_set_format_ustar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/filter_fork.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_check_magic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_entry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_stat.Po@am__quote@ @@ -1935,6 +1943,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_open_filename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_open_memory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_bzip2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_compress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_gzip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_none.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_program.Po@am__quote@ @@ -1980,6 +1989,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_pax_bz2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar_empty_filename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tbz.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tgz.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tz.Po@am__quote@ @@ -1990,6 +2000,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_read_truncated.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_tar_filenames.Po@am__quote@ @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_ustar_filenames.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress.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@ @@ -2003,20 +2015,26 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_shar_empty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_empty.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_ustar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_write_open_memory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-bsdtar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-getdate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-matching.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-read.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-siginfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-subst.Po@am__quote@ @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_0.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_option_T.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_patterns.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@ @@ -2044,363 +2062,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -libarchive/libarchive_la-archive_check_magic.lo: libarchive/archive_check_magic.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_check_magic.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_check_magic.Tpo -c -o libarchive/libarchive_la-archive_check_magic.lo `test -f 'libarchive/archive_check_magic.c' || echo '$(srcdir)/'`libarchive/archive_check_magic.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_check_magic.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_check_magic.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_check_magic.c' object='libarchive/libarchive_la-archive_check_magic.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_check_magic.lo `test -f 'libarchive/archive_check_magic.c' || echo '$(srcdir)/'`libarchive/archive_check_magic.c - -libarchive/libarchive_la-archive_entry.lo: libarchive/archive_entry.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_entry.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_entry.Tpo -c -o libarchive/libarchive_la-archive_entry.lo `test -f 'libarchive/archive_entry.c' || echo '$(srcdir)/'`libarchive/archive_entry.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_entry.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_entry.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_entry.c' object='libarchive/libarchive_la-archive_entry.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_entry.lo `test -f 'libarchive/archive_entry.c' || echo '$(srcdir)/'`libarchive/archive_entry.c - -libarchive/libarchive_la-archive_entry_copy_stat.lo: libarchive/archive_entry_copy_stat.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_entry_copy_stat.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_entry_copy_stat.Tpo -c -o libarchive/libarchive_la-archive_entry_copy_stat.lo `test -f 'libarchive/archive_entry_copy_stat.c' || echo '$(srcdir)/'`libarchive/archive_entry_copy_stat.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_entry_copy_stat.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_entry_copy_stat.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_entry_copy_stat.c' object='libarchive/libarchive_la-archive_entry_copy_stat.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_entry_copy_stat.lo `test -f 'libarchive/archive_entry_copy_stat.c' || echo '$(srcdir)/'`libarchive/archive_entry_copy_stat.c - -libarchive/libarchive_la-archive_entry_link_resolver.lo: libarchive/archive_entry_link_resolver.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_entry_link_resolver.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_entry_link_resolver.Tpo -c -o libarchive/libarchive_la-archive_entry_link_resolver.lo `test -f 'libarchive/archive_entry_link_resolver.c' || echo '$(srcdir)/'`libarchive/archive_entry_link_resolver.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_entry_link_resolver.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_entry_link_resolver.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_entry_link_resolver.c' object='libarchive/libarchive_la-archive_entry_link_resolver.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_entry_link_resolver.lo `test -f 'libarchive/archive_entry_link_resolver.c' || echo '$(srcdir)/'`libarchive/archive_entry_link_resolver.c - -libarchive/libarchive_la-archive_entry_stat.lo: libarchive/archive_entry_stat.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_entry_stat.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_entry_stat.Tpo -c -o libarchive/libarchive_la-archive_entry_stat.lo `test -f 'libarchive/archive_entry_stat.c' || echo '$(srcdir)/'`libarchive/archive_entry_stat.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_entry_stat.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_entry_stat.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_entry_stat.c' object='libarchive/libarchive_la-archive_entry_stat.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_entry_stat.lo `test -f 'libarchive/archive_entry_stat.c' || echo '$(srcdir)/'`libarchive/archive_entry_stat.c - -libarchive/libarchive_la-archive_entry_strmode.lo: libarchive/archive_entry_strmode.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_entry_strmode.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_entry_strmode.Tpo -c -o libarchive/libarchive_la-archive_entry_strmode.lo `test -f 'libarchive/archive_entry_strmode.c' || echo '$(srcdir)/'`libarchive/archive_entry_strmode.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_entry_strmode.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_entry_strmode.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_entry_strmode.c' object='libarchive/libarchive_la-archive_entry_strmode.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_entry_strmode.lo `test -f 'libarchive/archive_entry_strmode.c' || echo '$(srcdir)/'`libarchive/archive_entry_strmode.c - -libarchive/libarchive_la-archive_read.lo: libarchive/archive_read.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read.Tpo -c -o libarchive/libarchive_la-archive_read.lo `test -f 'libarchive/archive_read.c' || echo '$(srcdir)/'`libarchive/archive_read.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read.c' object='libarchive/libarchive_la-archive_read.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read.lo `test -f 'libarchive/archive_read.c' || echo '$(srcdir)/'`libarchive/archive_read.c - -libarchive/libarchive_la-archive_read_data_into_fd.lo: libarchive/archive_read_data_into_fd.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_data_into_fd.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_data_into_fd.Tpo -c -o libarchive/libarchive_la-archive_read_data_into_fd.lo `test -f 'libarchive/archive_read_data_into_fd.c' || echo '$(srcdir)/'`libarchive/archive_read_data_into_fd.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_data_into_fd.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_data_into_fd.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_data_into_fd.c' object='libarchive/libarchive_la-archive_read_data_into_fd.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_data_into_fd.lo `test -f 'libarchive/archive_read_data_into_fd.c' || echo '$(srcdir)/'`libarchive/archive_read_data_into_fd.c - -libarchive/libarchive_la-archive_read_extract.lo: libarchive/archive_read_extract.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_extract.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_extract.Tpo -c -o libarchive/libarchive_la-archive_read_extract.lo `test -f 'libarchive/archive_read_extract.c' || echo '$(srcdir)/'`libarchive/archive_read_extract.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_extract.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_extract.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_extract.c' object='libarchive/libarchive_la-archive_read_extract.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_extract.lo `test -f 'libarchive/archive_read_extract.c' || echo '$(srcdir)/'`libarchive/archive_read_extract.c - -libarchive/libarchive_la-archive_read_open_fd.lo: libarchive/archive_read_open_fd.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_open_fd.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_open_fd.Tpo -c -o libarchive/libarchive_la-archive_read_open_fd.lo `test -f 'libarchive/archive_read_open_fd.c' || echo '$(srcdir)/'`libarchive/archive_read_open_fd.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_open_fd.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_open_fd.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_open_fd.c' object='libarchive/libarchive_la-archive_read_open_fd.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_open_fd.lo `test -f 'libarchive/archive_read_open_fd.c' || echo '$(srcdir)/'`libarchive/archive_read_open_fd.c - -libarchive/libarchive_la-archive_read_open_file.lo: libarchive/archive_read_open_file.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_open_file.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_open_file.Tpo -c -o libarchive/libarchive_la-archive_read_open_file.lo `test -f 'libarchive/archive_read_open_file.c' || echo '$(srcdir)/'`libarchive/archive_read_open_file.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_open_file.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_open_file.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_open_file.c' object='libarchive/libarchive_la-archive_read_open_file.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_open_file.lo `test -f 'libarchive/archive_read_open_file.c' || echo '$(srcdir)/'`libarchive/archive_read_open_file.c - -libarchive/libarchive_la-archive_read_open_filename.lo: libarchive/archive_read_open_filename.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_open_filename.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_open_filename.Tpo -c -o libarchive/libarchive_la-archive_read_open_filename.lo `test -f 'libarchive/archive_read_open_filename.c' || echo '$(srcdir)/'`libarchive/archive_read_open_filename.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_open_filename.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_open_filename.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_open_filename.c' object='libarchive/libarchive_la-archive_read_open_filename.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_open_filename.lo `test -f 'libarchive/archive_read_open_filename.c' || echo '$(srcdir)/'`libarchive/archive_read_open_filename.c - -libarchive/libarchive_la-archive_read_open_memory.lo: libarchive/archive_read_open_memory.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_open_memory.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_open_memory.Tpo -c -o libarchive/libarchive_la-archive_read_open_memory.lo `test -f 'libarchive/archive_read_open_memory.c' || echo '$(srcdir)/'`libarchive/archive_read_open_memory.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_open_memory.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_open_memory.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_open_memory.c' object='libarchive/libarchive_la-archive_read_open_memory.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_open_memory.lo `test -f 'libarchive/archive_read_open_memory.c' || echo '$(srcdir)/'`libarchive/archive_read_open_memory.c - -libarchive/libarchive_la-archive_read_support_compression_all.lo: libarchive/archive_read_support_compression_all.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_compression_all.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_all.Tpo -c -o libarchive/libarchive_la-archive_read_support_compression_all.lo `test -f 'libarchive/archive_read_support_compression_all.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_all.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_all.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_all.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_all.c' object='libarchive/libarchive_la-archive_read_support_compression_all.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_compression_all.lo `test -f 'libarchive/archive_read_support_compression_all.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_all.c - -libarchive/libarchive_la-archive_read_support_compression_bzip2.lo: libarchive/archive_read_support_compression_bzip2.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_compression_bzip2.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_bzip2.Tpo -c -o libarchive/libarchive_la-archive_read_support_compression_bzip2.lo `test -f 'libarchive/archive_read_support_compression_bzip2.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_bzip2.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_bzip2.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_bzip2.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_bzip2.c' object='libarchive/libarchive_la-archive_read_support_compression_bzip2.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_compression_bzip2.lo `test -f 'libarchive/archive_read_support_compression_bzip2.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_bzip2.c - -libarchive/libarchive_la-archive_read_support_compression_compress.lo: libarchive/archive_read_support_compression_compress.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_compression_compress.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_compress.Tpo -c -o libarchive/libarchive_la-archive_read_support_compression_compress.lo `test -f 'libarchive/archive_read_support_compression_compress.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_compress.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_compress.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_compress.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_compress.c' object='libarchive/libarchive_la-archive_read_support_compression_compress.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_compression_compress.lo `test -f 'libarchive/archive_read_support_compression_compress.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_compress.c - -libarchive/libarchive_la-archive_read_support_compression_gzip.lo: libarchive/archive_read_support_compression_gzip.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_compression_gzip.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_gzip.Tpo -c -o libarchive/libarchive_la-archive_read_support_compression_gzip.lo `test -f 'libarchive/archive_read_support_compression_gzip.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_gzip.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_gzip.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_gzip.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_gzip.c' object='libarchive/libarchive_la-archive_read_support_compression_gzip.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_compression_gzip.lo `test -f 'libarchive/archive_read_support_compression_gzip.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_gzip.c - -libarchive/libarchive_la-archive_read_support_compression_none.lo: libarchive/archive_read_support_compression_none.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_compression_none.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_none.Tpo -c -o libarchive/libarchive_la-archive_read_support_compression_none.lo `test -f 'libarchive/archive_read_support_compression_none.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_none.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_none.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_none.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_none.c' object='libarchive/libarchive_la-archive_read_support_compression_none.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_compression_none.lo `test -f 'libarchive/archive_read_support_compression_none.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_none.c - -libarchive/libarchive_la-archive_read_support_compression_program.lo: libarchive/archive_read_support_compression_program.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_compression_program.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_program.Tpo -c -o libarchive/libarchive_la-archive_read_support_compression_program.lo `test -f 'libarchive/archive_read_support_compression_program.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_program.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_program.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_compression_program.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_compression_program.c' object='libarchive/libarchive_la-archive_read_support_compression_program.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_compression_program.lo `test -f 'libarchive/archive_read_support_compression_program.c' || echo '$(srcdir)/'`libarchive/archive_read_support_compression_program.c - -libarchive/libarchive_la-archive_read_support_format_all.lo: libarchive/archive_read_support_format_all.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_format_all.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_all.Tpo -c -o libarchive/libarchive_la-archive_read_support_format_all.lo `test -f 'libarchive/archive_read_support_format_all.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_all.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_all.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_all.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_all.c' object='libarchive/libarchive_la-archive_read_support_format_all.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_format_all.lo `test -f 'libarchive/archive_read_support_format_all.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_all.c - -libarchive/libarchive_la-archive_read_support_format_ar.lo: libarchive/archive_read_support_format_ar.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_format_ar.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_ar.Tpo -c -o libarchive/libarchive_la-archive_read_support_format_ar.lo `test -f 'libarchive/archive_read_support_format_ar.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_ar.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_ar.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_ar.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_ar.c' object='libarchive/libarchive_la-archive_read_support_format_ar.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_format_ar.lo `test -f 'libarchive/archive_read_support_format_ar.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_ar.c - -libarchive/libarchive_la-archive_read_support_format_cpio.lo: libarchive/archive_read_support_format_cpio.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_format_cpio.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_cpio.Tpo -c -o libarchive/libarchive_la-archive_read_support_format_cpio.lo `test -f 'libarchive/archive_read_support_format_cpio.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_cpio.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_cpio.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_cpio.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_cpio.c' object='libarchive/libarchive_la-archive_read_support_format_cpio.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_format_cpio.lo `test -f 'libarchive/archive_read_support_format_cpio.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_cpio.c - -libarchive/libarchive_la-archive_read_support_format_empty.lo: libarchive/archive_read_support_format_empty.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_format_empty.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_empty.Tpo -c -o libarchive/libarchive_la-archive_read_support_format_empty.lo `test -f 'libarchive/archive_read_support_format_empty.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_empty.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_empty.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_empty.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_empty.c' object='libarchive/libarchive_la-archive_read_support_format_empty.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_format_empty.lo `test -f 'libarchive/archive_read_support_format_empty.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_empty.c - -libarchive/libarchive_la-archive_read_support_format_iso9660.lo: libarchive/archive_read_support_format_iso9660.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_format_iso9660.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_iso9660.Tpo -c -o libarchive/libarchive_la-archive_read_support_format_iso9660.lo `test -f 'libarchive/archive_read_support_format_iso9660.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_iso9660.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_iso9660.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_iso9660.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_iso9660.c' object='libarchive/libarchive_la-archive_read_support_format_iso9660.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_format_iso9660.lo `test -f 'libarchive/archive_read_support_format_iso9660.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_iso9660.c - -libarchive/libarchive_la-archive_read_support_format_mtree.lo: libarchive/archive_read_support_format_mtree.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_format_mtree.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_mtree.Tpo -c -o libarchive/libarchive_la-archive_read_support_format_mtree.lo `test -f 'libarchive/archive_read_support_format_mtree.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_mtree.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_mtree.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_mtree.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_mtree.c' object='libarchive/libarchive_la-archive_read_support_format_mtree.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_format_mtree.lo `test -f 'libarchive/archive_read_support_format_mtree.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_mtree.c - -libarchive/libarchive_la-archive_read_support_format_tar.lo: libarchive/archive_read_support_format_tar.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_format_tar.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_tar.Tpo -c -o libarchive/libarchive_la-archive_read_support_format_tar.lo `test -f 'libarchive/archive_read_support_format_tar.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_tar.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_tar.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_tar.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_tar.c' object='libarchive/libarchive_la-archive_read_support_format_tar.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_format_tar.lo `test -f 'libarchive/archive_read_support_format_tar.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_tar.c - -libarchive/libarchive_la-archive_read_support_format_zip.lo: libarchive/archive_read_support_format_zip.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_read_support_format_zip.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_zip.Tpo -c -o libarchive/libarchive_la-archive_read_support_format_zip.lo `test -f 'libarchive/archive_read_support_format_zip.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_zip.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_zip.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_read_support_format_zip.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_read_support_format_zip.c' object='libarchive/libarchive_la-archive_read_support_format_zip.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_read_support_format_zip.lo `test -f 'libarchive/archive_read_support_format_zip.c' || echo '$(srcdir)/'`libarchive/archive_read_support_format_zip.c - -libarchive/libarchive_la-archive_string.lo: libarchive/archive_string.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_string.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_string.Tpo -c -o libarchive/libarchive_la-archive_string.lo `test -f 'libarchive/archive_string.c' || echo '$(srcdir)/'`libarchive/archive_string.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_string.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_string.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_string.c' object='libarchive/libarchive_la-archive_string.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_string.lo `test -f 'libarchive/archive_string.c' || echo '$(srcdir)/'`libarchive/archive_string.c - -libarchive/libarchive_la-archive_string_sprintf.lo: libarchive/archive_string_sprintf.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_string_sprintf.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_string_sprintf.Tpo -c -o libarchive/libarchive_la-archive_string_sprintf.lo `test -f 'libarchive/archive_string_sprintf.c' || echo '$(srcdir)/'`libarchive/archive_string_sprintf.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_string_sprintf.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_string_sprintf.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_string_sprintf.c' object='libarchive/libarchive_la-archive_string_sprintf.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_string_sprintf.lo `test -f 'libarchive/archive_string_sprintf.c' || echo '$(srcdir)/'`libarchive/archive_string_sprintf.c - -libarchive/libarchive_la-archive_util.lo: libarchive/archive_util.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_util.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_util.Tpo -c -o libarchive/libarchive_la-archive_util.lo `test -f 'libarchive/archive_util.c' || echo '$(srcdir)/'`libarchive/archive_util.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_util.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_util.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_util.c' object='libarchive/libarchive_la-archive_util.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_util.lo `test -f 'libarchive/archive_util.c' || echo '$(srcdir)/'`libarchive/archive_util.c - -libarchive/libarchive_la-archive_virtual.lo: libarchive/archive_virtual.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_virtual.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_virtual.Tpo -c -o libarchive/libarchive_la-archive_virtual.lo `test -f 'libarchive/archive_virtual.c' || echo '$(srcdir)/'`libarchive/archive_virtual.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_virtual.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_virtual.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_virtual.c' object='libarchive/libarchive_la-archive_virtual.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_virtual.lo `test -f 'libarchive/archive_virtual.c' || echo '$(srcdir)/'`libarchive/archive_virtual.c - -libarchive/libarchive_la-archive_write.lo: libarchive/archive_write.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write.Tpo -c -o libarchive/libarchive_la-archive_write.lo `test -f 'libarchive/archive_write.c' || echo '$(srcdir)/'`libarchive/archive_write.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write.c' object='libarchive/libarchive_la-archive_write.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write.lo `test -f 'libarchive/archive_write.c' || echo '$(srcdir)/'`libarchive/archive_write.c - -libarchive/libarchive_la-archive_write_disk.lo: libarchive/archive_write_disk.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_disk.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_disk.Tpo -c -o libarchive/libarchive_la-archive_write_disk.lo `test -f 'libarchive/archive_write_disk.c' || echo '$(srcdir)/'`libarchive/archive_write_disk.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_disk.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_disk.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_disk.c' object='libarchive/libarchive_la-archive_write_disk.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_disk.lo `test -f 'libarchive/archive_write_disk.c' || echo '$(srcdir)/'`libarchive/archive_write_disk.c - -libarchive/libarchive_la-archive_write_disk_set_standard_lookup.lo: libarchive/archive_write_disk_set_standard_lookup.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_disk_set_standard_lookup.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_disk_set_standard_lookup.Tpo -c -o libarchive/libarchive_la-archive_write_disk_set_standard_lookup.lo `test -f 'libarchive/archive_write_disk_set_standard_lookup.c' || echo '$(srcdir)/'`libarchive/archive_write_disk_set_standard_lookup.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_disk_set_standard_lookup.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_disk_set_standard_lookup.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_disk_set_standard_lookup.c' object='libarchive/libarchive_la-archive_write_disk_set_standard_lookup.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_disk_set_standard_lookup.lo `test -f 'libarchive/archive_write_disk_set_standard_lookup.c' || echo '$(srcdir)/'`libarchive/archive_write_disk_set_standard_lookup.c - -libarchive/libarchive_la-archive_write_open_fd.lo: libarchive/archive_write_open_fd.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_open_fd.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_open_fd.Tpo -c -o libarchive/libarchive_la-archive_write_open_fd.lo `test -f 'libarchive/archive_write_open_fd.c' || echo '$(srcdir)/'`libarchive/archive_write_open_fd.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_open_fd.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_open_fd.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_open_fd.c' object='libarchive/libarchive_la-archive_write_open_fd.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_open_fd.lo `test -f 'libarchive/archive_write_open_fd.c' || echo '$(srcdir)/'`libarchive/archive_write_open_fd.c - -libarchive/libarchive_la-archive_write_open_file.lo: libarchive/archive_write_open_file.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_open_file.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_open_file.Tpo -c -o libarchive/libarchive_la-archive_write_open_file.lo `test -f 'libarchive/archive_write_open_file.c' || echo '$(srcdir)/'`libarchive/archive_write_open_file.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_open_file.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_open_file.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_open_file.c' object='libarchive/libarchive_la-archive_write_open_file.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_open_file.lo `test -f 'libarchive/archive_write_open_file.c' || echo '$(srcdir)/'`libarchive/archive_write_open_file.c - -libarchive/libarchive_la-archive_write_open_filename.lo: libarchive/archive_write_open_filename.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_open_filename.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_open_filename.Tpo -c -o libarchive/libarchive_la-archive_write_open_filename.lo `test -f 'libarchive/archive_write_open_filename.c' || echo '$(srcdir)/'`libarchive/archive_write_open_filename.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_open_filename.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_open_filename.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_open_filename.c' object='libarchive/libarchive_la-archive_write_open_filename.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_open_filename.lo `test -f 'libarchive/archive_write_open_filename.c' || echo '$(srcdir)/'`libarchive/archive_write_open_filename.c - -libarchive/libarchive_la-archive_write_open_memory.lo: libarchive/archive_write_open_memory.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_open_memory.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_open_memory.Tpo -c -o libarchive/libarchive_la-archive_write_open_memory.lo `test -f 'libarchive/archive_write_open_memory.c' || echo '$(srcdir)/'`libarchive/archive_write_open_memory.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_open_memory.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_open_memory.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_open_memory.c' object='libarchive/libarchive_la-archive_write_open_memory.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_open_memory.lo `test -f 'libarchive/archive_write_open_memory.c' || echo '$(srcdir)/'`libarchive/archive_write_open_memory.c - -libarchive/libarchive_la-archive_write_set_compression_bzip2.lo: libarchive/archive_write_set_compression_bzip2.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_compression_bzip2.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_bzip2.Tpo -c -o libarchive/libarchive_la-archive_write_set_compression_bzip2.lo `test -f 'libarchive/archive_write_set_compression_bzip2.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_bzip2.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_bzip2.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_bzip2.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_compression_bzip2.c' object='libarchive/libarchive_la-archive_write_set_compression_bzip2.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_compression_bzip2.lo `test -f 'libarchive/archive_write_set_compression_bzip2.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_bzip2.c - -libarchive/libarchive_la-archive_write_set_compression_gzip.lo: libarchive/archive_write_set_compression_gzip.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_compression_gzip.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_gzip.Tpo -c -o libarchive/libarchive_la-archive_write_set_compression_gzip.lo `test -f 'libarchive/archive_write_set_compression_gzip.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_gzip.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_gzip.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_gzip.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_compression_gzip.c' object='libarchive/libarchive_la-archive_write_set_compression_gzip.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_compression_gzip.lo `test -f 'libarchive/archive_write_set_compression_gzip.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_gzip.c - -libarchive/libarchive_la-archive_write_set_compression_none.lo: libarchive/archive_write_set_compression_none.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_compression_none.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_none.Tpo -c -o libarchive/libarchive_la-archive_write_set_compression_none.lo `test -f 'libarchive/archive_write_set_compression_none.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_none.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_none.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_none.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_compression_none.c' object='libarchive/libarchive_la-archive_write_set_compression_none.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_compression_none.lo `test -f 'libarchive/archive_write_set_compression_none.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_none.c - -libarchive/libarchive_la-archive_write_set_compression_program.lo: libarchive/archive_write_set_compression_program.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_compression_program.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_program.Tpo -c -o libarchive/libarchive_la-archive_write_set_compression_program.lo `test -f 'libarchive/archive_write_set_compression_program.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_program.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_program.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_compression_program.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_compression_program.c' object='libarchive/libarchive_la-archive_write_set_compression_program.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_compression_program.lo `test -f 'libarchive/archive_write_set_compression_program.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_program.c - -libarchive/libarchive_la-archive_write_set_format.lo: libarchive/archive_write_set_format.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_format.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format.Tpo -c -o libarchive/libarchive_la-archive_write_set_format.lo `test -f 'libarchive/archive_write_set_format.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format.c' object='libarchive/libarchive_la-archive_write_set_format.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_format.lo `test -f 'libarchive/archive_write_set_format.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format.c - -libarchive/libarchive_la-archive_write_set_format_ar.lo: libarchive/archive_write_set_format_ar.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_format_ar.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_ar.Tpo -c -o libarchive/libarchive_la-archive_write_set_format_ar.lo `test -f 'libarchive/archive_write_set_format_ar.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_ar.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_ar.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_ar.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_ar.c' object='libarchive/libarchive_la-archive_write_set_format_ar.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_format_ar.lo `test -f 'libarchive/archive_write_set_format_ar.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_ar.c - -libarchive/libarchive_la-archive_write_set_format_by_name.lo: libarchive/archive_write_set_format_by_name.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_format_by_name.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_by_name.Tpo -c -o libarchive/libarchive_la-archive_write_set_format_by_name.lo `test -f 'libarchive/archive_write_set_format_by_name.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_by_name.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_by_name.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_by_name.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_by_name.c' object='libarchive/libarchive_la-archive_write_set_format_by_name.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_format_by_name.lo `test -f 'libarchive/archive_write_set_format_by_name.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_by_name.c - -libarchive/libarchive_la-archive_write_set_format_cpio.lo: libarchive/archive_write_set_format_cpio.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_format_cpio.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_cpio.Tpo -c -o libarchive/libarchive_la-archive_write_set_format_cpio.lo `test -f 'libarchive/archive_write_set_format_cpio.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_cpio.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_cpio.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_cpio.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_cpio.c' object='libarchive/libarchive_la-archive_write_set_format_cpio.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_format_cpio.lo `test -f 'libarchive/archive_write_set_format_cpio.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_cpio.c - -libarchive/libarchive_la-archive_write_set_format_cpio_newc.lo: libarchive/archive_write_set_format_cpio_newc.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_format_cpio_newc.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_cpio_newc.Tpo -c -o libarchive/libarchive_la-archive_write_set_format_cpio_newc.lo `test -f 'libarchive/archive_write_set_format_cpio_newc.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_cpio_newc.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_cpio_newc.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_cpio_newc.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_cpio_newc.c' object='libarchive/libarchive_la-archive_write_set_format_cpio_newc.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_format_cpio_newc.lo `test -f 'libarchive/archive_write_set_format_cpio_newc.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_cpio_newc.c - -libarchive/libarchive_la-archive_write_set_format_pax.lo: libarchive/archive_write_set_format_pax.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_format_pax.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_pax.Tpo -c -o libarchive/libarchive_la-archive_write_set_format_pax.lo `test -f 'libarchive/archive_write_set_format_pax.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_pax.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_pax.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_pax.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_pax.c' object='libarchive/libarchive_la-archive_write_set_format_pax.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_format_pax.lo `test -f 'libarchive/archive_write_set_format_pax.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_pax.c - -libarchive/libarchive_la-archive_write_set_format_shar.lo: libarchive/archive_write_set_format_shar.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_format_shar.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_shar.Tpo -c -o libarchive/libarchive_la-archive_write_set_format_shar.lo `test -f 'libarchive/archive_write_set_format_shar.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_shar.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_shar.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_shar.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_shar.c' object='libarchive/libarchive_la-archive_write_set_format_shar.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_format_shar.lo `test -f 'libarchive/archive_write_set_format_shar.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_shar.c - -libarchive/libarchive_la-archive_write_set_format_ustar.lo: libarchive/archive_write_set_format_ustar.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-archive_write_set_format_ustar.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_ustar.Tpo -c -o libarchive/libarchive_la-archive_write_set_format_ustar.lo `test -f 'libarchive/archive_write_set_format_ustar.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_ustar.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_ustar.Tpo libarchive/$(DEPDIR)/libarchive_la-archive_write_set_format_ustar.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_format_ustar.c' object='libarchive/libarchive_la-archive_write_set_format_ustar.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-archive_write_set_format_ustar.lo `test -f 'libarchive/archive_write_set_format_ustar.c' || echo '$(srcdir)/'`libarchive/archive_write_set_format_ustar.c - -libarchive/libarchive_la-filter_fork.lo: libarchive/filter_fork.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_la-filter_fork.lo -MD -MP -MF libarchive/$(DEPDIR)/libarchive_la-filter_fork.Tpo -c -o libarchive/libarchive_la-filter_fork.lo `test -f 'libarchive/filter_fork.c' || echo '$(srcdir)/'`libarchive/filter_fork.c -@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_la-filter_fork.Tpo libarchive/$(DEPDIR)/libarchive_la-filter_fork.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/filter_fork.c' object='libarchive/libarchive_la-filter_fork.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_la-filter_fork.lo `test -f 'libarchive/filter_fork.c' || echo '$(srcdir)/'`libarchive/filter_fork.c - cpio/bsdcpio-cmdline.o: cpio/cmdline.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio-cmdline.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio-cmdline.Tpo -c -o cpio/bsdcpio-cmdline.o `test -f 'cpio/cmdline.c' || echo '$(srcdir)/'`cpio/cmdline.c @am__fastdepCC_TRUE@ mv -f cpio/$(DEPDIR)/bsdcpio-cmdline.Tpo cpio/$(DEPDIR)/bsdcpio-cmdline.Po @@ -2527,6 +2188,20 @@ cpio/test/bsdcpio_test-main.obj: cpio/test/main.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-main.obj `if test -f 'cpio/test/main.c'; then $(CYGPATH_W) 'cpio/test/main.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/main.c'; fi` +cpio/test/bsdcpio_test-test_0.o: cpio/test/test_0.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_0.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Tpo -c -o cpio/test/bsdcpio_test-test_0.o `test -f 'cpio/test/test_0.c' || echo '$(srcdir)/'`cpio/test/test_0.c +@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_0.c' object='cpio/test/bsdcpio_test-test_0.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_0.o `test -f 'cpio/test/test_0.c' || echo '$(srcdir)/'`cpio/test/test_0.c + +cpio/test/bsdcpio_test-test_0.obj: cpio/test/test_0.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_0.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Tpo -c -o cpio/test/bsdcpio_test-test_0.obj `if test -f 'cpio/test/test_0.c'; then $(CYGPATH_W) 'cpio/test/test_0.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_0.c'; fi` +@am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cpio/test/test_0.c' object='cpio/test/bsdcpio_test-test_0.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_0.obj `if test -f 'cpio/test/test_0.c'; then $(CYGPATH_W) 'cpio/test/test_0.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/test_0.c'; fi` + cpio/test/bsdcpio_test-test_basic.o: cpio/test/test_basic.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_basic.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_basic.Tpo -c -o cpio/test/bsdcpio_test-test_basic.o `test -f 'cpio/test/test_basic.c' || echo '$(srcdir)/'`cpio/test/test_basic.c @am__fastdepCC_TRUE@ mv -f cpio/test/$(DEPDIR)/bsdcpio_test-test_basic.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_basic.Po @@ -2849,6 +2524,34 @@ tar/bsdtar-read.obj: tar/read.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-read.obj `if test -f 'tar/read.c'; then $(CYGPATH_W) 'tar/read.c'; else $(CYGPATH_W) '$(srcdir)/tar/read.c'; fi` +tar/bsdtar-siginfo.o: tar/siginfo.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-siginfo.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-siginfo.Tpo -c -o tar/bsdtar-siginfo.o `test -f 'tar/siginfo.c' || echo '$(srcdir)/'`tar/siginfo.c +@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-siginfo.Tpo tar/$(DEPDIR)/bsdtar-siginfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/siginfo.c' object='tar/bsdtar-siginfo.o' libtool=no @AMDEPBACKSLASH@ +@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-siginfo.o `test -f 'tar/siginfo.c' || echo '$(srcdir)/'`tar/siginfo.c + +tar/bsdtar-siginfo.obj: tar/siginfo.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-siginfo.obj -MD -MP -MF tar/$(DEPDIR)/bsdtar-siginfo.Tpo -c -o tar/bsdtar-siginfo.obj `if test -f 'tar/siginfo.c'; then $(CYGPATH_W) 'tar/siginfo.c'; else $(CYGPATH_W) '$(srcdir)/tar/siginfo.c'; fi` +@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-siginfo.Tpo tar/$(DEPDIR)/bsdtar-siginfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/siginfo.c' object='tar/bsdtar-siginfo.obj' libtool=no @AMDEPBACKSLASH@ +@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-siginfo.obj `if test -f 'tar/siginfo.c'; then $(CYGPATH_W) 'tar/siginfo.c'; else $(CYGPATH_W) '$(srcdir)/tar/siginfo.c'; fi` + +tar/bsdtar-subst.o: tar/subst.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-subst.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-subst.Tpo -c -o tar/bsdtar-subst.o `test -f 'tar/subst.c' || echo '$(srcdir)/'`tar/subst.c +@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-subst.Tpo tar/$(DEPDIR)/bsdtar-subst.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/subst.c' object='tar/bsdtar-subst.o' libtool=no @AMDEPBACKSLASH@ +@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-subst.o `test -f 'tar/subst.c' || echo '$(srcdir)/'`tar/subst.c + +tar/bsdtar-subst.obj: tar/subst.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-subst.obj -MD -MP -MF tar/$(DEPDIR)/bsdtar-subst.Tpo -c -o tar/bsdtar-subst.obj `if test -f 'tar/subst.c'; then $(CYGPATH_W) 'tar/subst.c'; else $(CYGPATH_W) '$(srcdir)/tar/subst.c'; fi` +@am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-subst.Tpo tar/$(DEPDIR)/bsdtar-subst.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/subst.c' object='tar/bsdtar-subst.obj' libtool=no @AMDEPBACKSLASH@ +@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-subst.obj `if test -f 'tar/subst.c'; then $(CYGPATH_W) 'tar/subst.c'; else $(CYGPATH_W) '$(srcdir)/tar/subst.c'; fi` + tar/bsdtar-tree.o: tar/tree.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/bsdtar-tree.o -MD -MP -MF tar/$(DEPDIR)/bsdtar-tree.Tpo -c -o tar/bsdtar-tree.o `test -f 'tar/tree.c' || echo '$(srcdir)/'`tar/tree.c @am__fastdepCC_TRUE@ mv -f tar/$(DEPDIR)/bsdtar-tree.Tpo tar/$(DEPDIR)/bsdtar-tree.Po @@ -2919,6 +2622,20 @@ tar/test/bsdtar_test-main.obj: tar/test/main.c @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_0.o: tar/test/test_0.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_0.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_0.Tpo -c -o tar/test/bsdtar_test-test_0.o `test -f 'tar/test/test_0.c' || echo '$(srcdir)/'`tar/test/test_0.c +@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_0.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_0.c' object='tar/test/bsdtar_test-test_0.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_0.o `test -f 'tar/test/test_0.c' || echo '$(srcdir)/'`tar/test/test_0.c + +tar/test/bsdtar_test-test_0.obj: tar/test/test_0.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_0.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_0.Tpo -c -o tar/test/bsdtar_test-test_0.obj `if test -f 'tar/test/test_0.c'; then $(CYGPATH_W) 'tar/test/test_0.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_0.c'; fi` +@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_0.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_0.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_0.c' object='tar/test/bsdtar_test-test_0.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_0.obj `if test -f 'tar/test/test_0.c'; then $(CYGPATH_W) 'tar/test/test_0.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_0.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 @@ -2975,6 +2692,34 @@ tar/test/bsdtar_test-test_help.obj: tar/test/test_help.c @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_option_T.o: tar/test/test_option_T.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_T.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Tpo -c -o tar/test/bsdtar_test-test_option_T.o `test -f 'tar/test/test_option_T.c' || echo '$(srcdir)/'`tar/test/test_option_T.c +@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_T.c' object='tar/test/bsdtar_test-test_option_T.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_option_T.o `test -f 'tar/test/test_option_T.c' || echo '$(srcdir)/'`tar/test/test_option_T.c + +tar/test/bsdtar_test-test_option_T.obj: tar/test/test_option_T.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_T.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Tpo -c -o tar/test/bsdtar_test-test_option_T.obj `if test -f 'tar/test/test_option_T.c'; then $(CYGPATH_W) 'tar/test/test_option_T.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_T.c'; fi` +@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_T.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_option_T.c' object='tar/test/bsdtar_test-test_option_T.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_option_T.obj `if test -f 'tar/test/test_option_T.c'; then $(CYGPATH_W) 'tar/test/test_option_T.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_T.c'; fi` + +tar/test/bsdtar_test-test_patterns.o: tar/test/test_patterns.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_patterns.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_patterns.Tpo -c -o tar/test/bsdtar_test-test_patterns.o `test -f 'tar/test/test_patterns.c' || echo '$(srcdir)/'`tar/test/test_patterns.c +@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_patterns.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_patterns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_patterns.c' object='tar/test/bsdtar_test-test_patterns.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_patterns.o `test -f 'tar/test/test_patterns.c' || echo '$(srcdir)/'`tar/test/test_patterns.c + +tar/test/bsdtar_test-test_patterns.obj: tar/test/test_patterns.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_patterns.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_patterns.Tpo -c -o tar/test/bsdtar_test-test_patterns.obj `if test -f 'tar/test/test_patterns.c'; then $(CYGPATH_W) 'tar/test/test_patterns.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_patterns.c'; fi` +@am__fastdepCC_TRUE@ mv -f tar/test/$(DEPDIR)/bsdtar_test-test_patterns.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_patterns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tar/test/test_patterns.c' object='tar/test/bsdtar_test-test_patterns.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_patterns.obj `if test -f 'tar/test/test_patterns.c'; then $(CYGPATH_W) 'tar/test/test_patterns.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_patterns.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 @@ -3549,6 +3294,20 @@ libarchive/libarchive_test-archive_write_set_compression_bzip2.obj: libarchive/a @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/libarchive_test-archive_write_set_compression_bzip2.obj `if test -f 'libarchive/archive_write_set_compression_bzip2.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_compression_bzip2.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_compression_bzip2.c'; fi` +libarchive/libarchive_test-archive_write_set_compression_compress.o: libarchive/archive_write_set_compression_compress.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_compression_compress.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_compress.Tpo -c -o libarchive/libarchive_test-archive_write_set_compression_compress.o `test -f 'libarchive/archive_write_set_compression_compress.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_compress.c +@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_compress.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_compress.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_compression_compress.c' object='libarchive/libarchive_test-archive_write_set_compression_compress.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/libarchive_test-archive_write_set_compression_compress.o `test -f 'libarchive/archive_write_set_compression_compress.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_compress.c + +libarchive/libarchive_test-archive_write_set_compression_compress.obj: libarchive/archive_write_set_compression_compress.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_compression_compress.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_compress.Tpo -c -o libarchive/libarchive_test-archive_write_set_compression_compress.obj `if test -f 'libarchive/archive_write_set_compression_compress.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_compression_compress.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_compression_compress.c'; fi` +@am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_compress.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_compress.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/archive_write_set_compression_compress.c' object='libarchive/libarchive_test-archive_write_set_compression_compress.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/libarchive_test-archive_write_set_compression_compress.obj `if test -f 'libarchive/archive_write_set_compression_compress.c'; then $(CYGPATH_W) 'libarchive/archive_write_set_compression_compress.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_set_compression_compress.c'; fi` + libarchive/libarchive_test-archive_write_set_compression_gzip.o: libarchive/archive_write_set_compression_gzip.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_set_compression_gzip.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_gzip.Tpo -c -o libarchive/libarchive_test-archive_write_set_compression_gzip.o `test -f 'libarchive/archive_write_set_compression_gzip.c' || echo '$(srcdir)/'`libarchive/archive_write_set_compression_gzip.c @am__fastdepCC_TRUE@ mv -f libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_gzip.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_set_compression_gzip.Po @@ -4179,6 +3938,20 @@ libarchive/test/libarchive_test-test_read_format_tar.obj: libarchive/test/test_r @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_read_format_tar.obj `if test -f 'libarchive/test/test_read_format_tar.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_tar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_tar.c'; fi` +libarchive/test/libarchive_test-test_read_format_tar_empty_filename.o: libarchive/test/test_read_format_tar_empty_filename.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_tar_empty_filename.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar_empty_filename.Tpo -c -o libarchive/test/libarchive_test-test_read_format_tar_empty_filename.o `test -f 'libarchive/test/test_read_format_tar_empty_filename.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_tar_empty_filename.c +@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar_empty_filename.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar_empty_filename.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_tar_empty_filename.c' object='libarchive/test/libarchive_test-test_read_format_tar_empty_filename.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_read_format_tar_empty_filename.o `test -f 'libarchive/test/test_read_format_tar_empty_filename.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_tar_empty_filename.c + +libarchive/test/libarchive_test-test_read_format_tar_empty_filename.obj: libarchive/test/test_read_format_tar_empty_filename.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_tar_empty_filename.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar_empty_filename.Tpo -c -o libarchive/test/libarchive_test-test_read_format_tar_empty_filename.obj `if test -f 'libarchive/test/test_read_format_tar_empty_filename.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_tar_empty_filename.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_tar_empty_filename.c'; fi` +@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar_empty_filename.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tar_empty_filename.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_read_format_tar_empty_filename.c' object='libarchive/test/libarchive_test-test_read_format_tar_empty_filename.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_read_format_tar_empty_filename.obj `if test -f 'libarchive/test/test_read_format_tar_empty_filename.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_tar_empty_filename.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_tar_empty_filename.c'; fi` + libarchive/test/libarchive_test-test_read_format_tbz.o: libarchive/test/test_read_format_tbz.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_tbz.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tbz.Tpo -c -o libarchive/test/libarchive_test-test_read_format_tbz.o `test -f 'libarchive/test/test_read_format_tbz.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_tbz.c @am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tbz.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_tbz.Po @@ -4319,6 +4092,34 @@ libarchive/test/libarchive_test-test_tar_large.obj: libarchive/test/test_tar_lar @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_tar_large.obj `if test -f 'libarchive/test/test_tar_large.c'; then $(CYGPATH_W) 'libarchive/test/test_tar_large.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_tar_large.c'; fi` +libarchive/test/libarchive_test-test_ustar_filenames.o: libarchive/test/test_ustar_filenames.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_ustar_filenames.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_ustar_filenames.Tpo -c -o libarchive/test/libarchive_test-test_ustar_filenames.o `test -f 'libarchive/test/test_ustar_filenames.c' || echo '$(srcdir)/'`libarchive/test/test_ustar_filenames.c +@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_ustar_filenames.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_ustar_filenames.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_ustar_filenames.c' object='libarchive/test/libarchive_test-test_ustar_filenames.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_ustar_filenames.o `test -f 'libarchive/test/test_ustar_filenames.c' || echo '$(srcdir)/'`libarchive/test/test_ustar_filenames.c + +libarchive/test/libarchive_test-test_ustar_filenames.obj: libarchive/test/test_ustar_filenames.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_ustar_filenames.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_ustar_filenames.Tpo -c -o libarchive/test/libarchive_test-test_ustar_filenames.obj `if test -f 'libarchive/test/test_ustar_filenames.c'; then $(CYGPATH_W) 'libarchive/test/test_ustar_filenames.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_ustar_filenames.c'; fi` +@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_ustar_filenames.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_ustar_filenames.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_ustar_filenames.c' object='libarchive/test/libarchive_test-test_ustar_filenames.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_ustar_filenames.obj `if test -f 'libarchive/test/test_ustar_filenames.c'; then $(CYGPATH_W) 'libarchive/test/test_ustar_filenames.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_ustar_filenames.c'; fi` + +libarchive/test/libarchive_test-test_write_compress.o: libarchive/test/test_write_compress.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress.Tpo -c -o libarchive/test/libarchive_test-test_write_compress.o `test -f 'libarchive/test/test_write_compress.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress.c +@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress.c' object='libarchive/test/libarchive_test-test_write_compress.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_compress.o `test -f 'libarchive/test/test_write_compress.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress.c + +libarchive/test/libarchive_test-test_write_compress.obj: libarchive/test/test_write_compress.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress.Tpo -c -o libarchive/test/libarchive_test-test_write_compress.obj `if test -f 'libarchive/test/test_write_compress.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress.c'; fi` +@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_compress.c' object='libarchive/test/libarchive_test-test_write_compress.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_compress.obj `if test -f 'libarchive/test/test_write_compress.c'; then $(CYGPATH_W) 'libarchive/test/test_write_compress.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_compress.c'; fi` + libarchive/test/libarchive_test-test_write_compress_program.o: libarchive/test/test_write_compress_program.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_compress_program.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_program.Tpo -c -o libarchive/test/libarchive_test-test_write_compress_program.o `test -f 'libarchive/test/test_write_compress_program.c' || echo '$(srcdir)/'`libarchive/test/test_write_compress_program.c @am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_program.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_compress_program.Po @@ -4501,6 +4302,20 @@ libarchive/test/libarchive_test-test_write_format_tar_empty.obj: libarchive/test @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_format_tar_empty.obj `if test -f 'libarchive/test/test_write_format_tar_empty.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_tar_empty.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_tar_empty.c'; fi` +libarchive/test/libarchive_test-test_write_format_tar_ustar.o: libarchive/test/test_write_format_tar_ustar.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_tar_ustar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_ustar.Tpo -c -o libarchive/test/libarchive_test-test_write_format_tar_ustar.o `test -f 'libarchive/test/test_write_format_tar_ustar.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_tar_ustar.c +@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_ustar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_ustar.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_tar_ustar.c' object='libarchive/test/libarchive_test-test_write_format_tar_ustar.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_format_tar_ustar.o `test -f 'libarchive/test/test_write_format_tar_ustar.c' || echo '$(srcdir)/'`libarchive/test/test_write_format_tar_ustar.c + +libarchive/test/libarchive_test-test_write_format_tar_ustar.obj: libarchive/test/test_write_format_tar_ustar.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_format_tar_ustar.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_ustar.Tpo -c -o libarchive/test/libarchive_test-test_write_format_tar_ustar.obj `if test -f 'libarchive/test/test_write_format_tar_ustar.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_tar_ustar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_tar_ustar.c'; fi` +@am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_ustar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_tar_ustar.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libarchive/test/test_write_format_tar_ustar.c' object='libarchive/test/libarchive_test-test_write_format_tar_ustar.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_format_tar_ustar.obj `if test -f 'libarchive/test/test_write_format_tar_ustar.c'; then $(CYGPATH_W) 'libarchive/test/test_write_format_tar_ustar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_format_tar_ustar.c'; fi` + libarchive/test/libarchive_test-test_write_open_memory.o: libarchive/test/test_write_open_memory.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_open_memory.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_open_memory.Tpo -c -o libarchive/test/libarchive_test-test_write_open_memory.o `test -f 'libarchive/test/test_write_open_memory.c' || echo '$(srcdir)/'`libarchive/test/test_write_open_memory.c @am__fastdepCC_TRUE@ mv -f libarchive/test/$(DEPDIR)/libarchive_test-test_write_open_memory.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_open_memory.Po @@ -4679,23 +4494,6 @@ uninstall-includeHEADERS: echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done -install-nodist_includeHEADERS: $(nodist_include_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" - @list='$(nodist_include_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(nodist_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ - $(nodist_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ - done - -uninstall-nodist_includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(nodist_include_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ - rm -f "$(DESTDIR)$(includedir)/$$f"; \ - done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -4956,7 +4754,7 @@ all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS) \ install-binPROGRAMS: install-libLTLIBRARIES installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -4977,7 +4775,6 @@ install-strip: mostlyclean-generic: clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -5022,8 +4819,7 @@ info: info-am info-am: -install-data-am: install-includeHEADERS install-man \ - install-nodist_includeHEADERS +install-data-am: install-includeHEADERS install-man install-dvi: install-dvi-am @@ -5062,8 +4858,7 @@ ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ - uninstall-libLTLIBRARIES uninstall-man \ - uninstall-nodist_includeHEADERS + uninstall-libLTLIBRARIES uninstall-man uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 @@ -5081,15 +4876,14 @@ uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-man1 install-man3 \ - install-man5 install-nodist_includeHEADERS install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-includeHEADERS uninstall-libLTLIBRARIES \ - uninstall-man uninstall-man1 uninstall-man3 uninstall-man5 \ - uninstall-nodist_includeHEADERS + install-man5 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \ + uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \ + uninstall-man3 uninstall-man5 # a) Clean out some unneeded files and directories @@ -5101,11 +4895,18 @@ dist-hook: rm -f `find $(distdir) -name '*.out'` rm -f `find $(distdir) -name '*.core'` -rm -f $(distdir)/*/Makefile $(distdir)/*/*/Makefile - cd $(distdir)/doc && ./update.sh + cd $(distdir)/doc && /bin/sh update.sh distclean-local: + -rm -rf .ref -rm -rf autom4te.cache/ -rm -f *~ + -[ -f libarchive/Makefile ] && cd libarchive && make clean + -[ -f libarchive/test/Makefile ] && cd libarchive/test && make clean + -[ -f tar/Makefile ] && cd tar && make clean + -[ -f tar/test/Makefile ] && cd tar/test && make clean + -[ -f cpio/Makefile ] && cd cpio && make clean + -[ -f cpio/test/Makefile ] && cd cpio/test && make clean # The "list.h" file just lists all of the tests defined in all of the sources. # Building it automatically provides a sanity-check on libarchive_test_SOURCES @@ -5113,66 +4914,11 @@ 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/libarchive/libarchive-2.4.17/NEWS b/libarchive/libarchive-2.5.5/NEWS index 991509e..36005fd 100644 --- a/libarchive/libarchive-2.4.17/NEWS +++ b/libarchive/libarchive-2.5.5/NEWS @@ -1,9 +1,79 @@ -Mar 14, 2008: libarchive 2.4.14 released. This is identical to 2.4.13 - except it contains a one-line fix to the uname/gname problem - introduced by the Feb 25 UTF-8 fix. This bug makes libarchive - refuse to add a file to a pax archive if it has a valid gname - but not a valid uname. In some cases, it can also cause the - uname to be stored for the gname. + +Jul 02, 2008: libarchive 2.5.5 released + +Jul 02, 2008: libarchive 2.5.5b released +Jul 01, 2008: bsdcpio is being used by enough people, we can call it 1.0.0 now +Jun 20, 2008: bsdcpio: If a -l link fails with EXDEV, copy the file instead +Jun 19, 2008: bsdcpio: additional long options for better GNU cpio compat +Jun 15, 2008: Many small portability and bugfixes since 2.5.4b. + +May 25, 2008: libarchive 2.5.4b released +May 21, 2008: Joerg Sonnenberger: fix bsdtar hardlink handling for newc format + +May 21, 2008: More progress on Windows building. Thanks to "Scott" + for the Windows makefiles, thanks to Kees Zeelenberg for + code contributions. + +May 21, 2008: Fix a number of non-exploitable integer and buffer overflows, + thanks to David Remahl at Apple for pointing these out. + +May 21, 2008: Colin Percival: SIGINFO or SIGUSR1 to bsdtar prints progress info + +May 16, 2008: bsdtar's test harness no longer depends on file ordering. + This was causing spurious test failures on a lot of systems. + Thanks to Bernhard R. Link for the diagnosis. + +May 14, 2008: Joerg Sonnenberger: -s substitution support for bsdtar + +May 13, 2008: Joerg Sonnenberger: Many mtree improvements + +May 11, 2008: Joerg Sonnenberger: fix hardlink extraction when + hardlinks have different permissions from original file + +April 30, 2008: Primary libarchive work has been moved into the FreeBSD + project's Perforce repository: http://perforce.freebsd.org/ + The libarchive project can be browsed at + //depot/user/kientzle/libarchive-portable + Direct link: http://preview.tinyurl.com/46mdgr + +May 04, 2008: libarchive 2.5.3b released + * libarchive: Several fixes to link resolver to address bsdcpio crashes + * bsdcpio: -p hardlink handling fixes + * tar/pax: Ensure ustar dirnames end in '/'; be more careful about + measuring filenames when deciding what pathname fields to use + * libarchive: Mark which entry strings are set; be accurate about + distinguishing empty strings ("") from unset ones (NULL) + * tar: Don't crash reading entries with empty filenames + * libarchive_test, bsdtar_test, bsdcpio_test: Better detaults: + run all tests, delete temp dirs, summarize repeated failures + * -no-undefined to libtool for Cygwin + * libarchive_test: Skip large file tests on systems with 32-bit off_t + * iso9660: Don't bother trying to find the body of an empty file; + this works around strange behavior from some ISO9660 writers + * tar: allow -r -T to be used together + * tar: allow --format with -r or -u + * libarchive: Don't build archive.h + +May 04, 2008: Simplified building: archive.h is no longer constructed + This may require additional #if conditionals on some platforms. + +Mar 30, 2008: libarchive 2.5.1b released + +Mar 15, 2008: libarchive 2.5.0b released +Mar 15, 2008: bsdcpio now seems to correctly write hardlinks into newc, + ustar, and old cpio archives. Just a little more testing before + bsdcpio 1.0 becomes a reality. +Mar 15, 2008: I think the new linkify() interface is finally handling + all known hardlink strategies. +Mar 15, 2008: Mtree read fixes from Joerg Sonnenberger. +Mar 15, 2008: Many new bsdtar and bsdcpio options from Joerg Sonnenberger. +Mar 15, 2008: test harnesses no longer require uudecode; they + now have built-in decoding logic that decodes the reference + files as they are needed. + +Mar 14, 2008: libarchive 2.4.14 released; identical to 2.4.13 except for + a point fix for gname/uname mixup in pax format that was introduced + with the UTF-8 fixes. Feb 26, 2008: libarchive 2.4.13 released Feb 25, 2008: Handle path, linkname, gname, or uname that can't be converted diff --git a/libarchive/libarchive-2.4.17/README b/libarchive/libarchive-2.5.5/README index 3652503..50a9d62 100644 --- a/libarchive/libarchive-2.4.17/README +++ b/libarchive/libarchive-2.5.5/README @@ -69,6 +69,7 @@ Currently, the library automatically detects and reads the following: The library can write: * gzip compression * bzip2 compression + * compress/LZW compression * POSIX ustar * POSIX pax interchange format * "restricted" pax format, which will create ustar archives except for diff --git a/libarchive/libarchive-2.4.17/aclocal.m4 b/libarchive/libarchive-2.5.5/aclocal.m4 index 0d4f6fd..0d4f6fd 100644 --- a/libarchive/libarchive-2.4.17/aclocal.m4 +++ b/libarchive/libarchive-2.5.5/aclocal.m4 diff --git a/libarchive/libarchive-2.4.17/config.aux/compile b/libarchive/libarchive-2.5.5/config.aux/compile index 1b1d232..1b1d232 100755 --- a/libarchive/libarchive-2.4.17/config.aux/compile +++ b/libarchive/libarchive-2.5.5/config.aux/compile diff --git a/libarchive/libarchive-2.4.17/config.aux/config.guess b/libarchive/libarchive-2.5.5/config.aux/config.guess index 0f0fe71..0f0fe71 100755 --- a/libarchive/libarchive-2.4.17/config.aux/config.guess +++ b/libarchive/libarchive-2.5.5/config.aux/config.guess diff --git a/libarchive/libarchive-2.4.17/config.aux/config.sub b/libarchive/libarchive-2.5.5/config.aux/config.sub index 5defff6..5defff6 100755 --- a/libarchive/libarchive-2.4.17/config.aux/config.sub +++ b/libarchive/libarchive-2.5.5/config.aux/config.sub diff --git a/libarchive/libarchive-2.4.17/config.aux/depcomp b/libarchive/libarchive-2.5.5/config.aux/depcomp index ca5ea4e..ca5ea4e 100755 --- a/libarchive/libarchive-2.4.17/config.aux/depcomp +++ b/libarchive/libarchive-2.5.5/config.aux/depcomp diff --git a/libarchive/libarchive-2.4.17/config.aux/install-sh b/libarchive/libarchive-2.5.5/config.aux/install-sh index 4fbbae7..4fbbae7 100755 --- a/libarchive/libarchive-2.4.17/config.aux/install-sh +++ b/libarchive/libarchive-2.5.5/config.aux/install-sh diff --git a/libarchive/libarchive-2.4.17/config.aux/ltmain.sh b/libarchive/libarchive-2.5.5/config.aux/ltmain.sh index a85567f..a85567f 100644 --- a/libarchive/libarchive-2.4.17/config.aux/ltmain.sh +++ b/libarchive/libarchive-2.5.5/config.aux/ltmain.sh diff --git a/libarchive/libarchive-2.4.17/config.aux/missing b/libarchive/libarchive-2.5.5/config.aux/missing index 1c8ff70..1c8ff70 100755 --- a/libarchive/libarchive-2.4.17/config.aux/missing +++ b/libarchive/libarchive-2.5.5/config.aux/missing diff --git a/libarchive/libarchive-2.4.17/config.aux/ylwrap b/libarchive/libarchive-2.5.5/config.aux/ylwrap index 102bd89..102bd89 100755 --- a/libarchive/libarchive-2.4.17/config.aux/ylwrap +++ b/libarchive/libarchive-2.5.5/config.aux/ylwrap diff --git a/libarchive/libarchive-2.4.17/config.h.in b/libarchive/libarchive-2.5.5/config.h.in index 87536d5..3aa2f3e 100644 --- a/libarchive/libarchive-2.4.17/config.h.in +++ b/libarchive/libarchive-2.5.5/config.h.in @@ -45,6 +45,9 @@ /* Define to 1 if you have the `chown' function. */ #undef HAVE_CHOWN +/* Define to 1 if you have the `chroot' function. */ +#undef HAVE_CHROOT + /* Define to 1 if you have the declaration of `INT64_MAX', and to 0 if you don't. */ #undef HAVE_DECL_INT64_MAX @@ -114,6 +117,9 @@ /* Define to 1 if you have the `fchown' function. */ #undef HAVE_FCHOWN +/* Define to 1 if you have the `fcntl' function. */ +#undef HAVE_FCNTL + /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H @@ -123,12 +129,18 @@ /* Define to 1 if fnmatch(3) supports the FNM_LEADING_DIR flag */ #undef HAVE_FNM_LEADING_DIR +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + /* 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 `fstat' function. */ +#undef HAVE_FSTAT + /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE @@ -141,6 +153,9 @@ /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG +/* Define to 1 if you have the `getpid' function. */ +#undef HAVE_GETPID + /* Define to 1 if you have the `getxattr' function. */ #undef HAVE_GETXATTR @@ -183,9 +198,6 @@ /* Define to 1 if you have the <limits.h> header file. */ #undef HAVE_LIMITS_H -/* 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 @@ -238,6 +250,9 @@ /* Define to 1 if you have the <paths.h> header file. */ #undef HAVE_PATHS_H +/* Define to 1 if you have the `pipe' function. */ +#undef HAVE_PIPE + /* Define to 1 if you have the `poll' function. */ #undef HAVE_POLL @@ -247,6 +262,9 @@ /* Define to 1 if you have the <pwd.h> header file. */ #undef HAVE_PWD_H +/* Define to 1 if you have the <regex.h> header file. */ +#undef HAVE_REGEX_H + /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT @@ -299,12 +317,6 @@ /* 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'. */ -#undef HAVE_STRUCT_STAT_ST_RDEV - -/* 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 @@ -376,6 +388,9 @@ /* Define to 1 if you have the <utime.h> header file. */ #undef HAVE_UTIME_H +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF @@ -388,6 +403,9 @@ /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN +/* Define to 1 if you have the `wctomb' function. */ +#undef HAVE_WCTOMB + /* Define to 1 if you have the `wmemcmp' function. */ #undef HAVE_WMEMCMP @@ -398,7 +416,7 @@ #undef HAVE_ZLIB_H /* Version number of libarchive as a single integer */ -#undef LIBARCHIVE_VERSION +#undef LIBARCHIVE_VERSION_NUMBER /* Version number of libarchive */ #undef LIBARCHIVE_VERSION_STRING diff --git a/libarchive/libarchive-2.4.17/configure b/libarchive/libarchive-2.5.5/configure index e18c509..0dca9a4 100755 --- a/libarchive/libarchive-2.4.17/configure +++ b/libarchive/libarchive-2.5.5/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.17. +# Generated by GNU Autoconf 2.61 for libarchive 2.5.5. # # 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.17' -PACKAGE_STRING='libarchive 2.4.17' +PACKAGE_VERSION='2.5.5' +PACKAGE_STRING='libarchive 2.5.5' PACKAGE_BUGREPORT='kientzle@freebsd.org' ac_unique_file="libarchive" @@ -832,7 +832,7 @@ ARCHIVE_LIBTOOL_VERSION BSDCPIO_VERSION_STRING BSDTAR_VERSION_STRING LIBARCHIVE_VERSION_STRING -LIBARCHIVE_VERSION +LIBARCHIVE_VERSION_NUMBER CC CFLAGS LDFLAGS @@ -885,7 +885,6 @@ BUILD_BSDCPIO_TRUE BUILD_BSDCPIO_FALSE STATIC_BSDCPIO_TRUE STATIC_BSDCPIO_FALSE -ARCHIVE_H_INCLUDE_INTTYPES_H LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -1408,7 +1407,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.17 to adapt to many kinds of systems. +\`configure' configures libarchive 2.5.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1478,7 +1477,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libarchive 2.4.17:";; + short | recursive ) echo "Configuration of libarchive 2.5.5:";; esac cat <<\_ACEOF @@ -1596,7 +1595,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libarchive configure 2.4.17 +libarchive configure 2.5.5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1610,7 +1609,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.17, which was +It was created by libarchive $as_me 2.5.5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2304,7 +2303,7 @@ fi # Define the identity of the package. PACKAGE='libarchive' - VERSION='2.4.17' + VERSION='2.5.5' cat >>confdefs.h <<_ACEOF @@ -2451,11 +2450,49 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' -# Shell magic to compute Major/minor/etc from full version stamp. -# This gets a little hairy... +# Libtool versioning uses different conventions on different +# platforms. At least on FreeBSD, libtool uses an overly complex +# convention that attempts to solve problems that most people just +# don't have and which just causes confusion for most end users. +ARCHIVE_MAJOR=$(( 2005005 / 1000000 )) +ARCHIVE_MINOR=$(( (2005005 / 1000) % 1000 )) +ARCHIVE_REVISION=$(( 2005005 % 1000 )) +ARCHIVE_LIBTOOL_MAJOR=`echo $((${ARCHIVE_MAJOR} + ${ARCHIVE_MINOR}))` +ARCHIVE_LIBTOOL_VERSION=$ARCHIVE_LIBTOOL_MAJOR:$ARCHIVE_REVISION:$ARCHIVE_MINOR + +# Stick the version numbers into config.h + +cat >>confdefs.h <<\_ACEOF +#define LIBARCHIVE_VERSION_STRING "2.5.5" +_ACEOF +cat >>confdefs.h <<_ACEOF +#define LIBARCHIVE_VERSION_NUMBER "2005005" +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define BSDCPIO_VERSION_STRING "1.0.0" +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define BSDTAR_VERSION_STRING "2.5.5" +_ACEOF + + +# The shell variables here must be the same as the AC_SUBST() variables +# below, but the shell variable names apparently cannot be the same as +# the m4 macro names above. Why? Ask autoconf. +BSDCPIO_VERSION_STRING=1.0.0 +BSDTAR_VERSION_STRING=2.5.5 +LIBARCHIVE_VERSION_STRING=2.5.5 +LIBARCHIVE_VERSION_NUMBER=2005005 + # Substitute the above version numbers into the various files below. +# Yes, I believe this is the fourth time we define what are essentially +# the same symbols. Why? Ask autoconf. @@ -2466,8 +2503,6 @@ ac_config_headers="$ac_config_headers config.h" ac_config_files="$ac_config_files Makefile" -ac_config_files="$ac_config_files libarchive/archive.h" - # Checks for programs. ac_ext=c @@ -4524,7 +4559,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4527 "configure"' > conftest.$ac_ext + echo '#line 4562 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7255,11 +7290,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:7258: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7293: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7262: \$? = $ac_status" >&5 + echo "$as_me:7297: \$? = $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. @@ -7523,11 +7558,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:7526: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7561: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7530: \$? = $ac_status" >&5 + echo "$as_me:7565: \$? = $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. @@ -7627,11 +7662,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:7630: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7665: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7634: \$? = $ac_status" >&5 + echo "$as_me:7669: \$? = $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 @@ -9935,7 +9970,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 9938 "configure" +#line 9973 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10035,7 +10070,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10038 "configure" +#line 10073 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12371,11 +12406,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:12374: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12409: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12378: \$? = $ac_status" >&5 + echo "$as_me:12413: \$? = $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. @@ -12475,11 +12510,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:12478: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12513: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12482: \$? = $ac_status" >&5 + echo "$as_me:12517: \$? = $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 @@ -14045,11 +14080,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:14048: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14083: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14052: \$? = $ac_status" >&5 + echo "$as_me:14087: \$? = $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. @@ -14149,11 +14184,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:14152: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14187: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14156: \$? = $ac_status" >&5 + echo "$as_me:14191: \$? = $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 @@ -16347,11 +16382,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:16350: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16385: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16354: \$? = $ac_status" >&5 + echo "$as_me:16389: \$? = $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. @@ -16615,11 +16650,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:16618: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16653: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16622: \$? = $ac_status" >&5 + echo "$as_me:16657: \$? = $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. @@ -16719,11 +16754,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:16722: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16757: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16726: \$? = $ac_status" >&5 + echo "$as_me:16761: \$? = $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 @@ -20247,8 +20282,7 @@ done - -for ac_header in inttypes.h langinfo.h limits.h linux/ext2_fs.h linux/fs.h +for ac_header in inttypes.h langinfo.h limits.h linux/fs.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 @@ -20392,157 +20426,13 @@ fi done -# Include inttypes.h into archive.h only if appropriate. -# We can't use the HAVE_INTTYPES_H macro here because archive.h -# gets installed as a system header and then included into client code -# that doesn't define such macros. (And we should certainly not -# define such macros in system headers!) -# Hence the following: -if test "${ac_cv_header_inttypes_h+set}" = set; then - { echo "$as_me:$LINENO: checking for inttypes.h" >&5 -echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } -if test "${ac_cv_header_inttypes_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5 -echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking inttypes.h usability" >&5 -echo $ECHO_N "checking inttypes.h 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 <inttypes.h> -_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 inttypes.h presence" >&5 -echo $ECHO_N "checking inttypes.h 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 <inttypes.h> -_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: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: inttypes.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: inttypes.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: inttypes.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: inttypes.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: inttypes.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: inttypes.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: inttypes.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: inttypes.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: inttypes.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: inttypes.h: 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 inttypes.h" >&5 -echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } -if test "${ac_cv_header_inttypes_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_inttypes_h=$ac_header_preproc -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_inttypes_h" >&5 -echo "${ECHO_T}$ac_cv_header_inttypes_h" >&6; } - -fi -if test $ac_cv_header_inttypes_h = yes; then - ARCHIVE_H_INCLUDE_INTTYPES_H='#include <inttypes.h> /* For int64_t */' - -else - ARCHIVE_H_INCLUDE_INTTYPES_H='' - -fi - - - - - - - -for ac_header in locale.h paths.h poll.h pwd.h stdarg.h +for ac_header in locale.h paths.h poll.h pwd.h regex.h stdarg.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 @@ -21747,210 +21637,6 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 -echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } -if test "${ac_cv_member_struct_stat_st_rdev+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. */ -$ac_includes_default -int -main () -{ -static struct stat ac_aggr; -if (ac_aggr.st_rdev) -return 0; - ; - return 0; -} -_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_cv_member_struct_stat_st_rdev=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -int -main () -{ -static struct stat ac_aggr; -if (sizeof ac_aggr.st_rdev) -return 0; - ; - return 0; -} -_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_cv_member_struct_stat_st_rdev=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_stat_st_rdev=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } -if test $ac_cv_member_struct_stat_st_rdev = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_RDEV 1 -_ACEOF - - -fi - -{ echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5 -echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6; } -if test "${ac_cv_member_struct_tm_tm_gmtoff+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. */ -$ac_includes_default -int -main () -{ -static struct tm ac_aggr; -if (ac_aggr.tm_gmtoff) -return 0; - ; - return 0; -} -_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_cv_member_struct_tm_tm_gmtoff=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -int -main () -{ -static struct tm ac_aggr; -if (sizeof ac_aggr.tm_gmtoff) -return 0; - ; - return 0; -} -_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_cv_member_struct_tm_tm_gmtoff=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_member_struct_tm_tm_gmtoff=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_gmtoff" >&6; } -if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TM_TM_GMTOFF 1 -_ACEOF - - -fi - # Check for high-resolution timestamps in struct stat { echo "$as_me:$LINENO: checking for struct stat.st_mtimespec.tv_nsec" >&5 echo $ECHO_N "checking for struct stat.st_mtimespec.tv_nsec... $ECHO_C" >&6; } @@ -24817,7 +24503,9 @@ done -for ac_func in chflags chown fchdir fchflags fchmod fchown futimes + + +for ac_func in chflags chown chroot fchdir fchflags fchmod fchown fcntl fork do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -24913,7 +24601,10 @@ done -for ac_func in ftruncate geteuid getopt_long + + + +for ac_func in fstat ftruncate futimes geteuid getopt_long getpid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -25206,7 +24897,8 @@ done -for ac_func in nl_langinfo poll select setenv setlocale + +for ac_func in nl_langinfo pipe 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 @@ -25401,7 +25093,8 @@ done -for ac_func in tzset unsetenv utime utimes + +for ac_func in tzset unsetenv utime utimes vfork do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -25498,7 +25191,8 @@ done -for ac_func in wcscpy wcslen wmemcmp wmemcpy + +for ac_func in wcscpy wcslen wctomb wmemcmp wmemcpy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -27394,48 +27088,6 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs - -# Autoconf assigns the version above to PACKAGE_VERSION -LIBARCHIVE_VERSION_STRING=$PACKAGE_VERSION -BSDTAR_VERSION_STRING=$PACKAGE_VERSION -# For a little while longer, cpio is considered immature -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/\..*//'` -ARCHIVE_MINOR=`echo $LIBARCHIVE_VERSION_STRING | sed -e 's/[^0-9]/./g' -e 's/^[0-9]*\.//' -e 's/\..*//'` -ARCHIVE_REVISION=`echo $LIBARCHIVE_VERSION_STRING | sed -e 's/[^0-9]/./g' -e 's/^[0-9]*\.[0-9]*\.//' -e 's/\..*//'` -# Major/minor indicate the API version -LIBARCHIVE_VERSION=`printf "%d%03d%03d" ${ARCHIVE_MAJOR} ${ARCHIVE_MINOR} ${ARCHIVE_REVISION}` -# Libtool versioning uses different conventions on different platforms. -# FreeBSD libtool still uses this old (and very dumb) convention, -# which doesn't match FreeBSD system conventions, nor anything else -# I'm familiar with. -ARCHIVE_LIBTOOL_MAJOR=`echo $((${ARCHIVE_MAJOR} + ${ARCHIVE_MINOR}))` -ARCHIVE_LIBTOOL_VERSION=$ARCHIVE_LIBTOOL_MAJOR:$ARCHIVE_REVISION:$ARCHIVE_MINOR - -# Make sure the following get defined in config.h properly - -cat >>confdefs.h <<_ACEOF -#define LIBARCHIVE_VERSION_STRING "$LIBARCHIVE_VERSION_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LIBARCHIVE_VERSION "$LIBARCHIVE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define BSDCPIO_VERSION_STRING "$BSDCPIO_VERSION_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define BSDTAR_VERSION_STRING "$BSDTAR_VERSION_STRING" -_ACEOF - - if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -27785,7 +27437,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.17, which was +This file was extended by libarchive $as_me 2.5.5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -27838,7 +27490,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -libarchive config.status 2.4.17 +libarchive config.status 2.5.5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -27954,7 +27606,6 @@ do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "libarchive/archive.h") CONFIG_FILES="$CONFIG_FILES libarchive/archive.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 @@ -28081,7 +27732,7 @@ ARCHIVE_LIBTOOL_VERSION!$ARCHIVE_LIBTOOL_VERSION$ac_delim BSDCPIO_VERSION_STRING!$BSDCPIO_VERSION_STRING$ac_delim BSDTAR_VERSION_STRING!$BSDTAR_VERSION_STRING$ac_delim LIBARCHIVE_VERSION_STRING!$LIBARCHIVE_VERSION_STRING$ac_delim -LIBARCHIVE_VERSION!$LIBARCHIVE_VERSION$ac_delim +LIBARCHIVE_VERSION_NUMBER!$LIBARCHIVE_VERSION_NUMBER$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim @@ -28175,12 +27826,11 @@ BUILD_BSDCPIO_TRUE!$BUILD_BSDCPIO_TRUE$ac_delim BUILD_BSDCPIO_FALSE!$BUILD_BSDCPIO_FALSE$ac_delim STATIC_BSDCPIO_TRUE!$STATIC_BSDCPIO_TRUE$ac_delim STATIC_BSDCPIO_FALSE!$STATIC_BSDCPIO_FALSE$ac_delim -ARCHIVE_H_INCLUDE_INTTYPES_H!$ARCHIVE_H_INCLUDE_INTTYPES_H$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 22; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 21; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/libarchive/libarchive-2.4.17/configure.ac b/libarchive/libarchive-2.5.5/configure.ac index eae9beb..317947b 100644 --- a/libarchive/libarchive-2.4.17/configure.ac +++ b/libarchive/libarchive-2.5.5/configure.ac @@ -1,10 +1,22 @@ -#Process this file with autoconf to produce a configure script. +dnl Process this file with autoconf to produce a configure script. -# M4 magic to pull in the version from a separate file -# so we don't have to edit this file for routine version updates -m4_define([ARCHIVE_VERS],m4_include([version])) +dnl First, define all of the version numbers up front. +dnl In particular, this allows the version macro to be used in AC_INIT -AC_INIT([libarchive],ARCHIVE_VERS(),[kientzle@freebsd.org]) +dnl These first two version numbers are updated automatically on each release. +m4_define([LIBARCHIVE_VERSION_S],[2.5.5]) +m4_define([LIBARCHIVE_VERSION_N],[2005005]) + +dnl bsdtar versioning tracks libarchive +m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S()) +dnl bsdcpio is still versioning separately, as it's less mature. +m4_define([BSDCPIO_VERSION_S],[1.0.0]) + +# +# Now starts the "real" configure script. +# + +AC_INIT([libarchive],LIBARCHIVE_VERSION_S(),[kientzle@freebsd.org]) # Make sure the srcdir contains "libarchive" directory AC_CONFIG_SRCDIR([libarchive]) # Use auxiliary subscripts from this subdirectory (cleans up root) @@ -12,53 +24,45 @@ AC_CONFIG_AUX_DIR([config.aux]) # Must follow AC_CONFIG macros above... AM_INIT_AUTOMAKE() -# Shell magic to compute Major/minor/etc from full version stamp. -# This gets a little hairy... -AC_CONFIG_COMMANDS_PRE([ -# Autoconf assigns the version above to PACKAGE_VERSION -LIBARCHIVE_VERSION_STRING=$PACKAGE_VERSION -BSDTAR_VERSION_STRING=$PACKAGE_VERSION -# For a little while longer, cpio is considered immature -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/\..*//'` -ARCHIVE_MINOR=`echo $LIBARCHIVE_VERSION_STRING | sed -e 's/[[^0-9]]/./g' -e 's/^[[0-9]]*\.//' -e 's/\..*//'` -ARCHIVE_REVISION=`echo $LIBARCHIVE_VERSION_STRING | sed -e 's/[[^0-9]]/./g' -e 's/^[[0-9]]*\.[[0-9]]*\.//' -e 's/\..*//'` -# Major/minor indicate the API version -LIBARCHIVE_VERSION=`printf "%d%03d%03d" ${ARCHIVE_MAJOR} ${ARCHIVE_MINOR} ${ARCHIVE_REVISION}` -# Libtool versioning uses different conventions on different platforms. -# FreeBSD libtool still uses this old (and very dumb) convention, -# which doesn't match FreeBSD system conventions, nor anything else -# I'm familiar with. +# Libtool versioning uses different conventions on different +# platforms. At least on FreeBSD, libtool uses an overly complex +# convention that attempts to solve problems that most people just +# don't have and which just causes confusion for most end users. +ARCHIVE_MAJOR=$(( LIBARCHIVE_VERSION_N() / 1000000 )) +ARCHIVE_MINOR=$(( (LIBARCHIVE_VERSION_N() / 1000) % 1000 )) +ARCHIVE_REVISION=$(( LIBARCHIVE_VERSION_N() % 1000 )) ARCHIVE_LIBTOOL_MAJOR=`echo $((${ARCHIVE_MAJOR} + ${ARCHIVE_MINOR}))` ARCHIVE_LIBTOOL_VERSION=$ARCHIVE_LIBTOOL_MAJOR:$ARCHIVE_REVISION:$ARCHIVE_MINOR -# Make sure the following get defined in config.h properly -AC_DEFINE_UNQUOTED([LIBARCHIVE_VERSION_STRING], - "$LIBARCHIVE_VERSION_STRING", +# Stick the version numbers into config.h +AC_DEFINE([LIBARCHIVE_VERSION_STRING],"LIBARCHIVE_VERSION_S()", [Version number of libarchive]) -AC_DEFINE_UNQUOTED([LIBARCHIVE_VERSION], - "$LIBARCHIVE_VERSION", +AC_DEFINE_UNQUOTED([LIBARCHIVE_VERSION_NUMBER],"LIBARCHIVE_VERSION_N()", [Version number of libarchive as a single integer]) -AC_DEFINE_UNQUOTED([BSDCPIO_VERSION_STRING], - "$BSDCPIO_VERSION_STRING", +AC_DEFINE([BSDCPIO_VERSION_STRING],"BSDCPIO_VERSION_S()", [Version number of bsdcpio]) -AC_DEFINE_UNQUOTED([BSDTAR_VERSION_STRING], - "$BSDTAR_VERSION_STRING", +AC_DEFINE([BSDTAR_VERSION_STRING],"BSDTAR_VERSION_S()", [Version number of bsdtar]) -]) + +# The shell variables here must be the same as the AC_SUBST() variables +# below, but the shell variable names apparently cannot be the same as +# the m4 macro names above. Why? Ask autoconf. +BSDCPIO_VERSION_STRING=BSDCPIO_VERSION_S() +BSDTAR_VERSION_STRING=BSDTAR_VERSION_S() +LIBARCHIVE_VERSION_STRING=LIBARCHIVE_VERSION_S() +LIBARCHIVE_VERSION_NUMBER=LIBARCHIVE_VERSION_N() # Substitute the above version numbers into the various files below. +# Yes, I believe this is the fourth time we define what are essentially +# the same symbols. Why? Ask autoconf. AC_SUBST(ARCHIVE_LIBTOOL_VERSION) AC_SUBST(BSDCPIO_VERSION_STRING) AC_SUBST(BSDTAR_VERSION_STRING) AC_SUBST(LIBARCHIVE_VERSION_STRING) -AC_SUBST(LIBARCHIVE_VERSION) +AC_SUBST(LIBARCHIVE_VERSION_NUMBER) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile]) -AC_CONFIG_FILES([libarchive/archive.h]) # Checks for programs. AC_PROG_CC @@ -159,17 +163,8 @@ AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_SYS_WAIT 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. -# We can't use the HAVE_INTTYPES_H macro here because archive.h -# gets installed as a system header and then included into client code -# that doesn't define such macros. (And we should certainly not -# define such macros in system headers!) -# Hence the following: -AC_CHECK_HEADER(inttypes.h, - [AC_SUBST(ARCHIVE_H_INCLUDE_INTTYPES_H,['#include <inttypes.h> /* For int64_t */'])], - [AC_SUBST(ARCHIVE_H_INCLUDE_INTTYPES_H,[''])]) -AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h stdarg.h]) +AC_CHECK_HEADERS([inttypes.h langinfo.h limits.h linux/fs.h]) +AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h regex.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 sys/utime.h]) AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h zlib.h]) @@ -195,8 +190,6 @@ AC_CHECK_TYPE(off_t, [long long]) AC_TYPE_SIZE_T AC_CHECK_TYPE(id_t, [unsigned long]) AC_CHECK_TYPE(uintptr_t, [unsigned int]) -AC_CHECK_MEMBERS([struct stat.st_rdev]) -AC_CHECK_MEMBERS([struct tm.tm_gmtoff]) # Check for high-resolution timestamps in struct stat AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec]) AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec]) @@ -235,14 +228,14 @@ AC_FUNC_STAT AC_FUNC_STRERROR_R AC_FUNC_STRFTIME AC_FUNC_VPRINTF -AC_CHECK_FUNCS([chflags chown fchdir fchflags fchmod fchown futimes]) -AC_CHECK_FUNCS([ftruncate geteuid getopt_long]) +AC_CHECK_FUNCS([chflags chown chroot fchdir fchflags fchmod fchown fcntl fork]) +AC_CHECK_FUNCS([fstat ftruncate futimes geteuid getopt_long getpid]) AC_CHECK_FUNCS([lchflags lchmod lchown]) AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo mknod]) -AC_CHECK_FUNCS([nl_langinfo poll select setenv setlocale]) +AC_CHECK_FUNCS([nl_langinfo pipe 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]) +AC_CHECK_FUNCS([tzset unsetenv utime utimes vfork]) +AC_CHECK_FUNCS([wcscpy wcslen wctomb wmemcmp wmemcpy]) # FreeBSD's nl_langinfo supports an option to specify whether the # current locale uses month/day or day/month ordering. It makes the diff --git a/libarchive/libarchive-2.4.17/contrib/README b/libarchive/libarchive-2.5.5/contrib/README index 2eb0114..2eb0114 100644 --- a/libarchive/libarchive-2.4.17/contrib/README +++ b/libarchive/libarchive-2.5.5/contrib/README diff --git a/libarchive/libarchive-2.4.17/contrib/libarchive.1aix53.spec b/libarchive/libarchive-2.5.5/contrib/libarchive.1aix53.spec index 9c35c82..9c35c82 100644 --- a/libarchive/libarchive-2.4.17/contrib/libarchive.1aix53.spec +++ b/libarchive/libarchive-2.5.5/contrib/libarchive.1aix53.spec diff --git a/libarchive/libarchive-2.4.17/contrib/libarchive.spec b/libarchive/libarchive-2.5.5/contrib/libarchive.spec index 29eef95..29eef95 100644 --- a/libarchive/libarchive-2.4.17/contrib/libarchive.spec +++ b/libarchive/libarchive-2.5.5/contrib/libarchive.spec diff --git a/libarchive/libarchive-2.4.17/contrib/libarchive_autodetect-st_lib_archive.m4 b/libarchive/libarchive-2.5.5/contrib/libarchive_autodetect-st_lib_archive.m4 index 4419e88..4419e88 100644 --- a/libarchive/libarchive-2.4.17/contrib/libarchive_autodetect-st_lib_archive.m4 +++ b/libarchive/libarchive-2.5.5/contrib/libarchive_autodetect-st_lib_archive.m4 diff --git a/libarchive/libarchive-2.5.5/contrib/psota-benchmark/results.txt b/libarchive/libarchive-2.5.5/contrib/psota-benchmark/results.txt new file mode 100644 index 0000000..8197b28 --- /dev/null +++ b/libarchive/libarchive-2.5.5/contrib/psota-benchmark/results.txt @@ -0,0 +1,122 @@ +ODP: [Bug-tar] GNU tar, star and BSD tar speed comparision +new script + +Jan Psota +Thu, 25 Oct 2007 06:51:13 -0700 + +Latest TCP script at the bottom (3180 bytes). +4 tests: 64bit dual core Athlon tmpfs / disk (reiserfs) - 60MB/s, + 32bit Athlon tmpfs / disk (reiserfs) - 55MB/s +Both machines were idle -- used for testing only. +Tarball and extracted files were on different physical devices. +Test data: linux 2.6.22/3 kernel sources for memory operations, +for the other data average file size should bring enough info. + +2 x [...] processor means 1 processor with 2 cores (2 entries in cpuinfo). +Archive format is set to pax (Joerg). +Let's end with it. I only wanted to send You a new version of TCP script :-). + +-- +Jan Psota + +TCP, version 2007-10-25 +Linux 2.6.22-suspend2-r2 / Gentoo Base System release 2.0.0_rc5 +2012MB of memory, 2 x AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ 2211.348 +512 KB 4426.24 bmips +gcc (GCC) 4.2.2 (Gentoo 4.2.2 p1.0) +CFLAGS="-O2 -march=k8 -pipe" + +bsdtar: bsdtar 2.3.4 - libarchive 2.3.4 +gnutar: tar (GNU tar) 1.19 +star: star: star 1.5a85 (x86_64-unknown-linux-gnu) + +best time of 5 repetitions, + src=linux-2.6.23, 291M in 23867 files, avg 13KB/file, + archive=/tmp/tcp.tar, extract to /tmp/tcptmp +program operation real user system %CPU speed +bsdtar create 0.764 0.232 0.532 99.96 370308 KB/s +gnutar create 0.743 0.200 0.512 95.87 380775 KB/s +star create 0.587 0.040 0.820 100.00 441247 KB/s + +bsdtar list 0.164 0.096 0.068 99.84 1579341 KB/s +gnutar list 0.218 0.064 0.152 98.92 1188128 KB/s +star list 0.359 0.044 0.240 79.09 721481 KB/s + +bsdtar extract 0.733 0.200 0.504 96.02 353358 KB/s +gnutar extract 0.625 0.092 0.508 96.02 414419 KB/s +star extract 0.875 0.096 0.980 100.00 296013 KB/s + +bsdtar compare 0.001 0.000 0.000 0.00 259012000 KB/s +gnutar compare 0.719 0.288 0.400 95.66 360239 KB/s +star compare 0.695 0.224 0.636 100.00 372679 KB/s + +[...] +best time of 3 repetitions, + src=/home, 3.2G in 7447 files, avg 554KB/file, + archive=/var/tcp.tar, extract to /mnt/a/tcptmp +program operation real user system %CPU speed +bsdtar create 184.680 0.552 13.365 7.53 17958 KB/s +gnutar create 159.240 0.256 12.417 7.95 20827 KB/s +star create 181.779 0.140 14.789 8.21 18203 KB/s + +bsdtar list 0.053 0.032 0.016 91.41 62435471 KB/s +gnutar list 56.535 0.136 3.764 6.89 58531 KB/s +star list 56.652 0.080 5.236 9.38 58410 KB/s + +bsdtar extract 78.914 0.820 15.149 20.23 41932 KB/s +gnutar extract 78.480 0.196 14.197 18.33 42164 KB/s +star extract 79.439 0.132 12.973 16.49 41655 KB/s + +bsdtar compare 0.001 0.000 0.000 0.00 3309080000 KB/s +gnutar compare 61.771 3.464 8.905 20.02 53570 KB/s +star compare 57.561 1.728 9.897 20.19 57488 KB/s + + +Linux 2.6.22-suspend2-smp / Gentoo Base System release 2.0.0_rc5 +504MB of memory, 1 x AMD Athlon(tm) Processor 1500.033 256 KB 3002.55 bmips +gcc (GCC) 4.2.2 (Gentoo 4.2.2 p1.0) +CFLAGS="-O2 -march=athlon-xp -mfpmath=sse -frename-registers -pipe" + +bsdtar: bsdtar 2.3.4 - libarchive 2.3.4 +gnutar: tar (GNU tar) 1.19 +star: star: star 1.5a85 (i686-pc-linux-gnu) + +best time of 3 repetitions, + src=/usr/src/linux-2.6.22-suspend2/drivers, 119M in 5900 files, + avg 21KB/file, archive=/tmp/tcp.tar, extract to /tmp/tcptmp +program operation real user system %CPU speed +bsdtar create 1.329 0.192 1.132 99.63 89784 KB/s +gnutar create 1.223 0.124 1.092 99.46 97566 KB/s +star create 1.848 0.036 1.708 94.36 61372 KB/s + +bsdtar list 0.167 0.060 0.108 100.00 679137 KB/s +gnutar list 0.161 0.040 0.124 100.00 704447 KB/s +star list 0.859 0.044 0.716 88.51 132032 KB/s + +bsdtar extract 1.186 0.172 1.012 99.87 95629 KB/s +gnutar extract 1.064 0.056 1.004 99.63 106593 KB/s +star extract 1.920 0.088 1.724 94.40 59070 KB/s + +bsdtar compare 0.002 0.000 0.000 0.00 56708000 KB/s +gnutar compare 0.925 0.232 0.692 99.90 122611 KB/s +star compare 1.569 0.376 1.096 93.79 72285 KB/s + +[...] +best time of 3 repetitions, + src=/home/jasiu, 2.1G in 8416 files, avg 277KB/file, + archive=/home/j2/tcp.tar, extract to /mnt/a/tar/tcptmp +program operation real user system %CPU speed +bsdtar create 182.171 1.692 29.130 16.91 11584 KB/s +gnutar create 174.999 0.632 27.450 16.04 12059 KB/s +star create 180.004 0.360 41.795 23.41 11677 KB/s + +bsdtar list 0.214 0.076 0.136 99.04 9822294 KB/s +gnutar list 0.210 0.076 0.136 100.00 10009385 KB/s +star list 43.462 0.148 18.109 42.00 48363 KB/s + +bsdtar extract 94.912 4.476 31.574 37.98 22146 KB/s +gnutar extract 94.657 0.396 29.462 31.54 22206 KB/s +star extract 100.814 0.400 39.906 39.98 20849 KB/s + +bsdtar compare 0.003 0.000 0.004 100.00 700657000 KB/s +gnutar compare 80.174 3.932 20.365 30.30 26217 KB/s +star compare 73.911 8.341 27.670 48.72 28439 KB/s diff --git a/libarchive/libarchive-2.5.5/contrib/psota-benchmark/tcp.sh b/libarchive/libarchive-2.5.5/contrib/psota-benchmark/tcp.sh new file mode 100644 index 0000000..6c0e4b5 --- /dev/null +++ b/libarchive/libarchive-2.5.5/contrib/psota-benchmark/tcp.sh @@ -0,0 +1,104 @@ +#!/bin/sh +# tar comparision program +# 2007-10-25 Jan Psota + +n=3 # number of repetitions +TAR=(bsdtar gnutar star) # TApeArchivers to compare +OPT=("" "--seek" "-no-fsync") +pax="--format=pax" # comment out for defaults +OPN=(create list extract compare) # operations +version="2007-10-25" +TIMEFORMAT=$'%R\t%U\t%S\t%P' +LC_ALL=C + +test $# -ge 2 || { + echo -e "usage:\t$0 source_dir where_to_place_archive +[where_to_extract_it] + +TCP, version $version +TCP stands for Tar Comparision Program here. +It currently compares: BSD tar (bsdtar), GNU tar (gnutar) and star in archive +creation, listing, extraction and archive-to-extracted comparision. +Tcp prints out best time of n=$n repetitions. + +Tcp creates temporary archive named tcp.tar with $pax and some native +(--seek/-no-fsync) options and extracts it to [\$3]/tcptmp/. +If unset, third argument defaults to [\$2]. +After normal exit tcp removes tarball and extracted files. +Tcp does not check filesystems destination directories are on for free space, +so make sure there is enough space (a bit more than source_dir uses) for both: +archive and extracted files. +Do not use white space in arguments. + Jan Psota, $version" + exit 0 +} +src=$1 +dst=$2/tcp.tar +dst_path=${3:-$2}/tcptmp +test -e $dst -o -e /tmp/tcp \ + && { echo "$dst or /tmp/tcp exists, exiting"; exit 1; } +mkdir $dst_path || exit 2 + +use_times () +{ + awk -F"\t" -vN=$n -vL="`du -k $dst`" -vOFS="\t" -vORS="" ' + { if (NF==4) { printf "\t%s\t%10.1d KB/s\n", $0, ($1+0>0 ? +(L+0)/($1+0) : 0) } }' \ + /tmp/tcp | sort | head -1 + > /tmp/tcp +} + +test -d $src || { echo "'$src' is not a directory"; exit 3; } + +# system information: type, release, memory, cpu(s), compiler and flags +echo -e "TCP, version $version\n"`uname -sr`" / "`head -1 /etc/*-release` +free -m | awk '/^Mem/ { printf "%dMB of memory, ", $2 }' +test -e /proc/cpuinfo \ + && awk -F: '/name|cache size|MHz|mips/ { if (!a) b=b $2 } + /^$/ { a++ } END { print a" x"b" bmips" }' /proc/cpuinfo +test -e /etc/gentoo-release \ + && gcc --version | head -1 && grep ^CFLAGS /etc/make.conf + +# tar versions +echo +for tar in [EMAIL PROTECTED]; do echo -ne "$tar:\t"; $tar --version | head -1; +done + +echo -e "\nbest time of $n repetitions,\n"\ +" src=$src, "\ +`du -sh $src | awk '{print $1}'`" in "`find $src | wc -l`" files, "\ +"avg "$((`du -sk $src | awk '{print $1}'`/`find $src -type f | wc +-l`))"KB/file,\n"\ +" archive=$dst, extract to $dst_path" + +echo -e "program\toperation\treal\tuser\tsystem\t%CPU\t speed" +> /tmp/tcp +let op_num=0 +for op in "cf $dst $pax -C $src ." "tf $dst" "xf $dst -C $dst_path" \ + "f $dst -C $dst_path --diff"; do + let tar_num=0 + for tar in [EMAIL PROTECTED]; do + echo -en "$tar\t${OPN[op_num]}\t" + for ((i=1; i<=$n; i++)); do + echo $op | grep -q ^cf && rm -f $dst + echo $op | grep -q ^xf && + { chmod -R u+w $dst_path + rm -rf $dst_path; mkdir $dst_path; } + sync + if echo $op | grep -q ^f; then # op == compare + time $tar $op ${OPT[$tar_num]} > /dev/null + else # op in (create | list | extract) + time $tar $op ${OPT[$tar_num]} > /dev/null \ + || break 3 + fi 2>> /tmp/tcp + done + use_times + let tar_num++ + done + let op_num++ + echo +done +rm -rf $dst_path $dst +echo +cat /tmp/tcp +rm -f /tmp/tcp diff --git a/libarchive/libarchive-2.4.17/cpio/bsdcpio.1 b/libarchive/libarchive-2.5.5/cpio/bsdcpio.1 index 70889df..d4a1857 100644 --- a/libarchive/libarchive-2.4.17/cpio/bsdcpio.1 +++ b/libarchive/libarchive-2.5.5/cpio/bsdcpio.1 @@ -59,8 +59,8 @@ is a mode indicator from the following list: .Bl -tag -compact -width indent .It Fl i Input. -Read an archive from standard input and extract the contents to disk or -(if the +Read an archive from standard input (unless overriden) and extract the +contents to disk or (if the .Fl t option is specified) list the contents to standard output. @@ -69,7 +69,7 @@ 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. +on standard output (unless overriden) containing the specified items. .It Fl p Pass-through. Read a list of filenames from standard input and copy the files to the @@ -80,12 +80,21 @@ specified directory. Unless specifically stated otherwise, options are applicable in all operating modes. .Bl -tag -width indent +.It Fl A +(o mode only) +Append to the specified archive. +(Not yet implemented.) .It Fl a (o and p modes) Reset access times on files after they are read. .It Fl B (o mode only) Block output to records of 5120 bytes. +.It Fl C Ar size +(o mode only) +Block output to records of +.Ar size +bytes. .It Fl c (o mode only) Use the old POSIX portable character format. @@ -94,6 +103,14 @@ Equivalent to .It Fl d (i and p modes) Create directories as necessary. +.It Fl E Ar file +(i mode only) +Read list of file name patterns from +.Ar file +to list and extract. +.It Fl F Ar file +Read archive from or write archive to +.Ar file . .It Fl f Ar pattern (i mode only) Ignore files that match @@ -125,9 +142,18 @@ for more complete information about the formats currently supported by the underlying .Xr libarchive 3 library. +.It Fl I Ar file +Read archive from +.Ar file . .It Fl i Input mode. See above for description. +.It Fl -insecure +(i and p mode only) +Disable security checks during extraction or copying. +This allows extraction via symbolic links and path names containing +.Sq .. +in the name. .It Fl L (o and p modes) All symbolic links will be followed. @@ -141,6 +167,9 @@ instead of copying. (i and p modes) Set file modification time on created files to match those in the source. +.It Fl O Ar file +Write archive to +.Ar file . .It Fl o Output mode. See above for description. @@ -194,14 +223,17 @@ provide a detailed listing of each file. Print the program version information and exit. .It Fl y (o mode only) -Compress the archive with bzip2-compatible compression before -writing to stdout. +Compress the archive with bzip2-compatible compression before writing it. In input mode, this option is ignored; bzip2 compression is recognized automatically on input. +.It Fl Z +(o mode only) +Compress the archive with compress-compatible compression before writing it. +In input mode, this option is ignored; +compression is recognized automatically on input. .It Fl z (o mode only) -Compress the archive with gzip-compatible compression before writing -it to stdout. +Compress the archive with gzip-compatible compression before writing it. In input mode, this option is ignored; gzip compression is recognized automatically on input. .El diff --git a/libarchive/libarchive-2.4.17/cpio/cmdline.c b/libarchive/libarchive-2.5.5/cpio/cmdline.c index 8910569..a602e39 100644 --- a/libarchive/libarchive-2.4.17/cpio/cmdline.c +++ b/libarchive/libarchive-2.5.5/cpio/cmdline.c @@ -26,7 +26,7 @@ #include "cpio_platform.h" -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/usr.bin/cpio/cmdline.c,v 1.3 2008/06/21 02:20:20 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -66,7 +66,7 @@ struct option { */ -static const char *cpio_opts = "aBcdf:H:hijLlmopR:rtuvW:yz"; +static const char *cpio_opts = "0AaBC:F:O:cdE:f:H:hijLlmopR:rtuvW:yZz"; /* * On systems that lack getopt_long, long options can be specified @@ -82,10 +82,21 @@ static const char *cpio_opts = "aBcdf:H:hijLlmopR:rtuvW:yz"; * sorted, as the -W logic below relies on it. */ static const struct option cpio_longopts[] = { + { "create", no_argument, NULL, 'o' }, + { "extract", no_argument, NULL, 'i' }, + { "file", required_argument, NULL, 'F' }, { "format", required_argument, NULL, 'H' }, { "help", no_argument, NULL, 'h' }, + { "insecure", no_argument, NULL, OPTION_INSECURE }, + { "link", no_argument, NULL, 'l' }, + { "list", no_argument, NULL, 't' }, + { "make-directories", no_argument, NULL, 'd' }, + { "null", no_argument, NULL, '0' }, { "owner", required_argument, NULL, 'R' }, + { "pass-through", no_argument, NULL, 'p' }, + { "preserve-modification-time", no_argument, NULL, 'm' }, { "quiet", no_argument, NULL, OPTION_QUIET }, + { "unconditional", no_argument, NULL, 'u' }, { "verbose", no_argument, NULL, 'v' }, { "version", no_argument, NULL, OPTION_VERSION }, { NULL, 0, NULL, 0 } diff --git a/libarchive/libarchive-2.4.17/cpio/cpio.c b/libarchive/libarchive-2.5.5/cpio/cpio.c index 9f24d9c..76a91cf 100644 --- a/libarchive/libarchive-2.4.17/cpio/cpio.c +++ b/libarchive/libarchive-2.5.5/cpio/cpio.c @@ -26,7 +26,7 @@ #include "cpio_platform.h" -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/usr.bin/cpio/cpio.c,v 1.4 2008/06/24 15:18:40 kientzle Exp $"); #include <sys/types.h> #include <archive.h> @@ -60,23 +60,22 @@ __FBSDID("$FreeBSD$"); static int copy_data(struct archive *, struct archive *); static const char *cpio_rename(const char *name); -static int file_to_archive(struct cpio *, const char *, const char *); +static int entry_to_archive(struct cpio *, struct archive_entry *); +static int file_to_archive(struct cpio *, const char *); static void long_help(void); static void mode_in(struct cpio *); static void mode_list(struct cpio *); static void mode_out(struct cpio *); 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 *); +static void version(void); int main(int argc, char *argv[]) { + static char buff[16384]; struct cpio _cpio; /* Allocated on stack. */ struct cpio *cpio; int uid, gid; @@ -84,6 +83,8 @@ main(int argc, char *argv[]) cpio = &_cpio; memset(cpio, 0, sizeof(*cpio)); + cpio->buff = buff; + cpio->buff_size = sizeof(buff); /* Need cpio_progname before calling cpio_warnc. */ if (*argv == NULL) @@ -100,6 +101,7 @@ main(int argc, char *argv[]) cpio->gid_override = -1; cpio->argv = argv; cpio->argc = argc; + cpio->line_separator = '\n'; cpio->mode = '\0'; cpio->verbose = 0; cpio->compress = '\0'; @@ -107,37 +109,63 @@ main(int argc, char *argv[]) cpio->format = "odc"; /* Default format */ cpio->extract_flags = ARCHIVE_EXTRACT_NO_AUTODIR; cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; + cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; + cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; /* TODO: If run by root, set owner as well. */ cpio->bytes_per_block = 512; cpio->filename = NULL; while ((opt = cpio_getopt(cpio)) != -1) { switch (opt) { + case '0': /* GNU convention: --null, -0 */ + cpio->line_separator = '\0'; + break; + case 'A': /* NetBSD/OpenBSD */ + cpio->option_append = 1; + break; case 'a': /* POSIX 1997 */ cpio->option_atime_restore = 1; break; case 'B': /* POSIX 1997 */ cpio->bytes_per_block = 5120; break; + case 'C': /* NetBSD/OpenBSD */ + cpio->bytes_per_block = atoi(optarg); + if (cpio->bytes_per_block <= 0) + cpio_errc(1, 0, "Invalid blocksize %s", optarg); + break; case 'c': /* POSIX 1997 */ cpio->format = "odc"; break; case 'd': /* POSIX 1997 */ cpio->extract_flags &= ~ARCHIVE_EXTRACT_NO_AUTODIR; break; + case 'E': /* NetBSD/OpenBSD */ + include_from_file(cpio, optarg); + break; + case 'F': /* NetBSD/OpenBSD/GNU cpio */ + cpio->filename = optarg; + break; case 'f': /* POSIX 1997 */ exclude(cpio, optarg); break; - case 'H': /* GNU cpio, also --format */ + case 'H': /* GNU cpio (also --format) */ cpio->format = optarg; break; case 'h': long_help(); break; + case 'I': /* NetBSD/OpenBSD */ + cpio->filename = optarg; + break; case 'i': /* POSIX 1997 */ cpio->mode = opt; break; - case 'L': /* GNU cpio, BSD convention */ + case OPTION_INSECURE: + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; + break; + case 'L': /* GNU cpio */ cpio->option_follow_links = 1; break; case 'l': /* POSIX 1997 */ @@ -146,11 +174,15 @@ main(int argc, char *argv[]) case 'm': /* POSIX 1997 */ cpio->extract_flags |= ARCHIVE_EXTRACT_TIME; break; + case 'O': /* GNU cpio */ + cpio->filename = optarg; + break; case 'o': /* POSIX 1997 */ cpio->mode = opt; break; case 'p': /* POSIX 1997 */ cpio->mode = opt; + cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; break; case OPTION_QUIET: /* GNU cpio */ cpio->quiet = 1; @@ -177,7 +209,7 @@ main(int argc, char *argv[]) cpio->verbose++; break; case OPTION_VERSION: /* GNU convention */ - version(stdout); + version(); break; #if 0 /* @@ -190,6 +222,9 @@ main(int argc, char *argv[]) case 'y': /* tar convention */ cpio->compress = opt; break; + case 'Z': /* tar convention */ + cpio->compress = opt; + break; case 'z': /* tar convention */ cpio->compress = opt; break; @@ -296,24 +331,29 @@ long_help(void) } else putchar(*p); } - version(stdout); + version(); } static void -version(FILE *out) +version(void) { - fprintf(out,"bsdcpio %s -- %s\n", + fprintf(stdout,"bsdcpio %s -- %s\n", BSDCPIO_VERSION_STRING, archive_version()); - exit(1); + exit(0); } static void mode_out(struct cpio *cpio) { unsigned long blocks; + struct archive_entry *entry, *spare; + struct line_reader *lr; + const char *p; int r; + if (cpio->option_append) + cpio_errc(1, 0, "Append mode not yet supported."); cpio->archive = archive_write_new(); if (cpio->archive == NULL) cpio_errc(1, 0, "Failed to allocate archive object"); @@ -324,6 +364,9 @@ mode_out(struct cpio *cpio) case 'z': archive_write_set_compression_gzip(cpio->archive); break; + case 'Z': + archive_write_set_compression_compress(cpio->archive); + break; default: archive_write_set_compression_none(cpio->archive); break; @@ -333,11 +376,29 @@ mode_out(struct cpio *cpio) cpio_errc(1, 0, archive_error_string(cpio->archive)); archive_write_set_bytes_per_block(cpio->archive, cpio->bytes_per_block); cpio->linkresolver = archive_entry_linkresolver_new(); + archive_entry_linkresolver_set_strategy(cpio->linkresolver, + archive_format(cpio->archive)); r = archive_write_open_file(cpio->archive, cpio->filename); if (r != ARCHIVE_OK) cpio_errc(1, 0, archive_error_string(cpio->archive)); - process_lines(cpio, "-", out_file); + lr = process_lines_init("-", cpio->line_separator); + while ((p = process_lines_next(lr)) != NULL) + file_to_archive(cpio, p); + process_lines_free(lr); + + /* + * The hardlink detection may have queued up a couple of entries + * that can now be flushed. + */ + entry = NULL; + archive_entry_linkify(cpio->linkresolver, &entry, &spare); + while (entry != NULL) { + entry_to_archive(cpio, entry); + archive_entry_free(entry); + entry = NULL; + archive_entry_linkify(cpio->linkresolver, &entry, &spare); + } r = archive_write_close(cpio->archive); if (r != ARCHIVE_OK) @@ -352,93 +413,164 @@ mode_out(struct cpio *cpio) archive_write_finish(cpio->archive); } -static int -out_file(struct cpio *cpio, const char *path) -{ - const char *destpath; - - if (cpio->option_rename) - destpath = cpio_rename(path); - else - destpath = path; - if (destpath == NULL) - return (0); - return (file_to_archive(cpio, path, destpath)); -} - /* * This is used by both out mode (to copy objects from disk into * an archive) and pass mode (to copy objects from disk to * an archive_write_disk "archive"). */ static int -file_to_archive(struct cpio *cpio, const char *srcpath, const char *destpath) +file_to_archive(struct cpio *cpio, const char *srcpath) { - static char buff[16384]; struct stat st; - struct archive_entry *entry; - const char *linkname; - int fd = -1; - ssize_t len; + const char *destpath; + struct archive_entry *entry, *spare; + size_t len; + const char *p; + int lnklen; int r; - if (cpio->verbose) - fprintf(stderr,"%s", destpath); - + /* + * Create an archive_entry describing the source file. + */ entry = archive_entry_new(); if (entry == NULL) cpio_errc(1, 0, "Couldn't allocate entry"); - archive_entry_set_pathname(entry, destpath); - - /* TODO: pathname editing. */ + archive_entry_copy_sourcepath(entry, srcpath); + /* Get stat information. */ 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; + archive_entry_free(entry); + return (0); } - /* If we're trying to preserve hardlinks, match them here. */ - if (cpio->linkresolver != NULL - && st.st_nlink > 1 - && !S_ISDIR(st.st_mode)) { - linkname = archive_entry_linkresolve(cpio->linkresolver, entry); - archive_entry_set_hardlink(entry, linkname); - } + if (cpio->uid_override >= 0) + st.st_uid = cpio->uid_override; + if (cpio->gid_override >= 0) + st.st_gid = cpio->uid_override; + archive_entry_copy_stat(entry, &st); + /* If its a symlink, pull the target. */ if (S_ISLNK(st.st_mode)) { - int lnklen; - - lnklen = readlink(srcpath, buff, sizeof(buff)); + lnklen = readlink(srcpath, cpio->buff, cpio->buff_size); if (lnklen < 0) { cpio_warnc(errno, "%s: Couldn't read symbolic link", srcpath); - goto cleanup; + archive_entry_free(entry); + return (0); } - buff[lnklen] = 0; - archive_entry_set_symlink(entry, buff); + cpio->buff[lnklen] = 0; + archive_entry_set_symlink(entry, cpio->buff); } - if (cpio->uid_override >= 0) - st.st_uid = cpio->uid_override; - if (cpio->gid_override >= 0) - st.st_gid = cpio->uid_override; - archive_entry_copy_stat(entry, &st); + /* + * Generate a destination path for this entry. + * "destination path" is the name to which it will be copied in + * pass mode or the name that will go into the archive in + * output mode. + */ + destpath = srcpath; + if (cpio->destdir) { + len = strlen(cpio->destdir) + strlen(srcpath) + 8; + if (len >= cpio->pass_destpath_alloc) { + while (len >= cpio->pass_destpath_alloc) { + cpio->pass_destpath_alloc += 512; + cpio->pass_destpath_alloc *= 2; + } + free(cpio->pass_destpath); + cpio->pass_destpath = malloc(cpio->pass_destpath_alloc); + if (cpio->pass_destpath == NULL) + cpio_errc(1, ENOMEM, + "Can't allocate path buffer"); + } + strcpy(cpio->pass_destpath, cpio->destdir); + p = srcpath; + while (p[0] == '/') + ++p; + strcat(cpio->pass_destpath, p); + destpath = cpio->pass_destpath; + } + if (cpio->option_rename) + destpath = cpio_rename(destpath); + if (destpath == NULL) + return (0); + archive_entry_copy_pathname(entry, destpath); - /* Obviously, this only gets invoked in pass mode. */ - if (cpio->option_link) { - /* Note: link(2) doesn't create parent directories. */ - archive_entry_set_hardlink(entry, srcpath); - r = archive_write_header(cpio->archive, entry); - if (r == ARCHIVE_OK) - return (0); - cpio_warnc(archive_errno(cpio->archive), - archive_error_string(cpio->archive)); + /* + * If we're trying to preserve hardlinks, match them here. + */ + spare = NULL; + if (cpio->linkresolver != NULL + && !S_ISDIR(st.st_mode)) { + archive_entry_linkify(cpio->linkresolver, &entry, &spare); + } + + if (entry != NULL) { + r = entry_to_archive(cpio, entry); + archive_entry_free(entry); + } + if (spare != NULL) { + if (r == 0) + r = entry_to_archive(cpio, spare); + archive_entry_free(spare); + } + return (r); +} + +static int +entry_to_archive(struct cpio *cpio, struct archive_entry *entry) +{ + const char *destpath = archive_entry_pathname(entry); + const char *srcpath = archive_entry_sourcepath(entry); + int fd = -1; + ssize_t bytes_read; + int r; + + /* Print out the destination name to the user. */ + if (cpio->verbose) + fprintf(stderr,"%s", destpath); + + /* + * Option_link only makes sense in pass mode and for + * regular files. Also note: if a link operation fails + * because of cross-device restrictions, we'll fall back + * to copy mode for that entry. + * + * TODO: Test other cpio implementations to see if they + * hard-link anything other than regular files here. + */ + if (cpio->option_link + && archive_entry_filetype(entry) == AE_IFREG) + { + struct archive_entry *t; + /* Save the original entry in case we need it later. */ + t = archive_entry_clone(entry); + if (t == NULL) + cpio_errc(1, ENOMEM, "Can't create link"); + /* Note: link(2) doesn't create parent directories, + * so we use archive_write_header() instead as a + * convenience. */ + archive_entry_set_hardlink(t, srcpath); + /* This is a straight link that carries no data. */ + archive_entry_set_size(t, 0); + r = archive_write_header(cpio->archive, t); + archive_entry_free(t); + if (r != ARCHIVE_OK) + cpio_warnc(archive_errno(cpio->archive), + archive_error_string(cpio->archive)); if (r == ARCHIVE_FATAL) exit(1); +#ifdef EXDEV + if (r != ARCHIVE_OK && archive_errno(cpio->archive) == EXDEV) { + /* Cross-device link: Just fall through and use + * the original entry to copy the file over. */ + cpio_warnc(0, "Copying file instead"); + } else +#endif return (0); } @@ -446,17 +578,18 @@ file_to_archive(struct cpio *cpio, const char *srcpath, const char *destpath) * Make sure we can open the file (if necessary) before * trying to write the header. */ - if (S_ISREG(st.st_mode) && st.st_size > 0) { - fd = open(srcpath, O_RDONLY); - if (fd < 0) { - cpio_warnc(errno, - "%s: could not open file", srcpath); - goto cleanup; + if (archive_entry_filetype(entry) == AE_IFREG) { + if (archive_entry_size(entry) > 0) { + fd = open(srcpath, O_RDONLY); + if (fd < 0) { + cpio_warnc(errno, + "%s: could not open file", srcpath); + goto cleanup; + } } - } - - if (!S_ISREG(st.st_mode)) + } else { archive_entry_set_size(entry, 0); + } r = archive_write_header(cpio->archive, entry); @@ -469,19 +602,19 @@ file_to_archive(struct cpio *cpio, const char *srcpath, const char *destpath) if (r == ARCHIVE_FATAL) exit(1); - if (r >= ARCHIVE_WARN && fd >= 0 && archive_entry_size(entry) > 0) { - fd = open(srcpath, O_RDONLY); - len = read(fd, buff, sizeof(buff)); - while (len > 0) { - r = archive_write_data(cpio->archive, buff, len); + if (r >= ARCHIVE_WARN && fd >= 0) { + bytes_read = read(fd, cpio->buff, cpio->buff_size); + while (bytes_read > 0) { + r = archive_write_data(cpio->archive, + cpio->buff, bytes_read); if (r < 0) cpio_errc(1, archive_errno(cpio->archive), archive_error_string(cpio->archive)); - if (r < len) { + if (r < bytes_read) { cpio_warnc(0, "Truncated write; file may have grown while being archived."); } - len = read(fd, buff, sizeof(buff)); + bytes_read = read(fd, cpio->buff, cpio->buff_size); } } @@ -492,9 +625,6 @@ cleanup: fprintf(stderr,"\n"); if (fd >= 0) close(fd); - if (entry != NULL) - archive_entry_free(entry); - return (0); } @@ -695,49 +825,18 @@ mode_list(struct cpio *cpio) exit(0); } -/* - * TODO: Fix hardlink handling. - */ -static int -pass_file(struct cpio *cpio, const char *pathname) -{ - size_t len; - const char *destpath; - - len = strlen(cpio->pass_destdir) + strlen(pathname) + 8; - if (len >= cpio->pass_destpath_alloc) { - while (len >= cpio->pass_destpath_alloc) { - cpio->pass_destpath_alloc += 512; - cpio->pass_destpath_alloc *= 2; - } - free(cpio->pass_destpath); - cpio->pass_destpath = malloc(cpio->pass_destpath_alloc); - if (cpio->pass_destpath == NULL) - cpio_errc(1, ENOMEM, - "Can't allocate path buffer"); - } - if (pathname[0] == '/') - pathname++; - strcpy(cpio->pass_destpath, cpio->pass_destdir); - strcat(cpio->pass_destpath, pathname); - destpath = cpio->pass_destpath; - if (cpio->option_rename) - destpath = cpio_rename(destpath); - if (destpath != NULL) - file_to_archive(cpio, pathname, destpath); - return (0); -} - static void mode_pass(struct cpio *cpio, const char *destdir) { + struct line_reader *lr; + const char *p; int r; /* Ensure target dir has a trailing '/' to simplify path surgery. */ - cpio->pass_destdir = malloc(strlen(destdir) + 8); - strcpy(cpio->pass_destdir, destdir); + cpio->destdir = malloc(strlen(destdir) + 8); + strcpy(cpio->destdir, destdir); if (destdir[strlen(destdir) - 1] != '/') - strcat(cpio->pass_destdir, "/"); + strcat(cpio->destdir, "/"); cpio->archive = archive_write_disk_new(); if (cpio->archive == NULL) @@ -747,7 +846,10 @@ mode_pass(struct cpio *cpio, const char *destdir) cpio_errc(1, 0, archive_error_string(cpio->archive)); cpio->linkresolver = archive_entry_linkresolver_new(); archive_write_disk_set_standard_lookup(cpio->archive); - process_lines(cpio, "-", pass_file); + lr = process_lines_init("-", cpio->line_separator); + while ((p = process_lines_next(lr)) != NULL) + file_to_archive(cpio, p); + process_lines_free(lr); archive_entry_linkresolver_free(cpio->linkresolver); r = archive_write_close(cpio->archive); @@ -806,79 +908,119 @@ cpio_rename(const char *name) * terminated with newlines. * * This uses a self-sizing buffer to handle arbitrarily-long lines. - * If the "process" function returns non-zero for any line, this - * function will return non-zero after attempting to process all - * remaining lines. */ -static int -process_lines(struct cpio *cpio, const char *pathname, - int (*process)(struct cpio *, const char *)) -{ +struct line_reader { FILE *f; char *buff, *buff_end, *line_start, *line_end, *p; - size_t buff_length, bytes_read, bytes_wanted; + char *pathname; + size_t buff_length; int separator; int ret; +}; + +struct line_reader * +process_lines_init(const char *pathname, char separator) +{ + struct line_reader *lr; + + lr = calloc(1, sizeof(*lr)); + if (lr == NULL) + cpio_errc(1, ENOMEM, "Can't open %s", pathname); - separator = cpio->option_null ? '\0' : '\n'; - ret = 0; + lr->separator = separator; + lr->pathname = strdup(pathname); if (strcmp(pathname, "-") == 0) - f = stdin; + lr->f = stdin; else - f = fopen(pathname, "r"); - if (f == NULL) + lr->f = fopen(pathname, "r"); + if (lr->f == NULL) cpio_errc(1, errno, "Couldn't open %s", pathname); - buff_length = 8192; - buff = malloc(buff_length); - if (buff == NULL) + lr->buff_length = 8192; + lr->buff = malloc(lr->buff_length); + if (lr->buff == NULL) cpio_errc(1, ENOMEM, "Can't read %s", pathname); - line_start = line_end = buff_end = buff; + lr->line_start = lr->line_end = lr->buff_end = lr->buff; + + return (lr); +} + +const char * +process_lines_next(struct line_reader *lr) +{ + size_t bytes_wanted, bytes_read, new_buff_size; + char *line_start, *p; + for (;;) { - /* Get some more data into the buffer. */ - bytes_wanted = buff + buff_length - buff_end; - bytes_read = fread(buff_end, 1, bytes_wanted, f); - buff_end += bytes_read; - /* Process all complete lines in the buffer. */ - while (line_end < buff_end) { - if (*line_end == separator) { - *line_end = '\0'; - if ((*process)(cpio, line_start) != 0) - ret = -1; - line_start = line_end + 1; - line_end = line_start; + /* If there's a line in the buffer, return it immediately. */ + while (lr->line_end < lr->buff_end) { + if (*lr->line_end == lr->separator) { + *lr->line_end = '\0'; + line_start = lr->line_start; + lr->line_start = lr->line_end + 1; + lr->line_end = lr->line_start; + return (line_start); } else - line_end++; + lr->line_end++; } - if (feof(f)) - break; - if (ferror(f)) - cpio_errc(1, errno, "Can't read %s", pathname); - if (line_start > buff) { + + /* If we're at end-of-file, process the final data. */ + if (lr->f == NULL) { + /* If there's more text, return one last line. */ + if (lr->line_end > lr->line_start) { + *lr->line_end = '\0'; + line_start = lr->line_start; + lr->line_start = lr->line_end + 1; + lr->line_end = lr->line_start; + return (line_start); + } + /* Otherwise, we're done. */ + return (NULL); + } + + /* Buffer only has part of a line. */ + if (lr->line_start > lr->buff) { /* Move a leftover fractional line to the beginning. */ - memmove(buff, line_start, buff_end - line_start); - buff_end -= line_start - buff; - line_end -= line_start - buff; - line_start = buff; + memmove(lr->buff, lr->line_start, + lr->buff_end - lr->line_start); + lr->buff_end -= lr->line_start - lr->buff; + lr->line_end -= lr->line_start - lr->buff; + lr->line_start = lr->buff; } else { /* Line is too big; enlarge the buffer. */ - p = realloc(buff, buff_length *= 2); + new_buff_size = lr->buff_length * 2; + if (new_buff_size <= lr->buff_length) + cpio_errc(1, ENOMEM, + "Line too long in %s", lr->pathname); + lr->buff_length = new_buff_size; + p = realloc(lr->buff, new_buff_size); if (p == NULL) cpio_errc(1, ENOMEM, - "Line too long in %s", pathname); - buff_end = p + (buff_end - buff); - line_end = p + (line_end - buff); - line_start = buff = p; + "Line too long in %s", lr->pathname); + lr->buff_end = p + (lr->buff_end - lr->buff); + lr->line_end = p + (lr->line_end - lr->buff); + lr->line_start = lr->buff = p; + } + + /* Get some more data into the buffer. */ + bytes_wanted = lr->buff + lr->buff_length - lr->buff_end; + bytes_read = fread(lr->buff_end, 1, bytes_wanted, lr->f); + lr->buff_end += bytes_read; + + if (ferror(lr->f)) + cpio_errc(1, errno, "Can't read %s", lr->pathname); + if (feof(lr->f)) { + if (lr->f != stdin) + fclose(lr->f); + lr->f = NULL; } } - /* At end-of-file, handle the final line. */ - if (line_end > line_start) { - *line_end = '\0'; - if ((*process)(cpio, line_start) != 0) - ret = -1; - } - free(buff); - if (f != stdin) - fclose(f); - return (ret); +} + +void +process_lines_free(struct line_reader *lr) +{ + free(lr->buff); + free(lr->pathname); + free(lr); } diff --git a/libarchive/libarchive-2.4.17/cpio/cpio.h b/libarchive/libarchive-2.5.5/cpio/cpio.h index a928d59..3afd952 100644 --- a/libarchive/libarchive-2.4.17/cpio/cpio.h +++ b/libarchive/libarchive-2.5.5/cpio/cpio.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$ + * $FreeBSD: src/usr.bin/cpio/cpio.h,v 1.2 2008/06/21 02:20:20 kientzle Exp $ */ #ifndef CPIO_H_INCLUDED @@ -53,13 +53,14 @@ struct cpio { int extract_flags; /* Flags for extract operation */ char symlink_mode; /* H or L, per BSD conventions */ const char *compress_program; + char line_separator; /* --null ? '\0' : '\n' */ + int option_append; /* -A, only relevant for -o */ int option_atime_restore; /* -a */ 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; + char *destdir; size_t pass_destpath_alloc; char *pass_destpath; int uid_override; @@ -75,7 +76,10 @@ struct cpio { int return_value; /* Value returned by main() */ struct archive_entry_linkresolver *linkresolver; + /* Work data. */ struct matching *matching; + char *buff; + size_t buff_size; }; /* Name of this program; used in error reporting, initialized in main(). */ @@ -89,10 +93,18 @@ int owner_parse(const char *, int *, int *); /* Fake short equivalents for long options that otherwise lack them. */ enum { - OPTION_QUIET = 1, + OPTION_INSECURE = 1, + OPTION_QUIET, OPTION_VERSION }; +struct line_reader; + +struct line_reader *process_lines_init(const char *, char separator); +const char *process_lines_next(struct line_reader *); +void process_lines_free(struct line_reader *); + int cpio_getopt(struct cpio *cpio); +int include_from_file(struct cpio *, const char *); #endif diff --git a/libarchive/libarchive-2.4.17/cpio/cpio_platform.h b/libarchive/libarchive-2.5.5/cpio/cpio_platform.h index 3145198..3145198 100644 --- a/libarchive/libarchive-2.4.17/cpio/cpio_platform.h +++ b/libarchive/libarchive-2.5.5/cpio/cpio_platform.h diff --git a/libarchive/libarchive-2.4.17/cpio/err.c b/libarchive/libarchive-2.5.5/cpio/err.c index ad9c0e1..ad9c0e1 100644 --- a/libarchive/libarchive-2.4.17/cpio/err.c +++ b/libarchive/libarchive-2.5.5/cpio/err.c diff --git a/libarchive/libarchive-2.4.17/cpio/matching.c b/libarchive/libarchive-2.5.5/cpio/matching.c index d949ea8..3e4ddc3 100644 --- a/libarchive/libarchive-2.4.17/cpio/matching.c +++ b/libarchive/libarchive-2.5.5/cpio/matching.c @@ -24,7 +24,7 @@ */ #include "cpio_platform.h" -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/usr.bin/cpio/matching.c,v 1.2 2008/06/21 02:20:20 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -104,13 +104,20 @@ include(struct cpio *cpio, const char *pattern) return (0); } -#if 0 int include_from_file(struct cpio *cpio, const char *pathname) { - return (process_lines(cpio, pathname, &include)); + struct line_reader *lr; + const char *p; + int ret = 0; + + lr = process_lines_init(pathname, '\n'); + while ((p = process_lines_next(lr)) != NULL) + if (include(cpio, p) != 0) + ret = -1; + process_lines_free(lr); + return (ret); } -#endif static void add_pattern(struct match **list, const char *pattern) diff --git a/libarchive/libarchive-2.4.17/cpio/matching.h b/libarchive/libarchive-2.5.5/cpio/matching.h index a66bc86..a66bc86 100644 --- a/libarchive/libarchive-2.4.17/cpio/matching.h +++ b/libarchive/libarchive-2.5.5/cpio/matching.h diff --git a/libarchive/libarchive-2.4.17/cpio/pathmatch.c b/libarchive/libarchive-2.5.5/cpio/pathmatch.c index d33bd34..d33bd34 100644 --- a/libarchive/libarchive-2.4.17/cpio/pathmatch.c +++ b/libarchive/libarchive-2.5.5/cpio/pathmatch.c diff --git a/libarchive/libarchive-2.4.17/cpio/pathmatch.h b/libarchive/libarchive-2.5.5/cpio/pathmatch.h index 990fa1f..990fa1f 100644 --- a/libarchive/libarchive-2.4.17/cpio/pathmatch.h +++ b/libarchive/libarchive-2.5.5/cpio/pathmatch.h diff --git a/libarchive/libarchive-2.4.17/cpio/test/list.h b/libarchive/libarchive-2.5.5/cpio/test/list.h index 9b0197c..42cc558 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/list.h +++ b/libarchive/libarchive-2.5.5/cpio/test/list.h @@ -1,3 +1,4 @@ +DEFINE_TEST(test_0) DEFINE_TEST(test_basic) DEFINE_TEST(test_format_newc) DEFINE_TEST(test_gcpio_compat) diff --git a/libarchive/libarchive-2.4.17/libarchive/test/main.c b/libarchive/libarchive-2.5.5/cpio/test/main.c index 2646598..e0f8c2e 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/main.c +++ b/libarchive/libarchive-2.5.5/cpio/test/main.c @@ -24,23 +24,27 @@ */ /* - * 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. + * Various utility routines useful for test programs. + * Each test program is linked against this file. */ -#define PROGRAM "LIBARCHIVE" +#include "test.h" #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.10 2008/02/19 05:52:30 kientzle Exp $"); +/* + * This same file is used pretty much verbatim for all test harnesses. + * + * The next few lines are the only differences. + */ +#define PROGRAM "bsdcpio" /* Name of program being tested. */ +#define ENVBASE "BSDCPIO" /* Prefix for environment variables. */ +#undef EXTRA_DUMP /* How to dump extra data */ +/* How to generate extra version info. */ +#define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "") +__FBSDID("$FreeBSD: src/usr.bin/cpio/test/main.c,v 1.2 2008/06/21 02:17:18 kientzle Exp $"); /* * "list.h" is simply created by "grep DEFINE_TEST"; it has @@ -51,7 +55,7 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.10 2008/02/19 05:52:30 ki * test functions. */ #undef DEFINE_TEST -#define DEFINE_TEST(name) void name(void); +#define DEFINE_TEST(name) void name(void); #include "list.h" /* Interix doesn't define these in a standard header. */ @@ -60,10 +64,14 @@ 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; +/* Enable core dump on failure. */ +static int dump_on_failure = 0; +/* Default is to remove temp dirs for successful tests. */ +static int keep_temp_files = 0; /* Default is to print some basic information about each test. */ static int quiet_flag = 0; +/* Default is to summarize repeated failures. */ +static int verbose = 0; /* Cumulative count of component failures. */ static int failures = 0; /* Cumulative count of skipped component tests. */ @@ -71,6 +79,9 @@ static int skips = 0; /* Cumulative count of assertions. */ static int assertions = 0; +/* Directory where uuencoded reference files can be found. */ +static char *refdir; + /* * My own implementation of the standard assert() macro emits the * message in the same format as GCC (file:line: message). @@ -90,7 +101,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; @@ -163,9 +174,13 @@ report_failure(void *extra) fprintf(stderr, " Description: %s\n", msg); msg[0] = '\0'; } - if (extra != NULL) { - fprintf(stderr, " archive error: %s\n", archive_error_string((struct archive *)extra)); - } + +#ifdef EXTRA_DUMP + if (extra != NULL) + fprintf(stderr, " detail: %s\n", EXTRA_DUMP(extra)); +#else + (void)extra; /* UNUSED */ +#endif if (dump_on_failure) { fprintf(stderr, @@ -232,7 +247,7 @@ test_assert(const char *file, int line, int value, const char *condition, void * return (value); } failures ++; - if (previous_failures(file, line)) + if (!verbose && previous_failures(file, line)) return (value); fprintf(stderr, "%s:%d: Assertion failed\n", file, line); fprintf(stderr, " Condition: %s\n", condition); @@ -241,27 +256,52 @@ test_assert(const char *file, int line, int value, const char *condition, void * } /* 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; + if (!verbose && previous_failures(file, line)) + 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); +} + +static void strdump(const char *p) +{ + if (p == NULL) { + fprintf(stderr, "(null)"); + return; + } + fprintf(stderr, "\""); + while (*p != '\0') { + unsigned int c = 0xff & *p++; + switch (c) { + case '\a': fprintf(stderr, "\a"); break; + case '\b': fprintf(stderr, "\b"); break; + case '\n': fprintf(stderr, "\n"); break; + case '\r': fprintf(stderr, "\r"); break; + default: + if (c >= 32 && c < 127) + fprintf(stderr, "%c", c); + else + fprintf(stderr, "\\x%02X", c); + } + } + fprintf(stderr, "\""); } /* 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, @@ -271,20 +311,25 @@ test_assert_equal_string(const char *file, int line, 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; + if (!verbose && previous_failures(file, line)) + 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); + fprintf(stderr, " %s = ", e1); + strdump(v1); + fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : strlen(v1)); + fprintf(stderr, " %s = ", e2); + strdump(v2); + fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : strlen(v2)); report_failure(extra); + return (0); } static void wcsdump(const wchar_t *w) @@ -309,7 +354,7 @@ static void wcsdump(const wchar_t *w) } /* 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, @@ -328,11 +373,11 @@ test_assert_equal_wstring(const char *file, int line, } } else if (wcscmp(v1, v2) == 0) { msg[0] = '\0'; - return; + return (1); } failures ++; - if (previous_failures(file, line)) - return; + if (!verbose && previous_failures(file, line)) + return (0); fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n", file, line); fprintf(stderr, " %s = ", e1); @@ -342,6 +387,7 @@ test_assert_equal_wstring(const char *file, int line, wcsdump(v2); fprintf(stderr, "\n"); report_failure(extra); + return (0); } /* @@ -361,7 +407,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 = ' '; } @@ -383,7 +429,7 @@ 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, @@ -393,15 +439,15 @@ test_assert_equal_mem(const char *file, int line, 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; + if (!verbose && previous_failures(file, line)) + return (0); fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n", file, line); fprintf(stderr, " size %s = %d\n", ld, (int)l); @@ -411,14 +457,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); @@ -427,16 +478,33 @@ 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); + return (0); + } + if (st.st_size == 0) + return (1); + + failures ++; + if (!verbose && 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]; @@ -458,16 +526,100 @@ 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 (!verbose && 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); +} + +int +test_assert_file_exists(const char *fpattern, ...) +{ + char f[1024]; + va_list ap; + + va_start(ap, fpattern); + vsprintf(f, fpattern, ap); + va_end(ap); + + if (!access(f, F_OK)) + return (1); + if (!previous_failures(test_filename, test_line)) { + fprintf(stderr, "%s:%d: File doesn't exist\n", + test_filename, test_line); + fprintf(stderr, " file=\"%s\"\n", f); + report_failure(test_extra); + } + return (0); +} + +int +test_assert_file_not_exists(const char *fpattern, ...) +{ + char f[1024]; + va_list ap; + + va_start(ap, fpattern); + vsprintf(f, fpattern, ap); + va_end(ap); + + if (access(f, F_OK)) + return (1); + if (!previous_failures(test_filename, test_line)) { + fprintf(stderr, "%s:%d: File exists and shouldn't\n", + test_filename, test_line); + fprintf(stderr, " file=\"%s\"\n", f); + 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); +} /* * Call standard system() call, but build up the command line using @@ -545,7 +697,7 @@ slurpfile(size_t * sizep, const char *fmt, ...) * We reuse it here to define a list of all tests (functions and names). */ #undef DEFINE_TEST -#define DEFINE_TEST(n) { n, #n }, +#define DEFINE_TEST(n) { n, #n }, struct { void (*func)(void); const char *name; } tests[] = { #include "list.h" }; @@ -560,8 +712,11 @@ static int test_run(int i, const char *tmpdir) { int failures_before = failures; - if (!quiet_flag) + if (!quiet_flag) { printf("%d: %s\n", i, tests[i].name); + fflush(stdout); + } + /* * Always explicitly chdir() in case the last test moved us to * a strange place. @@ -592,6 +747,12 @@ static int test_run(int i, const char *tmpdir) (*tests[i].func)(); /* Summarize the results of this test. */ summarize(); + /* If there were no failures, we can remove the work dir. */ + if (failures == failures_before) { + if (!keep_temp_files && chdir(tmpdir) == 0) { + systemf("rm -rf %s", tests[i].name); + } + } /* Return appropriate status. */ return (failures == failures_before ? 0 : 1); } @@ -605,17 +766,83 @@ static void usage(const char *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(" -d Dump core after any failure, for debugging.\n"); + printf(" -k Keep all temp files.\n"); + printf(" Default: temp files for successful tests deleted.\n"); +#ifdef PROGRAM + printf(" -p <path> Path to executable to be tested.\n"); + printf(" Default: path taken from " ENVBASE " environment variable.\n"); +#endif printf(" -q Quiet.\n"); printf(" -r <dir> Path to dir containing reference files.\n"); printf(" Default: Current directory.\n"); + printf(" -v Verbose.\n"); printf("Available tests:\n"); for (i = 0; i < limit; i++) printf(" %d: %s\n", i, tests[i].name); exit(1); } +#define UUDECODE(c) (((c) - 0x20) & 0x3f) + +void +extract_reference_file(const char *name) +{ + char buff[1024]; + FILE *in, *out; + + sprintf(buff, "%s/%s.uu", refdir, name); + in = fopen(buff, "r"); + failure("Couldn't open reference file %s", buff); + assert(in != NULL); + if (in == NULL) + return; + /* Read up to and including the 'begin' line. */ + for (;;) { + if (fgets(buff, sizeof(buff), in) == NULL) { + /* TODO: This is a failure. */ + return; + } + if (memcmp(buff, "begin ", 6) == 0) + break; + } + /* Now, decode the rest and write it. */ + /* Not a lot of error checking here; the input better be right. */ + out = fopen(name, "w"); + while (fgets(buff, sizeof(buff), in) != NULL) { + char *p = buff; + int bytes; + + if (memcmp(buff, "end", 3) == 0) + break; + + bytes = UUDECODE(*p++); + while (bytes > 0) { + int n = 0; + /* Write out 1-3 bytes from that. */ + if (bytes > 0) { + n = UUDECODE(*p++) << 18; + n |= UUDECODE(*p++) << 12; + fputc(n >> 16, out); + --bytes; + } + if (bytes > 0) { + n |= UUDECODE(*p++) << 6; + fputc((n >> 8) & 0xFF, out); + --bytes; + } + if (bytes > 0) { + n |= UUDECODE(*p++); + fputc(n & 0xFF, out); + --bytes; + } + } + } + fclose(out); + fclose(in); +} + + int main(int argc, char **argv) { static const int limit = sizeof(tests) / sizeof(tests[0]); @@ -637,16 +864,35 @@ int main(int argc, char **argv) ++p; } +#ifdef PROGRAM + /* Get the target program from environment, if available. */ + testprog = getenv(ENVBASE); +#endif + + /* Allow -d to be controlled through the environment. */ + if (getenv(ENVBASE "_DEBUG") != NULL) + dump_on_failure = 1; + /* Get the directory holding test files from environment. */ - refdir = getenv(PROGRAM "_TEST_FILES"); + refdir = getenv(ENVBASE "_TEST_FILES"); /* * Parse options. */ - while ((opt = getopt(argc, argv, "kqr:")) != -1) { + while ((opt = getopt(argc, argv, "dkp:qr:v")) != -1) { switch (opt) { + case 'd': + dump_on_failure = 1; + break; case 'k': - dump_on_failure = 0; + keep_temp_files = 1; + break; + case 'p': +#ifdef PROGRAM + testprog = optarg; +#else + usage(progname); +#endif break; case 'q': quiet_flag++; @@ -654,6 +900,9 @@ int main(int argc, char **argv) case 'r': refdir = optarg; break; + case 'v': + verbose = 1; + break; case '?': default: usage(progname); @@ -663,6 +912,14 @@ int main(int argc, char **argv) argv += optind; /* + * Sanity-check that our options make sense. + */ +#ifdef PROGRAM + if (testprog == NULL) + usage(progname); +#endif + + /* * 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. @@ -694,6 +951,7 @@ int main(int argc, char **argv) --p; *p = '\0'; } + systemf("rm %s/refdir", tmpdir); } /* @@ -702,7 +960,12 @@ int main(int argc, char **argv) if (!quiet_flag) { printf("Running tests in: %s\n", tmpdir); printf("Reference files will be read from: %s\n", refdir); - printf("Exercising %s\n", archive_version()); +#ifdef PROGRAM + printf("Running tests on: %s\n", testprog); +#endif + printf("Exercising: "); + fflush(stdout); + printf("%s\n", EXTRA_VERSION); } /* @@ -744,5 +1007,9 @@ int main(int argc, char **argv) free(refdir_alloc); + /* If the final tmpdir is empty, we can remove it. */ + /* This should be the usual case when all tests succeed. */ + rmdir(tmpdir); + return (tests_failed); } diff --git a/libarchive/libarchive-2.4.17/tar/test/test.h b/libarchive/libarchive-2.5.5/cpio/test/test.h index a19d44c..431d5d7 100644 --- a/libarchive/libarchive-2.4.17/tar/test/test.h +++ b/libarchive/libarchive-2.5.5/cpio/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/usr.bin/cpio/test/test.h,v 1.2 2008/06/21 02:17:18 kientzle Exp $ */ /* Every test program should #include "test.h" as the first thing. */ @@ -31,8 +31,19 @@ * 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 +#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 #include <dirent.h> #include <errno.h> @@ -41,27 +52,15 @@ #include <stdlib.h> #include <string.h> #include <sys/stat.h> +#ifndef _WIN32 #include <unistd.h> +#endif #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 */ @@ -99,6 +98,15 @@ /* Assert that a file is empty; supports printf-style arguments. */ #define assertEmptyFile \ test_setup(__FILE__, __LINE__);test_assert_empty_file +/* Assert that a file exists; supports printf-style arguments. */ +#define assertFileExists \ + test_setup(__FILE__, __LINE__);test_assert_file_exists +/* Assert that a file exists; supports printf-style arguments. */ +#define assertFileNotExists \ + test_setup(__FILE__, __LINE__);test_assert_file_not_exists +/* 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 @@ -113,13 +121,16 @@ 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 *, ...); +int test_assert_file_exists(const char *, ...); +int test_assert_file_not_exists(const char *, ...); /* Like sprintf, then system() */ int systemf(const char * fmt, ...); @@ -128,17 +139,12 @@ int systemf(const char * fmt, ...); /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */ char *slurpfile(size_t *, const char *fmt, ...); -/* - * Global vars - */ - -/* Directory holding reference files. */ -char *refdir; +/* Extracts named reference file to the current directory. */ +void extract_reference_file(const char *); /* - * Special interfaces for bsdtar test harness. + * Special interfaces for program test harness. */ /* Pathname of exe to be tested. */ char *testprog; - diff --git a/libarchive/libarchive-2.5.5/cpio/test/test_0.c b/libarchive/libarchive-2.5.5/cpio/test/test_0.c new file mode 100644 index 0000000..7a72af1 --- /dev/null +++ b/libarchive/libarchive-2.5.5/cpio/test/test_0.c @@ -0,0 +1,62 @@ +/*- + * 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 first test does basic sanity checks on the environment. For + * most of these, we just exit on failure. + */ + +DEFINE_TEST(test_0) +{ + struct stat st; + + failure("File %s does not exist?!", testprog); + if (!assertEqualInt(0, stat(testprog, &st))) + exit(1); + + failure("%s is not executable?!", testprog); + if (!assert((st.st_mode & 0111) != 0)) + exit(1); + + /* + * Try to succesfully run the program; this requires that + * we know some option that will succeed. + */ + if (0 == systemf("%s --version >/dev/null", testprog)) { + /* This worked. */ + } else if (0 == systemf("%s -W version >/dev/null", testprog)) { + /* This worked. */ + } else { + failure("Unable to successfully run any of the following:\n" + " * %s --version\n" + " * %s -W version\n", + testprog, testprog); + assert(0); + } + + /* TODO: Ensure that our reference files are available. */ +} diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_basic.c b/libarchive/libarchive-2.5.5/cpio/test/test_basic.c index 3a9982b..7f1fe6d 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_basic.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_basic.c @@ -25,36 +25,13 @@ #include "test.h" __FBSDID("$FreeBSD$"); - static void -basic_cpio(const char *target, const char *pack_options, const char *unpack_options) +verify_files(const char *target) { struct stat st, st2; char buff[128]; int r; - assertEqualInt(0, mkdir(target, 0775)); - - /* Use the cpio program to create an archive. */ - 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); - - /* Verify that nothing went to stderr. */ - assertEmptyFile("pack.err"); - - /* - * Use cpio to unpack the archive into another directory. - */ - 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 stderr. */ - assertEmptyFile("unpack.err"); - /* * Verify unpacked files. */ @@ -67,7 +44,7 @@ basic_cpio(const char *target, const char *pack_options, const char *unpack_opti assert(S_ISREG(st.st_mode)); assertEqualInt(0644, st.st_mode & 0777); assertEqualInt(10, st.st_size); - failure("file %s/file", target); + failure("file %s/file should have 2 links", target); assertEqualInt(2, st.st_nlink); } @@ -79,11 +56,12 @@ basic_cpio(const char *target, const char *pack_options, const char *unpack_opti assert(S_ISREG(st2.st_mode)); assertEqualInt(0644, st2.st_mode & 0777); assertEqualInt(10, st2.st_size); - failure("file %s/linkfile", target); + failure("file %s/linkfile should have 2 links", 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); + failure("%s/linkfile and %s/file should be hardlinked", + target, target); assertEqualInt(st.st_ino, st2.st_ino); } @@ -110,7 +88,72 @@ basic_cpio(const char *target, const char *pack_options, const char *unpack_opti assert(S_ISDIR(st.st_mode)); assertEqualInt(0775, st.st_mode & 0777); } +} + +static void +basic_cpio(const char *target, + const char *pack_options, + const char *unpack_options, + const char *se) +{ + int r; + + if (!assertEqualInt(0, mkdir(target, 0775))) + return; + + /* 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); + assertEqualInt(r, 0); + + chdir(target); + + /* Verify stderr. */ + failure("Expected: %s, options=%s", se, pack_options); + assertFileContents(se, strlen(se), "pack.err"); + + /* + * Use cpio to unpack the archive into another directory. + */ + r = systemf("%s -i %s< archive >unpack.out 2>unpack.err", + testprog, unpack_options); + failure("Error invoking %s -i %s", testprog, unpack_options); + assertEqualInt(r, 0); + + /* Verify stderr. */ + failure("Error invoking %s -i %s in dir %s", testprog, unpack_options, target); + assertFileContents(se, strlen(se), "unpack.err"); + + verify_files(target); + + chdir(".."); +} + +static void +passthrough(const char *target) +{ + int r; + + if (!assertEqualInt(0, mkdir(target, 0775))) + return; + + /* + * Use cpio passthrough mode to copy files to another directory. + */ + r = systemf("%s -p -W quiet %s <filelist >%s/stdout 2>%s/stderr", + testprog, target, target, target); + failure("Error invoking %s -p", testprog); + assertEqualInt(r, 0); + + chdir(target); + + /* Verify stderr. */ + failure("Error invoking %s -p in dir %s", + testprog, target); + assertEmptyFile("stderr"); + verify_files(target); chdir(".."); } @@ -149,11 +192,13 @@ DEFINE_TEST(test_basic) close(filelist); /* Archive/dearchive with a variety of options. */ - basic_cpio("copy", "", ""); - basic_cpio("copy_odc", "--format=odc", ""); - basic_cpio("copy_newc", "-H newc", ""); - basic_cpio("copy_cpio", "-H odc", ""); - basic_cpio("copy_ustar", "-H ustar", ""); + basic_cpio("copy", "", "", "1 block\n"); + basic_cpio("copy_odc", "--format=odc", "", "1 block\n"); + basic_cpio("copy_newc", "-H newc", "", "2 blocks\n"); + basic_cpio("copy_cpio", "-H odc", "", "1 block\n"); + basic_cpio("copy_ustar", "-H ustar", "", "7 blocks\n"); + /* Copy in one step using -p */ + passthrough("passthrough"); umask(oldumask); } diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_format_newc.c b/libarchive/libarchive-2.5.5/cpio/test/test_format_newc.c index 8d24ad5..0714bd4 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_format_newc.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_format_newc.c @@ -66,7 +66,7 @@ DEFINE_TEST(test_format_newc) int fd, list; int r; int devmajor, devminor, ino, gid; - time_t t, now; + time_t t, t2, now; char *p, *e; size_t s; mode_t oldmask; @@ -90,6 +90,9 @@ DEFINE_TEST(test_format_newc) assertEqualInt(0, link("file1", "hardlink")); assertEqualInt(9, write(list, "hardlink\n", 9)); + /* Another hardlink, but this one won't be archived. */ + assertEqualInt(0, link("file1", "hardlink2")); + /* "symlink" */ assertEqualInt(0, symlink("file1", "symlink")); assertEqualInt(8, write(list, "symlink\n", 8)); @@ -103,12 +106,13 @@ DEFINE_TEST(test_format_newc) /* Use the cpio program to create an archive. */ close(list); - r = systemf("%s -o --format=newc --quiet <list >newc.out 2>newc.err", + r = systemf("%s -o --format=newc <list >newc.out 2>newc.err", testprog); - assertEqualInt(r, 0); + if (!assertEqualInt(r, 0)) + return; /* Verify that nothing went to stderr. */ - assertEmptyFile("newc.err"); + assertFileContents("2 blocks\n", 9, "newc.err"); /* Verify that stdout is a well-formed cpio file in "newc" format. */ p = slurpfile(&s, "newc.out"); @@ -127,21 +131,16 @@ DEFINE_TEST(test_format_newc) 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 */ + assertEqualMem(e + 38, "00000003", 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 */ @@ -152,27 +151,6 @@ DEFINE_TEST(test_format_newc) /* 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 */ @@ -181,7 +159,9 @@ DEFINE_TEST(test_format_newc) 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 */ + t2 = from_hex(e + 46, 8); /* mtime */ + failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2); + assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000005", 8); /* File size */ assertEqualInt(devmajor, from_hex(e + 62, 8)); /* devmajor */ assertEqualInt(devminor, from_hex(e + 70, 8)); /* devminor */ @@ -201,7 +181,9 @@ DEFINE_TEST(test_format_newc) 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 */ + t2 = from_hex(e + 46, 8); /* mtime */ + failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2); + assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ assertEqualMem(e + 54, "00000000", 8); /* File size */ assertEqualInt(devmajor, from_hex(e + 62, 8)); /* devmajor */ assertEqualInt(devminor, from_hex(e + 70, 8)); /* devminor */ @@ -214,6 +196,31 @@ DEFINE_TEST(test_format_newc) /* TODO: Verify other types of entries. */ + /* Hardlink identical to "file1" */ + /* Since we only wrote two of the three links to this + * file, this link should get deferred by the hardlink logic. */ + assert(is_hex(e, 110)); + assertEqualMem(e + 0, "070701", 6); /* Magic */ + failure("If these aren't the same, then the hardlink detection failed to match them."); + 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, "00000003", 8); /* nlink */ + t2 = from_hex(e + 46, 8); /* mtime */ + failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2); + assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */ + 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)); + /* Last entry is end-of-archive marker. */ assert(is_hex(e, 110)); assertEqualMem(e + 0, "070701", 6); /* Magic */ diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat.c b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat.c index 32f4b6b..4c69abb 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat.c @@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$"); static void -unpack_test(const char *from, const char *options) +unpack_test(const char *from, const char *options, const char *se) { struct stat st, st2; char buff[128]; @@ -40,14 +40,15 @@ unpack_test(const char *from, const char *options) /* * Use cpio to unpack the sample archive */ - 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); + extract_reference_file(from); + r = systemf("%s -i %s < %s >unpack.out 2>unpack.err", + testprog, options, from); + failure("Error invoking %s -i %s < %s", + testprog, options, from); assertEqualInt(r, 0); /* Verify that nothing went to stderr. */ - assertEmptyFile("unpack.err"); + assertFileContents(se, strlen(se), "unpack.err"); /* * Verify unpacked files. @@ -117,10 +118,10 @@ DEFINE_TEST(test_gcpio_compat) oldumask = umask(0); /* Dearchive sample files with a variety of options. */ - unpack_test("test_gcpio_compat_ref.bin", ""); - unpack_test("test_gcpio_compat_ref.crc", ""); - unpack_test("test_gcpio_compat_ref.newc", ""); - unpack_test("test_gcpio_compat_ref.ustar", ""); + unpack_test("test_gcpio_compat_ref.bin", "", "1 block\n"); + unpack_test("test_gcpio_compat_ref.crc", "", "2 blocks\n"); + unpack_test("test_gcpio_compat_ref.newc", "", "2 blocks\n"); + unpack_test("test_gcpio_compat_ref.ustar", "", "7 blocks\n"); umask(oldumask); } diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.bin.uu b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.bin.uu index 745d8ab..745d8ab 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.bin.uu +++ b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.bin.uu diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.crc.uu b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.crc.uu index df8dde0..df8dde0 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.crc.uu +++ b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.crc.uu diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.newc.uu b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.newc.uu index 1e29ba9..1e29ba9 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.newc.uu +++ b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.newc.uu diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.ustar.uu b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.ustar.uu index 77989f4..77989f4 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_gcpio_compat_ref.ustar.uu +++ b/libarchive/libarchive-2.5.5/cpio/test/test_gcpio_compat_ref.ustar.uu diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_B.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_B.c index 1753318..8083882 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_B.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_B.c @@ -39,16 +39,16 @@ DEFINE_TEST(test_option_B) close(fd); /* Create an archive without -B; this should be 512 bytes. */ - r = systemf("echo file | %s -o --quiet > small.cpio 2>small.err", testprog); + r = systemf("echo file | %s -o > small.cpio 2>small.err", testprog); assertEqualInt(r, 0); - assertEmptyFile("small.err"); + assertFileContents("1 block\n", 8, "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 --quiet > large.cpio 2>large.err", testprog); + r = systemf("echo file | %s -oB > large.cpio 2>large.err", testprog); assertEqualInt(r, 0); - assertEmptyFile("large.err"); + assertFileContents("1 block\n", 8, "large.err"); assertEqualInt(0, stat("large.cpio", &st)); assertEqualInt(5120, st.st_size); } diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_L.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_L.c index 0f9ee5e..2d69ab6 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_L.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_L.c @@ -46,20 +46,22 @@ DEFINE_TEST(test_option_L) close(filelist); - r = systemf("cat filelist | %s -pd --quiet copy >copy.out 2>copy.err", testprog); + r = systemf("cat filelist | %s -pd 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); + r = systemf("cat filelist | %s -pd -L copy-L >copy-L.out 2>copy-L.err", testprog); assertEqualInt(r, 0); + assertEmptyFile("copy-L.out"); + assertEmptyFile("copy-L.err"); assertEqualInt(0, lstat("copy-L/symlink", &st)); - failure("-pL should dereference symlinks and turn them into files."); + failure("-pdL 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", testprog); + r = systemf("cat filelist | %s -o >archive.out 2>archive.err", testprog); + failure("Error invoking %s -o ", testprog); assertEqualInt(r, 0); assertEqualInt(0, mkdir("unpack", 0755)); @@ -69,8 +71,8 @@ DEFINE_TEST(test_option_L) 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", testprog); + r = systemf("cat filelist | %s -oL >archive-L.out 2>archive-L.err", testprog); + failure("Error invoking %s -oL", testprog); assertEqualInt(r, 0); assertEqualInt(0, mkdir("unpack-L", 0755)); diff --git a/libarchive/libarchive-2.5.5/cpio/test/test_option_a.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_a.c new file mode 100644 index 0000000..c063280 --- /dev/null +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_a.c @@ -0,0 +1,159 @@ +/*- + * Copyright (c) 2003-2008 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" +#include <utime.h> +__FBSDID("$FreeBSD$"); + +static struct { + const char *name; + time_t atime_sec; +} files[] = { + { "f0", 0 }, + { "f1", 0 }, + { "f2", 0 }, + { "f3", 0 }, + { "f4", 0 }, + { "f5", 0 } +}; + +/* + * Create a bunch of test files and record their atimes. + * For the atime preserve/change tests, the files must have + * atimes in the past. We can accomplish this by explicitly invoking + * utime() on platforms that support it or by simply sleeping + * for a second after creating the files. (Creating all of the files + * at once means we only need to sleep once.) + */ +static void +test_create(void) +{ + struct stat st; + struct utimbuf times; + static const int numfiles = sizeof(files) / sizeof(files[0]); + int i; + int fd; + + for (i = 0; i < numfiles; ++i) { + fd = open(files[i].name, 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)); + close(fd); + + /* If utime() isn't supported on your platform, just + * #ifdef this section out. Most of the test below is + * still valid. */ + memset(×, 0, sizeof(times)); + times.actime = 1; + times.modtime = 3; + assertEqualInt(0, utime(files[i].name, ×)); + + /* Record whatever atime the file ended up with. */ + /* If utime() is available, this should be 1, but there's + * no harm in being careful. */ + assertEqualInt(0, stat(files[i].name, &st)); + files[i].atime_sec = st.st_atime; + } + + /* Wait until the atime on the last file is actually in the past. */ + /* If utime() is supported above, there's no sleep here which + * makes the test faster. */ + while (files[numfiles - 1].atime_sec >= time(NULL)) + sleep(1); +} + +DEFINE_TEST(test_option_a) +{ + struct stat st; + int r; + int f; + char buff[64]; + + /* Create all of the test files. */ + test_create(); + + /* Sanity check; verify that atimes really do get modified. */ + f = open(files[0].name, O_RDONLY); + assertEqualInt(1, read(f,buff, 1)); + assertEqualInt(0, close(f)); + assertEqualInt(0, stat("f0", &st)); + if (st.st_atime == files[0].atime_sec) { + skipping("Cannot verify -a option\n" + " Your system appears to not support atime."); + } + else + { + /* + * If this disk is mounted noatime, then we can't + * verify correct operation without -a. + */ + + /* Copy the file without -a; should change the atime. */ + r = systemf("echo %s | %s -pd copy-no-a > copy-no-a.out 2>copy-no-a.err", files[1].name, testprog); + assertEqualInt(r, 0); + assertEmptyFile("copy-no-a.err"); + assertEmptyFile("copy-no-a.out"); + assertEqualInt(0, stat(files[1].name, &st)); + failure("Copying file without -a should have changed atime."); + assert(st.st_atime != files[1].atime_sec); + + /* Archive the file without -a; should change the atime. */ + r = systemf("echo %s | %s -o > archive-no-a.out 2>archive-no-a.err", files[2].name, testprog); + assertEqualInt(r, 0); + assertEmptyFile("copy-no-a.err"); + assertEqualInt(0, stat(files[2].name, &st)); + failure("Archiving file without -a should have changed atime."); + assert(st.st_atime != files[2].atime_sec); + } + + /* + * We can, of course, still verify that the atime is unchanged + * when using the -a option. + */ + + /* Copy the file with -a; should not change the atime. */ + r = systemf("echo %s | %s -pad copy-a > copy-a.out 2>copy-a.err", + files[3].name, testprog); + assertEqualInt(r, 0); + assertEmptyFile("copy-a.err"); + assertEmptyFile("copy-a.out"); + assertEqualInt(0, stat(files[3].name, &st)); + failure("Copying file with -a should not have changed atime."); + assertEqualInt(st.st_atime, files[3].atime_sec); + + /* Archive the file with -a; should not change the atime. */ + r = systemf("echo %s | %s -oa > archive-a.out 2>archive-a.err", + files[4].name, testprog); + assertEqualInt(r, 0); + assertEmptyFile("copy-a.err"); + assertEqualInt(0, stat(files[4].name, &st)); + failure("Archiving file with -a should not have changed atime."); + assertEqualInt(st.st_atime, files[4].atime_sec); +} diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_c.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_c.c index 7596ba9..05b48c2 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_c.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_c.c @@ -88,11 +88,14 @@ DEFINE_TEST(test_option_c) /* 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); - + r = systemf("%s -oc <filelist >basic.out 2>basic.err", testprog); /* Verify that nothing went to stderr. */ - assertEmptyFile("basic.err"); + assertFileContents("1 block\n", 8, "basic.err"); + + /* Assert that the program finished. */ + failure("%s -oc crashed", testprog); + if (!assertEqualInt(r, 0)) + return; /* Verify that stdout is a well-formed cpio file in "odc" format. */ p = slurpfile(&s, "basic.out"); diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_d.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_d.c index cc962cc..370c82a 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_d.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_d.c @@ -40,9 +40,9 @@ DEFINE_TEST(test_option_d) close(fd); /* Create an archive. */ - r = systemf("echo dir/file | %s -o --quiet > archive.cpio 2>archive.err", testprog); + r = systemf("echo dir/file | %s -o > archive.cpio 2>archive.err", testprog); assertEqualInt(r, 0); - assertEmptyFile("archive.err"); + assertFileContents("1 block\n", 8, "archive.err"); assertEqualInt(0, stat("archive.cpio", &st)); assertEqualInt(512, st.st_size); @@ -59,10 +59,10 @@ DEFINE_TEST(test_option_d) assertEqualInt(0, chdir("..")); assertEqualInt(0, mkdir("with-d", 0755)); assertEqualInt(0, chdir("with-d")); - r = systemf("%s -id --quiet < ../archive.cpio >out 2>err", testprog); + r = systemf("%s -id < ../archive.cpio >out 2>err", testprog); assertEqualInt(r, 0); assertEmptyFile("out"); - assertEmptyFile("err"); + assertFileContents("1 block\n", 8, "err"); /* And the file should be restored. */ assertEqualInt(0, stat("dir/file", &st)); } diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_ell.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_ell.c index caf2a80..36bb0ac 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_ell.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_ell.c @@ -47,7 +47,7 @@ DEFINE_TEST(test_option_ell) 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", + r = systemf("echo f | %s -pd copy >copy.out 2>copy.err", testprog); assertEqualInt(r, 0); @@ -56,7 +56,7 @@ DEFINE_TEST(test_option_ell) 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", + r = systemf("echo f | %s -pld link >link.out 2>link.err", testprog); assertEqualInt(r, 0); diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_f.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_f.c index c1fefd9..d1af912 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_f.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_f.c @@ -35,7 +35,8 @@ unpack(const char *dirname, const char *option) 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); + extract_reference_file("test_option_f.cpio"); + r = systemf("%s -i %s < test_option_f.cpio > copy-no-a.out 2>copy-no-a.err", testprog, option); assertEqualInt(0, r); assertEqualInt(0, chdir("..")); } diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_f.cpio.uu b/libarchive/libarchive-2.5.5/cpio/test/test_option_f.cpio.uu index 42c63c3..42c63c3 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_f.cpio.uu +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_f.cpio.uu diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_help.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_help.c index b9433a4..b9433a4 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_help.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_help.c diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_m.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_m.c index e43d259..d5bbad2 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_m.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_m.c @@ -40,7 +40,8 @@ DEFINE_TEST(test_option_m) /* Restored without -m, the result should have a current mtime. */ assertEqualInt(0, mkdir("without-m", 0755)); assertEqualInt(0, chdir("without-m")); - r = systemf("%s -i < %s/test_option_m.cpio >out 2>err", testprog, refdir); + extract_reference_file("test_option_m.cpio"); + r = systemf("%s -i < test_option_m.cpio >out 2>err", testprog); now = time(NULL); assertEqualInt(r, 0); assertEmptyFile("out"); @@ -54,7 +55,8 @@ DEFINE_TEST(test_option_m) assertEqualInt(0, chdir("..")); assertEqualInt(0, mkdir("with-m", 0755)); assertEqualInt(0, chdir("with-m")); - r = systemf("%s -im < %s/test_option_m.cpio >out 2>err", testprog, refdir); + extract_reference_file("test_option_m.cpio"); + r = systemf("%s -im < test_option_m.cpio >out 2>err", testprog); now = time(NULL); assertEqualInt(r, 0); assertEmptyFile("out"); diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_m.cpio.uu b/libarchive/libarchive-2.5.5/cpio/test/test_option_m.cpio.uu index 3d20023..3d20023 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_m.cpio.uu +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_m.cpio.uu diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_t.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_t.c index 1bb9934..c9cdd0b 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_t.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_t.c @@ -31,14 +31,17 @@ DEFINE_TEST(test_option_t) int r; /* 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); + extract_reference_file("test_option_t.cpio"); + r = systemf("%s -it < test_option_t.cpio >t.out 2>t.err", testprog); assertEqualInt(r, 0); assertFileContents("1 block\n", 8, "t.err"); - assertEqualFile("t.out", "%s/test_option_t.stdout", refdir); + extract_reference_file("test_option_t.stdout"); + assertEqualFile("t.out", "test_option_t.stdout"); /* 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); + r = systemf("%s -itv < test_option_t.cpio >tv.out 2>tv.err", testprog); assertEqualInt(r, 0); assertFileContents("1 block\n", 8, "tv.err"); - assertEqualFile("tv.out", "%s/test_option_tv.stdout", refdir); + extract_reference_file("test_option_tv.stdout"); + assertEqualFile("tv.out", "test_option_tv.stdout"); } diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_t.cpio.uu b/libarchive/libarchive-2.5.5/cpio/test/test_option_t.cpio.uu index 055fe74..055fe74 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_t.cpio.uu +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_t.cpio.uu diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_t.stdout.uu b/libarchive/libarchive-2.5.5/cpio/test/test_option_t.stdout.uu index 2457706..2457706 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_t.stdout.uu +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_t.stdout.uu diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_tv.stdout.uu b/libarchive/libarchive-2.5.5/cpio/test/test_option_tv.stdout.uu index baead3e..baead3e 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_tv.stdout.uu +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_tv.stdout.uu diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_u.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_u.c index b35719f..7abd7f0 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_u.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_u.c @@ -23,11 +23,12 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" +#include <utime.h> __FBSDID("$FreeBSD$"); DEFINE_TEST(test_option_u) { - struct timeval times[2]; + struct utimbuf times; char *p; size_t s; int fd; @@ -40,7 +41,7 @@ DEFINE_TEST(test_option_u) close(fd); /* Copy the file to the "copy" dir. */ - r = systemf("echo f | %s -pd --quiet copy >copy.out 2>copy.err", + r = systemf("echo f | %s -pd copy >copy.out 2>copy.err", testprog); assertEqualInt(r, 0); @@ -56,15 +57,13 @@ DEFINE_TEST(test_option_u) 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)); + memset(×, 0, sizeof(times)); + times.actime = 1; + times.modtime = 3; + assertEqualInt(0, utime("f", ×)); /* Copy the file to the "copy" dir. */ - r = systemf("echo f | %s -pd --quiet copy >copy.out 2>copy.err", + r = systemf("echo f | %s -pd copy >copy.out 2>copy.err", testprog); assertEqualInt(r, 0); @@ -74,7 +73,7 @@ DEFINE_TEST(test_option_u) 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", + r = systemf("echo f | %s -pud copy >copy.out 2>copy.err", testprog); assertEqualInt(r, 0); diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_version.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_version.c index 06df47a..95258eb 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_version.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_version.c @@ -30,13 +30,15 @@ __FBSDID("$FreeBSD$"); */ static void -verify(const char *q, size_t s) +verify(const char *p, size_t s) { + const char *q = p; + /* Version message should start with name of program, then space. */ - failure("version message too short"); + failure("version message too short:", p); if (!assert(s > 6)) return; - failure("Version message should begin with 'bsdcpio'"); + failure("Version message should begin with 'bsdcpio': %s", p); if (!assertEqualMem(q, "bsdcpio ", 8)) /* If we're not testing bsdcpio, don't keep going. */ return; @@ -47,14 +49,21 @@ verify(const char *q, size_t s) --s; } /* Version number terminated by space. */ + failure("Version: %s", p); assert(s > 1); + /* Skip a single trailing a,b,c, or d. */ + if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') + ++q; + failure("Version: %s", p); assert(*q == ' '); ++q; --s; /* Separator. */ + failure("Version: %s", p); assertEqualMem(q, "-- ", 3); q += 3; s -= 3; /* libarchive name and version number */ assert(s > 11); + failure("Version: %s", p); assertEqualMem(q, "libarchive ", 11); q += 11; s -= 11; /* Version number is a series of digits and periods. */ @@ -62,8 +71,12 @@ verify(const char *q, size_t s) ++q; --s; } + /* Skip a single trailing a,b,c, or d. */ + if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') + ++q; /* All terminated by a newline. */ assert(s >= 1); + failure("Version: %s", p); assertEqualMem(q, "\n", 1); } @@ -75,6 +88,14 @@ DEFINE_TEST(test_option_version) size_t s; r = systemf("%s --version >version.stdout 2>version.stderr", testprog); + if (r != 0) + r = systemf("%s -W version >version.stdout 2>version.stderr", + testprog); + failure("Unable to run either %s --version or %s -W version", + testprog, testprog); + if (!assert(r == 0)) + return; + /* --version should generate nothing to stderr. */ assertEmptyFile("version.stderr"); /* Verify format of version message. */ diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_y.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_y.c index 56852a8..56852a8 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_y.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_y.c diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_option_z.c b/libarchive/libarchive-2.5.5/cpio/test/test_option_z.c index 15337a4..15337a4 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_option_z.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_option_z.c diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_owner_parse.c b/libarchive/libarchive-2.5.5/cpio/test/test_owner_parse.c index 1adbce4..1adbce4 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_owner_parse.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_owner_parse.c diff --git a/libarchive/libarchive-2.4.17/cpio/test/test_pathmatch.c b/libarchive/libarchive-2.5.5/cpio/test/test_pathmatch.c index 83528c0..83528c0 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test_pathmatch.c +++ b/libarchive/libarchive-2.5.5/cpio/test/test_pathmatch.c diff --git a/libarchive/libarchive-2.4.17/doc/man/Makefile b/libarchive/libarchive-2.5.5/doc/man/Makefile index c33aac4..c33aac4 100644 --- a/libarchive/libarchive-2.4.17/doc/man/Makefile +++ b/libarchive/libarchive-2.5.5/doc/man/Makefile diff --git a/libarchive/libarchive-2.4.17/doc/man/archive_entry.3 b/libarchive/libarchive-2.5.5/doc/man/archive_entry.3 index a3548c2..994b474 100644 --- a/libarchive/libarchive-2.4.17/doc/man/archive_entry.3 +++ b/libarchive/libarchive-2.5.5/doc/man/archive_entry.3 @@ -1,4 +1,4 @@ -.TH archive_entry 3 "December 15, 2003" "" +.TH archive_entry 3 "May 12, 2008" "" .SH NAME \fBarchive_entry_acl_add_entry\fP, \fBarchive_entry_acl_add_entry_w\fP, @@ -12,12 +12,16 @@ \fBarchive_entry_atime_nsec\fP, \fBarchive_entry_clear\fP, \fBarchive_entry_clone\fP, +\fBarchive_entry_copy_fflags_text\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_link\fP, +\fBarchive_entry_copy_link_w\fP, \fBarchive_entry_copy_pathname_w\fP, +\fBarchive_entry_copy_sourcepath\fP, \fBarchive_entry_copy_stat\fP, \fBarchive_entry_copy_symlink\fP, \fBarchive_entry_copy_symlink_w\fP, @@ -65,6 +69,7 @@ \fBarchive_entry_set_uid\fP, \fBarchive_entry_set_uname\fP, \fBarchive_entry_size\fP, +\fBarchive_entry_sourcepath\fP, \fBarchive_entry_stat\fP, \fBarchive_entry_symlink\fP, \fBarchive_entry_uid\fP, @@ -75,16 +80,24 @@ .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"); +Fo archive_entry_acl_add_entry +Fa "struct archive_entry *" +Fa "int type" +Fa "int permset" +Fa "int tag" +Fa "int qual" +Fa "const char *name" +Fc \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"); +Fo archive_entry_acl_add_entry_w +Fa "struct archive_entry *" +Fa "int type" +Fa "int permset" +Fa "int tag" +Fa "int qual" +Fa "const wchar_t *name" +Fc \fIvoid\fP .RE .nh @@ -99,16 +112,26 @@ ("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"); +Fo archive_entry_acl_next +Fa "struct archive_entry *" +Fa "int want_type" +Fa "int *type" +Fa "int *permset" +Fa "int *tag" +Fa "int *qual" +Fa "const char **name" +Fc \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"); +Fo archive_entry_acl_next_w +Fa "struct archive_entry *" +Fa "int want_type" +Fa "int *type" +Fa "int *permset" +Fa "int *tag" +Fa "int *qual" +Fa "const wchar_t **name" +Fc \fIint\fP .RE .nh @@ -145,6 +168,12 @@ \fBarchive_entry_clone\fP .hy ("struct archive_entry *"); +\fIconst char * *\fP +.RE +.nh +\fBarchive_entry_copy_fflags_text_w\fP +.hy +("struct archive_entry *" "const char *"); \fIconst wchar_t *\fP .RE .nh @@ -178,6 +207,12 @@ \fIvoid\fP .RE .nh +\fBarchive_entry_copy_sourcepath\fP +.hy +("struct archive_entry *" "const char *"); +\fIvoid\fP +.RE +.nh \fBarchive_entry_copy_pathname_w\fP .hy ("struct archive_entry *" "const wchar_t *"); @@ -237,10 +272,11 @@ ("struct archive_entry *"); \fIvoid\fP .RE -.nh -\fBarchive_entry_fflags\fP -.hy -("struct archive_entry *" "unsigned long *set" "unsigned long *clear"); +Fo archive_entry_fflags +Fa "struct archive_entry *" +Fa "unsigned long *set" +Fa "unsigned long *clear" +Fc \fIconst char *\fP .RE .nh @@ -357,10 +393,11 @@ ("struct archive_entry *" "unsigned int"); \fIvoid\fP .RE -.nh -\fBarchive_entry_set_fflags\fP -.hy -("struct archive_entry *" "unsigned long set" "unsigned long clear"); +Fo archive_entry_set_fflags +Fa "struct archive_entry *" +Fa "unsigned long set" +Fa "unsigned long clear" +Fc \fIvoid\fP .RE .nh @@ -463,6 +500,12 @@ \fBarchive_entry_size\fP .hy ("struct archive_entry *"); +\fIconst char *\fP +.RE +.nh +\fBarchive_entry_sourcepath\fP +.hy +("struct archive_entry *"); \fIconst struct stat *\fP .RE .nh @@ -605,10 +648,15 @@ will be ignored. The canonical text format is a comma-separated list of flag names. The .nh +\fBarchive_entry_copy_fflags_text\fP +.hy +(); +and +.nh \fBarchive_entry_copy_fflags_text_w\fP .hy (); -function parses the provided text and sets the internal bitmap values. +functions parse 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 diff --git a/libarchive/libarchive-2.4.17/doc/man/archive_read.3 b/libarchive/libarchive-2.5.5/doc/man/archive_read.3 index 524c5a8..91908e8 100644 --- a/libarchive/libarchive-2.4.17/doc/man/archive_read.3 +++ b/libarchive/libarchive-2.5.5/doc/man/archive_read.3 @@ -26,6 +26,7 @@ \fBarchive_read_data_into_buffer\fP, \fBarchive_read_data_into_fd\fP, \fBarchive_read_extract\fP, +\fBarchive_read_extract2\fP, \fBarchive_read_extract_set_progress_callback\fP, \fBarchive_read_close\fP, \fBarchive_read_finish\fP @@ -71,10 +72,10 @@ ("struct archive *"); \fIint\fP .RE -.nh -\fBarchive_read_support_compression_program\fP -.hy -("struct archive *" "const char *cmd"); +Fo archive_read_support_compression_program +Fa "struct archive *" +Fa "const char *cmd" +Fc \fIint\fP .RE .nh @@ -113,16 +114,23 @@ ("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 *"); +Fo archive_read_open +Fa "struct archive *" +Fa "void *client_data" +Fa "archive_open_callback *" +Fa "archive_read_callback *" +Fa "archive_close_callback *" +Fc \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 *"); +Fo archive_read_open2 +Fa "struct archive *" +Fa "void *client_data" +Fa "archive_open_callback *" +Fa "archive_read_callback *" +Fa "archive_skip_callback *" +Fa "archive_close_callback *" +Fc \fIint\fP .RE .nh @@ -137,10 +145,11 @@ ("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"); +Fo archive_read_open_filename +Fa "struct archive *" +Fa "const char *filename" +Fa "size_t block_size" +Fc \fIint\fP .RE .nh @@ -161,10 +170,12 @@ ("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"); +Fo archive_read_data_block +Fa "struct archive *" +Fa "const void **buff" +Fa "size_t *len" +Fa "off_t *offset" +Fc \fIint\fP .RE .nh @@ -185,16 +196,25 @@ ("struct archive *" "int fd"); \fIint\fP .RE -.nh -\fBarchive_read_extract\fP -.hy -("struct archive *" "struct archive_entry *" "int flags"); +Fo archive_read_extract +Fa "struct archive *" +Fa "struct archive_entry *" +Fa "int flags" +Fc +\fIint\fP +.RE +Fo archive_read_extract2 +Fa "struct archive *src" +Fa "struct archive_entry *" +Fa "struct archive *dest" +Fc \fIvoid\fP .RE -.nh -\fBarchive_read_extract_set_progress_callback\fP -.hy -("struct archive *" "void (*func)(void *)" "void *user_data"); +Fo archive_read_extract_set_progress_callback +Fa "struct archive *" +Fa "void (*func)(void *)" +Fa "void *user_data" +Fc \fIint\fP .RE .nh @@ -225,22 +245,28 @@ Allocates and initializes a Tn struct archive object suitable for reading from an archive. .TP +Xo .nh \fBarchive_read_support_compression_all\fP .hy -(, .nh); +(,); +.nh \fBarchive_read_support_compression_bzip2\fP .hy -(, .nh); +(,); +.nh \fBarchive_read_support_compression_compress\fP .hy -(, .nh); +(,); +.nh \fBarchive_read_support_compression_gzip\fP .hy -(, .nh); +(,); +.nh \fBarchive_read_support_compression_none\fP .hy (); +Xc Enables auto-detection code and decompression support for the specified compression. Note that @@ -262,25 +288,32 @@ 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. .TP +Xo .nh \fBarchive_read_support_format_all\fP .hy -(, .nh); +(,); +.nh \fBarchive_read_support_format_cpio\fP .hy -(, .nh); +(,); +.nh \fBarchive_read_support_format_empty\fP .hy -(, .nh); +(,); +.nh \fBarchive_read_support_format_iso9660\fP .hy -(, .nh); -\fBarchive_read_support_format_tar,\fP +(,); +.nh +\fBarchive_read_support_format_tar\fP .hy -(.nh); +(,); +.nh \fBarchive_read_support_format_zip\fP .hy (); +Xc Enables support---including auto-detection code---for the specified archive format. For example, @@ -515,6 +548,35 @@ argument is passed unmodified to \fBarchive_write_disk_set_options\fP(3). .TP .nh +\fBarchive_read_extract2\fP +.hy +(); +This is another version of +.nh +\fBarchive_read_extract\fP +.hy +(); +that allows you to provide your own restore object. +In particular, this allows you to override the standard lookup functions +using +\fBarchive_write_disk_set_group_lookup\fP(3), +and +\fBarchive_write_disk_set_user_lookup\fP(3). +Note that +.nh +\fBarchive_read_extract2\fP +.hy +(); +does not accept a +\fIflags\fP +argument; you should use +.nh +\fBarchive_write_disk_set_options\fP +.hy +(); +to set the restore options yourself. +.TP +.nh \fBarchive_read_extract_set_progress_callback\fP .hy (); @@ -572,17 +634,19 @@ The callback functions must match the following prototypes: .IP \fItypedef ssize_t\fP .RE -.nh -\fBarchive_read_callback\fP -.hy -("struct archive *" "void *client_data" "const void **buffer"); +Fo archive_read_callback +Fa "struct archive *" +Fa "void *client_data" +Fa "const void **buffer" +Fc .IP \fItypedef int\fP .RE -.nh -\fBarchive_skip_callback\fP -.hy -("struct archive *" "void *client_data" "size_t request"); +Fo archive_skip_callback +Fa "struct archive *" +Fa "void *client_data" +Fa "size_t request" +Fc .IP \fItypedef int\fP .RE diff --git a/libarchive/libarchive-2.4.17/doc/man/archive_util.3 b/libarchive/libarchive-2.5.5/doc/man/archive_util.3 index e41c59f..6a9b7f5 100644 --- a/libarchive/libarchive-2.4.17/doc/man/archive_util.3 +++ b/libarchive/libarchive-2.5.5/doc/man/archive_util.3 @@ -63,10 +63,12 @@ ("struct archive *"); \fIvoid\fP .RE -.nh -\fBarchive_set_error\fP -.hy -("struct archive *" "int error_code" "const char *fmt" "..."); +Fo archive_set_error +Fa "struct archive *" +Fa "int error_code" +Fa "const char *fmt" +Fa "..." +Fc .SH DESCRIPTION These functions provide access to various information about the Tn struct archive diff --git a/libarchive/libarchive-2.4.17/doc/man/archive_write.3 b/libarchive/libarchive-2.5.5/doc/man/archive_write.3 index c4b9395..3c02d52 100644 --- a/libarchive/libarchive-2.4.17/doc/man/archive_write.3 +++ b/libarchive/libarchive-2.5.5/doc/man/archive_write.3 @@ -1,4 +1,4 @@ -.TH archive_write 3 "August 19, 2006" "" +.TH archive_write 3 "May 11, 2008" "" .SH NAME \fBarchive_write_new\fP, \fBarchive_write_set_format_cpio\fP, @@ -11,6 +11,7 @@ \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_compress\fP, \fBarchive_write_set_compression_gzip\fP, \fBarchive_write_set_compression_none\fP, \fBarchive_write_set_compression_program\fP, @@ -61,21 +62,27 @@ \fIint\fP .RE .nh -\fBarchive_write_set_compression_gzip\fP +\fBarchive_write_set_compression_compress\fP .hy ("struct archive *"); \fIint\fP .RE .nh -\fBarchive_write_set_compression_none\fP +\fBarchive_write_set_compression_gzip\fP .hy ("struct archive *"); \fIint\fP .RE .nh -\fBarchive_write_set_compression_program\fP +\fBarchive_write_set_compression_none\fP .hy -("struct archive *" "const char * cmd"); +("struct archive *"); +\fIint\fP +.RE +Fo archive_write_set_compression_program +Fa "struct archive *" +Fa "const char * cmd" +Fc \fIint\fP .RE .nh @@ -114,10 +121,13 @@ ("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 *"); +Fo archive_write_open +Fa "struct archive *" +Fa "void *client_data" +Fa "archive_open_callback *" +Fa "archive_write_callback *" +Fa "archive_close_callback *" +Fc \fIint\fP .RE .nh @@ -138,10 +148,12 @@ ("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"); +Fo archive_write_open_memory +Fa "struct archive *" +Fa "void *buffer" +Fa "size_t bufferSize" +Fa "size_t *outUsed" +Fc \fIint\fP .RE .nh @@ -242,25 +254,32 @@ functions, this function can be called after the archive is opened. Retrieve the currently-set value for last block size. A value of -1 here indicates that the library should use default values. .TP +Xo .nh \fBarchive_write_set_format_cpio\fP .hy -(, .nh); +(,); +.nh \fBarchive_write_set_format_pax\fP .hy -(, .nh); +(,); +.nh \fBarchive_write_set_format_pax_restricted\fP .hy -(, .nh); +(,); +.nh \fBarchive_write_set_format_shar\fP .hy -(, .nh); +(,); +.nh \fBarchive_write_set_format_shar_binary\fP .hy -(, .nh); +(,); +.nh \fBarchive_write_set_format_ustar\fP .hy (); +Xc Sets the format that will be used for the archive. The library can write POSIX octet-oriented cpio format archives, @@ -285,16 +304,24 @@ 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. .TP +Xo .nh \fBarchive_write_set_compression_bzip2\fP .hy -(, .nh); +(,); +.nh +\fBarchive_write_set_compression_compress\fP +.hy +(,); +.nh \fBarchive_write_set_compression_gzip\fP .hy -(, .nh); +(,); +.nh \fBarchive_write_set_compression_none\fP .hy (); +Xc The resulting archive will be compressed as specified. Note that the compressed output is always properly blocked. .TP @@ -538,10 +565,12 @@ to register an error code and message and return .IP \fItypedef ssize_t\fP .RE -.nh -\fBarchive_write_callback\fP -.hy -("struct archive *" "void *client_data" "void *buffer" "size_t length"); +Fo archive_write_callback +Fa "struct archive *" +Fa "void *client_data" +Fa "void *buffer" +Fa "size_t length" +Fc 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 diff --git a/libarchive/libarchive-2.4.17/doc/man/archive_write_disk.3 b/libarchive/libarchive-2.5.5/doc/man/archive_write_disk.3 index 4e81e1c..e48292d 100644 --- a/libarchive/libarchive-2.4.17/doc/man/archive_write_disk.3 +++ b/libarchive/libarchive-2.5.5/doc/man/archive_write_disk.3 @@ -35,10 +35,12 @@ ("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 *)"); +Fo archive_write_disk_set_group_lookup +Fa "struct archive *" +Fa "void *" +Fa "gid_t (*)(void *, const char *gname, gid_t gid)" +Fa "void (*cleanup)(void *)" +Fc \fIint\fP .RE .nh @@ -47,10 +49,12 @@ ("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 *)"); +Fo archive_write_disk_set_user_lookup +Fa "struct archive *" +Fa "void *" +Fa "uid_t (*)(void *, const char *uname, uid_t uid)" +Fa "void (*cleanup)(void *)" +Fc \fIint\fP .RE .nh @@ -206,13 +210,21 @@ Note that paths ending in \fI\& ..\fP always cause an error, regardless of this flag. .TP +\fBARCHIVE_EXTRACT_SPARSE\fP +Scan data for blocks of NUL bytes and try to recreate them with holes. +This results in sparse files, independent of whether the archive format +supports or uses them. +.TP +Xo .nh \fBarchive_write_disk_set_group_lookup\fP .hy -(, .nh); +(,); +.nh \fBarchive_write_disk_set_user_lookup\fP .hy (); +Xc The Tn struct archive_entry objects contain both names and ids that can be used to identify users diff --git a/libarchive/libarchive-2.4.17/doc/man/bsdcpio.1 b/libarchive/libarchive-2.5.5/doc/man/bsdcpio.1 index 26c5c1d..fa1bd72 100644 --- a/libarchive/libarchive-2.4.17/doc/man/bsdcpio.1 +++ b/libarchive/libarchive-2.5.5/doc/man/bsdcpio.1 @@ -33,8 +33,8 @@ is a mode indicator from the following list: .TP \fB\-i\fP Input. -Read an archive from standard input and extract the contents to disk or -(if the +Read an archive from standard input (unless overriden) and extract the +contents to disk or (if the \fB\-t\fP option is specified) list the contents to standard output. @@ -44,7 +44,7 @@ one of the patterns will be extracted. \fB\-o\fP Output. Read a list of filenames from standard input and produce a new archive -on standard output containing the specified items. +on standard output (unless overriden) containing the specified items. .TP \fB\-p\fP Pass-through. @@ -54,6 +54,11 @@ specified directory. Unless specifically stated otherwise, options are applicable in all operating modes. .TP +\fB\-A\fP +(o mode only) +Append to the specified archive. +(Not yet implemented.) +.TP \fB\-a\fP (o and p modes) Reset access times on files after they are read. @@ -62,6 +67,12 @@ Reset access times on files after they are read. (o mode only) Block output to records of 5120 bytes. .TP +\fB\-C\fP \fIsize\fP +(o mode only) +Block output to records of +\fIsize\fP +bytes. +.TP \fB\-c\fP (o mode only) Use the old POSIX portable character format. @@ -72,6 +83,16 @@ Equivalent to (i and p modes) Create directories as necessary. .TP +\fB\-E\fP \fIfile\fP +(i mode only) +Read list of file name patterns from +\fIfile\fP +to list and extract. +.TP +\fB\-F\fP \fIfile\fP +Read archive from or write archive to +\fIfile\fP. +.TP \fB\-f\fP \fIpattern\fP (i mode only) Ignore files that match @@ -106,10 +127,21 @@ formats currently supported by the underlying \fBlibarchive\fP(3) library. .TP +\fB\-I\fP \fIfile\fP +Read archive from +\fIfile\fP. +.TP \fB\-i\fP Input mode. See above for description. .TP +\fB\--insecure\fP +(i and p mode only) +Disable security checks during extraction or copying. +This allows extraction via symbolic links and path names containing +Sq .. +in the name. +.TP \fB\-L\fP (o and p modes) All symbolic links will be followed. @@ -126,6 +158,10 @@ instead of copying. Set file modification time on created files to match those in the source. .TP +\fB\-O\fP \fIfile\fP +Write archive to +\fIfile\fP. +.TP \fB\-o\fP Output mode. See above for description. @@ -188,15 +224,19 @@ Print the program version information and exit. .TP \fB\-y\fP (o mode only) -Compress the archive with bzip2-compatible compression before -writing to stdout. +Compress the archive with bzip2-compatible compression before writing it. In input mode, this option is ignored; bzip2 compression is recognized automatically on input. .TP +\fB\-Z\fP +(o mode only) +Compress the archive with compress-compatible compression before writing it. +In input mode, this option is ignored; +compression is recognized automatically on input. +.TP \fB\-z\fP (o mode only) -Compress the archive with gzip-compatible compression before writing -it to stdout. +Compress the archive with gzip-compatible compression before writing it. In input mode, this option is ignored; gzip compression is recognized automatically on input. .SH ENVIRONMENT diff --git a/libarchive/libarchive-2.4.17/doc/man/bsdtar.1 b/libarchive/libarchive-2.5.5/doc/man/bsdtar.1 index b0e4523..c1088d9 100644 --- a/libarchive/libarchive-2.4.17/doc/man/bsdtar.1 +++ b/libarchive/libarchive-2.5.5/doc/man/bsdtar.1 @@ -1,4 +1,4 @@ -.TH BSDTAR 1 "April 13, 2004" "" +.TH BSDTAR 1 "May 15, 2008" "" .SH NAME \fBtar\fP \- manipulate tape archives @@ -132,6 +132,16 @@ but before extracting entries from the archive. (c and r modes only) Issue a warning message unless all links to each file are archived. .TP +\fB\--chroot\fP (\fB\-W\fP \fBchroot\fP) +(x mode only) +.nh +\fBchroot\fP +.hy +(); +to the current directory after processing any +\fB\-C\fP +options and before extracting any files. +.TP \fB\--exclude\fP \fIpattern\fP (\fB\-W\fP \fBexclude\fP=\fIpattern\fP) Do not process files or directories that match the specified pattern. @@ -139,7 +149,7 @@ Note that exclusions take precedence over patterns or filenames specified on the command line. .TP \fB\--format\fP \fIformat\fP (\fB\-W\fP \fBformat\fP=\fIformat\fP) -(c mode only) +(c, r, u mode only) Use the specified format for the created archive. Supported formats include ``cpio'', @@ -150,6 +160,8 @@ and Other formats may also be supported; see \fBlibarchive-formats\fP(5) for more information about currently-supported formats. +In r and u modes, when extending an existing archive, the format specified +here must be compatible with the format of the existing archive on disk. .TP \fB\-f\fP \fIfile\fP Read the archive from or write the archive to the specified file. @@ -162,16 +174,6 @@ FreeBSD, the default tape device is \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. -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. -.TP \fB\-H\fP (c and r mode only) Symbolic links named on the command line will be followed; the @@ -223,6 +225,11 @@ Do not overwrite existing files. In particular, if a file appears more than once in an archive, later copies will not overwrite earlier copies. .TP +\fB\--keep-newer-files\fP (\fB\-W\fP \fBkeep-newer-files\fP) +(x mode only) +Do not overwrite existing files that are newer than the +versions appearing in the archive being extracted. +.TP \fB\-L\fP (c and r mode only) All symbolic links will be followed. @@ -282,6 +289,11 @@ This is often used to read filenames output by the option to \fBfind\fP(1). .TP +\fB\--numeric-owner\fP +(x mode only) +Ignore symbolic user and group names when restoring archives to disk, +only numeric uid and gid values will be obeyed. +.TP \fB\-O\fP (x, t modes only) In extract (-x) mode, files will be written to standard out rather than @@ -290,7 +302,7 @@ In list (-t) mode, the file listing will be written to stderr rather than the usual stdout. .TP \fB\-o\fP -(x mode only) +(x mode) 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 @@ -300,6 +312,11 @@ 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. .TP +\fB\-o\fP +(c, r, u mode) +A synonym for +\fB\--format\fP \fIustar\fP +.TP \fB\--one-file-system\fP (\fB\-W\fP \fBone-file-system\fP) (c, r, and u modes) Do not cross mount points. @@ -331,6 +348,23 @@ is being run by root, the default is to restore the owner unless the \fB\-o\fP option is also specified. .TP +\fB\-q\fP (\fB\--fast-read\fP) +(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. +.TP +\fB\-S\fP +(x mode only) +Extract files as sparse files. +For every block on disk, check first if it contains only NULL bytes and seek +over it otherwise. +This works similiar to the conv=sparse option of dd. +.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. @@ -338,6 +372,23 @@ Pathnames with fewer elements will be silently skipped. Note that the pathname is edited after checking inclusion/exclusion patterns but before security checks. .TP +\fB\-s\fP \fIpattern\fP +Modify file or archive member names according to +\fIpattern\fP. +The pattern has the format /old/new/[gps]. +old is a basic regular expression. +If it doesn't apply, the pattern is skipped. +new is the replacement string of the matched part. +~ is substituted with the match, \1 to \9 with the content of +the corresponding captured group. +The optional trailing g specifies that matching should continue +after the matched part and stopped on the first unmatched pattern. +The optional trailing s specifies that the pattern applies to the value +of symbolic links. +The optional trailing p specifies that after a successful substitution +the original path name and the new path name should be printed to +standard error. +.TP \fB\-T\fP \fIfilename\fP In x or t mode, \fBtar\fP @@ -426,6 +477,16 @@ Note that, unlike other \fBtar\fP implementations, this implementation recognizes gzip compression automatically when reading archives. +.TP +\fB\-Z\fP +(c mode only) +Compress the resulting archive with +\fBcompress\fP(1). +In extract or list modes, this option is ignored. +Note that, unlike other +\fBtar\fP +implementations, this implementation recognizes compress compression +automatically when reading archives. .SH ENVIRONMENT The following environment variables affect the execution of \fB:\fP @@ -515,6 +576,22 @@ Finally, it will switch to the directory and add \fIfoo2\fP to the output archive. +An input file in +\fBmtree\fP(5) +format can be used to create an output archive with arbitrary ownership, +permissions, or names that differ from existing data on disk: +.RS +$ cat input.mtree +.RE +.RS +usr/bin uid=0 gid=0 mode=0755 type=dir +.RE +.RS +usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls +.RE +.RS +$ tar -cvf output.tar @input.mtree +.RE The \fB\--newer\fP and @@ -655,6 +732,7 @@ an archive while preserving any absolute pathnames, components, or symlinks to other directories. .SH SEE ALSO \fBbzip2\fP(1), +\fBcompress\fP(1), \fBcpio\fP(1), \fBgzip\fP(1), \fBmt\fP(1), diff --git a/libarchive/libarchive-2.4.17/doc/man/cpio.5 b/libarchive/libarchive-2.5.5/doc/man/cpio.5 index a77d96b..e389f71 100644 --- a/libarchive/libarchive-2.4.17/doc/man/cpio.5 +++ b/libarchive/libarchive-2.5.5/doc/man/cpio.5 @@ -137,7 +137,7 @@ Each of the two 16 bit values are stored in machine-native byte order. .TP \fInamesize\fP The number of bytes in the pathname that follows the header. -This count includes the trailing NULL byte. +This count includes the trailing NUL byte. .TP \fIfilesize\fP The size of the file. @@ -149,8 +149,8 @@ above for a description of the storage of four-byte integers. The pathname immediately follows the fixed header. If the \fBnamesize\fP -is odd, an additional NULL byte is added after the pathname. -The file data is then appended, padded with NULL +is odd, an additional NUL byte is added after the pathname. +The file data is then appended, padded with NUL bytes to an even length. Hardlinked files are not given special treatment; the full file contents are included with each copy of the @@ -187,7 +187,7 @@ 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. +NUL byte that terminates the name field. .SS New ASCII Format The "new" ASCII format uses 8-byte hexadecimal fields for all numbers and separates device numbers into separate fields @@ -220,7 +220,7 @@ The string \fIcheck\fP This field is always set to zero by writers and ignored by readers. See the next section for more details. -The pathname is followed by NULL bytes so that the total size +The pathname is followed by NUL 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 diff --git a/libarchive/libarchive-2.4.17/doc/man/libarchive-formats.5 b/libarchive/libarchive-2.5.5/doc/man/libarchive-formats.5 index 1e88dd2..580aaea 100644 --- a/libarchive/libarchive-2.4.17/doc/man/libarchive-formats.5 +++ b/libarchive/libarchive-2.5.5/doc/man/libarchive-formats.5 @@ -226,6 +226,14 @@ There are two common variants: the GNU format derived from SVR4, and the BSD format, which first appeared in 4.4BSD. Libarchive provides read and write support for both variants. +.SS mtree +Libarchive can read files in +\fBmtree\fP(5) +format. This format is not a true archive format, but rather a description +of a file hierarchy. When requested, libarchive obtains the contents of +the files described by the +\fBmtree\fP(5) +format from files on disk instead. .SH SEE ALSO \fBar\fP(1), \fBcpio\fP(1), diff --git a/libarchive/libarchive-2.4.17/doc/man/libarchive.3 b/libarchive/libarchive-2.5.5/doc/man/libarchive.3 index 722b765..722b765 100644 --- a/libarchive/libarchive-2.4.17/doc/man/libarchive.3 +++ b/libarchive/libarchive-2.5.5/doc/man/libarchive.3 diff --git a/libarchive/libarchive-2.4.17/doc/man/libarchive_internals.3 b/libarchive/libarchive-2.5.5/doc/man/libarchive_internals.3 index fae95d8..fae95d8 100644 --- a/libarchive/libarchive-2.4.17/doc/man/libarchive_internals.3 +++ b/libarchive/libarchive-2.5.5/doc/man/libarchive_internals.3 diff --git a/libarchive/libarchive-2.4.17/doc/man/mtree.5 b/libarchive/libarchive-2.5.5/doc/man/mtree.5 index 10ad85b..0f4c255 100644 --- a/libarchive/libarchive-2.4.17/doc/man/mtree.5 +++ b/libarchive/libarchive-2.5.5/doc/man/mtree.5 @@ -1,12 +1,12 @@ .TH MTREE 5 "August 20, 2007" "" .SH NAME \fBmtree\fP -\- format of mtree dir heirarchy files +\- format of mtree dir hierarchy files .SH DESCRIPTION The \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. +Such files are typically used to create or verify directory hierarchies. .SS General Format An \fBmtree\fP @@ -91,7 +91,7 @@ separated by whitespace. .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 +Each such definition consists of a key from the following list immediately followed by an '=' sign and a value. Software programs reading mtree files should warn about @@ -105,8 +105,7 @@ the utility. .TP \fBcontents\fP -The full pathname of a file whose contents should be -compared to the contents of this file. +The full pathname of a file that holds the contents of this file. .TP \fBflags\fP The file flags as a symbolic name. @@ -117,15 +116,18 @@ If no flags are to be set the string ``none'' may be used to override the current default. .TP -\fBignore\fP -Ignore any file hierarchy below this file. -.TP \fBgid\fP The file group as a numeric value. .TP \fBgname\fP The file group as a symbolic name. .TP +\fBignore\fP +Ignore any file hierarchy below this file. +.TP +\fBlink\fP +The target of the symbolic link when type=link. +.TP \fBmd5\fP The MD5 message digest of the file. .TP @@ -133,6 +135,29 @@ The MD5 message digest of the file. A synonym for \fBmd5\fP. .TP +\fBmode\fP +The current file's permissions as a numeric (octal) or symbolic +value. +.TP +\fBnlink\fP +The number of hard links the file is expected to have. +.TP +\fBnochange\fP +Make sure this file or directory exists but otherwise ignore all attributes. +.TP +\fBripemd160digest\fP +The +Tn RIPEMD160 +message digest of the file. +.TP +\fBrmd160\fP +A synonym for +\fBripemd160digest\fP. +.TP +\fBrmd160digest\fP +A synonym for +\fBripemd160digest\fP. +.TP \fBsha1\fP The Tn FIPS @@ -155,41 +180,9 @@ message digest of the file. A synonym for \fBsha256\fP. .TP -\fBripemd160digest\fP -The -Tn RIPEMD160 -message digest of the file. -.TP -\fBrmd160\fP -A synonym for -\fBripemd160digest\fP. -.TP -\fBrmd160digest\fP -A synonym for -\fBripemd160digest\fP. -.TP -\fBmode\fP -The current file's permissions as a numeric (octal) or symbolic -value. -.TP -\fBnlink\fP -The number of hard links the file is expected to have. -.TP -\fBnochange\fP -Make sure this file or directory exists but otherwise ignore all attributes. -.TP -\fBuid\fP -The file owner as a numeric value. -.TP -\fBuname\fP -The file owner as a symbolic name. -.TP \fBsize\fP The size, in bytes, of the file. .TP -\fBlink\fP -The file the symbolic link is expected to reference. -.TP \fBtime\fP The last modification time of the file. .TP @@ -216,6 +209,12 @@ symbolic link .TP \fBsocket\fP socket +.TP +\fBuid\fP +The file owner as a numeric value. +.TP +\fBuname\fP +The file owner as a symbolic name. .SH SEE ALSO \fBcksum\fP(1), \fBfind\fP(1), diff --git a/libarchive/libarchive-2.4.17/doc/man/tar.5 b/libarchive/libarchive-2.5.5/doc/man/tar.5 index 3b4414f..4901e2c 100644 --- a/libarchive/libarchive-2.4.17/doc/man/tar.5 +++ b/libarchive/libarchive-2.5.5/doc/man/tar.5 @@ -193,7 +193,7 @@ field with several new type values: .TP ``0'' Regular file. -NULL should be treated as a synonym, for compatibility purposes. +NUL should be treated as a synonym, for compatibility purposes. .TP ``1'' Hard link. @@ -238,7 +238,7 @@ by readers. \fImagic\fP Contains the magic value ``ustar'' -followed by a NULL byte to indicate that this is a POSIX standard archive. +followed by a NUL byte to indicate that this is a POSIX standard archive. Full compliance requires the uname and gname fields be properly set. .TP \fIversion\fP @@ -267,7 +267,7 @@ the prefix value and a \fI/\fP character to the regular name field to obtain the full pathname. Note that all unused bytes must be set to -.BR NULL. +.BR NUL. Field termination is specified slightly differently by POSIX than by previous implementations. The @@ -276,14 +276,14 @@ The and \fIgname\fP fields must have a trailing -.BR NULL. +.BR NUL. The \fIpathname\fP, \fIlinkname\fP, and \fIprefix\fP fields must have a trailing -.BR NULL +.BR NUL unless they fill the entire field. (In particular, it is possible to store a 256-character pathname if it happens to have a @@ -291,7 +291,7 @@ 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 -.BR NULL +.BR NUL characters. Currently, most tar implementations comply with the ustar format, occasionally extending it by adding new fields to the diff --git a/libarchive/libarchive-2.4.17/doc/mdoc2man.awk b/libarchive/libarchive-2.5.5/doc/mdoc2man.awk index c71e528..c71e528 100644 --- a/libarchive/libarchive-2.4.17/doc/mdoc2man.awk +++ b/libarchive/libarchive-2.5.5/doc/mdoc2man.awk diff --git a/libarchive/libarchive-2.4.17/doc/text/Makefile b/libarchive/libarchive-2.5.5/doc/text/Makefile index a70eb18..a70eb18 100644 --- a/libarchive/libarchive-2.4.17/doc/text/Makefile +++ b/libarchive/libarchive-2.5.5/doc/text/Makefile diff --git a/libarchive/libarchive-2.4.17/doc/text/archive_entry.3 b/libarchive/libarchive-2.5.5/doc/text/archive_entry.3 index 5201c4f..e1f4ccd 100644 --- a/libarchive/libarchive-2.4.17/doc/text/archive_entry.3 +++ b/libarchive/libarchive-2.5.5/doc/text/archive_entry.3 @@ -5,21 +5,22 @@ NAME 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_clear, archive_entry_clone, archive_entry_copy_fflags_text, 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_copy_hardlink_w, archive_entry_copy_link, + archive_entry_copy_link_w, archive_entry_copy_pathname_w, + archive_entry_copy_sourcepath, 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, @@ -28,9 +29,10 @@ NAME 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 + archive_entry_set_uname, archive_entry_size, archive_entry_sourcepath, + archive_entry_stat, archive_entry_symlink, archive_entry_uid, + archive_entry_uname -- functions for manipulating archive entry descrip- + tions SYNOPSIS #include <archive_entry.h> @@ -75,6 +77,9 @@ SYNOPSIS struct archive_entry * archive_entry_clone(struct archive_entry *); + const char * * + archive_entry_copy_fflags_text_w(struct archive_entry *, const char *); + const wchar_t * archive_entry_copy_fflags_text_w(struct archive_entry *, const wchar_t *); @@ -92,6 +97,9 @@ SYNOPSIS archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *); void + archive_entry_copy_sourcepath(struct archive_entry *, const char *); + + void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *); void @@ -237,6 +245,9 @@ SYNOPSIS int64_t archive_entry_size(struct archive_entry *); + const char * + archive_entry_sourcepath(struct archive_entry *); + const struct stat * archive_entry_stat(struct archive_entry *); @@ -316,15 +327,15 @@ DESCRIPTION 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.) + archive_entry_copy_fflags_text() and archive_entry_copy_fflags_text_w() + functions parse 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 evaluated, and the bitmaps will be set to + reflect every name that is recognized. (In particular, this differs from + strtofflags(3), which stops parsing at the first unrecognized name.) ACL Handling XXX This needs serious help. XXX @@ -347,4 +358,4 @@ HISTORY AUTHORS The libarchive library was written by Tim Kientzle <kientzle@acm.org>. -FreeBSD 6.0 December 15, 2003 FreeBSD 6.0 +FreeBSD 6.0 May 12, 2008 FreeBSD 6.0 diff --git a/libarchive/libarchive-2.4.17/doc/text/archive_read.3 b/libarchive/libarchive-2.5.5/doc/text/archive_read.3 index 95b8686..00d60f8 100644 --- a/libarchive/libarchive-2.4.17/doc/text/archive_read.3 +++ b/libarchive/libarchive-2.5.5/doc/text/archive_read.3 @@ -15,9 +15,9 @@ NAME 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 + archive_read_extract, archive_read_extract2, + archive_read_extract_set_progress_callback, archive_read_close, + archive_read_finish -- functions for reading streaming archives SYNOPSIS #include <archive.h> @@ -108,6 +108,10 @@ SYNOPSIS archive_read_extract(struct archive *, struct archive_entry *, int flags); + int + archive_read_extract2(struct archive *src, struct archive_entry *, + struct archive *dest); + void archive_read_extract_set_progress_callback(struct archive *, void (*func)(void *), void *user_data); @@ -145,7 +149,7 @@ DESCRIPTION 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_tar(), archive_read_support_format_zip() Enables support---including auto-detection code---for the speci- fied archive format. For example, @@ -224,6 +228,15 @@ DESCRIPTION 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_extract2() + This is another version of archive_read_extract() that allows you + to provide your own restore object. In particular, this allows + you to override the standard lookup functions using + archive_write_disk_set_group_lookup(3), and + archive_write_disk_set_user_lookup(3). Note that + archive_read_extract2() does not accept a flags argument; you + should use archive_write_disk_set_options() to set the restore + options yourself. 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- @@ -254,11 +267,11 @@ DESCRIPTION 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 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_skip_callback(struct archive *, + void *client_data, size_t request) typedef int archive_open_callback(struct archive *, void *client_data) diff --git a/libarchive/libarchive-2.4.17/doc/text/archive_util.3 b/libarchive/libarchive-2.5.5/doc/text/archive_util.3 index 28b6883..28b6883 100644 --- a/libarchive/libarchive-2.4.17/doc/text/archive_util.3 +++ b/libarchive/libarchive-2.5.5/doc/text/archive_util.3 diff --git a/libarchive/libarchive-2.4.17/doc/text/archive_write.3 b/libarchive/libarchive-2.5.5/doc/text/archive_write.3 index a16d364..fff35ea 100644 --- a/libarchive/libarchive-2.4.17/doc/text/archive_write.3 +++ b/libarchive/libarchive-2.5.5/doc/text/archive_write.3 @@ -6,8 +6,9 @@ NAME 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_bzip2, + archive_write_set_compression_compress, + 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, @@ -34,6 +35,9 @@ SYNOPSIS archive_write_set_compression_bzip2(struct archive *); int + archive_write_set_compression_compress(struct archive *); + + int archive_write_set_compression_gzip(struct archive *); int @@ -159,6 +163,7 @@ DESCRIPTION result in ordinary ustar archives. archive_write_set_compression_bzip2(), + archive_write_set_compression_compress(), archive_write_set_compression_gzip(), archive_write_set_compression_none() The resulting archive will be compressed as specified. Note that @@ -257,8 +262,8 @@ CLIENT CALLBACKS 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) + 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- @@ -417,4 +422,4 @@ BUGS correctly restore device nodes with large device numbers from archives created by this library. -FreeBSD 6.0 August 19, 2006 FreeBSD 6.0 +FreeBSD 6.0 May 11, 2008 FreeBSD 6.0 diff --git a/libarchive/libarchive-2.4.17/doc/text/archive_write_disk.3 b/libarchive/libarchive-2.5.5/doc/text/archive_write_disk.3 index 18e4e50..58916ac 100644 --- a/libarchive/libarchive-2.4.17/doc/text/archive_write_disk.3 +++ b/libarchive/libarchive-2.5.5/doc/text/archive_write_disk.3 @@ -129,6 +129,11 @@ DESCRIPTION paths. Note that paths ending in .. always cause an error, regardless of this flag. + ARCHIVE_EXTRACT_SPARSE + Scan data for blocks of NUL bytes and try to recreate them with + holes. This results in sparse files, independent of whether the + archive format supports or uses them. + archive_write_disk_set_group_lookup(), archive_write_disk_set_user_lookup() The struct archive_entry objects contain both names and ids that diff --git a/libarchive/libarchive-2.4.17/doc/text/bsdcpio.1 b/libarchive/libarchive-2.5.5/doc/text/bsdcpio.1 index d8f7102..6df6c43 100644 --- a/libarchive/libarchive-2.4.17/doc/text/bsdcpio.1 +++ b/libarchive/libarchive-2.5.5/doc/text/bsdcpio.1 @@ -14,12 +14,14 @@ DESCRIPTION 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. + -i Input. Read an archive from standard input (unless overriden) + and extract the contents to disk or (if the -t option is speci- + fied) list the contents to standard output. If one or more file + patterns are specified, 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. + a new archive on standard output (unless overriden) containing + the specified items. -p Pass-through. Read a list of filenames from standard input and copy the files to the specified directory. @@ -27,15 +29,28 @@ OPTIONS Unless specifically stated otherwise, options are applicable in all oper- ating modes. + -A (o mode only) Append to the specified archive. (Not yet imple- + mented.) + -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 size + (o mode only) Block output to records of size 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. + -E file + (i mode only) Read list of file name patterns from file to list + and extract. + + -F file + Read archive from or write archive to file. + -f pattern (i mode only) Ignore files that match pattern. @@ -54,8 +69,16 @@ OPTIONS complete information about the formats currently supported by the underlying libarchive(3) library. + -I file + Read archive from file. + -i Input mode. See above for description. + --insecure + (i and p mode only) Disable security checks during extraction or + copying. This allows extraction via symbolic links and path + names containing `..' in the name. + -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 @@ -67,6 +90,9 @@ OPTIONS -m (i and p modes) Set file modification time on created files to match those in the source. + -O file + Write archive to file. + -o Output mode. See above for description. -p Pass-through mode. See above for description. @@ -105,12 +131,16 @@ OPTIONS 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. + sion before writing it. In input mode, this option is ignored; + bzip2 compression is recognized automatically on input. + + -Z (o mode only) Compress the archive with compress-compatible com- + pression before writing it. In input mode, this option is + ignored; 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. + sion before writing it. In input mode, this option is ignored; + gzip compression is recognized automatically on input. ENVIRONMENT The following environment variables affect the execution of cpio: diff --git a/libarchive/libarchive-2.4.17/doc/text/bsdtar.1 b/libarchive/libarchive-2.5.5/doc/text/bsdtar.1 index 9a62753..d6a22ea 100644 --- a/libarchive/libarchive-2.4.17/doc/text/bsdtar.1 +++ b/libarchive/libarchive-2.5.5/doc/text/bsdtar.1 @@ -77,17 +77,23 @@ OPTIONS (c and r modes only) Issue a warning message unless all links to each file are archived. + --chroot (-W chroot) + (x mode only) chroot() to the current directory after processing + any -C options and before extracting any files. + --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 + (c, r, u mode only) Use the specified format for the created ar- + chive. 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. + ported formats. In r and u modes, when extending an existing ar- + chive, the format specified here must be compatible with the for- + mat of the existing archive on disk. -f file Read the archive from or write the archive to the specified file. @@ -95,15 +101,6 @@ OPTIONS 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. @@ -132,6 +129,10 @@ OPTIONS a file appears more than once in an archive, later copies will not overwrite earlier copies. + --keep-newer-files (-W keep-newer-files) + (x mode only) Do not overwrite existing files that are newer than + the versions appearing in the archive being extracted. + -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. @@ -169,17 +170,23 @@ OPTIONS null characters, not by newlines. This is often used to read filenames output by the -print0 option to find(1). + --numeric-owner + (x mode only) Ignore symbolic user and group names when restoring + archives to disk, only numeric uid and gid values will be obeyed. + -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. + -o (x mode) 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 -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 information + in the archive will be discarded. + + -o (c, r, u mode) A synonym for --format ustar --one-file-system (-W one-file-system) (c, r, and u modes) Do not cross mount points. @@ -200,12 +207,39 @@ OPTIONS is being run by root, the default is to restore the owner unless the -o option is also specified. + -q (--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. + + -S (x mode only) Extract files as sparse files. For every block on + disk, check first if it contains only NULL bytes and seek over it + otherwise. This works similiar to the conv=sparse option of dd. + --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. + -s pattern + Modify file or archive member names according to pattern. The + pattern has the format /old/new/[gps]. old is a basic regular + expression. If it doesn't apply, the pattern is skipped. new is + the replacement string of the matched part. ~ is substituted + with the match, 1 to 9 with the content of the corresponding cap- + tured group. The optional trailing g specifies that matching + should continue after the matched part and stopped on the first + unmatched pattern. The optional trailing s specifies that the + pattern applies to the value of symbolic links. The optional + trailing p specifies that after a successful substitution the + original path name and the new path name should be printed to + standard error. + -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 @@ -252,6 +286,11 @@ OPTIONS other tar implementations, this implementation recognizes gzip compression automatically when reading archives. + -Z (c mode only) Compress the resulting archive with compress(1). + In extract or list modes, this option is ignored. Note that, + unlike other tar implementations, this implementation recognizes + compress compression automatically when reading archives. + ENVIRONMENT The following environment variables affect the execution of tar: @@ -298,6 +337,15 @@ EXAMPLES Finally, it will switch to the /tmp directory and add foo2 to the output archive. + An input file in mtree(5) format can be used to create an output archive + with arbitrary ownership, permissions, or names that differ from existing + data on disk: + + $ cat input.mtree + usr/bin uid=0 gid=0 mode=0755 type=dir + usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls + $ tar -cvf output.tar @input.mtree + 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''. @@ -363,8 +411,8 @@ SECURITY ries. SEE ALSO - bzip2(1), cpio(1), gzip(1), mt(1), pax(1), shar(1), libarchive(3), - libarchive-formats(5), tar(5) + bzip2(1), compress(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 @@ -438,4 +486,4 @@ BUGS 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 +FreeBSD 6.0 May 15, 2008 FreeBSD 6.0 diff --git a/libarchive/libarchive-2.4.17/doc/text/cpio.5 b/libarchive/libarchive-2.5.5/doc/text/cpio.5 index db5da1e..53e4ba6 100644 --- a/libarchive/libarchive-2.4.17/doc/text/cpio.5 +++ b/libarchive/libarchive-2.5.5/doc/text/cpio.5 @@ -91,7 +91,7 @@ DESCRIPTION namesize The number of bytes in the pathname that follows the header. - This count includes the trailing NULL byte. + This count includes the trailing NUL byte. filesize The size of the file. Note that this archive format is limited @@ -99,8 +99,8 @@ 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. + odd, an additional NUL byte is added after the pathname. The file data + is then appended, padded with NUL bytes to an even length. Hardlinked files are not given special treatment; the full file contents are included with each copy of the file. @@ -130,7 +130,7 @@ DESCRIPTION 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 + archive will be entirely ASCII, except for the NUL byte that terminates the name field. New ASCII Format @@ -163,11 +163,11 @@ DESCRIPTION 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). + The pathname is followed by NUL 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 giga- + byte 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. diff --git a/libarchive/libarchive-2.4.17/doc/text/libarchive-formats.5 b/libarchive/libarchive-2.5.5/doc/text/libarchive-formats.5 index 35eb278..579370c 100644 --- a/libarchive/libarchive-2.4.17/doc/text/libarchive-formats.5 +++ b/libarchive/libarchive-2.5.5/doc/text/libarchive-formats.5 @@ -173,6 +173,12 @@ DESCRIPTION SVR4, and the BSD format, which first appeared in 4.4BSD. Libarchive provides read and write support for both variants. + mtree + Libarchive can read files in mtree(5) format. This format is not a true + archive format, but rather a description of a file hierarchy. When + requested, libarchive obtains the contents of the files described by the + mtree(5) format from files on disk instead. + SEE ALSO ar(1), cpio(1), mkisofs(1), shar(1), tar(1), zip(1), zlib(3), cpio(5), mtree(5), tar(5) diff --git a/libarchive/libarchive-2.4.17/doc/text/libarchive.3 b/libarchive/libarchive-2.5.5/doc/text/libarchive.3 index f4925f0..f4925f0 100644 --- a/libarchive/libarchive-2.4.17/doc/text/libarchive.3 +++ b/libarchive/libarchive-2.5.5/doc/text/libarchive.3 diff --git a/libarchive/libarchive-2.4.17/doc/text/libarchive_internals.3 b/libarchive/libarchive-2.5.5/doc/text/libarchive_internals.3 index 4e398a1..4e398a1 100644 --- a/libarchive/libarchive-2.4.17/doc/text/libarchive_internals.3 +++ b/libarchive/libarchive-2.5.5/doc/text/libarchive_internals.3 diff --git a/libarchive/libarchive-2.4.17/doc/text/mtree.5 b/libarchive/libarchive-2.5.5/doc/text/mtree.5 index 1e5eb4f..7ceadb3 100644 --- a/libarchive/libarchive-2.4.17/doc/text/mtree.5 +++ b/libarchive/libarchive-2.5.5/doc/text/mtree.5 @@ -1,12 +1,12 @@ MTREE(5) FreeBSD File Formats Manual MTREE(5) NAME - mtree -- format of mtree dir heirarchy files + mtree -- format of mtree dir hierarchy 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. + directory hierarchies. General Format An mtree file consists of a series of lines, each providing information @@ -66,7 +66,7 @@ DESCRIPTION Keywords After the filename, a full or relative entry consists of zero or more - whitespace-separated keyword definitions. Each such definitions consists + whitespace-separated keyword definitions. Each such definition 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. @@ -76,31 +76,32 @@ DESCRIPTION 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. + contents The full pathname of a file that holds 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. + ignore Ignore any file hierarchy below this file. + + link The target of the symbolic link when type=link. + 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. + mode The current file's permissions as a numeric (octal) or sym- + bolic value. - sha256 The FIPS 180-2 (``SHA-256'') message digest of the file. + nlink The number of hard links the file is expected to have. - sha256digest - A synonym for sha256. + nochange Make sure this file or directory exists but otherwise ignore + all attributes. ripemd160digest The RIPEMD160 message digest of the file. @@ -110,22 +111,17 @@ DESCRIPTION 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. + sha1 The FIPS 160-1 (``SHA-1'') message digest of the file. - nochange Make sure this file or directory exists but otherwise ignore - all attributes. + sha1digest A synonym for sha1. - uid The file owner as a numeric value. + sha256 The FIPS 180-2 (``SHA-256'') message digest of the file. - uname The file owner as a symbolic name. + sha256digest + A synonym for sha256. 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: @@ -138,6 +134,10 @@ DESCRIPTION link symbolic link socket socket + uid The file owner as a numeric value. + + uname The file owner as a symbolic name. + SEE ALSO cksum(1), find(1), mtree(8) diff --git a/libarchive/libarchive-2.4.17/doc/text/tar.5 b/libarchive/libarchive-2.5.5/doc/text/tar.5 index 24b77e1..fe98bd5 100644 --- a/libarchive/libarchive-2.4.17/doc/text/tar.5 +++ b/libarchive/libarchive-2.5.5/doc/text/tar.5 @@ -143,7 +143,7 @@ DESCRIPTION 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 + ``0'' Regular file. NUL should be treated as a synonym, for compatibility purposes. ``1'' Hard link. ``2'' Symbolic link. @@ -167,7 +167,7 @@ DESCRIPTION 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 + magic Contains the magic value ``ustar'' followed by a NUL byte to indicate that this is a POSIX standard archive. Full compliance requires the uname and gname fields be properly set. @@ -191,15 +191,15 @@ DESCRIPTION a / character to the regular name field to obtain the full path- name. - Note that all unused bytes must be set to NULL. + Note that all unused bytes must be set to NUL. 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 + trailing NUL. The pathname, linkname, and prefix fields must have a + trailing NUL 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 + the front, and allows them to be terminated with either space or NUL characters. Currently, most tar implementations comply with the ustar format, occa- diff --git a/libarchive/libarchive-2.4.17/doc/update.sh b/libarchive/libarchive-2.5.5/doc/update.sh index 644b90a..644b90a 100755..100644 --- a/libarchive/libarchive-2.4.17/doc/update.sh +++ b/libarchive/libarchive-2.5.5/doc/update.sh diff --git a/libarchive/libarchive-2.4.17/examples/minitar/README b/libarchive/libarchive-2.5.5/examples/minitar/README index 83f646c..83f646c 100644 --- a/libarchive/libarchive-2.4.17/examples/minitar/README +++ b/libarchive/libarchive-2.5.5/examples/minitar/README diff --git a/libarchive/libarchive-2.4.17/examples/minitar/minitar.c b/libarchive/libarchive-2.5.5/examples/minitar/minitar.c index c943916..c943916 100644 --- a/libarchive/libarchive-2.4.17/examples/minitar/minitar.c +++ b/libarchive/libarchive-2.5.5/examples/minitar/minitar.c diff --git a/libarchive/libarchive-2.4.17/examples/minitar/tree.c b/libarchive/libarchive-2.5.5/examples/minitar/tree.c index 8af0b4d..8af0b4d 100644 --- a/libarchive/libarchive-2.4.17/examples/minitar/tree.c +++ b/libarchive/libarchive-2.5.5/examples/minitar/tree.c diff --git a/libarchive/libarchive-2.4.17/examples/minitar/tree.h b/libarchive/libarchive-2.5.5/examples/minitar/tree.h index 554e6c2..554e6c2 100644 --- a/libarchive/libarchive-2.4.17/examples/minitar/tree.h +++ b/libarchive/libarchive-2.5.5/examples/minitar/tree.h diff --git a/libarchive/libarchive-2.4.17/examples/tarfilter.c b/libarchive/libarchive-2.5.5/examples/tarfilter.c index b7e08cf..b7e08cf 100644 --- a/libarchive/libarchive-2.4.17/examples/tarfilter.c +++ b/libarchive/libarchive-2.5.5/examples/tarfilter.c diff --git a/libarchive/libarchive-2.4.17/examples/untar.c b/libarchive/libarchive-2.5.5/examples/untar.c index 88f6dc2..88f6dc2 100644 --- a/libarchive/libarchive-2.4.17/examples/untar.c +++ b/libarchive/libarchive-2.5.5/examples/untar.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive.h.in b/libarchive/libarchive-2.5.5/libarchive/archive.h index d76c85e..3f9f6e1 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive.h.in +++ b/libarchive/libarchive-2.5.5/libarchive/archive.h @@ -22,87 +22,126 @@ * (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.47 2007/12/30 04:58:21 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive.h.in,v 1.50 2008/05/26 17:00:22 kientzle Exp $ */ #ifndef ARCHIVE_H_INCLUDED #define ARCHIVE_H_INCLUDED /* - * This header file corresponds to: - * Library version @ARCHIVE_VERSION@ - * Shared library version @SHLIB_MAJOR@ + * Note: archive.h is for use outside of libarchive; the configuration + * headers (config.h, archive_platform.h, etc.) are purely internal. + * Do NOT use HAVE_XXX configuration macros to control the behavior of + * this header! If you must conditionalize, use predefined compiler and/or + * platform macros. */ #include <sys/types.h> /* Linux requires this for off_t */ -@ARCHIVE_H_INCLUDE_INTTYPES_H@ +#if !defined(__WATCOMC__) && !defined(_MSC_VER) +/* Header unavailable on Watcom C or MS Visual C++. */ +#include <inttypes.h> /* int64_t, etc. */ +#endif #include <stdio.h> /* For FILE * */ -#ifndef _WIN32 -#include <unistd.h> /* For ssize_t and size_t */ + +/* Get appropriate definitions of standard POSIX-style types. */ +/* These should match the types used in 'struct stat' */ +#ifdef _WIN32 +#define __LA_SSIZE_T long +#define __LA_UID_T unsigned int +#define __LA_GID_T unsigned int #else -typedef long ssize_t; -typedef unsigned int uid_t; -typedef unsigned int gid_t; -typedef unsigned short mode_t; +#include <unistd.h> /* ssize_t, uid_t, and gid_t */ +#define __LA_SSIZE_T ssize_t +#define __LA_UID_T uid_t +#define __LA_GID_T gid_t #endif +/* + * On Windows, define LIBARCHIVE_STATIC if you're building or using a + * .lib. The default here assumes you're building a DLL. Only + * libarchive source should ever define __LIBARCHIVE_BUILD. + */ +#if ((defined __WIN32__) || (defined _WIN32)) && (!defined LIBARCHIVE_STATIC) +# ifdef __LIBARCHIVE_BUILD +# ifdef __GNUC__ +# define __LA_DECL __attribute__((dllexport)) extern +# else +# define __LA_DECL __declspec(dllexport) +# endif +# else +# ifdef __GNUC__ +# define __LA_DECL __attribute__((dllimport)) extern +# else +# define __LA_DECL __declspec(dllimport) +# endif +# endif +#else +/* Static libraries or non-Windows needs no special declaration. */ +# define __LA_DECL +#endif + + #ifdef __cplusplus extern "C" { #endif /* - * Each of the version identifiers comes as a macro and a function. + * The version number is provided as both a macro and a function. * The macro identifies the installed header; the function identifies * the library version (which may not be the same if you're using a - * dynamically-linked version of the library). + * dynamically-linked version of the library). Of course, if the + * header and library are very different, you should expect some + * strangeness. Don't do that. */ /* - * Textual name/version of the library, useful for version displays. - */ -#define ARCHIVE_LIBRARY_VERSION "libarchive @LIBARCHIVE_VERSION_STRING@" -const char * archive_version(void); - -/* - * The "version stamp" is a single integer that makes it easy to check - * the exact version: for version a.b.c, the version stamp is - * printf("%d%03d%03d",a,b,c). For example, version 2.12.108 has - * version stamp 2012108. + * The version number is expressed as a single integer that makes it + * easy to compare versions at build time: for version a.b.c, the + * version number is printf("%d%03d%03d",a,b,c). For example, if you + * know your application requires version 2.12.108 or later, you can + * assert that ARCHIVE_VERSION >= 2012108. * - * This was introduced with libarchive 1.9.0 in the libarchive 1.x family - * and libarchive 2.2.4 in the libarchive 2.x family. The following - * may be useful if you really want to do feature detection for earlier - * libarchive versions (which defined API_VERSION and API_FEATURE): + * This single-number format was introduced with libarchive 1.9.0 in + * the libarchive 1.x family and libarchive 2.2.4 in the libarchive + * 2.x family. The following may be useful if you really want to do + * feature detection for earlier libarchive versions (which defined + * ARCHIVE_API_VERSION and ARCHIVE_API_FEATURE instead): * - * #ifndef ARCHIVE_VERSION_STAMP - * #define ARCHIVE_VERSION_STAMP \ + * #ifndef ARCHIVE_VERSION_NUMBER + * #define ARCHIVE_VERSION_NUMBER \ * (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000) * #endif */ -#define ARCHIVE_VERSION_STAMP @LIBARCHIVE_VERSION@ -int archive_version_stamp(void); +#define ARCHIVE_VERSION_NUMBER 2005005 +__LA_DECL int archive_version_number(void); /* - * Major version number: If ARCHIVE_API_VERSION != - * archive_api_version(), then the library you were linked with is - * using an incompatible API to the one you were compiled with. This - * is almost certainly a fatal problem. - * This is deprecated and will be removed; use ARCHIVE_VERSION_STAMP - * instead. + * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_API_VERSION (ARCHIVE_VERSION_STAMP / 1000000) -int archive_api_version(void); +#define ARCHIVE_VERSION_STRING "libarchive 2.5.5" +__LA_DECL const char * archive_version_string(void); +#if ARCHIVE_VERSION_NUMBER < 3000000 /* - * Minor version number. This is deprecated and will be removed. - * Use ARCHIVE_VERSION_STAMP to adapt to libarchive API variations. + * Deprecated; these are older names that will be removed in favor of + * the simpler definitions above. */ -#define ARCHIVE_API_FEATURE ((ARCHIVE_VERSION_STAMP / 1000) % 1000) -int archive_api_feature(void); - +#define ARCHIVE_VERSION_STAMP ARCHIVE_VERSION_NUMBER +__LA_DECL int archive_version_stamp(void); +#define ARCHIVE_LIBRARY_VERSION ARCHIVE_VERSION_STRING +__LA_DECL const char * archive_version(void); +#define ARCHIVE_API_VERSION (ARCHIVE_VERSION_NUMBER / 1000000) +__LA_DECL int archive_api_version(void); +#define ARCHIVE_API_FEATURE ((ARCHIVE_VERSION_NUMBER / 1000) % 1000) +__LA_DECL int archive_api_feature(void); +#endif +#if ARCHIVE_VERSION_NUMBER < 3000000 +/* This should never have been here in the first place. */ +/* Legacy of old tar assumptions, will be removed in libarchive 3.0. */ #define ARCHIVE_BYTES_PER_RECORD 512 #define ARCHIVE_DEFAULT_BYTES_PER_BLOCK 10240 +#endif /* Declare our basic types. */ struct archive; @@ -119,6 +158,7 @@ struct archive_entry; #define ARCHIVE_WARN (-20) /* Partial success. */ /* For example, if write_header "fails", then you can't push data. */ #define ARCHIVE_FAILED (-25) /* Current operation cannot complete. */ +/* But if write_header is "fatal," then this archive is dead and useless. */ #define ARCHIVE_FATAL (-30) /* No more operations are possible. */ /* @@ -143,18 +183,18 @@ struct archive_entry; */ /* Returns pointer and size of next block of data from archive. */ -typedef ssize_t archive_read_callback(struct archive *, void *_client_data, +typedef __LA_SSIZE_T archive_read_callback(struct archive *, void *_client_data, const void **_buffer); /* Skips at most request bytes from archive and returns the skipped amount */ -#if ARCHIVE_API_VERSION < 2 -typedef ssize_t archive_skip_callback(struct archive *, void *_client_data, +#if ARCHIVE_VERSION_NUMBER < 2000000 +typedef __LA_SSIZE_T archive_skip_callback(struct archive *, void *_client_data, size_t request); #else typedef off_t archive_skip_callback(struct archive *, void *_client_data, off_t request); #endif /* Returns size actually written, zero on EOF, -1 on error. */ -typedef ssize_t archive_write_callback(struct archive *, void *_client_data, +typedef __LA_SSIZE_T archive_write_callback(struct archive *, void *_client_data, const void *_buffer, size_t _length); typedef int archive_open_callback(struct archive *, void *_client_data); typedef int archive_close_callback(struct archive *, void *_client_data); @@ -222,7 +262,7 @@ typedef int archive_close_callback(struct archive *, void *_client_data); * data for entries of interest. * 5) Call archive_read_finish to end processing. */ -struct archive *archive_read_new(void); +__LA_DECL struct archive *archive_read_new(void); /* * The archive_read_support_XXX calls enable auto-detect for this @@ -231,30 +271,30 @@ struct archive *archive_read_new(void); * support_compression_bzip2(). The "all" functions provide the * obvious shorthand. */ -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 *, +__LA_DECL int archive_read_support_compression_all(struct archive *); +__LA_DECL int archive_read_support_compression_bzip2(struct archive *); +__LA_DECL int archive_read_support_compression_compress(struct archive *); +__LA_DECL int archive_read_support_compression_gzip(struct archive *); +__LA_DECL int archive_read_support_compression_none(struct archive *); +__LA_DECL int archive_read_support_compression_program(struct archive *, const char *command); -int archive_read_support_format_all(struct archive *); -int archive_read_support_format_ar(struct archive *); -int archive_read_support_format_cpio(struct archive *); -int archive_read_support_format_empty(struct archive *); -int archive_read_support_format_gnutar(struct archive *); -int archive_read_support_format_iso9660(struct archive *); -int archive_read_support_format_mtree(struct archive *); -int archive_read_support_format_tar(struct archive *); -int archive_read_support_format_zip(struct archive *); +__LA_DECL int archive_read_support_format_all(struct archive *); +__LA_DECL int archive_read_support_format_ar(struct archive *); +__LA_DECL int archive_read_support_format_cpio(struct archive *); +__LA_DECL int archive_read_support_format_empty(struct archive *); +__LA_DECL int archive_read_support_format_gnutar(struct archive *); +__LA_DECL int archive_read_support_format_iso9660(struct archive *); +__LA_DECL int archive_read_support_format_mtree(struct archive *); +__LA_DECL int archive_read_support_format_tar(struct archive *); +__LA_DECL int archive_read_support_format_zip(struct archive *); /* Open the archive using callbacks for archive I/O. */ -int archive_read_open(struct archive *, void *_client_data, +__LA_DECL 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, +__LA_DECL int archive_read_open2(struct archive *, void *_client_data, archive_open_callback *, archive_read_callback *, archive_skip_callback *, archive_close_callback *); @@ -264,43 +304,43 @@ int archive_read_open2(struct archive *, void *_client_data, * accept a block size handle tape blocking correctly. */ /* Use this if you know the filename. Note: NULL indicates stdin. */ -int archive_read_open_filename(struct archive *, +__LA_DECL int archive_read_open_filename(struct archive *, const char *_filename, size_t _block_size); /* archive_read_open_file() is a deprecated synonym for ..._open_filename(). */ -int archive_read_open_file(struct archive *, +__LA_DECL int archive_read_open_file(struct archive *, const char *_filename, size_t _block_size); /* Read an archive that's stored in memory. */ -int archive_read_open_memory(struct archive *, +__LA_DECL int archive_read_open_memory(struct archive *, void * buff, size_t size); /* A more involved version that is only used for internal testing. */ -int archive_read_open_memory2(struct archive *a, void *buff, +__LA_DECL int archive_read_open_memory2(struct archive *a, void *buff, size_t size, size_t read_size); /* Read an archive that's already open, using the file descriptor. */ -int archive_read_open_fd(struct archive *, int _fd, +__LA_DECL int archive_read_open_fd(struct archive *, int _fd, size_t _block_size); /* Read an archive that's already open, using a FILE *. */ /* Note: DO NOT use this with tape drives. */ -int archive_read_open_FILE(struct archive *, FILE *_file); +__LA_DECL int archive_read_open_FILE(struct archive *, FILE *_file); /* Parses and returns next entry header. */ -int archive_read_next_header(struct archive *, +__LA_DECL int archive_read_next_header(struct archive *, struct archive_entry **); /* * Retrieve the byte offset in UNCOMPRESSED data where last-read * header started. */ -int64_t archive_read_header_position(struct archive *); +__LA_DECL int64_t archive_read_header_position(struct archive *); /* Read data from the body of an entry. Similar to read(2). */ -ssize_t archive_read_data(struct archive *, void *, size_t); +__LA_DECL __LA_SSIZE_T archive_read_data(struct archive *, void *, size_t); /* * A zero-copy version of archive_read_data that also exposes the file offset * of each returned block. Note that the client has no way to specify * the desired size of the block. The API does guarantee that offsets will * be strictly increasing and that returned blocks will not overlap. */ -int archive_read_data_block(struct archive *a, +__LA_DECL int archive_read_data_block(struct archive *a, const void **buff, size_t *size, off_t *offset); /*- @@ -309,10 +349,10 @@ int archive_read_data_block(struct archive *a, * 'into_buffer': writes data into memory buffer that you provide * 'into_fd': writes data to specified filedes */ -int archive_read_data_skip(struct archive *); -int archive_read_data_into_buffer(struct archive *, void *buffer, - ssize_t len); -int archive_read_data_into_fd(struct archive *, int fd); +__LA_DECL int archive_read_data_skip(struct archive *); +__LA_DECL int archive_read_data_into_buffer(struct archive *, void *buffer, + __LA_SSIZE_T len); +__LA_DECL int archive_read_data_into_fd(struct archive *, int fd); /*- * Convenience function to recreate the current entry (whose header @@ -331,51 +371,55 @@ int archive_read_data_into_fd(struct archive *, int fd); /* The "flags" argument selects optional behavior, 'OR' the flags you want. */ /* Default: Do not try to set owner/group. */ -#define ARCHIVE_EXTRACT_OWNER (1) +#define ARCHIVE_EXTRACT_OWNER (0x0001) /* Default: Do obey umask, do not restore SUID/SGID/SVTX bits. */ -#define ARCHIVE_EXTRACT_PERM (2) +#define ARCHIVE_EXTRACT_PERM (0x0002) /* Default: Do not restore mtime/atime. */ -#define ARCHIVE_EXTRACT_TIME (4) +#define ARCHIVE_EXTRACT_TIME (0x0004) /* Default: Replace existing files. */ -#define ARCHIVE_EXTRACT_NO_OVERWRITE (8) +#define ARCHIVE_EXTRACT_NO_OVERWRITE (0x0008) /* Default: Try create first, unlink only if create fails with EEXIST. */ -#define ARCHIVE_EXTRACT_UNLINK (16) +#define ARCHIVE_EXTRACT_UNLINK (0x0010) /* Default: Do not restore ACLs. */ -#define ARCHIVE_EXTRACT_ACL (32) +#define ARCHIVE_EXTRACT_ACL (0x0020) /* Default: Do not restore fflags. */ -#define ARCHIVE_EXTRACT_FFLAGS (64) +#define ARCHIVE_EXTRACT_FFLAGS (0x0040) /* Default: Do not restore xattrs. */ -#define ARCHIVE_EXTRACT_XATTR (128) +#define ARCHIVE_EXTRACT_XATTR (0x0080) /* Default: Do not try to guard against extracts redirected by symlinks. */ /* Note: With ARCHIVE_EXTRACT_UNLINK, will remove any intermediate symlink. */ -#define ARCHIVE_EXTRACT_SECURE_SYMLINKS (256) +#define ARCHIVE_EXTRACT_SECURE_SYMLINKS (0x0100) /* Default: Do not reject entries with '..' as path elements. */ -#define ARCHIVE_EXTRACT_SECURE_NODOTDOT (512) +#define ARCHIVE_EXTRACT_SECURE_NODOTDOT (0x0200) /* Default: Create parent directories as needed. */ -#define ARCHIVE_EXTRACT_NO_AUTODIR (1024) +#define ARCHIVE_EXTRACT_NO_AUTODIR (0x0400) /* Default: Overwrite files, even if one on disk is newer. */ -#define ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER (2048) +#define ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER (0x0800) +/* Detect blocks of 0 and write holes instead. */ +#define ARCHIVE_EXTRACT_SPARSE (0x1000) -int archive_read_extract(struct archive *, struct archive_entry *, +__LA_DECL int archive_read_extract(struct archive *, struct archive_entry *, int flags); -void archive_read_extract_set_progress_callback(struct archive *, +__LA_DECL int archive_read_extract2(struct archive *, struct archive_entry *, + struct archive * /* dest */); +__LA_DECL void archive_read_extract_set_progress_callback(struct archive *, void (*_progress_func)(void *), void *_user_data); /* Record the dev/ino of a file that will not be written. This is * generally set to the dev/ino of the archive being read. */ -void archive_read_extract_set_skip_file(struct archive *, +__LA_DECL void archive_read_extract_set_skip_file(struct archive *, dev_t, ino_t); /* Close the file and release most resources. */ -int archive_read_close(struct archive *); +__LA_DECL int archive_read_close(struct archive *); /* Release all resources and destroy the object. */ /* Note that archive_read_finish will call archive_read_close for you. */ -#if ARCHIVE_API_VERSION > 1 -int archive_read_finish(struct archive *); +#if ARCHIVE_VERSION_NUMBER >= 2000000 +__LA_DECL int archive_read_finish(struct archive *); #else /* Temporarily allow library to compile with either 1.x or 2.0 API. */ /* Erroneously declared to return void in libarchive 1.x */ -void archive_read_finish(struct archive *); +__LA_DECL void archive_read_finish(struct archive *); #endif /*- @@ -393,74 +437,75 @@ void archive_read_finish(struct archive *); * 5) archive_write_close to close the output * 6) archive_write_finish to cleanup the writer and release resources */ -struct archive *archive_write_new(void); -int archive_write_set_bytes_per_block(struct archive *, +__LA_DECL struct archive *archive_write_new(void); +__LA_DECL int archive_write_set_bytes_per_block(struct archive *, int bytes_per_block); -int archive_write_get_bytes_per_block(struct archive *); +__LA_DECL int archive_write_get_bytes_per_block(struct archive *); /* XXX This is badly misnamed; suggestions appreciated. XXX */ -int archive_write_set_bytes_in_last_block(struct archive *, +__LA_DECL int archive_write_set_bytes_in_last_block(struct archive *, int bytes_in_last_block); -int archive_write_get_bytes_in_last_block(struct archive *); +__LA_DECL int archive_write_get_bytes_in_last_block(struct archive *); /* The dev/ino of a file that won't be archived. This is used * to avoid recursively adding an archive to itself. */ -int archive_write_set_skip_file(struct archive *, dev_t, ino_t); +__LA_DECL int archive_write_set_skip_file(struct archive *, dev_t, ino_t); -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 *, +__LA_DECL int archive_write_set_compression_bzip2(struct archive *); +__LA_DECL int archive_write_set_compression_compress(struct archive *); +__LA_DECL int archive_write_set_compression_gzip(struct archive *); +__LA_DECL int archive_write_set_compression_none(struct archive *); +__LA_DECL int archive_write_set_compression_program(struct archive *, const char *cmd); /* A convenience function to set the format based on the code or name. */ -int archive_write_set_format(struct archive *, int format_code); -int archive_write_set_format_by_name(struct archive *, +__LA_DECL int archive_write_set_format(struct archive *, int format_code); +__LA_DECL int archive_write_set_format_by_name(struct archive *, const char *name); /* To minimize link pollution, use one or more of the following. */ -int archive_write_set_format_ar_bsd(struct archive *); -int archive_write_set_format_ar_svr4(struct archive *); -int archive_write_set_format_cpio(struct archive *); -int archive_write_set_format_cpio_newc(struct archive *); +__LA_DECL int archive_write_set_format_ar_bsd(struct archive *); +__LA_DECL int archive_write_set_format_ar_svr4(struct archive *); +__LA_DECL int archive_write_set_format_cpio(struct archive *); +__LA_DECL int archive_write_set_format_cpio_newc(struct archive *); /* TODO: int archive_write_set_format_old_tar(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_dump(struct archive *); -int archive_write_set_format_ustar(struct archive *); -int archive_write_open(struct archive *, void *, +__LA_DECL int archive_write_set_format_pax(struct archive *); +__LA_DECL int archive_write_set_format_pax_restricted(struct archive *); +__LA_DECL int archive_write_set_format_shar(struct archive *); +__LA_DECL int archive_write_set_format_shar_dump(struct archive *); +__LA_DECL int archive_write_set_format_ustar(struct archive *); +__LA_DECL int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, archive_close_callback *); -int archive_write_open_fd(struct archive *, int _fd); -int archive_write_open_filename(struct archive *, const char *_file); +__LA_DECL int archive_write_open_fd(struct archive *, int _fd); +__LA_DECL int archive_write_open_filename(struct archive *, const char *_file); /* A deprecated synonym for archive_write_open_filename() */ -int archive_write_open_file(struct archive *, const char *_file); -int archive_write_open_FILE(struct archive *, FILE *); +__LA_DECL int archive_write_open_file(struct archive *, const char *_file); +__LA_DECL int archive_write_open_FILE(struct archive *, FILE *); /* _buffSize is the size of the buffer, _used refers to a variable that * will be updated after each write into the buffer. */ -int archive_write_open_memory(struct archive *, +__LA_DECL int archive_write_open_memory(struct archive *, void *_buffer, size_t _buffSize, size_t *_used); /* * Note that the library will truncate writes beyond the size provided * to archive_write_header or pad if the provided data is short. */ -int archive_write_header(struct archive *, +__LA_DECL int archive_write_header(struct archive *, struct archive_entry *); -#if ARCHIVE_API_VERSION > 1 -ssize_t archive_write_data(struct archive *, const void *, size_t); +#if ARCHIVE_VERSION_NUMBER >= 2000000 +__LA_DECL __LA_SSIZE_T archive_write_data(struct archive *, const void *, size_t); #else /* Temporarily allow library to compile with either 1.x or 2.0 API. */ /* This was erroneously declared to return "int" in libarchive 1.x. */ -int archive_write_data(struct archive *, const void *, size_t); +__LA_DECL int archive_write_data(struct archive *, const void *, size_t); #endif -ssize_t archive_write_data_block(struct archive *, const void *, size_t, off_t); -int archive_write_finish_entry(struct archive *); -int archive_write_close(struct archive *); -#if ARCHIVE_API_VERSION > 1 -int archive_write_finish(struct archive *); +__LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *, const void *, size_t, off_t); +__LA_DECL int archive_write_finish_entry(struct archive *); +__LA_DECL int archive_write_close(struct archive *); +#if ARCHIVE_VERSION_NUMBER >= 2000000 +__LA_DECL int archive_write_finish(struct archive *); #else /* Temporarily allow library to compile with either 1.x or 2.0 API. */ /* Return value was incorrect in libarchive 1.x. */ -void archive_write_finish(struct archive *); +__LA_DECL void archive_write_finish(struct archive *); #endif /*- @@ -477,12 +522,12 @@ void archive_write_finish(struct archive *); * In particular, you can use this in conjunction with archive_read() * to pull entries out of an archive and create them on disk. */ -struct archive *archive_write_disk_new(void); +__LA_DECL struct archive *archive_write_disk_new(void); /* This file will not be overwritten. */ -int archive_write_disk_set_skip_file(struct archive *, +__LA_DECL int archive_write_disk_set_skip_file(struct archive *, dev_t, ino_t); /* Set flags to control how the next item gets created. */ -int archive_write_disk_set_options(struct archive *, +__LA_DECL int archive_write_disk_set_options(struct archive *, int flags); /* * The lookup functions are given uname/uid (or gname/gid) pairs and @@ -501,42 +546,47 @@ int archive_write_disk_set_options(struct archive *, * particular, these match the specifications of POSIX "pax" and old * POSIX "tar". */ -int archive_write_disk_set_standard_lookup(struct archive *); +__LA_DECL int archive_write_disk_set_standard_lookup(struct archive *); /* * If neither the default (naive) nor the standard (big) functions suit * your needs, you can write your own and register them. Be sure to * include a cleanup function if you have allocated private data. */ -int archive_write_disk_set_group_lookup(struct archive *, - void *private_data, - gid_t (*loookup)(void *, const char *gname, gid_t gid), - void (*cleanup)(void *)); -int archive_write_disk_set_user_lookup(struct archive *, - void *private_data, - uid_t (*)(void *, const char *uname, uid_t uid), - void (*cleanup)(void *)); +__LA_DECL int archive_write_disk_set_group_lookup(struct archive *, + void * /* private_data */, + __LA_GID_T (*)(void *, const char *, __LA_GID_T), + void (* /* cleanup */)(void *)); +__LA_DECL int archive_write_disk_set_user_lookup(struct archive *, + void * /* private_data */, + __LA_UID_T (*)(void *, const char *, __LA_UID_T), + void (* /* cleanup */)(void *)); /* * Accessor functions to read/set various information in * the struct archive object: */ /* Bytes written after compression or read before decompression. */ -int64_t archive_position_compressed(struct archive *); +__LA_DECL int64_t archive_position_compressed(struct archive *); /* Bytes written to compressor or read from decompressor. */ -int64_t archive_position_uncompressed(struct archive *); - -const char *archive_compression_name(struct archive *); -int archive_compression(struct archive *); -int archive_errno(struct archive *); -const char *archive_error_string(struct archive *); -const char *archive_format_name(struct archive *); -int archive_format(struct archive *); -void archive_clear_error(struct archive *); -void archive_set_error(struct archive *, int _err, const char *fmt, ...); -void archive_copy_error(struct archive *dest, struct archive *src); +__LA_DECL int64_t archive_position_uncompressed(struct archive *); + +__LA_DECL const char *archive_compression_name(struct archive *); +__LA_DECL int archive_compression(struct archive *); +__LA_DECL int archive_errno(struct archive *); +__LA_DECL const char *archive_error_string(struct archive *); +__LA_DECL const char *archive_format_name(struct archive *); +__LA_DECL int archive_format(struct archive *); +__LA_DECL void archive_clear_error(struct archive *); +__LA_DECL void archive_set_error(struct archive *, int _err, + const char *fmt, ...); +__LA_DECL void archive_copy_error(struct archive *dest, + struct archive *src); #ifdef __cplusplus } #endif +/* This is meaningless outside of this header. */ +#undef __LA_DECL + #endif /* !ARCHIVE_H_INCLUDED */ diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_check_magic.c b/libarchive/libarchive-2.5.5/libarchive/archive_check_magic.c index 715486d..715486d 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_check_magic.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_check_magic.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_endian.h b/libarchive/libarchive-2.5.5/libarchive/archive_endian.h index 259f5de..550be16 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_endian.h +++ b/libarchive/libarchive-2.5.5/libarchive/archive_endian.h @@ -23,14 +23,28 @@ * 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 $ + * $FreeBSD: src/lib/libarchive/archive_endian.h,v 1.3 2008/05/26 17:00:22 kientzle Exp $ * * Borrowed from FreeBSD's <sys/endian.h> */ +/* Note: This is a purely internal header! */ +/* Do not use this outside of libarchive internal code! */ + #ifndef ARCHIVE_ENDIAN_H_INCLUDED #define ARCHIVE_ENDIAN_H_INCLUDED + +/* Watcom C++ doesn't support 'inline' in C code. (For any version?) */ +#if defined( __WATCOMC__ ) + #define inline +#endif + +/* Visual C++ 6.0 doesn't support 'inline' in C code. (Does VC7? VC8?) */ +#if defined(_MSC_VER) + #define inline +#endif + /* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ static inline uint16_t diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_entry.3 b/libarchive/libarchive-2.5.5/libarchive/archive_entry.3 index 6b1b270..9ceb18b 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_entry.3 +++ b/libarchive/libarchive-2.5.5/libarchive/archive_entry.3 @@ -22,9 +22,9 @@ .\" 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 $ +.\" $FreeBSD: src/lib/libarchive/archive_entry.3,v 1.18 2008/05/26 17:00:22 kientzle Exp $ .\" -.Dd December 15, 2003 +.Dd May 12, 2008 .Dt archive_entry 3 .Os .Sh NAME @@ -40,12 +40,16 @@ .Nm archive_entry_atime_nsec , .Nm archive_entry_clear , .Nm archive_entry_clone , +.Nm archive_entry_copy_fflags_text , .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_link , +.Nm archive_entry_copy_link_w , .Nm archive_entry_copy_pathname_w , +.Nm archive_entry_copy_sourcepath , .Nm archive_entry_copy_stat , .Nm archive_entry_copy_symlink , .Nm archive_entry_copy_symlink_w , @@ -93,6 +97,7 @@ .Nm archive_entry_set_uid , .Nm archive_entry_set_uname , .Nm archive_entry_size , +.Nm archive_entry_sourcepath , .Nm archive_entry_stat , .Nm archive_entry_symlink , .Nm archive_entry_uid , @@ -101,17 +106,47 @@ .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" +.Fo archive_entry_acl_add_entry +.Fa "struct archive_entry *" +.Fa "int type" +.Fa "int permset" +.Fa "int tag" +.Fa "int qual" +.Fa "const char *name" +.Fc +.Ft void +.Fo archive_entry_acl_add_entry_w +.Fa "struct archive_entry *" +.Fa "int type" +.Fa "int permset" +.Fa "int tag" +.Fa "int qual" +.Fa "const wchar_t *name" +.Fc .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" +.Fo archive_entry_acl_next +.Fa "struct archive_entry *" +.Fa "int want_type" +.Fa "int *type" +.Fa "int *permset" +.Fa "int *tag" +.Fa "int *qual" +.Fa "const char **name" +.Fc .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" +.Fo archive_entry_acl_next_w +.Fa "struct archive_entry *" +.Fa "int want_type" +.Fa "int *type" +.Fa "int *permset" +.Fa "int *tag" +.Fa "int *qual" +.Fa "const wchar_t **name" +.Fc .Ft int .Fn archive_entry_acl_reset "struct archive_entry *" "int want_type" .Ft const wchar_t * @@ -124,6 +159,8 @@ .Fn archive_entry_clear "struct archive_entry *" .Ft struct archive_entry * .Fn archive_entry_clone "struct archive_entry *" +.Ft const char * * +.Fn archive_entry_copy_fflags_text_w "struct archive_entry *" "const char *" .Ft const wchar_t * .Fn archive_entry_copy_fflags_text_w "struct archive_entry *" "const wchar_t *" .Ft void @@ -135,6 +172,8 @@ .Ft void .Fn archive_entry_copy_hardlink_w "struct archive_entry *" "const wchar_t *" .Ft void +.Fn archive_entry_copy_sourcepath "struct archive_entry *" "const char *" +.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 *" @@ -155,7 +194,11 @@ .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" +.Fo archive_entry_fflags +.Fa "struct archive_entry *" +.Fa "unsigned long *set" +.Fa "unsigned long *clear" +.Fc .Ft const char * .Fn archive_entry_fflags_text "struct archive_entry *" .Ft void @@ -195,7 +238,11 @@ .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" +.Fo archive_entry_set_fflags +.Fa "struct archive_entry *" +.Fa "unsigned long set" +.Fa "unsigned long clear" +.Fc .Ft void .Fn archive_entry_set_gid "struct archive_entry *" "gid_t" .Ft void @@ -230,6 +277,8 @@ .Fn archive_entry_set_uname "struct archive_entry *" "const char *" .Ft int64_t .Fn archive_entry_size "struct archive_entry *" +.Ft const char * +.Fn archive_entry_sourcepath "struct archive_entry *" .Ft const struct stat * .Fn archive_entry_stat "struct archive_entry *" .Ft const char * @@ -336,8 +385,10 @@ will be ignored. .Pp The canonical text format is a comma-separated list of flag names. The +.Fn archive_entry_copy_fflags_text +and .Fn archive_entry_copy_fflags_text_w -function parses the provided text and sets the internal bitmap values. +functions parse 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 diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_entry.c b/libarchive/libarchive-2.5.5/libarchive/archive_entry.c index a6c9b44..69921c3 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_entry.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_entry.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.45 2007/12/30 04:58:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.52 2008/05/26 17:00:22 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -91,15 +91,17 @@ static void aes_clean(struct aes *); static void aes_copy(struct aes *dest, struct aes *src); static const char * aes_get_mbs(struct aes *); static const wchar_t * aes_get_wcs(struct aes *); -static void aes_set_mbs(struct aes *, const char *mbs); -static void aes_copy_mbs(struct aes *, const char *mbs); +static int aes_set_mbs(struct aes *, const char *mbs); +static int aes_copy_mbs(struct aes *, const char *mbs); /* static void aes_set_wcs(struct aes *, const wchar_t *wcs); */ -static void aes_copy_wcs(struct aes *, const wchar_t *wcs); -static void aes_copy_wcs_len(struct aes *, const wchar_t *wcs, size_t); +static int aes_copy_wcs(struct aes *, const wchar_t *wcs); +static int aes_copy_wcs_len(struct aes *, const wchar_t *wcs, size_t); static char * ae_fflagstostr(unsigned long bitset, unsigned long bitclear); static const wchar_t *ae_wcstofflags(const wchar_t *stringp, unsigned long *setp, unsigned long *clrp); +static const char *ae_strtofflags(const char *stringp, + unsigned long *setp, unsigned long *clrp); static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag, const wchar_t *wname, int perm, int id); static void append_id_w(wchar_t **wp, int id); @@ -144,173 +146,216 @@ static size_t wcslen(const wchar_t *s) #define wmemcpy(a,b,i) (wchar_t *)memcpy((a), (b), (i) * sizeof(wchar_t)) #endif - static void aes_clean(struct aes *aes) { - if (aes->aes_mbs_alloc) { - free(aes->aes_mbs_alloc); - aes->aes_mbs_alloc = NULL; - } - if (aes->aes_wcs_alloc) { - free(aes->aes_wcs_alloc); - aes->aes_wcs_alloc = NULL; + if (aes->aes_wcs) { + free((wchar_t *)(uintptr_t)aes->aes_wcs); + aes->aes_wcs = NULL; } - memset(aes, 0, sizeof(*aes)); + archive_string_free(&(aes->aes_mbs)); + archive_string_free(&(aes->aes_utf8)); + aes->aes_set = 0; } static void aes_copy(struct aes *dest, struct aes *src) { - *dest = *src; - if (src->aes_mbs != NULL) { - dest->aes_mbs_alloc = strdup(src->aes_mbs); - dest->aes_mbs = dest->aes_mbs_alloc; - if (dest->aes_mbs == NULL) - __archive_errx(1, "No memory for aes_copy()"); - } + wchar_t *wp; + + dest->aes_set = src->aes_set; + archive_string_copy(&(dest->aes_mbs), &(src->aes_mbs)); + archive_string_copy(&(dest->aes_utf8), &(src->aes_utf8)); if (src->aes_wcs != NULL) { - dest->aes_wcs_alloc = (wchar_t *)malloc((wcslen(src->aes_wcs) + 1) + wp = (wchar_t *)malloc((wcslen(src->aes_wcs) + 1) * sizeof(wchar_t)); - dest->aes_wcs = dest->aes_wcs_alloc; - if (dest->aes_wcs == NULL) + if (wp == NULL) __archive_errx(1, "No memory for aes_copy()"); - wcscpy(dest->aes_wcs_alloc, src->aes_wcs); + wcscpy(wp, src->aes_wcs); + dest->aes_wcs = wp; + } +} + +static const char * +aes_get_utf8(struct aes *aes) +{ + if (aes->aes_set & AES_SET_UTF8) + return (aes->aes_utf8.s); + if ((aes->aes_set & AES_SET_WCS) + && archive_strappend_w_utf8(&(aes->aes_utf8), aes->aes_wcs) != NULL) { + aes->aes_set |= AES_SET_UTF8; + return (aes->aes_utf8.s); } + return (NULL); } static const char * aes_get_mbs(struct aes *aes) { - if (aes->aes_mbs == NULL && aes->aes_wcs == NULL) - return NULL; - if (aes->aes_mbs == NULL && aes->aes_wcs != NULL) { - /* - * XXX Need to estimate the number of byte in the - * multi-byte form. Assume that, on average, wcs - * chars encode to no more than 3 bytes. There must - * be a better way... XXX - */ - size_t mbs_length = wcslen(aes->aes_wcs) * 3 + 64; - - aes->aes_mbs_alloc = (char *)malloc(mbs_length); - aes->aes_mbs = aes->aes_mbs_alloc; - if (aes->aes_mbs == NULL) - __archive_errx(1, "No memory for aes_get_mbs()"); - wcstombs(aes->aes_mbs_alloc, aes->aes_wcs, mbs_length - 1); - aes->aes_mbs_alloc[mbs_length - 1] = 0; + /* If we already have an MBS form, return that immediately. */ + if (aes->aes_set & AES_SET_MBS) + return (aes->aes_mbs.s); + /* If there's a WCS form, try converting with the native locale. */ + if ((aes->aes_set & AES_SET_WCS) + && archive_strappend_w_mbs(&(aes->aes_mbs), aes->aes_wcs) != NULL) { + aes->aes_set |= AES_SET_MBS; + return (aes->aes_mbs.s); } - return (aes->aes_mbs); + /* We'll use UTF-8 for MBS if all else fails. */ + return (aes_get_utf8(aes)); } static const wchar_t * aes_get_wcs(struct aes *aes) { + wchar_t *w; int r; - if (aes->aes_wcs == NULL && aes->aes_mbs == NULL) - return NULL; - if (aes->aes_wcs == NULL && aes->aes_mbs != NULL) { + /* Return WCS form if we already have it. */ + if (aes->aes_set & AES_SET_WCS) + return (aes->aes_wcs); + + if (aes->aes_set & AES_SET_MBS) { + /* Try converting MBS to WCS using native locale. */ /* * No single byte will be more than one wide character, * so this length estimate will always be big enough. */ - size_t wcs_length = strlen(aes->aes_mbs); + size_t wcs_length = aes->aes_mbs.length; - aes->aes_wcs_alloc - = (wchar_t *)malloc((wcs_length + 1) * sizeof(wchar_t)); - aes->aes_wcs = aes->aes_wcs_alloc; - if (aes->aes_wcs == NULL) + w = (wchar_t *)malloc((wcs_length + 1) * sizeof(wchar_t)); + if (w == NULL) __archive_errx(1, "No memory for aes_get_wcs()"); - 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; + r = mbstowcs(w, aes->aes_mbs.s, wcs_length); + w[wcs_length] = 0; + if (r > 0) { + aes->aes_set |= AES_SET_WCS; + return (aes->aes_wcs = w); } + free(w); } - return (aes->aes_wcs); + + if (aes->aes_set & AES_SET_UTF8) { + /* Try converting UTF8 to WCS. */ + aes->aes_wcs = __archive_string_utf8_w(&(aes->aes_utf8)); + aes->aes_set |= AES_SET_WCS; + return (aes->aes_wcs); + } + return (NULL); } -static void +static int aes_set_mbs(struct aes *aes, const char *mbs) { - if (aes->aes_mbs_alloc) { - free(aes->aes_mbs_alloc); - aes->aes_mbs_alloc = NULL; - } - if (aes->aes_wcs_alloc) { - free(aes->aes_wcs_alloc); - aes->aes_wcs_alloc = NULL; - } - aes->aes_mbs = mbs; - aes->aes_wcs = NULL; + return (aes_copy_mbs(aes, mbs)); } -static void +static int aes_copy_mbs(struct aes *aes, const char *mbs) { - if (aes->aes_mbs_alloc) { - free(aes->aes_mbs_alloc); - aes->aes_mbs_alloc = NULL; + if (mbs == NULL) { + aes->aes_set = 0; + return (0); } - if (aes->aes_wcs_alloc) { - free(aes->aes_wcs_alloc); - aes->aes_wcs_alloc = NULL; + aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */ + archive_strcpy(&(aes->aes_mbs), mbs); + archive_string_empty(&(aes->aes_utf8)); + if (aes->aes_wcs) { + free((wchar_t *)(uintptr_t)aes->aes_wcs); + aes->aes_wcs = NULL; } - aes->aes_mbs_alloc = (char *)malloc((strlen(mbs) + 1) * sizeof(char)); - if (aes->aes_mbs_alloc == NULL) - __archive_errx(1, "No memory for aes_copy_mbs()"); - strcpy(aes->aes_mbs_alloc, mbs); - aes->aes_mbs = aes->aes_mbs_alloc; - aes->aes_wcs = NULL; + return (0); } -#if 0 -static void -aes_set_wcs(struct aes *aes, const wchar_t *wcs) +/* + * The 'update' form tries to proactively update all forms of + * this string (WCS and MBS) and returns an error if any of + * them fail. This is used by the 'pax' handler, for instance, + * to detect and report character-conversion failures early while + * still allowing clients to get potentially useful values from + * the more tolerant lazy conversions. (get_mbs and get_wcs will + * strive to give the user something useful, so you can get hopefully + * usable values even if some of the character conversions are failing.) + */ +static int +aes_update_utf8(struct aes *aes, const char *utf8) { - if (aes->aes_mbs_alloc) { - free(aes->aes_mbs_alloc); - aes->aes_mbs_alloc = NULL; + if (utf8 == NULL) { + aes->aes_set = 0; + return (1); /* Succeeded in clearing everything. */ } - if (aes->aes_wcs_alloc) { - free(aes->aes_wcs_alloc); - aes->aes_wcs_alloc = NULL; + + /* Save the UTF8 string. */ + archive_strcpy(&(aes->aes_utf8), utf8); + + /* Empty the mbs and wcs strings. */ + archive_string_empty(&(aes->aes_mbs)); + if (aes->aes_wcs) { + free((wchar_t *)(uintptr_t)aes->aes_wcs); + aes->aes_wcs = NULL; } - aes->aes_mbs = NULL; - aes->aes_wcs = wcs; + + aes->aes_set = AES_SET_UTF8; /* Only UTF8 is set now. */ + + /* TODO: We should just do a direct UTF-8 to MBS conversion + * here. That would be faster, use less space, and give the + * same information. (If a UTF-8 to MBS conversion succeeds, + * then UTF-8->WCS and Unicode->MBS conversions will both + * succeed.) */ + + /* Try converting UTF8 to WCS, return false on failure. */ + aes->aes_wcs = __archive_string_utf8_w(&(aes->aes_utf8)); + if (aes->aes_wcs == NULL) + return (0); + aes->aes_set = AES_SET_UTF8 | AES_SET_WCS; /* Both UTF8 and WCS set. */ + + /* Try converting WCS to MBS, return false on failure. */ + if (archive_strappend_w_mbs(&(aes->aes_mbs), aes->aes_wcs) == NULL) + return (0); + aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS; + + /* All conversions succeeded. */ + return (1); } -#endif -static void +static int aes_copy_wcs(struct aes *aes, const wchar_t *wcs) { - aes_copy_wcs_len(aes, wcs, wcslen(wcs)); + return aes_copy_wcs_len(aes, wcs, wcs == NULL ? 0 : wcslen(wcs)); } -static void +static int aes_copy_wcs_len(struct aes *aes, const wchar_t *wcs, size_t len) { - if (aes->aes_mbs_alloc) { - free(aes->aes_mbs_alloc); - aes->aes_mbs_alloc = NULL; + wchar_t *w; + + if (wcs == NULL) { + aes->aes_set = 0; + return (0); } - if (aes->aes_wcs_alloc) { - free(aes->aes_wcs_alloc); - aes->aes_wcs_alloc = NULL; + aes->aes_set = AES_SET_WCS; /* Only WCS form set. */ + archive_string_empty(&(aes->aes_mbs)); + archive_string_empty(&(aes->aes_utf8)); + if (aes->aes_wcs) { + free((wchar_t *)(uintptr_t)aes->aes_wcs); + aes->aes_wcs = NULL; } - aes->aes_mbs = NULL; - aes->aes_wcs_alloc = (wchar_t *)malloc((len + 1) * sizeof(wchar_t)); - if (aes->aes_wcs_alloc == NULL) + w = (wchar_t *)malloc((len + 1) * sizeof(wchar_t)); + if (w == NULL) __archive_errx(1, "No memory for aes_copy_wcs()"); - wmemcpy(aes->aes_wcs_alloc, wcs, len); - aes->aes_wcs_alloc[len] = L'\0'; - aes->aes_wcs = aes->aes_wcs_alloc; + wmemcpy(w, wcs, len); + w[len] = L'\0'; + aes->aes_wcs = w; + return (0); } +/**************************************************************************** + * + * Public Interface + * + ****************************************************************************/ + struct archive_entry * archive_entry_clear(struct archive_entry *entry) { @@ -350,6 +395,8 @@ archive_entry_clone(struct archive_entry *entry) aes_copy(&entry2->ae_hardlink, &entry->ae_hardlink); aes_copy(&entry2->ae_pathname, &entry->ae_pathname); aes_copy(&entry2->ae_symlink, &entry->ae_symlink); + entry2->ae_hardlinkset = entry->ae_hardlinkset; + entry2->ae_symlinkset = entry->ae_symlinkset; aes_copy(&entry2->ae_uname, &entry->ae_uname); /* Copy ACL data over. */ @@ -515,12 +562,16 @@ archive_entry_gname_w(struct archive_entry *entry) const char * archive_entry_hardlink(struct archive_entry *entry) { + if (!entry->ae_hardlinkset) + return (NULL); return (aes_get_mbs(&entry->ae_hardlink)); } const wchar_t * archive_entry_hardlink_w(struct archive_entry *entry) { + if (!entry->ae_hardlinkset) + return (NULL); return (aes_get_wcs(&entry->ae_hardlink)); } @@ -601,14 +652,24 @@ archive_entry_size(struct archive_entry *entry) } const char * +archive_entry_sourcepath(struct archive_entry *entry) +{ + return (aes_get_mbs(&entry->ae_sourcepath)); +} + +const char * archive_entry_symlink(struct archive_entry *entry) { + if (!entry->ae_symlinkset) + return (NULL); return (aes_get_mbs(&entry->ae_symlink)); } const wchar_t * archive_entry_symlink_w(struct archive_entry *entry) { + if (!entry->ae_symlinkset) + return (NULL); return (aes_get_wcs(&entry->ae_symlink)); } @@ -651,6 +712,15 @@ archive_entry_set_fflags(struct archive_entry *entry, entry->ae_fflags_clear = clear; } +const char * +archive_entry_copy_fflags_text(struct archive_entry *entry, + const char *flags) +{ + aes_copy_mbs(&entry->ae_fflags_text, flags); + return (ae_strtofflags(flags, + &entry->ae_fflags_set, &entry->ae_fflags_clear)); +} + const wchar_t * archive_entry_copy_fflags_text_w(struct archive_entry *entry, const wchar_t *flags) @@ -685,6 +755,12 @@ archive_entry_copy_gname_w(struct archive_entry *entry, const wchar_t *name) aes_copy_wcs(&entry->ae_gname, name); } +int +archive_entry_update_gname_utf8(struct archive_entry *entry, const char *name) +{ + return (aes_update_utf8(&entry->ae_gname, name)); +} + void archive_entry_set_ino(struct archive_entry *entry, unsigned long ino) { @@ -696,18 +772,24 @@ void archive_entry_set_hardlink(struct archive_entry *entry, const char *target) { aes_set_mbs(&entry->ae_hardlink, target); + if (target != NULL) + entry->ae_hardlinkset = 1; } void archive_entry_copy_hardlink(struct archive_entry *entry, const char *target) { aes_copy_mbs(&entry->ae_hardlink, target); + if (target != NULL) + entry->ae_hardlinkset = 1; } void archive_entry_copy_hardlink_w(struct archive_entry *entry, const wchar_t *target) { aes_copy_wcs(&entry->ae_hardlink, target); + if (target != NULL) + entry->ae_hardlinkset = 1; } void @@ -754,8 +836,7 @@ archive_entry_set_devminor(struct archive_entry *entry, dev_t m) void archive_entry_set_link(struct archive_entry *entry, const char *target) { - if (entry->ae_symlink.aes_mbs != NULL || - entry->ae_symlink.aes_wcs != NULL) + if (entry->ae_symlinkset) aes_set_mbs(&entry->ae_symlink, target); else aes_set_mbs(&entry->ae_hardlink, target); @@ -765,8 +846,7 @@ archive_entry_set_link(struct archive_entry *entry, const char *target) 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) + if (entry->ae_symlinkset) aes_copy_mbs(&entry->ae_symlink, target); else aes_copy_mbs(&entry->ae_hardlink, target); @@ -776,13 +856,21 @@ archive_entry_copy_link(struct archive_entry *entry, const char *target) 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) + if (entry->ae_symlinkset) aes_copy_wcs(&entry->ae_symlink, target); else aes_copy_wcs(&entry->ae_hardlink, target); } +int +archive_entry_update_link_utf8(struct archive_entry *entry, const char *target) +{ + if (entry->ae_symlinkset) + return (aes_update_utf8(&entry->ae_symlink, target)); + else + return (aes_update_utf8(&entry->ae_hardlink, target)); +} + void archive_entry_set_mode(struct archive_entry *entry, mode_t m) { @@ -823,6 +911,12 @@ archive_entry_copy_pathname_w(struct archive_entry *entry, const wchar_t *name) aes_copy_wcs(&entry->ae_pathname, name); } +int +archive_entry_update_pathname_utf8(struct archive_entry *entry, const char *name) +{ + return (aes_update_utf8(&entry->ae_pathname, name)); +} + void archive_entry_set_perm(struct archive_entry *entry, mode_t p) { @@ -863,21 +957,33 @@ archive_entry_set_size(struct archive_entry *entry, int64_t s) } void +archive_entry_copy_sourcepath(struct archive_entry *entry, const char *path) +{ + aes_set_mbs(&entry->ae_sourcepath, path); +} + +void archive_entry_set_symlink(struct archive_entry *entry, const char *linkname) { aes_set_mbs(&entry->ae_symlink, linkname); + if (linkname != NULL) + entry->ae_symlinkset = 1; } void archive_entry_copy_symlink(struct archive_entry *entry, const char *linkname) { aes_copy_mbs(&entry->ae_symlink, linkname); + if (linkname != NULL) + entry->ae_symlinkset = 1; } void archive_entry_copy_symlink_w(struct archive_entry *entry, const wchar_t *linkname) { aes_copy_wcs(&entry->ae_symlink, linkname); + if (linkname != NULL) + entry->ae_symlinkset = 1; } void @@ -905,6 +1011,12 @@ archive_entry_copy_uname_w(struct archive_entry *entry, const wchar_t *name) aes_copy_wcs(&entry->ae_uname, name); } +int +archive_entry_update_uname_utf8(struct archive_entry *entry, const char *name) +{ + return (aes_update_utf8(&entry->ae_uname, name)); +} + /* * ACL management. The following would, of course, be a lot simpler * if: 1) the last draft of POSIX.1e were a really thorough and @@ -1155,6 +1267,11 @@ archive_entry_acl_next(struct archive_entry *entry, int want_type, int *type, entry->acl_p = entry->acl_p->next; if (entry->acl_p == NULL) { entry->acl_state = 0; + *type = 0; + *permset = 0; + *tag = 0; + *id = -1; + *name = NULL; return (ARCHIVE_EOF); /* End of ACL entries. */ } *type = entry->acl_p->type; @@ -1536,7 +1653,7 @@ archive_entry_xattr_next(struct archive_entry * entry, return (ARCHIVE_OK); } else { *name = NULL; - *name = NULL; + *value = NULL; *size = (size_t)0; return (ARCHIVE_WARN); } @@ -1739,7 +1856,7 @@ static struct flag { * Convert file flags to a comma-separated string. If no flags * are set, return the empty string. */ -char * +static char * ae_fflagstostr(unsigned long bitset, unsigned long bitclear) { char *string, *dp; @@ -1784,6 +1901,70 @@ ae_fflagstostr(unsigned long bitset, unsigned long bitclear) } /* + * strtofflags -- + * Take string of arguments and return file flags. This + * version works a little differently than strtofflags(3). + * In particular, it always tests every token, skipping any + * unrecognized tokens. It returns a pointer to the first + * unrecognized token, or NULL if every token was recognized. + * This version is also const-correct and does not modify the + * provided string. + */ +static const char * +ae_strtofflags(const char *s, unsigned long *setp, unsigned long *clrp) +{ + const char *start, *end; + struct flag *flag; + unsigned long set, clear; + const char *failed; + + set = clear = 0; + start = s; + failed = NULL; + /* Find start of first token. */ + while (*start == '\t' || *start == ' ' || *start == ',') + start++; + while (*start != '\0') { + /* Locate end of token. */ + end = start; + while (*end != '\0' && *end != '\t' && + *end != ' ' && *end != ',') + end++; + for (flag = flags; flag->name != NULL; flag++) { + if (memcmp(start, flag->name, end - start) == 0) { + /* Matched "noXXXX", so reverse the sense. */ + clear |= flag->set; + set |= flag->clear; + break; + } else if (memcmp(start, flag->name + 2, end - start) + == 0) { + /* Matched "XXXX", so don't reverse. */ + set |= flag->set; + clear |= flag->clear; + break; + } + } + /* Ignore unknown flag names. */ + if (flag->name == NULL && failed == NULL) + failed = start; + + /* Find start of next token. */ + start = end; + while (*start == '\t' || *start == ' ' || *start == ',') + start++; + + } + + if (setp) + *setp = set; + if (clrp) + *clrp = clear; + + /* Return location of first failure. */ + return (failed); +} + +/* * wcstofflags -- * Take string of arguments and return file flags. This * version works a little differently than strtofflags(3). @@ -1793,7 +1974,7 @@ ae_fflagstostr(unsigned long bitset, unsigned long bitclear) * This version is also const-correct and does not modify the * provided string. */ -const wchar_t * +static const wchar_t * ae_wcstofflags(const wchar_t *s, unsigned long *setp, unsigned long *clrp) { const wchar_t *start, *end; diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_entry.h b/libarchive/libarchive-2.5.5/libarchive/archive_entry.h index cebd55b..ee96c56 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_entry.h +++ b/libarchive/libarchive-2.5.5/libarchive/archive_entry.h @@ -22,16 +22,71 @@ * (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.24 2007/12/30 04:58:21 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.27 2008/05/26 17:00:22 kientzle Exp $ */ #ifndef ARCHIVE_ENTRY_H_INCLUDED #define ARCHIVE_ENTRY_H_INCLUDED +/* + * Note: archive_entry.h is for use outside of libarchive; the + * configuration headers (config.h, archive_platform.h, etc.) are + * purely internal. Do NOT use HAVE_XXX configuration macros to + * control the behavior of this header! If you must conditionalize, + * use predefined compiler and/or platform macros. + */ + #include <sys/types.h> #include <stddef.h> /* for wchar_t */ #include <time.h> + +/* Get appropriate definitions of standard POSIX-style types. */ +/* These should match the types used in 'struct stat' */ +#ifdef _WIN32 +#define __LA_UID_T unsigned int +#define __LA_GID_T unsigned int +#define __LA_DEV_T unsigned int +#define __LA_MODE_T unsigned short +#else #include <unistd.h> +#define __LA_UID_T uid_t +#define __LA_GID_T gid_t +#define __LA_DEV_T dev_t +#define __LA_MODE_T mode_t +#endif + +/* + * XXX Is this defined for all Windows compilers? If so, in what + * header? It would be nice to remove the __LA_INO_T indirection and + * just use plain ino_t everywhere. Likewise for the other types just + * above. + */ +#define __LA_INO_T ino_t + + +/* + * On Windows, define LIBARCHIVE_STATIC if you're building or using a + * .lib. The default here assumes you're building a DLL. Only + * libarchive source should ever define __LIBARCHIVE_BUILD. + */ +#if ((defined __WIN32__) || (defined _WIN32)) && (!defined LIBARCHIVE_STATIC) +# ifdef __LIBARCHIVE_BUILD +# ifdef __GNUC__ +# define __LA_DECL __attribute__((dllexport)) extern +# else +# define __LA_DECL __declspec(dllexport) +# endif +# else +# ifdef __GNUC__ +# define __LA_DECL __attribute__((dllimport)) extern +# else +# define __LA_DECL __declspec(dllimport) +# endif +# endif +#else +/* Static libraries on all platforms and shared libraries on non-Windows. */ +# define __LA_DECL +#endif #ifdef __cplusplus extern "C" { @@ -40,7 +95,7 @@ extern "C" { /* * Description of an archive entry. * - * Basically, a "struct stat" with a few text fields added in. + * You can think of this as "struct stat" with some text fields added in. * * TODO: Add "comment", "charset", and possibly other entries that are * supported by "pax interchange" format. However, GNU, ustar, cpio, @@ -89,50 +144,51 @@ struct archive_entry; * Basic object manipulation */ -struct archive_entry *archive_entry_clear(struct archive_entry *); +__LA_DECL struct archive_entry *archive_entry_clear(struct archive_entry *); /* The 'clone' function does a deep copy; all of the strings are copied too. */ -struct archive_entry *archive_entry_clone(struct archive_entry *); -void archive_entry_free(struct archive_entry *); -struct archive_entry *archive_entry_new(void); +__LA_DECL struct archive_entry *archive_entry_clone(struct archive_entry *); +__LA_DECL void archive_entry_free(struct archive_entry *); +__LA_DECL struct archive_entry *archive_entry_new(void); /* * Retrieve fields from an archive_entry. */ -time_t archive_entry_atime(struct archive_entry *); -long archive_entry_atime_nsec(struct archive_entry *); -time_t archive_entry_ctime(struct archive_entry *); -long archive_entry_ctime_nsec(struct archive_entry *); -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 *, +__LA_DECL time_t archive_entry_atime(struct archive_entry *); +__LA_DECL long archive_entry_atime_nsec(struct archive_entry *); +__LA_DECL time_t archive_entry_ctime(struct archive_entry *); +__LA_DECL long archive_entry_ctime_nsec(struct archive_entry *); +__LA_DECL dev_t archive_entry_dev(struct archive_entry *); +__LA_DECL dev_t archive_entry_devmajor(struct archive_entry *); +__LA_DECL dev_t archive_entry_devminor(struct archive_entry *); +__LA_DECL __LA_MODE_T archive_entry_filetype(struct archive_entry *); +__LA_DECL void archive_entry_fflags(struct archive_entry *, 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 *); -const wchar_t *archive_entry_gname_w(struct archive_entry *); -const char *archive_entry_hardlink(struct archive_entry *); -const wchar_t *archive_entry_hardlink_w(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 *); -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 *); -int64_t archive_entry_size(struct archive_entry *); -const char *archive_entry_strmode(struct archive_entry *); -const char *archive_entry_symlink(struct archive_entry *); -const wchar_t *archive_entry_symlink_w(struct archive_entry *); -uid_t archive_entry_uid(struct archive_entry *); -const char *archive_entry_uname(struct archive_entry *); -const wchar_t *archive_entry_uname_w(struct archive_entry *); +__LA_DECL const char *archive_entry_fflags_text(struct archive_entry *); +__LA_DECL __LA_GID_T archive_entry_gid(struct archive_entry *); +__LA_DECL const char *archive_entry_gname(struct archive_entry *); +__LA_DECL const wchar_t *archive_entry_gname_w(struct archive_entry *); +__LA_DECL const char *archive_entry_hardlink(struct archive_entry *); +__LA_DECL const wchar_t *archive_entry_hardlink_w(struct archive_entry *); +__LA_DECL __LA_INO_T archive_entry_ino(struct archive_entry *); +__LA_DECL __LA_MODE_T archive_entry_mode(struct archive_entry *); +__LA_DECL time_t archive_entry_mtime(struct archive_entry *); +__LA_DECL long archive_entry_mtime_nsec(struct archive_entry *); +__LA_DECL unsigned int archive_entry_nlink(struct archive_entry *); +__LA_DECL const char *archive_entry_pathname(struct archive_entry *); +__LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *); +__LA_DECL dev_t archive_entry_rdev(struct archive_entry *); +__LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *); +__LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *); +__LA_DECL const char *archive_entry_sourcepath(struct archive_entry *); +__LA_DECL int64_t archive_entry_size(struct archive_entry *); +__LA_DECL const char *archive_entry_strmode(struct archive_entry *); +__LA_DECL const char *archive_entry_symlink(struct archive_entry *); +__LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *); +__LA_DECL __LA_UID_T archive_entry_uid(struct archive_entry *); +__LA_DECL const char *archive_entry_uname(struct archive_entry *); +__LA_DECL const wchar_t *archive_entry_uname_w(struct archive_entry *); /* * Set fields in an archive_entry. @@ -141,48 +197,54 @@ const wchar_t *archive_entry_uname_w(struct archive_entry *); * In contrast, 'copy' functions do copy the object pointed to. */ -void archive_entry_set_atime(struct archive_entry *, time_t, long); -void archive_entry_set_ctime(struct archive_entry *, time_t, long); -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 *, +__LA_DECL void archive_entry_set_atime(struct archive_entry *, time_t, long); +__LA_DECL void archive_entry_set_ctime(struct archive_entry *, time_t, long); +__LA_DECL void archive_entry_set_dev(struct archive_entry *, dev_t); +__LA_DECL void archive_entry_set_devmajor(struct archive_entry *, dev_t); +__LA_DECL void archive_entry_set_devminor(struct archive_entry *, dev_t); +__LA_DECL void archive_entry_set_filetype(struct archive_entry *, unsigned int); +__LA_DECL void archive_entry_set_fflags(struct archive_entry *, 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 *, +__LA_DECL const char *archive_entry_copy_fflags_text(struct archive_entry *, + const char *); +__LA_DECL const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *, const wchar_t *); -void archive_entry_set_gid(struct archive_entry *, gid_t); -void archive_entry_set_gname(struct archive_entry *, const char *); -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_set_hardlink(struct archive_entry *, const char *); -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); -void archive_entry_set_pathname(struct archive_entry *, const char *); -void archive_entry_copy_pathname(struct archive_entry *, const char *); -void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *); -void archive_entry_set_perm(struct archive_entry *, mode_t); -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_copy_symlink(struct archive_entry *, const char *); -void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); -void archive_entry_set_uid(struct archive_entry *, uid_t); -void archive_entry_set_uname(struct archive_entry *, const char *); -void archive_entry_copy_uname(struct archive_entry *, const char *); -void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *); - +__LA_DECL void archive_entry_set_gid(struct archive_entry *, __LA_GID_T); +__LA_DECL void archive_entry_set_gname(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_gname(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *); +__LA_DECL int archive_entry_update_gname_utf8(struct archive_entry *, const char *); +__LA_DECL void archive_entry_set_hardlink(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_hardlink(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *); +__LA_DECL void archive_entry_set_ino(struct archive_entry *, unsigned long); +__LA_DECL void archive_entry_set_link(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_link(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_link_w(struct archive_entry *, const wchar_t *); +__LA_DECL int archive_entry_update_link_utf8(struct archive_entry *, const char *); +__LA_DECL void archive_entry_set_mode(struct archive_entry *, __LA_MODE_T); +__LA_DECL void archive_entry_set_mtime(struct archive_entry *, time_t, long); +__LA_DECL void archive_entry_set_nlink(struct archive_entry *, unsigned int); +__LA_DECL void archive_entry_set_pathname(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_pathname(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_pathname_w(struct archive_entry *, const wchar_t *); +__LA_DECL int archive_entry_update_pathname_utf8(struct archive_entry *, const char *); +__LA_DECL void archive_entry_set_perm(struct archive_entry *, __LA_MODE_T); +__LA_DECL void archive_entry_set_rdev(struct archive_entry *, dev_t); +__LA_DECL void archive_entry_set_rdevmajor(struct archive_entry *, dev_t); +__LA_DECL void archive_entry_set_rdevminor(struct archive_entry *, dev_t); +__LA_DECL void archive_entry_set_size(struct archive_entry *, int64_t); +__LA_DECL void archive_entry_copy_sourcepath(struct archive_entry *, const char *); +__LA_DECL void archive_entry_set_symlink(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_symlink(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); +__LA_DECL void archive_entry_set_uid(struct archive_entry *, __LA_UID_T); +__LA_DECL void archive_entry_set_uname(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_uname(struct archive_entry *, const char *); +__LA_DECL void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *); +__LA_DECL int archive_entry_update_uname_utf8(struct archive_entry *, const char *); /* * Routines to bulk copy fields to/from a platform-native "struct * stat." Libarchive used to just store a struct stat inside of each @@ -192,8 +254,8 @@ void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *); * * TODO: On Linux, provide both stat32 and stat64 versions of these functions. */ -const struct stat *archive_entry_stat(struct archive_entry *); -void archive_entry_copy_stat(struct archive_entry *, const struct stat *); +__LA_DECL const struct stat *archive_entry_stat(struct archive_entry *); +__LA_DECL void archive_entry_copy_stat(struct archive_entry *, const struct stat *); /* * ACL routines. This used to simply store and return text-format ACL @@ -241,11 +303,11 @@ void archive_entry_copy_stat(struct archive_entry *, const struct stat *); * POSIX.1e) is useful for handling archive formats that combine * default and access information in a single ACL list. */ -void archive_entry_acl_clear(struct archive_entry *); -void archive_entry_acl_add_entry(struct archive_entry *, +__LA_DECL void archive_entry_acl_clear(struct archive_entry *); +__LA_DECL 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 *, +__LA_DECL void archive_entry_acl_add_entry_w(struct archive_entry *, int /* type */, int /* permset */, int /* tag */, int /* qual */, const wchar_t * /* name */); @@ -254,11 +316,11 @@ void archive_entry_acl_add_entry_w(struct archive_entry *, * "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 */, +__LA_DECL int archive_entry_acl_reset(struct archive_entry *, int /* want_type */); +__LA_DECL 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 */, +__LA_DECL int archive_entry_acl_next_w(struct archive_entry *, int /* want_type */, int * /* type */, int * /* permset */, int * /* tag */, int * /* qual */, const wchar_t ** /* name */); @@ -275,11 +337,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 *, +__LA_DECL 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 */); +__LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */); /* * Private ACL parser. This is private because it handles some @@ -294,15 +356,15 @@ int archive_entry_acl_count(struct archive_entry *, int /* want_type */); * 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 *, +__LA_DECL int __archive_entry_acl_parse_w(struct archive_entry *, const wchar_t *, int /* type */); /* * extended attributes */ -void archive_entry_xattr_clear(struct archive_entry *); -void archive_entry_xattr_add_entry(struct archive_entry *, +__LA_DECL void archive_entry_xattr_clear(struct archive_entry *); +__LA_DECL void archive_entry_xattr_add_entry(struct archive_entry *, const char * /* name */, const void * /* value */, size_t /* size */); @@ -311,18 +373,18 @@ void archive_entry_xattr_add_entry(struct archive_entry *, * "next" 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 *, +__LA_DECL int archive_entry_xattr_count(struct archive_entry *); +__LA_DECL int archive_entry_xattr_reset(struct archive_entry *); +__LA_DECL int archive_entry_xattr_next(struct archive_entry *, const char ** /* name */, const void ** /* value */, size_t *); /* - * Utility to detect hardlinks. + * Utility to match up hardlinks. * * 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. + * 2. Tell it the archive format you're using. * 3. Hand each archive_entry to archive_entry_linkify(). * That function will return 0, 1, or 2 entries that should * be written. @@ -344,11 +406,11 @@ int archive_entry_xattr_next(struct archive_entry *, * 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; +__LA_DECL struct archive_entry_linkresolver; /* - * This machine supports three different strategies for marking - * hardlinks. The names come from the best-known + * There are three different strategies for marking hardlinks. + * The descriptions below name them after the best-known * formats that rely on each strategy: * * "Old cpio" is the simplest, it always returns any entry unmodified. @@ -357,7 +419,7 @@ struct archive_entry_linkresolver; * 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 + * references to the first one without any body. 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. @@ -385,28 +447,19 @@ struct archive_entry_linkresolver; * 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 *); +__LA_DECL struct archive_entry_linkresolver *archive_entry_linkresolver_new(void); +__LA_DECL void archive_entry_linkresolver_set_strategy( + struct archive_entry_linkresolver *, int /* format_code */); +__LA_DECL void archive_entry_linkresolver_free(struct archive_entry_linkresolver *); +__LA_DECL void archive_entry_linkify(struct archive_entry_linkresolver *, + struct archive_entry **, struct archive_entry **); #ifdef __cplusplus } #endif +/* This is meaningless outside of this header. */ +#undef __LA_DECL + #endif /* !ARCHIVE_ENTRY_H_INCLUDED */ diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_entry_copy_stat.c b/libarchive/libarchive-2.5.5/libarchive/archive_entry_copy_stat.c index 514db02..514db02 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_entry_copy_stat.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_entry_copy_stat.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_entry_link_resolver.c b/libarchive/libarchive-2.5.5/libarchive/archive_entry_link_resolver.c index 37131ff..4deee26 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_entry_link_resolver.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_entry_link_resolver.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_link_resolver.c,v 1.1 2007/12/30 04:58:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_link_resolver.c,v 1.3 2008/06/15 04:31:43 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_link_resolver.c,v 1.1 2007/ #include <string.h> #endif +#include "archive.h" #include "archive_entry.h" /* @@ -57,6 +58,12 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_link_resolver.c,v 1.1 2007/ * below. */ +/* Users pass us a format code, we translate that into a strategy here. */ +#define ARCHIVE_ENTRY_LINKIFY_LIKE_TAR 0 +#define ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE 1 +#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2 +#define ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO 3 + /* Initial size of link cache. */ #define links_cache_initial_size 1024 @@ -65,6 +72,7 @@ struct links_entry { struct links_entry *previous; int links; /* # links not yet seen */ int hash; + struct archive_entry *canonical; struct archive_entry *entry; }; @@ -79,8 +87,9 @@ struct archive_entry_linkresolver { 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 *, +static struct links_entry *insert_entry(struct archive_entry_linkresolver *, struct archive_entry *); +static struct links_entry *next_entry(struct archive_entry_linkresolver *); struct archive_entry_linkresolver * archive_entry_linkresolver_new(void) @@ -106,49 +115,49 @@ archive_entry_linkresolver_new(void) void archive_entry_linkresolver_set_strategy(struct archive_entry_linkresolver *res, - int strategy) + int fmt) { - res->strategy = strategy; + int fmtbase = fmt & ARCHIVE_FORMAT_BASE_MASK; + + switch (fmtbase) { + case ARCHIVE_FORMAT_CPIO: + switch (fmt) { + case ARCHIVE_FORMAT_CPIO_SVR4_NOCRC: + case ARCHIVE_FORMAT_CPIO_SVR4_CRC: + res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO; + break; + default: + res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO; + break; + } + break; + case ARCHIVE_FORMAT_MTREE: + res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE; + break; + case ARCHIVE_FORMAT_TAR: + res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_TAR; + break; + default: + res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_TAR; + break; + } } void archive_entry_linkresolver_free(struct archive_entry_linkresolver *res) { - size_t i; + struct links_entry *le; - if (res->buckets == NULL) + if (res == NULL) return; - 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; - } + if (res->buckets != NULL) { + while ((le = next_entry(res)) != NULL) + archive_entry_free(le->entry); + free(res->buckets); + res->buckets = NULL; } - free(res->buckets); - res->buckets = NULL; -} - -/* Always uses tar-like semantics. */ -const char * -archive_entry_linkresolve(struct archive_entry_linkresolver *res, - struct archive_entry *entry) -{ - struct links_entry *le; - - /* If it has only one link, then we're done. */ - if (archive_entry_nlink(entry) == 1) - return (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); + free(res); } void @@ -160,17 +169,37 @@ archive_entry_linkify(struct archive_entry_linkresolver *res, *f = NULL; /* Default: Don't return a second entry. */ + if (*e == NULL) { + le = next_entry(res); + if (le != NULL) { + *e = le->entry; + le->entry = NULL; + } + return; + } + /* If it has only one link, then we're done. */ if (archive_entry_nlink(*e) == 1) return; + /* Directories never have hardlinks. */ + if (archive_entry_filetype(*e) == AE_IFDIR) + return; 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)); + archive_entry_copy_hardlink(*e, + archive_entry_pathname(le->canonical)); + } else + insert_entry(res, *e); + return; + case ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE: + le = find_entry(res, *e); + if (le != NULL) { + archive_entry_copy_hardlink(*e, + archive_entry_pathname(le->canonical)); } else insert_entry(res, *e); return; @@ -180,17 +209,30 @@ archive_entry_linkify(struct archive_entry_linkresolver *res, case ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO: le = find_entry(res, *e); if (le != NULL) { + /* + * Put the new entry in le, return the + * old entry from le. + */ t = *e; *e = le->entry; le->entry = t; + /* Make the old entry into a hardlink. */ archive_entry_set_size(*e, 0); - archive_entry_set_hardlink(*e, - archive_entry_pathname(le->entry)); + archive_entry_copy_hardlink(*e, + archive_entry_pathname(le->canonical)); + /* If we ran out of links, return the + * final entry as well. */ if (le->links == 0) { *f = le->entry; + le->entry = NULL; } } else { - insert_entry(res, *e); + /* + * If we haven't seen it, tuck it away + * for future use. + */ + le = insert_entry(res, *e); + le->entry = *e; *e = NULL; } return; @@ -211,6 +253,7 @@ find_entry(struct archive_entry_linkresolver *res, /* Free a held entry. */ if (res->spare != NULL) { + archive_entry_free(res->spare->canonical); archive_entry_free(res->spare->entry); free(res->spare); res->spare = NULL; @@ -228,8 +271,8 @@ find_entry(struct archive_entry_linkresolver *res, 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)) { + && dev == archive_entry_dev(le->canonical) + && ino == archive_entry_ino(le->canonical)) { /* * Decrement link count each time and release * the entry if it hits zero. This saves @@ -255,7 +298,41 @@ find_entry(struct archive_entry_linkresolver *res, return (NULL); } -static void +static struct links_entry * +next_entry(struct archive_entry_linkresolver *res) +{ + struct links_entry *le; + size_t bucket; + + /* Free a held entry. */ + if (res->spare != NULL) { + archive_entry_free(res->spare->canonical); + free(res->spare); + res->spare = NULL; + } + + /* If the links cache overflowed and got flushed, don't bother. */ + if (res->buckets == NULL) + return (NULL); + + /* Look for next non-empty bucket in the links cache. */ + for (bucket = 0; bucket < res->number_buckets; bucket++) { + le = res->buckets[bucket]; + if (le != NULL) { + /* Remove it from this hash bucket. */ + if (le->next != NULL) + le->next->previous = le->previous; + res->buckets[bucket] = le->next; + res->number_entries--; + /* Defer freeing this entry. */ + res->spare = le; + return (le); + } + } + return (NULL); +} + +static struct links_entry * insert_entry(struct archive_entry_linkresolver *res, struct archive_entry *entry) { @@ -265,12 +342,9 @@ insert_entry(struct archive_entry_linkresolver *res, /* Add this entry to the links cache. */ le = malloc(sizeof(struct links_entry)); if (le == NULL) - return; - le->entry = archive_entry_clone(entry); - if (le->entry == NULL) { - free(le); - return; - } + return (NULL); + memset(le, 0, sizeof(*le)); + le->canonical = archive_entry_clone(entry); /* If the links cache is getting too full, enlarge the hash table. */ if (res->number_entries > res->number_buckets * 2) @@ -288,6 +362,7 @@ insert_entry(struct archive_entry_linkresolver *res, res->buckets[bucket] = le; le->hash = hash; le->links = archive_entry_nlink(entry) - 1; + return (le); } static void diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_entry_private.h b/libarchive/libarchive-2.5.5/libarchive/archive_entry_private.h index 57fe296..0289290 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_entry_private.h +++ b/libarchive/libarchive-2.5.5/libarchive/archive_entry_private.h @@ -22,23 +22,31 @@ * (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.2 2007/12/30 04:58:21 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive_entry_private.h,v 1.4 2008/05/26 17:00:22 kientzle Exp $ */ #ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED #define ARCHIVE_ENTRY_PRIVATE_H_INCLUDED +#include "archive_string.h" + /* * Handle wide character (i.e., Unicode) and non-wide character * strings transparently. - * */ struct aes { - const char *aes_mbs; - char *aes_mbs_alloc; + struct archive_string aes_mbs; + struct archive_string aes_utf8; const wchar_t *aes_wcs; - wchar_t *aes_wcs_alloc; + /* Bitmap of which of the above are valid. Because we're lazy + * about malloc-ing and reusing the underlying storage, we + * can't rely on NULL pointers to indicate whether a string + * has been set. */ + int aes_set; +#define AES_SET_MBS 1 +#define AES_SET_UTF8 2 +#define AES_SET_WCS 4 }; struct ae_acl { @@ -128,8 +136,6 @@ struct archive_entry { dev_t aest_rdevminor; } ae_stat; - - /* * Use aes here so that we get transparent mbs<->wcs conversions. */ @@ -141,16 +147,24 @@ struct archive_entry { struct aes ae_pathname; /* Name of entry */ struct aes ae_symlink; /* symlink contents */ struct aes ae_uname; /* Name of owner */ + unsigned char ae_hardlinkset; + unsigned char ae_symlinkset; + + /* Not used within libarchive; useful for some clients. */ + struct aes ae_sourcepath; /* Path this entry is sourced from. */ + /* ACL support. */ struct ae_acl *acl_head; struct ae_acl *acl_p; int acl_state; /* See acl_next for details. */ wchar_t *acl_text_w; + /* extattr support. */ struct ae_xattr *xattr_head; struct ae_xattr *xattr_p; - char strmode[11]; + /* Miscellaneous. */ + char strmode[12]; }; diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_entry_stat.c b/libarchive/libarchive-2.5.5/libarchive/archive_entry_stat.c index 6ef5b37..6ef5b37 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_entry_stat.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_entry_stat.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_entry_strmode.c b/libarchive/libarchive-2.5.5/libarchive/archive_entry_strmode.c index dc08d97..16cb3f7 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_entry_strmode.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_entry_strmode.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.2 2008/02/19 05:49:02 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.4 2008/06/15 05:14:01 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.2 2008/02/19 const char * archive_entry_strmode(struct archive_entry *entry) { - static const char *perms = "?rwxrwxrwx "; static const mode_t permbits[] = { 0400, 0200, 0100, 0040, 0020, 0010, 0004, 0002, 0001 }; char *bp = entry->strmode; @@ -47,7 +46,7 @@ archive_entry_strmode(struct archive_entry *entry) int i; /* Fill in a default string, then selectively override. */ - strcpy(bp, perms); + strcpy(bp, "?rwxrwxrwx "); mode = archive_entry_mode(entry); switch (archive_entry_filetype(entry)) { @@ -58,6 +57,11 @@ archive_entry_strmode(struct archive_entry *entry) case AE_IFLNK: bp[0] = 'l'; break; case AE_IFSOCK: bp[0] = 's'; break; case AE_IFIFO: bp[0] = 'p'; break; + default: + if (archive_entry_hardlink(entry) != NULL) { + bp[0] = 'h'; + break; + } } for (i = 0; i < 9; i++) diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_platform.h b/libarchive/libarchive-2.5.5/libarchive/archive_platform.h index b14ccd8..99dfacc 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_platform.h +++ b/libarchive/libarchive-2.5.5/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.29 2008/02/19 06:06:13 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive_platform.h,v 1.30 2008/05/26 17:00:22 kientzle Exp $ */ /* @@ -36,6 +36,9 @@ #ifndef ARCHIVE_PLATFORM_H_INCLUDED #define ARCHIVE_PLATFORM_H_INCLUDED +/* archive.h and archive_entry.h require this. */ +#define __LIBARCHIVE_BUILD 1 + #ifdef _WIN32 #include "config_windows.h" #include "archive_windows.h" diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_private.h b/libarchive/libarchive-2.5.5/libarchive/archive_private.h index 9ca5893..9ca5893 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_private.h +++ b/libarchive/libarchive-2.5.5/libarchive/archive_private.h diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read.3 b/libarchive/libarchive-2.5.5/libarchive/archive_read.3 index 6daba3f..13063d9 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read.3 +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read.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/archive_read.3,v 1.35 2007/09/19 16:37:45 kientzle Exp $ +.\" $FreeBSD: src/lib/libarchive/archive_read.3,v 1.37 2008/05/26 17:00:22 kientzle Exp $ .\" .Dd August 19, 2006 .Dt archive_read 3 @@ -56,6 +56,7 @@ .\" #endif .Nm archive_read_data_into_fd , .Nm archive_read_extract , +.Nm archive_read_extract2 , .Nm archive_read_extract_set_progress_callback , .Nm archive_read_close , .Nm archive_read_finish @@ -75,7 +76,10 @@ .Ft int .Fn archive_read_support_compression_none "struct archive *" .Ft int -.Fn archive_read_support_compression_program "struct archive *" "const char *cmd" +.Fo archive_read_support_compression_program +.Fa "struct archive *" +.Fa "const char *cmd" +.Fc .Ft int .Fn archive_read_support_format_all "struct archive *" .Ft int @@ -89,15 +93,32 @@ .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 *" +.Fo archive_read_open +.Fa "struct archive *" +.Fa "void *client_data" +.Fa "archive_open_callback *" +.Fa "archive_read_callback *" +.Fa "archive_close_callback *" +.Fc .Ft int -.Fn archive_read_open2 "struct archive *" "void *client_data" "archive_open_callback *" "archive_read_callback *" "archive_skip_callback *" "archive_close_callback *" +.Fo archive_read_open2 +.Fa "struct archive *" +.Fa "void *client_data" +.Fa "archive_open_callback *" +.Fa "archive_read_callback *" +.Fa "archive_skip_callback *" +.Fa "archive_close_callback *" +.Fc .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" +.Fo archive_read_open_filename +.Fa "struct archive *" +.Fa "const char *filename" +.Fa "size_t block_size" +.Fc .Ft int .Fn archive_read_open_memory "struct archive *" "void *buff" "size_t size" .Ft int @@ -105,7 +126,12 @@ .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" +.Fo archive_read_data_block +.Fa "struct archive *" +.Fa "const void **buff" +.Fa "size_t *len" +.Fa "off_t *offset" +.Fc .Ft int .Fn archive_read_data_skip "struct archive *" .\" #if ARCHIVE_API_VERSION < 3 @@ -115,9 +141,23 @@ .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" +.Fo archive_read_extract +.Fa "struct archive *" +.Fa "struct archive_entry *" +.Fa "int flags" +.Fc +.Ft int +.Fo archive_read_extract2 +.Fa "struct archive *src" +.Fa "struct archive_entry *" +.Fa "struct archive *dest" +.Fc .Ft void -.Fn archive_read_extract_set_progress_callback "struct archive *" "void (*func)(void *)" "void *user_data" +.Fo archive_read_extract_set_progress_callback +.Fa "struct archive *" +.Fa "void (*func)(void *)" +.Fa "void *user_data" +.Fc .Ft int .Fn archive_read_close "struct archive *" .Ft int @@ -136,7 +176,13 @@ order they would be used: Allocates and initializes a .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 +.It Xo +.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 +.Xc Enables auto-detection code and decompression support for the specified compression. Note that @@ -150,7 +196,14 @@ 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 +.It Xo +.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 +.Xc Enables support---including auto-detection code---for the specified archive format. For example, @@ -268,6 +321,22 @@ The .Va flags argument is passed unmodified to .Xr archive_write_disk_set_options 3 . +.It Fn archive_read_extract2 +This is another version of +.Fn archive_read_extract +that allows you to provide your own restore object. +In particular, this allows you to override the standard lookup functions +using +.Xr archive_write_disk_set_group_lookup 3 , +and +.Xr archive_write_disk_set_user_lookup 3 . +Note that +.Fn archive_read_extract2 +does not accept a +.Va flags +argument; you should use +.Fn archive_write_disk_set_options +to set the restore options yourself. .It Fn archive_read_extract_set_progress_callback Sets a pointer to a user-defined callback that can be used for updating progress displays during extraction. @@ -311,14 +380,26 @@ 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" +.Fo archive_read_callback +.Fa "struct archive *" +.Fa "void *client_data" +.Fa "const void **buffer" +.Fc .It .\" #if ARCHIVE_API_VERSION < 2 .Ft typedef int -.Fn archive_skip_callback "struct archive *" "void *client_data" "size_t request" +.Fo archive_skip_callback +.Fa "struct archive *" +.Fa "void *client_data" +.Fa "size_t request" +.Fc .\" #else .\" .Ft typedef off_t -.\" .Fn archive_skip_callback "struct archive *" "void *client_data" "off_t request" +.\" .Fo archive_skip_callback +.\" .Fa "struct archive *" +.\" .Fa "void *client_data" +.\" .Fa "off_t request" +.\" .Fc .\" #endif .It .Ft typedef int diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read.c b/libarchive/libarchive-2.5.5/libarchive/archive_read.c index 19be775..327969f 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read.c @@ -32,7 +32,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.37 2008/01/03 17:54:26 des Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.38 2008/03/12 04:58:32 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -64,25 +64,12 @@ struct archive * archive_read_new(void) { struct archive_read *a; - unsigned char *nulls; a = (struct archive_read *)malloc(sizeof(*a)); if (a == NULL) return (NULL); memset(a, 0, sizeof(*a)); a->archive.magic = ARCHIVE_READ_MAGIC; - a->bytes_per_block = ARCHIVE_DEFAULT_BYTES_PER_BLOCK; - - a->null_length = 1024; - nulls = (unsigned char *)malloc(a->null_length); - if (nulls == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate archive object 'nulls' element"); - free(a); - return (NULL); - } - memset(nulls, 0, a->null_length); - a->nulls = nulls; a->archive.state = ARCHIVE_STATE_NEW; a->entry = archive_entry_new(); @@ -660,8 +647,6 @@ archive_read_finish(struct archive *_a) (a->formats[i].cleanup)(a); } - /* Casting a pointer to int allows us to remove 'const.' */ - free((void *)(uintptr_t)(const void *)a->nulls); archive_string_free(&a->archive.error_string); if (a->entry) archive_entry_free(a->entry); diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_data_into_fd.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_data_into_fd.c index 664cc2c..3aeef3b 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_data_into_fd.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_data_into_fd.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_fd.c,v 1.15 2007/04/02 00:21:46 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_fd.c,v 1.16 2008/05/23 05:01:29 cperciva Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -64,8 +64,12 @@ archive_read_data_into_fd(struct archive *a, int fd) ARCHIVE_OK) { const char *p = buff; if (offset > output_offset) { - lseek(fd, offset - output_offset, SEEK_CUR); - output_offset = offset; + output_offset = lseek(fd, + offset - output_offset, SEEK_CUR); + if (output_offset != offset) { + archive_set_error(a, errno, "Seek error"); + return (ARCHIVE_FATAL); + } } while (size > 0) { bytes_to_write = size; @@ -74,7 +78,7 @@ archive_read_data_into_fd(struct archive *a, int fd) bytes_written = write(fd, p, bytes_to_write); if (bytes_written < 0) { archive_set_error(a, errno, "Write error"); - return (-1); + return (ARCHIVE_FATAL); } output_offset += bytes_written; total_written += bytes_written; diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_extract.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_extract.c index bb5add7..e102799 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_extract.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_extract.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.60 2008/01/18 04:53:45 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.61 2008/05/26 17:00:22 kientzle Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -82,34 +82,40 @@ get_extract(struct archive_read *a) int archive_read_extract(struct archive *_a, struct archive_entry *entry, int flags) { - struct archive_read *a = (struct archive_read *)_a; struct extract *extract; - int r, r2; - extract = get_extract(a); + extract = get_extract((struct archive_read *)_a); if (extract == NULL) return (ARCHIVE_FATAL); + archive_write_disk_set_options(extract->ad, flags); + return (archive_read_extract2(_a, entry, extract->ad)); +} + +int +archive_read_extract2(struct archive *_a, struct archive_entry *entry, + struct archive *ad) +{ + struct archive_read *a = (struct archive_read *)_a; + int r, r2; /* Set up for this particular entry. */ - extract = a->extract; - archive_write_disk_set_options(a->extract->ad, flags); - archive_write_disk_set_skip_file(a->extract->ad, + archive_write_disk_set_skip_file(ad, a->skip_file_dev, a->skip_file_ino); - r = archive_write_header(a->extract->ad, entry); + r = archive_write_header(ad, entry); if (r < ARCHIVE_WARN) r = ARCHIVE_WARN; if (r != ARCHIVE_OK) /* If _write_header failed, copy the error. */ - archive_copy_error(&a->archive, extract->ad); + archive_copy_error(&a->archive, ad); else /* Otherwise, pour data into the entry. */ - r = copy_data(_a, a->extract->ad); - r2 = archive_write_finish_entry(a->extract->ad); + r = copy_data(_a, ad); + r2 = archive_write_finish_entry(ad); if (r2 < ARCHIVE_WARN) r2 = ARCHIVE_WARN; /* Use the first message. */ if (r2 != ARCHIVE_OK && r == ARCHIVE_OK) - archive_copy_error(&a->archive, extract->ad); + archive_copy_error(&a->archive, ad); /* Use the worst error return. */ if (r2 < r) r = r2; diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_open_fd.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_open_fd.c index 2ebd46d..2ebd46d 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_open_fd.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_open_fd.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_open_file.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_open_file.c index 55c431c..55c431c 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_open_file.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_open_file.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_open_filename.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_open_filename.c index 3d6376f..3d6376f 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_open_filename.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_open_filename.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_open_memory.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_open_memory.c index 61f574f..61f574f 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_open_memory.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_open_memory.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_private.h b/libarchive/libarchive-2.5.5/libarchive/archive_read_private.h index 90fb7db..f4d0274 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_private.h +++ b/libarchive/libarchive-2.5.5/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.4 2008/01/03 17:54:26 des Exp $ + * $FreeBSD: src/lib/libarchive/archive_read_private.h,v 1.6 2008/03/15 11:09:16 kientzle Exp $ */ #ifndef ARCHIVE_READ_PRIVATE_H_INCLUDED @@ -41,10 +41,6 @@ struct archive_read { dev_t skip_file_dev; ino_t skip_file_ino; - /* Utility: Pointer to a block of nulls. */ - const unsigned char *nulls; - size_t null_length; - /* * Used by archive_read_data() to track blocks and copy * data to client buffers, filling gaps with zero bytes. @@ -58,30 +54,9 @@ struct archive_read { archive_open_callback *client_opener; archive_read_callback *client_reader; archive_skip_callback *client_skipper; - archive_write_callback *client_writer; archive_close_callback *client_closer; void *client_data; - /* - * Blocking information. Note that bytes_in_last_block is - * misleadingly named; I should find a better name. These - * control the final output from all compressors, including - * compression_none. - */ - int bytes_per_block; - int bytes_in_last_block; - - /* - * These control whether data within a gzip/bzip2 compressed - * stream gets padded or not. If pad_uncompressed is set, - * the data will be padded to a full block before being - * compressed. The pad_uncompressed_byte determines the value - * that will be used for padding. Note that these have no - * effect on compression "none." - */ - int pad_uncompressed; - int pad_uncompressed_byte; /* TODO: Support this. */ - /* File offset of beginning of most recently-read header. */ off_t header_position; @@ -118,17 +93,10 @@ struct archive_read { /* * Format detection is mostly the same as compression - * detection, with two significant differences: The bidders + * detection, with one significant difference: The bidders * use the read_ahead calls above to examine the stream rather * than having the supervisor hand them a block of data to - * examine, and the auction is repeated for every header. - * Winning bidders should set the archive_format and - * archive_format_name appropriately. Bid routines should - * check archive_format and decline to bid if the format of - * the last header was incompatible. - * - * Again, write support is considerably simpler because there's - * no need for an auction. + * examine. */ struct archive_format_descriptor { @@ -142,18 +110,6 @@ struct archive_read { struct archive_format_descriptor *format; /* Active format. */ /* - * Pointers to format-specific functions for writing. They're - * initialized by archive_write_set_format_XXX() calls. - */ - int (*format_init)(struct archive *); /* Only used on write. */ - int (*format_finish)(struct archive *); - int (*format_finish_entry)(struct archive *); - int (*format_write_header)(struct archive *, - struct archive_entry *); - ssize_t (*format_write_data)(struct archive *, - const void *buff, size_t); - - /* * Various information needed by archive_extract. */ struct extract *extract; diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_all.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_all.c index da2b246..da2b246 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_all.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_all.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_bzip2.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_bzip2.c index 372eff0..824b0cd 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_bzip2.c +++ b/libarchive/libarchive-2.5.5/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.17 2008/02/19 05:44:59 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_bzip2.c,v 1.18 2008/05/26 17:00:22 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -116,17 +116,29 @@ bid(const void *buff, size_t len) if (buffer[3] < '1' || buffer[3] > '9') return (0); bits_checked += 5; + if (len < 5) + return (bits_checked); - /* - * Research Question: Can we do any more to verify that this - * really is BZip2 format?? For 99.9% of the time, the above - * test is sufficient, but it would be nice to do a more - * thorough check. It's especially troubling that the BZip2 - * signature begins with all ASCII characters; a tar archive - * whose first filename begins with 'BZh3' would potentially - * fool this logic. (It may also be possible to guard against - * such anomalies in archive_read_support_compression_none.) - */ + /* After BZh[1-9], there must be either a data block + * which begins with 0x314159265359 or an end-of-data + * marker of 0x177245385090. */ + + if (buffer[4] == 0x31) { + /* Verify the data block signature. */ + size_t s = len; + if (s > 10) s = 10; + if (memcmp(buffer + 4, "\x31\x41\x59\x26\x53\x59", s - 4) != 0) + return (0); + bits_checked += 8 * (s - 4); + } else if (buffer[4] == 0x17) { + /* Verify the end-of-data marker. */ + size_t s = len; + if (s > 10) s = 10; + if (memcmp(buffer + 4, "\x17\x72\x45\x38\x50\x90", s - 4) != 0) + return (0); + bits_checked += 8 * (s - 4); + } else + return (0); return (bits_checked); } diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_compress.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_compress.c index 050099b..050099b 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_compress.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_compress.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_gzip.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_gzip.c index 2dac54d..2dac54d 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_gzip.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_gzip.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_none.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_none.c index 3f17756..3f17756 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_none.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_none.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_program.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_program.c index 58b4bbd..4f25d6e 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_compression_program.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_compression_program.c @@ -24,7 +24,25 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_program.c,v 1.2 2007/07/20 01:28:50 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_program.c,v 1.4 2008/06/15 10:45:57 kientzle Exp $"); + +/* This capability is only available on POSIX systems. */ +#if !defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \ + !(defined(HAVE_FORK) || defined(HAVE_VFORK)) + +/* + * On non-Posix systems, allow the program to build, but choke if + * this function is actually invoked. + */ +int +archive_read_support_compression_program(struct archive *_a, const char *cmd) +{ + archive_set_error(_a, -1, + "External compression programs not supported on this platform"); + return (ARCHIVE_FATAL); +} + +#else #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> @@ -159,6 +177,12 @@ restart_read: state->child_in_buf_avail = ret; } + if (state->child_stdin == -1) { + fcntl(state->child_stdout, F_SETFL, 0); + __archive_check_child(state->child_stdin, state->child_stdout); + goto restart_read; + } + do { ret = write(state->child_stdin, state->child_in_buf, state->child_in_buf_avail); @@ -173,7 +197,7 @@ restart_read: goto restart_read; } else if (ret == 0 || (ret == -1 && errno == EPIPE)) { close(state->child_stdin); - state->child_stdout = -1; + state->child_stdin = -1; fcntl(state->child_stdout, F_SETFL, 0); goto restart_read; } else { @@ -313,3 +337,5 @@ archive_decompressor_program_finish(struct archive_read *a) return (ARCHIVE_OK); } + +#endif /* !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL) */ diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_all.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_all.c index 24e31ef..24e31ef 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_all.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_all.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_ar.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_ar.c index a74791c..baf80bd 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_ar.c +++ b/libarchive/libarchive-2.5.5/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.8 2008/02/19 05:54:24 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_ar.c,v 1.10 2008/05/26 17:00:22 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -83,8 +83,7 @@ static int archive_read_format_ar_read_header(struct archive_read *a, struct archive_entry *e); static uint64_t ar_atol8(const char *p, unsigned char_cnt); static uint64_t ar_atol10(const char *p, unsigned char_cnt); -static int ar_parse_gnu_filename_table(struct archive_read *, struct ar *, - const void *, size_t); +static int ar_parse_gnu_filename_table(struct archive_read *a); static int ar_parse_common_header(struct ar *ar, struct archive_entry *, const char *h); @@ -167,8 +166,8 @@ archive_read_format_ar_read_header(struct archive_read *a, struct ar *ar; uint64_t number; /* Used to hold parsed numbers before validation. */ ssize_t bytes_read; - size_t bsd_name_length, entry_size; - char *p; + size_t bsd_name_length, entry_size, s; + char *p, *st; const void *b; const char *h; int r; @@ -277,22 +276,42 @@ archive_read_format_ar_read_header(struct archive_read *a, return (ARCHIVE_FATAL); } entry_size = (size_t)number; + if (entry_size == 0) { + archive_set_error(&a->archive, EINVAL, + "Invalid string table"); + return (ARCHIVE_WARN); + } + if (ar->strtab != NULL) { + archive_set_error(&a->archive, EINVAL, + "More than one string tables exist"); + return (ARCHIVE_WARN); + } + /* Read the filename table into memory. */ - bytes_read = (a->decompressor->read_ahead)(a, &b, entry_size); - if (bytes_read <= 0) - return (ARCHIVE_FATAL); - if ((size_t)bytes_read < entry_size) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Truncated input file"); + st = malloc(entry_size); + if (st == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate filename table buffer"); return (ARCHIVE_FATAL); } - /* - * Don't consume the contents, so the client will - * also get a shot at reading it. - */ + ar->strtab = st; + ar->strtab_size = entry_size; + for (s = entry_size; s > 0; s -= bytes_read) { + bytes_read = (a->decompressor->read_ahead)(a, &b, s); + if (bytes_read <= 0) + return (ARCHIVE_FATAL); + if (bytes_read > (ssize_t)s) + bytes_read = s; + memcpy(st, b, bytes_read); + st += bytes_read; + (a->decompressor->consume)(a, bytes_read); + } + /* All contents are consumed. */ + ar->entry_bytes_remaining = 0; + archive_entry_set_size(entry, ar->entry_bytes_remaining); /* Parse the filename table. */ - return (ar_parse_gnu_filename_table(a, ar, b, entry_size)); + return (ar_parse_gnu_filename_table(a)); } /* @@ -331,12 +350,16 @@ archive_read_format_ar_read_header(struct archive_read *a, /* Parse the size of the name, adjust the file size. */ number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3); - if ((off_t)number > ar->entry_bytes_remaining) { + bsd_name_length = (size_t)number; + /* Guard against the filename + trailing NUL + * overflowing a size_t and against the filename size + * being larger than the entire entry. */ + if (number > (uint64_t)(bsd_name_length + 1) + || (off_t)bsd_name_length > ar->entry_bytes_remaining) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Bad input file size"); return (ARCHIVE_FATAL); } - bsd_name_length = (size_t)number; ar->entry_bytes_remaining -= bsd_name_length; /* Adjust file size reported to client. */ archive_entry_set_size(entry, ar->entry_bytes_remaining); @@ -492,31 +515,15 @@ archive_read_format_ar_skip(struct archive_read *a) } static int -ar_parse_gnu_filename_table(struct archive_read *a, struct ar *ar, - const void *h, size_t size) +ar_parse_gnu_filename_table(struct archive_read *a) { + struct ar *ar; char *p; + size_t size; - if (ar->strtab != NULL) { - archive_set_error(&a->archive, EINVAL, - "More than one string tables exist"); - return (ARCHIVE_WARN); - } - - if (size == 0) { - archive_set_error(&a->archive, EINVAL, "Invalid string table"); - return (ARCHIVE_WARN); - } - - ar->strtab_size = size; - ar->strtab = malloc(size); - if (ar->strtab == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate string table buffer"); - return (ARCHIVE_FATAL); - } + ar = (struct ar*)(a->format->data); + size = ar->strtab_size; - (void)memcpy(ar->strtab, h, size); for (p = ar->strtab; p < ar->strtab + size - 1; ++p) { if (*p == '/') { *p++ = '\0'; diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_cpio.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_cpio.c index 2c50abc..2c50abc 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_cpio.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_cpio.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_empty.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_empty.c index 837fdef..837fdef 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_empty.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_empty.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_iso9660.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_iso9660.c index d333f0c..481220d 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_iso9660.c +++ b/libarchive/libarchive-2.5.5/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.25 2008/02/19 06:02:01 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_iso9660.c,v 1.26 2008/05/26 17:00:22 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -595,8 +595,11 @@ add_entry(struct iso9660 *iso9660, struct file_info *file) struct file_info **new_pending_files; int new_size = iso9660->pending_files_allocated * 2; - if (new_size < 1024) + if (iso9660->pending_files_allocated < 1024) new_size = 1024; + /* Overflow might keep us from growing the list. */ + if (new_size <= iso9660->pending_files_allocated) + __archive_errx(1, "Out of memory"); new_pending_files = (struct file_info **)malloc(new_size * sizeof(new_pending_files[0])); if (new_pending_files == NULL) __archive_errx(1, "Out of memory"); @@ -908,6 +911,11 @@ fprintf(stderr, " *** Discarding CE data.\n"); file->ce_size = 0; } + /* Don't waste time seeking for zero-length bodies. */ + if (file->size == 0) { + file->offset = iso9660->current_position; + } + /* If CE exists, find and read it now. */ if (file->ce_offset > 0) offset = file->ce_offset; @@ -1041,51 +1049,22 @@ isodate17(const unsigned char *v) return (time_from_tm(&tm)); } -/* - * timegm() converts a struct tm to a time_t, except it isn't standard, - * so I provide my own function here that (ideally) is just a wrapper - * for timegm(). - */ static time_t time_from_tm(struct tm *t) { #if HAVE_TIMEGM + /* Use platform timegm() if available. */ return (timegm(t)); -#elif HAVE_STRUCT_TM_TM_GMTOFF - /* - * Unfortunately, timegm() isn't standard. The standard - * mktime() function is a close match, except that it uses - * local timezone instead of GMT. You can compensate for - * this by adding the timezone and DST offsets back in, at - * the cost of two calls to mktime(). - */ - mktime(t); /* Normalize the time and get the TZ offset. */ - t->tm_sec += t->tm_gmtoff; /* Try to adjust for the timezone and DST.*/ - if (t->tm_isdst) - t->tm_hour -= 1; - return (mktime(t)); /* Re-convert. */ -#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)); + /* Else use direct calculation using POSIX assumptions. */ + /* First, fix up tm_yday based on the year/month/day. */ + mktime(t); + /* Then we can compute timegm() from first principles. */ + return (t->tm_sec + t->tm_min * 60 + t->tm_hour * 3600 + + t->tm_yday * 86400 + (t->tm_year - 70) * 31536000 + + ((t->tm_year - 69) / 4) * 86400 - + ((t->tm_year - 1) / 100) * 86400 + + ((t->tm_year + 299) / 400) * 86400); #endif } diff --git a/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_mtree.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_mtree.c new file mode 100644 index 0000000..33597e0 --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_mtree.c @@ -0,0 +1,1298 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2008 Joerg Sonnenberger + * 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 "archive_platform.h" +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_mtree.c,v 1.9 2008/06/21 19:06:37 kientzle Exp $"); + +#ifdef HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif +#include <stddef.h> +/* #include <stdint.h> */ /* See archive_platform.h */ +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif + +#include "archive.h" +#include "archive_entry.h" +#include "archive_private.h" +#include "archive_read_private.h" +#include "archive_string.h" + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#define MTREE_HAS_DEVICE 0x0001 +#define MTREE_HAS_FFLAGS 0x0002 +#define MTREE_HAS_GID 0x0004 +#define MTREE_HAS_GNAME 0x0008 +#define MTREE_HAS_MTIME 0x0010 +#define MTREE_HAS_NLINK 0x0020 +#define MTREE_HAS_PERM 0x0040 +#define MTREE_HAS_SIZE 0x0080 +#define MTREE_HAS_TYPE 0x0100 +#define MTREE_HAS_UID 0x0200 +#define MTREE_HAS_UNAME 0x0400 + +#define MTREE_HAS_OPTIONAL 0x0800 + +struct mtree_option { + struct mtree_option *next; + char *value; +}; + +struct mtree_entry { + struct mtree_entry *next; + struct mtree_option *options; + char *name; + char full; + char used; +}; + +struct mtree { + struct archive_string line; + size_t buffsize; + char *buff; + off_t offset; + int fd; + int filetype; + int archive_format; + const char *archive_format_name; + struct mtree_entry *entries; + struct mtree_entry *this_entry; + struct archive_string current_dir; + struct archive_string contents_name; + + struct archive_entry_linkresolver *resolver; + + off_t cur_size, cur_offset; +}; + +static int cleanup(struct archive_read *); +static int mtree_bid(struct archive_read *); +static int parse_file(struct archive_read *, struct archive_entry *, + struct mtree *, struct mtree_entry *, int *); +static void parse_escapes(char *, struct mtree_entry *); +static int parse_line(struct archive_read *, struct archive_entry *, + struct mtree *, struct mtree_entry *, int *); +static int parse_keyword(struct archive_read *, struct mtree *, + struct archive_entry *, struct mtree_option *, int *); +static int read_data(struct archive_read *a, + const void **buff, size_t *size, off_t *offset); +static ssize_t readline(struct archive_read *, struct mtree *, char **, ssize_t); +static int skip(struct archive_read *a); +static int read_header(struct archive_read *, + struct archive_entry *); +static int64_t mtree_atol10(char **); +static int64_t mtree_atol8(char **); +static int64_t mtree_atol(char **); + +static void +free_options(struct mtree_option *head) +{ + struct mtree_option *next; + + for (; head != NULL; head = next) { + next = head->next; + free(head->value); + free(head); + } +} + +int +archive_read_support_format_mtree(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + struct mtree *mtree; + int r; + + mtree = (struct mtree *)malloc(sizeof(*mtree)); + if (mtree == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate mtree data"); + return (ARCHIVE_FATAL); + } + memset(mtree, 0, sizeof(*mtree)); + mtree->fd = -1; + + r = __archive_read_register_format(a, mtree, + mtree_bid, read_header, read_data, skip, cleanup); + + if (r != ARCHIVE_OK) + free(mtree); + return (ARCHIVE_OK); +} + +static int +cleanup(struct archive_read *a) +{ + struct mtree *mtree; + struct mtree_entry *p, *q; + + mtree = (struct mtree *)(a->format->data); + + p = mtree->entries; + while (p != NULL) { + q = p->next; + free(p->name); + free_options(p->options); + free(p); + p = q; + } + archive_string_free(&mtree->line); + archive_string_free(&mtree->current_dir); + archive_string_free(&mtree->contents_name); + archive_entry_linkresolver_free(mtree->resolver); + + free(mtree->buff); + free(mtree); + (a->format->data) = NULL; + return (ARCHIVE_OK); +} + + +static int +mtree_bid(struct archive_read *a) +{ + struct mtree *mtree; + ssize_t bytes_read; + const void *h; + const char *signature = "#mtree"; + const char *p; + int bid; + + mtree = (struct mtree *)(a->format->data); + + /* Now let's look at the actual header and see if it matches. */ + bytes_read = (a->decompressor->read_ahead)(a, &h, strlen(signature)); + + if (bytes_read <= 0) + return (bytes_read); + + p = h; + bid = 0; + while (bytes_read > 0 && *signature != '\0') { + if (*p != *signature) + return (bid = 0); + bid += 8; + p++; + signature++; + bytes_read--; + } + return (bid); +} + +/* + * The extended mtree format permits multiple lines specifying + * attributes for each file. For those entries, only the last line + * is actually used. Practically speaking, that means we have + * to read the entire mtree file into memory up front. + * + * The parsing is done in two steps. First, it is decided if a line + * changes the global defaults and if it is, processed accordingly. + * Otherwise, the options of the line are merged with the current + * global options. + */ +static int +add_option(struct archive_read *a, struct mtree_option **global, + const char *value, size_t len) +{ + struct mtree_option *option; + + if ((option = malloc(sizeof(*option))) == NULL) { + archive_set_error(&a->archive, errno, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + if ((option->value = malloc(len + 1)) == NULL) { + free(option); + archive_set_error(&a->archive, errno, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + memcpy(option->value, value, len); + option->value[len] = '\0'; + option->next = *global; + *global = option; + return (ARCHIVE_OK); +} + +static void +remove_option(struct mtree_option **global, const char *value, size_t len) +{ + struct mtree_option *iter, *last; + + last = NULL; + for (iter = *global; iter != NULL; last = iter, iter = iter->next) { + if (strncmp(iter->value, value, len) == 0 && + (iter->value[len] == '\0' || + iter->value[len] == '=')) + break; + } + if (iter == NULL) + return; + if (last == NULL) + *global = iter->next; + else + last->next = iter->next; + + free(iter->value); + free(iter); +} + +static int +process_global_set(struct archive_read *a, + struct mtree_option **global, const char *line) +{ + const char *next, *eq; + size_t len; + int r; + + line += 4; + for (;;) { + next = line + strspn(line, " \t\r\n"); + if (*next == '\0') + return (ARCHIVE_OK); + line = next; + next = line + strcspn(line, " \t\r\n"); + eq = strchr(line, '='); + if (eq > next) + len = next - line; + else + len = eq - line; + + remove_option(global, line, len); + r = add_option(a, global, line, next - line); + if (r != ARCHIVE_OK) + return (r); + line = next; + } +} + +static int +process_global_unset(struct archive_read *a, + struct mtree_option **global, const char *line) +{ + const char *next; + size_t len; + + line += 6; + if (strchr(line, '=') != NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "/unset shall not contain `='"); + return ARCHIVE_FATAL; + } + + for (;;) { + next = line + strspn(line, " \t\r\n"); + if (*next == '\0') + return (ARCHIVE_OK); + line = next; + len = strcspn(line, " \t\r\n"); + + if (len == 3 && strncmp(line, "all", 3) == 0) { + free_options(*global); + *global = NULL; + } else { + remove_option(global, line, len); + } + + line += len; + } +} + +static int +process_add_entry(struct archive_read *a, struct mtree *mtree, + struct mtree_option **global, const char *line, + struct mtree_entry **last_entry) +{ + struct mtree_entry *entry; + struct mtree_option *iter; + const char *next, *eq; + size_t len; + int r; + + if ((entry = malloc(sizeof(*entry))) == NULL) { + archive_set_error(&a->archive, errno, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + entry->next = NULL; + entry->options = NULL; + entry->name = NULL; + entry->used = 0; + entry->full = 0; + + /* Add this entry to list. */ + if (*last_entry == NULL) + mtree->entries = entry; + else + (*last_entry)->next = entry; + *last_entry = entry; + + len = strcspn(line, " \t\r\n"); + if ((entry->name = malloc(len + 1)) == NULL) { + archive_set_error(&a->archive, errno, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + + memcpy(entry->name, line, len); + entry->name[len] = '\0'; + parse_escapes(entry->name, entry); + + line += len; + for (iter = *global; iter != NULL; iter = iter->next) { + r = add_option(a, &entry->options, iter->value, + strlen(iter->value)); + if (r != ARCHIVE_OK) + return (r); + } + + for (;;) { + next = line + strspn(line, " \t\r\n"); + if (*next == '\0') + return (ARCHIVE_OK); + line = next; + next = line + strcspn(line, " \t\r\n"); + eq = strchr(line, '='); + if (eq > next) + len = next - line; + else + len = eq - line; + + remove_option(&entry->options, line, len); + r = add_option(a, &entry->options, line, next - line); + if (r != ARCHIVE_OK) + return (r); + line = next; + } +} + +static int +read_mtree(struct archive_read *a, struct mtree *mtree) +{ + ssize_t len; + uintmax_t counter; + char *p; + struct mtree_option *global; + struct mtree_entry *last_entry; + int r; + + mtree->archive_format = ARCHIVE_FORMAT_MTREE_V1; + mtree->archive_format_name = "mtree"; + + global = NULL; + last_entry = NULL; + r = ARCHIVE_OK; + + for (counter = 1; ; ++counter) { + len = readline(a, mtree, &p, 256); + if (len == 0) { + mtree->this_entry = mtree->entries; + return (ARCHIVE_OK); + } + if (len < 0) + return (len); + /* Leading whitespace is never significant, ignore it. */ + while (*p == ' ' || *p == '\t') { + ++p; + --len; + } + /* Skip content lines and blank lines. */ + if (*p == '#') + continue; + if (*p == '\r' || *p == '\n' || *p == '\0') + continue; + if (*p != '/') { + r = process_add_entry(a, mtree, &global, p, + &last_entry); + } else if (strncmp(p, "/set", 4) == 0) { + if (p[4] != ' ' && p[4] != '\t') + break; + r = process_global_set(a, &global, p); + } else if (strncmp(p, "/unset", 6) == 0) { + if (p[6] != ' ' && p[6] != '\t') + break; + r = process_global_unset(a, &global, p); + } else + break; + + if (r != ARCHIVE_OK) + return r; + } + + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Can't parse line %ju", counter); + return ARCHIVE_FATAL; +} + +/* + * Read in the entire mtree file into memory on the first request. + * Then use the next unused file to satisfy each header request. + */ +static int +read_header(struct archive_read *a, struct archive_entry *entry) +{ + struct mtree *mtree; + char *p; + int r, use_next; + + mtree = (struct mtree *)(a->format->data); + + if (mtree->fd >= 0) { + close(mtree->fd); + mtree->fd = -1; + } + + if (mtree->entries == NULL) { + mtree->resolver = archive_entry_linkresolver_new(); + if (mtree->resolver == NULL) + return ARCHIVE_FATAL; + archive_entry_linkresolver_set_strategy(mtree->resolver, + ARCHIVE_FORMAT_MTREE); + r = read_mtree(a, mtree); + if (r != ARCHIVE_OK) + return (r); + } + + a->archive.archive_format = mtree->archive_format; + a->archive.archive_format_name = mtree->archive_format_name; + + for (;;) { + if (mtree->this_entry == NULL) + return (ARCHIVE_EOF); + if (strcmp(mtree->this_entry->name, "..") == 0) { + mtree->this_entry->used = 1; + if (archive_strlen(&mtree->current_dir) > 0) { + /* Roll back current path. */ + p = mtree->current_dir.s + + mtree->current_dir.length - 1; + while (p >= mtree->current_dir.s && *p != '/') + --p; + if (p >= mtree->current_dir.s) + --p; + mtree->current_dir.length + = p - mtree->current_dir.s + 1; + } + } + if (!mtree->this_entry->used) { + use_next = 0; + r = parse_file(a, entry, mtree, mtree->this_entry, &use_next); + if (use_next == 0) + return (r); + } + mtree->this_entry = mtree->this_entry->next; + } +} + +/* + * A single file can have multiple lines contribute specifications. + * Parse as many lines as necessary, then pull additional information + * from a backing file on disk as necessary. + */ +static int +parse_file(struct archive_read *a, struct archive_entry *entry, + struct mtree *mtree, struct mtree_entry *mentry, int *use_next) +{ + const char *path; + struct stat st_storage, *st; + struct mtree_entry *mp; + struct archive_entry *sparse_entry; + int r = ARCHIVE_OK, r1, parsed_kws, mismatched_type; + + mentry->used = 1; + + /* Initialize reasonable defaults. */ + mtree->filetype = AE_IFREG; + archive_entry_set_size(entry, 0); + + /* Parse options from this line. */ + parsed_kws = 0; + r = parse_line(a, entry, mtree, mentry, &parsed_kws); + + if (mentry->full) { + archive_entry_copy_pathname(entry, mentry->name); + /* + * "Full" entries are allowed to have multiple lines + * and those lines aren't required to be adjacent. We + * don't support multiple lines for "relative" entries + * nor do we make any attempt to merge data from + * separate "relative" and "full" entries. (Merging + * "relative" and "full" entries would require dealing + * with pathname canonicalization, which is a very + * tricky subject.) + */ + for (mp = mentry->next; mp != NULL; mp = mp->next) { + if (mp->full && !mp->used + && strcmp(mentry->name, mp->name) == 0) { + /* Later lines override earlier ones. */ + mp->used = 1; + r1 = parse_line(a, entry, mtree, mp, + &parsed_kws); + if (r1 < r) + r = r1; + } + } + } else { + /* + * Relative entries require us to construct + * the full path and possibly update the + * current directory. + */ + size_t n = archive_strlen(&mtree->current_dir); + if (n > 0) + archive_strcat(&mtree->current_dir, "/"); + archive_strcat(&mtree->current_dir, mentry->name); + archive_entry_copy_pathname(entry, mtree->current_dir.s); + if (archive_entry_filetype(entry) != AE_IFDIR) + mtree->current_dir.length = n; + } + + /* + * Try to open and stat the file to get the real size + * and other file info. It would be nice to avoid + * this here so that getting a listing of an mtree + * wouldn't require opening every referenced contents + * file. But then we wouldn't know the actual + * contents size, so I don't see a really viable way + * around this. (Also, we may want to someday pull + * other unspecified info from the contents file on + * disk.) + */ + mtree->fd = -1; + if (archive_strlen(&mtree->contents_name) > 0) + path = mtree->contents_name.s; + else + path = archive_entry_pathname(entry); + + if (archive_entry_filetype(entry) == AE_IFREG || + archive_entry_filetype(entry) == AE_IFDIR) { + mtree->fd = open(path, + O_RDONLY | O_BINARY); + if (mtree->fd == -1 && + (errno != ENOENT || + archive_strlen(&mtree->contents_name) > 0)) { + archive_set_error(&a->archive, errno, + "Can't open %s", path); + r = ARCHIVE_WARN; + } + } + + st = &st_storage; + if (mtree->fd >= 0) { + if (fstat(mtree->fd, st) == -1) { + archive_set_error(&a->archive, errno, + "Could not fstat %s", path); + r = ARCHIVE_WARN; + /* If we can't stat it, don't keep it open. */ + close(mtree->fd); + mtree->fd = -1; + st = NULL; + } + } else if (lstat(path, st) == -1) { + st = NULL; + } + + /* + * If there is a contents file on disk, use that size; + * otherwise leave it as-is (it might have been set from + * the mtree size= keyword). + */ + if (st != NULL) { + mismatched_type = 0; + if ((st->st_mode & S_IFMT) == S_IFREG && + archive_entry_filetype(entry) != AE_IFREG) + mismatched_type = 1; + if ((st->st_mode & S_IFMT) == S_IFLNK && + archive_entry_filetype(entry) != AE_IFLNK) + mismatched_type = 1; + if ((st->st_mode & S_IFSOCK) == S_IFSOCK && + archive_entry_filetype(entry) != AE_IFSOCK) + mismatched_type = 1; + if ((st->st_mode & S_IFMT) == S_IFCHR && + archive_entry_filetype(entry) != AE_IFCHR) + mismatched_type = 1; + if ((st->st_mode & S_IFMT) == S_IFBLK && + archive_entry_filetype(entry) != AE_IFBLK) + mismatched_type = 1; + if ((st->st_mode & S_IFMT) == S_IFDIR && + archive_entry_filetype(entry) != AE_IFDIR) + mismatched_type = 1; + if ((st->st_mode & S_IFMT) == S_IFIFO && + archive_entry_filetype(entry) != AE_IFIFO) + mismatched_type = 1; + + if (mismatched_type) { + if ((parsed_kws & MTREE_HAS_OPTIONAL) == 0) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "mtree specification has different type for %s", + archive_entry_pathname(entry)); + r = ARCHIVE_WARN; + } else { + *use_next = 1; + } + /* Don't hold a non-regular file open. */ + if (mtree->fd >= 0) + close(mtree->fd); + mtree->fd = -1; + st = NULL; + return r; + } + } + + if (st != NULL) { + if ((parsed_kws & MTREE_HAS_DEVICE) == 0 && + (archive_entry_filetype(entry) == AE_IFCHR || + archive_entry_filetype(entry) == AE_IFBLK)) + archive_entry_set_rdev(entry, st->st_rdev); + if ((parsed_kws & (MTREE_HAS_GID | MTREE_HAS_GNAME)) == 0) + archive_entry_set_gid(entry, st->st_gid); + if ((parsed_kws & (MTREE_HAS_UID | MTREE_HAS_UNAME)) == 0) + archive_entry_set_uid(entry, st->st_uid); + if ((parsed_kws & MTREE_HAS_MTIME) == 0) { +#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC + archive_entry_set_mtime(entry, st->st_mtime, + st->st_mtimespec.tv_nsec); +#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC + archive_entry_set_mtime(entry, st->st_mtime, + st->st_mtim.tv_nsec); +#else + archive_entry_set_mtime(entry, st->st_mtime, 0); +#endif + } + if ((parsed_kws & MTREE_HAS_NLINK) == 0) + archive_entry_set_nlink(entry, st->st_nlink); + if ((parsed_kws & MTREE_HAS_PERM) == 0) + archive_entry_set_perm(entry, st->st_mode); + if ((parsed_kws & MTREE_HAS_SIZE) == 0) + archive_entry_set_size(entry, st->st_size); + archive_entry_set_ino(entry, st->st_ino); + archive_entry_set_dev(entry, st->st_dev); + + archive_entry_linkify(mtree->resolver, &entry, &sparse_entry); + } else if (parsed_kws & MTREE_HAS_OPTIONAL) { + /* + * Couldn't open the entry, stat it or the on-disk type + * didn't match. If this entry is optional, just ignore it + * and read the next header entry. + */ + *use_next = 1; + return ARCHIVE_OK; + } + + mtree->cur_size = archive_entry_size(entry); + mtree->offset = 0; + + return r; +} + +/* + * Each line contains a sequence of keywords. + */ +static int +parse_line(struct archive_read *a, struct archive_entry *entry, + struct mtree *mtree, struct mtree_entry *mp, int *parsed_kws) +{ + struct mtree_option *iter; + int r = ARCHIVE_OK, r1; + + for (iter = mp->options; iter != NULL; iter = iter->next) { + r1 = parse_keyword(a, mtree, entry, iter, parsed_kws); + if (r1 < r) + r = r1; + } + if ((*parsed_kws & MTREE_HAS_TYPE) == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Missing type keyword in mtree specification"); + return (ARCHIVE_WARN); + } + return (r); +} + +/* + * Device entries have one of the following forms: + * raw dev_t + * format,major,minor[,subdevice] + * + * Just use major and minor, no translation etc is done + * between formats. + */ +static int +parse_device(struct archive *a, struct archive_entry *entry, char *val) +{ + char *comma1, *comma2; + + comma1 = strchr(val, ','); + if (comma1 == NULL) { + archive_entry_set_dev(entry, mtree_atol10(&val)); + return (ARCHIVE_OK); + } + ++comma1; + comma2 = strchr(comma1, ','); + if (comma2 == NULL) { + archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT, + "Malformed device attribute"); + return (ARCHIVE_WARN); + } + ++comma2; + archive_entry_set_rdevmajor(entry, mtree_atol(&comma1)); + archive_entry_set_rdevminor(entry, mtree_atol(&comma2)); + return (ARCHIVE_OK); +} + +/* + * Parse a single keyword and its value. + */ +static int +parse_keyword(struct archive_read *a, struct mtree *mtree, + struct archive_entry *entry, struct mtree_option *option, int *parsed_kws) +{ + char *val, *key; + + key = option->value; + + if (*key == '\0') + return (ARCHIVE_OK); + + if (strcmp(key, "optional") == 0) { + *parsed_kws |= MTREE_HAS_OPTIONAL; + return (ARCHIVE_OK); + } + if (strcmp(key, "ignore") == 0) { + /* + * The mtree processing is not recursive, so + * recursion will only happen for explicitly listed + * entries. + */ + return (ARCHIVE_OK); + } + + val = strchr(key, '='); + if (val == NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Malformed attribute \"%s\" (%d)", key, key[0]); + return (ARCHIVE_WARN); + } + + *val = '\0'; + ++val; + + switch (key[0]) { + case 'c': + if (strcmp(key, "content") == 0 + || strcmp(key, "contents") == 0) { + parse_escapes(val, NULL); + archive_strcpy(&mtree->contents_name, val); + break; + } + if (strcmp(key, "cksum") == 0) + break; + case 'd': + if (strcmp(key, "device") == 0) { + *parsed_kws |= MTREE_HAS_DEVICE; + return parse_device(&a->archive, entry, val); + } + case 'f': + if (strcmp(key, "flags") == 0) { + *parsed_kws |= MTREE_HAS_FFLAGS; + archive_entry_copy_fflags_text(entry, val); + break; + } + case 'g': + if (strcmp(key, "gid") == 0) { + *parsed_kws |= MTREE_HAS_GID; + archive_entry_set_gid(entry, mtree_atol10(&val)); + break; + } + if (strcmp(key, "gname") == 0) { + *parsed_kws |= MTREE_HAS_GNAME; + archive_entry_copy_gname(entry, val); + break; + } + case 'l': + if (strcmp(key, "link") == 0) { + archive_entry_copy_symlink(entry, val); + break; + } + case 'm': + if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) + break; + if (strcmp(key, "mode") == 0) { + if (val[0] >= '0' && val[0] <= '9') { + *parsed_kws |= MTREE_HAS_PERM; + archive_entry_set_perm(entry, + mtree_atol8(&val)); + } else { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Symbolic mode \"%s\" unsupported", val); + return ARCHIVE_WARN; + } + break; + } + case 'n': + if (strcmp(key, "nlink") == 0) { + *parsed_kws |= MTREE_HAS_NLINK; + archive_entry_set_nlink(entry, mtree_atol10(&val)); + break; + } + case 'r': + if (strcmp(key, "rmd160") == 0 || + strcmp(key, "rmd160digest") == 0) + break; + case 's': + if (strcmp(key, "sha1") == 0 || strcmp(key, "sha1digest") == 0) + break; + if (strcmp(key, "sha256") == 0 || + strcmp(key, "sha256digest") == 0) + break; + if (strcmp(key, "sha384") == 0 || + strcmp(key, "sha384digest") == 0) + break; + if (strcmp(key, "sha512") == 0 || + strcmp(key, "sha512digest") == 0) + break; + if (strcmp(key, "size") == 0) { + archive_entry_set_size(entry, mtree_atol10(&val)); + break; + } + case 't': + if (strcmp(key, "tags") == 0) { + /* + * Comma delimited list of tags. + * Ignore the tags for now, but the interface + * should be extended to allow inclusion/exclusion. + */ + break; + } + if (strcmp(key, "time") == 0) { + *parsed_kws |= MTREE_HAS_MTIME; + archive_entry_set_mtime(entry, mtree_atol10(&val), 0); + break; + } + if (strcmp(key, "type") == 0) { + *parsed_kws |= MTREE_HAS_TYPE; + switch (val[0]) { + case 'b': + if (strcmp(val, "block") == 0) { + mtree->filetype = AE_IFBLK; + break; + } + case 'c': + if (strcmp(val, "char") == 0) { + mtree->filetype = AE_IFCHR; + break; + } + case 'd': + if (strcmp(val, "dir") == 0) { + mtree->filetype = AE_IFDIR; + break; + } + case 'f': + if (strcmp(val, "fifo") == 0) { + mtree->filetype = AE_IFIFO; + break; + } + if (strcmp(val, "file") == 0) { + mtree->filetype = AE_IFREG; + break; + } + case 'l': + if (strcmp(val, "link") == 0) { + mtree->filetype = AE_IFLNK; + break; + } + default: + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Unrecognized file type \"%s\"", val); + return (ARCHIVE_WARN); + } + archive_entry_set_filetype(entry, mtree->filetype); + break; + } + case 'u': + if (strcmp(key, "uid") == 0) { + *parsed_kws |= MTREE_HAS_UID; + archive_entry_set_uid(entry, mtree_atol10(&val)); + break; + } + if (strcmp(key, "uname") == 0) { + *parsed_kws |= MTREE_HAS_UNAME; + archive_entry_copy_uname(entry, val); + break; + } + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Unrecognized key %s=%s", key, val); + return (ARCHIVE_WARN); + } + return (ARCHIVE_OK); +} + +static int +read_data(struct archive_read *a, const void **buff, size_t *size, off_t *offset) +{ + size_t bytes_to_read; + ssize_t bytes_read; + struct mtree *mtree; + + mtree = (struct mtree *)(a->format->data); + if (mtree->fd < 0) { + *buff = NULL; + *offset = 0; + *size = 0; + return (ARCHIVE_EOF); + } + if (mtree->buff == NULL) { + mtree->buffsize = 64 * 1024; + mtree->buff = malloc(mtree->buffsize); + if (mtree->buff == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory"); + } + return (ARCHIVE_FATAL); + } + + *buff = mtree->buff; + *offset = mtree->offset; + if ((off_t)mtree->buffsize > mtree->cur_size - mtree->offset) + bytes_to_read = mtree->cur_size - mtree->offset; + else + bytes_to_read = mtree->buffsize; + bytes_read = read(mtree->fd, mtree->buff, bytes_to_read); + if (bytes_read < 0) { + archive_set_error(&a->archive, errno, "Can't read"); + return (ARCHIVE_WARN); + } + if (bytes_read == 0) { + *size = 0; + return (ARCHIVE_EOF); + } + mtree->offset += bytes_read; + *size = bytes_read; + return (ARCHIVE_OK); +} + +/* Skip does nothing except possibly close the contents file. */ +static int +skip(struct archive_read *a) +{ + struct mtree *mtree; + + mtree = (struct mtree *)(a->format->data); + if (mtree->fd >= 0) { + close(mtree->fd); + mtree->fd = -1; + } + return (ARCHIVE_OK); +} + +/* + * Since parsing backslash sequences always makes strings shorter, + * we can always do this conversion in-place. + */ +static void +parse_escapes(char *src, struct mtree_entry *mentry) +{ + char *dest = src; + char c; + + /* + * The current directory is somewhat special, it should be archived + * only once as it will confuse extraction otherwise. + */ + if (strcmp(src, ".") == 0) + mentry->full = 1; + + while (*src != '\0') { + c = *src++; + if (c == '/' && mentry != NULL) + mentry->full = 1; + if (c == '\\') { + switch (src[0]) { + case '0': + if (src[1] < '0' || src[1] > '7') { + c = 0; + ++src; + break; + } + /* FALLTHROUGH */ + case '1': + case '2': + case '3': + if (src[1] >= '0' && src[1] <= '7' && + src[2] >= '0' && src[2] <= '7') { + c = (src[0] - '0') << 6; + c |= (src[1] - '0') << 3; + c |= (src[2] - '0'); + src += 3; + } + break; + case 'a': + c = '\a'; + ++src; + break; + case 'b': + c = '\b'; + ++src; + break; + case 'f': + c = '\f'; + ++src; + break; + case 'n': + c = '\n'; + ++src; + break; + case 'r': + c = '\r'; + ++src; + break; + case 's': + c = ' '; + ++src; + break; + case 't': + c = '\t'; + ++src; + break; + case 'v': + c = '\v'; + ++src; + break; + } + } + *dest++ = c; + } + *dest = '\0'; +} + +/* + * Note that this implementation does not (and should not!) obey + * locale settings; you cannot simply substitute strtol here, since + * it does obey locale. + */ +static int64_t +mtree_atol8(char **p) +{ + int64_t l, limit, last_digit_limit; + int digit, base; + + base = 8; + limit = INT64_MAX / base; + last_digit_limit = INT64_MAX % base; + + l = 0; + digit = **p - '0'; + while (digit >= 0 && digit < base) { + if (l>limit || (l == limit && digit > last_digit_limit)) { + l = INT64_MAX; /* Truncate on overflow. */ + break; + } + l = (l * base) + digit; + digit = *++(*p) - '0'; + } + return (l); +} + +/* + * Note that this implementation does not (and should not!) obey + * locale settings; you cannot simply substitute strtol here, since + * it does obey locale. + */ +static int64_t +mtree_atol10(char **p) +{ + int64_t l, limit, last_digit_limit; + int base, digit, sign; + + base = 10; + limit = INT64_MAX / base; + last_digit_limit = INT64_MAX % base; + + if (**p == '-') { + sign = -1; + ++(*p); + } else + sign = 1; + + l = 0; + digit = **p - '0'; + while (digit >= 0 && digit < base) { + if (l > limit || (l == limit && digit > last_digit_limit)) { + l = UINT64_MAX; /* Truncate on overflow. */ + break; + } + l = (l * base) + digit; + digit = *++(*p) - '0'; + } + return (sign < 0) ? -l : l; +} + +/* + * Note that this implementation does not (and should not!) obey + * locale settings; you cannot simply substitute strtol here, since + * it does obey locale. + */ +static int64_t +mtree_atol16(char **p) +{ + int64_t l, limit, last_digit_limit; + int base, digit, sign; + + base = 16; + limit = INT64_MAX / base; + last_digit_limit = INT64_MAX % base; + + if (**p == '-') { + sign = -1; + ++(*p); + } else + sign = 1; + + l = 0; + if (**p >= '0' && **p <= '9') + digit = **p - '0'; + else if (**p >= 'a' && **p <= 'f') + digit = **p - 'a' + 10; + else if (**p >= 'A' && **p <= 'F') + digit = **p - 'A' + 10; + else + digit = -1; + while (digit >= 0 && digit < base) { + if (l > limit || (l == limit && digit > last_digit_limit)) { + l = UINT64_MAX; /* Truncate on overflow. */ + break; + } + l = (l * base) + digit; + if (**p >= '0' && **p <= '9') + digit = **p - '0'; + else if (**p >= 'a' && **p <= 'f') + digit = **p - 'a' + 10; + else if (**p >= 'A' && **p <= 'F') + digit = **p - 'A' + 10; + else + digit = -1; + } + return (sign < 0) ? -l : l; +} + +static int64_t +mtree_atol(char **p) +{ + if (**p != '0') + return mtree_atol10(p); + if ((*p)[1] == 'x' || (*p)[1] == 'X') { + *p += 2; + return mtree_atol16(p); + } + return mtree_atol8(p); +} + +/* + * Returns length of line (including trailing newline) + * or negative on error. 'start' argument is updated to + * point to first character of line. + */ +static ssize_t +readline(struct archive_read *a, struct mtree *mtree, char **start, ssize_t limit) +{ + ssize_t bytes_read; + ssize_t total_size = 0; + const void *t; + const char *s; + void *p; + char *u; + + /* Accumulate line in a line buffer. */ + for (;;) { + /* Read some more. */ + bytes_read = (a->decompressor->read_ahead)(a, &t, 1); + if (bytes_read == 0) + return (0); + if (bytes_read < 0) + return (ARCHIVE_FATAL); + s = t; /* Start of line? */ + p = memchr(t, '\n', bytes_read); + /* If we found '\n', trim the read. */ + if (p != NULL) { + bytes_read = 1 + ((const char *)p) - s; + } + if (total_size + bytes_read + 1 > limit) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Line too long"); + return (ARCHIVE_FATAL); + } + if (archive_string_ensure(&mtree->line, + total_size + bytes_read + 1) == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate working buffer"); + return (ARCHIVE_FATAL); + } + memcpy(mtree->line.s + total_size, t, bytes_read); + (a->decompressor->consume)(a, bytes_read); + total_size += bytes_read; + /* Null terminate. */ + mtree->line.s[total_size] = '\0'; + /* If we found an unescaped '\n', clean up and return. */ + if (p == NULL) + continue; + for (u = mtree->line.s; *u; ++u) { + if (u[0] == '\n') { + *start = mtree->line.s; + return total_size; + } + if (u[0] == '#') { + if (p == NULL) + break; + *start = mtree->line.s; + return total_size; + } + if (u[0] != '\\') + continue; + if (u[1] == '\\') { + ++u; + continue; + } + if (u[1] == '\n') { + memmove(u, u + 1, + total_size - (u - mtree->line.s) + 1); + --total_size; + continue; + } + } + } +} diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_tar.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_tar.c index 26b2abb..0c2f007 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_tar.c +++ b/libarchive/libarchive-2.5.5/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.65 2008/01/31 07:41:45 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_tar.c,v 1.69 2008/05/27 04:46:12 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -145,6 +145,8 @@ struct sparse_block { struct tar { struct archive_string acl_text; struct archive_string entry_pathname; + /* For "GNU.sparse.name" and other similar path extensions. */ + struct archive_string entry_pathname_override; struct archive_string entry_linkpath; struct archive_string entry_uname; struct archive_string entry_gname; @@ -272,6 +274,7 @@ archive_read_format_tar_cleanup(struct archive_read *a) gnu_clear_sparse_list(tar); archive_string_free(&tar->acl_text); archive_string_free(&tar->entry_pathname); + archive_string_free(&tar->entry_pathname_override); archive_string_free(&tar->entry_linkpath); archive_string_free(&tar->entry_uname); archive_string_free(&tar->entry_gname); @@ -714,7 +717,7 @@ archive_block_is_null(const unsigned char *p) { unsigned i; - for (i = 0; i < ARCHIVE_BYTES_PER_RECORD / sizeof(*p); i++) + for (i = 0; i < 512; i++) if (*p++) return (0); return (1); @@ -1174,7 +1177,6 @@ pax_header(struct archive_read *a, struct tar *tar, size_t attr_length, l, line_length; char *line, *p; char *key, *value; - wchar_t *wp; int err, err2; attr_length = strlen(attr); @@ -1182,6 +1184,7 @@ pax_header(struct archive_read *a, struct tar *tar, archive_string_empty(&(tar->entry_gname)); archive_string_empty(&(tar->entry_linkpath)); archive_string_empty(&(tar->entry_pathname)); + archive_string_empty(&(tar->entry_pathname_override)); archive_string_empty(&(tar->entry_uname)); err = ARCHIVE_OK; while (attr_length > 0) { @@ -1257,11 +1260,13 @@ pax_header(struct archive_read *a, struct tar *tar, 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_entry_update_gname_utf8(entry, value)) { + err = ARCHIVE_WARN; + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Gname in pax header can't " + "be converted to current locale."); + } } } if (archive_strlen(&(tar->entry_linkpath)) > 0) { @@ -1269,23 +1274,40 @@ pax_header(struct archive_read *a, struct tar *tar, 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_entry_update_link_utf8(entry, value)) { + err = ARCHIVE_WARN; + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Linkname in pax header can't " + "be converted to current locale."); + } } } - if (archive_strlen(&(tar->entry_pathname)) > 0) { + /* + * Some extensions (such as the GNU sparse file extensions) + * deliberately store a synthetic name under the regular 'path' + * attribute and the real file name under a different attribute. + * Since we're supposed to not care about the order, we + * have no choice but to store all of the various filenames + * we find and figure it all out afterwards. This is the + * figuring out part. + */ + value = NULL; + if (archive_strlen(&(tar->entry_pathname_override)) > 0) + value = tar->entry_pathname_override.s; + else if (archive_strlen(&(tar->entry_pathname)) > 0) value = tar->entry_pathname.s; + if (value != NULL) { 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_entry_update_pathname_utf8(entry, value)) { + err = ARCHIVE_WARN; + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Pathname in pax header can't be " + "converted to current locale."); + } } } if (archive_strlen(&(tar->entry_uname)) > 0) { @@ -1293,11 +1315,13 @@ pax_header(struct archive_read *a, struct tar *tar, 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); + if (!archive_entry_update_uname_utf8(entry, value)) { + err = ARCHIVE_WARN; + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Uname in pax header can't " + "be converted to current locale."); + } } } return (err); @@ -1407,11 +1431,13 @@ pax_attribute(struct tar *tar, struct archive_entry *entry, tar->sparse_gnu_pending = 1; } 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); + /* + * The real filename; when storing sparse + * files, GNU tar puts a synthesized name into + * the regular 'path' attribute in an attempt + * to limit confusion. ;-) + */ + archive_strcpy(&(tar->entry_pathname_override), value); } if (strcmp(key, "GNU.sparse.realsize") == 0) { tar->realsize = tar_atol10(value, strlen(value)); @@ -1447,9 +1473,7 @@ pax_attribute(struct tar *tar, struct archive_entry *entry, 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); + archive_entry_copy_fflags_text(entry, value); } else if (strcmp(key, "SCHILY.dev")==0) { archive_entry_set_dev(entry, tar_atol10(value, strlen(value))); @@ -2279,7 +2303,7 @@ base64_decode(const char *s, size_t len, size_t *out_len) /* Allocate enough space to hold the entire output. */ /* Note that we may not use all of this... */ - out = (char *)malloc((len * 3 + 3) / 4); + out = (char *)malloc(len - len / 4 + 1); if (out == NULL) { *out_len = 0; return (NULL); @@ -2338,7 +2362,7 @@ url_decode(const char *in) if (out == NULL) return (NULL); for (s = in, d = out; *s != '\0'; ) { - if (*s == '%') { + if (s[0] == '%' && s[1] != '\0' && s[2] != '\0') { /* Try to convert % escape */ int digit1 = tohex(s[1]); int digit2 = tohex(s[2]); diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_zip.c b/libarchive/libarchive-2.5.5/libarchive/archive_read_support_format_zip.c index 09e7411..f04f69b 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_read_support_format_zip.c +++ b/libarchive/libarchive-2.5.5/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.21 2008/02/26 07:17:47 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.24 2008/06/15 05:15:53 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -564,8 +564,8 @@ archive_read_format_zip_read_data(struct archive_read *a, */ r = ARCHIVE_FATAL; } else { - /* We know compressed size; just skip it. */ - archive_read_format_zip_read_data_skip(a); + /* We can't decompress this entry, but we will + * be able to skip() it and try the next entry. */ r = ARCHIVE_WARN; } break; @@ -743,10 +743,14 @@ archive_read_format_zip_read_data_skip(struct archive_read *a) { struct zip *zip; const void *buff = NULL; - ssize_t bytes_avail; + off_t bytes_skipped; zip = (struct zip *)(a->format->data); + /* If we've already read to end of data, we're done. */ + if (zip->end_of_entry_cleanup) + return (ARCHIVE_OK); + /* * If the length is at the end, we have no choice but * to decompress all the data to find the end marker. @@ -766,19 +770,10 @@ archive_read_format_zip_read_data_skip(struct archive_read *a) * If the length is at the beginning, we can skip the * compressed data much more quickly. */ - while (zip->entry_bytes_remaining > 0) { - bytes_avail = (a->decompressor->read_ahead)(a, &buff, 1); - if (bytes_avail <= 0) { - archive_set_error(&a->archive, - ARCHIVE_ERRNO_FILE_FORMAT, - "Truncated ZIP file body"); - return (ARCHIVE_FATAL); - } - if (bytes_avail > zip->entry_bytes_remaining) - bytes_avail = zip->entry_bytes_remaining; - (a->decompressor->consume)(a, bytes_avail); - zip->entry_bytes_remaining -= bytes_avail; - } + bytes_skipped = (a->decompressor->skip)(a, zip->entry_bytes_remaining); + if (bytes_skipped < 0) + return (ARCHIVE_FATAL); + /* This entry is finished and done. */ zip->end_of_entry_cleanup = zip->end_of_entry = 1; return (ARCHIVE_OK); diff --git a/libarchive/libarchive-2.5.5/libarchive/archive_string.c b/libarchive/libarchive-2.5.5/libarchive/archive_string.c new file mode 100644 index 0000000..21fe571 --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/archive_string.c @@ -0,0 +1,365 @@ +/*- + * 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 "archive_platform.h" +__FBSDID("$FreeBSD: src/lib/libarchive/archive_string.c,v 1.16 2008/06/15 11:28:56 kientzle Exp $"); + +/* + * Basic resizable string support, to simplify manipulating arbitrary-sized + * strings while minimizing heap activity. + */ + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_WCHAR_H +#include <wchar.h> +#endif + +#include "archive_private.h" +#include "archive_string.h" + +struct archive_string * +__archive_string_append(struct archive_string *as, const char *p, size_t s) +{ + if (__archive_string_ensure(as, as->length + s + 1) == NULL) + __archive_errx(1, "Out of memory"); + memcpy(as->s + as->length, p, s); + as->s[as->length + s] = 0; + as->length += s; + return (as); +} + +void +__archive_string_copy(struct archive_string *dest, struct archive_string *src) +{ + if (src->length == 0) + dest->length = 0; + else { + if (__archive_string_ensure(dest, src->length + 1) == NULL) + __archive_errx(1, "Out of memory"); + memcpy(dest->s, src->s, src->length); + dest->length = src->length; + dest->s[dest->length] = 0; + } +} + +void +__archive_string_free(struct archive_string *as) +{ + as->length = 0; + as->buffer_length = 0; + if (as->s != NULL) { + free(as->s); + as->s = NULL; + } +} + +/* Returns NULL on any allocation failure. */ +struct archive_string * +__archive_string_ensure(struct archive_string *as, size_t s) +{ + /* If buffer is already big enough, don't reallocate. */ + if (as->s && (s <= as->buffer_length)) + return (as); + + /* + * Growing the buffer at least exponentially ensures that + * append operations are always linear in the number of + * characters appended. Using a smaller growth rate for + * larger buffers reduces memory waste somewhat at the cost of + * a larger constant factor. + */ + if (as->buffer_length < 32) + /* Start with a minimum 32-character buffer. */ + as->buffer_length = 32; + else if (as->buffer_length < 8192) + /* Buffers under 8k are doubled for speed. */ + as->buffer_length *= 2; + else { + /* Buffers 8k and over grow by at least 25% each time. */ + size_t old_length = as->buffer_length; + as->buffer_length = (as->buffer_length * 5) / 4; + /* Be safe: If size wraps, release buffer and return NULL. */ + if (as->buffer_length < old_length) { + free(as->s); + as->s = NULL; + return (NULL); + } + } + /* + * The computation above is a lower limit to how much we'll + * grow the buffer. In any case, we have to grow it enough to + * hold the request. + */ + if (as->buffer_length < s) + as->buffer_length = s; + /* Now we can reallocate the buffer. */ + as->s = (char *)realloc(as->s, as->buffer_length); + if (as->s == NULL) + return (NULL); + return (as); +} + +struct archive_string * +__archive_strncat(struct archive_string *as, const char *p, size_t n) +{ + size_t s; + const char *pp; + + /* Like strlen(p), except won't examine positions beyond p[n]. */ + s = 0; + pp = p; + while (*pp && s < n) { + pp++; + s++; + } + return (__archive_string_append(as, p, s)); +} + +struct archive_string * +__archive_strappend_char(struct archive_string *as, char c) +{ + return (__archive_string_append(as, &c, 1)); +} + +struct archive_string * +__archive_strappend_int(struct archive_string *as, int d, int base) +{ + static const char *digits = "0123456789abcdef"; + + if (d < 0) { + __archive_strappend_char(as, '-'); + d = -d; + } + if (d >= base) + __archive_strappend_int(as, d/base, base); + __archive_strappend_char(as, digits[d % base]); + return (as); +} + +/* + * Home-grown wctomb for UTF-8. + */ +static int +my_wctomb_utf8(char *p, wchar_t wc) +{ + if (p == NULL) + /* UTF-8 doesn't use shift states. */ + return (0); + if (wc <= 0x7f) { + p[0] = (char)wc; + return (1); + } + if (wc <= 0x7ff) { + p[0] = 0xc0 | ((wc >> 6) & 0x1f); + p[1] = 0x80 | (wc & 0x3f); + return (2); + } + if (wc <= 0xffff) { + p[0] = 0xe0 | ((wc >> 12) & 0x0f); + p[1] = 0x80 | ((wc >> 6) & 0x3f); + p[2] = 0x80 | (wc & 0x3f); + return (3); + } + if (wc <= 0x1fffff) { + p[0] = 0xf0 | ((wc >> 18) & 0x07); + p[1] = 0x80 | ((wc >> 12) & 0x3f); + p[2] = 0x80 | ((wc >> 6) & 0x3f); + p[3] = 0x80 | (wc & 0x3f); + return (4); + } + /* Unicode has no codes larger than 0x1fffff. */ + /* + * Awkward point: UTF-8 <-> wchar_t conversions + * can actually fail. + */ + return (-1); +} + +static int +my_wcstombs(struct archive_string *as, const wchar_t *w, + int (*func)(char *, wchar_t)) +{ + int n; + char *p; + char buff[256]; + + /* Clear the shift state before starting. */ + (*func)(NULL, L'\0'); + + /* + * Convert one wide char at a time into 'buff', whenever that + * fills, append it to the string. + */ + p = buff; + while (*w != L'\0') { + /* Flush the buffer when we have <=16 bytes free. */ + /* (No encoding has a single character >16 bytes.) */ + if ((size_t)(p - buff) >= (size_t)(sizeof(buff) - 16)) { + *p = '\0'; + archive_strcat(as, buff); + p = buff; + } + n = (*func)(p, *w++); + if (n == -1) + return (-1); + p += n; + } + *p = '\0'; + archive_strcat(as, buff); + return (0); +} + +/* + * Translates a wide character string into UTF-8 and appends + * to the archive_string. Note: returns NULL if conversion fails. + */ +struct archive_string * +__archive_strappend_w_utf8(struct archive_string *as, const wchar_t *w) +{ + if (my_wcstombs(as, w, my_wctomb_utf8)) + return (NULL); + return (as); +} + +/* + * Translates a wide character string into current locale character set + * and appends to the archive_string. Note: returns NULL if conversion + * fails. + */ +struct archive_string * +__archive_strappend_w_mbs(struct archive_string *as, const wchar_t *w) +{ +#if HAVE_WCTOMB + if (my_wcstombs(as, w, wctomb)) + return (NULL); +#else + /* TODO: Can we do better than this? Are there platforms + * that have locale support but don't have wctomb()? */ + if (my_wcstombs(as, w, my_wctomb_utf8)) + return (NULL); +#endif + return (as); +} + + +/* + * Home-grown mbtowc for UTF-8. Some systems lack UTF-8 + * (or even lack mbtowc()) and we need UTF-8 support for pax + * format. So please don't replace this with a call to the + * standard mbtowc() function! + */ +static int +my_mbtowc_utf8(wchar_t *pwc, const char *s, size_t n) +{ + int ch; + + /* Standard behavior: a NULL value for 's' just resets shift state. */ + if (s == NULL) + return (0); + /* If length argument is zero, don't look at the first character. */ + if (n <= 0) + return (-1); + + /* + * Decode 1-4 bytes depending on the value of the first byte. + */ + ch = (unsigned char)*s; + if (ch == 0) { + return (0); /* Standard: return 0 for end-of-string. */ + } + if ((ch & 0x80) == 0) { + *pwc = ch & 0x7f; + return (1); + } + if ((ch & 0xe0) == 0xc0) { + if (n < 2) + return (-1); + if ((s[1] & 0xc0) != 0x80) return (-1); + *pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f); + return (2); + } + if ((ch & 0xf0) == 0xe0) { + if (n < 3) + return (-1); + if ((s[1] & 0xc0) != 0x80) return (-1); + if ((s[2] & 0xc0) != 0x80) return (-1); + *pwc = ((ch & 0x0f) << 12) + | ((s[1] & 0x3f) << 6) + | (s[2] & 0x3f); + return (3); + } + if ((ch & 0xf8) == 0xf0) { + if (n < 4) + return (-1); + if ((s[1] & 0xc0) != 0x80) return (-1); + if ((s[2] & 0xc0) != 0x80) return (-1); + if ((s[3] & 0xc0) != 0x80) return (-1); + *pwc = ((ch & 0x07) << 18) + | ((s[1] & 0x3f) << 12) + | ((s[2] & 0x3f) << 6) + | (s[3] & 0x3f); + return (4); + } + /* Invalid first byte. */ + return (-1); +} + +/* + * Return a wide-character string by converting this archive_string + * from UTF-8. + */ +wchar_t * +__archive_string_utf8_w(struct archive_string *as) +{ + wchar_t *ws, *dest; + const char *src; + int n; + int err; + + ws = (wchar_t *)malloc((as->length + 1) * sizeof(wchar_t)); + if (ws == NULL) + __archive_errx(1, "Out of memory"); + err = 0; + dest = ws; + src = as->s; + while (*src != '\0') { + n = my_mbtowc_utf8(dest, src, 8); + if (n == 0) + break; + if (n < 0) { + free(ws); + return (NULL); + } + dest++; + src += n; + } + *dest++ = L'\0'; + return (ws); +} diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_string.h b/libarchive/libarchive-2.5.5/libarchive/archive_string.h index 596db9a..e59c33a 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_string.h +++ b/libarchive/libarchive-2.5.5/libarchive/archive_string.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_string.h,v 1.9 2007/05/29 01:00:19 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive_string.h,v 1.12 2008/06/15 05:11:08 kientzle Exp $ * */ @@ -30,9 +30,15 @@ #define ARCHIVE_STRING_H_INCLUDED #include <stdarg.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> /* required for wchar_t on some systems */ +#endif #ifdef HAVE_STRING_H #include <string.h> #endif +#ifdef HAVE_WCHAR_H +#include <wchar.h> +#endif /* * Basic resizable/reusable string support a la Java's "StringBuffer." @@ -60,16 +66,22 @@ struct archive_string * __archive_strappend_char(struct archive_string *, char); #define archive_strappend_char __archive_strappend_char -/* Append a char to an archive_string using UTF8. */ -struct archive_string * -__archive_strappend_char_UTF8(struct archive_string *, int); -#define archive_strappend_char_UTF8 __archive_strappend_char_UTF8 - /* Append an integer in the specified base (2 <= base <= 16). */ struct archive_string * __archive_strappend_int(struct archive_string *as, int d, int base); #define archive_strappend_int __archive_strappend_int +/* Convert a wide-char string to UTF-8 and append the result. */ +struct archive_string * +__archive_strappend_w_utf8(struct archive_string *, const wchar_t *); +#define archive_strappend_w_utf8 __archive_strappend_w_utf8 + +/* Convert a wide-char string to current locale and append the result. */ +/* Returns NULL if conversion fails. */ +struct archive_string * +__archive_strappend_w_mbs(struct archive_string *, const wchar_t *); +#define archive_strappend_w_mbs __archive_strappend_w_mbs + /* Basic append operation. */ struct archive_string * __archive_string_append(struct archive_string *as, const char *p, size_t s); @@ -95,7 +107,7 @@ __archive_strncat(struct archive_string *, const char *, size_t); /* Copy a C string to an archive_string, resizing as necessary. */ #define archive_strcpy(as,p) \ - ((as)->length = 0, __archive_string_append((as), (p), strlen(p))) + ((as)->length = 0, __archive_string_append((as), (p), p == NULL ? 0 : strlen(p))) /* Copy a C string to an archive_string with limit, resizing as necessary. */ #define archive_strncpy(as,p,l) \ @@ -116,4 +128,12 @@ void __archive_string_vsprintf(struct archive_string *, const char *, va_list); #define archive_string_vsprintf __archive_string_vsprintf +void __archive_string_sprintf(struct archive_string *, const char *, ...); +#define archive_string_sprintf __archive_string_sprintf + +/* Allocates a fresh buffer and converts as (assumed to be UTF-8) into it. + * Returns NULL if conversion failed in any way. */ +wchar_t *__archive_string_utf8_w(struct archive_string *as); + + #endif diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_string_sprintf.c b/libarchive/libarchive-2.5.5/libarchive/archive_string_sprintf.c index 763e75d..6f77a36 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_string_sprintf.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_string_sprintf.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_string_sprintf.c,v 1.9 2007/07/15 19:13:59 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_string_sprintf.c,v 1.10 2008/03/14 22:00:09 kientzle Exp $"); /* * The use of printf()-family functions can be troublesome @@ -44,6 +44,16 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_string_sprintf.c,v 1.9 2007/07/15 #include "archive_string.h" #include "archive_private.h" +void +__archive_string_sprintf(struct archive_string *as, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + archive_string_vsprintf(as, fmt, ap); + va_end(ap); +} + /* * Like 'vsprintf', but ensures the target is big enough, resizing if * necessary. diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_util.3 b/libarchive/libarchive-2.5.5/libarchive/archive_util.3 index b8a030e..b315c55 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_util.3 +++ b/libarchive/libarchive-2.5.5/libarchive/archive_util.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/archive_util.3,v 1.7 2007/05/29 01:00:19 kientzle Exp $ +.\" $FreeBSD: src/lib/libarchive/archive_util.3,v 1.8 2008/03/10 14:44:40 jkoshy Exp $ .\" .Dd January 8, 2005 .Dt archive_util 3 @@ -57,7 +57,12 @@ .Ft const char * .Fn archive_format_name "struct archive *" .Ft void -.Fn archive_set_error "struct archive *" "int error_code" "const char *fmt" "..." +.Fo archive_set_error +.Fa "struct archive *" +.Fa "int error_code" +.Fa "const char *fmt" +.Fa "..." +.Fc .Sh DESCRIPTION These functions provide access to various information about the .Tn struct archive diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_util.c b/libarchive/libarchive-2.5.5/libarchive/archive_util.c index 413199a..7fb4696 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_util.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_util.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_util.c,v 1.16 2007/12/30 04:58:21 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_util.c,v 1.18 2008/05/26 17:00:22 kientzle Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -38,29 +38,49 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_util.c,v 1.16 2007/12/30 04:58:21 #include "archive.h" #include "archive_private.h" +#include "archive_string.h" +#if ARCHIVE_VERSION_NUMBER < 3000000 +/* These disappear in libarchive 3.0 */ +/* Deprecated. */ int archive_api_feature(void) { return (ARCHIVE_API_FEATURE); } +/* Deprecated. */ int archive_api_version(void) { return (ARCHIVE_API_VERSION); } +/* Deprecated synonym for archive_version_number() */ int archive_version_stamp(void) { - return (ARCHIVE_VERSION_STAMP); + return (archive_version_number()); } +/* Deprecated synonym for archive_version_string() */ const char * archive_version(void) { - return (ARCHIVE_LIBRARY_VERSION); + return (archive_version_string()); +} +#endif + +int +archive_version_number(void) +{ + return (ARCHIVE_VERSION_NUMBER); +} + +const char * +archive_version_string(void) +{ + return (ARCHIVE_VERSION_STRING); } int diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_virtual.c b/libarchive/libarchive-2.5.5/libarchive/archive_virtual.c index a431058..a431058 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_virtual.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_virtual.c diff --git a/libarchive/libarchive-2.5.5/libarchive/archive_windows.c b/libarchive/libarchive-2.5.5/libarchive/archive_windows.c new file mode 100644 index 0000000..1f4d273 --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/archive_windows.c @@ -0,0 +1,188 @@ +/*- + * Copyright (c) 2003-2007 Kees Zeelenberg + * 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$ + */ + +/* + * A set of compatibility glue for building libarchive on Windows platforms. + * + * Originally created as "libarchive-nonposix.c" by Kees Zeelenberg + * for the GnuWin32 project, trimmed significantly by Tim Kientzle. + * + * Much of the original file was unnecessary for libarchive, because + * many of the features it emulated were not strictly necessary for + * libarchive. I hope for this to shrink further as libarchive + * internals are gradually reworked to sit more naturally on both + * POSIX and Windows. Any ideas for this are greatly appreciated. + * + * The biggest remaining issue is the dev/ino emulation; libarchive + * has a couple of public APIs that rely on dev/ino uniquely + * identifying a file. This doesn't match well with Windows. I'm + * considering alternative APIs. + */ + +#ifdef _WIN32 + +#include <errno.h> +#include <stddef.h> +#include <sys/utime.h> +#include <sys/stat.h> +#include <process.h> +#include <stdlib.h> +#include <windows.h> +#include "archive_platform.h" + +/* Make a link to FROM called TO. */ +int link (from, to) + const char *from; + const char *to; +{ + int res; + + if (from == NULL || to == NULL) { + set_errno (EINVAL); + return -1; + } + + if (!_access (from, F_OK)) + res = CopyFile (from, to, FALSE); + else { + /* from doesn not exist; try to prepend it with the dirname of to */ + char *fullfrompath, *slash, *todir; + todir = strdup (to); + if (!todir) + return -1; + slash = strrchr(todir, '/'); + if (slash) + *slash = '\0'; + fullfrompath = malloc (strlen (from) + strlen (todir) + 2); + if (!fullfrompath) + return -1; + strcpy (fullfrompath, todir); + strcat (fullfrompath, "/"); + strcat (fullfrompath, from); + if (todir) + free (todir); + if (_access (fullfrompath, R_OK)) + return -1; + res = CopyFile (fullfrompath, to, FALSE); + if (fullfrompath) + free (fullfrompath); + } + + if (res == 0) { + set_errno (EINVAL); + return -1; + } + return 0; +} + +/* Make a symbolic link to FROM called TO. */ +int symlink (from, to) + const char *from; + const char *to; +{ + return link (from, to); +} + +static int get_dev_ino (HANDLE hFile, dev_t *dev, ino_t *ino) +{ +/* dev_t: short (2 bytes); ino_t: unsigned int (4 bytes) */ +#define LODWORD(l) ((DWORD)((DWORDLONG)(l))) +#define HIDWORD(l) ((DWORD)(((DWORDLONG)(l)>>32)&0xFFFFFFFF)) +#define MAKEDWORDLONG(a,b) ((DWORDLONG)(((DWORD)(a))|(((DWORDLONG)((DWORD)(b)))<<32))) + +#define INOSIZE (8*sizeof(ino_t)) /* 32 */ +//#define DEVSIZE (8*sizeof(dev_t)) /* 16 */ +#define SEQNUMSIZE (16) + + BY_HANDLE_FILE_INFORMATION FileInformation; + uint64_t ino64, FileReferenceNumber ; + ino_t resino; + dev_t resdev; + DWORD VolumeSerialNumber; + + *ino = 0; + *dev = 0; + if (hFile == INVALID_HANDLE_VALUE) /* file cannot be opened */ + return 0; + ZeroMemory (&FileInformation, sizeof(FileInformation)); + if (!GetFileInformationByHandle (hFile, &FileInformation)) /* cannot obtain FileInformation */ + return 0; + ino64 = (uint64_t) MAKEDWORDLONG ( + FileInformation.nFileIndexLow, FileInformation.nFileIndexHigh); + FileReferenceNumber = ino64 & ((~(0ULL)) >> SEQNUMSIZE); /* remove sequence number */ + /* transform 64-bits ino into 32-bits by hashing */ + resino = (ino_t) ( + ( (LODWORD(FileReferenceNumber)) ^ ((LODWORD(FileReferenceNumber)) >> INOSIZE) ) +// ^ +// ( (HIDWORD(FileReferenceNumber)) ^ ((HIDWORD(FileReferenceNumber)) >> INOSIZE) ) + ); + *ino = resino; + VolumeSerialNumber = FileInformation.dwVolumeSerialNumber; + //resdev = (unsigned short) ( (LOWORD(VolumeSerialNumber)) ^ ((HIWORD(VolumeSerialNumber)) >> DEVSIZE) ); + resdev = (dev_t) VolumeSerialNumber; + *dev = resdev; +//printf ("get_dev_ino: dev = %d; ino = %u\n", resdev, resino); + return 0; +} + +int get_dev_ino_fd (int fd, dev_t *dev, ino_t *ino) +{ + HANDLE hFile; + hFile = (HANDLE) _get_osfhandle (fd); + return get_dev_ino (hFile, dev, ino); +} + +int get_dev_ino_filename (char *path, dev_t *dev, ino_t *ino) +{ + HANDLE hFile; + int res; + if (!path || !*path) /* path = NULL */ + return 0; + if (_access (path, F_OK)) /* path does not exist */ + return -1; +/* obtain handle to file "name"; FILE_FLAG_BACKUP_SEMANTICS is used to open directories */ + hFile = CreateFile (path, 0, 0, NULL, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_READONLY, + NULL); + res = get_dev_ino (hFile, dev, ino); + CloseHandle (hFile); + return res; +} + +int fstati64 (int fd, struct _stati64 *st) +{ + int res; + res = _fstati64 (fd, st); + if (res < 0) + return -1; + if (st->st_ino == 0) + res = get_dev_ino_fd (fd, &st->st_dev, &st->st_ino); +// printf ("fstat: dev = %u; ino = %u\n", st->st_dev, st->st_ino); + return res; +} + +#endif /* _WIN32 */ diff --git a/libarchive/libarchive-2.5.5/libarchive/archive_windows.h b/libarchive/libarchive-2.5.5/libarchive/archive_windows.h new file mode 100644 index 0000000..9bc21e4 --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/archive_windows.h @@ -0,0 +1,152 @@ +/*- + * 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$ + */ + +#ifndef LIBARCHIVE_NONPOSIX_H_INCLUDED +#define LIBARCHIVE_NONPOSIX_H_INCLUDED + +/* Start of configuration for native Win32 */ + +#include <errno.h> +#define set_errno(val) ((errno)=val) +#include <io.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <process.h> +#include <direct.h> + +#define EFTYPE 7 +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 + +/* TODO: Fix the code, don't suppress the warnings. */ +#pragma warning(disable:4244) /* 'conversion' conversion from 'type1' to 'type2', possible loss of data */ +#pragma warning(disable:4146) /* unary minus operator applied to unsigned type, result still unsigned */ +#pragma warning(disable:4996) /* 'function': was declared deprecated */ +#pragma warning(disable:4267) /* Conversion, possible loss of data */ + +/* Basic definitions for system and integer types. */ +#ifndef _SSIZE_T_ +# define SSIZE_MAX LONG_MAX +#define _SSIZE_T_ +#endif /* _SSIZE_T_ */ + +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +/* 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 +#ifndef STDERR_FILENO +#define STDERR_FILENO 2 +#endif /* STDERR_FILENO */ + +/* Alias the Windows _function to the POSIX equivalent. */ +#define chdir _chdir +#define chmod _chmod +#define close _close +#define fileno _fileno +#define fstat _fstat +#define lseek _lseek +#define open _open +#define stat _stat +#define mkdir(d,m) _mkdir(d) +#define mktemp _mktemp +#define read _read +#define rmdir _rmdir +#define strdup _strdup +#define tzset _tzset +#define umask _umask +#define write _write + +#define O_RDONLY _O_RDONLY +#define O_WRONLY _O_WRONLY +#define O_TRUNC _O_TRUNC +#define O_CREAT _O_CREAT +#define O_EXCL _O_EXCL + +#define S_ISUID 0004000 +#define S_ISGID 0002000 +#define S_ISVTX 0001000 + +#define S_IFMT 0170000 +#define S_IFDIR _S_IFDIR +#define S_IFREG _S_IFREG + +#define S_ISDIR(m) (((m) & 0170000) == _S_IFDIR) /* directory */ +#define S_ISCHR(m) (((m) & 0170000) == _S_IFCHR) /* char special */ +#define S_ISREG(m) (((m) & 0170000) == _S_IFREG) /* regular file */ + +/* Windows doesn't have the following, so they're trivial. */ +#define S_ISBLK(m) (0) /* block special */ +#define S_ISFIFO(m) (0) /* fifo or socket */ +#define S_ISLNK(m) (0) /* Symbolic link */ +#define S_ISSOCK(m) (0) /* Socket */ + +/* replace stat and seek by their large-file equivalents */ +#undef stat +#define stat _stati64 +#undef fstat +#define fstat _fstati64 + +#undef lseek +#define lseek _lseeki64 +#define lseek64 _lseeki64 +#define tell _telli64 +#define tell64 _telli64 + +#ifdef __MINGW32__ +# define fseek fseeko64 +# define fseeko fseeko64 +# define ftell ftello64 +# define ftello ftello64 +# define ftell64 ftello64 +#endif /* __MINGW32__ */ + +/* End of Win32 definitions. */ + +#ifdef __cplusplus +extern "C" { +#endif + +extern int link (const char *from, const char *to); +extern int symlink (const char *from, const char *to); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBARCHIVE_NONPOSIX_H_INCLUDED */ diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write.3 b/libarchive/libarchive-2.5.5/libarchive/archive_write.3 index c07b6b5..14003f4 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write.3 +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write.3 @@ -22,9 +22,9 @@ .\" 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 $ +.\" $FreeBSD: src/lib/libarchive/archive_write.3,v 1.24 2008/05/26 17:00:23 kientzle Exp $ .\" -.Dd August 19, 2006 +.Dd May 11, 2008 .Dt archive_write 3 .Os .Sh NAME @@ -39,6 +39,7 @@ .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_compress , .Nm archive_write_set_compression_gzip , .Nm archive_write_set_compression_none , .Nm archive_write_set_compression_program , @@ -66,11 +67,16 @@ .Ft int .Fn archive_write_set_compression_bzip2 "struct archive *" .Ft int +.Fn archive_write_set_compression_compress "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" +.Fo archive_write_set_compression_program +.Fa "struct archive *" +.Fa "const char * cmd" +.Fc .Ft int .Fn archive_write_set_format_cpio "struct archive *" .Ft int @@ -84,7 +90,13 @@ .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 *" +.Fo archive_write_open +.Fa "struct archive *" +.Fa "void *client_data" +.Fa "archive_open_callback *" +.Fa "archive_write_callback *" +.Fa "archive_close_callback *" +.Fc .Ft int .Fn archive_write_open_fd "struct archive *" "int fd" .Ft int @@ -92,7 +104,12 @@ .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" +.Fo archive_write_open_memory +.Fa "struct archive *" +.Fa "void *buffer" +.Fa "size_t bufferSize" +.Fa "size_t *outUsed" +.Fc .Ft int .Fn archive_write_header "struct archive *" "struct archive_entry *" .Ft ssize_t @@ -150,7 +167,14 @@ functions, this function can be called after the archive is opened. .It Fn 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. -.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 +.It Xo +.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 +.Xc Sets the format that will be used for the archive. The library can write POSIX octet-oriented cpio format archives, @@ -174,7 +198,12 @@ filenames, linknames, uids, sizes, etc. 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 +.It Xo +.Fn archive_write_set_compression_bzip2 , +.Fn archive_write_set_compression_compress , +.Fn archive_write_set_compression_gzip , +.Fn archive_write_set_compression_none +.Xc The resulting archive will be compressed as specified. Note that the compressed output is always properly blocked. .It Fn archive_write_set_compression_program @@ -310,7 +339,12 @@ to register an error code and message and return .Bl -item -offset indent .It .Ft typedef ssize_t -.Fn archive_write_callback "struct archive *" "void *client_data" "void *buffer" "size_t length" +.Fo archive_write_callback +.Fa "struct archive *" +.Fa "void *client_data" +.Fa "void *buffer" +.Fa "size_t length" +.Fc .El .Pp The write callback is invoked whenever the library diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write.c b/libarchive/libarchive-2.5.5/libarchive/archive_write.c index 2977063..1a3ddc9 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write.c,v 1.26 2007/05/29 01:00:19 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write.c,v 1.27 2008/03/14 23:09:02 kientzle Exp $"); /* * This file contains the "essential" portions of the write API, that @@ -97,7 +97,12 @@ archive_write_new(void) a->archive.magic = ARCHIVE_WRITE_MAGIC; a->archive.state = ARCHIVE_STATE_NEW; a->archive.vtable = archive_write_vtable(); - a->bytes_per_block = ARCHIVE_DEFAULT_BYTES_PER_BLOCK; + /* + * The value 10240 here matches the traditional tar default, + * but is otherwise arbitrary. + * TODO: Set the default block size from the format selected. + */ + a->bytes_per_block = 10240; a->bytes_in_last_block = -1; /* Default */ /* Initialize a block of nulls for padding purposes. */ diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_disk.3 b/libarchive/libarchive-2.5.5/libarchive/archive_write_disk.3 index 880a399..d68a0ff 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_disk.3 +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_disk.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/archive_write_disk.3,v 1.1 2007/03/03 07:37:36 kientzle Exp $ +.\" $FreeBSD: src/lib/libarchive/archive_write_disk.3,v 1.3 2008/05/26 17:00:23 kientzle Exp $ .\" .Dd March 2, 2007 .Dt archive_write_disk 3 @@ -49,11 +49,21 @@ .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 *)" +.Fo archive_write_disk_set_group_lookup +.Fa "struct archive *" +.Fa "void *" +.Fa "gid_t (*)(void *, const char *gname, gid_t gid)" +.Fa "void (*cleanup)(void *)" +.Fc .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 *)" +.Fo archive_write_disk_set_user_lookup +.Fa "struct archive *" +.Fa "void *" +.Fa "uid_t (*)(void *, const char *uname, uid_t uid)" +.Fa "void (*cleanup)(void *)" +.Fc .Ft int .Fn archive_write_header "struct archive *" "struct archive_entry *" .Ft ssize_t @@ -160,7 +170,14 @@ Note that paths ending in .Pa .. always cause an error, regardless of this flag. .El -.It Fn archive_write_disk_set_group_lookup , Fn archive_write_disk_set_user_lookup +.It Cm ARCHIVE_EXTRACT_SPARSE +Scan data for blocks of NUL bytes and try to recreate them with holes. +This results in sparse files, independent of whether the archive format +supports or uses them. +.It Xo +.Fn archive_write_disk_set_group_lookup , +.Fn archive_write_disk_set_user_lookup +.Xc The .Tn struct archive_entry objects contain both names and ids that can be used to identify users diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_disk.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_disk.c index dfb6d35..238173c 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_disk.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_disk.c @@ -25,7 +25,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.22 2008/02/19 05:39:35 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.26 2008/06/21 19:05:29 kientzle Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -64,9 +64,6 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.22 2008/02/19 05 #ifdef HAVE_LINUX_FS_H #include <linux/fs.h> /* for Linux file flags */ #endif -#ifdef HAVE_LINUX_EXT2_FS_H -#include <linux/ext2_fs.h> /* for Linux file flags */ -#endif #ifdef HAVE_LIMITS_H #include <limits.h> #endif @@ -187,6 +184,8 @@ struct archive_write_disk { /* UID/GID to use in restoring this entry. */ uid_t uid; gid_t gid; + /* Last offset written to disk. */ + off_t last_offset; }; /* @@ -242,6 +241,31 @@ static int _archive_write_finish_entry(struct archive *); static ssize_t _archive_write_data(struct archive *, const void *, size_t); static ssize_t _archive_write_data_block(struct archive *, const void *, size_t, off_t); +static int +_archive_write_disk_lazy_stat(struct archive_write_disk *a) +{ + if (a->pst != NULL) { + /* Already have stat() data available. */ + return (ARCHIVE_OK); + } +#ifdef HAVE_FSTAT + if (a->fd >= 0 && fstat(a->fd, &a->st) == 0) { + a->pst = &a->st; + return (ARCHIVE_OK); + } +#endif + /* + * XXX At this point, symlinks should not be hit, otherwise + * XXX a race occured. Do we want to check explicitly for that? + */ + if (lstat(a->name, &a->st) == 0) { + a->pst = &a->st; + return (ARCHIVE_OK); + } + archive_set_error(&a->archive, errno, "Couldn't stat file"); + return (ARCHIVE_WARN); +} + static struct archive_vtable * archive_write_disk_vtable(void) { @@ -294,7 +318,7 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry) archive_clear_error(&a->archive); if (a->archive.state & ARCHIVE_STATE_DATA) { r = _archive_write_finish_entry(&a->archive); - if (r != ARCHIVE_OK) + if (r == ARCHIVE_FATAL) return (r); } @@ -308,6 +332,7 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry) } a->entry = archive_entry_clone(entry); a->fd = -1; + a->last_offset = 0; a->offset = 0; a->uid = a->user_uid; a->mode = archive_entry_mode(a->entry); @@ -463,6 +488,7 @@ _archive_write_data_block(struct archive *_a, { struct archive_write_disk *a = (struct archive_write_disk *)_a; ssize_t bytes_written = 0; + ssize_t block_size, bytes_to_write; int r = ARCHIVE_OK; __archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, @@ -473,31 +499,53 @@ _archive_write_data_block(struct archive *_a, } archive_clear_error(&a->archive); - /* Seek if necessary to the specified offset. */ - if (offset != a->offset) { - if (lseek(a->fd, offset, SEEK_SET) < 0) { - archive_set_error(&a->archive, errno, "Seek failed"); - return (ARCHIVE_WARN); - } - a->offset = offset; + if (a->flags & ARCHIVE_EXTRACT_SPARSE) { + if ((r = _archive_write_disk_lazy_stat(a)) != ARCHIVE_OK) + return (r); + block_size = a->pst->st_blksize; + } else + block_size = -1; + + if ((off_t)(offset + size) > a->filesize) { + size = (size_t)(a->filesize - a->offset); + archive_set_error(&a->archive, 0, + "Write request too large"); + r = ARCHIVE_WARN; } /* Write the data. */ - 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; - } + while (size > 0) { + if (block_size != -1) { + const char *buf; + + for (buf = buff; size; ++buf, --size, ++offset) { + if (*buf != '\0') + break; + } + if (size == 0) + break; + bytes_to_write = block_size - offset % block_size; + buff = buf; + } else + bytes_to_write = size; + /* Seek if necessary to the specified offset. */ + if (offset != a->last_offset) { + if (lseek(a->fd, offset, SEEK_SET) < 0) { + archive_set_error(&a->archive, errno, "Seek failed"); + return (ARCHIVE_FATAL); + } + } bytes_written = write(a->fd, buff, size); if (bytes_written < 0) { archive_set_error(&a->archive, errno, "Write failed"); return (ARCHIVE_WARN); } + buff = (const char *)buff + bytes_written; size -= bytes_written; - a->offset += bytes_written; + offset += bytes_written; + a->last_offset = a->offset = offset; } + a->offset = offset; return (r); } @@ -505,7 +553,6 @@ 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, @@ -513,11 +560,10 @@ _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 (a->offset - offset); + return size; } static int @@ -533,11 +579,39 @@ _archive_write_finish_entry(struct archive *_a) return (ARCHIVE_OK); archive_clear_error(&a->archive); + if (a->last_offset != a->filesize && a->fd >= 0) { + if (ftruncate(a->fd, a->filesize) == -1 && + a->filesize == 0) { + archive_set_error(&a->archive, errno, + "File size could not be restored"); + return (ARCHIVE_FAILED); + } + /* + * Explicitly stat the file as some platforms might not + * implement the XSI option to extend files via ftruncate. + */ + a->pst = NULL; + if ((ret = _archive_write_disk_lazy_stat(a)) != ARCHIVE_OK) + return (ret); + if (a->st.st_size != a->filesize) { + const char nul = '\0'; + if (lseek(a->fd, a->st.st_size - 1, SEEK_SET) < 0) { + archive_set_error(&a->archive, errno, "Seek failed"); + return (ARCHIVE_FATAL); + } + if (write(a->fd, &nul, 1) < 0) { + archive_set_error(&a->archive, errno, + "Write to restore size failed"); + return (ARCHIVE_FATAL); + } + } + } + /* Restore metadata. */ /* - * Look up the "real" UID only if we're going to need it. We - * need this for TODO_SGID because chown() requires both. + * Look up the "real" UID only if we're going to need it. + * TODO: the TODO_SGID condition can be dropped here, can't it? */ if (a->todo & (TODO_OWNER | TODO_SUID | TODO_SGID)) { a->uid = a->lookup_uid(a->lookup_uid_data, @@ -545,6 +619,7 @@ _archive_write_finish_entry(struct archive *_a) archive_entry_uid(a->entry)); } /* Look up the "real" GID only if we're going to need it. */ + /* TODO: the TODO_SUID condition can be dropped here, can't it? */ if (a->todo & (TODO_OWNER | TODO_SGID | TODO_SUID)) { a->gid = a->lookup_gid(a->lookup_gid_data, archive_entry_gname(a->entry), @@ -723,11 +798,13 @@ restore_entry(struct archive_write_disk *a) * object isn't a dir. */ if (unlink(a->name) == 0) { - /* We removed it, we're done. */ + /* We removed it, reset cached stat. */ + a->pst = NULL; } else if (errno == ENOENT) { /* File didn't exist, that's just as good. */ } else if (rmdir(a->name) == 0) { /* It was a dir, but now it's gone. */ + a->pst = NULL; } else { /* We tried, but couldn't get rid of it. */ archive_set_error(&a->archive, errno, @@ -768,6 +845,7 @@ restore_entry(struct archive_write_disk *a) "Can't remove already-existing dir"); return (ARCHIVE_WARN); } + a->pst = NULL; /* Try again. */ en = create_filesystem_object(a); } else if (en == EEXIST) { @@ -807,6 +885,7 @@ restore_entry(struct archive_write_disk *a) "Can't unlink already-existing object"); return (ARCHIVE_WARN); } + a->pst = NULL; /* Try again. */ en = create_filesystem_object(a); } else if (!S_ISDIR(a->mode)) { @@ -866,8 +945,18 @@ create_filesystem_object(struct archive_write_disk *a) * New cpio and pax formats allow hardlink entries * to carry data, so we may have to open the file * for hardlink entries. + * + * If the hardlink was successfully created and + * the archive doesn't have carry data for it, + * consider it to be non-authoritive for meta data. + * This is consistent with GNU tar and BSD pax. + * If the hardlink does carry data, let the last + * archive entry decide ownership. */ - if (r == 0 && a->filesize > 0) { + if (r == 0 && a->filesize == 0) { + a->todo = 0; + a->deferred = 0; + } if (r == 0 && a->filesize > 0) { a->fd = open(a->name, O_WRONLY | O_TRUNC | O_BINARY); if (a->fd < 0) r = errno; @@ -932,7 +1021,10 @@ create_filesystem_object(struct archive_write_disk *a) a->deferred |= (a->todo & TODO_TIMES); a->todo &= ~TODO_TIMES; /* Never use an immediate chmod(). */ - if (mode != final_mode) + /* We can't avoid the chmod() entirely if EXTRACT_PERM + * because of SysV SGID inheritance. */ + if ((mode != final_mode) + || (a->flags & ARCHIVE_EXTRACT_PERM)) a->deferred |= (a->todo & TODO_MODE); a->todo &= ~TODO_MODE; } @@ -1167,7 +1259,7 @@ check_symlinks(struct archive_write_disk *a) struct stat st; /* - * Gaurd against symlink tricks. Reject any archive entry whose + * Guard against symlink tricks. Reject any archive entry whose * destination would be altered by a symlink. */ /* Whatever we checked last time doesn't need to be re-checked. */ @@ -1203,6 +1295,7 @@ check_symlinks(struct archive_write_disk *a) pn[0] = c; return (ARCHIVE_WARN); } + a->pst = NULL; /* * Even if we did remove it, a warning * is in order. The warning is silly, @@ -1226,6 +1319,7 @@ check_symlinks(struct archive_write_disk *a) pn[0] = c; return (ARCHIVE_WARN); } + a->pst = NULL; } else { archive_set_error(&a->archive, 0, "Cannot extract through symlink %s", @@ -1258,7 +1352,7 @@ cleanup_pathname(struct archive_write_disk *a) if (*src == '\0') { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Invalid empty pathname"); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } /* Skip leading '/'. */ @@ -1289,7 +1383,7 @@ cleanup_pathname(struct archive_write_disk *a) archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Path contains '..'"); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } lastdotdot = 1; } else @@ -1328,7 +1422,7 @@ cleanup_pathname(struct archive_write_disk *a) archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Path contains trailing '..'"); - return (ARCHIVE_WARN); + return (ARCHIVE_FAILED); } if (dest == a->name) { /* @@ -1472,8 +1566,8 @@ create_dir(struct archive_write_disk *a, char *path) /* * Note: Although we can skip setting the user id if the desired user * id matches the current user, we cannot skip setting the group, as - * many systems set the gid bit based on the containing directory. So - * we have to perform a chown syscall if we want to restore the SGID + * many systems set the gid based on the containing directory. So + * we have to perform a chown syscall if we want to set the SGID * bit. (The alternative is to stat() and then possibly chown(); it's * more efficient to skip the stat() and just always chown().) Note * that a successful chown() here clears the TODO_SGID_CHECK bit, which @@ -1608,19 +1702,8 @@ set_mode(struct archive_write_disk *a, int mode) * process, since systems sometimes set GID from * the enclosing dir or based on ACLs. */ - if (a->pst != NULL) { - /* Already have stat() data available. */ -#ifdef HAVE_FSTAT - } else if (fd >= 0 && fstat(fd, &a->st) == 0) { - a->pst = &a->st; -#endif - } else if (stat(a->name, &a->st) == 0) { - a->pst = &a->st; - } else { - archive_set_error(&a->archive, errno, - "Couldn't stat file"); - return (ARCHIVE_WARN); - } + if ((r = _archive_write_disk_lazy_stat(a)) != ARCHIVE_OK) + return (r); if (a->pst->st_gid != a->gid) { mode &= ~ S_ISGID; if (a->flags & ARCHIVE_EXTRACT_OWNER) { @@ -1783,6 +1866,8 @@ static int set_fflags_platform(struct archive_write_disk *a, int fd, const char *name, mode_t mode, unsigned long set, unsigned long clear) { + int r; + (void)mode; /* UNUSED */ if (set == 0 && clear == 0) return (ARCHIVE_OK); @@ -1793,15 +1878,8 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name, * about the correct approach if we're overwriting an existing * file that already has flags on it. XXX */ - if (fd >= 0 && fstat(fd, &a->st) == 0) - a->pst = &a->st; - else if (lstat(name, &a->st) == 0) - a->pst = &a->st; - else { - archive_set_error(&a->archive, errno, - "Couldn't stat file"); - return (ARCHIVE_WARN); - } + if ((r = _archive_write_disk_lazy_stat(a)) != ARCHIVE_OK) + return (r); a->st.st_flags &= ~clear; a->st.st_flags |= set; diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_disk_private.h b/libarchive/libarchive-2.5.5/libarchive/archive_write_disk_private.h index 1e8ad69..1e8ad69 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_disk_private.h +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_disk_private.h diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_disk_set_standard_lookup.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_disk_set_standard_lookup.c index 427b876..427b876 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_disk_set_standard_lookup.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_disk_set_standard_lookup.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_open_fd.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_open_fd.c index 35e258c..35e258c 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_open_fd.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_open_fd.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_open_file.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_open_file.c index 5c0c737..5c0c737 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_open_file.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_open_file.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_open_filename.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_open_filename.c index 72eeb54..72eeb54 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_open_filename.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_open_filename.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_open_memory.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_open_memory.c index d235ca0..d235ca0 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_open_memory.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_open_memory.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_private.h b/libarchive/libarchive-2.5.5/libarchive/archive_write_private.h index 82935f4..55c24ad 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_private.h +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_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_write_private.h,v 1.2 2007/05/29 01:00:19 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive_write_private.h,v 1.3 2008/03/15 11:04:45 kientzle Exp $ */ #ifndef ARCHIVE_WRITE_PRIVATE_H_INCLUDED @@ -82,13 +82,6 @@ struct archive_write { } compressor; /* - * Again, write support is considerably simpler because there's - * no need for an auction. - */ - int archive_format; - const char *archive_format_name; - - /* * Pointers to format-specific functions for writing. They're * initialized by archive_write_set_format_XXX() calls. */ diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_bzip2.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_bzip2.c index 272ae26..272ae26 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_bzip2.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_bzip2.c diff --git a/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_compress.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_compress.c new file mode 100644 index 0000000..f913a23 --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_compress.c @@ -0,0 +1,494 @@ +/*- + * Copyright (c) 2008 Joerg Sonnenberger + * 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. + */ + +/*- + * Copyright (c) 1985, 1986, 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Diomidis Spinellis and James A. Woods, derived from original + * work by Spencer Thomas and Joseph Orost. + * + * 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. + * 3. 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. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_compress.c,v 1.1 2008/03/14 20:35:37 kientzle Exp $"); + +#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 "archive.h" +#include "archive_private.h" +#include "archive_write_private.h" + +#define HSIZE 69001 /* 95% occupancy */ +#define HSHIFT 8 /* 8 - trunc(log2(HSIZE / 65536)) */ +#define CHECK_GAP 10000 /* Ratio check interval. */ + +#define MAXCODE(bits) ((1 << (bits)) - 1) + +/* + * the next two codes should not be changed lightly, as they must not + * lie within the contiguous general code space. + */ +#define FIRST 257 /* First free entry. */ +#define CLEAR 256 /* Table clear output code. */ + +struct private_data { + off_t in_count, out_count, checkpoint; + + int code_len; /* Number of bits/code. */ + int cur_maxcode; /* Maximum code, given n_bits. */ + int max_maxcode; /* Should NEVER generate this code. */ + int hashtab [HSIZE]; + unsigned short codetab [HSIZE]; + int first_free; /* First unused entry. */ + int compress_ratio; + + int cur_code, cur_fcode; + + int bit_offset; + unsigned char bit_buf; + + unsigned char *compressed; + size_t compressed_buffer_size; + size_t compressed_offset; +}; + +static int archive_compressor_compress_finish(struct archive_write *); +static int archive_compressor_compress_init(struct archive_write *); +static int archive_compressor_compress_write(struct archive_write *, + const void *, size_t); + +/* + * Allocate, initialize and return a archive object. + */ +int +archive_write_set_compression_compress(struct archive *_a) +{ + struct archive_write *a = (struct archive_write *)_a; + __archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW, "archive_write_set_compression_compress"); + a->compressor.init = &archive_compressor_compress_init; + a->archive.compression_code = ARCHIVE_COMPRESSION_COMPRESS; + a->archive.compression_name = "compress"; + return (ARCHIVE_OK); +} + +/* + * Setup callback. + */ +static int +archive_compressor_compress_init(struct archive_write *a) +{ + int ret; + struct private_data *state; + + a->archive.compression_code = ARCHIVE_COMPRESSION_COMPRESS; + a->archive.compression_name = "compress"; + + if (a->bytes_per_block < 4) { + archive_set_error(&a->archive, EINVAL, + "Can't write Compress header as single block"); + return (ARCHIVE_FATAL); + } + + if (a->client_opener != NULL) { + ret = (a->client_opener)(&a->archive, a->client_data); + if (ret != ARCHIVE_OK) + return (ret); + } + + state = (struct private_data *)malloc(sizeof(*state)); + if (state == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate data for compression"); + return (ARCHIVE_FATAL); + } + memset(state, 0, sizeof(*state)); + + state->compressed_buffer_size = a->bytes_per_block; + state->compressed = malloc(state->compressed_buffer_size); + + if (state->compressed == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate data for compression buffer"); + free(state); + return (ARCHIVE_FATAL); + } + + a->compressor.write = archive_compressor_compress_write; + a->compressor.finish = archive_compressor_compress_finish; + + state->max_maxcode = 0x10000; /* Should NEVER generate this code. */ + state->in_count = 0; /* Length of input. */ + state->bit_buf = 0; + state->bit_offset = 0; + state->out_count = 3; /* Includes 3-byte header mojo. */ + state->compress_ratio = 0; + state->checkpoint = CHECK_GAP; + state->code_len = 9; + state->cur_maxcode = MAXCODE(state->code_len); + state->first_free = FIRST; + + memset(state->hashtab, 0xff, sizeof(state->hashtab)); + + /* Prime output buffer with a gzip header. */ + state->compressed[0] = 0x1f; /* Compress */ + state->compressed[1] = 0x9d; + state->compressed[2] = 0x90; /* Block mode, 16bit max */ + state->compressed_offset = 3; + + a->compressor.data = state; + return (0); +} + +/*- + * Output the given code. + * Inputs: + * code: A n_bits-bit integer. If == -1, then EOF. This assumes + * that n_bits =< (long)wordsize - 1. + * Outputs: + * Outputs code to the file. + * Assumptions: + * Chars are 8 bits long. + * Algorithm: + * Maintain a BITS character long buffer (so that 8 codes will + * fit in it exactly). Use the VAX insv instruction to insert each + * code in turn. When the buffer fills up empty it and start over. + */ + +static unsigned char rmask[9] = + {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; + +static int +output_byte(struct archive_write *a, unsigned char c) +{ + struct private_data *state = a->compressor.data; + ssize_t bytes_written; + + state->compressed[state->compressed_offset++] = c; + ++state->out_count; + + if (state->compressed_buffer_size == state->compressed_offset) { + bytes_written = (a->client_writer)(&a->archive, + a->client_data, + state->compressed, state->compressed_buffer_size); + if (bytes_written <= 0) + return ARCHIVE_FATAL; + a->archive.raw_position += bytes_written; + state->compressed_offset = 0; + } + + return ARCHIVE_OK; +} + +static int +output_code(struct archive_write *a, int ocode) +{ + struct private_data *state = a->compressor.data; + int bits, ret, clear_flg, bit_offset; + + clear_flg = ocode == CLEAR; + bits = state->code_len; + + /* + * Since ocode is always >= 8 bits, only need to mask the first + * hunk on the left. + */ + bit_offset = state->bit_offset % 8; + state->bit_buf |= (ocode << bit_offset) & 0xff; + output_byte(a, state->bit_buf); + + bits = state->code_len - (8 - bit_offset); + ocode >>= 8 - bit_offset; + /* Get any 8 bit parts in the middle (<=1 for up to 16 bits). */ + if (bits >= 8) { + output_byte(a, ocode & 0xff); + ocode >>= 8; + bits -= 8; + } + /* Last bits. */ + state->bit_offset += state->code_len; + state->bit_buf = ocode & rmask[bits]; + if (state->bit_offset == state->code_len * 8) + state->bit_offset = 0; + + /* + * If the next entry is going to be too big for the ocode size, + * then increase it, if possible. + */ + if (clear_flg || state->first_free > state->cur_maxcode) { + /* + * Write the whole buffer, because the input side won't + * discover the size increase until after it has read it. + */ + if (state->bit_offset > 0) { + while (state->bit_offset < state->code_len * 8) { + ret = output_byte(a, state->bit_buf); + if (ret != ARCHIVE_OK) + return ret; + state->bit_offset += 8; + state->bit_buf = 0; + } + } + state->bit_buf = 0; + state->bit_offset = 0; + + if (clear_flg) { + state->code_len = 9; + state->cur_maxcode = MAXCODE(state->code_len); + } else { + state->code_len++; + if (state->code_len == 16) + state->cur_maxcode = state->max_maxcode; + else + state->cur_maxcode = MAXCODE(state->code_len); + } + } + + return (ARCHIVE_OK); +} + +static int +output_flush(struct archive_write *a) +{ + struct private_data *state = a->compressor.data; + int ret; + + /* At EOF, write the rest of the buffer. */ + if (state->bit_offset % 8) { + state->code_len = (state->bit_offset % 8 + 7) / 8; + ret = output_byte(a, state->bit_buf); + if (ret != ARCHIVE_OK) + return ret; + } + + return (ARCHIVE_OK); +} + +/* + * Write data to the compressed stream. + */ +static int +archive_compressor_compress_write(struct archive_write *a, const void *buff, + size_t length) +{ + struct private_data *state; + int i; + int ratio; + int c, disp, ret; + const unsigned char *bp; + + state = (struct private_data *)a->compressor.data; + if (a->client_writer == NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "No write callback is registered? " + "This is probably an internal programming error."); + return (ARCHIVE_FATAL); + } + + if (length == 0) + return ARCHIVE_OK; + + bp = buff; + + if (state->in_count == 0) { + state->cur_code = *bp++; + ++state->in_count; + --length; + } + + while (length--) { + c = *bp++; + state->in_count++; + state->cur_fcode = (c << 16) + state->cur_code; + i = ((c << HSHIFT) ^ state->cur_code); /* Xor hashing. */ + + if (state->hashtab[i] == state->cur_fcode) { + state->cur_code = state->codetab[i]; + continue; + } + if (state->hashtab[i] < 0) /* Empty slot. */ + goto nomatch; + /* Secondary hash (after G. Knott). */ + if (i == 0) + disp = 1; + else + disp = HSIZE - i; + probe: + if ((i -= disp) < 0) + i += HSIZE; + + if (state->hashtab[i] == state->cur_fcode) { + state->cur_code = state->codetab[i]; + continue; + } + if (state->hashtab[i] >= 0) + goto probe; + nomatch: + ret = output_code(a, state->cur_code); + if (ret != ARCHIVE_OK) + return ret; + state->cur_code = c; + if (state->first_free < state->max_maxcode) { + state->codetab[i] = state->first_free++; /* code -> hashtable */ + state->hashtab[i] = state->cur_fcode; + continue; + } + if (state->in_count < state->checkpoint) + continue; + + state->checkpoint = state->in_count + CHECK_GAP; + + if (state->in_count <= 0x007fffff) + ratio = state->in_count * 256 / state->out_count; + else if ((ratio = state->out_count / 256) == 0) + ratio = 0x7fffffff; + else + ratio = state->in_count / ratio; + + if (ratio > state->compress_ratio) + state->compress_ratio = ratio; + else { + state->compress_ratio = 0; + memset(state->hashtab, 0xff, sizeof(state->hashtab)); + state->first_free = FIRST; + ret = output_code(a, CLEAR); + if (ret != ARCHIVE_OK) + return ret; + } + } + + return (ARCHIVE_OK); +} + + +/* + * Finish the compression... + */ +static int +archive_compressor_compress_finish(struct archive_write *a) +{ + ssize_t block_length, target_block_length, bytes_written; + int ret; + struct private_data *state; + unsigned tocopy; + + state = (struct private_data *)a->compressor.data; + ret = 0; + if (a->client_writer == NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "No write callback is registered? " + "This is probably an internal programming error."); + ret = ARCHIVE_FATAL; + goto cleanup; + } + + /* By default, always pad the uncompressed data. */ + if (a->pad_uncompressed) { + while (state->in_count % a->bytes_per_block != 0) { + tocopy = a->bytes_per_block - + (state->in_count % a->bytes_per_block); + if (tocopy > a->null_length) + tocopy = a->null_length; + ret = archive_compressor_compress_write(a, a->nulls, + tocopy); + if (ret != ARCHIVE_OK) + goto cleanup; + } + } + + ret = output_code(a, state->cur_code); + if (ret != ARCHIVE_OK) + goto cleanup; + ret = output_flush(a); + if (ret != ARCHIVE_OK) + goto cleanup; + + /* Optionally, pad the final compressed block. */ + block_length = state->compressed_offset; + + /* Tricky calculation to determine size of last block. */ + if (a->bytes_in_last_block <= 0) + /* Default or Zero: pad to full block */ + target_block_length = a->bytes_per_block; + else + /* Round length to next multiple of bytes_in_last_block. */ + target_block_length = a->bytes_in_last_block * + ( (block_length + a->bytes_in_last_block - 1) / + a->bytes_in_last_block); + if (target_block_length > a->bytes_per_block) + target_block_length = a->bytes_per_block; + if (block_length < target_block_length) { + memset(state->compressed + state->compressed_offset, 0, + target_block_length - block_length); + block_length = target_block_length; + } + + /* Write the last block */ + bytes_written = (a->client_writer)(&a->archive, a->client_data, + state->compressed, block_length); + if (bytes_written <= 0) + ret = ARCHIVE_FATAL; + else + a->archive.raw_position += bytes_written; + +cleanup: + free(state->compressed); + free(state); + return (ret); +} diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_gzip.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_gzip.c index 18abbdf..18abbdf 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_gzip.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_gzip.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_none.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_none.c index bdecb24..bdecb24 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_none.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_none.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_program.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_program.c index fc1481d..69c5d42 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_compression_program.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_compression_program.c @@ -25,7 +25,26 @@ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_program.c,v 1.1 2007/05/29 01:00:19 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_program.c,v 1.3 2008/06/15 10:45:57 kientzle Exp $"); + +/* This capability is only available on POSIX systems. */ +#if !defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \ + !(defined(HAVE_FORK) || defined(HAVE_VFORK)) +#include "archive.h" + +/* + * On non-Posix systems, allow the program to build, but choke if + * this function is actually invoked. + */ +int +archive_write_set_compression_program(struct archive *_a, const char *cmd) +{ + archive_set_error(_a, -1, + "External compression programs not supported on this platform"); + return (ARCHIVE_FATAL); +} + +#else #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> @@ -163,6 +182,12 @@ restart_write: if (ret == -1 && errno != EAGAIN) return (-1); + if (state->child_stdout == -1) { + fcntl(state->child_stdin, F_SETFL, 0); + __archive_check_child(state->child_stdin, state->child_stdout); + goto restart_write; + } + do { ret = read(state->child_stdout, state->child_buf + state->child_buf_avail, @@ -320,3 +345,5 @@ cleanup: free(state); return (ret); } + +#endif /* !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL) */ diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format.c index e5f8921..e5f8921 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_ar.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_ar.c index 2e77f1b..7176e6e 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_ar.c +++ b/libarchive/libarchive-2.5.5/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.5 2008/01/31 08:11:01 kaiw Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_ar.c,v 1.7 2008/05/26 17:00:23 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -87,8 +87,8 @@ archive_write_set_format_ar_bsd(struct archive *_a) struct archive_write *a = (struct archive_write *)_a; int r = archive_write_set_format_ar(a); if (r == ARCHIVE_OK) { - a->archive_format = ARCHIVE_FORMAT_AR_BSD; - a->archive_format_name = "ar (BSD)"; + a->archive.archive_format = ARCHIVE_FORMAT_AR_BSD; + a->archive.archive_format_name = "ar (BSD)"; } return (r); } @@ -99,8 +99,8 @@ archive_write_set_format_ar_svr4(struct archive *_a) struct archive_write *a = (struct archive_write *)_a; int r = archive_write_set_format_ar(a); if (r == ARCHIVE_OK) { - a->archive_format = ARCHIVE_FORMAT_AR_GNU; - a->archive_format_name = "ar (GNU/SVR4)"; + a->archive.archive_format = ARCHIVE_FORMAT_AR_GNU; + a->archive.archive_format_name = "ar (GNU/SVR4)"; } return (r); } @@ -142,12 +142,15 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry) struct ar_w *ar; const char *pathname; const char *filename; + int64_t size; ret = 0; append_fn = 0; ar = (struct ar_w *)a->format_data; ar->is_strtab = 0; filename = NULL; + size = archive_entry_size(entry); + /* * Reject files with empty name. @@ -204,7 +207,7 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry) return (ARCHIVE_WARN); } - if (a->archive_format == ARCHIVE_FORMAT_AR_GNU) { + if (a->archive.archive_format == ARCHIVE_FORMAT_AR_GNU) { /* * SVR4/GNU variant use a "/" to mark then end of the filename, * make it possible to have embedded spaces in the filename. @@ -261,7 +264,7 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry) return (ARCHIVE_WARN); } } - } else if (a->archive_format == ARCHIVE_FORMAT_AR_BSD) { + } else if (a->archive.archive_format == ARCHIVE_FORMAT_AR_BSD) { /* * BSD variant: for any file name which is more than * 16 chars or contains one or more embedded space(s), the @@ -285,8 +288,7 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry) return (ARCHIVE_WARN); } append_fn = 1; - archive_entry_set_size(entry, - archive_entry_size(entry) + strlen(filename)); + size += strlen(filename); } } @@ -322,8 +324,7 @@ stat: } size: - if (format_decimal(archive_entry_size(entry), buff + AR_size_offset, - AR_size_size)) { + if (format_decimal(size, buff + AR_size_offset, AR_size_size)) { archive_set_error(&a->archive, ERANGE, "File size out of range"); return (ARCHIVE_WARN); @@ -333,7 +334,7 @@ size: if (ret != ARCHIVE_OK) return (ret); - ar->entry_bytes_remaining = archive_entry_size(entry); + ar->entry_bytes_remaining = size; ar->entry_padding = ar->entry_bytes_remaining % 2; if (append_fn > 0) { diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_by_name.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_by_name.c index 0d7cae4..0d7cae4 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_by_name.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_by_name.c diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_cpio.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_cpio.c index 45cb4e7..6104299 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_cpio.c +++ b/libarchive/libarchive-2.5.5/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.13 2007/12/30 04:58:22 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_cpio.c,v 1.14 2008/03/15 11:04:45 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -97,8 +97,8 @@ archive_write_set_format_cpio(struct archive *_a) a->format_finish_entry = archive_write_cpio_finish_entry; a->format_finish = archive_write_cpio_finish; a->format_destroy = archive_write_cpio_destroy; - a->archive_format = ARCHIVE_FORMAT_CPIO_POSIX; - a->archive_format_name = "POSIX cpio"; + a->archive.archive_format = ARCHIVE_FORMAT_CPIO_POSIX; + a->archive.archive_format_name = "POSIX cpio"; return (ARCHIVE_OK); } diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_cpio_newc.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_cpio_newc.c index d11176c..b5a2a02 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_cpio_newc.c +++ b/libarchive/libarchive-2.5.5/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.3 2008/01/23 05:43:25 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_cpio_newc.c,v 1.4 2008/03/15 11:04:45 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -102,8 +102,8 @@ archive_write_set_format_cpio_newc(struct archive *_a) a->format_finish_entry = archive_write_newc_finish_entry; a->format_finish = archive_write_newc_finish; a->format_destroy = archive_write_newc_destroy; - a->archive_format = ARCHIVE_FORMAT_CPIO_SVR4_NOCRC; - a->archive_format_name = "SVR4 cpio nocrc"; + a->archive.archive_format = ARCHIVE_FORMAT_CPIO_SVR4_NOCRC; + a->archive.archive_format_name = "SVR4 cpio nocrc"; return (ARCHIVE_OK); } diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_pax.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_pax.c index a1bd688..3e294cd 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_pax.c +++ b/libarchive/libarchive-2.5.5/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.42 2007/12/30 04:58:22 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_pax.c,v 1.47 2008/05/26 17:00:23 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -85,8 +85,8 @@ archive_write_set_format_pax_restricted(struct archive *_a) struct archive_write *a = (struct archive_write *)_a; int r; r = archive_write_set_format_pax(&a->archive); - a->archive_format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED; - a->archive_format_name = "restricted POSIX pax interchange"; + a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED; + a->archive.archive_format_name = "restricted POSIX pax interchange"; return (r); } @@ -116,8 +116,8 @@ archive_write_set_format_pax(struct archive *_a) a->format_finish = archive_write_pax_finish; a->format_destroy = archive_write_pax_destroy; a->format_finish_entry = archive_write_pax_finish_entry; - a->archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE; - a->archive_format_name = "POSIX pax interchange"; + a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE; + a->archive.archive_format_name = "POSIX pax interchange"; return (ARCHIVE_OK); } @@ -386,7 +386,7 @@ archive_write_pax_header(struct archive_write *a, const char *p; char *t; const wchar_t *wp; - const char *suffix_start; + const char *suffix; int need_extension, r, ret; struct pax *pax; const char *hdrcharset = NULL; @@ -496,34 +496,73 @@ archive_write_pax_header(struct archive_write *a, 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. - */ - 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(path + strlen(path) - 100 - 1, '/'); /* * If name is too long, or has non-ASCII characters, add * 'path' to pax extended attrs. (Note that an unconvertible * name must have non-ASCII characters.) */ - if (suffix_start == NULL || suffix_start - path > 155 - || path_w == NULL || has_non_ASCII(path_w)) { - if (path_w == NULL || hdrcharset != NULL) + if (path == NULL) { + /* We don't have a narrow version, so we have to store + * the wide version. */ + add_pax_attr_w(&(pax->pax_header), "path", path_w); + archive_entry_set_pathname(entry_main, "@WidePath"); + need_extension = 1; + } else if (has_non_ASCII(path_w)) { + /* We have non-ASCII characters. */ + 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); + } else { + /* Store UTF-8 */ + add_pax_attr_w(&(pax->pax_header), + "path", path_w); + } archive_entry_set_pathname(entry_main, build_ustar_entry_name(ustar_entry_name, path, strlen(path), NULL)); need_extension = 1; + } else { + /* We have an all-ASCII path; we'd like to just store + * it in the ustar header if it will fit. Yes, this + * duplicates some of the logic in + * write_set_format_ustar.c + */ + if (strlen(path) <= 100) { + /* Fits in the old 100-char tar name field. */ + } else { + /* Find largest suffix that will fit. */ + /* Note: strlen() > 100, so strlen() - 100 - 1 >= 0 */ + suffix = strchr(path + strlen(path) - 100 - 1, '/'); + /* Don't attempt an empty prefix. */ + if (suffix == path) + suffix = strchr(suffix + 1, '/'); + /* We can put it in the ustar header if it's + * all ASCII and it's either <= 100 characters + * or can be split at a '/' into a prefix <= + * 155 chars and a suffix <= 100 chars. (Note + * the strchr() above will return NULL exactly + * when the path can't be split.) + */ + if (suffix == NULL /* Suffix > 100 chars. */ + || suffix[1] == '\0' /* empty suffix */ + || suffix - path > 155) /* Prefix > 155 chars */ + { + if (path_w == NULL || hdrcharset != NULL) { + /* Can't do UTF-8, so store it raw. */ + add_pax_attr(&(pax->pax_header), + "path", path); + } else { + /* Store UTF-8 */ + add_pax_attr_w(&(pax->pax_header), + "path", path_w); + } + archive_entry_set_pathname(entry_main, + build_ustar_entry_name(ustar_entry_name, + path, strlen(path), NULL)); + need_extension = 1; + } + } } if (linkpath != NULL) { @@ -701,7 +740,7 @@ archive_write_pax_header(struct archive_write *a, * already set (we're already generating an extended header, so * may as well include these). */ - if (a->archive_format != ARCHIVE_FORMAT_TAR_PAX_RESTRICTED || + if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_RESTRICTED || need_extension) { if (archive_entry_mtime(entry_main) < 0 || @@ -764,7 +803,7 @@ archive_write_pax_header(struct archive_write *a, * Pax-restricted does not store data for hardlinks, in order * to improve compatibility with ustar. */ - if (a->archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE && + if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE && hardlink != NULL) archive_entry_set_size(entry_main, 0); @@ -1060,7 +1099,13 @@ 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' + * reasonable name: SUSv3 requires 'dirname'/PaxHeader.'pid'/'filename' + * where 'pid' is the PID of the archiving process. Unfortunately, + * that makes testing a pain since the output varies for each run, + * so I'm sticking with the simpler 'dirname'/PaxHeader/'filename' + * for now. (Someday, I'll make this settable. Then I can use the + * SUS recommendation as default and test harnesses can override it + * to get predictable results.) * * Joerg Schilling has argued that this is unnecessary because, in * practice, if the pax extended attributes get extracted as regular @@ -1071,19 +1116,14 @@ build_ustar_entry_name(char *dest, const char *src, size_t src_length, * 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 - * most of the work (we just need to give it an extra path element to - * insert and handle a few pathological cases). + * The following routine leverages build_ustar_entry_name() above and + * so is simpler than you might think. It just needs to provide the + * additional path element and handle a few pathological cases). */ static char * build_pax_attribute_name(char *dest, const char *src) { + char buff[64]; const char *p; /* Handle the null filename case. */ @@ -1122,8 +1162,19 @@ build_pax_attribute_name(char *dest, const char *src) return (dest); } + /* + * TODO: Push this string into the 'pax' structure to avoid + * recomputing it every time. That will also open the door + * to having clients override it. + */ +#if HAVE_GETPID && 0 /* Disable this for now; see above comment. */ + sprintf(buff, "PaxHeader.%d", getpid()); +#else + /* If the platform can't fetch the pid, don't include it. */ + strcpy(buff, "PaxHeader"); +#endif /* General case: build a ustar-compatible name adding "/PaxHeader/". */ - build_ustar_entry_name(dest, src, p - src, "PaxHeader"); + build_ustar_entry_name(dest, src, p - src, buff); return (dest); } @@ -1203,6 +1254,8 @@ archive_write_pax_data(struct archive_write *a, const void *buff, size_t s) static int has_non_ASCII(const wchar_t *wp) { + if (wp == NULL) + return (1); while (*wp != L'\0' && *wp < 128) wp++; return (*wp != L'\0'); diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_shar.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_shar.c index f26ba02..b5d16e0 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_shar.c +++ b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_shar.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_shar.c,v 1.18 2007/05/29 01:00:19 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_shar.c,v 1.19 2008/03/15 11:04:45 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -113,8 +113,8 @@ archive_write_set_format_shar(struct archive *_a) a->format_destroy = archive_write_shar_destroy; a->format_write_data = archive_write_shar_data_sed; a->format_finish_entry = archive_write_shar_finish_entry; - a->archive_format = ARCHIVE_FORMAT_SHAR_BASE; - a->archive_format_name = "shar"; + a->archive.archive_format = ARCHIVE_FORMAT_SHAR_BASE; + a->archive.archive_format_name = "shar"; return (ARCHIVE_OK); } @@ -134,8 +134,8 @@ archive_write_set_format_shar_dump(struct archive *_a) shar = (struct shar *)a->format_data; shar->dump = 1; a->format_write_data = archive_write_shar_data_uuencode; - a->archive_format = ARCHIVE_FORMAT_SHAR_DUMP; - a->archive_format_name = "shar dump"; + a->archive.archive_format = ARCHIVE_FORMAT_SHAR_DUMP; + a->archive.archive_format_name = "shar dump"; return (ARCHIVE_OK); } diff --git a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_ustar.c b/libarchive/libarchive-2.5.5/libarchive/archive_write_set_format_ustar.c index a7d26c9..8aed25d 100644 --- a/libarchive/libarchive-2.4.17/libarchive/archive_write_set_format_ustar.c +++ b/libarchive/libarchive-2.5.5/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.25 2007/12/30 04:58:22 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_format_ustar.c,v 1.27 2008/05/26 17:00:23 kientzle Exp $"); #ifdef HAVE_ERRNO_H @@ -186,8 +186,8 @@ archive_write_set_format_ustar(struct archive *_a) a->format_finish = archive_write_ustar_finish; a->format_destroy = archive_write_ustar_destroy; a->format_finish_entry = archive_write_ustar_finish_entry; - a->archive_format = ARCHIVE_FORMAT_TAR_USTAR; - a->archive_format_name = "POSIX ustar"; + a->archive.archive_format = ARCHIVE_FORMAT_TAR_USTAR; + a->archive.archive_format_name = "POSIX ustar"; return (ARCHIVE_OK); } @@ -195,7 +195,7 @@ static int archive_write_ustar_header(struct archive_write *a, struct archive_entry *entry) { char buff[512]; - int ret; + int ret, ret2; struct ustar *ustar; ustar = (struct ustar *)a->format_data; @@ -206,7 +206,7 @@ archive_write_ustar_header(struct archive_write *a, struct archive_entry *entry) !(archive_entry_filetype(entry) == AE_IFREG)) archive_entry_set_size(entry, 0); - if (AE_IFDIR == archive_entry_mode(entry)) { + if (AE_IFDIR == archive_entry_filetype(entry)) { const char *p; char *t; /* @@ -229,15 +229,17 @@ archive_write_ustar_header(struct archive_write *a, struct archive_entry *entry) } ret = __archive_write_format_header_ustar(a, buff, entry, -1, 1); - if (ret != ARCHIVE_OK) - return (ret); - ret = (a->compressor.write)(a, buff, 512); - if (ret != ARCHIVE_OK) + if (ret < ARCHIVE_WARN) return (ret); + ret2 = (a->compressor.write)(a, buff, 512); + if (ret2 < ARCHIVE_WARN) + return (ret2); + if (ret2 < ret) + ret = ret2; ustar->entry_bytes_remaining = archive_entry_size(entry); ustar->entry_padding = 0x1ff & (-(int64_t)ustar->entry_bytes_remaining); - return (ARCHIVE_OK); + return (ret); } /* @@ -282,27 +284,33 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512], /* Store in two pieces, splitting at a '/'. */ p = strchr(pp + strlen(pp) - USTAR_name_size - 1, '/'); /* - * If the separator we found is the first '/', find - * the next one. (This is a pathological case that - * occurs for paths of exactly 101 bytes that start with - * '/'; it occurs because the separating '/' is not - * stored explicitly and the reconstruction assumes that - * an empty prefix means there is no '/' separator.) + * Look for the next '/' if we chose the first character + * as the separator. (ustar format doesn't permit + * an empty prefix.) */ if (p == pp) p = strchr(p + 1, '/'); - /* - * If there is no path separator, or the prefix or - * remaining name are too large, return an error. - */ + /* Fail if the name won't fit. */ if (!p) { + /* No separator. */ + archive_set_error(&a->archive, ENAMETOOLONG, + "Pathname too long"); + ret = ARCHIVE_FAILED; + } else if (p[1] == '\0') { + /* + * The only feasible separator is a final '/'; + * this would result in a non-empty prefix and + * an empty name, which POSIX doesn't + * explicity forbid, but it just feels wrong. + */ archive_set_error(&a->archive, ENAMETOOLONG, "Pathname too long"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } else if (p > pp + USTAR_prefix_size) { + /* Prefix is too long. */ archive_set_error(&a->archive, ENAMETOOLONG, "Pathname too long"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } else { /* Copy prefix and remainder to appropriate places */ memcpy(h + USTAR_prefix_offset, pp, p - pp); @@ -320,7 +328,7 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512], if (copy_length > USTAR_linkname_size) { archive_set_error(&a->archive, ENAMETOOLONG, "Link contents too long"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; copy_length = USTAR_linkname_size; } memcpy(h + USTAR_linkname_offset, p, copy_length); @@ -332,7 +340,7 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512], if (copy_length > USTAR_uname_size) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Username too long"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; copy_length = USTAR_uname_size; } memcpy(h + USTAR_uname_offset, p, copy_length); @@ -344,7 +352,7 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512], if (strlen(p) > USTAR_gname_size) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Group name too long"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; copy_length = USTAR_gname_size; } memcpy(h + USTAR_gname_offset, p, copy_length); @@ -352,28 +360,28 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512], if (format_number(archive_entry_mode(entry) & 07777, h + USTAR_mode_offset, USTAR_mode_size, USTAR_mode_max_size, strict)) { archive_set_error(&a->archive, ERANGE, "Numeric mode too large"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } if (format_number(archive_entry_uid(entry), h + USTAR_uid_offset, USTAR_uid_size, USTAR_uid_max_size, strict)) { archive_set_error(&a->archive, ERANGE, "Numeric user ID too large"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } if (format_number(archive_entry_gid(entry), h + USTAR_gid_offset, USTAR_gid_size, USTAR_gid_max_size, strict)) { archive_set_error(&a->archive, ERANGE, "Numeric group ID too large"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } if (format_number(archive_entry_size(entry), h + USTAR_size_offset, USTAR_size_size, USTAR_size_max_size, strict)) { archive_set_error(&a->archive, ERANGE, "File size out of range"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } if (format_number(archive_entry_mtime(entry), h + USTAR_mtime_offset, USTAR_mtime_size, USTAR_mtime_max_size, strict)) { archive_set_error(&a->archive, ERANGE, "File modification time too large"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } if (archive_entry_filetype(entry) == AE_IFBLK @@ -382,14 +390,14 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512], USTAR_rdevmajor_size, USTAR_rdevmajor_max_size, strict)) { archive_set_error(&a->archive, ERANGE, "Major device number too large"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } if (format_number(archive_entry_rdevminor(entry), h + USTAR_rdevminor_offset, USTAR_rdevminor_size, USTAR_rdevminor_max_size, strict)) { archive_set_error(&a->archive, ERANGE, "Minor device number too large"); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } } @@ -409,7 +417,7 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512], archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "tar format cannot archive this (mode=0%lo)", (unsigned long)archive_entry_mode(entry)); - ret = ARCHIVE_WARN; + ret = ARCHIVE_FAILED; } } diff --git a/libarchive/libarchive-2.4.17/libarchive/config_freebsd.h b/libarchive/libarchive-2.5.5/libarchive/config_freebsd.h index 83a8599..4182b71 100644 --- a/libarchive/libarchive-2.4.17/libarchive/config_freebsd.h +++ b/libarchive/libarchive-2.5.5/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.6 2008/02/19 05:40:28 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/config_freebsd.h,v 1.10 2008/06/15 05:12:47 kientzle Exp $ */ /* FreeBSD 5.0 and later have ACL support. */ @@ -51,10 +51,13 @@ #define HAVE_FCHFLAGS 1 #define HAVE_FCHMOD 1 #define HAVE_FCHOWN 1 +#define HAVE_FCNTL 1 #define HAVE_FCNTL_H 1 #define HAVE_FSEEKO 1 +#define HAVE_FSTAT 1 #define HAVE_FUTIMES 1 #define HAVE_GETEUID 1 +#define HAVE_GETPID 1 #define HAVE_GRP_H 1 #define HAVE_INTTYPES_H 1 #define HAVE_LCHFLAGS 1 @@ -68,6 +71,7 @@ #define HAVE_MKDIR 1 #define HAVE_MKFIFO 1 #define HAVE_MKNOD 1 +#define HAVE_PIPE 1 #define HAVE_POLL 1 #define HAVE_POLL_H 1 #define HAVE_PWD_H 1 @@ -83,8 +87,6 @@ #define HAVE_STRING_H 1 #define HAVE_STRRCHR 1 #define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 -#define HAVE_STRUCT_STAT_ST_RDEV 1 -#define HAVE_STRUCT_TM_TM_GMTOFF 1 #define HAVE_SYS_ACL_H 1 #define HAVE_SYS_IOCTL_H 1 #define HAVE_SYS_SELECT_H 1 @@ -100,9 +102,11 @@ #define HAVE_UTIME 1 #define HAVE_UTIMES 1 #define HAVE_UTIME_H 1 +#define HAVE_VFORK 1 #define HAVE_WCHAR_H 1 #define HAVE_WCSCPY 1 #define HAVE_WCSLEN 1 +#define HAVE_WCTOMB 1 #define HAVE_WMEMCMP 1 #define HAVE_WMEMCPY 1 #define HAVE_ZLIB_H 1 diff --git a/libarchive/libarchive-2.4.17/libarchive/config_windows.h b/libarchive/libarchive-2.5.5/libarchive/config_windows.h index c520065..e6a6afa 100644 --- a/libarchive/libarchive-2.4.17/libarchive/config_windows.h +++ b/libarchive/libarchive-2.5.5/libarchive/config_windows.h @@ -1,510 +1,682 @@ -/* 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 */ +/* 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
+
+
+///////////////////////////////////////////////////////////////////////////
+// Check for Watcom and Microsoft Visual C compilers (WIN32 only) ///////
+///////////////////////////////////////////////////////////////////////////
+#if defined(__WIN32__) || defined(_WIN32) || defined(__WIN32)
+ #define IS_WIN32 1
+
+ #if defined(__TURBOC__) || defined(__BORLANDC__) /* Borland compilers */
+ #elif defined( __WATCOMC__ ) || defined(__WATCOMCPP__) /* Watcom compilers */
+ #define IS_WATCOM 1
+ /* Define to 1 if __INT64 is defined */
+ #define HAVE___INT64 1
+
+ /* Define to 1 if UID should be unsigned */
+ #define USE_UNSIGNED_UID 1
+
+ /* Define to 1 if UID should be unsigned */
+ #define USE_UNSIGNED_GID 1
+
+ #elif defined(__IBMC__) || defined(__IBMCPP__) /* IBM compilers */
+ #elif defined( __SC__ ) /* Symantec C++ compilers */
+ #elif defined( M_I86 ) && defined( MSDOS ) /* Microsoft DOS/Win 16 compilers */
+ #elif defined( _M_IX86 ) || defined( _68K_ ) /* Microsoft Win32 compilers */
+ #define IS_VISUALC 1
+ /* Define to 1 if __INT64 is defined */
+ #define HAVE___INT64 1
+ #else
+ #endif
+
+#endif
+///////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////
+
+/* 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. */
+/* #undef HAVE_DECL_SIZE_MAX */
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+#define HAVE_DECL_SIZE_MAX 1
+#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 */
+#if ((IS_WATCOM) || (IS_VISUALC))
+#define HAVE_EFTYPE 0
+#else
+#define HAVE_EFTYPE 1
+#endif
+
+/* 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. */
+/* #undef HAVE_FCNTL_H 1 */
+
+/* Define to 1 if you have the fcntl() function. */
+/* #undef HAVE_FCNTL_FN */
+
+/* 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 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. */
+#define HAVE_ZLIB_H 1
+
+/* Version number of libarchive as a single integer */
+#define LIBARCHIVE_VERSION_NUMBER "2005000"
+
+/* Version number of libarchive */
+#define LIBARCHIVE_VERSION_STRING "2.5.0b"
+
+/* 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. */
+#if (USE_UNSIGNED_GID)
+#define gid_t unsigned int
+#else
+#define gid_t int
+#endif
+
+/* 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. */
+#if (HAVE___INT64)
+typedef __int64 int64_t;
+#else
+#define int64_t long long
+#endif
+
+/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
+ not define. */
+#if (HAVE___INT64)
+typedef __int64 intmax_t;
+#else
+#define intmax_t long long
+#endif
+
+/* 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. */
+#if (USE_UNSIGNED_UID)
+#define uid_t unsigned int
+#else
+#define uid_t int
+#endif
+
+/* 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. */
+#if (HAVE___INT64)
+typedef unsigned __int64 uint64_t;
+#else
+#define uint64_t unsigned long long
+#endif
+
+/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
+ do not define. */
+#if (HAVE___INT64)
+typedef unsigned __int64 uintmax_t;
+#else
+#define uintmax_t unsigned long long
+#endif
+
+/* 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
+
+
+///////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+#if (IS_VISUALC)
+ #include <io.h>
+ #include <stdlib.h> //brings in NULL
+ #include <sys/stat.h> //brings in S_IFMT(), etc...
+
+ #define HAVE_UINTPTR 0
+
+ #if !defined(STDIN_FILENO)
+ #define STDIN_FILENO 0
+ #endif
+
+ #if !defined(STDOUT_FILENO)
+ #define STDOUT_FILENO 1
+ #endif
+
+ #if !defined(STDERR_FILENO)
+ #define STDERR_FILENO 2
+ #endif
+
+ /* Define to 1 if ino_t is defined (possibly in sys/types.h) */
+ #define HAVE_INO_T 1
+
+ #define S_IFFIFO _S_IFIFO
+
+ #define S_ISBLK( m ) 0
+ #define S_ISFIFO( m ) (((m) & S_IFMT) == S_IFFIFO)
+ #define S_ISCHR( m ) (((m) & S_IFMT) == S_IFCHR)
+ #define S_ISDIR( m ) (((m) & S_IFMT) == S_IFDIR)
+ #define S_ISREG( m ) (((m) & S_IFMT) == S_IFREG)
+ #define S_ISUID 0004000
+ #define S_ISGID 0002000
+ #define S_ISVTX 0001000
+
+ //NOT SURE IF O_NONBLOCK is OK here but at least the 0x0004 flag is not used by anything else...
+ #define O_NONBLOCK 0x0004 /* Non-blocking I/O. */
+ //#define O_NDELAY O_NONBLOCK
+
+ #define lstat _stat
+
+ /* Symbolic constants for the access() function */
+ #if !defined(F_OK)
+ #define R_OK 4 /* Test for read permission */
+ #define W_OK 2 /* Test for write permission */
+ #define X_OK 1 /* Test for execute permission */
+ #define F_OK 0 /* Test for existence of file */
+ #endif
+
+#endif
+
+//////////////////////////////////////////////////////////////////////////
+#if (IS_WATCOM)
+ #include <io.h> //brings in STDERR/OUT/IN_FILENO, dup(), dup2(), close(), write(), etc...
+ #include <process.h> //brings in execlp() and _exit()
+ #include <stdlib.h> //brings in NULL
+ #include <sys/stat.h>
+
+ /* Define to 1 if ino_t is defined (possibly in sys/types.h) */
+ #define HAVE_INO_T 1
+
+ //NOT SURE IF O_NONBLOCK is OK here but at least the 0x0004 flag is not used by anything else...
+ #define O_NONBLOCK 0x0004 /* Non-blocking I/O. */
+ //#define O_NDELAY O_NONBLOCK
+
+ //Prototypes for functions which we'll define in archive_windows.c
+ extern unsigned int sleep (unsigned int seconds);
+
+ #define lstat _stat
+#endif
+
+
+//////////////////////////////////////////////////////////////////////////
+#if !(HAVE_UINTPTR)
+ typedef unsigned int *uintptr_t;
+ #if defined(HAVE_UINTPTR)
+ #undef HAVE_UINTPTR
+ #endif
+ #define HAVE_UINTPTR 1
+#endif
+
+#if !defined(SSIZE_MAX)
+ //#define _POSIX_SSIZE_MAX 32767
+ #if defined(_POSIX_SSIZE_MAX)
+ #define SSIZE_MAX _POSIX_SSIZE_MAX
+ #else
+ #define SSIZE_MAX ((ssize_t)((size_t)-1 >> 1))
+ #endif
+#endif
+
+#if !(HAVE_FCNTL_FN)
+ #define F_SETFL 4 /* Set file status flags. */
+
+ #if defined(HAVE_FCNTL_FN)
+ #undef HAVE_FCNTL_FN
+ #endif
+ #define HAVE_FCNTL_FN 1
+#endif
+
+ #define _S_IFLNK 0xA000 /* symbolic link */
+ #if !defined(_S_IFMT)
+ #define _S_IFMT S_IFMT
+ #endif
+
+ #define _S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK)
+ #define S_ISLNK(m) _S_ISLNK(m)
+
+
+/* Replacement for major/minor/makedev. */
+#if !(MAJOR_IN_MKDEV) && !(MAJOR_IN_SYSMACROS)
+ #define major(x) ((int)(0x00ff & ((x) >> 8)))
+ #define minor(x) ((int)(0xffff00ff & (x)))
+ #define makedev(maj,min) ((0xff00 & ((maj)<<8))|(0xffff00ff & (min)))
+#endif
+
+#define set_errno(val) ((errno)=val)
+
+
+#endif /* CONFIG_H_INCLUDED */
diff --git a/libarchive/libarchive-2.4.17/libarchive/cpio.5 b/libarchive/libarchive-2.5.5/libarchive/cpio.5 index 9dbdc6d..f544628 100644 --- a/libarchive/libarchive-2.4.17/libarchive/cpio.5 +++ b/libarchive/libarchive-2.5.5/libarchive/cpio.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/cpio.5,v 1.1 2007/12/30 04:58:22 kientzle Exp $ +.\" $FreeBSD: src/lib/libarchive/cpio.5,v 1.2 2008/05/26 17:00:23 kientzle Exp $ .\" .Dd October 5, 2007 .Dt CPIO 5 @@ -149,7 +149,7 @@ followed by the least-significant 16 bits. Each of the two 16 bit values are stored in machine-native byte order. .It Va namesize The number of bytes in the pathname that follows the header. -This count includes the trailing NULL byte. +This count includes the trailing NUL byte. .It Va filesize The size of the file. Note that this archive format is limited to @@ -162,8 +162,8 @@ above for a description of the storage of four-byte integers. The pathname immediately follows the fixed header. If the .Cm namesize -is odd, an additional NULL byte is added after the pathname. -The file data is then appended, padded with NULL +is odd, an additional NUL byte is added after the pathname. +The file data is then appended, padded with NUL bytes to an even length. .Pp Hardlinked files are not given special treatment; @@ -202,7 +202,7 @@ 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. +NUL byte that terminates the name field. .Ss New ASCII Format The "new" ASCII format uses 8-byte hexadecimal fields for all numbers and separates device numbers into separate fields @@ -237,7 +237,7 @@ 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 +The pathname is followed by NUL 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 @@ -322,4 +322,4 @@ by SCO under their 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 +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/libarchive/libarchive-2.4.17/libarchive/filter_fork.c b/libarchive/libarchive-2.5.5/libarchive/filter_fork.c index 8cad9e2..c746a18 100644 --- a/libarchive/libarchive-2.4.17/libarchive/filter_fork.c +++ b/libarchive/libarchive-2.5.5/libarchive/filter_fork.c @@ -25,7 +25,11 @@ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/filter_fork.c,v 1.2 2007/12/30 04:58:22 kientzle Exp $"); +/* This capability is only available on POSIX systems. */ +#if defined(HAVE_PIPE) && defined(HAVE_FCNTL) && \ + (defined(HAVE_FORK) || defined(HAVE_VFORK)) + +__FBSDID("$FreeBSD: src/lib/libarchive/filter_fork.c,v 1.4 2008/06/15 10:45:57 kientzle Exp $"); #if defined(HAVE_POLL) # if defined(HAVE_POLL_H) @@ -72,7 +76,11 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout) stdout_pipe[1] = tmp; } +#if HAVE_VFORK switch ((child = vfork())) { +#else + switch ((child = fork())) { +#endif case -1: goto stdout_opened; case 0: @@ -115,25 +123,39 @@ __archive_check_child(int in, int out) { #if defined(HAVE_POLL) struct pollfd fds[2]; + int idx; - fds[0].fd = in; - fds[0].events = POLLOUT; - fds[1].fd = out; - fds[1].events = POLLIN; + idx = 0; + if (in != -1) { + fds[idx].fd = in; + fds[idx].events = POLLOUT; + ++idx; + } + if (out != -1) { + fds[idx].fd = out; + fds[idx].events = POLLIN; + ++idx; + } - poll(fds, 2, -1); /* -1 == INFTIM, wait forever */ + poll(fds, idx, -1); /* -1 == INFTIM, wait forever */ #elif defined(HAVE_SELECT) fd_set fds_in, fds_out, fds_error; FD_ZERO(&fds_in); - FD_SET(out, &fds_in); FD_ZERO(&fds_out); - FD_SET(in, &fds_out); FD_ZERO(&fds_error); - FD_SET(in, &fds_error); - FD_SET(out, &fds_error); + if (out != -1) { + FD_SET(out, &fds_in); + FD_SET(out, &fds_error); + } + if (in != -1) { + FD_SET(in, &fds_out); + FD_SET(in, &fds_error); + } select(in < out ? out + 1 : in + 1, &fds_in, &fds_out, &fds_error, NULL); #else sleep(1); #endif } + +#endif /* defined(HAVE_PIPE) && defined(HAVE_VFORK) && defined(HAVE_FCNTL) */ diff --git a/libarchive/libarchive-2.4.17/libarchive/filter_fork.h b/libarchive/libarchive-2.5.5/libarchive/filter_fork.h index 685efda..685efda 100644 --- a/libarchive/libarchive-2.4.17/libarchive/filter_fork.h +++ b/libarchive/libarchive-2.5.5/libarchive/filter_fork.h diff --git a/libarchive/libarchive-2.4.17/libarchive/libarchive-formats.5 b/libarchive/libarchive-2.5.5/libarchive/libarchive-formats.5 index 0346d8f..dd054a9 100644 --- a/libarchive/libarchive-2.4.17/libarchive/libarchive-formats.5 +++ b/libarchive/libarchive-2.5.5/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.15 2007/12/30 04:58:22 kientzle Exp $ +.\" $FreeBSD: src/lib/libarchive/libarchive-formats.5,v 1.16 2008/05/26 17:00:23 kientzle Exp $ .\" .Dd April 27, 2004 .Dt libarchive-formats 3 @@ -259,6 +259,14 @@ There are two common variants: the GNU format derived from SVR4, and the BSD format, which first appeared in 4.4BSD. Libarchive provides read and write support for both variants. +.Ss mtree +Libarchive can read files in +.Xr mtree 5 +format. This format is not a true archive format, but rather a description +of a file hierarchy. When requested, libarchive obtains the contents of +the files described by the +.Xr mtree 5 +format from files on disk instead. .Sh SEE ALSO .Xr ar 1 , .Xr cpio 1 , diff --git a/libarchive/libarchive-2.4.17/libarchive/libarchive.3 b/libarchive/libarchive-2.5.5/libarchive/libarchive.3 index 8c19d00..8c19d00 100644 --- a/libarchive/libarchive-2.4.17/libarchive/libarchive.3 +++ b/libarchive/libarchive-2.5.5/libarchive/libarchive.3 diff --git a/libarchive/libarchive-2.4.17/libarchive/libarchive_internals.3 b/libarchive/libarchive-2.5.5/libarchive/libarchive_internals.3 index 9a42b76..9a42b76 100644 --- a/libarchive/libarchive-2.4.17/libarchive/libarchive_internals.3 +++ b/libarchive/libarchive-2.5.5/libarchive/libarchive_internals.3 diff --git a/libarchive/libarchive-2.4.17/libarchive/mtree.5 b/libarchive/libarchive-2.5.5/libarchive/mtree.5 index 613de6a..b6637d6 100644 --- a/libarchive/libarchive-2.4.17/libarchive/mtree.5 +++ b/libarchive/libarchive-2.5.5/libarchive/mtree.5 @@ -33,12 +33,12 @@ .Os .Sh NAME .Nm mtree -.Nd format of mtree dir heirarchy files +.Nd format of mtree dir hierarchy files .Sh DESCRIPTION The .Nm format is a textual format that describes a collection of filesystem objects. -Such files are typically used to create or verify directory heirarchies. +Such files are typically used to create or verify directory hierarchies. .Ss General Format An .Nm @@ -121,7 +121,7 @@ separated by whitespace. .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 +Each such definition consists of a key from the following list immediately followed by an '=' sign and a value. Software programs reading mtree files should warn about @@ -135,8 +135,7 @@ the .Xr cksum 1 utility. .It Cm contents -The full pathname of a file whose contents should be -compared to the contents of this file. +The full pathname of a file that holds the contents of this file. .It Cm flags The file flags as a symbolic name. See @@ -145,17 +144,36 @@ for information on these names. If no flags are to be set the string .Dq none may be used to override the current default. -.It Cm ignore -Ignore any file hierarchy below this file. .It Cm gid The file group as a numeric value. .It Cm gname The file group as a symbolic name. +.It Cm ignore +Ignore any file hierarchy below this file. +.It Cm link +The target of the symbolic link when type=link. .It Cm md5 The MD5 message digest of the file. .It Cm md5digest A synonym for .Cm md5 . +.It Cm mode +The current file's permissions as a numeric (octal) or symbolic +value. +.It Cm nlink +The number of hard links the file is expected to have. +.It Cm nochange +Make sure this file or directory exists but otherwise ignore all attributes. +.It Cm ripemd160digest +The +.Tn RIPEMD160 +message digest of the file. +.It Cm rmd160 +A synonym for +.Cm ripemd160digest . +.It Cm rmd160digest +A synonym for +.Cm ripemd160digest . .It Cm sha1 The .Tn FIPS @@ -174,31 +192,8 @@ message digest of the file. .It Cm sha256digest A synonym for .Cm sha256 . -.It Cm ripemd160digest -The -.Tn RIPEMD160 -message digest of the file. -.It Cm rmd160 -A synonym for -.Cm ripemd160digest . -.It Cm rmd160digest -A synonym for -.Cm ripemd160digest . -.It Cm mode -The current file's permissions as a numeric (octal) or symbolic -value. -.It Cm nlink -The number of hard links the file is expected to have. -.It Cm nochange -Make sure this file or directory exists but otherwise ignore all attributes. -.It Cm uid -The file owner as a numeric value. -.It Cm uname -The file owner as a symbolic name. .It Cm size The size, in bytes, of the file. -.It Cm link -The file the symbolic link is expected to reference. .It Cm time The last modification time of the file. .It Cm type @@ -220,6 +215,10 @@ symbolic link .It Cm socket socket .El +.It Cm uid +The file owner as a numeric value. +.It Cm uname +The file owner as a symbolic name. .El .Pp .Sh SEE ALSO diff --git a/libarchive/libarchive-2.4.17/libarchive/tar.5 b/libarchive/libarchive-2.5.5/libarchive/tar.5 index ab39df3..0687326 100644 --- a/libarchive/libarchive-2.4.17/libarchive/tar.5 +++ b/libarchive/libarchive-2.5.5/libarchive/tar.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/tar.5,v 1.17 2007/01/09 08:05:56 kientzle Exp $ +.\" $FreeBSD: src/lib/libarchive/tar.5,v 1.18 2008/05/26 17:00:23 kientzle Exp $ .\" .Dd May 20, 2004 .Dt TAR 5 @@ -221,7 +221,7 @@ field with several new type values: .Bl -tag -width indent -compact .It Dq 0 Regular file. -NULL should be treated as a synonym, for compatibility purposes. +NUL should be treated as a synonym, for compatibility purposes. .It Dq 1 Hard link. .It Dq 2 @@ -258,7 +258,7 @@ by readers. .It Va magic Contains the magic value .Dq ustar -followed by a NULL byte to indicate that this is a POSIX standard archive. +followed by a NUL byte to indicate that this is a POSIX standard archive. Full compliance requires the uname and gname fields be properly set. .It Va version Version. @@ -285,7 +285,7 @@ character to the regular name field to obtain the full pathname. .El .Pp Note that all unused bytes must be set to -.Dv NULL . +.Dv NUL . .Pp Field termination is specified slightly differently by POSIX than by previous implementations. @@ -295,14 +295,14 @@ The and .Va gname fields must have a trailing -.Dv NULL . +.Dv NUL . The .Va pathname , .Va linkname , and .Va prefix fields must have a trailing -.Dv NULL +.Dv NUL unless they fill the entire field. (In particular, it is possible to store a 256-character pathname if it happens to have a @@ -310,7 +310,7 @@ 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 -.Dv NULL +.Dv NUL characters. .Pp Currently, most tar implementations comply with the ustar diff --git a/libarchive/libarchive-2.4.17/libarchive/test/list.h b/libarchive/libarchive-2.5.5/libarchive/test/list.h index fdd5633..278821a 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/list.h +++ b/libarchive/libarchive-2.5.5/libarchive/test/list.h @@ -9,7 +9,9 @@ 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_pax_filename_encoding_1) +DEFINE_TEST(test_pax_filename_encoding_2) +DEFINE_TEST(test_pax_filename_encoding_3) DEFINE_TEST(test_read_compress_program) DEFINE_TEST(test_read_data_large) DEFINE_TEST(test_read_extract) @@ -29,6 +31,7 @@ DEFINE_TEST(test_read_format_isorr_bz2) DEFINE_TEST(test_read_format_mtree) DEFINE_TEST(test_read_format_pax_bz2) DEFINE_TEST(test_read_format_tar) +DEFINE_TEST(test_read_format_tar_empty_filename) DEFINE_TEST(test_read_format_tbz) DEFINE_TEST(test_read_format_tgz) DEFINE_TEST(test_read_format_tz) @@ -39,6 +42,8 @@ DEFINE_TEST(test_read_position) DEFINE_TEST(test_read_truncated) DEFINE_TEST(test_tar_filenames) DEFINE_TEST(test_tar_large) +DEFINE_TEST(test_ustar_filenames) +DEFINE_TEST(test_write_compress) DEFINE_TEST(test_write_compress_program) DEFINE_TEST(test_write_disk) DEFINE_TEST(test_write_disk_hardlink) @@ -52,4 +57,5 @@ DEFINE_TEST(test_write_format_cpio_odc) DEFINE_TEST(test_write_format_shar_empty) DEFINE_TEST(test_write_format_tar) DEFINE_TEST(test_write_format_tar_empty) +DEFINE_TEST(test_write_format_tar_ustar) DEFINE_TEST(test_write_open_memory) diff --git a/libarchive/libarchive-2.4.17/cpio/test/main.c b/libarchive/libarchive-2.5.5/libarchive/test/main.c index 7e58940..83d3147 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/main.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/main.c @@ -24,26 +24,26 @@ */ /* - * 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. */ +#include "test.h" + #include <errno.h> +#include <locale.h> #include <stdarg.h> #include <time.h> -#include "test.h" -__FBSDID("$FreeBSD$"); +/* + * This same file is used pretty much verbatim for all test harnesses. + * + * The next few lines are the only differences. + */ +#undef PROGRAM /* Testing a library, not a program. */ +#define ENVBASE "LIBARCHIVE" /* Prefix for environment variables. */ +#define EXTRA_DUMP(x) archive_error_string((struct archive *)(x)) +#define EXTRA_VERSION archive_version() +__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.13 2008/06/15 10:35:22 kientzle Exp $"); /* * "list.h" is simply created by "grep DEFINE_TEST"; it has @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); * test functions. */ #undef DEFINE_TEST -#define DEFINE_TEST(name) void name(void); +#define DEFINE_TEST(name) void name(void); #include "list.h" /* Interix doesn't define these in a standard header. */ @@ -63,10 +63,14 @@ 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; +/* Enable core dump on failure. */ +static int dump_on_failure = 0; +/* Default is to remove temp dirs for successful tests. */ +static int keep_temp_files = 0; /* Default is to print some basic information about each test. */ static int quiet_flag = 0; +/* Default is to summarize repeated failures. */ +static int verbose = 0; /* Cumulative count of component failures. */ static int failures = 0; /* Cumulative count of skipped component tests. */ @@ -74,6 +78,9 @@ static int skips = 0; /* Cumulative count of assertions. */ static int assertions = 0; +/* Directory where uuencoded reference files can be found. */ +static char *refdir; + /* * My own implementation of the standard assert() macro emits the * message in the same format as GCC (file:line: message). @@ -167,7 +174,12 @@ report_failure(void *extra) msg[0] = '\0'; } +#ifdef EXTRA_DUMP + if (extra != NULL) + fprintf(stderr, " detail: %s\n", EXTRA_DUMP(extra)); +#else (void)extra; /* UNUSED */ +#endif if (dump_on_failure) { fprintf(stderr, @@ -231,15 +243,15 @@ test_assert(const char *file, int line, int value, const char *condition, void * ++assertions; if (value) { msg[0] = '\0'; - return (1); + return (value); } failures ++; - if (previous_failures(file, line)) - return (0); + if (!verbose && previous_failures(file, line)) + return (value); fprintf(stderr, "%s:%d: Assertion failed\n", file, line); fprintf(stderr, " Condition: %s\n", condition); report_failure(extra); - return (0); + return (value); } /* assertEqualInt() displays the values of the two integers. */ @@ -253,7 +265,7 @@ test_assert_equal_int(const char *file, int line, return (1); } failures ++; - if (previous_failures(file, line)) + if (!verbose && previous_failures(file, line)) return (0); fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n", file, line); @@ -263,6 +275,30 @@ test_assert_equal_int(const char *file, int line, return (0); } +static void strdump(const char *p) +{ + if (p == NULL) { + fprintf(stderr, "(null)"); + return; + } + fprintf(stderr, "\""); + while (*p != '\0') { + unsigned int c = 0xff & *p++; + switch (c) { + case '\a': fprintf(stderr, "\a"); break; + case '\b': fprintf(stderr, "\b"); break; + case '\n': fprintf(stderr, "\n"); break; + case '\r': fprintf(stderr, "\r"); break; + default: + if (c >= 32 && c < 127) + fprintf(stderr, "%c", c); + else + fprintf(stderr, "\\x%02X", c); + } + } + fprintf(stderr, "\""); +} + /* assertEqualString() displays the values of the two strings. */ int test_assert_equal_string(const char *file, int line, @@ -281,12 +317,16 @@ test_assert_equal_string(const char *file, int line, return (1); } failures ++; - if (previous_failures(file, line)) + if (!verbose && previous_failures(file, line)) 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); + fprintf(stderr, " %s = ", e1); + strdump(v1); + fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : strlen(v1)); + fprintf(stderr, " %s = ", e2); + strdump(v2); + fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : strlen(v2)); report_failure(extra); return (0); } @@ -335,7 +375,7 @@ test_assert_equal_wstring(const char *file, int line, return (1); } failures ++; - if (previous_failures(file, line)) + if (!verbose && previous_failures(file, line)) return (0); fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n", file, line); @@ -405,7 +445,7 @@ test_assert_equal_mem(const char *file, int line, return (1); } failures ++; - if (previous_failures(file, line)) + if (!verbose && previous_failures(file, line)) return (0); fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n", file, line); @@ -437,12 +477,13 @@ 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); + return (0); } if (st.st_size == 0) return (1); failures ++; - if (previous_failures(test_filename, test_line)) + if (!verbose && previous_failures(test_filename, test_line)) return (0); fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1); @@ -489,7 +530,7 @@ test_assert_equal_file(const char *f1, const char *f2pattern, ...) break; } failures ++; - if (previous_failures(test_filename, test_line)) + if (!verbose && previous_failures(test_filename, test_line)) return (0); fprintf(stderr, "%s:%d: Files are not identical\n", test_filename, test_line); @@ -499,6 +540,48 @@ test_assert_equal_file(const char *f1, const char *f2pattern, ...) return (0); } +int +test_assert_file_exists(const char *fpattern, ...) +{ + char f[1024]; + va_list ap; + + va_start(ap, fpattern); + vsprintf(f, fpattern, ap); + va_end(ap); + + if (!access(f, F_OK)) + return (1); + if (!previous_failures(test_filename, test_line)) { + fprintf(stderr, "%s:%d: File doesn't exist\n", + test_filename, test_line); + fprintf(stderr, " file=\"%s\"\n", f); + report_failure(test_extra); + } + return (0); +} + +int +test_assert_file_not_exists(const char *fpattern, ...) +{ + char f[1024]; + va_list ap; + + va_start(ap, fpattern); + vsprintf(f, fpattern, ap); + va_end(ap); + + if (access(f, F_OK)) + return (1); + if (!previous_failures(test_filename, test_line)) { + fprintf(stderr, "%s:%d: File exists and shouldn't\n", + test_filename, test_line); + fprintf(stderr, " file=\"%s\"\n", f); + 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, ...) @@ -537,7 +620,6 @@ test_assert_file_contents(const void *buff, int s, const char *fpattern, ...) return (0); } - /* * Call standard system() call, but build up the command line using * sprintf() conventions. @@ -614,7 +696,7 @@ slurpfile(size_t * sizep, const char *fmt, ...) * We reuse it here to define a list of all tests (functions and names). */ #undef DEFINE_TEST -#define DEFINE_TEST(n) { n, #n }, +#define DEFINE_TEST(n) { n, #n }, struct { void (*func)(void); const char *name; } tests[] = { #include "list.h" }; @@ -629,8 +711,11 @@ static int test_run(int i, const char *tmpdir) { int failures_before = failures; - if (!quiet_flag) + if (!quiet_flag) { printf("%d: %s\n", i, tests[i].name); + fflush(stdout); + } + /* * Always explicitly chdir() in case the last test moved us to * a strange place. @@ -655,10 +740,18 @@ 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. */ summarize(); + /* If there were no failures, we can remove the work dir. */ + if (failures == failures_before) { + if (!keep_temp_files && chdir(tmpdir) == 0) { + systemf("rm -rf %s", tests[i].name); + } + } /* Return appropriate status. */ return (failures == failures_before ? 0 : 1); } @@ -672,19 +765,83 @@ static void usage(const char *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(" -d Dump core after any failure, for debugging.\n"); + printf(" -k Keep all temp files.\n"); + printf(" Default: temp files for successful tests deleted.\n"); +#ifdef PROGRAM printf(" -p <path> Path to executable to be tested.\n"); - printf(" Default: path taken from " PROGRAM " environment variable.\n"); + printf(" Default: path taken from " ENVBASE " environment variable.\n"); +#endif printf(" -q Quiet.\n"); printf(" -r <dir> Path to dir containing reference files.\n"); printf(" Default: Current directory.\n"); + printf(" -v Verbose.\n"); printf("Available tests:\n"); for (i = 0; i < limit; i++) printf(" %d: %s\n", i, tests[i].name); exit(1); } +#define UUDECODE(c) (((c) - 0x20) & 0x3f) + +void +extract_reference_file(const char *name) +{ + char buff[1024]; + FILE *in, *out; + + sprintf(buff, "%s/%s.uu", refdir, name); + in = fopen(buff, "r"); + failure("Couldn't open reference file %s", buff); + assert(in != NULL); + if (in == NULL) + return; + /* Read up to and including the 'begin' line. */ + for (;;) { + if (fgets(buff, sizeof(buff), in) == NULL) { + /* TODO: This is a failure. */ + return; + } + if (memcmp(buff, "begin ", 6) == 0) + break; + } + /* Now, decode the rest and write it. */ + /* Not a lot of error checking here; the input better be right. */ + out = fopen(name, "w"); + while (fgets(buff, sizeof(buff), in) != NULL) { + char *p = buff; + int bytes; + + if (memcmp(buff, "end", 3) == 0) + break; + + bytes = UUDECODE(*p++); + while (bytes > 0) { + int n = 0; + /* Write out 1-3 bytes from that. */ + if (bytes > 0) { + n = UUDECODE(*p++) << 18; + n |= UUDECODE(*p++) << 12; + fputc(n >> 16, out); + --bytes; + } + if (bytes > 0) { + n |= UUDECODE(*p++) << 6; + fputc((n >> 8) & 0xFF, out); + --bytes; + } + if (bytes > 0) { + n |= UUDECODE(*p++); + fputc(n & 0xFF, out); + --bytes; + } + } + } + fclose(out); + fclose(in); +} + + int main(int argc, char **argv) { static const int limit = sizeof(tests) / sizeof(tests[0]); @@ -706,26 +863,35 @@ int main(int argc, char **argv) ++p; } +#ifdef PROGRAM /* Get the target program from environment, if available. */ - testprog = getenv(PROGRAM); + testprog = getenv(ENVBASE); +#endif - /* Allow -k to be controlled through the environment. */ - if (getenv(PROGRAM "_KEEP_GOING") != NULL) - dump_on_failure = 0; + /* Allow -d to be controlled through the environment. */ + if (getenv(ENVBASE "_DEBUG") != NULL) + dump_on_failure = 1; /* Get the directory holding test files from environment. */ - refdir = getenv(PROGRAM "_TEST_FILES"); + refdir = getenv(ENVBASE "_TEST_FILES"); /* * Parse options. */ - while ((opt = getopt(argc, argv, "kp:qr:")) != -1) { + while ((opt = getopt(argc, argv, "dkp:qr:v")) != -1) { switch (opt) { + case 'd': + dump_on_failure = 1; + break; case 'k': - dump_on_failure = 0; + keep_temp_files = 1; break; case 'p': +#ifdef PROGRAM testprog = optarg; +#else + usage(progname); +#endif break; case 'q': quiet_flag++; @@ -733,6 +899,9 @@ int main(int argc, char **argv) case 'r': refdir = optarg; break; + case 'v': + verbose = 1; + break; case '?': default: usage(progname); @@ -744,9 +913,10 @@ int main(int argc, char **argv) /* * Sanity-check that our options make sense. */ +#ifdef PROGRAM if (testprog == NULL) usage(progname); - +#endif /* * Create a temp directory for the following tests. @@ -780,6 +950,7 @@ int main(int argc, char **argv) --p; *p = '\0'; } + systemf("rm %s/refdir", tmpdir); } /* @@ -788,7 +959,12 @@ int main(int argc, char **argv) if (!quiet_flag) { printf("Running tests in: %s\n", tmpdir); printf("Reference files will be read from: %s\n", refdir); +#ifdef PROGRAM printf("Running tests on: %s\n", testprog); +#endif + printf("Exercising: "); + fflush(stdout); + printf("%s\n", EXTRA_VERSION); } /* @@ -830,5 +1006,9 @@ int main(int argc, char **argv) free(refdir_alloc); + /* If the final tmpdir is empty, we can remove it. */ + /* This should be the usual case when all tests succeed. */ + rmdir(tmpdir); + return (tests_failed); } diff --git a/libarchive/libarchive-2.4.17/libarchive/test/read_open_memory.c b/libarchive/libarchive-2.5.5/libarchive/test/read_open_memory.c index aacb012..aacb012 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/read_open_memory.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/read_open_memory.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test.h b/libarchive/libarchive-2.5.5/libarchive/test/test.h index 72d611d..fbbf10a 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test.h +++ b/libarchive/libarchive-2.5.5/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.8 2008/02/19 05:52:30 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/test/test.h,v 1.10 2008/06/15 10:35:22 kientzle Exp $ */ /* Every test program should #include "test.h" as the first thing. */ @@ -31,10 +31,21 @@ * 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 +#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 +#include <dirent.h> #include <errno.h> #include <fcntl.h> #include <stdio.h> @@ -50,20 +61,6 @@ #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 */ @@ -101,6 +98,15 @@ /* Assert that a file is empty; supports printf-style arguments. */ #define assertEmptyFile \ test_setup(__FILE__, __LINE__);test_assert_empty_file +/* Assert that a file exists; supports printf-style arguments. */ +#define assertFileExists \ + test_setup(__FILE__, __LINE__);test_assert_file_exists +/* Assert that a file exists; supports printf-style arguments. */ +#define assertFileNotExists \ + test_setup(__FILE__, __LINE__);test_assert_file_not_exists +/* 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 @@ -116,12 +122,15 @@ void failure(const char *fmt, ...); void test_setup(const char *, int); void test_skipping(const char *fmt, ...); 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 *); -void test_assert_equal_mem(const char *, int, const char *, const char *, const char *, const char *, size_t, 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 *, ...); +int test_assert_file_exists(const char *, ...); +int test_assert_file_not_exists(const char *, ...); /* Like sprintf, then system() */ int systemf(const char * fmt, ...); @@ -130,12 +139,8 @@ int systemf(const char * fmt, ...); /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */ char *slurpfile(size_t *, const char *fmt, ...); -/* - * Global vars - */ - -/* Directory holding reference files. */ -char *refdir; +/* Extracts named reference file to the current directory. */ +void extract_reference_file(const char *); /* * Special interfaces for libarchive test harness. diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_acl_basic.c b/libarchive/libarchive-2.5.5/libarchive/test/test_acl_basic.c index effcfb7..effcfb7 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_acl_basic.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_acl_basic.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_acl_pax.c b/libarchive/libarchive-2.5.5/libarchive/test/test_acl_pax.c index abf7469..1eb3d39 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_acl_pax.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_acl_pax.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_acl_pax.c,v 1.4 2007/07/06 15:43:11 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_pax.c,v 1.5 2008/05/26 17:00:24 kientzle Exp $"); /* * Exercise the system-independent portion of the ACL support. @@ -332,14 +332,10 @@ acl_match(struct acl_t *acl, int type, int permset, int tag, int qual, const cha return (1); if (qual != acl->qual) return (0); - if (name == NULL) { - if (acl->name == NULL || acl->name[0] == '\0') - return (1); - } - if (acl->name == NULL) { - if (name[0] == '\0') - return (1); - } + if (name == NULL) + return (acl->name == NULL || acl->name[0] == '\0'); + if (acl->name == NULL) + return (name == NULL || name[0] == '\0'); return (0 == strcmp(name, acl->name)); } diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_archive_api_feature.c b/libarchive/libarchive-2.5.5/libarchive/test/test_archive_api_feature.c index 432d902..23a7083 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_archive_api_feature.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_archive_api_feature.c @@ -23,10 +23,34 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_archive_api_feature.c,v 1.3 2007/07/06 15:43:11 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_archive_api_feature.c,v 1.5 2008/05/26 17:00:24 kientzle Exp $"); DEFINE_TEST(test_archive_api_feature) { + char buff[128]; + const char *p; + + /* This is the (hopefully) final versioning API. */ + assertEqualInt(ARCHIVE_VERSION_NUMBER, archive_version_number()); + sprintf(buff, "libarchive %d.%d.%d", + archive_version_number() / 1000000, + (archive_version_number() / 1000) % 1000, + archive_version_number() % 1000); + failure("Version string is: %s, computed is: %s", + archive_version_string(), buff); + assert(memcmp(buff, archive_version_string(), strlen(buff)) == 0); + if (strlen(buff) < strlen(archive_version_string())) { + p = archive_version_string() + strlen(buff); + failure("Version string is: %s", archive_version_string()); + assert(*p == 'a' || *p == 'b' || *p == 'c' || *p == 'd'); + ++p; + failure("Version string is: %s", archive_version_string()); + assert(*p == '\0'); + } + +/* This is all scheduled to disappear in libarchive 3.0 */ +#if ARCHIVE_VERSION_NUMBER < 3000000 + assertEqualInt(ARCHIVE_VERSION_STAMP, ARCHIVE_VERSION_NUMBER); assertEqualInt(ARCHIVE_API_FEATURE, archive_api_feature()); assertEqualInt(ARCHIVE_API_VERSION, archive_api_version()); /* @@ -48,4 +72,5 @@ DEFINE_TEST(test_archive_api_feature) skipping("archive_version_stamp()"); #endif assertEqualString(ARCHIVE_LIBRARY_VERSION, archive_version()); +#endif } diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_bad_fd.c b/libarchive/libarchive-2.5.5/libarchive/test/test_bad_fd.c index 1903cd0..1903cd0 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_bad_fd.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_bad_fd.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_gtar.c b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_gtar.c index 3451a76..66cd7b0 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_gtar.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_gtar.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_compat_gtar.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_gtar.c,v 1.2 2008/03/12 05:12:23 kientzle Exp $"); /* * Verify our ability to read sample files created by GNU tar. @@ -40,14 +40,14 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_gtar.c,v 1.1 2008/01/01 static void test_compat_gtar_1(void) { - char name[1024]; + char name[] = "test_compat_gtar_1.tgz"; 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); + extract_reference_file(name); assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240)); /* Read first entry. */ diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_gtar_1.tgz.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_gtar_1.tgz.uu index f088a4a..f088a4a 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_gtar_1.tgz.uu +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_gtar_1.tgz.uu diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_tar_hardlink.c b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_tar_hardlink.c index 103b349..ae71e92 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_tar_hardlink.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_tar_hardlink.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_compat_tar_hardlink.c,v 1.1 2008/01/31 07:47:38 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink.c,v 1.2 2008/03/12 05:12:23 kientzle Exp $"); /* * Background: There are two written standards for the tar file format. @@ -46,14 +46,14 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink.c,v 1.1 200 static void test_compat_tar_hardlink_1(void) { - char name[1024]; + char name[] = "test_compat_tar_hardlink_1.tar"; 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); + extract_reference_file(name); assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240)); /* Read first entry, which is a regular file. */ diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_tar_hardlink_1.tar.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_tar_hardlink_1.tar.uu index 95dba54..95dba54 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_tar_hardlink_1.tar.uu +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_tar_hardlink_1.tar.uu diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_zip.c b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_zip.c index 0f6d1d0..fdeb9c6 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_zip.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_zip.c @@ -23,20 +23,20 @@ * 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 $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_zip.c,v 1.2 2008/03/12 05:12:23 kientzle Exp $"); /* Copy this function for each test file and adjust it accordingly. */ static void test_compat_zip_1(void) { - char name[1024]; + char name[] = "test_compat_zip_1.zip"; 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); + extract_reference_file(name); assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240)); /* Read first entry. */ diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_zip_1.zip.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_zip_1.zip.uu index e13a6ca..e13a6ca 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_compat_zip_1.zip.uu +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_compat_zip_1.zip.uu diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_empty_write.c b/libarchive/libarchive-2.5.5/libarchive/test/test_empty_write.c index 540ddf1..6a9f3f9 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_empty_write.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_empty_write.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_empty_write.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_empty_write.c,v 1.2 2008/03/15 11:06:15 kientzle Exp $"); DEFINE_TEST(test_empty_write) { @@ -47,6 +47,7 @@ DEFINE_TEST(test_empty_write) archive_entry_set_mode(ae, S_IFREG | 0755); archive_entry_set_size(ae, 0); assertA(0 == archive_write_header(a, ae)); + archive_entry_free(ae); /* THE TEST: write zero bytes to this entry. */ /* This used to crash. */ @@ -76,6 +77,7 @@ DEFINE_TEST(test_empty_write) archive_entry_set_mode(ae, S_IFREG | 0755); archive_entry_set_size(ae, 0); assertA(0 == archive_write_header(a, ae)); + archive_entry_free(ae); /* THE TEST: write zero bytes to this entry. */ assertEqualIntA(a, 0, archive_write_data(a, "", 0)); @@ -104,6 +106,7 @@ DEFINE_TEST(test_empty_write) archive_entry_set_mode(ae, S_IFREG | 0755); archive_entry_set_size(ae, 0); assertA(0 == archive_write_header(a, ae)); + archive_entry_free(ae); /* THE TEST: write zero bytes to this entry. */ assertEqualIntA(a, 0, archive_write_data(a, "", 0)); diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_entry.c b/libarchive/libarchive-2.5.5/libarchive/test/test_entry.c index 11b7f2b..5282092 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_entry.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_entry.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_entry.c,v 1.2 2007/07/06 15:43:11 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_entry.c,v 1.6 2008/05/26 17:00:24 kientzle Exp $"); #include <locale.h> @@ -52,6 +52,8 @@ DEFINE_TEST(test_entry) const void *xval; /* For xattr tests. */ size_t xsize; /* For xattr tests. */ int c; + wchar_t wc; + long l; assert((e = archive_entry_new()) != NULL); @@ -122,8 +124,37 @@ DEFINE_TEST(test_entry) #else skipping("archive_entry_ino()"); #endif + /* link */ - /* TODO: implement these tests. */ + archive_entry_set_hardlink(e, "hardlinkname"); + archive_entry_set_symlink(e, NULL); + archive_entry_set_link(e, "link"); + assertEqualString(archive_entry_hardlink(e), "link"); + assertEqualString(archive_entry_symlink(e), NULL); + archive_entry_copy_link(e, "link2"); + assertEqualString(archive_entry_hardlink(e), "link2"); + assertEqualString(archive_entry_symlink(e), NULL); + archive_entry_copy_link_w(e, L"link3"); + assertEqualString(archive_entry_hardlink(e), "link3"); + assertEqualString(archive_entry_symlink(e), NULL); + archive_entry_set_hardlink(e, NULL); + archive_entry_set_symlink(e, "symlink"); + archive_entry_set_link(e, "link"); + assertEqualString(archive_entry_hardlink(e), NULL); + assertEqualString(archive_entry_symlink(e), "link"); + archive_entry_copy_link(e, "link2"); + assertEqualString(archive_entry_hardlink(e), NULL); + assertEqualString(archive_entry_symlink(e), "link2"); + archive_entry_copy_link_w(e, L"link3"); + assertEqualString(archive_entry_hardlink(e), NULL); + assertEqualString(archive_entry_symlink(e), "link3"); + /* Arbitrarily override symlink if both hardlink and symlink set. */ + archive_entry_set_hardlink(e, "hardlink"); + archive_entry_set_symlink(e, "symlink"); + archive_entry_set_link(e, "link"); + assertEqualString(archive_entry_hardlink(e), "hardlink"); + assertEqualString(archive_entry_symlink(e), "link"); + /* mode */ archive_entry_set_mode(e, 0123456); assertEqualInt(archive_entry_mode(e), 0123456); @@ -201,6 +232,11 @@ DEFINE_TEST(test_entry) assertEqualString(archive_entry_fflags_text(e), "uappnd,nouchg,nodump,noopaque,uunlnk"); /* TODO: Test archive_entry_copy_fflags_text_w() */ + /* Test archive_entry_copy_fflags_text() */ + archive_entry_copy_fflags_text(e, "nouappnd, nouchg, dump,uunlnk"); + archive_entry_fflags(e, &set, &clear); + assertEqualInt(16, set); + assertEqualInt(7, clear); #endif /* See test_acl_basic.c for tests of ACL set/get consistency. */ @@ -215,10 +251,16 @@ DEFINE_TEST(test_entry) assertEqualInt(1, archive_entry_xattr_count(e)); assertEqualInt(ARCHIVE_WARN, archive_entry_xattr_next(e, &xname, &xval, &xsize)); + assertEqualString(xname, NULL); + assertEqualString(xval, NULL); + assertEqualInt(xsize, 0); archive_entry_xattr_clear(e); assertEqualInt(0, archive_entry_xattr_reset(e)); assertEqualInt(ARCHIVE_WARN, archive_entry_xattr_next(e, &xname, &xval, &xsize)); + assertEqualString(xname, NULL); + assertEqualString(xval, NULL); + assertEqualInt(xsize, 0); archive_entry_xattr_add_entry(e, "xattr1", "xattrvalue1", 12); assertEqualInt(1, archive_entry_xattr_reset(e)); archive_entry_xattr_add_entry(e, "xattr2", "xattrvalue2", 12); @@ -227,6 +269,9 @@ DEFINE_TEST(test_entry) assertEqualInt(0, archive_entry_xattr_next(e, &xname, &xval, &xsize)); assertEqualInt(ARCHIVE_WARN, archive_entry_xattr_next(e, &xname, &xval, &xsize)); + assertEqualString(xname, NULL); + assertEqualString(xval, NULL); + assertEqualInt(xsize, 0); /* @@ -350,6 +395,11 @@ DEFINE_TEST(test_entry) assertEqualString(xname, "xattr1"); assertEqualString(xval, "xattrvalue"); assertEqualInt(xsize, 11); + assertEqualInt(ARCHIVE_WARN, + archive_entry_xattr_next(e2, &xname, &xval, &xsize)); + assertEqualString(xname, NULL); + assertEqualString(xval, NULL); + assertEqualInt(xsize, 0); #endif /* Change the original */ @@ -455,6 +505,14 @@ DEFINE_TEST(test_entry) assertEqualInt(tag, ARCHIVE_ENTRY_ACL_USER); assertEqualInt(qual, 77); assertEqualString(name, "user77"); + assertEqualInt(1, archive_entry_acl_next(e2, + ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + &type, &permset, &tag, &qual, &name)); + assertEqualInt(type, 0); + assertEqualInt(permset, 0); + assertEqualInt(tag, 0); + assertEqualInt(qual, -1); + assertEqualString(name, NULL); #endif #if ARCHIVE_VERSION_STAMP < 1009000 skipping("xattr preserved in archive_entry copy"); @@ -707,6 +765,26 @@ DEFINE_TEST(test_entry) assert(NULL == archive_entry_symlink_w(e)); } + l = 0x12345678L; + wc = (wchar_t)l; /* Wide character too big for UTF-8. */ + if (NULL == setlocale(LC_ALL, "C") || (long)wc != l) { + skipping("Testing charset conversion failure requires 32-bit wchar_t and support for \"C\" locale."); + } else { + /* + * Build the string L"xxx\U12345678yyy\u5678zzz" without + * using C99 \u#### syntax, which isn't uniformly + * supported. (GCC 3.4.6, for instance, defaults to + * "c89 plus GNU extensions.") + */ + wcscpy(wbuff, L"xxxAyyyBzzz"); + wbuff[3] = 0x12345678; + wbuff[7] = 0x5678; + /* A wide filename that cannot be converted to narrow. */ + archive_entry_copy_pathname_w(e, wbuff); + failure("Converting wide characters from Unicode should fail."); + assertEqualString(NULL, archive_entry_pathname(e)); + } + /* Release the experimental entry. */ archive_entry_free(e); } diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_entry_strmode.c b/libarchive/libarchive-2.5.5/libarchive/test/test_entry_strmode.c index 2941c4a..2941c4a 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_entry_strmode.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_entry_strmode.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_link_resolver.c b/libarchive/libarchive-2.5.5/libarchive/test/test_link_resolver.c index 24827b0..8332c4f 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_link_resolver.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_link_resolver.c @@ -23,41 +23,7 @@ * 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); -} +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_link_resolver.c,v 1.2 2008/06/15 04:31:43 kientzle Exp $"); static void test_linkify_tar(void) { @@ -67,7 +33,7 @@ static void test_linkify_tar(void) /* Initialize the resolver. */ assert(NULL != (resolver = archive_entry_linkresolver_new())); archive_entry_linkresolver_set_strategy(resolver, - ARCHIVE_ENTRY_LINKIFY_LIKE_TAR); + ARCHIVE_FORMAT_TAR_USTAR); /* Create an entry with only 1 link and try to linkify it. */ assert(NULL != (entry = archive_entry_new())); @@ -102,6 +68,24 @@ static void test_linkify_tar(void) assertEqualInt(0, archive_entry_size(entry)); + /* Dirs should never be matched as hardlinks, regardless. */ + archive_entry_set_pathname(entry, "test3"); + archive_entry_set_nlink(entry, 2); + archive_entry_set_filetype(entry, AE_IFDIR); + archive_entry_set_ino(entry, 3); + archive_entry_set_hardlink(entry, NULL); + archive_entry_linkify(resolver, &entry, &e2); + /* Shouldn't be altered, since it wasn't seen before. */ + assert(e2 == NULL); + assertEqualString("test3", archive_entry_pathname(entry)); + assertEqualString(NULL, archive_entry_hardlink(entry)); + + /* Dir, so it shouldn't get matched. */ + archive_entry_linkify(resolver, &entry, &e2); + assert(e2 == NULL); + assertEqualString("test3", archive_entry_pathname(entry)); + assertEqualString(NULL, archive_entry_hardlink(entry)); + archive_entry_free(entry); archive_entry_linkresolver_free(resolver); } @@ -114,7 +98,7 @@ static void test_linkify_old_cpio(void) /* Initialize the resolver. */ assert(NULL != (resolver = archive_entry_linkresolver_new())); archive_entry_linkresolver_set_strategy(resolver, - ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO); + ARCHIVE_FORMAT_CPIO_POSIX); /* Create an entry with 2 link and try to linkify it. */ assert(NULL != (entry = archive_entry_new())); @@ -149,7 +133,7 @@ static void test_linkify_new_cpio(void) /* Initialize the resolver. */ assert(NULL != (resolver = archive_entry_linkresolver_new())); archive_entry_linkresolver_set_strategy(resolver, - ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO); + ARCHIVE_FORMAT_CPIO_SVR4_NOCRC); /* Create an entry with only 1 link and try to linkify it. */ assert(NULL != (entry = archive_entry_new())); @@ -215,7 +199,6 @@ static void test_linkify_new_cpio(void) DEFINE_TEST(test_link_resolver) { - test_link_resolver_basic(); test_linkify_tar(); test_linkify_old_cpio(); test_linkify_new_cpio(); diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_pax_filename_encoding.c b/libarchive/libarchive-2.5.5/libarchive/test/test_pax_filename_encoding.c new file mode 100644 index 0000000..aad8327 --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_pax_filename_encoding.c @@ -0,0 +1,297 @@ +/*- + * 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_pax_filename_encoding.c,v 1.2 2008/05/26 17:00:24 kientzle Exp $"); + +#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. + */ + +/* + * Read a manually-created archive that has filenames that are + * stored in binary instead of UTF-8 and verify that we get + * the right filename returned and that we get a warning only + * if the header isn't marked as binary. + */ +DEFINE_TEST(test_pax_filename_encoding_1) +{ + static const char testname[] = "test_pax_filename_encoding.tar.gz"; + /* + * \314\214 is a valid 2-byte UTF-8 sequence. + * \374 is invalid in UTF-8. + */ + char filename[] = "abc\314\214mno\374xyz"; + struct archive *a; + struct archive_entry *entry; + + /* + * Read an archive that has non-UTF8 pax filenames in it. + */ + extract_reference_file(testname); + a = archive_read_new(); + assertEqualInt(ARCHIVE_OK, archive_read_support_format_tar(a)); + assertEqualInt(ARCHIVE_OK, archive_read_support_compression_gzip(a)); + assertEqualInt(ARCHIVE_OK, + archive_read_open_filename(a, testname, 10240)); + /* + * First entry in this test archive has an invalid UTF-8 sequence + * in it, but the header is not marked as hdrcharset=BINARY, so that + * requires a warning. + */ + failure("Invalid UTF8 in a pax archive pathname should cause a warning"); + assertEqualInt(ARCHIVE_WARN, archive_read_next_header(a, &entry)); + assertEqualString(filename, archive_entry_pathname(entry)); + /* + * Second entry is identical except that it does have + * hdrcharset=BINARY, so no warning should be generated. + */ + failure("A pathname with hdrcharset=BINARY can have invalid UTF8\n" + " characters in it without generating a warning"); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &entry)); + assertEqualString(filename, archive_entry_pathname(entry)); + archive_read_finish(a); +} + +/* + * Set the locale and write a pathname containing invalid characters. + * This should work; the underlying implementation should automatically + * fall back to storing the pathname in binary. + */ +DEFINE_TEST(test_pax_filename_encoding_2) +{ + char filename[] = "abc\314\214mno\374xyz"; + struct archive *a; + struct archive_entry *entry; + char buff[65536]; + 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; + + /* + * 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. */ + if (NULL == setlocale(LC_ALL, "de_DE.UTF-8")) { + skipping("invalid encoding tests require a suitable locale;" + " de_DE.UTF-8 not available on this system"); + 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)); +} + +/* + * Create an entry starting from a wide-character Unicode pathname, + * read it back into "C" locale, which doesn't support the name. + * TODO: Figure out the "right" behavior here. + */ +DEFINE_TEST(test_pax_filename_encoding_3) +{ + wchar_t badname[] = L"xxxAyyyBzzz"; + const char badname_utf8[] = "xxx\xE1\x88\xB4yyy\xE5\x99\xB8zzz"; + struct archive *a; + struct archive_entry *entry; + char buff[65536]; + size_t used; + + badname[3] = 0x1234; + badname[7] = 0x5678; + + /* If it doesn't exist, just warn and return. */ + if (NULL == setlocale(LC_ALL, "C")) { + skipping("Can't set \"C\" locale, so can't exercise " + "certain character-conversion failures"); + 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 to non-convertible wide value. */ + archive_entry_copy_pathname_w(entry, badname); + archive_entry_set_filetype(entry, AE_IFREG); + assertEqualInt(ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + + assert((entry = archive_entry_new()) != NULL); + archive_entry_copy_pathname_w(entry, L"abc"); + /* Set gname to non-convertible wide value. */ + archive_entry_copy_gname_w(entry, badname); + archive_entry_set_filetype(entry, AE_IFREG); + assertEqualInt(ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + + assert((entry = archive_entry_new()) != NULL); + archive_entry_copy_pathname_w(entry, L"abc"); + /* Set uname to non-convertible wide value. */ + archive_entry_copy_uname_w(entry, badname); + archive_entry_set_filetype(entry, AE_IFREG); + assertEqualInt(ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + + assert((entry = archive_entry_new()) != NULL); + archive_entry_copy_pathname_w(entry, L"abc"); + /* Set hardlink to non-convertible wide value. */ + archive_entry_copy_hardlink_w(entry, badname); + archive_entry_set_filetype(entry, AE_IFREG); + assertEqualInt(ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + + assert((entry = archive_entry_new()) != NULL); + archive_entry_copy_pathname_w(entry, L"abc"); + /* Set symlink to non-convertible wide value. */ + archive_entry_copy_symlink_w(entry, badname); + archive_entry_set_filetype(entry, AE_IFLNK); + assertEqualInt(ARCHIVE_OK, 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)); + + failure("A non-convertible pathname should cause a warning."); + assertEqualInt(ARCHIVE_WARN, archive_read_next_header(a, &entry)); + assertEqualWString(badname, archive_entry_pathname_w(entry)); + failure("If native locale can't convert, we should get UTF-8 back."); + assertEqualString(badname_utf8, archive_entry_pathname(entry)); + + failure("A non-convertible gname should cause a warning."); + assertEqualInt(ARCHIVE_WARN, archive_read_next_header(a, &entry)); + assertEqualWString(badname, archive_entry_gname_w(entry)); + failure("If native locale can't convert, we should get UTF-8 back."); + assertEqualString(badname_utf8, archive_entry_gname(entry)); + + failure("A non-convertible uname should cause a warning."); + assertEqualInt(ARCHIVE_WARN, archive_read_next_header(a, &entry)); + assertEqualWString(badname, archive_entry_uname_w(entry)); + failure("If native locale can't convert, we should get UTF-8 back."); + assertEqualString(badname_utf8, archive_entry_uname(entry)); + + failure("A non-convertible hardlink should cause a warning."); + assertEqualInt(ARCHIVE_WARN, archive_read_next_header(a, &entry)); + assertEqualWString(badname, archive_entry_hardlink_w(entry)); + failure("If native locale can't convert, we should get UTF-8 back."); + assertEqualString(badname_utf8, archive_entry_hardlink(entry)); + + failure("A non-convertible symlink should cause a warning."); + assertEqualInt(ARCHIVE_WARN, archive_read_next_header(a, &entry)); + assertEqualWString(badname, archive_entry_symlink_w(entry)); + assertEqualWString(NULL, archive_entry_hardlink_w(entry)); + failure("If native locale can't convert, we should get UTF-8 back."); + assertEqualString(badname_utf8, archive_entry_symlink(entry)); + + assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &entry)); + + assertEqualInt(0, archive_read_close(a)); + assertEqualInt(0, archive_read_finish(a)); +} diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_pax_filename_encoding.tar.gz.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_pax_filename_encoding.tar.gz.uu new file mode 100644 index 0000000..7191aac --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_pax_filename_encoding.tar.gz.uu @@ -0,0 +1,10 @@ +begin 644 test_pax_filename_encoding.tar.gz +M'XL(`)4;VT<``^V6STK#0!#&<\Y3[!/HS/Z-ASVHEQ1$BE[L<4T6$DP32:-$ +MG\%'\Y%Z,*7$UEJLE"91NK_+P.P>OF'X^&9LZM":V):GYCYZ?YOFQ5W]\NH= +M%`"0G).FHA*P7I>@E`1!22E!`9,$4#"0'JD/*V,[3[/*E(V4*IW^^&_7^W(4 +M\EG_"13)HZD2W6Y_WFS?IT"B9EZKD8(0+)"!6/3,EQZ5/BIR>QF.KB8GL7W6 +M0>!3VC;2O-"<H>#\S,>@[>99FC]H](>>VM'2G>M7[/(_@-CP/V-4>`2Z$K3. +MD?L_M%E6#"W",1CC;_D_[SW_*;+-_!><N?SO@R;_D[B,$E/.;*4O1M?G-Q/_ +L%T<!1\7V/@IP\<T=!7^![ER_8H_\%PI=_O>!RW^'P^$X3CX`98.>C@`4```` +` +end diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_compress_program.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_compress_program.c index ec688e6..ec688e6 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_compress_program.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_compress_program.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_data_large.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_data_large.c index a690b7b..a690b7b 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_data_large.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_data_large.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_extract.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_extract.c index bd42fd0..ec84830 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_extract.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_extract.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_extract.c,v 1.3 2007/05/29 01:00:20 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_extract.c,v 1.4 2008/06/15 10:35:22 kientzle Exp $"); #define BUFF_SIZE 1000000 #define FILE_BUFF_SIZE 100000 @@ -135,12 +135,18 @@ DEFINE_TEST(test_read_extract) #endif /* Test the entries on disk. */ + /* This first entry was extracted with ARCHIVE_EXTRACT_PERM, + * so the permissions should have been restored exactly, + * including resetting the gid bit on those platforms + * where gid is inherited by subdirs. */ assert(0 == stat("dir_0775", &st)); failure("This was 0775 in archive, and should be 0775 on disk"); - assert(st.st_mode == (S_IFDIR | 0775)); + assertEqualInt(st.st_mode, S_IFDIR | 0775); + /* Everything else was extracted without ARCHIVE_EXTRACT_PERM, + * so there may be some sloppiness about gid bits on directories. */ assert(0 == stat("file", &st)); failure("st.st_mode=%o should be %o", st.st_mode, S_IFREG | 0755); - assert(st.st_mode == (S_IFREG | 0755)); + assertEqualInt(st.st_mode, S_IFREG | 0755); failure("The file extracted to disk is the wrong size."); assert(st.st_size == FILE_BUFF_SIZE); fd = open("file", O_RDONLY); @@ -153,23 +159,26 @@ DEFINE_TEST(test_read_extract) assert(memcmp(buff, file_buff, FILE_BUFF_SIZE) == 0); assert(0 == stat("dir", &st)); failure("This was 0777 in archive, but umask should make it 0755"); - assert(st.st_mode == (S_IFDIR | 0755)); + /* If EXTRACT_PERM wasn't used, be careful to ignore sgid bit + * when checking dir modes, as some systems inherit sgid bit + * from the parent dir. */ + assertEqualInt(0755, st.st_mode & 0777); assert(0 == stat("dir/file", &st)); assert(st.st_mode == (S_IFREG | 0700)); assert(0 == stat("dir2", &st)); - assert(st.st_mode == (S_IFDIR | 0755)); + assertEqualInt(0755, st.st_mode & 0777); assert(0 == stat("dir2/file", &st)); assert(st.st_mode == (S_IFREG | 0000)); assert(0 == stat("dir3", &st)); - assert(st.st_mode == (S_IFDIR | 0710)); + assertEqualInt(0710, st.st_mode & 0777); assert(0 == stat("dir4", &st)); - assert(st.st_mode == (S_IFDIR | 0755)); + assertEqualInt(0755, st.st_mode & 0777); assert(0 == stat("dir4/a", &st)); - assert(st.st_mode == (S_IFDIR | 0755)); + assertEqualInt(0755, st.st_mode & 0777); assert(0 == stat("dir4/b", &st)); - assert(st.st_mode == (S_IFDIR | 0755)); + assertEqualInt(0755, st.st_mode & 0777); assert(0 == stat("dir4/c", &st)); - assert(st.st_mode == (S_IFDIR | 0711)); + assertEqualInt(0711, st.st_mode & 0777); assert(0 == lstat("symlink", &st)); assert(S_ISLNK(st.st_mode)); #if HAVE_LCHMOD diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_ar.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_ar.c index 306da6f..0c01a2b 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_ar.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_ar.c @@ -26,7 +26,7 @@ */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_ar.c,v 1.4 2007/07/06 15:43:11 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_ar.c,v 1.5 2008/03/12 21:10:26 kaiw Exp $"); #if ARCHIVE_VERSION_STAMP >= 1009000 /* @@ -75,9 +75,7 @@ DEFINE_TEST(test_read_format_ar) assertEqualInt(0, archive_entry_mtime(ae)); assertEqualInt(0, archive_entry_uid(ae)); assertEqualInt(0, archive_entry_gid(ae)); - assertEqualInt(40, archive_entry_size(ae)); - assertEqualIntA(a, 40, archive_read_data(a, buff, 50)); - assert(0 == memcmp(buff, "yyytttsssaaafff.o/\nhhhhjjjjkkkkllll.o/\n\n", 40)); + assertEqualInt(0, archive_entry_size(ae)); /* First Entry */ assertA(0 == archive_read_next_header(a, &ae)); diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin.c index b188228..b188228 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin_Z.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin_Z.c index 1dcebd3..1dcebd3 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin_Z.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin_Z.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin_bz2.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin_bz2.c index e2841a7..e2841a7 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin_bz2.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin_bz2.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin_gz.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin_gz.c index efabf31..efabf31 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_bin_gz.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_bin_gz.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_odc.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_odc.c index 1d80ef9..1d80ef9 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_odc.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_odc.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_svr4_gzip.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_svr4_gzip.c index 0bd8296..0bd8296 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_svr4_gzip.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_svr4_gzip.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_svr4c_Z.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_svr4c_Z.c index d6158a8..d6158a8 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_cpio_svr4c_Z.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_cpio_svr4c_Z.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_empty.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_empty.c index f6f3e23..f6f3e23 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_empty.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_empty.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_gz.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_gz.c index 307d1d8..307d1d8 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_gz.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_gz.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse.c index ef3c5d2..b7efea5 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse.c +++ b/libarchive/libarchive-2.5.5/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.7 2008/01/01 22:28:04 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_gtar_sparse.c,v 1.8 2008/03/12 05:12:23 kientzle Exp $"); struct contents { @@ -181,7 +181,6 @@ struct archive_contents { static void verify_archive_file(const char *name, struct archive_contents *ac) { - char path[512]; struct archive_entry *ae; int err; /* data, size, offset of next expected block. */ @@ -190,13 +189,13 @@ verify_archive_file(const char *name, struct archive_contents *ac) struct contents actual; struct archive *a; - sprintf(path, "%s/%s", refdir, name); + extract_reference_file(name); assert((a = archive_read_new()) != NULL); assert(0 == archive_read_support_compression_all(a)); assert(0 == archive_read_support_format_tar(a)); - failure("Can't open %s", path); - assert(0 == archive_read_open_filename(a, path, 3)); + failure("Can't open %s", name); + assert(0 == archive_read_open_filename(a, name, 3)); while (ac->filename != NULL) { struct contents *cts = ac->contents; diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu index a298e59..a298e59 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_13.tgz.uu diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu index 3f31271..3f31271 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17.tgz.uu diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu index 4103896..4103896 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tgz.uu diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu index 6d7963e..6d7963e 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tgz.uu diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu index c74c08f..c74c08f 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tgz.uu diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu index cf8fd77..cf8fd77 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_iso_gz.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_iso_gz.c index 92ada13..92ada13 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_iso_gz.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_iso_gz.c diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_isorr_bz2.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_isorr_bz2.c new file mode 100644 index 0000000..5457c7f --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_isorr_bz2.c @@ -0,0 +1,141 @@ +/*- + * 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_read_format_isorr_bz2.c,v 1.4 2008/06/21 19:11:51 kientzle Exp $"); + +/* +Execute the following to rebuild the data for this program: + tail -n +32 test_read_format_isorr_bz2.c | /bin/sh + +rm -rf /tmp/iso +mkdir /tmp/iso +mkdir /tmp/iso/dir +echo "hello" >/tmp/iso/file +ln /tmp/iso/file /tmp/iso/hardlink +(cd /tmp/iso; ln -s file symlink) +TZ=utc touch -afhm -t 197001020000.01 /tmp/iso /tmp/iso/file /tmp/iso/dir +TZ=utc touch -afhm -t 197001030000.02 /tmp/iso/symlink +mkhybrid -R -uid 1 -gid 2 /tmp/iso | bzip2 > test_read_format_isorr_bz2.iso.bz2 +F=test_read_format_isorr_bz2.iso.bz2 +uuencode $F $F > $F.uu +exit 1 + */ + +DEFINE_TEST(test_read_format_isorr_bz2) +{ + const char *refname = "test_read_format_isorr_bz2.iso.bz2"; + struct archive_entry *ae; + struct archive *a; + const void *p; + size_t size; + off_t offset; + + extract_reference_file(refname); + assert((a = archive_read_new()) != NULL); + assertEqualInt(0, archive_read_support_compression_all(a)); + assertEqualInt(0, archive_read_support_format_all(a)); + assertEqualInt(0, archive_read_open_filename(a, refname, 10240)); + + /* First entry is '.' root directory. */ + assertEqualInt(0, archive_read_next_header(a, &ae)); + assertEqualString(".", archive_entry_pathname(ae)); + assert(S_ISDIR(archive_entry_stat(ae)->st_mode)); + assertEqualInt(2048, archive_entry_size(ae)); + assertEqualInt(86401, archive_entry_mtime(ae)); + assertEqualInt(0, archive_entry_mtime_nsec(ae)); + assertEqualInt(86401, archive_entry_ctime(ae)); + assertEqualInt(0, archive_entry_stat(ae)->st_nlink); + assertEqualInt(0, archive_entry_uid(ae)); + assertEqualIntA(a, ARCHIVE_EOF, + archive_read_data_block(a, &p, &size, &offset)); + assertEqualInt(size, 0); + + /* A directory. */ + assertEqualInt(0, archive_read_next_header(a, &ae)); + assertEqualString("dir", archive_entry_pathname(ae)); + assert(S_ISDIR(archive_entry_stat(ae)->st_mode)); + assertEqualInt(2048, archive_entry_size(ae)); + assertEqualInt(86401, archive_entry_mtime(ae)); + assertEqualInt(86401, archive_entry_atime(ae)); + assertEqualInt(2, archive_entry_stat(ae)->st_nlink); + assertEqualInt(1, archive_entry_uid(ae)); + assertEqualInt(2, archive_entry_gid(ae)); + + /* A regular file. */ + assertEqualInt(0, archive_read_next_header(a, &ae)); + assertEqualString("file", archive_entry_pathname(ae)); + assert(S_ISREG(archive_entry_stat(ae)->st_mode)); + assertEqualInt(6, archive_entry_size(ae)); + assertEqualInt(0, archive_read_data_block(a, &p, &size, &offset)); + assertEqualInt(6, size); + assertEqualInt(0, offset); + assertEqualInt(0, memcmp(p, "hello\n", 6)); + assertEqualInt(86401, archive_entry_mtime(ae)); + assertEqualInt(86401, archive_entry_atime(ae)); + assertEqualInt(2, archive_entry_stat(ae)->st_nlink); + assertEqualInt(1, archive_entry_uid(ae)); + assertEqualInt(2, archive_entry_gid(ae)); + + /* A hardlink to the regular file. */ + assertEqualInt(0, archive_read_next_header(a, &ae)); + assertEqualString("hardlink", archive_entry_pathname(ae)); + assert(S_ISREG(archive_entry_stat(ae)->st_mode)); + assertEqualString("file", archive_entry_hardlink(ae)); + assertEqualInt(6, archive_entry_size(ae)); + assertEqualInt(86401, archive_entry_mtime(ae)); + assertEqualInt(86401, archive_entry_atime(ae)); + assertEqualInt(2, archive_entry_stat(ae)->st_nlink); + assertEqualInt(1, archive_entry_uid(ae)); + assertEqualInt(2, archive_entry_gid(ae)); + + /* A symlink to the regular file. */ + assertEqualInt(0, archive_read_next_header(a, &ae)); + assertEqualString("symlink", archive_entry_pathname(ae)); + assert(S_ISLNK(archive_entry_stat(ae)->st_mode)); + assertEqualString("file", archive_entry_symlink(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(172802, archive_entry_mtime(ae)); + assertEqualInt(172802, archive_entry_atime(ae)); + assertEqualInt(1, archive_entry_stat(ae)->st_nlink); + assertEqualInt(1, archive_entry_uid(ae)); + assertEqualInt(2, archive_entry_gid(ae)); + + /* End of archive. */ + assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); + + /* Verify archive format. */ + assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); + + /* Close the archive. */ + assertEqualInt(0, archive_read_close(a)); +#if ARCHIVE_API_VERSION > 1 + assertEqualInt(0, archive_read_finish(a)); +#else + archive_read_finish(a); +#endif +} + + diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu new file mode 100644 index 0000000..3f0cfca --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu @@ -0,0 +1,22 @@ +begin 644 test_read_format_isorr_bz2.iso.bz2 +M0EIH.3%!629361M#:2D``,?_W?__6_Y58_GX/__?X*?OWB8AZB0`,`$@`$0" +M@0C``QP`U:!,&J>FJ>2:CR)^I'ZB#3U/4-`!H:#(:``]0P@`!H9!D!II-$,A +M&BGFJ>34]0T!IHT&AHT:#0:``!ZC$`#0T.`!H&@&AH``!IB&C30```!H9``! +MA(D0DTQ3T3$TVA-!IIZAA-'J:!H!H#0:#30:#30T;1*PHGAZ"/F;E""L"I6" +M8W&#'./D%S=_T4T96&+@94X&AL;:`Y+0C?:%=B#:8`:PP`2WF"20!EXL)6=] +M8=A)!0Q)($C&$U#8AI(&QL2!"10P4^8D$"0,8$I-.!3R8YWZ]Q1./IDR^VYN +MRJ&76*,$3PG?U(,=C;I20`D<&9/%5ILJIGI0(SWP3KRID6=#1MV*A>)(*B0$ +M$E:><!0D%K$G(WM("\:="00+`OCJ`Y0K(4B%(:1`#1-.%*`S0+)N`I4'MID+ +M$8MAN[,\.QJ`I=ZDA(5<O`KS[(+3L4-$,@&#*7!<`@AO7Y8*E9S#7L>B944( +MO-&.8&:1K;>[K$?O7R-FWA;%5+E]WBV<T&*%[O-6_,_/]:YC;<A-%^UFF09U +MP`*D@;&4KUHN&1:F_D1:YM:J-EG8L%<+BF4W%"6TU:I68MIJ6"FVH>T9PR7J +MNU2C2G2>5**"XH4HD`PF+(*DTT&47'A+)B";NS-UH>(]7G^\/G_343KU\17< +M<*""-SM"%>BVIJL8SF]7L-1.-LSRP2%=KX&C56*FC&#C$XNMGL)]3X&^$V4Z +MY`()G`%`KUR!HU8Z'"HWNE&P6MI:KZ<F%H/X3DN/F&%#`.%8#!HTK295C.#[ +M+^4C&90I^(::@`Y$=<OX=S3?,A#ZU'\'^+PYHV2PK?Q-,&8/Q$A3@$*X*=$A +MK;I2)&A^MSZ`*](@"[>^Q"H0L7.OV8ZJW409[QO=`&&D%=5&@RP`MO%R/J#Q +M-KJ*6D;EH7:DK0.48@8HF*IP(>*YMR$>!+A,)X+;`$94@@?U]B/=2T0CY-2= +M*_1FPF<-G\\@Z-_,Q>06='5:(B#3`W$8Y!:C-CE22SM9*S$00,XXJTIZ!GA( +LGTMN:F\J-,D9>?.38*!I7T>--*B_=T44HJ?#@``"1;7#_Q=R13A0D!M#:2D` +` +end diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_mtree.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_mtree.c index e5165d3..954f022 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_mtree.c +++ b/libarchive/libarchive-2.5.5/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: src/lib/libarchive/test/test_read_format_mtree.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_mtree.c,v 1.2 2008/05/26 17:00:24 kientzle Exp $"); /* Single entry with a hardlink. */ static unsigned char archive[] = { @@ -32,18 +32,18 @@ static unsigned char archive[] = { "dir type=dir\n" " file\\040with\\040space type=file uid=18\n" " ..\n" - "file\\04with\\040space\n" + "file\\04with\\040space type=file\n" "dir2 type=dir\n" " dir3a type=dir\n" - " indir3a\n" + " indir3a type=file\n" "dir2/fullindir2 type=file mode=0777\n" " ..\n" - " indir2\n" + " indir2 type=file\n" " dir3b type=dir\n" - " indir3b\n" + " indir3b type=file\n" " ..\n" " ..\n" - "notindir\n" + "notindir type=file\n" "dir2/fullindir2 mode=0644\n" }; diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_pax_bz2.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_pax_bz2.c index 186d5f9..186d5f9 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_pax_bz2.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_pax_bz2.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tar.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar.c index 1de0849..1de0849 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tar.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar.c diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar_empty_filename.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar_empty_filename.c new file mode 100644 index 0000000..d9ba69b --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar_empty_filename.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$"); + +/* + * Tar entries with empty filenames are unusual, but shouldn't crash us. + */ +DEFINE_TEST(test_read_format_tar_empty_filename) +{ + char name[] = "test_read_format_tar_empty_filename.tar"; + 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)); + extract_reference_file(name); + 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("", archive_entry_pathname(ae)); + assertEqualInt(1208628157, archive_entry_mtime(ae)); + assertEqualInt(1000, archive_entry_uid(ae)); + assertEqualString("tim", archive_entry_uname(ae)); + assertEqualInt(0, archive_entry_gid(ae)); + assertEqualString("wheel", archive_entry_gname(ae)); + assertEqualInt(040775, 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_NONE); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + 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 +} diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar_empty_filename.tar.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar_empty_filename.tar.uu new file mode 100644 index 0000000..7a34c82 --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tar_empty_filename.tar.uu @@ -0,0 +1,38 @@ +begin 644 test_compat_tar_1.tar +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````#`P,#<W-2``,#`Q-S4P(``P,#`P,#`@`#`P,#`P,#`P,#`P +M(#$Q,#`R-#,Q-C<U(#`Q,3`P,0`@-0`````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````!U<W1A<@`P,'1I;0`` +M````````````````````````````````````=VAE96P````````````````` +M```````````````````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```````````````````````````````````````````````````````````` +&```````` +` +end diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tbz.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tbz.c index 3d135eb..3d135eb 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tbz.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tbz.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tgz.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tgz.c index ce61aa6..ce61aa6 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tgz.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tgz.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tz.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tz.c index 337b96d..337b96d 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_tz.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_tz.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_zip.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_zip.c index 9829217..50e522b 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_format_zip.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_zip.c @@ -25,26 +25,9 @@ #include "test.h" __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, -'d','i','r','/','U','T',9,0,3,25,'U','O','F',25,'U','O','F','U','x',4,0,232, -3,232,3,'P','K',3,4,20,0,0,0,8,0,'o','f',179,'6',':','7','f','=',10,0,0,0, -18,0,0,0,5,0,21,0,'f','i','l','e','1','U','T',9,0,3,'A','U','O','F',172,'[', -'O','F','U','x',4,0,232,3,232,3,203,'H',205,201,201,231,202,'@','"',1,'P', -'K',3,4,20,0,0,0,8,0,'Z','j',179,'6',':','7','f','=',10,0,0,0,18,0,0,0,5, -0,21,0,'f','i','l','e','2','U','T',9,0,3,172,'[','O','F',172,'[','O','F', -'U','x',4,0,232,3,232,3,203,'H',205,201,201,231,202,'@','"',1,'P','K',1,2, -23,3,10,0,0,0,0,0,'Y','f',179,'6',0,0,0,0,0,0,0,0,0,0,0,0,4,0,13,0,0,0,0, -0,0,0,16,0,237,'A',0,0,0,0,'d','i','r','/','U','T',5,0,3,25,'U','O','F','U', -'x',0,0,'P','K',1,2,23,3,20,0,0,0,8,0,'o','f',179,'6',':','7','f','=',10, -0,0,0,18,0,0,0,5,0,13,0,0,0,0,0,1,0,0,0,164,129,'7',0,0,0,'f','i','l','e', -'1','U','T',5,0,3,'A','U','O','F','U','x',0,0,'P','K',1,2,23,3,20,0,0,0,8, -0,'Z','j',179,'6',':','7','f','=',10,0,0,0,18,0,0,0,5,0,13,0,0,0,0,0,1,0, -0,0,164,129,'y',0,0,0,'f','i','l','e','2','U','T',5,0,3,172,'[','O','F','U', -'x',0,0,'P','K',5,6,0,0,0,0,3,0,3,0,191,0,0,0,187,0,0,0,0,0}; - DEFINE_TEST(test_read_format_zip) { + const char *refname = "test_read_format_zip.zip"; struct archive_entry *ae; struct archive *a; char *buff[128]; @@ -52,10 +35,11 @@ DEFINE_TEST(test_read_format_zip) size_t s; off_t o; + extract_reference_file(refname); 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, archive, sizeof(archive))); + assertA(0 == archive_read_open_filename(a, refname, 10240)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("dir/", archive_entry_pathname(ae)); assertEqualInt(1179604249, archive_entry_mtime(ae)); diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_zip.zip.uu b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_zip.zip.uu new file mode 100644 index 0000000..f61340e --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_format_zip.zip.uu @@ -0,0 +1,13 @@ +$FreeBSD$ +begin 645 test_read_format_zip.zip +M4$L#!`H``````%EFLS8````````````````$`!4`9&ER+U54"0`#&55/1AE5 +M3T95>`0`Z`/H`U!+`P04````"`!O9K,V.C=F/0H````2````!0`5`&9I;&4Q +M550)``-!54]&K%M/1E5X!`#H`^@#RTC-R<GGRD`B`5!+`P04````"`!::K,V +M.C=F/0H````2````!0`5`&9I;&4R550)``.L6T]&K%M/1E5X!`#H`^@#RTC- +MR<GGRD`B`5!+`0(7`PH``````%EFLS8````````````````$``T````````` +M$`#M00````!D:7(O550%``,954]&57@``%!+`0(7`Q0````(`&]FLS8Z-V8] +M"@```!(````%``T```````$```"D@3<```!F:6QE,554!0`#055/1E5X``!0 +M2P$"%P,4````"`!::K,V.C=F/0H````2````!0`-```````!````I(%Y```` +H9FEL93)55`4``ZQ;3T95>```4$L%!@`````#``,`OP```+L````````` +` +end diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_large.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_large.c index d034240..d034240 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_large.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_large.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_pax_truncated.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_pax_truncated.c index 5e2c9c5..5e2c9c5 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_pax_truncated.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_pax_truncated.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_position.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_position.c index 3675e11..3675e11 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_position.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_position.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_read_truncated.c b/libarchive/libarchive-2.5.5/libarchive/test/test_read_truncated.c index 726984c..726984c 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_read_truncated.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_read_truncated.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_tar_filenames.c b/libarchive/libarchive-2.5.5/libarchive/test/test_tar_filenames.c index 8b83b52..e863fbd 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_tar_filenames.c +++ b/libarchive/libarchive-2.5.5/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.8 2008/01/01 22:28:04 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_filenames.c,v 1.9 2008/05/26 17:00:24 kientzle Exp $"); /* * Exercise various lengths of filenames in tar archives, @@ -40,19 +40,22 @@ test_filename(const char *prefix, int dlen, int flen) struct archive_entry *ae; struct archive *a; size_t used; - size_t prefix_length = 0; - unsigned i = 0; + char *p; + int i; + p = filename; if (prefix) { strcpy(filename, prefix); - i = prefix_length = strlen(prefix); + p += strlen(p); } - for (; i < prefix_length + dlen; i++) - filename[i] = 'a'; - filename[i++] = '/'; - for (; i < prefix_length + dlen + flen + 1; i++) - filename[i] = 'b'; - filename[i++] = '\0'; + if (dlen > 0) { + for (i = 0; i < dlen; i++) + *p++ = 'a'; + *p++ = '/'; + } + for (i = 0; i < flen; i++) + *p++ = 'b'; + *p = '\0'; strcpy(dirname, filename); @@ -160,15 +163,22 @@ DEFINE_TEST(test_tar_filenames) int dlen, flen; /* Repeat the following for a variety of dir/file lengths. */ - for (dlen = 40; dlen < 60; dlen++) { - for (flen = 40; flen < 60; flen++) { + for (dlen = 45; dlen < 55; dlen++) { + for (flen = 45; flen < 55; flen++) { + test_filename(NULL, dlen, flen); + test_filename("/", dlen, flen); + } + } + + for (dlen = 0; dlen < 140; dlen += 10) { + for (flen = 98; flen < 102; flen++) { test_filename(NULL, dlen, flen); test_filename("/", dlen, flen); } } for (dlen = 140; dlen < 160; dlen++) { - for (flen = 90; flen < 110; flen++) { + for (flen = 95; flen < 105; flen++) { test_filename(NULL, dlen, flen); test_filename("/", dlen, flen); } diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_tar_large.c b/libarchive/libarchive-2.5.5/libarchive/test/test_tar_large.c index c675ac1..df8a139 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_tar_large.c +++ b/libarchive/libarchive-2.5.5/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: src/lib/libarchive/test/test_tar_large.c,v 1.1 2008/01/01 22:28:04 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_large.c,v 1.2 2008/05/26 17:00:24 kientzle Exp $"); #include <errno.h> #include <stdlib.h> @@ -242,6 +242,11 @@ DEFINE_TEST(test_tar_large) archive_entry_copy_pathname(ae, namebuff); archive_entry_set_mode(ae, S_IFREG | 0755); filesize = tests[i]; + + if (filesize < 0) { + skipping("32-bit off_t doesn't permit testing of very large files."); + return; + } archive_entry_set_size(ae, filesize); assertA(0 == archive_write_header(a, ae)); diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_ustar_filenames.c b/libarchive/libarchive-2.5.5/libarchive/test/test_ustar_filenames.c new file mode 100644 index 0000000..88b4b2c --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_ustar_filenames.c @@ -0,0 +1,183 @@ +/*- + * 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$"); + +/* + * Exercise various lengths of filenames in ustar archives. + */ + +static void +test_filename(const char *prefix, int dlen, int flen) +{ + char buff[8192]; + char filename[400]; + char dirname[400]; + struct archive_entry *ae; + struct archive *a; + size_t used; + int separator = 0; + int i = 0; + + if (prefix != NULL) { + strcpy(filename, prefix); + i = strlen(prefix); + } + if (dlen > 0) { + for (; i < dlen; i++) + filename[i] = 'a'; + filename[i++] = '/'; + separator = 1; + } + for (; i < dlen + flen + separator; i++) + filename[i] = 'b'; + filename[i++] = '\0'; + + strcpy(dirname, filename); + + /* 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_set_bytes_per_block(a,0)); + 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, filename); + archive_entry_set_mode(ae, S_IFREG | 0755); + failure("dlen=%d, flen=%d", dlen, flen); + if (flen > 100) { + assertEqualIntA(a, ARCHIVE_FAILED, archive_write_header(a, ae)); + } else { + assertEqualIntA(a, 0, archive_write_header(a, ae)); + } + archive_entry_free(ae); + + /* + * Write a dir to it (without trailing '/'). + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, dirname); + archive_entry_set_mode(ae, S_IFDIR | 0755); + failure("dlen=%d, flen=%d", dlen, flen); + if (flen >= 100) { + assertEqualIntA(a, ARCHIVE_FAILED, archive_write_header(a, ae)); + } else { + assertEqualIntA(a, 0, archive_write_header(a, ae)); + } + archive_entry_free(ae); + + /* Tar adds a '/' to directory names. */ + strcat(dirname, "/"); + + /* + * Write a dir to it (with trailing '/'). + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, dirname); + archive_entry_set_mode(ae, S_IFDIR | 0755); + failure("dlen=%d, flen=%d", dlen, flen); + if (flen >= 100) { + assertEqualIntA(a, ARCHIVE_FAILED, archive_write_header(a, ae)); + } else { + assertEqualIntA(a, 0, archive_write_header(a, ae)); + } + archive_entry_free(ae); + + /* Close out the archive. */ + assertA(0 == archive_write_close(a)); + assertA(0 == archive_write_finish(a)); + + /* + * Now, read the data back. + */ + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_support_format_all(a)); + assertA(0 == archive_read_support_compression_all(a)); + assertA(0 == archive_read_open_memory(a, buff, used)); + + if (flen <= 100) { + /* Read the file and check the filename. */ + assertA(0 == archive_read_next_header(a, &ae)); + failure("dlen=%d, flen=%d", dlen, flen); + assertEqualString(filename, archive_entry_pathname(ae)); + assertEqualInt((S_IFREG | 0755), archive_entry_mode(ae)); + } + + /* + * Read the two dirs and check the names. + * + * Both dirs should read back with the same name, since + * tar should add a trailing '/' to any dir that doesn't + * already have one. + */ + if (flen <= 99) { + assertA(0 == archive_read_next_header(a, &ae)); + assert((S_IFDIR | 0755) == archive_entry_mode(ae)); + failure("dlen=%d, flen=%d", dlen, flen); + assertEqualString(dirname, archive_entry_pathname(ae)); + } + + if (flen <= 99) { + assertA(0 == archive_read_next_header(a, &ae)); + assert((S_IFDIR | 0755) == archive_entry_mode(ae)); + assertEqualString(dirname, archive_entry_pathname(ae)); + } + + /* Verify the end of the archive. */ + failure("This fails if entries were written that should not have been written. dlen=%d, flen=%d", dlen, flen); + assertEqualInt(1, archive_read_next_header(a, &ae)); + assert(0 == archive_read_close(a)); + assert(0 == archive_read_finish(a)); +} + +DEFINE_TEST(test_ustar_filenames) +{ + int dlen, flen; + + /* Try a bunch of different file/dir lengths that add up + * to just a little less or a little more than 100 bytes. + * This exercises the code that splits paths between ustar + * filename and prefix fields. + */ + for (dlen = 5; dlen < 70; dlen += 5) { + for (flen = 100 - dlen - 5; flen < 100 - dlen + 5; flen++) { + test_filename(NULL, dlen, flen); + test_filename("/", dlen, flen); + } + } + + /* Probe the 100-char limit for paths with no '/'. */ + for (flen = 90; flen < 110; flen++) { + test_filename(NULL, 0, flen); + test_filename("/", dlen, flen); + } + + /* XXXX TODO Probe the 100-char limit with a dir prefix. */ + /* XXXX TODO Probe the 255-char total limit. */ +} diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_write_compress.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_compress.c new file mode 100644 index 0000000..6f8ef35 --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_compress.c @@ -0,0 +1,102 @@ +/*- + * 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 + * 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 "test.h" +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_compress.c,v 1.2 2008/03/15 11:05:49 kientzle Exp $"); + +/* + * A basic exercise of compress reading and writing. + * + * TODO: Add a reference file and make sure we can decompress that. + */ + +DEFINE_TEST(test_write_compress) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + char path[16]; + size_t used; + int i; + + buffsize = 1000000; + assert(NULL != (buff = (char *)malloc(buffsize))); + + datasize = 10000; + assert(NULL != (data = (char *)malloc(datasize))); + memset(data, 0, datasize); + + assert((a = archive_write_new()) != NULL); + assertA(0 == archive_write_set_format_ustar(a)); + assertA(0 == archive_write_set_compression_compress(a)); + assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); + + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertA(0 == archive_write_header(a, ae)); + assertA(datasize == (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + + + archive_write_close(a); +#if ARCHIVE_API_VERSION > 1 + assert(0 == archive_write_finish(a)); +#else + archive_write_finish(a); +#endif + + /* + * Now, read the data back. + */ + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_support_format_all(a)); + assertA(0 == archive_read_support_compression_all(a)); + assertA(0 == archive_read_open_memory(a, buff, used)); + + + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + assertEqualInt(0, archive_read_next_header(a, &ae)); + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt(datasize, archive_entry_size(ae)); + } + + assert(0 == archive_read_close(a)); +#if ARCHIVE_API_VERSION > 1 + assert(0 == archive_read_finish(a)); +#else + archive_read_finish(a); +#endif + + free(data); + free(buff); +} diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_compress_program.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_compress_program.c index 666bbf9..666bbf9 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_compress_program.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_compress_program.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_disk.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_disk.c index 480cf29..fe44a45 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_disk.c +++ b/libarchive/libarchive-2.5.5/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.8 2008/01/23 05:47:08 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk.c,v 1.9 2008/06/15 10:35:22 kientzle Exp $"); #if ARCHIVE_VERSION_STAMP >= 1009000 @@ -48,7 +48,11 @@ static void create(struct archive_entry *ae, const char *msg) assert(0 == stat(archive_entry_pathname(ae), &st)); failure("st.st_mode=%o archive_entry_mode(ae)=%o", st.st_mode, archive_entry_mode(ae)); - assert(st.st_mode == (archive_entry_mode(ae) & ~UMASK)); + /* When verifying a dir, ignore the S_ISGID bit, as some systems set + * that automatically. */ + if (archive_entry_filetype(ae) == AE_IFDIR) + st.st_mode &= ~S_ISGID; + assertEqualInt(st.st_mode, archive_entry_mode(ae) & ~UMASK); } static void create_reg_file(struct archive_entry *ae, const char *msg) diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_disk_hardlink.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_disk_hardlink.c index b21c44b..dda384a 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_disk_hardlink.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_disk_hardlink.c @@ -23,12 +23,16 @@ * 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 $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_hardlink.c,v 1.2 2008/05/26 17:00:24 kientzle Exp $"); #define UMASK 022 /* * Exercise hardlink recreation. + * + * File permissions are chosen so that the authoritive entry + * has the correct permission and the non-authoritive versions + * are just writeable files. */ DEFINE_TEST(test_write_disk_hardlink) { @@ -64,7 +68,7 @@ DEFINE_TEST(test_write_disk_hardlink) /* Link. */ assert((ae = archive_entry_new()) != NULL); archive_entry_copy_pathname(ae, "link1b"); - archive_entry_set_mode(ae, S_IFREG | 0755); + archive_entry_set_mode(ae, S_IFREG | 0600); archive_entry_set_size(ae, 0); archive_entry_copy_hardlink(ae, "link1a"); assertEqualIntA(ad, 0, archive_write_header(ad, ae)); @@ -80,7 +84,7 @@ DEFINE_TEST(test_write_disk_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_mode(ae, S_IFREG | 0600); 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))); @@ -106,10 +110,14 @@ DEFINE_TEST(test_write_disk_hardlink) /* 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_mode(ae, S_IFREG | 0600); archive_entry_set_size(ae, 0); assertEqualIntA(ad, 0, archive_write_header(ad, ae)); - assertEqualInt(0, archive_write_data(ad, data, sizeof(data))); +#if ARCHIVE_VERSION_NUMBER < 3000000 + assertEqualInt(ARCHIVE_WARN, archive_write_data(ad, data, 1)); +#else + assertEqualInt(-1, archive_write_data(ad, data, 1)); +#endif assertEqualIntA(ad, 0, archive_write_finish_entry(ad)); archive_entry_free(ae); diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_disk_perms.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_disk_perms.c index 4c03c75..2e872a1 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_disk_perms.c +++ b/libarchive/libarchive-2.5.5/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.8 2008/01/01 22:28:04 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_perms.c,v 1.9 2008/06/15 10:35:22 kientzle Exp $"); #if ARCHIVE_VERSION_STAMP >= 1009000 @@ -186,7 +186,7 @@ DEFINE_TEST(test_write_disk_perms) /* Check original perms. */ assert(0 == stat("dir_overwrite_0744", &st)); failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); - assert((st.st_mode & 07777) == 0744); + assert((st.st_mode & 0777) == 0744); /* Overwrite shouldn't edit perms. */ assert((ae = archive_entry_new()) != NULL); archive_entry_copy_pathname(ae, "dir_overwrite_0744"); @@ -197,7 +197,7 @@ DEFINE_TEST(test_write_disk_perms) /* Make sure they're unchanged. */ assert(0 == stat("dir_overwrite_0744", &st)); failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); - assert((st.st_mode & 07777) == 0744); + assert((st.st_mode & 0777) == 0744); /* Write a regular file with SUID bit, but don't use _EXTRACT_PERM. */ assert((ae = archive_entry_new()) != NULL); @@ -385,7 +385,7 @@ DEFINE_TEST(test_write_disk_perms) assert(0 == stat("dir_overwrite_0744", &st)); failure("dir_overwrite_0744: st.st_mode=%o", st.st_mode); - assert((st.st_mode & 07777) == 0744); + assert((st.st_mode & 0777) == 0744); assert(0 == stat("file_no_suid", &st)); failure("file_0755: st.st_mode=%o", st.st_mode); diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_disk_secure.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_disk_secure.c index 80876b4..2bcc957 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_disk_secure.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_disk_secure.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_secure.c,v 1.3 2007/07/06 15:43:11 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_secure.c,v 1.4 2008/06/15 10:35:22 kientzle Exp $"); #define UMASK 022 @@ -115,7 +115,7 @@ DEFINE_TEST(test_write_disk_secure) /* Test the entries on disk. */ assert(0 == lstat("dir", &st)); failure("dir: st.st_mode=%o", st.st_mode); - assert((st.st_mode & 07777) == 0755); + assert((st.st_mode & 0777) == 0755); assert(0 == lstat("link_to_dir", &st)); failure("link_to_dir: st.st_mode=%o", st.st_mode); @@ -137,7 +137,7 @@ DEFINE_TEST(test_write_disk_secure) failure("link_to_dir2 should have been re-created as a true dir"); assert(S_ISDIR(st.st_mode)); failure("link_to_dir2: Implicit dir creation should obey umask, but st.st_mode=%o", st.st_mode); - assert((st.st_mode & 07777) == 0755); + assert((st.st_mode & 0777) == 0755); assert(0 == lstat("link_to_dir2/filec", &st)); assert(S_ISREG(st.st_mode)); diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_ar.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_ar.c index 2de670f..a60a0cd 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_ar.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_ar.c @@ -26,11 +26,11 @@ */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_ar.c,v 1.5 2007/07/06 15:43:11 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_ar.c,v 1.7 2008/05/26 17:00:24 kientzle Exp $"); char buff[4096]; char buff2[64]; -static unsigned char strtab[] = "abcdefghijklmn.o/\nggghhhjjjrrrttt.o/\niiijjjdddsssppp.o/\n"; +static char strtab[] = "abcdefghijklmn.o/\nggghhhjjjrrrttt.o/\niiijjjdddsssppp.o/\n"; DEFINE_TEST(test_write_format_ar) { @@ -119,9 +119,7 @@ DEFINE_TEST(test_write_format_ar) assertA(0 == archive_read_next_header(a, &ae)); assertEqualInt(0, archive_entry_mtime(ae)); assertEqualString("//", archive_entry_pathname(ae)); - assertEqualInt(strlen(strtab), archive_entry_size(ae)); - assertEqualIntA(a, strlen(strtab), archive_read_data(a, buff2, 100)); - assert(0 == memcmp(buff2, strtab, strlen(strtab))); + assertEqualInt(0, archive_entry_size(ae)); assertA(0 == archive_read_next_header(a, &ae)); assert(1 == archive_entry_mtime(ae)); @@ -164,6 +162,7 @@ DEFINE_TEST(test_write_format_ar) archive_entry_set_filetype(ae, AE_IFREG); archive_entry_set_size(ae, 5); assertA(0 == archive_write_header(a, ae)); + assertA(5 == archive_entry_size(ae)); assertA(5 == archive_write_data(a, "12345", 7)); archive_entry_free(ae); diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio.c index dbb9775..dbb9775 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio_empty.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio_empty.c index 61c4921..61c4921 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio_empty.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio_empty.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio_newc.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio_newc.c index 431097b..431097b 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio_newc.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio_newc.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio_odc.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio_odc.c index e6ed7ee..e6ed7ee 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_cpio_odc.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_cpio_odc.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_shar_empty.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_shar_empty.c index c43e23b..c43e23b 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_shar_empty.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_shar_empty.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_tar.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar.c index a23d05c..a23d05c 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_tar.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar.c diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_tar_empty.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar_empty.c index 1d4d354..1d4d354 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_format_tar_empty.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar_empty.c diff --git a/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar_ustar.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar_ustar.c new file mode 100644 index 0000000..53eb07c --- /dev/null +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_format_tar_ustar.c @@ -0,0 +1,342 @@ +/*- + * 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_null(const char *p, size_t l) +{ + while (l > 0) { + if (*p != '\0') + return (0); + --l; + ++p; + } + return (1); +} + +/* Verify the contents, then erase them to NUL bytes. */ +/* Tar requires all "unused" bytes be set to NUL; this allows us + * to easily verify that by invoking is_null() over the entire header + * after verifying each field. */ +#define myAssertEqualMem(a,b,s) assertEqualMem(a, b, s); memset(a, 0, s) + +/* + * Detailed verification that 'ustar' archives are written with + * the correct format. + */ +DEFINE_TEST(test_write_format_tar_ustar) +{ + struct archive *a; + struct archive_entry *entry; + char *buff, *e; + size_t buffsize = 100000; + size_t used; + int i; + char f99[100]; + char f100[101]; + char f256[257]; + + for (i = 0; i < 99; ++i) + f99[i] = 'a' + i % 26; + f99[99] = '\0'; + + for (i = 0; i < 100; ++i) + f100[i] = 'A' + i % 26; + f100[100] = '\0'; + + for (i = 0; i < 256; ++i) + f256[i] = 'A' + i % 26; + f256[155] = '/'; + f256[256] = '\0'; + + buff = malloc(buffsize); + + /* Create a new archive in memory. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, 0, archive_write_set_format_ustar(a)); + assertEqualIntA(a, 0, archive_write_set_compression_none(a)); + assertEqualIntA(a, 0, archive_write_open_memory(a, buff, buffsize, &used)); + + /* + * Add various files to it. + * TODO: Extend this to cover more filetypes. + */ + + /* "file" with 10 bytes of content */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 1, 10); + archive_entry_set_pathname(entry, "file"); + archive_entry_set_mode(entry, S_IFREG | 0664); + archive_entry_set_size(entry, 10); + archive_entry_set_uid(entry, 80); + archive_entry_set_gid(entry, 90); + archive_entry_set_dev(entry, 12); + archive_entry_set_ino(entry, 89); + archive_entry_set_nlink(entry, 2); + assertEqualIntA(a, 0, archive_write_header(a, entry)); + archive_entry_free(entry); + assertEqualIntA(a, 10, archive_write_data(a, "1234567890", 10)); + + /* Hardlink to "file" with 10 bytes of content */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 1, 10); + archive_entry_set_pathname(entry, "linkfile"); + archive_entry_set_mode(entry, S_IFREG | 0664); + /* TODO: Put this back and fix the bug. */ + /* archive_entry_set_size(entry, 10); */ + archive_entry_set_uid(entry, 80); + archive_entry_set_gid(entry, 90); + archive_entry_set_dev(entry, 12); + archive_entry_set_ino(entry, 89); + archive_entry_set_nlink(entry, 2); + assertEqualIntA(a, 0, archive_write_header(a, entry)); + archive_entry_free(entry); + /* Write of data to dir should fail == zero bytes get written. */ + assertEqualIntA(a, 0, archive_write_data(a, "1234567890", 10)); + + /* "dir" */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 2, 20); + archive_entry_set_pathname(entry, "dir"); + archive_entry_set_mode(entry, S_IFDIR | 0775); + archive_entry_set_size(entry, 10); + archive_entry_set_nlink(entry, 2); + assertEqualIntA(a, 0, archive_write_header(a, entry)); + archive_entry_free(entry); + /* Write of data to dir should fail == zero bytes get written. */ + assertEqualIntA(a, 0, archive_write_data(a, "1234567890", 10)); + + /* "symlink" pointing to "file" */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 3, 30); + archive_entry_set_pathname(entry, "symlink"); + archive_entry_set_mode(entry, S_IFLNK | 0664); + archive_entry_set_symlink(entry,"file"); + archive_entry_set_size(entry, 0); + archive_entry_set_uid(entry, 88); + archive_entry_set_gid(entry, 98); + archive_entry_set_dev(entry, 12); + archive_entry_set_ino(entry, 90); + archive_entry_set_nlink(entry, 1); + assertEqualIntA(a, 0, archive_write_header(a, entry)); + archive_entry_free(entry); + /* Write of data to symlink should fail == zero bytes get written. */ + assertEqualIntA(a, 0, archive_write_data(a, "1234567890", 10)); + + /* file with 99-char filename. */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 1, 10); + archive_entry_set_pathname(entry, f99); + archive_entry_set_mode(entry, S_IFREG | 0664); + archive_entry_set_size(entry, 0); + archive_entry_set_uid(entry, 82); + archive_entry_set_gid(entry, 93); + archive_entry_set_dev(entry, 102); + archive_entry_set_ino(entry, 7); + archive_entry_set_nlink(entry, 1); + assertEqualIntA(a, 0, archive_write_header(a, entry)); + archive_entry_free(entry); + + /* file with 100-char filename. */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 1, 10); + archive_entry_set_pathname(entry, f100); + archive_entry_set_mode(entry, S_IFREG | 0664); + archive_entry_set_size(entry, 0); + archive_entry_set_uid(entry, 82); + archive_entry_set_gid(entry, 93); + archive_entry_set_dev(entry, 102); + archive_entry_set_ino(entry, 7); + archive_entry_set_nlink(entry, 1); + assertEqualIntA(a, 0, archive_write_header(a, entry)); + archive_entry_free(entry); + + /* file with 256-char filename. */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 1, 10); + archive_entry_set_pathname(entry, f256); + archive_entry_set_mode(entry, S_IFREG | 0664); + archive_entry_set_size(entry, 0); + archive_entry_set_uid(entry, 82); + archive_entry_set_gid(entry, 93); + archive_entry_set_dev(entry, 102); + archive_entry_set_ino(entry, 7); + archive_entry_set_nlink(entry, 1); + assertEqualIntA(a, 0, archive_write_header(a, entry)); + archive_entry_free(entry); + + assert(0 == archive_write_finish(a)); + + /* + * Verify the archive format. + */ + e = buff; + + /* "file" */ + myAssertEqualMem(e + 0, "file", 5); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000120 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000132 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000012 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000001 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "010034\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "0", 1); /* linkflag */ + myAssertEqualMem(e + 157, "", 1); /* linkname */ + myAssertEqualMem(e + 257, "ustar\000000", 8); /* signature/version */ + myAssertEqualMem(e + 265, "", 1); /* uname */ + myAssertEqualMem(e + 297, "", 1); /* gname */ + myAssertEqualMem(e + 329, "000000 ", 8); /* devmajor */ + myAssertEqualMem(e + 337, "000000 ", 8); /* devminor */ + myAssertEqualMem(e + 345, "", 1); /* prefix */ + assert(is_null(e + 0, 512)); + myAssertEqualMem(e + 512, "1234567890", 10); + assert(is_null(e + 512, 512)); + e += 1024; + + /* hardlink to "file" */ + myAssertEqualMem(e + 0, "linkfile", 9); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000120 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000132 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000001 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "010707\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "0", 1); /* linkflag */ + myAssertEqualMem(e + 157, "", 1); /* linkname */ + myAssertEqualMem(e + 257, "ustar\000000", 8); /* signature/version */ + myAssertEqualMem(e + 265, "", 1); /* uname */ + myAssertEqualMem(e + 297, "", 1); /* gname */ + myAssertEqualMem(e + 329, "000000 ", 8); /* devmajor */ + myAssertEqualMem(e + 337, "000000 ", 8); /* devminor */ + myAssertEqualMem(e + 345, "", 1); /* prefix */ + assert(is_null(e + 0, 512)); + e += 512; + + /* "dir" */ + myAssertEqualMem(e + 0, "dir/", 4); /* Filename */ + myAssertEqualMem(e + 100, "000775 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000000 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000000 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000002 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "007747\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "5", 1); /* typeflag */ + myAssertEqualMem(e + 157, "", 1); /* linkname */ + myAssertEqualMem(e + 257, "ustar\000000", 8); /* signature/version */ + myAssertEqualMem(e + 265, "", 1); /* uname */ + myAssertEqualMem(e + 297, "", 1); /* gname */ + myAssertEqualMem(e + 329, "000000 ", 8); /* devmajor */ + myAssertEqualMem(e + 337, "000000 ", 8); /* devminor */ + myAssertEqualMem(e + 345, "", 1); /* prefix */ + assert(is_null(e + 0, 512)); + e += 512; + + /* "symlink" pointing to "file" */ + myAssertEqualMem(e + 0, "symlink", 8); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000130 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000142 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000003 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "011446\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "2", 1); /* linkflag */ + myAssertEqualMem(e + 157, "file", 5); /* linkname */ + myAssertEqualMem(e + 257, "ustar\000000", 8); /* signature/version */ + myAssertEqualMem(e + 265, "", 1); /* uname */ + myAssertEqualMem(e + 297, "", 1); /* gname */ + myAssertEqualMem(e + 329, "000000 ", 8); /* devmajor */ + myAssertEqualMem(e + 337, "000000 ", 8); /* devminor */ + myAssertEqualMem(e + 345, "", 1); /* prefix */ + assert(is_null(e + 0, 512)); + e += 512; + + /* File with 99-char filename */ + myAssertEqualMem(e + 0, f99, 100); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000122 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000135 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000001 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "034242\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "0", 1); /* linkflag */ + myAssertEqualMem(e + 157, "", 1); /* linkname */ + myAssertEqualMem(e + 257, "ustar\000000", 8); /* signature/version */ + myAssertEqualMem(e + 265, "", 1); /* uname */ + myAssertEqualMem(e + 297, "", 1); /* gname */ + myAssertEqualMem(e + 329, "000000 ", 8); /* devmajor */ + myAssertEqualMem(e + 337, "000000 ", 8); /* devminor */ + myAssertEqualMem(e + 345, "", 1); /* prefix */ + assert(is_null(e + 0, 512)); + e += 512; + + /* File with 100-char filename */ + myAssertEqualMem(e + 0, f100, 100); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000122 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000135 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000001 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "026230\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "0", 1); /* linkflag */ + myAssertEqualMem(e + 157, "", 1); /* linkname */ + myAssertEqualMem(e + 257, "ustar\000000", 8); /* signature/version */ + myAssertEqualMem(e + 265, "", 1); /* uname */ + myAssertEqualMem(e + 297, "", 1); /* gname */ + myAssertEqualMem(e + 329, "000000 ", 8); /* devmajor */ + myAssertEqualMem(e + 337, "000000 ", 8); /* devminor */ + myAssertEqualMem(e + 345, "", 1); /* prefix */ + assert(is_null(e + 0, 512)); + e += 512; + + /* File with 256-char filename */ + myAssertEqualMem(e + 0, f256 + 156, 100); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000122 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000135 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000001 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "055570\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "0", 1); /* linkflag */ + myAssertEqualMem(e + 157, "", 1); /* linkname */ + myAssertEqualMem(e + 257, "ustar\000000", 8); /* signature/version */ + myAssertEqualMem(e + 265, "", 1); /* uname */ + myAssertEqualMem(e + 297, "", 1); /* gname */ + myAssertEqualMem(e + 329, "000000 ", 8); /* devmajor */ + myAssertEqualMem(e + 337, "000000 ", 8); /* devminor */ + myAssertEqualMem(e + 345, f256, 155); /* prefix */ + assert(is_null(e + 0, 512)); + e += 512; + + /* TODO: Verify other types of entries. */ + + /* Last entry is end-of-archive marker. */ + assert(is_null(e, 1024)); + e += 1024; + + assertEqualInt(used, e - buff); + + free(buff); +} diff --git a/libarchive/libarchive-2.4.17/libarchive/test/test_write_open_memory.c b/libarchive/libarchive-2.5.5/libarchive/test/test_write_open_memory.c index 2e58fff..2e58fff 100644 --- a/libarchive/libarchive-2.4.17/libarchive/test/test_write_open_memory.c +++ b/libarchive/libarchive-2.5.5/libarchive/test/test_write_open_memory.c diff --git a/libarchive/libarchive-2.4.17/tar/bsdtar.1 b/libarchive/libarchive-2.5.5/tar/bsdtar.1 index ec22160..e790d60 100644 --- a/libarchive/libarchive-2.4.17/tar/bsdtar.1 +++ b/libarchive/libarchive-2.5.5/tar/bsdtar.1 @@ -22,9 +22,9 @@ .\" 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.37 2008/01/22 07:23:44 kientzle Exp $ +.\" $FreeBSD: src/usr.bin/tar/bsdtar.1,v 1.43 2008/05/26 17:10:10 kientzle Exp $ .\" -.Dd April 13, 2004 +.Dd May 15, 2008 .Dt BSDTAR 1 .Os .Sh NAME @@ -147,13 +147,19 @@ but before extracting entries from the archive. .It Fl -check-links ( Fl W Cm check-links ) (c and r modes only) Issue a warning message unless all links to each file are archived. +.It Fl -chroot ( Fl W Cm chroot ) +(x mode only) +.Fn chroot +to the current directory after processing any +.Fl C +options and before extracting any files. .It Fl -exclude Ar pattern ( Fl W Cm exclude Ns = Ns Ar pattern ) 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 ) -(c mode only) +(c, r, u mode only) Use the specified format for the created archive. Supported formats include .Dq cpio , @@ -164,6 +170,8 @@ and Other formats may also be supported; see .Xr libarchive-formats 5 for more information about currently-supported formats. +In r and u modes, when extending an existing archive, the format specified +here must be compatible with the format of the existing archive on disk. .It Fl f Ar file Read the archive from or write the archive to the specified file. The filename can be @@ -174,15 +182,6 @@ If not specified, the default tape device will be used. .Fx , the default tape device is .Pa /dev/sa0 . ) -.It Fl -fast-read ( Fl W Cm 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. .It Fl H (c and r mode only) Symbolic links named on the command line will be followed; the @@ -226,6 +225,10 @@ automatically when reading archives. 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 -keep-newer-files ( Fl W Cm keep-newer-files ) +(x mode only) +Do not overwrite existing files that are newer than the +versions appearing in the archive being extracted. .It Fl L (c and r mode only) All symbolic links will be followed. @@ -275,6 +278,10 @@ This is often used to read filenames output by the .Fl print0 option to .Xr find 1 . +.It Fl -numeric-owner +(x mode only) +Ignore symbolic user and group names when restoring archives to disk, +only numeric uid and gid values will be obeyed. .It Fl O (x, t modes only) In extract (-x) mode, files will be written to standard out rather than @@ -282,7 +289,7 @@ being extracted to disk. In list (-t) mode, the file listing will be written to stderr rather than the usual stdout. .It Fl o -(x mode only) +(x mode) 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 @@ -291,6 +298,10 @@ 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 o +(c, r, u mode) +A synonym for +.Fl -format Ar ustar .It Fl -one-file-system ( Fl W Cm one-file-system ) (c, r, and u modes) Do not cross mount points. @@ -319,12 +330,43 @@ If is being run by root, the default is to restore the owner unless the .Fl o option is also specified. +.It Fl q ( Fl -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. +.It Fl S +(x mode only) +Extract files as sparse files. +For every block on disk, check first if it contains only NULL bytes and seek +over it otherwise. +This works similiar to the conv=sparse option of dd. .It Fl -strip-components Ar count ( Fl W Cm strip-components Ns = Ns Ar 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 inclusion/exclusion patterns but before security checks. +.It Fl s Ar pattern +Modify file or archive member names according to +.Pa pattern . +The pattern has the format /old/new/[gps]. +old is a basic regular expression. +If it doesn't apply, the pattern is skipped. +new is the replacement string of the matched part. +~ is substituted with the match, \1 to \9 with the content of +the corresponding captured group. +The optional trailing g specifies that matching should continue +after the matched part and stopped on the first unmatched pattern. +The optional trailing s specifies that the pattern applies to the value +of symbolic links. +The optional trailing p specifies that after a successful substitution +the original path name and the new path name should be printed to +standard error. .It Fl T Ar filename In x or t mode, .Nm @@ -405,6 +447,15 @@ Note that, unlike other .Nm tar implementations, this implementation recognizes gzip compression automatically when reading archives. +.It Fl Z +(c mode only) +Compress the resulting archive with +.Xr compress 1 . +In extract or list modes, this option is ignored. +Note that, unlike other +.Nm tar +implementations, this implementation recognizes compress compression +automatically when reading archives. .El .Sh ENVIRONMENT The following environment variables affect the execution of @@ -487,6 +538,16 @@ directory and add .Pa foo2 to the output archive. .Pp +An input file in +.Xr mtree 5 +format can be used to create an output archive with arbitrary ownership, +permissions, or names that differ from existing data on disk: +.Pp +.Dl $ cat input.mtree +.Dl usr/bin uid=0 gid=0 mode=0755 type=dir +.Dl usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls +.Dl $ tar -cvf output.tar @input.mtree +.Pp The .Fl -newer and @@ -628,6 +689,7 @@ an archive while preserving any absolute pathnames, components, or symlinks to other directories. .Sh SEE ALSO .Xr bzip2 1 , +.Xr compress 1 , .Xr cpio 1 , .Xr gzip 1 , .Xr mt 1 , diff --git a/libarchive/libarchive-2.4.17/tar/bsdtar.c b/libarchive/libarchive-2.5.5/tar/bsdtar.c index fbc66c1..1c13cc6 100644 --- a/libarchive/libarchive-2.4.17/tar/bsdtar.c +++ b/libarchive/libarchive-2.5.5/tar/bsdtar.c @@ -24,7 +24,7 @@ */ #include "bsdtar_platform.h" -__FBSDID("$FreeBSD: src/usr.bin/tar/bsdtar.c,v 1.79 2008/01/22 07:23:44 kientzle Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/bsdtar.c,v 1.91 2008/05/26 17:10:10 kientzle Exp $"); #ifdef HAVE_SYS_PARAM_H #include <sys/param.h> @@ -118,7 +118,7 @@ static void version(void); * non-option. Otherwise, GNU getopt() permutes the arguments and * screws up -C processing. */ -static const char *tar_opts = "+Bb:C:cf:HhI:jkLlmnOoPprtT:UuvW:wX:xyZz"; +static const char *tar_opts = "+Bb:C:cf:HhI:jkLlmnOoPprts:ST:UuvW:wX:xyZz"; /* * Most of these long options are deliberately not documented. They @@ -136,12 +136,13 @@ static const char *tar_opts = "+Bb:C:cf:HhI:jkLlmnOoPprtT:UuvW:wX:xyZz"; /* Fake short equivalents for long options that otherwise lack them. */ enum { - OPTION_CHECK_LINKS=1, + OPTION_CHECK_LINKS = 1, + OPTION_CHROOT, OPTION_EXCLUDE, - OPTION_FAST_READ, OPTION_FORMAT, OPTION_HELP, OPTION_INCLUDE, + OPTION_KEEP_NEWER_FILES, OPTION_NEWER_CTIME, OPTION_NEWER_CTIME_THAN, OPTION_NEWER_MTIME, @@ -150,6 +151,7 @@ enum { OPTION_NO_SAME_OWNER, OPTION_NO_SAME_PERMISSIONS, OPTION_NULL, + OPTION_NUMERIC_OWNER, OPTION_ONE_FILE_SYSTEM, OPTION_POSIX, OPTION_STRIP_COMPONENTS, @@ -171,6 +173,8 @@ static const struct option tar_longopts[] = { { "bzip2", no_argument, NULL, 'j' }, { "cd", required_argument, NULL, 'C' }, { "check-links", no_argument, NULL, OPTION_CHECK_LINKS }, + { "chroot", no_argument, NULL, OPTION_CHROOT }, + { "compress", no_argument, NULL, 'Z' }, { "confirmation", no_argument, NULL, 'w' }, { "create", no_argument, NULL, 'c' }, { "dereference", no_argument, NULL, 'L' }, @@ -178,7 +182,7 @@ static const struct option tar_longopts[] = { { "exclude", required_argument, NULL, OPTION_EXCLUDE }, { "exclude-from", required_argument, NULL, 'X' }, { "extract", no_argument, NULL, 'x' }, - { "fast-read", no_argument, NULL, OPTION_FAST_READ }, + { "fast-read", no_argument, NULL, 'q' }, { "file", required_argument, NULL, 'f' }, { "files-from", required_argument, NULL, 'T' }, { "format", required_argument, NULL, OPTION_FORMAT }, @@ -187,6 +191,8 @@ static const struct option tar_longopts[] = { { "help", no_argument, NULL, OPTION_HELP }, { "include", required_argument, NULL, OPTION_INCLUDE }, { "interactive", no_argument, NULL, 'w' }, + { "insecure", no_argument, NULL, 'P' }, + { "keep-newer-files", no_argument, NULL, OPTION_KEEP_NEWER_FILES }, { "keep-old-files", no_argument, NULL, 'k' }, { "list", no_argument, NULL, 't' }, { "modification-time", no_argument, NULL, 'm' }, @@ -202,6 +208,7 @@ static const struct option tar_longopts[] = { { "no-same-owner", no_argument, NULL, OPTION_NO_SAME_OWNER }, { "no-same-permissions",no_argument, NULL, OPTION_NO_SAME_PERMISSIONS }, { "null", no_argument, NULL, OPTION_NULL }, + { "numeric-owner", no_argument, NULL, OPTION_NUMERIC_OWNER }, { "one-file-system", no_argument, NULL, OPTION_ONE_FILE_SYSTEM }, { "posix", no_argument, NULL, OPTION_POSIX }, { "preserve-permissions", no_argument, NULL, 'p' }, @@ -210,6 +217,7 @@ static const struct option tar_longopts[] = { { "strip-components", required_argument, NULL, OPTION_STRIP_COMPONENTS }, { "to-stdout", no_argument, NULL, 'O' }, { "totals", no_argument, NULL, OPTION_TOTALS }, + { "uncompress", no_argument, NULL, 'Z' }, { "unlink", no_argument, NULL, 'U' }, { "unlink-first", no_argument, NULL, 'U' }, { "update", no_argument, NULL, 'u' }, @@ -321,6 +329,9 @@ main(int argc, char **argv) case OPTION_CHECK_LINKS: /* GNU tar */ bsdtar->option_warn_links = 1; break; + case OPTION_CHROOT: /* NetBSD */ + bsdtar->option_chroot = 1; + break; case OPTION_EXCLUDE: /* GNU tar */ if (exclude(bsdtar, optarg)) bsdtar_errc(bsdtar, 1, 0, @@ -334,9 +345,6 @@ main(int argc, char **argv) if (strcmp(bsdtar->filename, "-") == 0) bsdtar->filename = NULL; break; - case OPTION_FAST_READ: /* GNU tar */ - bsdtar->option_fast_read = 1; - break; case 'H': /* BSD convention */ bsdtar->symlink_mode = 'H'; break; @@ -388,6 +396,9 @@ main(int argc, char **argv) case 'k': /* GNU tar */ bsdtar->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE; break; + case OPTION_KEEP_NEWER_FILES: /* GNU tar */ + bsdtar->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; + break; case 'L': /* BSD convention */ bsdtar->symlink_mode = 'L'; break; @@ -451,6 +462,9 @@ main(int argc, char **argv) case OPTION_NULL: /* GNU tar */ bsdtar->option_null++; break; + case OPTION_NUMERIC_OWNER: /* GNU tar */ + bsdtar->option_numeric_owner++; + break; case 'O': /* GNU tar */ bsdtar->option_stdout = 1; break; @@ -484,9 +498,23 @@ main(int argc, char **argv) case OPTION_POSIX: /* GNU tar */ bsdtar->create_format = "pax"; break; + case 'q': /* FreeBSD GNU tar --fast-read, NetBSD -q */ + bsdtar->option_fast_read = 1; + break; case 'r': /* SUSv2 */ set_mode(bsdtar, opt); break; + case 'S': /* NetBSD pax-as-tar */ + bsdtar->extract_flags |= ARCHIVE_EXTRACT_SPARSE; + break; + case 's': /* NetBSD pax-as-tar */ +#if HAVE_REGEX_H + add_substitution(bsdtar, optarg); +#else + bsdtar_warnc(bsdtar, 0, "-s is not supported by this version of bsdtar"); + usage(bsdtar); +#endif + break; case OPTION_STRIP_COMPONENTS: /* GNU tar 1.15 */ bsdtar->strip_components = atoi(optarg); break; @@ -625,17 +653,13 @@ main(int argc, char **argv) only_mode(bsdtar, "--check-links", "cr"); /* Check other parameters only permitted in certain modes. */ - if (bsdtar->create_compression == 'Z' && bsdtar->mode == 'c') { - bsdtar_warnc(bsdtar, 0, ".Z compression not supported"); - usage(bsdtar); - } if (bsdtar->create_compression != '\0') { strcpy(buff, "-?"); buff[1] = bsdtar->create_compression; only_mode(bsdtar, buff, "cxt"); } if (bsdtar->create_format != NULL) - only_mode(bsdtar, "--format", "c"); + only_mode(bsdtar, "--format", "cru"); if (bsdtar->symlink_mode != '\0') { strcpy(buff, "-?"); buff[1] = bsdtar->symlink_mode; @@ -666,6 +690,10 @@ main(int argc, char **argv) } cleanup_exclusions(bsdtar); +#if HAVE_REGEX_H + cleanup_substitution(bsdtar); +#endif + if (bsdtar->return_value != 0) bsdtar_warnc(bsdtar, 0, "Error exit delayed from previous errors."); @@ -718,8 +746,8 @@ rewrite_argv(struct bsdtar *bsdtar, int *argc, char **src_argv, const char *p; char *src, *dest; - if (src_argv[0] == NULL || - src_argv[1] == NULL || src_argv[1][0] == '-') + if (src_argv[0] == NULL || src_argv[1] == NULL || + src_argv[1][0] == '-' || src_argv[1][0] == '\0') return (src_argv); *argc += strlen(src_argv[1]) - 1; @@ -785,7 +813,7 @@ version(void) printf("bsdtar %s - %s\n", BSDTAR_VERSION_STRING, archive_version()); - exit(1); + exit(0); } static const char *long_help_msg = diff --git a/libarchive/libarchive-2.4.17/tar/bsdtar.h b/libarchive/libarchive-2.5.5/tar/bsdtar.h index fb10678..4153a44 100644 --- a/libarchive/libarchive-2.4.17/tar/bsdtar.h +++ b/libarchive/libarchive-2.5.5/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.29 2008/01/02 00:21:27 kientzle Exp $ + * $FreeBSD: src/usr.bin/tar/bsdtar.h,v 1.33 2008/05/26 17:10:10 kientzle Exp $ */ #include "bsdtar_platform.h" @@ -57,6 +57,7 @@ struct bsdtar { char create_compression; /* j, y, or z */ const char *compress_program; char option_absolute_paths; /* -P */ + char option_chroot; /* --chroot */ char option_dont_traverse_mounts; /* --one-file-system */ char option_fast_read; /* --fast-read */ char option_honor_nodump; /* --nodump */ @@ -64,6 +65,7 @@ struct bsdtar { char option_no_owner; /* -o */ char option_no_subdirs; /* -n */ char option_null; /* --null */ + char option_numeric_owner; /* --numeric-owner */ char option_stdout; /* -O */ char option_totals; /* --totals */ char option_unlink_first; /* -U */ @@ -89,12 +91,14 @@ struct bsdtar { * Data for various subsystems. Full definitions are located in * the file where they are used. */ + struct archive_entry_linkresolver *resolver; struct archive_dir *archive_dir; /* for write.c */ struct name_cache *gname_cache; /* for write.c */ - struct links_cache *links_cache; /* for write.c */ struct matching *matching; /* for matching.c */ struct security *security; /* for read.c */ struct name_cache *uname_cache; /* for write.c */ + struct siginfo_data *siginfo; /* for siginfo.c */ + struct substitution *substitution; /* for subst.c */ }; void bsdtar_errc(struct bsdtar *, int _eval, int _code, @@ -113,12 +117,23 @@ int process_lines(struct bsdtar *bsdtar, const char *pathname, int (*process)(struct bsdtar *, const char *)); void safe_fprintf(FILE *, const char *fmt, ...); void set_chdir(struct bsdtar *, const char *newdir); +void siginfo_init(struct bsdtar *); +void siginfo_setinfo(struct bsdtar *, const char * oper, + const char * path, int64_t size); +void siginfo_printinfo(struct bsdtar *, off_t progress); +void siginfo_done(struct bsdtar *); void tar_mode_c(struct bsdtar *bsdtar); void tar_mode_r(struct bsdtar *bsdtar); void tar_mode_t(struct bsdtar *bsdtar); void tar_mode_u(struct bsdtar *bsdtar); void tar_mode_x(struct bsdtar *bsdtar); int unmatched_inclusions(struct bsdtar *bsdtar); +int unmatched_inclusions_warn(struct bsdtar *bsdtar, const char *msg); void usage(struct bsdtar *); int yes(const char *fmt, ...); +#if HAVE_REGEX_H +void add_substitution(struct bsdtar *, const char *); +int apply_substitution(struct bsdtar *, const char *, char **, int); +void cleanup_substitution(struct bsdtar *); +#endif diff --git a/libarchive/libarchive-2.4.17/tar/bsdtar_platform.h b/libarchive/libarchive-2.5.5/tar/bsdtar_platform.h index ccb9d3c..ccb9d3c 100644 --- a/libarchive/libarchive-2.4.17/tar/bsdtar_platform.h +++ b/libarchive/libarchive-2.5.5/tar/bsdtar_platform.h diff --git a/libarchive/libarchive-2.5.5/tar/getdate.c b/libarchive/libarchive-2.5.5/tar/getdate.c new file mode 100644 index 0000000..895320b --- /dev/null +++ b/libarchive/libarchive-2.5.5/tar/getdate.c @@ -0,0 +1,2344 @@ +/* A Bison parser, made by GNU Bison 2.1. */ + +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + tAGO = 258, + tDAY = 259, + tDAYZONE = 260, + tAMPM = 261, + tMONTH = 262, + tMONTH_UNIT = 263, + tSEC_UNIT = 264, + tUNUMBER = 265, + tZONE = 266, + tDST = 267 + }; +#endif +/* Tokens. */ +#define tAGO 258 +#define tDAY 259 +#define tDAYZONE 260 +#define tAMPM 261 +#define tMONTH 262 +#define tMONTH_UNIT 263 +#define tSEC_UNIT 264 +#define tUNUMBER 265 +#define tZONE 266 +#define tDST 267 + + + + +/* Copy the first part of user declarations. */ +#line 1 "getdate.y" + +/* + * March 2005: Further modified and simplified by Tim Kientzle: + * Eliminate minutes-based calculations (just do everything in + * seconds), have lexer only recognize unsigned integers (handle '+' + * and '-' characters in grammar), combine tables into one table with + * explicit abbreviation notes, do am/pm adjustments in the grammar + * (eliminate some state variables and post-processing). Among other + * things, these changes eliminated two shift/reduce conflicts. (Went + * from 10 to 8.) + * All of Tim Kientzle's changes to this file are public domain. + */ + +/* +** Originally written by Steven M. Bellovin <smb@research.att.com> while +** at the University of North Carolina at Chapel Hill. Later tweaked by +** a couple of people on Usenet. Completely overhauled by Rich $alz +** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990; +** +** This grammar has 10 shift/reduce conflicts. +** +** This code is in the public domain and has no copyright. +*/ +/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */ +/* SUPPRESS 288 on yyerrlab *//* Label unused */ + +#ifdef __FreeBSD__ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD: src/usr.bin/tar/getdate.y,v 1.9 2007/07/20 01:27:50 kientzle Exp $"); +#endif + +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +#define yyparse getdate_yyparse +#define yylex getdate_yylex +#define yyerror getdate_yyerror + +static int yyparse(void); +static int yylex(void); +static int yyerror(const char *); + +time_t get_date(char *); + +#define EPOCH 1970 +#define HOUR(x) ((time_t)(x) * 60) +#define SECSPERDAY (24L * 60L * 60L) + +/* +** Daylight-savings mode: on, off, or not yet known. +*/ +typedef enum _DSTMODE { + DSTon, DSToff, DSTmaybe +} DSTMODE; + +/* +** Meridian: am or pm. +*/ +enum { tAM, tPM }; + +/* +** Global variables. We could get rid of most of these by using a good +** union as the yacc stack. (This routine was originally written before +** yacc had the %union construct.) Maybe someday; right now we only use +** the %union very rarely. +*/ +static char *yyInput; + +static DSTMODE yyDSTmode; +static time_t yyDayOrdinal; +static time_t yyDayNumber; +static int yyHaveDate; +static int yyHaveDay; +static int yyHaveRel; +static int yyHaveTime; +static int yyHaveZone; +static time_t yyTimezone; +static time_t yyDay; +static time_t yyHour; +static time_t yyMinutes; +static time_t yyMonth; +static time_t yySeconds; +static time_t yyYear; +static time_t yyRelMonth; +static time_t yyRelSeconds; + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 92 "getdate.y" +typedef union YYSTYPE { + time_t Number; +} YYSTYPE; +/* Line 196 of yacc.c. */ +#line 204 "tar/getdate.c" +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 219 of yacc.c. */ +#line 216 "tar/getdate.c" + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca +# if defined (__STDC__) || defined (__cplusplus) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# define YYINCLUDED_STDLIB_H +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) +# endif +# ifdef __cplusplus +extern "C" { +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifdef __cplusplus +} +# endif +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short int yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined (__GNUC__) && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 2 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 50 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 18 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 11 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 41 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 59 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 267 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 13, 16, 14, 2, 17, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 15, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned char yyprhs[] = +{ + 0, 0, 3, 4, 7, 9, 11, 13, 15, 17, + 19, 22, 24, 27, 31, 35, 39, 45, 47, 49, + 52, 54, 57, 60, 64, 70, 76, 82, 85, 90, + 93, 97, 100, 102, 106, 110, 113, 115, 119, 123, + 126, 128 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yysigned_char yyrhs[] = +{ + 19, 0, -1, -1, 19, 20, -1, 21, -1, 23, + -1, 25, -1, 24, -1, 26, -1, 28, -1, 10, + 6, -1, 22, -1, 22, 6, -1, 22, 13, 10, + -1, 22, 14, 10, -1, 10, 15, 10, -1, 10, + 15, 10, 15, 10, -1, 11, -1, 5, -1, 11, + 12, -1, 4, -1, 4, 16, -1, 10, 4, -1, + 10, 17, 10, -1, 10, 17, 10, 17, 10, -1, + 10, 14, 10, 14, 10, -1, 10, 14, 7, 14, + 10, -1, 7, 10, -1, 7, 10, 16, 10, -1, + 10, 7, -1, 10, 7, 10, -1, 27, 3, -1, + 27, -1, 14, 10, 9, -1, 13, 10, 9, -1, + 10, 9, -1, 9, -1, 14, 10, 8, -1, 13, + 10, 8, -1, 10, 8, -1, 8, -1, 10, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short int yyrline[] = +{ + 0, 104, 104, 105, 108, 109, 110, 111, 112, 113, + 116, 126, 129, 136, 141, 148, 153, 160, 164, 168, + 174, 178, 183, 190, 195, 214, 220, 233, 238, 244, + 249, 257, 261, 264, 268, 272, 276, 280, 284, 288, + 292, 298 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "tAGO", "tDAY", "tDAYZONE", "tAMPM", + "tMONTH", "tMONTH_UNIT", "tSEC_UNIT", "tUNUMBER", "tZONE", "tDST", "'+'", + "'-'", "':'", "','", "'/'", "$accept", "spec", "item", "time", + "bare_time", "zone", "day", "date", "rel", "relunit", "number", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short int yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 43, 45, 58, 44, 47 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = +{ + 0, 18, 19, 19, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 22, 22, 23, 23, 23, + 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, + 25, 26, 26, 27, 27, 27, 27, 27, 27, 27, + 27, 28 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, + 2, 1, 2, 3, 3, 3, 5, 1, 1, 2, + 1, 2, 2, 3, 5, 5, 5, 2, 4, 2, + 3, 2, 1, 3, 3, 2, 1, 3, 3, 2, + 1, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned char yydefact[] = +{ + 2, 0, 1, 20, 18, 0, 40, 36, 41, 17, + 0, 0, 3, 4, 11, 5, 7, 6, 8, 32, + 9, 21, 27, 22, 10, 29, 39, 35, 0, 0, + 0, 19, 0, 0, 12, 0, 0, 31, 0, 30, + 0, 0, 15, 23, 38, 34, 37, 33, 13, 14, + 28, 0, 0, 0, 0, 26, 25, 16, 24 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yysigned_char yydefgoto[] = +{ + -1, 1, 12, 13, 14, 15, 16, 17, 18, 19, + 20 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -8 +static const yysigned_char yypact[] = +{ + -8, 0, -8, 14, -8, 2, -8, -8, 11, 15, + 19, 21, -8, -8, 10, -8, -8, -8, -8, 29, + -8, -8, 17, -8, -8, 24, -8, -8, -4, 25, + 26, -8, -7, 13, -8, 27, 28, -8, 30, -8, + 31, 32, 33, 22, -8, -8, -8, -8, -8, -8, + -8, 34, 37, 39, 40, -8, -8, -8, -8 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yysigned_char yypgoto[] = +{ + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const unsigned char yytable[] = +{ + 2, 44, 45, 40, 3, 4, 41, 5, 6, 7, + 8, 9, 22, 10, 11, 23, 34, 24, 25, 26, + 27, 46, 47, 35, 36, 28, 29, 31, 30, 32, + 21, 33, 37, 38, 39, 42, 43, 48, 49, 54, + 50, 0, 0, 0, 55, 51, 52, 56, 53, 57, + 58 +}; + +static const yysigned_char yycheck[] = +{ + 0, 8, 9, 7, 4, 5, 10, 7, 8, 9, + 10, 11, 10, 13, 14, 4, 6, 6, 7, 8, + 9, 8, 9, 13, 14, 14, 15, 12, 17, 10, + 16, 10, 3, 16, 10, 10, 10, 10, 10, 17, + 10, -1, -1, -1, 10, 14, 14, 10, 15, 10, + 10 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const unsigned char yystos[] = +{ + 0, 19, 0, 4, 5, 7, 8, 9, 10, 11, + 13, 14, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 16, 10, 4, 6, 7, 8, 9, 14, 15, + 17, 12, 10, 10, 6, 13, 14, 3, 16, 10, + 7, 10, 10, 10, 8, 9, 8, 9, 10, 10, + 10, 14, 14, 15, 17, 10, 10, 10, 10 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_stack_print (short int *bottom, short int *top) +#else +static void +yy_stack_print (bottom, top) + short int *bottom; + short int *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_reduce_print (int yyrule) +#else +static void +yy_reduce_print (yyrule) + int yyrule; +#endif +{ + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif +{ + const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; +} +# endif +# endif + +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +#endif /* YYERROR_VERBOSE */ + + + +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); +} + +#endif /* ! YYDEBUG */ +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM); +# else +int yyparse (); +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int +yyparse (void) +#else +int +yyparse () + ; +#endif +#endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + short int *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK (yyvsp--, yyssp--) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short int *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + short int *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a look-ahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to look-ahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; + + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 4: +#line 108 "getdate.y" + { yyHaveTime++; } + break; + + case 5: +#line 109 "getdate.y" + { yyHaveZone++; } + break; + + case 6: +#line 110 "getdate.y" + { yyHaveDate++; } + break; + + case 7: +#line 111 "getdate.y" + { yyHaveDay++; } + break; + + case 8: +#line 112 "getdate.y" + { yyHaveRel++; } + break; + + case 10: +#line 116 "getdate.y" + { + /* "7am" */ + yyHour = (yyvsp[-1].Number); + if (yyHour == 12) + yyHour = 0; + yyMinutes = 0; + yySeconds = 0; + if ((yyvsp[0].Number) == tPM) + yyHour += 12; + } + break; + + case 11: +#line 126 "getdate.y" + { + /* "7:12:18" "19:17" */ + } + break; + + case 12: +#line 129 "getdate.y" + { + /* "7:12pm", "12:20:13am" */ + if (yyHour == 12) + yyHour = 0; + if ((yyvsp[0].Number) == tPM) + yyHour += 12; + } + break; + + case 13: +#line 136 "getdate.y" + { + /* "7:14+0700" */ + yyDSTmode = DSToff; + yyTimezone = - ((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60); + } + break; + + case 14: +#line 141 "getdate.y" + { + /* "19:14:12-0530" */ + yyDSTmode = DSToff; + yyTimezone = + ((yyvsp[0].Number) % 100 + ((yyvsp[0].Number) / 100) * 60); + } + break; + + case 15: +#line 148 "getdate.y" + { + yyHour = (yyvsp[-2].Number); + yyMinutes = (yyvsp[0].Number); + yySeconds = 0; + } + break; + + case 16: +#line 153 "getdate.y" + { + yyHour = (yyvsp[-4].Number); + yyMinutes = (yyvsp[-2].Number); + yySeconds = (yyvsp[0].Number); + } + break; + + case 17: +#line 160 "getdate.y" + { + yyTimezone = (yyvsp[0].Number); + yyDSTmode = DSToff; + } + break; + + case 18: +#line 164 "getdate.y" + { + yyTimezone = (yyvsp[0].Number); + yyDSTmode = DSTon; + } + break; + + case 19: +#line 168 "getdate.y" + { + yyTimezone = (yyvsp[-1].Number); + yyDSTmode = DSTon; + } + break; + + case 20: +#line 174 "getdate.y" + { + yyDayOrdinal = 1; + yyDayNumber = (yyvsp[0].Number); + } + break; + + case 21: +#line 178 "getdate.y" + { + /* "tue," "wednesday," */ + yyDayOrdinal = 1; + yyDayNumber = (yyvsp[-1].Number); + } + break; + + case 22: +#line 183 "getdate.y" + { + /* "second tues" "3 wed" */ + yyDayOrdinal = (yyvsp[-1].Number); + yyDayNumber = (yyvsp[0].Number); + } + break; + + case 23: +#line 190 "getdate.y" + { + /* "1/15" */ + yyMonth = (yyvsp[-2].Number); + yyDay = (yyvsp[0].Number); + } + break; + + case 24: +#line 195 "getdate.y" + { + if ((yyvsp[-4].Number) >= 13) { + /* First number is big: 2004/01/29, 99/02/17 */ + yyYear = (yyvsp[-4].Number); + yyMonth = (yyvsp[-2].Number); + yyDay = (yyvsp[0].Number); + } else if (((yyvsp[0].Number) >= 13) || ((yyvsp[-2].Number) >= 13)) { + /* Last number is big: 01/07/98 */ + /* Middle number is big: 01/29/04 */ + yyMonth = (yyvsp[-4].Number); + yyDay = (yyvsp[-2].Number); + yyYear = (yyvsp[0].Number); + } else { + /* No significant clues: 02/03/04 */ + yyMonth = (yyvsp[-4].Number); + yyDay = (yyvsp[-2].Number); + yyYear = (yyvsp[0].Number); + } + } + break; + + case 25: +#line 214 "getdate.y" + { + /* ISO 8601 format. yyyy-mm-dd. */ + yyYear = (yyvsp[-4].Number); + yyMonth = (yyvsp[-2].Number); + yyDay = (yyvsp[0].Number); + } + break; + + case 26: +#line 220 "getdate.y" + { + if ((yyvsp[-4].Number) > 31) { + /* e.g. 1992-Jun-17 */ + yyYear = (yyvsp[-4].Number); + yyMonth = (yyvsp[-2].Number); + yyDay = (yyvsp[0].Number); + } else { + /* e.g. 17-JUN-1992. */ + yyDay = (yyvsp[-4].Number); + yyMonth = (yyvsp[-2].Number); + yyYear = (yyvsp[0].Number); + } + } + break; + + case 27: +#line 233 "getdate.y" + { + /* "May 3" */ + yyMonth = (yyvsp[-1].Number); + yyDay = (yyvsp[0].Number); + } + break; + + case 28: +#line 238 "getdate.y" + { + /* "June 17, 2001" */ + yyMonth = (yyvsp[-3].Number); + yyDay = (yyvsp[-2].Number); + yyYear = (yyvsp[0].Number); + } + break; + + case 29: +#line 244 "getdate.y" + { + /* "12 Sept" */ + yyDay = (yyvsp[-1].Number); + yyMonth = (yyvsp[0].Number); + } + break; + + case 30: +#line 249 "getdate.y" + { + /* "12 Sept 1997" */ + yyDay = (yyvsp[-2].Number); + yyMonth = (yyvsp[-1].Number); + yyYear = (yyvsp[0].Number); + } + break; + + case 31: +#line 257 "getdate.y" + { + yyRelSeconds = -yyRelSeconds; + yyRelMonth = -yyRelMonth; + } + break; + + case 33: +#line 264 "getdate.y" + { + /* "-3 hours" */ + yyRelSeconds -= (yyvsp[-1].Number) * (yyvsp[0].Number); + } + break; + + case 34: +#line 268 "getdate.y" + { + /* "+1 minute" */ + yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number); + } + break; + + case 35: +#line 272 "getdate.y" + { + /* "1 day" */ + yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number); + } + break; + + case 36: +#line 276 "getdate.y" + { + /* "hour" */ + yyRelSeconds += (yyvsp[0].Number); + } + break; + + case 37: +#line 280 "getdate.y" + { + /* "-3 months" */ + yyRelMonth -= (yyvsp[-1].Number) * (yyvsp[0].Number); + } + break; + + case 38: +#line 284 "getdate.y" + { + /* "+5 years" */ + yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number); + } + break; + + case 39: +#line 288 "getdate.y" + { + /* "2 years" */ + yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number); + } + break; + + case 40: +#line 292 "getdate.y" + { + /* "6 months" */ + yyRelMonth += (yyvsp[0].Number); + } + break; + + case 41: +#line 298 "getdate.y" + { + if (yyHaveTime && yyHaveDate && !yyHaveRel) + yyYear = (yyvsp[0].Number); + else { + if((yyvsp[0].Number)>10000) { + /* "20040301" */ + yyHaveDate++; + yyDay= ((yyvsp[0].Number))%100; + yyMonth= ((yyvsp[0].Number)/100)%100; + yyYear = (yyvsp[0].Number)/10000; + } + else { + /* "513" is same as "5:13" */ + yyHaveTime++; + if ((yyvsp[0].Number) < 100) { + yyHour = (yyvsp[0].Number); + yyMinutes = 0; + } + else { + yyHour = (yyvsp[0].Number) / 100; + yyMinutes = (yyvsp[0].Number) % 100; + } + yySeconds = 0; + } + } + } + break; + + + default: break; + } + +/* Line 1126 of yacc.c. */ +#line 1590 "tar/getdate.c" + + yyvsp -= yylen; + yyssp -= yylen; + + + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + char *yymsg = 0; +# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +#if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +#endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + + if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yymsg; + int yyi = 0; + while ((*yyp = *yyf)) + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + { + yyerror (YY_("syntax error")); + goto yyexhaustedlab; + } + } + else +#endif /* YYERROR_VERBOSE */ + yyerror (YY_("syntax error")); + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (0) + goto yyerrorlab; + +yyvsp -= yylen; + yyssp -= yylen; + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", yystos[yystate], yyvsp); + YYPOPSTACK; + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK; + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + return yyresult; +} + + +#line 327 "getdate.y" + + +static struct TABLE { + size_t abbrev; + const char *name; + int type; + time_t value; +} const TimeWords[] = { + /* am/pm */ + { 0, "am", tAMPM, tAM }, + { 0, "pm", tAMPM, tPM }, + + /* Month names. */ + { 3, "january", tMONTH, 1 }, + { 3, "february", tMONTH, 2 }, + { 3, "march", tMONTH, 3 }, + { 3, "april", tMONTH, 4 }, + { 3, "may", tMONTH, 5 }, + { 3, "june", tMONTH, 6 }, + { 3, "july", tMONTH, 7 }, + { 3, "august", tMONTH, 8 }, + { 3, "september", tMONTH, 9 }, + { 3, "october", tMONTH, 10 }, + { 3, "november", tMONTH, 11 }, + { 3, "december", tMONTH, 12 }, + + /* Days of the week. */ + { 2, "sunday", tDAY, 0 }, + { 3, "monday", tDAY, 1 }, + { 2, "tuesday", tDAY, 2 }, + { 3, "wednesday", tDAY, 3 }, + { 2, "thursday", tDAY, 4 }, + { 2, "friday", tDAY, 5 }, + { 2, "saturday", tDAY, 6 }, + + /* Timezones: Offsets are in minutes. */ + { 0, "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */ + { 0, "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */ + { 0, "utc", tZONE, HOUR( 0) }, + { 0, "wet", tZONE, HOUR( 0) }, /* Western European */ + { 0, "bst", tDAYZONE, HOUR( 0) }, /* British Summer */ + { 0, "wat", tZONE, HOUR( 1) }, /* West Africa */ + { 0, "at", tZONE, HOUR( 2) }, /* Azores */ + /* { 0, "bst", tZONE, HOUR( 3) }, */ /* Brazil Standard: Conflict */ + /* { 0, "gst", tZONE, HOUR( 3) }, */ /* Greenland Standard: Conflict*/ + { 0, "nft", tZONE, HOUR(3)+30 }, /* Newfoundland */ + { 0, "nst", tZONE, HOUR(3)+30 }, /* Newfoundland Standard */ + { 0, "ndt", tDAYZONE, HOUR(3)+30 }, /* Newfoundland Daylight */ + { 0, "ast", tZONE, HOUR( 4) }, /* Atlantic Standard */ + { 0, "adt", tDAYZONE, HOUR( 4) }, /* Atlantic Daylight */ + { 0, "est", tZONE, HOUR( 5) }, /* Eastern Standard */ + { 0, "edt", tDAYZONE, HOUR( 5) }, /* Eastern Daylight */ + { 0, "cst", tZONE, HOUR( 6) }, /* Central Standard */ + { 0, "cdt", tDAYZONE, HOUR( 6) }, /* Central Daylight */ + { 0, "mst", tZONE, HOUR( 7) }, /* Mountain Standard */ + { 0, "mdt", tDAYZONE, HOUR( 7) }, /* Mountain Daylight */ + { 0, "pst", tZONE, HOUR( 8) }, /* Pacific Standard */ + { 0, "pdt", tDAYZONE, HOUR( 8) }, /* Pacific Daylight */ + { 0, "yst", tZONE, HOUR( 9) }, /* Yukon Standard */ + { 0, "ydt", tDAYZONE, HOUR( 9) }, /* Yukon Daylight */ + { 0, "hst", tZONE, HOUR(10) }, /* Hawaii Standard */ + { 0, "hdt", tDAYZONE, HOUR(10) }, /* Hawaii Daylight */ + { 0, "cat", tZONE, HOUR(10) }, /* Central Alaska */ + { 0, "ahst", tZONE, HOUR(10) }, /* Alaska-Hawaii Standard */ + { 0, "nt", tZONE, HOUR(11) }, /* Nome */ + { 0, "idlw", tZONE, HOUR(12) }, /* Intl Date Line West */ + { 0, "cet", tZONE, -HOUR(1) }, /* Central European */ + { 0, "met", tZONE, -HOUR(1) }, /* Middle European */ + { 0, "mewt", tZONE, -HOUR(1) }, /* Middle European Winter */ + { 0, "mest", tDAYZONE, -HOUR(1) }, /* Middle European Summer */ + { 0, "swt", tZONE, -HOUR(1) }, /* Swedish Winter */ + { 0, "sst", tDAYZONE, -HOUR(1) }, /* Swedish Summer */ + { 0, "fwt", tZONE, -HOUR(1) }, /* French Winter */ + { 0, "fst", tDAYZONE, -HOUR(1) }, /* French Summer */ + { 0, "eet", tZONE, -HOUR(2) }, /* Eastern Eur, USSR Zone 1 */ + { 0, "bt", tZONE, -HOUR(3) }, /* Baghdad, USSR Zone 2 */ + { 0, "it", tZONE, -HOUR(3)-30 },/* Iran */ + { 0, "zp4", tZONE, -HOUR(4) }, /* USSR Zone 3 */ + { 0, "zp5", tZONE, -HOUR(5) }, /* USSR Zone 4 */ + { 0, "ist", tZONE, -HOUR(5)-30 },/* Indian Standard */ + { 0, "zp6", tZONE, -HOUR(6) }, /* USSR Zone 5 */ + /* { 0, "nst", tZONE, -HOUR(6.5) }, */ /* North Sumatra: Conflict */ + /* { 0, "sst", tZONE, -HOUR(7) }, */ /* So Sumatra, USSR 6: Conflict */ + { 0, "wast", tZONE, -HOUR(7) }, /* West Australian Standard */ + { 0, "wadt", tDAYZONE, -HOUR(7) }, /* West Australian Daylight */ + { 0, "jt", tZONE, -HOUR(7)-30 },/* Java (3pm in Cronusland!)*/ + { 0, "cct", tZONE, -HOUR(8) }, /* China Coast, USSR Zone 7 */ + { 0, "jst", tZONE, -HOUR(9) }, /* Japan Std, USSR Zone 8 */ + { 0, "cast", tZONE, -HOUR(9)-30 },/* Central Australian Std */ + { 0, "cadt", tDAYZONE, -HOUR(9)-30 },/* Central Australian Daylt */ + { 0, "east", tZONE, -HOUR(10) }, /* Eastern Australian Std */ + { 0, "eadt", tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylt */ + { 0, "gst", tZONE, -HOUR(10) }, /* Guam Std, USSR Zone 9 */ + { 0, "nzt", tZONE, -HOUR(12) }, /* New Zealand */ + { 0, "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */ + { 0, "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */ + { 0, "idle", tZONE, -HOUR(12) }, /* Intl Date Line East */ + + { 0, "dst", tDST, 0 }, + + /* Time units. */ + { 4, "years", tMONTH_UNIT, 12 }, + { 5, "months", tMONTH_UNIT, 1 }, + { 9, "fortnights", tSEC_UNIT, 14 * 24 * 60 * 60 }, + { 4, "weeks", tSEC_UNIT, 7 * 24 * 60 * 60 }, + { 3, "days", tSEC_UNIT, 1 * 24 * 60 * 60 }, + { 4, "hours", tSEC_UNIT, 60 * 60 }, + { 3, "minutes", tSEC_UNIT, 60 }, + { 3, "seconds", tSEC_UNIT, 1 }, + + /* Relative-time words. */ + { 0, "tomorrow", tSEC_UNIT, 1 * 24 * 60 * 60 }, + { 0, "yesterday", tSEC_UNIT, -1 * 24 * 60 * 60 }, + { 0, "today", tSEC_UNIT, 0 }, + { 0, "now", tSEC_UNIT, 0 }, + { 0, "last", tUNUMBER, -1 }, + { 0, "this", tSEC_UNIT, 0 }, + { 0, "next", tUNUMBER, 2 }, + { 0, "first", tUNUMBER, 1 }, + { 0, "1st", tUNUMBER, 1 }, +/* { 0, "second", tUNUMBER, 2 }, */ + { 0, "2nd", tUNUMBER, 2 }, + { 0, "third", tUNUMBER, 3 }, + { 0, "3rd", tUNUMBER, 3 }, + { 0, "fourth", tUNUMBER, 4 }, + { 0, "4th", tUNUMBER, 4 }, + { 0, "fifth", tUNUMBER, 5 }, + { 0, "5th", tUNUMBER, 5 }, + { 0, "sixth", tUNUMBER, 6 }, + { 0, "seventh", tUNUMBER, 7 }, + { 0, "eighth", tUNUMBER, 8 }, + { 0, "ninth", tUNUMBER, 9 }, + { 0, "tenth", tUNUMBER, 10 }, + { 0, "eleventh", tUNUMBER, 11 }, + { 0, "twelfth", tUNUMBER, 12 }, + { 0, "ago", tAGO, 1 }, + + /* Military timezones. */ + { 0, "a", tZONE, HOUR( 1) }, + { 0, "b", tZONE, HOUR( 2) }, + { 0, "c", tZONE, HOUR( 3) }, + { 0, "d", tZONE, HOUR( 4) }, + { 0, "e", tZONE, HOUR( 5) }, + { 0, "f", tZONE, HOUR( 6) }, + { 0, "g", tZONE, HOUR( 7) }, + { 0, "h", tZONE, HOUR( 8) }, + { 0, "i", tZONE, HOUR( 9) }, + { 0, "k", tZONE, HOUR( 10) }, + { 0, "l", tZONE, HOUR( 11) }, + { 0, "m", tZONE, HOUR( 12) }, + { 0, "n", tZONE, HOUR(- 1) }, + { 0, "o", tZONE, HOUR(- 2) }, + { 0, "p", tZONE, HOUR(- 3) }, + { 0, "q", tZONE, HOUR(- 4) }, + { 0, "r", tZONE, HOUR(- 5) }, + { 0, "s", tZONE, HOUR(- 6) }, + { 0, "t", tZONE, HOUR(- 7) }, + { 0, "u", tZONE, HOUR(- 8) }, + { 0, "v", tZONE, HOUR(- 9) }, + { 0, "w", tZONE, HOUR(-10) }, + { 0, "x", tZONE, HOUR(-11) }, + { 0, "y", tZONE, HOUR(-12) }, + { 0, "z", tZONE, HOUR( 0) }, + + /* End of table. */ + { 0, NULL, 0, 0 } +}; + + + + +/* ARGSUSED */ +static int +yyerror(const char *s) +{ + (void)s; + return 0; +} + +static time_t +ToSeconds(time_t Hours, time_t Minutes, time_t Seconds) +{ + if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59) + return -1; + if (Hours < 0 || Hours > 23) + return -1; + return (Hours * 60L + Minutes) * 60L + Seconds; +} + + +/* Year is either + * A number from 0 to 99, which means a year from 1970 to 2069, or + * The actual year (>=100). */ +static time_t +Convert(time_t Month, time_t Day, time_t Year, + time_t Hours, time_t Minutes, time_t Seconds, DSTMODE DSTmode) +{ + static int DaysInMonth[12] = { + 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 + }; + time_t tod; + time_t Julian; + int i; + + if (Year < 69) + Year += 2000; + else if (Year < 100) + Year += 1900; + DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) + ? 29 : 28; + /* Checking for 2038 bogusly assumes that time_t is 32 bits. But + I'm too lazy to try to check for time_t overflow in another way. */ + if (Year < EPOCH || Year > 2038 + || Month < 1 || Month > 12 + /* Lint fluff: "conversion from long may lose accuracy" */ + || Day < 1 || Day > DaysInMonth[(int)--Month]) + return -1; + + Julian = Day - 1; + for (i = 0; i < Month; i++) + Julian += DaysInMonth[i]; + for (i = EPOCH; i < Year; i++) + Julian += 365 + (i % 4 == 0); + Julian *= SECSPERDAY; + Julian += yyTimezone * 60L; + if ((tod = ToSeconds(Hours, Minutes, Seconds)) < 0) + return -1; + Julian += tod; + if (DSTmode == DSTon + || (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst)) + Julian -= 60 * 60; + return Julian; +} + + +static time_t +DSTcorrect(time_t Start, time_t Future) +{ + time_t StartDay; + time_t FutureDay; + + StartDay = (localtime(&Start)->tm_hour + 1) % 24; + FutureDay = (localtime(&Future)->tm_hour + 1) % 24; + return (Future - Start) + (StartDay - FutureDay) * 60L * 60L; +} + + +static time_t +RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber) +{ + struct tm *tm; + time_t now; + + now = Start; + tm = localtime(&now); + now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7); + now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1); + return DSTcorrect(Start, now); +} + + +static time_t +RelativeMonth(time_t Start, time_t RelMonth) +{ + struct tm *tm; + time_t Month; + time_t Year; + + if (RelMonth == 0) + return 0; + tm = localtime(&Start); + Month = 12 * (tm->tm_year + 1900) + tm->tm_mon + RelMonth; + Year = Month / 12; + Month = Month % 12 + 1; + return DSTcorrect(Start, + Convert(Month, (time_t)tm->tm_mday, Year, + (time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec, + DSTmaybe)); +} + +static int +yylex(void) +{ + char c; + char buff[64]; + + for ( ; ; ) { + while (isspace((unsigned char)*yyInput)) + yyInput++; + + /* Skip parenthesized comments. */ + if (*yyInput == '(') { + int Count = 0; + do { + c = *yyInput++; + if (c == '\0') + return c; + if (c == '(') + Count++; + else if (c == ')') + Count--; + } while (Count > 0); + continue; + } + + /* Try the next token in the word table first. */ + /* This allows us to match "2nd", for example. */ + { + char *src = yyInput; + const struct TABLE *tp; + unsigned i = 0; + + /* Force to lowercase and strip '.' characters. */ + while (*src != '\0' + && (isalnum((unsigned char)*src) || *src == '.') + && i < sizeof(buff)-1) { + if (*src != '.') { + if (isupper((unsigned char)*src)) + buff[i++] = tolower((unsigned char)*src); + else + buff[i++] = *src; + } + src++; + } + buff[i++] = '\0'; + + /* + * Find the first match. If the word can be + * abbreviated, make sure we match at least + * the minimum abbreviation. + */ + for (tp = TimeWords; tp->name; tp++) { + size_t abbrev = tp->abbrev; + if (abbrev == 0) + abbrev = strlen(tp->name); + if (strlen(buff) >= abbrev + && strncmp(tp->name, buff, strlen(buff)) + == 0) { + /* Skip over token. */ + yyInput = src; + /* Return the match. */ + yylval.Number = tp->value; + return tp->type; + } + } + } + + /* + * Not in the word table, maybe it's a number. Note: + * Because '-' and '+' have other special meanings, I + * don't deal with signed numbers here. + */ + if (isdigit((unsigned char)(c = *yyInput))) { + for (yylval.Number = 0; isdigit((unsigned char)(c = *yyInput++)); ) + yylval.Number = 10 * yylval.Number + c - '0'; + yyInput--; + return (tUNUMBER); + } + + return (*yyInput++); + } +} + +#define TM_YEAR_ORIGIN 1900 + +/* Yield A - B, measured in seconds. */ +static long +difftm (struct tm *a, struct tm *b) +{ + int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); + int by = b->tm_year + (TM_YEAR_ORIGIN - 1); + int days = ( + /* difference in day of year */ + a->tm_yday - b->tm_yday + /* + intervening leap days */ + + ((ay >> 2) - (by >> 2)) + - (ay/100 - by/100) + + ((ay/100 >> 2) - (by/100 >> 2)) + /* + difference in years * 365 */ + + (long)(ay-by) * 365 + ); + return (60*(60*(24*days + (a->tm_hour - b->tm_hour)) + + (a->tm_min - b->tm_min)) + + (a->tm_sec - b->tm_sec)); +} + +time_t +get_date(char *p) +{ + struct tm *tm; + struct tm gmt, *gmt_ptr; + time_t Start; + time_t tod; + time_t nowtime; + long tzone; + + memset(&gmt, 0, sizeof(gmt)); + yyInput = p; + + (void)time (&nowtime); + + gmt_ptr = gmtime (&nowtime); + if (gmt_ptr != NULL) { + /* Copy, in case localtime and gmtime use the same buffer. */ + gmt = *gmt_ptr; + } + + if (! (tm = localtime (&nowtime))) + return -1; + + if (gmt_ptr != NULL) + tzone = difftm (&gmt, tm) / 60; + else + /* This system doesn't understand timezones; fake it. */ + tzone = 0; + if(tm->tm_isdst) + tzone += 60; + + yyYear = tm->tm_year + 1900; + yyMonth = tm->tm_mon + 1; + yyDay = tm->tm_mday; + yyTimezone = tzone; + yyDSTmode = DSTmaybe; + yyHour = 0; + yyMinutes = 0; + yySeconds = 0; + yyRelSeconds = 0; + yyRelMonth = 0; + yyHaveDate = 0; + yyHaveDay = 0; + yyHaveRel = 0; + yyHaveTime = 0; + yyHaveZone = 0; + + if (yyparse() + || yyHaveTime > 1 || yyHaveZone > 1 + || yyHaveDate > 1 || yyHaveDay > 1) + return -1; + + if (yyHaveDate || yyHaveTime || yyHaveDay) { + Start = Convert(yyMonth, yyDay, yyYear, + yyHour, yyMinutes, yySeconds, yyDSTmode); + if (Start < 0) + return -1; + } else { + Start = nowtime; + if (!yyHaveRel) + Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) + tm->tm_sec; + } + + Start += yyRelSeconds; + Start += RelativeMonth(Start, yyRelMonth); + + if (yyHaveDay && !yyHaveDate) { + tod = RelativeDate(Start, yyDayOrdinal, yyDayNumber); + Start += tod; + } + + /* Have to do *something* with a legitimate -1 so it's + * distinguishable from the error return value. (Alternately + * could set errno on error.) */ + return Start == -1 ? 0 : Start; +} + + +#if defined(TEST) + +/* ARGSUSED */ +int +main(int argc, char **argv) +{ + time_t d; + + while (*++argv != NULL) { + (void)printf("Input: %s\n", *argv); + d = get_date(*argv); + if (d == -1) + (void)printf("Bad format - couldn't convert.\n"); + else + (void)printf("Output: %s\n", ctime(&d)); + } + exit(0); + /* NOTREACHED */ +} +#endif /* defined(TEST) */ + + diff --git a/libarchive/libarchive-2.4.17/tar/getdate.y b/libarchive/libarchive-2.5.5/tar/getdate.y index 3253f6d..3253f6d 100644 --- a/libarchive/libarchive-2.4.17/tar/getdate.y +++ b/libarchive/libarchive-2.5.5/tar/getdate.y diff --git a/libarchive/libarchive-2.4.17/tar/matching.c b/libarchive/libarchive-2.5.5/tar/matching.c index f0ca0c9..952055f 100644 --- a/libarchive/libarchive-2.4.17/tar/matching.c +++ b/libarchive/libarchive-2.5.5/tar/matching.c @@ -24,7 +24,7 @@ */ #include "bsdtar_platform.h" -__FBSDID("$FreeBSD: src/usr.bin/tar/matching.c,v 1.11 2007/03/11 10:36:42 kientzle Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/matching.c,v 1.13 2008/05/26 17:10:10 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -157,7 +157,7 @@ excluded(struct bsdtar *bsdtar, const char *pathname) */ if (match->matches == 0) { match->matches++; - matching->inclusions_unmatched_count++; + matching->inclusions_unmatched_count--; return (0); } /* @@ -259,6 +259,29 @@ unmatched_inclusions(struct bsdtar *bsdtar) } +int +unmatched_inclusions_warn(struct bsdtar *bsdtar, const char *msg) +{ + struct matching *matching; + struct match *p; + + matching = bsdtar->matching; + if (matching == NULL) + return (0); + + p = matching->inclusions; + while (p != NULL) { + if (p->matches == 0) { + bsdtar->return_value = 1; + bsdtar_warnc(bsdtar, 0, "%s: %s", + p->pattern, msg); + } + p = p->next; + } + return (matching->inclusions_unmatched_count); +} + + #if defined(HAVE_FNMATCH) && defined(HAVE_FNM_LEADING_DIR) diff --git a/libarchive/libarchive-2.4.17/tar/read.c b/libarchive/libarchive-2.5.5/tar/read.c index edda317..fbb8253 100644 --- a/libarchive/libarchive-2.4.17/tar/read.c +++ b/libarchive/libarchive-2.5.5/tar/read.c @@ -24,7 +24,7 @@ */ #include "bsdtar_platform.h" -__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.35 2008/01/02 00:21:27 kientzle Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.38 2008/05/26 17:10:10 kientzle Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -77,12 +77,28 @@ void tar_mode_t(struct bsdtar *bsdtar) { read_archive(bsdtar, 't'); + unmatched_inclusions_warn(bsdtar, "Not found in archive"); } void tar_mode_x(struct bsdtar *bsdtar) { + /* We want to catch SIGINFO and SIGUSR1. */ + siginfo_init(bsdtar); + read_archive(bsdtar, 'x'); + + unmatched_inclusions_warn(bsdtar, "Not found in archive"); + /* Restore old SIGINFO + SIGUSR1 handlers. */ + siginfo_done(bsdtar); +} + +static void +progress_func(void * cookie) +{ + struct bsdtar * bsdtar = cookie; + + siginfo_printinfo(bsdtar, 0); } /* @@ -118,6 +134,23 @@ read_archive(struct bsdtar *bsdtar, char mode) archive_error_string(a)); do_chdir(bsdtar); + + if (mode == 'x') { + /* Set an extract callback so that we can handle SIGINFO. */ + archive_read_extract_set_progress_callback(a, progress_func, + bsdtar); + } + + if (mode == 'x' && bsdtar->option_chroot) { +#if HAVE_CHROOT + if (chroot(".") != 0) + bsdtar_errc(bsdtar, 1, errno, "Can't chroot to \".\""); +#else + bsdtar_errc(bsdtar, 1, 0, + "chroot isn't supported on this platform"); +#endif + } + for (;;) { /* Support --fast-read option */ if (bsdtar->option_fast_read && @@ -139,6 +172,11 @@ read_archive(struct bsdtar *bsdtar, char mode) if (r == ARCHIVE_FATAL) break; + if (bsdtar->option_numeric_owner) { + archive_entry_set_uname(entry, NULL); + archive_entry_set_gname(entry, NULL); + } + /* * Exclude entries that are too old. */ @@ -227,6 +265,12 @@ read_archive(struct bsdtar *bsdtar, char mode) archive_entry_pathname(entry)); fflush(stderr); } + + /* Tell the SIGINFO-handler code what we're doing. */ + siginfo_setinfo(bsdtar, "extracting", + archive_entry_pathname(entry), 0); + siginfo_printinfo(bsdtar, 0); + if (bsdtar->option_stdout) r = archive_read_data_into_fd(a, 1); else @@ -344,7 +388,7 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry) if (abs(tim - now) > (365/2)*86400) fmt = bsdtar->day_first ? "%e %b %Y" : "%b %e %Y"; else - fmt = bsdtar->day_first ? "%e %b %R" : "%b %e %R"; + fmt = bsdtar->day_first ? "%e %b %H:%M" : "%b %e %H:%M"; strftime(tmp, sizeof(tmp), fmt, localtime(&tim)); fprintf(out, " %s ", tmp); safe_fprintf(out, "%s", archive_entry_pathname(entry)); diff --git a/libarchive/libarchive-2.5.5/tar/siginfo.c b/libarchive/libarchive-2.5.5/tar/siginfo.c new file mode 100644 index 0000000..249ee34 --- /dev/null +++ b/libarchive/libarchive-2.5.5/tar/siginfo.c @@ -0,0 +1,147 @@ +/*- + * Copyright 2008 Colin Percival + * 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 "bsdtar_platform.h" +__FBSDID("$FreeBSD: src/usr.bin/tar/siginfo.c,v 1.2 2008/05/22 21:08:36 cperciva Exp $"); + +#include <errno.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "bsdtar.h" + +/* Is there a pending SIGINFO or SIGUSR1? */ +static volatile sig_atomic_t siginfo_received = 0; + +struct siginfo_data { + /* What sort of operation are we doing? */ + char * oper; + + /* What path are we handling? */ + char * path; + + /* How large is the archive entry? */ + int64_t size; + + /* Old signal handlers. */ +#ifdef SIGINFO + void (*siginfo_old)(int); +#endif + void (*sigusr1_old)(int); +}; + +static void siginfo_handler(int sig); + +/* Handler for SIGINFO / SIGUSR1. */ +static void +siginfo_handler(int sig) +{ + + (void)sig; /* UNUSED */ + + /* Record that SIGINFO or SIGUSR1 has been received. */ + siginfo_received = 1; +} + +void +siginfo_init(struct bsdtar *bsdtar) +{ + + /* Allocate space for internal structure. */ + if ((bsdtar->siginfo = malloc(sizeof(struct siginfo_data))) == NULL) + bsdtar_errc(bsdtar, 1, errno, "malloc failed"); + + /* Set the strings to NULL so that free() is safe. */ + bsdtar->siginfo->path = bsdtar->siginfo->oper = NULL; + +#ifdef SIGINFO + /* We want to catch SIGINFO, if it exists. */ + bsdtar->siginfo->siginfo_old = signal(SIGINFO, siginfo_handler); +#endif + /* ... and treat SIGUSR1 the same way as SIGINFO. */ + bsdtar->siginfo->sigusr1_old = signal(SIGUSR1, siginfo_handler); +} + +void +siginfo_setinfo(struct bsdtar *bsdtar, const char * oper, const char * path, + int64_t size) +{ + + /* Free old operation and path strings. */ + free(bsdtar->siginfo->oper); + free(bsdtar->siginfo->path); + + /* Duplicate strings and store entry size. */ + if ((bsdtar->siginfo->oper = strdup(oper)) == NULL) + bsdtar_errc(bsdtar, 1, errno, "Cannot strdup"); + if ((bsdtar->siginfo->path = strdup(path)) == NULL) + bsdtar_errc(bsdtar, 1, errno, "Cannot strdup"); + bsdtar->siginfo->size = size; +} + +void +siginfo_printinfo(struct bsdtar *bsdtar, off_t progress) +{ + + /* If there's a signal to handle and we know what we're doing... */ + if ((siginfo_received == 1) && + (bsdtar->siginfo->path != NULL) && + (bsdtar->siginfo->oper != NULL)) { + if (bsdtar->verbose) + fprintf(stderr, "\n"); + if (bsdtar->siginfo->size > 0) { + safe_fprintf(stderr, "%s %s (%ju / %" PRId64 ")", + bsdtar->siginfo->oper, bsdtar->siginfo->path, + (uintmax_t)progress, bsdtar->siginfo->size); + } else { + safe_fprintf(stderr, "%s %s", + bsdtar->siginfo->oper, bsdtar->siginfo->path); + } + if (!bsdtar->verbose) + fprintf(stderr, "\n"); + siginfo_received = 0; + } +} + +void +siginfo_done(struct bsdtar *bsdtar) +{ + +#ifdef SIGINFO + /* Restore old SIGINFO handler. */ + signal(SIGINFO, bsdtar->siginfo->siginfo_old); +#endif + /* And the old SIGUSR1 handler, too. */ + signal(SIGUSR1, bsdtar->siginfo->sigusr1_old); + + /* Free strings. */ + free(bsdtar->siginfo->path); + free(bsdtar->siginfo->oper); + + /* Free internal data structure. */ + free(bsdtar->siginfo); +} diff --git a/libarchive/libarchive-2.5.5/tar/subst.c b/libarchive/libarchive-2.5.5/tar/subst.c new file mode 100644 index 0000000..1c32fb0 --- /dev/null +++ b/libarchive/libarchive-2.5.5/tar/subst.c @@ -0,0 +1,287 @@ +/*- + * Copyright (c) 2008 Joerg Sonnenberger + * 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 "bsdtar_platform.h" +__FBSDID("$FreeBSD: src/usr.bin/tar/subst.c,v 1.4 2008/06/15 10:08:16 kientzle Exp $"); + +#if HAVE_REGEX_H +#include "bsdtar.h" + +#include <errno.h> +#include <regex.h> +#include <stdlib.h> +#include <string.h> + +#ifndef REG_BASIC +#define REG_BASIC 0 +#endif + +struct subst_rule { + struct subst_rule *next; + regex_t re; + char *result; + unsigned int global:1, print:1, symlink:1; +}; + +struct substitution { + struct subst_rule *first_rule, *last_rule; +}; + +static void +init_substitution(struct bsdtar *bsdtar) +{ + struct substitution *subst; + + bsdtar->substitution = subst = malloc(sizeof(*subst)); + if (subst == NULL) + bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + subst->first_rule = subst->last_rule = NULL; +} + +void +add_substitution(struct bsdtar *bsdtar, const char *rule_text) +{ + struct subst_rule *rule; + struct substitution *subst; + const char *end_pattern, *start_subst; + char *pattern; + int r; + + if ((subst = bsdtar->substitution) == NULL) { + init_substitution(bsdtar); + subst = bsdtar->substitution; + } + + rule = malloc(sizeof(*rule)); + if (rule == NULL) + bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + rule->next = NULL; + + if (subst->last_rule == NULL) + subst->first_rule = rule; + else + subst->last_rule->next = rule; + subst->last_rule = rule; + + if (*rule_text == '\0') + bsdtar_errc(bsdtar, 1, 0, "Empty replacement string"); + end_pattern = strchr(rule_text + 1, *rule_text); + if (end_pattern == NULL) + bsdtar_errc(bsdtar, 1, 0, "Invalid replacement string"); + + pattern = malloc(end_pattern - rule_text); + if (pattern == NULL) + bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + memcpy(pattern, rule_text + 1, end_pattern - rule_text - 1); + pattern[end_pattern - rule_text - 1] = '\0'; + + if ((r = regcomp(&rule->re, pattern, REG_BASIC)) != 0) { + char buf[80]; + regerror(r, &rule->re, buf, sizeof(buf)); + bsdtar_errc(bsdtar, 1, 0, "Invalid regular expression: %s", buf); + } + free(pattern); + + start_subst = end_pattern + 1; + end_pattern = strchr(start_subst, *rule_text); + if (end_pattern == NULL) + bsdtar_errc(bsdtar, 1, 0, "Invalid replacement string"); + + rule->result = malloc(end_pattern - start_subst + 1); + if (rule->result == NULL) + bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + memcpy(rule->result, start_subst, end_pattern - start_subst); + rule->result[end_pattern - start_subst] = '\0'; + + rule->global = 0; + rule->print = 0; + rule->symlink = 0; + + while (*++end_pattern) { + switch (*end_pattern) { + case 'g': + case 'G': + rule->global = 1; + break; + case 'p': + case 'P': + rule->print = 1; + break; + case 's': + case 'S': + rule->symlink = 1; + break; + default: + bsdtar_errc(bsdtar, 1, 0, "Invalid replacement flag %c", *end_pattern); + } + } +} + +static void +realloc_strncat(struct bsdtar *bsdtar, char **str, const char *append, size_t len) +{ + char *new_str; + size_t old_len; + + if (*str == NULL) + old_len = 0; + else + old_len = strlen(*str); + + new_str = malloc(old_len + len + 1); + if (new_str == NULL) + bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + memcpy(new_str, *str, old_len); + memcpy(new_str + old_len, append, len); + new_str[old_len + len] = '\0'; + free(*str); + *str = new_str; +} + +static void +realloc_strcat(struct bsdtar *bsdtar, char **str, const char *append) +{ + char *new_str; + size_t old_len; + + if (*str == NULL) + old_len = 0; + else + old_len = strlen(*str); + + new_str = malloc(old_len + strlen(append) + 1); + if (new_str == NULL) + bsdtar_errc(bsdtar, 1, errno, "Out of memory"); + memcpy(new_str, *str, old_len); + strcpy(new_str + old_len, append); + free(*str); + *str = new_str; +} + +int +apply_substitution(struct bsdtar *bsdtar, const char *name, char **result, int symlink_only) +{ + const char *path = name; + regmatch_t matches[10]; + size_t i, j; + struct subst_rule *rule; + struct substitution *subst; + int c, got_match, print_match; + + *result = NULL; + + if ((subst = bsdtar->substitution) == NULL) + return 0; + + got_match = 0; + print_match = 0; + + for (rule = subst->first_rule; rule != NULL; rule = rule->next) { + if (symlink_only && !rule->symlink) + continue; + if (regexec(&rule->re, name, 10, matches, 0)) + break; + + got_match = 1; + print_match |= rule->print; + realloc_strncat(bsdtar, result, name, matches[0].rm_so); + + for (i = 0, j = 0; rule->result[i] != '\0'; ++i) { + if (rule->result[i] == '~') { + realloc_strncat(bsdtar, result, rule->result + j, i - j); + realloc_strncat(bsdtar, result, name, matches[0].rm_eo); + j = i + 1; + continue; + } + if (rule->result[i] != '\\') + continue; + + ++i; + c = rule->result[i]; + switch (c) { + case '~': + case '\\': + realloc_strncat(bsdtar, result, rule->result + j, i - j - 1); + j = i; + break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + realloc_strncat(bsdtar, result, rule->result + j, i - j - 1); + if ((size_t)(c - '0') > (size_t)(rule->re.re_nsub)) { + free(*result); + *result = NULL; + return -1; + } + realloc_strncat(bsdtar, result, name + matches[c - '0'].rm_so, matches[c - '0'].rm_eo - matches[c - '0'].rm_so); + j = i + 1; + break; + default: + /* Just continue; */ + break; + } + + } + + realloc_strcat(bsdtar, result, rule->result + j); + + name += matches[0].rm_eo; + + if (!rule->global) + break; + } + + if (got_match) + realloc_strcat(bsdtar, result, name); + + if (print_match) + fprintf(stderr, "%s >> %s\n", path, *result); + + return got_match; +} + +void +cleanup_substitution(struct bsdtar *bsdtar) +{ + struct subst_rule *rule; + struct substitution *subst; + + if ((subst = bsdtar->substitution) == NULL) + return; + + while ((rule = subst->first_rule) != NULL) { + subst->first_rule = rule->next; + free(rule->result); + free(rule); + } + free(subst); +} +#endif /* HAVE_REGEX_H */ diff --git a/libarchive/libarchive-2.4.17/tar/test/main.c b/libarchive/libarchive-2.5.5/tar/test/main.c index 263e2cb..27bb48d 100644 --- a/libarchive/libarchive-2.4.17/tar/test/main.c +++ b/libarchive/libarchive-2.5.5/tar/test/main.c @@ -24,26 +24,27 @@ */ /* - * 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 "test.h" + #include <errno.h> +#include <locale.h> #include <stdarg.h> #include <time.h> -#include "test.h" -__FBSDID("$FreeBSD$"); +/* + * This same file is used pretty much verbatim for all test harnesses. + * + * The next few lines are the only differences. + */ +#define PROGRAM "bsdtar" /* Name of program being tested. */ +#define ENVBASE "BSDTAR" /* Prefix for environment variables. */ +#undef EXTRA_DUMP /* How to dump extra data */ +/* How to generate extra version info. */ +#define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "") +__FBSDID("$FreeBSD: src/usr.bin/tar/test/main.c,v 1.3 2008/06/15 10:07:54 kientzle Exp $"); /* * "list.h" is simply created by "grep DEFINE_TEST"; it has @@ -54,7 +55,7 @@ __FBSDID("$FreeBSD$"); * test functions. */ #undef DEFINE_TEST -#define DEFINE_TEST(name) void name(void); +#define DEFINE_TEST(name) void name(void); #include "list.h" /* Interix doesn't define these in a standard header. */ @@ -63,10 +64,14 @@ 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; +/* Enable core dump on failure. */ +static int dump_on_failure = 0; +/* Default is to remove temp dirs for successful tests. */ +static int keep_temp_files = 0; /* Default is to print some basic information about each test. */ static int quiet_flag = 0; +/* Default is to summarize repeated failures. */ +static int verbose = 0; /* Cumulative count of component failures. */ static int failures = 0; /* Cumulative count of skipped component tests. */ @@ -74,6 +79,9 @@ static int skips = 0; /* Cumulative count of assertions. */ static int assertions = 0; +/* Directory where uuencoded reference files can be found. */ +static char *refdir; + /* * My own implementation of the standard assert() macro emits the * message in the same format as GCC (file:line: message). @@ -93,7 +101,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; @@ -167,7 +175,12 @@ report_failure(void *extra) msg[0] = '\0'; } +#ifdef EXTRA_DUMP + if (extra != NULL) + fprintf(stderr, " detail: %s\n", EXTRA_DUMP(extra)); +#else (void)extra; /* UNUSED */ +#endif if (dump_on_failure) { fprintf(stderr, @@ -225,44 +238,70 @@ 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; + if (!verbose && previous_failures(file, line)) + 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. */ -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; + if (!verbose && previous_failures(file, line)) + 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); +} + +static void strdump(const char *p) +{ + if (p == NULL) { + fprintf(stderr, "(null)"); + return; + } + fprintf(stderr, "\""); + while (*p != '\0') { + unsigned int c = 0xff & *p++; + switch (c) { + case '\a': fprintf(stderr, "\a"); break; + case '\b': fprintf(stderr, "\b"); break; + case '\n': fprintf(stderr, "\n"); break; + case '\r': fprintf(stderr, "\r"); break; + default: + if (c >= 32 && c < 127) + fprintf(stderr, "%c", c); + else + fprintf(stderr, "\\x%02X", c); + } + } + fprintf(stderr, "\""); } /* 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, @@ -272,20 +311,25 @@ test_assert_equal_string(const char *file, int line, 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; + if (!verbose && previous_failures(file, line)) + 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); + fprintf(stderr, " %s = ", e1); + strdump(v1); + fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : strlen(v1)); + fprintf(stderr, " %s = ", e2); + strdump(v2); + fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : strlen(v2)); report_failure(extra); + return (0); } static void wcsdump(const wchar_t *w) @@ -310,7 +354,7 @@ static void wcsdump(const wchar_t *w) } /* 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, @@ -329,11 +373,11 @@ test_assert_equal_wstring(const char *file, int line, } } else if (wcscmp(v1, v2) == 0) { msg[0] = '\0'; - return; + return (1); } failures ++; - if (previous_failures(file, line)) - return; + if (!verbose && previous_failures(file, line)) + return (0); fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n", file, line); fprintf(stderr, " %s = ", e1); @@ -343,6 +387,7 @@ test_assert_equal_wstring(const char *file, int line, wcsdump(v2); fprintf(stderr, "\n"); report_failure(extra); + return (0); } /* @@ -362,7 +407,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 = ' '; } @@ -384,7 +429,7 @@ 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, @@ -394,15 +439,15 @@ test_assert_equal_mem(const char *file, int line, 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; + if (!verbose && previous_failures(file, line)) + return (0); fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n", file, line); fprintf(stderr, " size %s = %d\n", ld, (int)l); @@ -412,14 +457,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); @@ -428,16 +478,33 @@ 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); + return (0); + } + if (st.st_size == 0) + return (1); + + failures ++; + if (!verbose && 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]; @@ -459,16 +526,100 @@ 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 (!verbose && 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); +} + +int +test_assert_file_exists(const char *fpattern, ...) +{ + char f[1024]; + va_list ap; + + va_start(ap, fpattern); + vsprintf(f, fpattern, ap); + va_end(ap); + + if (!access(f, F_OK)) + return (1); + if (!previous_failures(test_filename, test_line)) { + fprintf(stderr, "%s:%d: File doesn't exist\n", + test_filename, test_line); + fprintf(stderr, " file=\"%s\"\n", f); + report_failure(test_extra); + } + return (0); +} + +int +test_assert_file_not_exists(const char *fpattern, ...) +{ + char f[1024]; + va_list ap; + + va_start(ap, fpattern); + vsprintf(f, fpattern, ap); + va_end(ap); + + if (access(f, F_OK)) + return (1); + if (!previous_failures(test_filename, test_line)) { + fprintf(stderr, "%s:%d: File exists and shouldn't\n", + test_filename, test_line); + fprintf(stderr, " file=\"%s\"\n", f); + 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); +} /* * Call standard system() call, but build up the command line using @@ -546,7 +697,7 @@ slurpfile(size_t * sizep, const char *fmt, ...) * We reuse it here to define a list of all tests (functions and names). */ #undef DEFINE_TEST -#define DEFINE_TEST(n) { n, #n }, +#define DEFINE_TEST(n) { n, #n }, struct { void (*func)(void); const char *name; } tests[] = { #include "list.h" }; @@ -561,8 +712,11 @@ static int test_run(int i, const char *tmpdir) { int failures_before = failures; - if (!quiet_flag) + if (!quiet_flag) { printf("%d: %s\n", i, tests[i].name); + fflush(stdout); + } + /* * Always explicitly chdir() in case the last test moved us to * a strange place. @@ -587,10 +741,18 @@ 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. */ summarize(); + /* If there were no failures, we can remove the work dir. */ + if (failures == failures_before) { + if (!keep_temp_files && chdir(tmpdir) == 0) { + systemf("rm -rf %s", tests[i].name); + } + } /* Return appropriate status. */ return (failures == failures_before ? 0 : 1); } @@ -604,19 +766,83 @@ static void usage(const char *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(" -d Dump core after any failure, for debugging.\n"); + printf(" -k Keep all temp files.\n"); + printf(" Default: temp files for successful tests deleted.\n"); +#ifdef PROGRAM printf(" -p <path> Path to executable to be tested.\n"); - printf(" Default: path taken from " PROGRAM " environment variable.\n"); + printf(" Default: path taken from " ENVBASE " environment variable.\n"); +#endif printf(" -q Quiet.\n"); printf(" -r <dir> Path to dir containing reference files.\n"); printf(" Default: Current directory.\n"); + printf(" -v Verbose.\n"); printf("Available tests:\n"); for (i = 0; i < limit; i++) printf(" %d: %s\n", i, tests[i].name); exit(1); } +#define UUDECODE(c) (((c) - 0x20) & 0x3f) + +void +extract_reference_file(const char *name) +{ + char buff[1024]; + FILE *in, *out; + + sprintf(buff, "%s/%s.uu", refdir, name); + in = fopen(buff, "r"); + failure("Couldn't open reference file %s", buff); + assert(in != NULL); + if (in == NULL) + return; + /* Read up to and including the 'begin' line. */ + for (;;) { + if (fgets(buff, sizeof(buff), in) == NULL) { + /* TODO: This is a failure. */ + return; + } + if (memcmp(buff, "begin ", 6) == 0) + break; + } + /* Now, decode the rest and write it. */ + /* Not a lot of error checking here; the input better be right. */ + out = fopen(name, "w"); + while (fgets(buff, sizeof(buff), in) != NULL) { + char *p = buff; + int bytes; + + if (memcmp(buff, "end", 3) == 0) + break; + + bytes = UUDECODE(*p++); + while (bytes > 0) { + int n = 0; + /* Write out 1-3 bytes from that. */ + if (bytes > 0) { + n = UUDECODE(*p++) << 18; + n |= UUDECODE(*p++) << 12; + fputc(n >> 16, out); + --bytes; + } + if (bytes > 0) { + n |= UUDECODE(*p++) << 6; + fputc((n >> 8) & 0xFF, out); + --bytes; + } + if (bytes > 0) { + n |= UUDECODE(*p++); + fputc(n & 0xFF, out); + --bytes; + } + } + } + fclose(out); + fclose(in); +} + + int main(int argc, char **argv) { static const int limit = sizeof(tests) / sizeof(tests[0]); @@ -638,26 +864,35 @@ int main(int argc, char **argv) ++p; } +#ifdef PROGRAM /* Get the target program from environment, if available. */ - testprog = getenv(PROGRAM); + testprog = getenv(ENVBASE); +#endif - /* Allow -k to be controlled through the environment. */ - if (getenv(PROGRAM "_KEEP_GOING") != NULL) - dump_on_failure = 0; + /* Allow -d to be controlled through the environment. */ + if (getenv(ENVBASE "_DEBUG") != NULL) + dump_on_failure = 1; /* Get the directory holding test files from environment. */ - refdir = getenv(PROGRAM "_TEST_FILES"); + refdir = getenv(ENVBASE "_TEST_FILES"); /* * Parse options. */ - while ((opt = getopt(argc, argv, "kp:qr:")) != -1) { + while ((opt = getopt(argc, argv, "dkp:qr:v")) != -1) { switch (opt) { + case 'd': + dump_on_failure = 1; + break; case 'k': - dump_on_failure = 0; + keep_temp_files = 1; break; case 'p': +#ifdef PROGRAM testprog = optarg; +#else + usage(progname); +#endif break; case 'q': quiet_flag++; @@ -665,6 +900,9 @@ int main(int argc, char **argv) case 'r': refdir = optarg; break; + case 'v': + verbose = 1; + break; case '?': default: usage(progname); @@ -676,9 +914,10 @@ int main(int argc, char **argv) /* * Sanity-check that our options make sense. */ +#ifdef PROGRAM if (testprog == NULL) usage(progname); - +#endif /* * Create a temp directory for the following tests. @@ -712,6 +951,7 @@ int main(int argc, char **argv) --p; *p = '\0'; } + systemf("rm %s/refdir", tmpdir); } /* @@ -720,7 +960,12 @@ int main(int argc, char **argv) if (!quiet_flag) { printf("Running tests in: %s\n", tmpdir); printf("Reference files will be read from: %s\n", refdir); +#ifdef PROGRAM printf("Running tests on: %s\n", testprog); +#endif + printf("Exercising: "); + fflush(stdout); + printf("%s\n", EXTRA_VERSION); } /* @@ -762,5 +1007,9 @@ int main(int argc, char **argv) free(refdir_alloc); + /* If the final tmpdir is empty, we can remove it. */ + /* This should be the usual case when all tests succeed. */ + rmdir(tmpdir); + return (tests_failed); } diff --git a/libarchive/libarchive-2.4.17/cpio/test/test.h b/libarchive/libarchive-2.5.5/tar/test/test.h index fcd3304..30321e8 100644 --- a/libarchive/libarchive-2.4.17/cpio/test/test.h +++ b/libarchive/libarchive-2.5.5/tar/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/usr.bin/tar/test/test.h,v 1.3 2008/06/15 10:07:54 kientzle Exp $ */ /* Every test program should #include "test.h" as the first thing. */ @@ -31,22 +31,6 @@ * 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 <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" @@ -61,6 +45,22 @@ #error Oops: No config.h and no pre-built configuration in test.h. #endif +#include <dirent.h> +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#ifndef _WIN32 +#include <unistd.h> +#endif +#include <wchar.h> + +#ifdef USE_DMALLOC +#include <dmalloc.h> +#endif + /* No non-FreeBSD platform will have __FBSDID, so just define it here. */ #ifdef __FreeBSD__ #include <sys/cdefs.h> /* For __FBSDID */ @@ -98,8 +98,14 @@ /* Assert that a file is empty; supports printf-style arguments. */ #define assertEmptyFile \ test_setup(__FILE__, __LINE__);test_assert_empty_file +/* Assert that a file exists; supports printf-style arguments. */ +#define assertFileExists \ + test_setup(__FILE__, __LINE__);test_assert_file_exists +/* Assert that a file exists; supports printf-style arguments. */ +#define assertFileNotExists \ + test_setup(__FILE__, __LINE__);test_assert_file_not_exists /* Assert that file contents match a string; supports printf-style arguments. */ -#define assertFileContents \ +#define assertFileContents \ test_setup(__FILE__, __LINE__);test_assert_file_contents /* @@ -123,6 +129,8 @@ int test_assert_equal_string(const char *, int, const char *v1, const char *, co 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 *, ...); +int test_assert_file_exists(const char *, ...); +int test_assert_file_not_exists(const char *, ...); /* Like sprintf, then system() */ int systemf(const char * fmt, ...); @@ -131,17 +139,12 @@ int systemf(const char * fmt, ...); /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */ char *slurpfile(size_t *, const char *fmt, ...); -/* - * Global vars - */ - -/* Directory holding reference files. */ -char *refdir; +/* Extracts named reference file to the current directory. */ +void extract_reference_file(const char *); /* - * Special interfaces for bsdcpio test harness. + * Special interfaces for program test harness. */ /* Pathname of exe to be tested. */ char *testprog; - diff --git a/libarchive/libarchive-2.5.5/tar/test/test_0.c b/libarchive/libarchive-2.5.5/tar/test/test_0.c new file mode 100644 index 0000000..36c8b1e --- /dev/null +++ b/libarchive/libarchive-2.5.5/tar/test/test_0.c @@ -0,0 +1,62 @@ +/*- + * 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/usr.bin/tar/test/test_0.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $"); + +/* + * This first test does basic sanity checks on the environment. For + * most of these, we just exit on failure. + */ + +DEFINE_TEST(test_0) +{ + struct stat st; + + failure("File %s does not exist?!", testprog); + if (!assertEqualInt(0, stat(testprog, &st))) + exit(1); + + failure("%s is not executable?!", testprog); + if (!assert((st.st_mode & 0111) != 0)) + exit(1); + + /* + * Try to succesfully run the program; this requires that + * we know some option that will succeed. + */ + if (0 == systemf("%s --version >/dev/null", testprog)) { + /* This worked. */ + } else if (0 == systemf("%s -W version >/dev/null", testprog)) { + /* This worked. */ + } else { + failure("Unable to successfully run any of the following:\n" + " * %s --version\n" + " * %s -W version\n", + testprog, testprog); + assert(0); + } + + /* TODO: Ensure that our reference files are available. */ +} diff --git a/libarchive/libarchive-2.4.17/tar/test/test_basic.c b/libarchive/libarchive-2.5.5/tar/test/test_basic.c index 50be289..fff5112 100644 --- a/libarchive/libarchive-2.4.17/tar/test/test_basic.c +++ b/libarchive/libarchive-2.5.5/tar/test/test_basic.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_basic.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $"); static void diff --git a/libarchive/libarchive-2.4.17/tar/test/test_copy.c b/libarchive/libarchive-2.5.5/tar/test/test_copy.c index 83fbd76..b2eef8c 100644 --- a/libarchive/libarchive-2.4.17/tar/test/test_copy.c +++ b/libarchive/libarchive-2.5.5/tar/test/test_copy.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_copy.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $"); static void create_tree(void) @@ -35,11 +35,16 @@ create_tree(void) assertEqualInt(0, mkdir("original", 0775)); chdir("original"); + assertEqualInt(0, mkdir("f", 0775)); + assertEqualInt(0, mkdir("l", 0775)); + assertEqualInt(0, mkdir("m", 0775)); + assertEqualInt(0, mkdir("s", 0775)); + assertEqualInt(0, mkdir("d", 0775)); - buff[0] = 'f'; - buff[1] = '_'; for (i = 0; i < 200; i++) { - /* Create a file named "f_abcdef..." */ + buff[0] = 'f'; + buff[1] = '/'; + /* Create a file named "f/abcdef..." */ buff[i + 2] = 'a' + (i % 26); buff[i + 3] = '\0'; fd = open(buff, O_CREAT | O_WRONLY, 0644); @@ -47,23 +52,27 @@ create_tree(void) assertEqualInt(i + 3, write(fd, buff, strlen(buff))); close(fd); - /* Create a link named "l_abcdef..." to the above. */ + /* 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. */ + /* 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 symlink named "s/abcdef..." to the above. */ + strcpy(buff2 + 3, buff); + buff[0] = 's'; + buff2[0] = '.'; + buff2[1] = '.'; + buff2[2] = '/'; + assertEqualInt(0, symlink(buff2, buff)); - /* Create a dir named "d_abcdef...". */ - buff2[0] = 'd'; - assertEqualInt(0, mkdir(buff2, 0775)); + /* Create a dir named "d/abcdef...". */ + buff[0] = 'd'; + assertEqualInt(0, mkdir(buff, 0775)); } chdir(".."); @@ -76,35 +85,46 @@ static void verify_tree(int limit) { struct stat st, st2; - char buff[260]; - char buff2[260]; - int i, r; + char filename[260]; + char name1[260]; + char name2[260]; + char contents[260]; + int i, j, r; int fd; int len; - const char *p; + const char *p, *dp; 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); + for (i = 1; i < 200; i++) { + /* Generate a base name of the correct length. */ + for (j = 0; j < i; ++j) + filename[j] = 'a' + (j % 26); +#if 0 + for (n = i; n > 0; n /= 10) + filename[--j] = '0' + (n % 10); +#endif + filename[i] = '\0'; + + /* Verify a file named "f/abcdef..." */ + strcpy(name1, "f/"); + strcat(name1, filename); + if (limit != LIMIT_USTAR || strlen(filename) <= 100) { + fd = open(name1, 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)); + name1, strerror(errno)); + if (assert(fd >= 0)) { + len = read(fd, contents, i + 10); + close(fd); + assertEqualInt(len, i + 2); + /* Verify contents of 'contents' */ + contents[len] = '\0'; + failure("Each test file contains its own name"); + assertEqualString(name1, contents); + /* stat() for dev/ino for next check */ + assertEqualInt(0, lstat(name1, &st)); + } } /* @@ -112,18 +132,19 @@ verify_tree(int limit) * "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))); + strcpy(name2, "l/"); + strcat(name2, filename); + if (limit != LIMIT_USTAR || strlen(name2) <= 100) { + /* Verify hardlink "l/abcdef..." */ + assertEqualInt(0, (r = lstat(name2, &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))); + name2[0] = 'm'; + assertEqualInt(0, (r = lstat(name2, &st2))); if (r == 0) { assertEqualInt(st2.st_dev, st.st_dev); assertEqualInt(st2.st_ino, st.st_ino); @@ -134,59 +155,84 @@ verify_tree(int limit) * 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) { + /* Verify symlink "s/abcdef..." */ + strcpy(name2, "../s/"); + strcat(name2, filename); + if (limit != LIMIT_USTAR || strlen(name2) <= 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); + failure("Couldn't stat %s (length %d)", + filename, strlen(filename)); + if (assertEqualInt(0, lstat(name2 + 3, &st2))) { + assert(S_ISLNK(st2.st_mode)); + /* This is a symlink to the file above. */ + failure("Couldn't stat %s", name2 + 3); + if (assertEqualInt(0, stat(name2 + 3, &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) { + /* Verify dir "d/abcdef...". */ + strcpy(name1, "d/"); + strcat(name1, filename); + if (limit != LIMIT_USTAR || strlen(filename) < 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. - */ + failure("Couldn't stat %s (length %d)", + name1, strlen(filename)); + if (assertEqualInt(0, lstat(name1, &st2))) { + if (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); + for (dp = "dflms"; *dp != '\0'; ++dp) { + char dir[2]; + dir[0] = *dp; dir[1] = '\0'; + d = opendir(dir); + while ((de = readdir(d)) != NULL) { + p = de->d_name; + switch(dp[0]) { + case 'l': case 'm': + if (limit == LIMIT_USTAR) { + failure("strlen(p) = %d", strlen(p)); + assert(strlen(p) <= 100); + } + case 'd': + if (limit == LIMIT_USTAR) { + failure("strlen(p)=%d", strlen(p)); + assert(strlen(p) < 100); + } + case 'f': case 's': + if (limit == LIMIT_USTAR) { + failure("strlen(p)=%d", strlen(p)); + assert(strlen(p) < 101); + } + /* Our files have very particular filename patterns. */ + if (p[0] != '.' || (p[1] != '.' && p[1] != '\0')) { + for (i = 0; p[i] != '\0' && i < 200; i++) { + failure("i=%d, p[i]='%c' 'a'+(i%%26)='%c'", i, p[i], 'a' + (i % 26)); + assertEqualInt(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); } - closedir(d); } static void @@ -195,12 +241,12 @@ copy_basic(void) int r; assertEqualInt(0, mkdir("plain", 0775)); - chdir("plain"); + assertEqualInt(0, chdir("plain")); /* * Use the tar program to create an archive. */ - r = systemf("%s cf archive -C .. original >pack.out 2>pack.err", + r = systemf("%s cf archive -C ../original f d l m s >pack.out 2>pack.err", testprog); failure("Error invoking \"%s cf\"", testprog); assertEqualInt(r, 0); @@ -220,9 +266,8 @@ copy_basic(void) assertEmptyFile("unpack.err"); assertEmptyFile("unpack.out"); - chdir("original"); verify_tree(LIMIT_NONE); - chdir("../.."); + assertEqualInt(0, chdir("..")); } static void @@ -232,18 +277,20 @@ copy_ustar(void) int r; assertEqualInt(0, mkdir(target, 0775)); - chdir(target); + assertEqualInt(0, chdir(target)); /* * Use the tar program to create an archive. */ - r = systemf("%s cf archive --format=ustar -C .. original >pack.out 2>pack.err", + r = systemf("%s cf archive --format=ustar -C ../original f d l m s >pack.out 2>pack.err", testprog); - failure("Error invoking \"%s cf\"", testprog); + failure("Error invoking \"%s cf archive --format=ustar\"", testprog); assertEqualInt(r, 0); /* Verify that nothing went to stdout. */ assertEmptyFile("pack.out"); + /* Stderr is non-empty, since there are a bunch of files + * with filenames too long to archive. */ /* * Use tar to unpack the archive into another directory. diff --git a/libarchive/libarchive-2.4.17/tar/test/test_getdate.c b/libarchive/libarchive-2.5.5/tar/test/test_getdate.c index 7ed447b..d75119c 100644 --- a/libarchive/libarchive-2.4.17/tar/test/test_getdate.c +++ b/libarchive/libarchive-2.5.5/tar/test/test_getdate.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_getdate.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $"); /* * Verify that the getdate() function works. diff --git a/libarchive/libarchive-2.4.17/tar/test/test_help.c b/libarchive/libarchive-2.5.5/tar/test/test_help.c index c547dbc..163e212 100644 --- a/libarchive/libarchive-2.4.17/tar/test/test_help.c +++ b/libarchive/libarchive-2.5.5/tar/test/test_help.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_help.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $"); /* * Test that "--help", "-h", and "-W help" options all work and diff --git a/libarchive/libarchive-2.5.5/tar/test/test_option_T.c b/libarchive/libarchive-2.5.5/tar/test/test_option_T.c new file mode 100644 index 0000000..6c9007b --- /dev/null +++ b/libarchive/libarchive-2.5.5/tar/test/test_option_T.c @@ -0,0 +1,142 @@ +/*- + * Copyright (c) 2003-2008 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/usr.bin/tar/test/test_option_T.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $"); + +static int +touch(const char *fn) +{ + int fd = open(fn, O_RDWR | O_CREAT); + failure("Couldn't create file '%s', fd=%d, errno=%d (%s)\n", + fn, fd, errno, strerror(errno)); + if (!assert(fd > 0)) + return (0); /* Failure. */ + close(fd); + return (1); /* Success */ +} + +DEFINE_TEST(test_option_T) +{ + FILE *f; + + /* Create a simple dir heirarchy; bail if anything fails. */ + if (!assertEqualInt(0, mkdir("d1", 0755))) return; + if (!assertEqualInt(0, mkdir("d1/d2", 0755))) return; + if (!touch("d1/f1")) return; + if (!touch("d1/f2")) return; + if (!touch("d1/d2/f3")) return; + if (!touch("d1/d2/f4")) return; + if (!touch("d1/d2/f5")) return; + + /* Populate a file list */ + f = fopen("filelist", "w+"); + if (!assert(f != NULL)) + return; + fprintf(f, "d1/f1\n"); + fprintf(f, "d1/d2/f4\n"); + fclose(f); + + /* Populate a second file list */ + f = fopen("filelist2", "w+"); + if (!assert(f != NULL)) + return; + fprintf(f, "d1/d2/f3\n"); + fprintf(f, "d1/d2/f5\n"); + fclose(f); + + /* Use -c -T to archive up the files. */ + systemf("%s -c -f test1.tar -T filelist > test1.out 2> test1.err", + testprog); + assertEmptyFile("test1.out"); + assertEmptyFile("test1.err"); + + /* Use -x -T to dearchive the files */ + if (!assertEqualInt(0, mkdir("test1", 0755))) return; + systemf("%s -x -f test1.tar -T filelist -C test1" + " > test1b.out 2> test1b.err", testprog); + assertEmptyFile("test1b.out"); + assertEmptyFile("test1b.err"); + + /* Verify the files were extracted. */ + assertFileExists("test1/d1/f1"); + assertFileNotExists("test1/d1/f2"); + assertFileNotExists("test1/d1/d2/f3"); + assertFileExists("test1/d1/d2/f4"); + assertFileNotExists("test1/d1/d2/f5"); + + /* Use -r -T to add more files to the archive. */ + systemf("%s -r -f test1.tar -T filelist2 > test2.out 2> test2.err", + testprog); + assertEmptyFile("test2.out"); + assertEmptyFile("test2.err"); + + /* Use -x without -T to dearchive the files (ensure -r worked) */ + if (!assertEqualInt(0, mkdir("test3", 0755))) return; + systemf("%s -x -f test1.tar -C test3" + " > test3.out 2> test3.err", testprog); + assertEmptyFile("test3.out"); + assertEmptyFile("test3.err"); + /* Verify the files were extracted.*/ + assertFileExists("test3/d1/f1"); + assertFileNotExists("test3/d1/f2"); + assertFileExists("test3/d1/d2/f3"); + assertFileExists("test3/d1/d2/f4"); + assertFileExists("test3/d1/d2/f5"); + + /* Use -x -T to dearchive the files (verify -x -T together) */ + if (!assertEqualInt(0, mkdir("test2", 0755))) return; + systemf("%s -x -f test1.tar -T filelist -C test2" + " > test2b.out 2> test2b.err", testprog); + assertEmptyFile("test2b.out"); + assertEmptyFile("test2b.err"); + /* Verify the files were extracted.*/ + assertFileExists("test2/d1/f1"); + assertFileNotExists("test2/d1/f2"); + assertFileNotExists("test2/d1/d2/f3"); + assertFileExists("test2/d1/d2/f4"); + assertFileNotExists("test2/d1/d2/f5"); + + assertEqualInt(0, mkdir("test4", 0755)); + assertEqualInt(0, mkdir("test4_out", 0755)); + assertEqualInt(0, mkdir("test4_out2", 0755)); + assertEqualInt(0, mkdir("test4/d1", 0755)); + assertEqualInt(1, touch("test4/d1/foo")); + + systemf("%s -cf - -s /foo/bar/ test4/d1/foo | %s -xf - -C test4_out", + testprog, testprog); + assertEmptyFile("test4_out/test4/d1/bar"); + systemf("%s -cf - -s /d1/d2/ test4/d1/foo | %s -xf - -C test4_out", + testprog, testprog); + assertEmptyFile("test4_out/test4/d2/foo"); + systemf("%s -cf - -s ,test4/d1/foo,, test4/d1/foo | %s -tvf - > test4.lst", + testprog, testprog); + assertEmptyFile("test4.lst"); + systemf("%s -cf - test4/d1/foo | %s -xf - -s /foo/bar/ -C test4_out2", + testprog, testprog); + assertEmptyFile("test4_out2/test4/d1/bar"); + + /* TODO: Include some use of -C directory-changing within the filelist. */ + /* I'm pretty sure -C within the filelist is broken on extract. */ +} diff --git a/libarchive/libarchive-2.5.5/tar/test/test_patterns.c b/libarchive/libarchive-2.5.5/tar/test/test_patterns.c new file mode 100644 index 0000000..e7b1679 --- /dev/null +++ b/libarchive/libarchive-2.5.5/tar/test/test_patterns.c @@ -0,0 +1,47 @@ +/*- + * 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_patterns) +{ + int fd, r; + + /* + * Test basic command-line pattern handling. + */ + + /* + * John Baldwin reported this problem in PR bin/121598 + */ + fd = open("foo", O_CREAT | O_WRONLY, 0644); + assert(fd >= 0); + close(fd); + r = systemf("%s zcfv tar1.tgz foo > tar1a.out 2> tar1a.err", testprog); + assertEqualInt(r, 0); + r = systemf("%s zxfv tar1.tgz foo bar > tar1b.out 2> tar1b.err", testprog); + failure("tar should return non-zero because a file was given on the command line that's not in the archive"); + assert(r != 0); +} diff --git a/libarchive/libarchive-2.4.17/tar/test/test_stdio.c b/libarchive/libarchive-2.5.5/tar/test/test_stdio.c index 2d24ae3..d770cf1 100644 --- a/libarchive/libarchive-2.4.17/tar/test/test_stdio.c +++ b/libarchive/libarchive-2.5.5/tar/test/test_stdio.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_stdio.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $"); DEFINE_TEST(test_stdio) { diff --git a/libarchive/libarchive-2.4.17/tar/test/test_version.c b/libarchive/libarchive-2.5.5/tar/test/test_version.c index 5ac6f88..6ed656d 100644 --- a/libarchive/libarchive-2.4.17/tar/test/test_version.c +++ b/libarchive/libarchive-2.5.5/tar/test/test_version.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_version.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $"); /* * Test that --version option works and generates reasonable output. @@ -37,12 +37,21 @@ DEFINE_TEST(test_version) r = systemf("%s --version >version.stdout 2>version.stderr", testprog); + if (r != 0) + r = systemf("%s -W version >version.stdout 2>version.stderr", + testprog); + failure("Unable to run either %s --version or %s -W version", + testprog, testprog); + if (!assert(r == 0)) + return; + /* --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); + failure("Version: %s", p); assertEqualMem(q, "bsdtar ", 7); q += 7; s -= 7; /* Version number is a series of digits and periods. */ @@ -51,14 +60,22 @@ DEFINE_TEST(test_version) --s; } /* Version number terminated by space. */ + failure("Version: %s", p); assert(s > 1); + /* Skip a single trailing a,b,c, or d. */ + if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') + ++q; + failure("Version: %s", p); assert(*q == ' '); ++q; --s; /* Separator. */ + failure("Version: %s", p); assertEqualMem(q, "- ", 2); q += 2; s -= 2; /* libarchive name and version number */ + failure("Version: %s", p); assert(s > 11); + failure("Version: %s", p); assertEqualMem(q, "libarchive ", 11); q += 11; s -= 11; /* Version number is a series of digits and periods. */ @@ -66,6 +83,9 @@ DEFINE_TEST(test_version) ++q; --s; } + /* Skip a single trailing a,b,c, or d. */ + if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') + ++q; /* All terminated by a newline. */ assert(s >= 1); assertEqualMem(q, "\n", 1); diff --git a/libarchive/libarchive-2.4.17/tar/tree.c b/libarchive/libarchive-2.5.5/tar/tree.c index 23e64e3..23e64e3 100644 --- a/libarchive/libarchive-2.4.17/tar/tree.c +++ b/libarchive/libarchive-2.5.5/tar/tree.c diff --git a/libarchive/libarchive-2.4.17/tar/tree.h b/libarchive/libarchive-2.5.5/tar/tree.h index a32a15f..a32a15f 100644 --- a/libarchive/libarchive-2.4.17/tar/tree.h +++ b/libarchive/libarchive-2.5.5/tar/tree.h diff --git a/libarchive/libarchive-2.4.17/tar/util.c b/libarchive/libarchive-2.5.5/tar/util.c index 68ff8d8..ee1e40d 100644 --- a/libarchive/libarchive-2.4.17/tar/util.c +++ b/libarchive/libarchive-2.5.5/tar/util.c @@ -24,7 +24,7 @@ */ #include "bsdtar_platform.h" -__FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.18 2008/01/02 00:21:27 kientzle Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.20 2008/06/09 14:03:55 cperciva Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -178,7 +178,7 @@ yes(const char *fmt, ...) fprintf(stderr, " (y/N)? "); fflush(stderr); - l = read(2, buff, sizeof(buff)); + l = read(2, buff, sizeof(buff) - 1); if (l <= 0) return (0); buff[l] = 0; @@ -215,7 +215,7 @@ process_lines(struct bsdtar *bsdtar, const char *pathname, { FILE *f; char *buff, *buff_end, *line_start, *line_end, *p; - size_t buff_length, bytes_read, bytes_wanted; + size_t buff_length, new_buff_length, bytes_read, bytes_wanted; int separator; int ret; @@ -262,7 +262,12 @@ process_lines(struct bsdtar *bsdtar, const char *pathname, line_start = buff; } else { /* Line is too big; enlarge the buffer. */ - p = realloc(buff, buff_length *= 2); + new_buff_length = buff_length * 2; + if (new_buff_length <= buff_length) + bsdtar_errc(bsdtar, 1, ENOMEM, + "Line too long in %s", pathname); + buff_length = new_buff_length; + p = realloc(buff, buff_length); if (p == NULL) bsdtar_errc(bsdtar, 1, ENOMEM, "Line too long in %s", pathname); @@ -351,10 +356,53 @@ int edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry) { const char *name = archive_entry_pathname(entry); +#if HAVE_REGEX_H + char *subst_name; +#endif + int r; + +#if HAVE_REGEX_H + r = apply_substitution(bsdtar, name, &subst_name, 0); + if (r == -1) { + bsdtar_warnc(bsdtar, 0, "Invalid substituion, skipping entry"); + return 1; + } + if (r == 1) { + archive_entry_copy_pathname(entry, subst_name); + if (*subst_name == '\0') { + free(subst_name); + return -1; + } else + free(subst_name); + name = archive_entry_pathname(entry); + } + + if (archive_entry_hardlink(entry)) { + r = apply_substitution(bsdtar, archive_entry_hardlink(entry), &subst_name, 1); + if (r == -1) { + bsdtar_warnc(bsdtar, 0, "Invalid substituion, skipping entry"); + return 1; + } + if (r == 1) { + archive_entry_copy_hardlink(entry, subst_name); + free(subst_name); + } + } + if (archive_entry_symlink(entry) != NULL) { + r = apply_substitution(bsdtar, archive_entry_symlink(entry), &subst_name, 1); + if (r == -1) { + bsdtar_warnc(bsdtar, 0, "Invalid substituion, skipping entry"); + return 1; + } + if (r == 1) { + archive_entry_copy_symlink(entry, subst_name); + free(subst_name); + } + } +#endif /* Strip leading dir names as per --strip-components option. */ - if (bsdtar->strip_components > 0) { - int r = bsdtar->strip_components; + if ((r = bsdtar->strip_components) > 0) { const char *p = name; while (r > 0) { @@ -368,6 +416,10 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry) return (1); } } + while (*name == '/') + ++name; + if (*name == '\0') + return (1); } /* Strip redundant leading '/' characters. */ diff --git a/libarchive/libarchive-2.4.17/tar/write.c b/libarchive/libarchive-2.5.5/tar/write.c index 3b8cc51..1a6e928 100644 --- a/libarchive/libarchive-2.4.17/tar/write.c +++ b/libarchive/libarchive-2.5.5/tar/write.c @@ -24,7 +24,7 @@ */ #include "bsdtar_platform.h" -__FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.64 2008/02/19 05:27:17 kientzle Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.70 2008/05/26 17:10:10 kientzle Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -62,9 +62,6 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.64 2008/02/19 05:27:17 kientzle #ifdef HAVE_LINUX_FS_H #include <linux/fs.h> /* for Linux file flags */ #endif -#ifdef HAVE_LINUX_EXT2_FS_H -#include <linux/ext2_fs.h> /* for Linux file flags */ -#endif #ifdef HAVE_PWD_H #include <pwd.h> #endif @@ -87,9 +84,6 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.64 2008/02/19 05:27:17 kientzle static const char * const NO_NAME = "(noname)"; -/* Initial size of link cache. */ -#define links_cache_initial_size 1024 - struct archive_dir_entry { struct archive_dir_entry *next; time_t mtime_sec; @@ -101,21 +95,6 @@ struct archive_dir { struct archive_dir_entry *head, *tail; }; -struct links_cache { - unsigned long number_entries; - size_t number_buckets; - struct links_entry **buckets; -}; - -struct links_entry { - struct links_entry *next; - struct links_entry *previous; - int links; - dev_t dev; - ino_t ino; - char *name; -}; - struct name_cache { int probes; int hits; @@ -139,13 +118,10 @@ static int archive_names_from_file_helper(struct bsdtar *bsdtar, static int copy_file_data(struct bsdtar *bsdtar, struct archive *a, struct archive *ina); static void create_cleanup(struct bsdtar *); -static void free_buckets(struct bsdtar *, struct links_cache *); static void free_cache(struct name_cache *cache); static const char * lookup_gname(struct bsdtar *bsdtar, gid_t gid); static int lookup_gname_helper(struct bsdtar *bsdtar, const char **name, id_t gid); -static void lookup_hardlink(struct bsdtar *, - struct archive_entry *entry, const struct stat *); static const char * lookup_uname(struct bsdtar *bsdtar, uid_t uid); static int lookup_uname_helper(struct bsdtar *bsdtar, const char **name, id_t uid); @@ -160,6 +136,8 @@ static void write_archive(struct archive *, struct bsdtar *); static void write_entry(struct bsdtar *, struct archive *, const struct stat *, const char *pathname, const char *accpath); +static void write_entry_backend(struct bsdtar *, struct archive *, + struct archive_entry *, int); static int write_file_data(struct bsdtar *, struct archive *, int fd); static void write_hierarchy(struct bsdtar *, struct archive *, @@ -174,6 +152,9 @@ tar_mode_c(struct bsdtar *bsdtar) if (*bsdtar->argv == NULL && bsdtar->names_from_file == NULL) bsdtar_errc(bsdtar, 1, 0, "no files or directories specified"); + /* We want to catch SIGINFO and SIGUSR1. */ + siginfo_init(bsdtar); + a = archive_write_new(); /* Support any format that the library supports. */ @@ -220,6 +201,9 @@ tar_mode_c(struct bsdtar *bsdtar) archive_write_set_compression_gzip(a); break; #endif + case 'Z': + archive_write_set_compression_compress(a); + break; default: bsdtar_errc(bsdtar, 1, 0, "Unrecognized compression option -%c", @@ -239,6 +223,9 @@ tar_mode_c(struct bsdtar *bsdtar) } archive_write_finish(a); + + /* Restore old SIGINFO + SIGUSR1 handlers. */ + siginfo_done(bsdtar); } /* @@ -257,6 +244,9 @@ tar_mode_r(struct bsdtar *bsdtar) /* Sanity-test some arguments and the file. */ test_for_append(bsdtar); + /* We want to catch SIGINFO and SIGUSR1. */ + siginfo_init(bsdtar); + format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED; bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT, 0666); @@ -355,6 +345,9 @@ tar_mode_u(struct bsdtar *bsdtar) /* Sanity-test some arguments and the file. */ test_for_append(bsdtar); + /* We want to catch SIGINFO and SIGUSR1. */ + siginfo_init(bsdtar); + bsdtar->fd = open(bsdtar->filename, O_RDWR); if (bsdtar->fd < 0) bsdtar_errc(bsdtar, 1, errno, @@ -439,6 +432,12 @@ static void write_archive(struct archive *a, struct bsdtar *bsdtar) { const char *arg; + struct archive_entry *entry, *sparse_entry; + + if ((bsdtar->resolver = archive_entry_linkresolver_new()) == NULL) + bsdtar_errc(bsdtar, 1, 0, "cannot create link resolver"); + archive_entry_linkresolver_set_strategy(bsdtar->resolver, + archive_format(a)); if (bsdtar->names_from_file != NULL) archive_names_from_file(bsdtar, a); @@ -471,6 +470,16 @@ write_archive(struct archive *a, struct bsdtar *bsdtar) bsdtar->argv++; } + entry = NULL; + archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry); + while (entry != NULL) { + int fd = -1; + write_entry_backend(bsdtar, a, entry, fd); + archive_entry_free(entry); + entry = NULL; + archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry); + } + create_cleanup(bsdtar); if (archive_write_close(a)) { bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a)); @@ -571,6 +580,10 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina) if (bsdtar->verbose) safe_fprintf(stderr, "a %s", archive_entry_pathname(in_entry)); + siginfo_setinfo(bsdtar, "copying", + archive_entry_pathname(in_entry), + archive_entry_size(in_entry)); + siginfo_printinfo(bsdtar, 0); e = archive_write_header(a, in_entry); if (e != ARCHIVE_OK) { @@ -584,9 +597,12 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina) if (e == ARCHIVE_FATAL) exit(1); - if (e >= ARCHIVE_WARN) - if (copy_file_data(bsdtar, a, ina)) + if (e >= ARCHIVE_WARN) { + if (archive_entry_size(in_entry) == 0) + archive_read_data_skip(ina); + else if (copy_file_data(bsdtar, a, ina)) exit(1); + } if (bsdtar->verbose) fprintf(stderr, "\n"); @@ -603,14 +619,18 @@ copy_file_data(struct bsdtar *bsdtar, struct archive *a, struct archive *ina) char buff[64*1024]; ssize_t bytes_read; ssize_t bytes_written; + off_t progress = 0; bytes_read = archive_read_data(ina, buff, sizeof(buff)); while (bytes_read > 0) { + siginfo_printinfo(bsdtar, progress); + bytes_written = archive_write_data(a, buff, bytes_read); if (bytes_written < bytes_read) { bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a)); return (-1); } + progress += bytes_written; bytes_read = archive_read_data(ina, buff, sizeof(buff)); } @@ -774,15 +794,62 @@ write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path) } /* + * Backend for write_entry. + */ +static void +write_entry_backend(struct bsdtar *bsdtar, struct archive *a, + struct archive_entry *entry, int fd) +{ + int e; + + if (fd == -1 && archive_entry_size(entry) > 0) { + const char *pathname = archive_entry_sourcepath(entry); + fd = open(pathname, O_RDONLY); + if (fd == -1) { + if (!bsdtar->verbose) + bsdtar_warnc(bsdtar, errno, + "%s: could not open file", pathname); + else + fprintf(stderr, ": %s", strerror(errno)); + return; + } + } + + e = archive_write_header(a, entry); + if (e != ARCHIVE_OK) { + if (!bsdtar->verbose) + bsdtar_warnc(bsdtar, 0, "%s: %s", + archive_entry_pathname(entry), + archive_error_string(a)); + else + fprintf(stderr, ": %s", archive_error_string(a)); + } + + if (e == ARCHIVE_FATAL) + exit(1); + + /* + * If we opened a file earlier, write it out now. Note that + * the format handler might have reset the size field to zero + * to inform us that the archive body won't get stored. In + * that case, just skip the write. + */ + if (e >= ARCHIVE_WARN && fd >= 0 && archive_entry_size(entry) > 0) { + if (write_file_data(bsdtar, a, fd)) + exit(1); + close(fd); + } +} + +/* * Add a single filesystem object to the archive. */ static void write_entry(struct bsdtar *bsdtar, struct archive *a, const struct stat *st, const char *pathname, const char *accpath) { - struct archive_entry *entry; - int e; - int fd; + struct archive_entry *entry, *sparse_entry; + int fd; #ifdef __linux int r; unsigned long stflags; @@ -793,6 +860,7 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, const struct stat *st, entry = archive_entry_new(); archive_entry_set_pathname(entry, pathname); + archive_entry_copy_sourcepath(entry, accpath); /* * Rewrite the pathname to be archived. If rewrite @@ -808,9 +876,6 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, const struct stat *st, if (!new_enough(bsdtar, archive_entry_pathname(entry), st)) goto abort; - if (!S_ISDIR(st->st_mode) && (st->st_nlink > 1)) - lookup_hardlink(bsdtar, entry, st); - /* Display entry as we process it. This format is required by SUSv2. */ if (bsdtar->verbose) safe_fprintf(stderr, "a %s", archive_entry_pathname(entry)); @@ -857,48 +922,25 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, const struct stat *st, setup_acls(bsdtar, entry, accpath); setup_xattrs(bsdtar, entry, accpath); - /* - * If it's a regular file (and non-zero in size) make sure we - * can open it before we start to write. In particular, note - * that we can always archive a zero-length file, even if we - * can't read it. - */ - if (S_ISREG(st->st_mode) && st->st_size > 0) { - fd = open(accpath, O_RDONLY); - if (fd < 0) { - if (!bsdtar->verbose) - bsdtar_warnc(bsdtar, errno, "%s: could not open file", pathname); - else - fprintf(stderr, ": %s", strerror(errno)); - goto cleanup; - } - } - /* Non-regular files get archived with zero size. */ if (!S_ISREG(st->st_mode)) archive_entry_set_size(entry, 0); - e = archive_write_header(a, entry); - if (e != ARCHIVE_OK) { - if (!bsdtar->verbose) - bsdtar_warnc(bsdtar, 0, "%s: %s", pathname, - archive_error_string(a)); - else - fprintf(stderr, ": %s", archive_error_string(a)); - } + /* Record what we're doing, for the benefit of SIGINFO / SIGUSR1. */ + siginfo_setinfo(bsdtar, "adding", archive_entry_pathname(entry), + archive_entry_size(entry)); + archive_entry_linkify(bsdtar->resolver, &entry, &sparse_entry); - if (e == ARCHIVE_FATAL) - exit(1); + /* Handle SIGINFO / SIGUSR1 request if one was made. */ + siginfo_printinfo(bsdtar, 0); - /* - * If we opened a file earlier, write it out now. Note that - * the format handler might have reset the size field to zero - * to inform us that the archive body won't get stored. In - * that case, just skip the write. - */ - if (e >= ARCHIVE_WARN && fd >= 0 && archive_entry_size(entry) > 0) - if (write_file_data(bsdtar, a, fd)) - exit(1); + while (entry != NULL) { + write_entry_backend(bsdtar, a, entry, fd); + fd = -1; + archive_entry_free(entry); + entry = sparse_entry; + sparse_entry = NULL; + } cleanup: if (bsdtar->verbose) @@ -908,8 +950,7 @@ abort: if (fd >= 0) close(fd); - if (entry != NULL) - archive_entry_free(entry); + archive_entry_free(entry); } @@ -920,12 +961,15 @@ write_file_data(struct bsdtar *bsdtar, struct archive *a, int fd) char buff[64*1024]; ssize_t bytes_read; ssize_t bytes_written; + off_t progress = 0; /* XXX TODO: Allocate buffer on heap and store pointer to * it in bsdtar structure; arrange cleanup as well. XXX */ bytes_read = read(fd, buff, sizeof(buff)); while (bytes_read > 0) { + siginfo_printinfo(bsdtar, progress); + bytes_written = archive_write_data(a, buff, bytes_read); if (bytes_written < 0) { /* Write failed; this is bad */ @@ -938,6 +982,7 @@ write_file_data(struct bsdtar *bsdtar, struct archive *a, int fd) "Truncated write; file may have grown while being archived."); return (0); } + progress += bytes_written; bytes_read = read(fd, buff, sizeof(buff)); } return 0; @@ -947,169 +992,12 @@ write_file_data(struct bsdtar *bsdtar, struct archive *a, int fd) static void create_cleanup(struct bsdtar *bsdtar) { - /* Free inode->pathname map used for hardlink detection. */ - if (bsdtar->links_cache != NULL) { - free_buckets(bsdtar, bsdtar->links_cache); - free(bsdtar->links_cache); - bsdtar->links_cache = NULL; - } - free_cache(bsdtar->uname_cache); bsdtar->uname_cache = NULL; free_cache(bsdtar->gname_cache); bsdtar->gname_cache = NULL; } - -static void -free_buckets(struct bsdtar *bsdtar, struct links_cache *links_cache) -{ - size_t i; - - if (links_cache->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 (bsdtar->option_warn_links) - bsdtar_warnc(bsdtar, 0, "Missing links to %s", - links_cache->buckets[i]->name); - if (links_cache->buckets[i]->name != NULL) - free(links_cache->buckets[i]->name); - free(links_cache->buckets[i]); - links_cache->buckets[i] = lp; - } - } - free(links_cache->buckets); - links_cache->buckets = NULL; -} - -static void -lookup_hardlink(struct bsdtar *bsdtar, struct archive_entry *entry, - const struct stat *st) -{ - struct links_cache *links_cache; - struct links_entry *le, **new_buckets; - int hash; - size_t i, new_size; - - /* If necessary, initialize the links cache. */ - links_cache = bsdtar->links_cache; - if (links_cache == NULL) { - bsdtar->links_cache = malloc(sizeof(struct links_cache)); - if (bsdtar->links_cache == NULL) - bsdtar_errc(bsdtar, 1, ENOMEM, - "No memory for hardlink detection."); - links_cache = bsdtar->links_cache; - memset(links_cache, 0, sizeof(struct links_cache)); - 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) { - bsdtar_errc(bsdtar, 1, ENOMEM, - "No memory for hardlink detection."); - } - for (i = 0; i < links_cache->number_buckets; i++) - links_cache->buckets[i] = NULL; - } - - /* If the links cache overflowed and got flushed, don't bother. */ - if (links_cache->buckets == NULL) - return; - - /* If the links cache is getting too full, enlarge the hash table. */ - if (links_cache->number_entries > links_cache->number_buckets * 2) - { - 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; - } - } - free(links_cache->buckets); - links_cache->buckets = new_buckets; - links_cache->number_buckets = new_size; - } else { - free_buckets(bsdtar, links_cache); - bsdtar_warnc(bsdtar, ENOMEM, - "No more memory for recording hard links"); - bsdtar_warnc(bsdtar, 0, - "Remaining links will be dumped as full files"); - } - } - - /* Try to locate this entry in the links cache. */ - hash = ( st->st_dev ^ st->st_ino ) % links_cache->number_buckets; - for (le = links_cache->buckets[hash]; le != NULL; le = le->next) { - if (le->dev == st->st_dev && le->ino == st->st_ino) { - archive_entry_copy_hardlink(entry, le->name); - - /* - * Decrement link count each time and release - * the entry if it hits zero. This saves - * memory and is necessary for proper -l - * implementation. - */ - if (--le->links <= 0) { - if (le->previous != NULL) - le->previous->next = le->next; - if (le->next != NULL) - le->next->previous = le->previous; - if (le->name != NULL) - free(le->name); - if (links_cache->buckets[hash] == le) - links_cache->buckets[hash] = le->next; - links_cache->number_entries--; - free(le); - } - - return; - } - } - - /* Add this entry to the links cache. */ - le = malloc(sizeof(struct links_entry)); - if (le != NULL) - le->name = strdup(archive_entry_pathname(entry)); - if ((le == NULL) || (le->name == NULL)) { - free_buckets(bsdtar, links_cache); - bsdtar_warnc(bsdtar, ENOMEM, - "No more memory for recording hard links"); - bsdtar_warnc(bsdtar, 0, - "Remaining hard links will be dumped as full files"); - if (le != NULL) - free(le); - return; - } - if (links_cache->buckets[hash] != NULL) - links_cache->buckets[hash]->previous = le; - links_cache->number_entries++; - le->next = links_cache->buckets[hash]; - le->previous = NULL; - links_cache->buckets[hash] = le; - le->dev = st->st_dev; - le->ino = st->st_ino; - le->links = st->st_nlink - 1; -} - #ifdef HAVE_POSIX_ACL static void setup_acl(struct bsdtar *bsdtar, struct archive_entry *entry, const char *accpath, @@ -1531,7 +1419,7 @@ test_for_append(struct bsdtar *bsdtar) { struct stat s; - if (*bsdtar->argv == NULL) + if (*bsdtar->argv == NULL && bsdtar->names_from_file == NULL) bsdtar_errc(bsdtar, 1, 0, "no files or directories specified"); if (bsdtar->filename == NULL) bsdtar_errc(bsdtar, 1, 0, "Cannot append to stdout."); diff --git a/libarchive/libarchive-2.5.5/version b/libarchive/libarchive-2.5.5/version new file mode 100644 index 0000000..b50fb11 --- /dev/null +++ b/libarchive/libarchive-2.5.5/version @@ -0,0 +1 @@ +2005005 diff --git a/libarchive/libarchive-2.5.5/windows/mvcpp.nt b/libarchive/libarchive-2.5.5/windows/mvcpp.nt new file mode 100644 index 0000000..03fa672 --- /dev/null +++ b/libarchive/libarchive-2.5.5/windows/mvcpp.nt @@ -0,0 +1,117 @@ +#/* FILE: mvcpp.nt
+# *
+# * Copyright (c) 2008
+# * TouchNet Information Systems, Inc.
+# * All Rights Reserved
+# *
+# * This program is an unpublished copyright work of TouchNet Information
+# * Systems, Inc. of Lenexa, KS. The program, all information disclosed
+# * and the matter shown and described hereon or herewith are confidential
+# * and proprietary to TouchNet Information Systems, Inc.
+# *
+# ******************************************************************************
+# *
+# * $Author: $
+# * $Locker: $
+# * $ProjectName: $
+# * $ProjectRevision: $
+# * $Revision: $
+# * $Date: $
+# * $State: $
+# * $RCSfile: $
+# * $Source: $
+# *
+# * Change Log:
+# * $Log: $
+# *
+# */
+
+.SUFFIXES : .c .cpp .obm
+
+ZLIB_INCL=\3rdParty\ZLib\Current\Include
+
+EXTRA_DEFINES=/DLIBARCHIVE_STATIC=1
+
+!ifdef DEBUG
+DEST_PATH=.\lib\mvcpp\debug
+OBJ_DIR=obj\debug
+COMPILE_FLAG=/MTd /DDEBUG=1 $(EXTRA_DEFINES) /Zi /Fd$(OBJ_DIR)\libarchive.pdb
+!else
+DEST_PATH=.\lib\mvcpp
+OBJ_DIR=obj
+COMPILE_FLAG=/MT $(EXTRA_DEFINES) /Fd$(OBJ_DIR)\libarchive.pdb
+!endif
+
+INCLUDE=.;$(MSDEVDIR)\INCLUDE;$(ZLIB_INCL);
+INCLUDE_OPTS=
+
+NT_CPP=cl
+NT_C=cl
+NT_LIBRARIAN=lib
+
+###
+NT_C_OPTS=$(COMPILE_FLAG) /GX /Zl /Zp1 /nologo /c /G5 /Oi /Ot /TC /DVC_EXTRANLEAN /DWIN32_LEAN_AND_MEAN $(INCLUDE_OPTS)
+NT_CPP_OPTS=$(COMPILE_FLAG) /GX /Zl /Zp1 /nologo /c /G5 /Oi /Ot /TP /DVC_EXTRANLEAN /DWIN32_LEAN_AND_MEAN $(INCLUDE_OPTS)
+NT_LIB_OPTS=
+
+.cpp{$(OBJ_DIR)}.obm:
+ -md $(OBJ_DIR) > nul 2>nul
+ $(NT_CPP) $(NT_CPP_OPTS) -Fo$*.obm $<
+
+.c{$(OBJ_DIR)}.obm:
+ -md $(OBJ_DIR) > nul 2>nul
+ $(NT_C) $(NT_C_OPTS) -Fo$*.obm $<
+
+
+OBJS=\
+ $(OBJ_DIR)\archive_check_magic.obm $(OBJ_DIR)\archive_entry.obm \
+ $(OBJ_DIR)\archive_entry_copy_stat.obm $(OBJ_DIR)\archive_entry_link_resolver.obm \
+ $(OBJ_DIR)\archive_entry_stat.obm $(OBJ_DIR)\archive_entry_strmode.obm \
+ $(OBJ_DIR)\archive_read.obm $(OBJ_DIR)\archive_read_data_into_fd.obm \
+ $(OBJ_DIR)\archive_read_extract.obm $(OBJ_DIR)\archive_read_open_fd.obm \
+ $(OBJ_DIR)\archive_read_open_file.obm $(OBJ_DIR)\archive_read_open_filename.obm \
+ $(OBJ_DIR)\archive_read_open_memory.obm $(OBJ_DIR)\archive_read_support_compression_all.obm \
+ $(OBJ_DIR)\archive_read_support_compression_bzip2.obm \
+ $(OBJ_DIR)\archive_read_support_compression_compress.obm \
+ $(OBJ_DIR)\archive_read_support_compression_gzip.obm \
+ $(OBJ_DIR)\archive_read_support_compression_none.obm \
+ $(OBJ_DIR)\archive_read_support_compression_program.obm \
+ $(OBJ_DIR)\archive_read_support_format_all.obm \
+ $(OBJ_DIR)\archive_read_support_format_ar.obm \
+ $(OBJ_DIR)\archive_read_support_format_cpio.obm \
+ $(OBJ_DIR)\archive_read_support_format_empty.obm \
+ $(OBJ_DIR)\archive_read_support_format_iso9660.obm \
+ $(OBJ_DIR)\archive_read_support_format_mtree.obm \
+ $(OBJ_DIR)\archive_read_support_format_tar.obm \
+ $(OBJ_DIR)\archive_read_support_format_zip.obm \
+ $(OBJ_DIR)\archive_string.obm $(OBJ_DIR)\archive_string_sprintf.obm \
+ $(OBJ_DIR)\archive_util.obm $(OBJ_DIR)\archive_virtual.obm \
+ $(OBJ_DIR)\archive_write.obm $(OBJ_DIR)\archive_write_disk.obm \
+ $(OBJ_DIR)\archive_write_disk_set_standard_lookup.obm \
+ $(OBJ_DIR)\archive_write_open_fd.obm $(OBJ_DIR)\archive_write_open_file.obm \
+ $(OBJ_DIR)\archive_write_open_filename.obm $(OBJ_DIR)\archive_write_open_memory.obm \
+ $(OBJ_DIR)\archive_write_set_compression_bzip2.obm $(OBJ_DIR)\archive_write_set_compression_compress.obm \
+ $(OBJ_DIR)\archive_write_set_compression_gzip.obm $(OBJ_DIR)\archive_write_set_compression_none.obm \
+ $(OBJ_DIR)\archive_write_set_compression_program.obm $(OBJ_DIR)\archive_write_set_format.obm \
+ $(OBJ_DIR)\archive_write_set_format_ar.obm $(OBJ_DIR)\archive_write_set_format_by_name.obm \
+ $(OBJ_DIR)\archive_write_set_format_cpio.obm $(OBJ_DIR)\archive_write_set_format_cpio_newc.obm \
+ $(OBJ_DIR)\archive_write_set_format_pax.obm $(OBJ_DIR)\archive_write_set_format_shar.obm \
+ $(OBJ_DIR)\archive_write_set_format_ustar.obm $(OBJ_DIR)\filter_fork.obm \
+ $(OBJ_DIR)\libarchive-nonposix.obm
+
+all: CLEAN $(DEST_PATH)\libarchive.lib
+
+$(DEST_PATH)\libarchive.lib :: $(OBJS) $(DEST_PATH)
+
+$(DEST_PATH)\libarchive.lib ::
+ $(NT_LIBRARIAN) $(NT_LIB_OPTS) /OUT:$(DEST_PATH)\libarchive.lib $(OBJS)
+
+$(DEST_PATH):
+ -md $(DEST_PATH) > nul 2>nul
+
+CLEAN:
+!ifdef CLEAN
+ -del $(OBJ_DIR)\*.pd? > nul 2>nul
+ -ren $(OBJ_DIR)\*.pdb *.pd1 > nul 2>nul
+ -ren $(OBJ_DIR)\*.pdb *.pd2 > nul 2>nul
+!endif
diff --git a/libarchive/libarchive-2.5.5/windows/wccpp.nt b/libarchive/libarchive-2.5.5/windows/wccpp.nt new file mode 100644 index 0000000..721fa6a --- /dev/null +++ b/libarchive/libarchive-2.5.5/windows/wccpp.nt @@ -0,0 +1,107 @@ +#/* FILE: wccpp.nt
+# *
+# * Copyright (c) 2008
+# * TouchNet Information Systems, Inc.
+# * All Rights Reserved
+# *
+# * This program is an unpublished copyright work of TouchNet Information
+# * Systems, Inc. of Lenexa, KS. The program, all information disclosed
+# * and the matter shown and described hereon or herewith are confidential
+# * and proprietary to TouchNet Information Systems, Inc.
+# *
+# ******************************************************************************
+# *
+# * $Author: $
+# * $Locker: $
+# * $ProjectName: $
+# * $ProjectRevision: $
+# * $Revision: $
+# * $Date: $
+# * $State: $
+# * $RCSfile: $
+# * $Source: $
+# *
+# * Change Log:
+# * $Log: $
+# *
+# */
+
+.EXTENSIONS:
+.EXTENSIONS: .obn .cpp .c
+
+ZLIB_INCL=\3rdParty\ZLib\Current\Include
+
+!ifdef DEBUG
+DEST_PATH=.\lib\wccpp\debug
+OBJ_DIR=obj\debug
+EXT_COMPILE_FLAG=-d2 -DLIBARCHIVE_STATIC=1
+!else
+DEST_PATH=.\lib\wccpp
+OBJ_DIR=obj
+EXT_COMPILE_FLAG=-DLIBARCHIVE_STATIC=1
+!endif
+
+# ----- NT compiler options -----------------------------------------------
+NT_CPP=wpp386
+NT_C=wcc386
+NT_LIBRARIAN=wlib
+
+
+###
+INCLUDE_OPTS=/I.;$(%watcom)\h;$(%watcom)\h\nt;$(ZLIB_INCL);
+NT_CPP_OPTS=-ei -wx -xs -xss -xst -od -of+ -zp1 -5 -bt=nt -bm $(EXT_COMPILE_FLAG) $(INCLUDE_OPTS) -DWIN32_LEAN_AND_MEAN
+NT_C_OPTS=-ei -wx -od -of+ -zp1 -5 -bt=nt -bm $(EXT_COMPILE_FLAG) $(INCLUDE_OPTS) -DWIN32_LEAN_AND_MEAN
+NT_LIB_OPTS=
+
+.cpp{$(OBJ_DIR)}.obn:
+ -md $(OBJ_DIR) > nul 2>nul
+ $(NT_CPP) $(NT_CPP_OPTS) -zp1 -fo=$*.obn $<
+
+.c{$(OBJ_DIR)}.obn:
+ -md $(OBJ_DIR) > nul 2>nul
+ $(NT_C) $(NT_C_OPTS) -zp1 -fo=$*.obn $<
+
+OBJS = &
+ $(OBJ_DIR)\archive_check_magic.obn $(OBJ_DIR)\archive_entry.obn &
+ $(OBJ_DIR)\archive_entry_copy_stat.obn $(OBJ_DIR)\archive_entry_link_resolver.obn &
+ $(OBJ_DIR)\archive_entry_stat.obn $(OBJ_DIR)\archive_entry_strmode.obn &
+ $(OBJ_DIR)\archive_read.obn $(OBJ_DIR)\archive_read_data_into_fd.obn &
+ $(OBJ_DIR)\archive_read_extract.obn $(OBJ_DIR)\archive_read_open_fd.obn &
+ $(OBJ_DIR)\archive_read_open_file.obn $(OBJ_DIR)\archive_read_open_filename.obn &
+ $(OBJ_DIR)\archive_read_open_memory.obn $(OBJ_DIR)\archive_read_support_compression_all.obn &
+ $(OBJ_DIR)\archive_read_support_compression_bzip2.obn &
+ $(OBJ_DIR)\archive_read_support_compression_compress.obn &
+ $(OBJ_DIR)\archive_read_support_compression_gzip.obn &
+ $(OBJ_DIR)\archive_read_support_compression_none.obn &
+ $(OBJ_DIR)\archive_read_support_compression_program.obn &
+ $(OBJ_DIR)\archive_read_support_format_all.obn &
+ $(OBJ_DIR)\archive_read_support_format_ar.obn &
+ $(OBJ_DIR)\archive_read_support_format_cpio.obn &
+ $(OBJ_DIR)\archive_read_support_format_empty.obn &
+ $(OBJ_DIR)\archive_read_support_format_iso9660.obn &
+ $(OBJ_DIR)\archive_read_support_format_mtree.obn &
+ $(OBJ_DIR)\archive_read_support_format_tar.obn &
+ $(OBJ_DIR)\archive_read_support_format_zip.obn &
+ $(OBJ_DIR)\archive_string.obn $(OBJ_DIR)\archive_string_sprintf.obn &
+ $(OBJ_DIR)\archive_util.obn $(OBJ_DIR)\archive_virtual.obn &
+ $(OBJ_DIR)\archive_write.obn $(OBJ_DIR)\archive_write_disk.obn &
+ $(OBJ_DIR)\archive_write_disk_set_standard_lookup.obn &
+ $(OBJ_DIR)\archive_write_open_fd.obn $(OBJ_DIR)\archive_write_open_file.obn &
+ $(OBJ_DIR)\archive_write_open_filename.obn $(OBJ_DIR)\archive_write_open_memory.obn &
+ $(OBJ_DIR)\archive_write_set_compression_bzip2.obn $(OBJ_DIR)\archive_write_set_compression_compress.obn &
+ $(OBJ_DIR)\archive_write_set_compression_gzip.obn $(OBJ_DIR)\archive_write_set_compression_none.obn &
+ $(OBJ_DIR)\archive_write_set_compression_program.obn $(OBJ_DIR)\archive_write_set_format.obn &
+ $(OBJ_DIR)\archive_write_set_format_ar.obn $(OBJ_DIR)\archive_write_set_format_by_name.obn &
+ $(OBJ_DIR)\archive_write_set_format_cpio.obn $(OBJ_DIR)\archive_write_set_format_cpio_newc.obn &
+ $(OBJ_DIR)\archive_write_set_format_pax.obn $(OBJ_DIR)\archive_write_set_format_shar.obn &
+ $(OBJ_DIR)\archive_write_set_format_ustar.obn $(OBJ_DIR)\filter_fork.obn &
+ $(OBJ_DIR)\libarchive-nonposix.obn
+
+$(DEST_PATH)\LibArchive.lib :: $(OBJS) $(DEST_PATH)
+
+$(DEST_PATH)\LibArchive.lib ::
+ -md $(DEST_PATH) > nul 2>nul
+ $(NT_LIBRARIAN) $@ -+ $(OBJS)
+
+$(DEST_PATH):
+ -md $(DEST_PATH) > nul 2>nul
|
