Merge lp:~akopytov/percona-xtrabackup/parallel-compression into lp:percona-xtrabackup/2.0
- parallel-compression
- Merge into 2.0
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Stewart Smith | ||||||||
Approved revision: | no longer in the source branch. | ||||||||
Merged at revision: | 390 | ||||||||
Proposed branch: | lp:~akopytov/percona-xtrabackup/parallel-compression | ||||||||
Merge into: | lp:percona-xtrabackup/2.0 | ||||||||
Diff against target: |
135301 lines (+129557/-1822) 440 files modified
innobackupex (+68/-120) patches/tar4ibd_libtar-1.2.11.patch (+0/-793) src/Makefile (+135/-91) src/common.h (+73/-0) src/compress.c (+491/-0) src/compress.h (+28/-0) src/datasink.h (+48/-0) src/libarchive/CMakeLists.txt (+855/-0) src/libarchive/COPYING (+60/-0) src/libarchive/INSTALL (+30/-0) src/libarchive/Makefile.am (+629/-0) src/libarchive/NEWS (+545/-0) src/libarchive/README (+137/-0) src/libarchive/build/autoconf/check_stdcall_func.m4 (+51/-0) src/libarchive/build/autoconf/compile (+143/-0) src/libarchive/build/autoconf/config.guess (+1501/-0) src/libarchive/build/autoconf/config.sub (+1705/-0) src/libarchive/build/autoconf/depcomp (+630/-0) src/libarchive/build/autoconf/install-sh (+520/-0) src/libarchive/build/autoconf/la_uid_t.m4 (+20/-0) src/libarchive/build/autoconf/ltmain.sh (+9655/-0) src/libarchive/build/autoconf/missing (+376/-0) src/libarchive/build/autogen.sh (+65/-0) src/libarchive/build/bump-version.sh (+36/-0) src/libarchive/build/clean.sh (+81/-0) src/libarchive/build/cmake/AddTest28.cmake (+107/-0) src/libarchive/build/cmake/CheckFileOffsetBits.c (+14/-0) src/libarchive/build/cmake/CheckFileOffsetBits.cmake (+44/-0) src/libarchive/build/cmake/CheckFuncs.cmake (+49/-0) src/libarchive/build/cmake/CheckFuncs_stub.c.in (+16/-0) src/libarchive/build/cmake/CheckHeaderDirent.cmake (+32/-0) src/libarchive/build/cmake/CheckStructMember.cmake (+43/-0) src/libarchive/build/cmake/CheckTypeExists.cmake (+42/-0) src/libarchive/build/cmake/FindLZMA.cmake (+52/-0) src/libarchive/build/cmake/config.h.in (+756/-0) src/libarchive/build/pkgconfig/libarchive.pc.in (+10/-0) src/libarchive/build/version (+1/-0) src/libarchive/build/windows/mvcpp.nt (+117/-0) src/libarchive/build/windows/vc71/libarchive.sln (+23/-0) src/libarchive/build/windows/vc71/libarchive.vcproj (+327/-0) src/libarchive/build/windows/vc80/libarchive.sln (+25/-0) src/libarchive/build/windows/vc80/libarchive.vcproj (+455/-0) src/libarchive/build/windows/vc80/libarchive_test/libarchive_test.vcproj (+495/-0) src/libarchive/build/windows/vc90/libarchive.sln (+25/-0) src/libarchive/build/windows/vc90/libarchive.vcproj (+456/-0) src/libarchive/build/windows/vc90/libarchive_test/libarchive_test.vcproj (+494/-0) src/libarchive/build/windows/wccpp.nt (+107/-0) src/libarchive/config.h.in (+772/-0) src/libarchive/configure.ac (+508/-0) src/libarchive/contrib/README (+32/-0) src/libarchive/contrib/libarchive.1aix53.spec (+160/-0) src/libarchive/contrib/libarchive.spec (+147/-0) src/libarchive/contrib/libarchive_autodetect-st_lib_archive.m4 (+154/-0) src/libarchive/contrib/psota-benchmark/results.txt (+122/-0) src/libarchive/contrib/psota-benchmark/tcp.sh (+104/-0) src/libarchive/contrib/shar/shar.1 (+128/-0) src/libarchive/contrib/shar/shar.c (+314/-0) src/libarchive/contrib/shar/tree.c (+542/-0) src/libarchive/contrib/shar/tree.h (+115/-0) src/libarchive/contrib/shar/tree_config.h (+78/-0) src/libarchive/contrib/untar.c (+225/-0) src/libarchive/cpio/CMakeLists.txt (+51/-0) src/libarchive/cpio/bsdcpio.1 (+405/-0) src/libarchive/cpio/cmdline.c (+369/-0) src/libarchive/cpio/config_freebsd.h (+56/-0) src/libarchive/cpio/cpio.c (+1267/-0) src/libarchive/cpio/cpio.h (+109/-0) src/libarchive/cpio/cpio_platform.h (+77/-0) src/libarchive/cpio/cpio_windows.c (+338/-0) src/libarchive/cpio/cpio_windows.h (+72/-0) src/libarchive/cpio/test/CMakeLists.txt (+79/-0) src/libarchive/cpio/test/main.c (+2140/-0) src/libarchive/cpio/test/test.h (+285/-0) src/libarchive/cpio/test/test_0.c (+67/-0) src/libarchive/cpio/test/test_basic.c (+173/-0) src/libarchive/cpio/test/test_cmdline.c (+107/-0) src/libarchive/cpio/test/test_format_newc.c (+294/-0) src/libarchive/cpio/test/test_gcpio_compat.c (+108/-0) src/libarchive/cpio/test/test_gcpio_compat_ref.bin.uu (+16/-0) src/libarchive/cpio/test/test_gcpio_compat_ref.crc.uu (+27/-0) src/libarchive/cpio/test/test_gcpio_compat_ref.newc.uu (+27/-0) src/libarchive/cpio/test/test_gcpio_compat_ref.ustar.uu (+84/-0) src/libarchive/cpio/test/test_gcpio_compat_ref_nosym.bin.uu (+15/-0) src/libarchive/cpio/test/test_gcpio_compat_ref_nosym.crc.uu (+15/-0) src/libarchive/cpio/test/test_gcpio_compat_ref_nosym.newc.uu (+15/-0) src/libarchive/cpio/test/test_gcpio_compat_ref_nosym.ustar.uu (+72/-0) src/libarchive/cpio/test/test_option_B_upper.c (+52/-0) src/libarchive/cpio/test/test_option_C_upper.c (+62/-0) src/libarchive/cpio/test/test_option_J_upper.c (+56/-0) src/libarchive/cpio/test/test_option_L_upper.c (+101/-0) src/libarchive/cpio/test/test_option_Z_upper.c (+56/-0) src/libarchive/cpio/test/test_option_a.c (+154/-0) src/libarchive/cpio/test/test_option_c.c (+221/-0) src/libarchive/cpio/test/test_option_d.c (+64/-0) src/libarchive/cpio/test/test_option_f.c (+76/-0) src/libarchive/cpio/test/test_option_f.cpio.uu (+16/-0) src/libarchive/cpio/test/test_option_help.c (+84/-0) src/libarchive/cpio/test/test_option_l.c (+50/-0) src/libarchive/cpio/test/test_option_lzma.c (+56/-0) src/libarchive/cpio/test/test_option_m.c (+63/-0) src/libarchive/cpio/test/test_option_m.cpio.uu (+16/-0) src/libarchive/cpio/test/test_option_t.c (+95/-0) src/libarchive/cpio/test/test_option_t.cpio.uu (+16/-0) src/libarchive/cpio/test/test_option_t.stdout.uu (+5/-0) src/libarchive/cpio/test/test_option_tv.stdout.uu (+6/-0) src/libarchive/cpio/test/test_option_u.c (+81/-0) src/libarchive/cpio/test/test_option_version.c (+109/-0) src/libarchive/cpio/test/test_option_y.c (+57/-0) src/libarchive/cpio/test/test_option_z.c (+56/-0) src/libarchive/cpio/test/test_owner_parse.c (+122/-0) src/libarchive/cpio/test/test_passthrough_dotdot.c (+76/-0) src/libarchive/cpio/test/test_passthrough_reverse.c (+85/-0) src/libarchive/cpio/test/test_pathmatch.c (+243/-0) src/libarchive/doc/mdoc2man.awk (+391/-0) src/libarchive/doc/mdoc2wiki.awk (+448/-0) src/libarchive/doc/update.sh (+107/-0) src/libarchive/examples/minitar/README (+12/-0) src/libarchive/examples/minitar/minitar.c (+421/-0) src/libarchive/examples/minitar/tree.c (+423/-0) src/libarchive/examples/minitar/tree.h (+78/-0) src/libarchive/examples/tarfilter.c (+113/-0) src/libarchive/examples/untar.c (+262/-0) src/libarchive/libarchive/CMakeLists.txt (+139/-0) src/libarchive/libarchive/archive.h (+741/-0) src/libarchive/libarchive/archive_check_magic.c (+134/-0) src/libarchive/libarchive/archive_crc32.h (+66/-0) src/libarchive/libarchive/archive_endian.h (+162/-0) src/libarchive/libarchive/archive_entry.3 (+433/-0) src/libarchive/libarchive/archive_entry.c (+2202/-0) src/libarchive/libarchive/archive_entry.h (+524/-0) src/libarchive/libarchive/archive_entry_copy_bhfi.c (+74/-0) src/libarchive/libarchive/archive_entry_copy_stat.c (+77/-0) src/libarchive/libarchive/archive_entry_link_resolver.c (+405/-0) src/libarchive/libarchive/archive_entry_private.h (+184/-0) src/libarchive/libarchive/archive_entry_stat.c (+118/-0) src/libarchive/libarchive/archive_entry_strmode.c (+87/-0) src/libarchive/libarchive/archive_entry_xattr.c (+158/-0) src/libarchive/libarchive/archive_hash.h (+281/-0) src/libarchive/libarchive/archive_platform.h (+165/-0) src/libarchive/libarchive/archive_private.h (+124/-0) src/libarchive/libarchive/archive_read.3 (+714/-0) src/libarchive/libarchive/archive_read.c (+1249/-0) src/libarchive/libarchive/archive_read_data_into_fd.c (+93/-0) src/libarchive/libarchive/archive_read_disk.3 (+308/-0) src/libarchive/libarchive/archive_read_disk.c (+198/-0) src/libarchive/libarchive/archive_read_disk_entry_from_file.c (+570/-0) src/libarchive/libarchive/archive_read_disk_private.h (+62/-0) src/libarchive/libarchive/archive_read_disk_set_standard_lookup.c (+303/-0) src/libarchive/libarchive/archive_read_extract.c (+182/-0) src/libarchive/libarchive/archive_read_open_fd.c (+190/-0) src/libarchive/libarchive/archive_read_open_file.c (+165/-0) src/libarchive/libarchive/archive_read_open_filename.c (+272/-0) src/libarchive/libarchive/archive_read_open_memory.c (+156/-0) src/libarchive/libarchive/archive_read_private.h (+199/-0) src/libarchive/libarchive/archive_read_support_compression_all.c (+60/-0) src/libarchive/libarchive/archive_read_support_compression_bzip2.c (+353/-0) src/libarchive/libarchive/archive_read_support_compression_compress.c (+444/-0) src/libarchive/libarchive/archive_read_support_compression_gzip.c (+465/-0) src/libarchive/libarchive/archive_read_support_compression_none.c (+40/-0) src/libarchive/libarchive/archive_read_support_compression_program.c (+459/-0) src/libarchive/libarchive/archive_read_support_compression_rpm.c (+287/-0) src/libarchive/libarchive/archive_read_support_compression_uu.c (+627/-0) src/libarchive/libarchive/archive_read_support_compression_xz.c (+708/-0) src/libarchive/libarchive/archive_read_support_format_all.c (+43/-0) src/libarchive/libarchive/archive_read_support_format_ar.c (+584/-0) src/libarchive/libarchive/archive_read_support_format_cpio.c (+777/-0) src/libarchive/libarchive/archive_read_support_format_empty.c (+93/-0) src/libarchive/libarchive/archive_read_support_format_iso9660.c (+2830/-0) src/libarchive/libarchive/archive_read_support_format_mtree.c (+1304/-0) src/libarchive/libarchive/archive_read_support_format_raw.c (+185/-0) src/libarchive/libarchive/archive_read_support_format_tar.c (+2418/-0) src/libarchive/libarchive/archive_read_support_format_xar.c (+3151/-0) src/libarchive/libarchive/archive_read_support_format_zip.c (+903/-0) src/libarchive/libarchive/archive_string.c (+453/-0) src/libarchive/libarchive/archive_string.h (+148/-0) src/libarchive/libarchive/archive_string_sprintf.c (+164/-0) src/libarchive/libarchive/archive_util.3 (+160/-0) src/libarchive/libarchive/archive_util.c (+391/-0) src/libarchive/libarchive/archive_virtual.c (+94/-0) src/libarchive/libarchive/archive_windows.c (+1236/-0) src/libarchive/libarchive/archive_windows.h (+347/-0) src/libarchive/libarchive/archive_write.3 (+629/-0) src/libarchive/libarchive/archive_write.c (+466/-0) src/libarchive/libarchive/archive_write_disk.3 (+375/-0) src/libarchive/libarchive/archive_write_disk.c (+2628/-0) src/libarchive/libarchive/archive_write_disk_private.h (+38/-0) src/libarchive/libarchive/archive_write_disk_set_standard_lookup.c (+262/-0) src/libarchive/libarchive/archive_write_open_fd.c (+141/-0) src/libarchive/libarchive/archive_write_open_file.c (+105/-0) src/libarchive/libarchive/archive_write_open_filename.c (+162/-0) src/libarchive/libarchive/archive_write_open_memory.c (+126/-0) src/libarchive/libarchive/archive_write_private.h (+122/-0) src/libarchive/libarchive/archive_write_set_compression_bzip2.c (+408/-0) src/libarchive/libarchive/archive_write_set_compression_compress.c (+492/-0) src/libarchive/libarchive/archive_write_set_compression_gzip.c (+477/-0) src/libarchive/libarchive/archive_write_set_compression_none.c (+257/-0) src/libarchive/libarchive/archive_write_set_compression_program.c (+347/-0) src/libarchive/libarchive/archive_write_set_compression_xz.c (+438/-0) src/libarchive/libarchive/archive_write_set_format.c (+72/-0) src/libarchive/libarchive/archive_write_set_format_ar.c (+550/-0) src/libarchive/libarchive/archive_write_set_format_by_name.c (+76/-0) src/libarchive/libarchive/archive_write_set_format_cpio.c (+344/-0) src/libarchive/libarchive/archive_write_set_format_cpio_newc.c (+295/-0) src/libarchive/libarchive/archive_write_set_format_mtree.c (+1050/-0) src/libarchive/libarchive/archive_write_set_format_pax.c (+1386/-0) src/libarchive/libarchive/archive_write_set_format_shar.c (+626/-0) src/libarchive/libarchive/archive_write_set_format_ustar.c (+587/-0) src/libarchive/libarchive/archive_write_set_format_zip.c (+667/-0) src/libarchive/libarchive/config_freebsd.h (+154/-0) src/libarchive/libarchive/cpio.5 (+325/-0) src/libarchive/libarchive/filter_fork.c (+161/-0) src/libarchive/libarchive/filter_fork.h (+41/-0) src/libarchive/libarchive/filter_fork_windows.c (+113/-0) src/libarchive/libarchive/libarchive-formats.5 (+355/-0) src/libarchive/libarchive/libarchive.3 (+331/-0) src/libarchive/libarchive/libarchive_internals.3 (+365/-0) src/libarchive/libarchive/mtree.5 (+269/-0) src/libarchive/libarchive/tar.5 (+831/-0) src/libarchive/libarchive/test/CMakeLists.txt (+158/-0) src/libarchive/libarchive/test/README (+63/-0) src/libarchive/libarchive/test/main.c (+2130/-0) src/libarchive/libarchive/test/read_open_memory.c (+167/-0) src/libarchive/libarchive/test/test.h (+302/-0) src/libarchive/libarchive/test/test_acl_basic.c (+229/-0) src/libarchive/libarchive/test/test_acl_freebsd.c (+255/-0) src/libarchive/libarchive/test/test_acl_pax.c (+517/-0) src/libarchive/libarchive/test/test_archive_api_feature.c (+76/-0) src/libarchive/libarchive/test/test_bad_fd.c (+41/-0) src/libarchive/libarchive/test/test_compat_bzip2.c (+85/-0) src/libarchive/libarchive/test/test_compat_bzip2_1.tbz.uu (+24/-0) src/libarchive/libarchive/test/test_compat_bzip2_2.tbz.uu (+11/-0) src/libarchive/libarchive/test/test_compat_cpio.c (+106/-0) src/libarchive/libarchive/test/test_compat_cpio_1.cpio.uu (+19/-0) src/libarchive/libarchive/test/test_compat_gtar.c (+119/-0) src/libarchive/libarchive/test/test_compat_gtar_1.tar.uu (+232/-0) src/libarchive/libarchive/test/test_compat_gzip.c (+97/-0) src/libarchive/libarchive/test/test_compat_gzip_1.tgz.uu (+24/-0) src/libarchive/libarchive/test/test_compat_gzip_2.tgz.uu (+11/-0) src/libarchive/libarchive/test/test_compat_lzma.c (+155/-0) src/libarchive/libarchive/test/test_compat_lzma_1.tlz.uu (+10/-0) src/libarchive/libarchive/test/test_compat_lzma_2.tlz.uu (+9/-0) src/libarchive/libarchive/test/test_compat_lzma_3.tlz.uu (+9/-0) src/libarchive/libarchive/test/test_compat_solaris_tar_acl.c (+128/-0) src/libarchive/libarchive/test/test_compat_solaris_tar_acl.tar.uu (+61/-0) src/libarchive/libarchive/test/test_compat_tar_hardlink.c (+108/-0) src/libarchive/libarchive/test/test_compat_tar_hardlink_1.tar.uu (+39/-0) src/libarchive/libarchive/test/test_compat_xz.c (+84/-0) src/libarchive/libarchive/test/test_compat_xz_1.txz.uu (+13/-0) src/libarchive/libarchive/test/test_compat_zip.c (+80/-0) src/libarchive/libarchive/test/test_compat_zip_1.zip.uu (+15/-0) src/libarchive/libarchive/test/test_empty_write.c (+120/-0) src/libarchive/libarchive/test/test_entry.c (+903/-0) src/libarchive/libarchive/test/test_entry_strmode.c (+71/-0) src/libarchive/libarchive/test/test_extattr_freebsd.c (+172/-0) src/libarchive/libarchive/test/test_fuzz.c (+166/-0) src/libarchive/libarchive/test/test_fuzz_1.iso.Z.uu (+495/-0) src/libarchive/libarchive/test/test_link_resolver.c (+205/-0) src/libarchive/libarchive/test/test_open_fd.c (+128/-0) src/libarchive/libarchive/test/test_open_file.c (+108/-0) src/libarchive/libarchive/test/test_open_filename.c (+109/-0) src/libarchive/libarchive/test/test_pax_filename_encoding.c (+333/-0) src/libarchive/libarchive/test/test_pax_filename_encoding.tar.uu (+118/-0) src/libarchive/libarchive/test/test_read_compress_program.c (+84/-0) src/libarchive/libarchive/test/test_read_data_large.c (+125/-0) src/libarchive/libarchive/test/test_read_disk.c (+172/-0) src/libarchive/libarchive/test/test_read_disk_entry_from_file.c (+80/-0) src/libarchive/libarchive/test/test_read_extract.c (+168/-0) src/libarchive/libarchive/test/test_read_file_nonexistent.c (+37/-0) src/libarchive/libarchive/test/test_read_format_ar.ar.uu (+12/-0) src/libarchive/libarchive/test/test_read_format_ar.c (+87/-0) src/libarchive/libarchive/test/test_read_format_cpio_bin.c (+64/-0) src/libarchive/libarchive/test/test_read_format_cpio_bin_Z.c (+61/-0) src/libarchive/libarchive/test/test_read_format_cpio_bin_be.c (+55/-0) src/libarchive/libarchive/test/test_read_format_cpio_bin_be.cpio.uu (+8/-0) src/libarchive/libarchive/test/test_read_format_cpio_bin_bz2.c (+58/-0) src/libarchive/libarchive/test/test_read_format_cpio_bin_gz.c (+61/-0) src/libarchive/libarchive/test/test_read_format_cpio_bin_lzma.c (+60/-0) src/libarchive/libarchive/test/test_read_format_cpio_bin_xz.c (+70/-0) src/libarchive/libarchive/test/test_read_format_cpio_odc.c (+68/-0) src/libarchive/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c (+127/-0) src/libarchive/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu (+47/-0) src/libarchive/libarchive/test/test_read_format_cpio_svr4_gzip.c (+61/-0) src/libarchive/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c (+127/-0) src/libarchive/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu (+46/-0) src/libarchive/libarchive/test/test_read_format_cpio_svr4c_Z.c (+62/-0) src/libarchive/libarchive/test/test_read_format_empty.c (+47/-0) src/libarchive/libarchive/test/test_read_format_gtar_gz.c (+60/-0) src/libarchive/libarchive/test/test_read_format_gtar_lzma.c (+78/-0) src/libarchive/libarchive/test/test_read_format_gtar_sparse.c (+318/-0) src/libarchive/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu (+1370/-0) src/libarchive/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu (+1370/-0) src/libarchive/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu (+1597/-0) src/libarchive/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu (+1370/-0) src/libarchive/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu (+1370/-0) src/libarchive/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu (+1370/-0) src/libarchive/libarchive/test/test_read_format_iso.iso.Z.uu (+26/-0) src/libarchive/libarchive/test/test_read_format_iso_gz.c (+52/-0) src/libarchive/libarchive/test/test_read_format_iso_joliet.iso.Z.uu (+66/-0) src/libarchive/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu (+71/-0) src/libarchive/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu (+68/-0) src/libarchive/libarchive/test/test_read_format_iso_multi_extent.c (+94/-0) src/libarchive/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu (+67/-0) src/libarchive/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu (+206/-0) src/libarchive/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu (+63/-0) src/libarchive/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu (+208/-0) src/libarchive/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu (+304/-0) src/libarchive/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu (+63/-0) src/libarchive/libarchive/test/test_read_format_isojoliet_bz2.c (+134/-0) src/libarchive/libarchive/test/test_read_format_isojoliet_long.c (+141/-0) src/libarchive/libarchive/test/test_read_format_isojoliet_rr.c (+159/-0) src/libarchive/libarchive/test/test_read_format_isorr_bz2.c (+203/-0) src/libarchive/libarchive/test/test_read_format_isorr_ce.c (+223/-0) src/libarchive/libarchive/test/test_read_format_isorr_new_bz2.c (+204/-0) src/libarchive/libarchive/test/test_read_format_isorr_rr_moved.c (+270/-0) src/libarchive/libarchive/test/test_read_format_isozisofs_bz2.c (+187/-0) src/libarchive/libarchive/test/test_read_format_mtree.c (+143/-0) src/libarchive/libarchive/test/test_read_format_mtree.mtree.uu (+13/-0) src/libarchive/libarchive/test/test_read_format_pax_bz2.c (+66/-0) src/libarchive/libarchive/test/test_read_format_raw.c (+89/-0) src/libarchive/libarchive/test/test_read_format_raw.data.Z.uu (+5/-0) src/libarchive/libarchive/test/test_read_format_raw.data.uu (+5/-0) src/libarchive/libarchive/test/test_read_format_tar.c (+480/-0) src/libarchive/libarchive/test/test_read_format_tar_empty_filename.c (+66/-0) src/libarchive/libarchive/test/test_read_format_tar_empty_filename.tar.uu (+39/-0) src/libarchive/libarchive/test/test_read_format_tbz.c (+59/-0) src/libarchive/libarchive/test/test_read_format_tgz.c (+60/-0) src/libarchive/libarchive/test/test_read_format_tlz.c (+60/-0) src/libarchive/libarchive/test/test_read_format_txz.c (+63/-0) src/libarchive/libarchive/test/test_read_format_tz.c (+61/-0) src/libarchive/libarchive/test/test_read_format_xar.c (+697/-0) src/libarchive/libarchive/test/test_read_format_zip.c (+92/-0) src/libarchive/libarchive/test/test_read_format_zip.zip.uu (+14/-0) src/libarchive/libarchive/test/test_read_large.c (+93/-0) src/libarchive/libarchive/test/test_read_pax_truncated.c (+288/-0) src/libarchive/libarchive/test/test_read_position.c (+94/-0) src/libarchive/libarchive/test/test_read_truncated.c (+149/-0) src/libarchive/libarchive/test/test_read_uu.c (+134/-0) src/libarchive/libarchive/test/test_tar_filenames.c (+186/-0) src/libarchive/libarchive/test/test_tar_large.c (+312/-0) src/libarchive/libarchive/test/test_ustar_filenames.c (+191/-0) src/libarchive/libarchive/test/test_write_compress.c (+102/-0) src/libarchive/libarchive/test/test_write_compress_bzip2.c (+228/-0) src/libarchive/libarchive/test/test_write_compress_gzip.c (+252/-0) src/libarchive/libarchive/test/test_write_compress_lzma.c (+245/-0) src/libarchive/libarchive/test/test_write_compress_program.c (+118/-0) src/libarchive/libarchive/test/test_write_compress_xz.c (+253/-0) src/libarchive/libarchive/test/test_write_disk.c (+332/-0) src/libarchive/libarchive/test/test_write_disk_failures.c (+72/-0) src/libarchive/libarchive/test/test_write_disk_hardlink.c (+219/-0) src/libarchive/libarchive/test/test_write_disk_perms.c (+457/-0) src/libarchive/libarchive/test/test_write_disk_secure.c (+215/-0) src/libarchive/libarchive/test/test_write_disk_sparse.c (+280/-0) src/libarchive/libarchive/test/test_write_disk_symlink.c (+117/-0) src/libarchive/libarchive/test/test_write_disk_times.c (+167/-0) src/libarchive/libarchive/test/test_write_format_ar.c (+209/-0) src/libarchive/libarchive/test/test_write_format_cpio.c (+194/-0) src/libarchive/libarchive/test/test_write_format_cpio_empty.c (+75/-0) src/libarchive/libarchive/test/test_write_format_cpio_newc.c (+214/-0) src/libarchive/libarchive/test/test_write_format_cpio_odc.c (+241/-0) src/libarchive/libarchive/test/test_write_format_mtree.c (+155/-0) src/libarchive/libarchive/test/test_write_format_pax.c (+146/-0) src/libarchive/libarchive/test/test_write_format_shar_empty.c (+58/-0) src/libarchive/libarchive/test/test_write_format_tar.c (+114/-0) src/libarchive/libarchive/test/test_write_format_tar_empty.c (+92/-0) src/libarchive/libarchive/test/test_write_format_tar_ustar.c (+347/-0) src/libarchive/libarchive/test/test_write_format_zip.c (+180/-0) src/libarchive/libarchive/test/test_write_format_zip_empty.c (+56/-0) src/libarchive/libarchive/test/test_write_format_zip_no_compression.c (+304/-0) src/libarchive/libarchive/test/test_write_open_memory.c (+76/-0) src/libarchive/libarchive_fe/err.c (+74/-0) src/libarchive/libarchive_fe/err.h (+41/-0) src/libarchive/libarchive_fe/lafe_platform.h (+55/-0) src/libarchive/libarchive_fe/line_reader.c (+171/-0) src/libarchive/libarchive_fe/line_reader.h (+35/-0) src/libarchive/libarchive_fe/matching.c (+284/-0) src/libarchive/libarchive_fe/matching.h (+46/-0) src/libarchive/libarchive_fe/pathmatch.c (+255/-0) src/libarchive/libarchive_fe/pathmatch.h (+42/-0) src/libarchive/tar/CMakeLists.txt (+55/-0) src/libarchive/tar/bsdtar.1 (+921/-0) src/libarchive/tar/bsdtar.c (+734/-0) src/libarchive/tar/bsdtar.h (+158/-0) src/libarchive/tar/bsdtar_platform.h (+132/-0) src/libarchive/tar/bsdtar_windows.c (+298/-0) src/libarchive/tar/bsdtar_windows.h (+60/-0) src/libarchive/tar/cmdline.c (+381/-0) src/libarchive/tar/config_freebsd.h (+84/-0) src/libarchive/tar/getdate.c (+1037/-0) src/libarchive/tar/read.c (+437/-0) src/libarchive/tar/subst.c (+289/-0) src/libarchive/tar/test/CMakeLists.txt (+67/-0) src/libarchive/tar/test/main.c (+2242/-0) src/libarchive/tar/test/test.h (+288/-0) src/libarchive/tar/test/test_0.c (+67/-0) src/libarchive/tar/test/test_basic.c (+115/-0) src/libarchive/tar/test/test_copy.c (+372/-0) src/libarchive/tar/test/test_empty_mtree.c (+45/-0) src/libarchive/tar/test/test_getdate.c (+80/-0) src/libarchive/tar/test/test_help.c (+84/-0) src/libarchive/tar/test/test_option_T_upper.c (+188/-0) src/libarchive/tar/test/test_option_q.c (+129/-0) src/libarchive/tar/test/test_option_r.c (+117/-0) src/libarchive/tar/test/test_option_s.c (+107/-0) src/libarchive/tar/test/test_patterns.c (+184/-0) src/libarchive/tar/test/test_patterns_2.tar.uu (+231/-0) src/libarchive/tar/test/test_patterns_3.tar.uu (+231/-0) src/libarchive/tar/test/test_patterns_4.tar.uu (+641/-0) src/libarchive/tar/test/test_stdio.c (+125/-0) src/libarchive/tar/test/test_strip_components.c (+109/-0) src/libarchive/tar/test/test_symlink_dir.c (+160/-0) src/libarchive/tar/test/test_version.c (+97/-0) src/libarchive/tar/test/test_windows.c (+323/-0) src/libarchive/tar/tree.c (+821/-0) src/libarchive/tar/tree.h (+141/-0) src/libarchive/tar/util.c (+559/-0) src/libarchive/tar/write.c (+1138/-0) src/local.c (+148/-0) src/local.h (+28/-0) src/quicklz/quicklz.c (+848/-0) src/quicklz/quicklz.h (+143/-0) src/stream.c (+265/-0) src/stream.h (+28/-0) src/xbstream.c (+446/-0) src/xbstream.h (+86/-0) src/xbstream_read.c (+222/-0) src/xbstream_write.c (+263/-0) src/xtrabackup.c (+844/-773) test/inc/common.sh (+3/-3) test/inc/ib_stream_common.sh (+20/-3) test/run.sh (+1/-1) test/t/bug514068.sh (+1/-1) test/t/bug606981.sh (+3/-3) test/t/bug759225.sh (+3/-3) test/t/ib_stream_compress.sh (+16/-0) test/t/ib_stream_parallel.sh (+9/-0) test/t/ib_stream_tar.sh (+9/-0) test/t/ib_stream_xbstream.sh (+8/-0) test/t/tar4ibd_symlink.sh (+1/-1) test/t/xb_incremental_compressed.sh (+2/-3) utils/build.sh (+25/-27) |
||||||||
To merge this branch: | bzr merge lp:~akopytov/percona-xtrabackup/parallel-compression | ||||||||
Related bugs: |
|
||||||||
Related blueprints: |
Parallel compression
(High)
Document XBSTREAM format
(Medium)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stewart Smith (community) | Approve | ||
Review via email: mp+79964@code.launchpad.net |
Commit message
Description of the change
Alexey Kopytov (akopytov) wrote : | # |
Stewart Smith (stewart) wrote : | # |
I have a number of thoughts:
- mostly with my xtrabackup-
- CRC32C instead of adler for XBSTREAM chunk checksum lets us use CRC32 instructions on Intel CPUs to compute checksums really fast.
- I think we should have a flags for XBSTREAM chunk. e.g. if unknown header a flag can be set to say if it's ignorable or not. This would allow us to add things like informational chunks in the future without breaking backwards compatibility.
- for xb_rstream_chunk_t, if data member is at the end, we can use the zero length array trick for reading it. Even if we don't use zero length array, it makes things a little nicer. I think this structure should also more mirror what's on disk (pathlength first).
- I wonder if we should have a incrementing number in the XBSTREAM chunk header. for disaster recovery, this may let the backup file be more easily reassembled from parts, or at least help figure out what's missing.
- i think the mutexes around writing the chunks out could be around less code
- the F_WRITE macro calls should be replaced with a single write call. doing multiple small write() calls is less efficient than one big one... actually... if we store the checksum along with the header rather than at the tail of the chunk, we save a write() call and even without much code modification we go from 3 to 2 write() calls in write_chunk().
- we should have defines for xbstream chunk payload type
in xb_stream_
- tmpbuf should be malloc() instead of on stack - will be easier to catch overruns
xb_stream_
- is it intentional that a series of writes of 100bytes, 1mb will be in 2 chunks (one 100bytes, the other 1mb)? It's certainly the simpler option :)
Stewart Smith (stewart) wrote : | # |
We should probably also add xbstream file format to documentation and make it a bit clearer for anybody who may want to interact with it....
so, my thoughts on merging it are that I think we're pretty good to go, although it may be a good idea that we do any format changes (suggested above) before we merge it in.
we will need branch based on current trunk though, and jenkins run.
Stewart Smith (stewart) : | # |
Alexey Kopytov (akopytov) wrote : | # |
On 10.02.12 12:38, Stewart Smith wrote:
> I have a number of thoughts:
> - mostly with my xtrabackup-
As discussed on IRC, I would love to use innodb OS abstraction routines
if they allowed to write a specified file descriptor rather than a path
name to begin with. Which was essential for my purposes, though I did
ponder the Drizzle port and the idea to avoid dependencies on mysys. But
I also needed other portability wrappers from mysys, so I would create
that dependency anyway. And not everything from mysys has alternatives
on CCAN, for example.
It is a big problem, and I don't have a solution for it yet. The idea
with POSIX- and Windows-specific local datasinks is good, but in general
we'll most likely end up creating our own portability library. Hopefully
with some help from the Drizzle community ;)
> - CRC32C instead of adler for XBSTREAM chunk checksum lets us use CRC32 instructions on Intel CPUs to compute checksums really fast.
The server tree doesn't have a bundled CRC32-C implementation, and I
couldn't find a suitable one after 5 minutes of searching the web. So I
replaced alder with crc32(). As I understand, there's also an x86
instruction to compute plain CRC-32, so we can optimize that later.
> - I think we should have a flags for XBSTREAM chunk. e.g. if unknown header a flag can be set to say if it's ignorable or not. This would allow us to add things like informational chunks in the future without breaking backwards compatibility.
Done. With XB_STREAM_
payloads are ignored, but checksums are till verified.
Note that there's also a format version field "embedded" into the chunk
header magic.
> - for xb_rstream_chunk_t, if data member is at the end, we can use the zero length array trick for reading it. Even if we don't use zero length array, it makes things a little nicer. I think this structure should also more mirror what's on disk (pathlength first).
The zero length array trick would work if payload was the only variable
length part of the chunk. But it's not the case, path is also variable
length, so the header itself is variable length too.
But I did move path_len before the path to match the stream format.
I also changed the format so that checksum goes before the payload to
minimize write() calls.
> - I wonder if we should have a incrementing number in the XBSTREAM chunk header. for disaster recovery, this may let the backup file be more easily reassembled from parts, or at least help figure out what's missing.
We already have the file offset as a part of every chunk.
> - i think the mutexes around writing the chunks out could be around less code
Fixed.
> - the F_WRITE macro calls should be replaced with a single write call. doing multiple small write() calls is less efficient than one big one... actually... if we store the checksum along ...
Alexey Kopytov (akopytov) wrote : | # |
On 10.02.12 12:49, Stewart Smith wrote:
> We should probably also add xbstream file format to documentation and make it a bit clearer for anybody who may want to interact with it....
>
OK, created
https:/
Alexey Kopytov (akopytov) wrote : | # |
Stewart Smith (stewart) : | # |
Preview Diff
1 | === modified file 'innobackupex' |
2 | --- innobackupex 2012-02-10 04:19:23 +0000 |
3 | +++ innobackupex 2012-02-10 20:09:18 +0000 |
4 | @@ -75,6 +75,7 @@ |
5 | my $option_throttle = ''; |
6 | my $option_sleep = ''; |
7 | my $option_compress = 999; |
8 | +my $option_compress_threads = 1; |
9 | my $option_uncompress = ''; |
10 | my $option_export = ''; |
11 | my $option_use_memory = ''; |
12 | @@ -98,6 +99,7 @@ |
13 | my $option_remote_host = ''; |
14 | my $option_rsync = ''; |
15 | my $option_stream = ''; |
16 | +my $stream_cmd = ''; |
17 | my $option_tmpdir = ''; |
18 | |
19 | my $option_tar4ibd = ''; |
20 | @@ -296,7 +298,7 @@ |
21 | close XTRABACKUP_BINARY; |
22 | |
23 | if ($option_stream) { |
24 | - system("cd $option_tmpdir; tar chf - $xtrabackup_binary_file") |
25 | + system("cd $option_tmpdir; $stream_cmd $xtrabackup_binary_file") |
26 | && die "Failed to stream $xtrabackup_binary_file: $!"; |
27 | unlink "$option_tmpdir/$xtrabackup_binary_file"; |
28 | } |
29 | @@ -387,7 +389,7 @@ |
30 | start_ibbackup(); |
31 | |
32 | # wait for ibbackup to suspend itself |
33 | - if (!$option_remote_host && !$option_stream) { |
34 | + if (!$option_remote_host) { |
35 | wait_for_ibbackup_suspend(); |
36 | } |
37 | |
38 | @@ -438,14 +440,6 @@ |
39 | system("scp $option_scp_opt '$option_tmpdir/xtrabackup_checkpoints' '$option_remote_host:$backup_dir/xtrabackup_checkpoints'") |
40 | and Die "Failed to scp file '$option_remote_host:$backup_dir/xtrabackup_checkpoints': $!"; |
41 | unlink "$option_tmpdir/xtrabackup_checkpoints" || Die "Failed to delete '$option_tmpdir/xtrabackup_checkpoints': $!"; |
42 | - } elsif ($option_stream eq 'tar') { |
43 | - system("cd $option_tmpdir; tar chf - xtrabackup_logfile") |
44 | - and Die "Failed to stream 'xtrabackup_logfile': $!"; |
45 | - unlink $tmp_logfile || Die "Failed to delete '$tmp_logfile': $!"; |
46 | - |
47 | - system("cd $option_tmpdir; tar chf - xtrabackup_checkpoints") |
48 | - and Die "Failed to stream 'xtrabackup_checkpoints': $!"; |
49 | - unlink "$option_tmpdir/xtrabackup_checkpoints" || Die "Failed to delete '$option_tmpdir/xtrabackup_checkpoints': $!"; |
50 | } |
51 | |
52 | print STDERR "\n$prefix Backup created in directory '$backup_dir'\n"; |
53 | @@ -856,7 +850,10 @@ |
54 | $options = $options . " --target-dir=$backup_dir"; |
55 | } else { |
56 | #(datadir) for 'xtrabackup_suspended' and 'xtrabackup_checkpoints' |
57 | - $options = $options . " --log-stream --target-dir=" . $option_tmpdir; |
58 | + $options = $options . " --target-dir=" . $option_tmpdir; |
59 | + if ($option_remote_host) { |
60 | + $options = $options . " --log-stream"; |
61 | + } |
62 | } |
63 | |
64 | # prepare command line for running ibbackup |
65 | @@ -867,7 +864,8 @@ |
66 | $options = $options . " --sleep=$option_sleep"; |
67 | } |
68 | if ($option_compress) { |
69 | - $options = $options . " --compress=$option_compress"; |
70 | + $options = $options . " --compress"; |
71 | + $options = $options . " --compress-threads=$option_compress_threads"; |
72 | } |
73 | if ($option_use_memory) { |
74 | $options = $options . " --use-memory=$option_use_memory"; |
75 | @@ -891,7 +889,10 @@ |
76 | $options = $options . " --tables_file='$option_tables_file'"; |
77 | } |
78 | if ($option_parallel) { |
79 | - $options = $options. " --parallel=$option_parallel"; |
80 | + $options = $options . " --parallel=$option_parallel"; |
81 | + } |
82 | + if ($option_stream) { |
83 | + $options = $options . " --stream=$option_stream"; |
84 | } |
85 | $cmdline = "$option_ibbackup_binary $options"; |
86 | |
87 | @@ -903,7 +904,7 @@ |
88 | # parent process |
89 | $ibbackup_pid = $pid; |
90 | |
91 | - if($option_remote_host || $option_stream) { |
92 | + if($option_remote_host) { |
93 | #direct copy to remote |
94 | my $orig_datadir = get_option(\%config, 'mysqld', 'datadir'); |
95 | my $orig_ibdata_dir = |
96 | @@ -918,56 +919,25 @@ |
97 | my $subdir; |
98 | my @list; |
99 | |
100 | - if($option_remote_host) { |
101 | - if (system("ssh $option_ssh_opt $option_remote_host test -e $backup_dir/ib_logfile0") |
102 | - == 0) { |
103 | - print STDERR "$prefix Remove $option_remote_host:$backup_dir/ib_logfile*\n"; |
104 | - system("ssh $option_ssh_opt $option_remote_host rm $backup_dir/ib_logfile\*") |
105 | - and Die "Failed to rm file '$backup_dir/ib_logfile*': $!"; |
106 | - } |
107 | + if (system("ssh $option_ssh_opt $option_remote_host test -e $backup_dir/ib_logfile0") |
108 | + == 0) { |
109 | + print STDERR "$prefix Remove $option_remote_host:$backup_dir/ib_logfile*\n"; |
110 | + system("ssh $option_ssh_opt $option_remote_host rm $backup_dir/ib_logfile\*") |
111 | + and Die "Failed to rm file '$backup_dir/ib_logfile*': $!"; |
112 | } |
113 | |
114 | wait_for_ibbackup_suspend(); |
115 | |
116 | #InnoDB data files from original InnoDB data directory |
117 | print STDERR "\n$prefix Starting to backup InnoDB tables and indexes\n"; |
118 | - if($option_remote_host) { |
119 | - print STDERR "$prefix to '$backup_dir'\n"; |
120 | - } |
121 | + print STDERR "$prefix to '$backup_dir'\n"; |
122 | print STDERR "$prefix from original InnoDB data directory '$orig_ibdata_dir'\n"; |
123 | foreach my $a (split(/;/, $orig_innodb_data_file_path)) { |
124 | my $path = (split(/:/,$a))[0]; |
125 | $path=~s/([\$\\\" ])/\\$1/g; |
126 | - if($option_remote_host) { |
127 | - print STDERR "$prefix Backing up file '$orig_ibdata_dir/$path'\n"; |
128 | - system("scp $option_scp_opt '$orig_ibdata_dir/$path' '$option_remote_host:$backup_dir/$path'") |
129 | - and Die "Failed to scp file '$path': $!"; |
130 | - } elsif($option_stream eq 'tar') { |
131 | - my $ret = 0; |
132 | - my $tarcmd; |
133 | - print STDERR "$prefix Backing up as tar stream '$path'\n"; |
134 | - if (!$option_tar4ibd) { |
135 | - $tarcmd = "tar chf - -b 32"; |
136 | - } else { |
137 | - $tarcmd = "tar4ibd"; |
138 | - if ($innodb_use_odirect) { |
139 | - $tarcmd = "$tarcmd -d"; |
140 | - } |
141 | - $tarcmd = "$tarcmd -c"; |
142 | - } |
143 | - $ret = system("cd $orig_ibdata_dir; $tarcmd $path") >> 8; |
144 | - if ($ret == 1) { |
145 | - print STDERR "$prefix If you use GNU tar, this warning can be ignored.\n"; |
146 | - } elsif ($ret != 0) { |
147 | - print STDERR "$prefix tar returned with exit code $ret.\n"; |
148 | - if ( -e "$orig_ibdata_dir/$path" ) { |
149 | - Die "Failed to stream '$orig_ibdata_dir/$path': $!"; |
150 | - } |
151 | - else { |
152 | - print STDERR "$prefix Ignoring nonexistent file '$orig_ibdata_dir/$path'.\n"; |
153 | - } |
154 | - } |
155 | - } |
156 | + print STDERR "$prefix Backing up file '$orig_ibdata_dir/$path'\n"; |
157 | + system("scp $option_scp_opt '$orig_ibdata_dir/$path' '$option_remote_host:$backup_dir/$path'") |
158 | + and Die "Failed to scp file '$path': $!"; |
159 | } |
160 | |
161 | #copy *.ibd files |
162 | @@ -1008,40 +978,18 @@ |
163 | if ($print_each_file) { |
164 | print STDERR "$prefix Backing up file '$file'\n"; |
165 | } |
166 | - if($option_remote_host) { |
167 | - if (system("ssh $option_ssh_opt $option_remote_host test -e $backup_dir/$subdir") |
168 | - != 0) { |
169 | - system("ssh $option_ssh_opt $option_remote_host mkdir $backup_dir/$subdir"); |
170 | - } |
171 | - system("scp $option_scp_opt '$file' '$option_remote_host:$backup_dir/$subdir/'") |
172 | - and Die "Failed to scp file '$file': $!"; |
173 | - } elsif($option_stream eq 'tar') { |
174 | - my $ret = 0; |
175 | - my $file_name = substr($file, rindex($file, '/') + 1); |
176 | - $file_name=~s/([\$\\\" ])/\\$1/g; |
177 | - if (!$option_tar4ibd) { |
178 | - $ret = system("cd $orig_datadir; tar chf - -b 32 $subdir/$file_name") >> 8; |
179 | - } else { |
180 | - $ret = system("cd $orig_datadir; tar4ibd -c $subdir/$file_name") >> 8; |
181 | - } |
182 | - if ($ret == 1) { |
183 | - print STDERR "$prefix If you use GNU tar, this warning can be ignored.\n"; |
184 | - } elsif ($ret != 0) { |
185 | - print STDERR "$prefix tar returned with exit code $ret.\n"; |
186 | - if ( -e "$orig_datadir/$subdir/$file_name" ) { |
187 | - Die "Failed to stream '$orig_datadir/$subdir/$file_name': $!"; |
188 | - } |
189 | - else { |
190 | - print STDERR "$prefix Ignoring nonexistent file '$orig_datadir/$subdir/$file_name'.\n"; |
191 | - } |
192 | - } |
193 | + if (system("ssh $option_ssh_opt $option_remote_host test -e $backup_dir/$subdir") |
194 | + != 0) { |
195 | + system("ssh $option_ssh_opt $option_remote_host mkdir $backup_dir/$subdir"); |
196 | } |
197 | - } |
198 | + system("scp $option_scp_opt '$file' '$option_remote_host:$backup_dir/$subdir/'") |
199 | + and Die "Failed to scp file '$file': $!"; |
200 | + } |
201 | } |
202 | closedir(DIR); |
203 | } |
204 | } else { |
205 | - if($option_remote_host || $option_stream) { |
206 | + if($option_remote_host) { |
207 | open(STDOUT, "> $tmp_logfile") |
208 | || Die "Failed to open file '$tmp_logfile': $!" |
209 | } |
210 | @@ -1259,8 +1207,8 @@ |
211 | print FILE "$info_lines[1]\n"; |
212 | close(FILE); |
213 | |
214 | - if ($option_stream eq 'tar') { |
215 | - system("cd $option_tmpdir; tar chf - xtrabackup_binlog_info") |
216 | + if ($option_stream) { |
217 | + system("cd $option_tmpdir; $stream_cmd xtrabackup_binlog_info") |
218 | and Die "Failed to stream 'xtrabackup_binlog_info': $!"; |
219 | unlink $binlog_info || Die "Failed to delete '$binlog_info': $!"; |
220 | } |
221 | @@ -1356,8 +1304,8 @@ |
222 | print FILE "CHANGE MASTER TO MASTER_LOG_FILE='$filename', MASTER_LOG_POS=$position\n"; |
223 | close(FILE); |
224 | |
225 | - if ($option_stream eq 'tar') { |
226 | - system("cd $option_tmpdir; tar chf - xtrabackup_slave_info") |
227 | + if ($option_stream) { |
228 | + system("cd $option_tmpdir; $stream_cmd xtrabackup_slave_info") |
229 | and Die "Failed to stream 'xtrabackup_slave_info': $!"; |
230 | unlink $slave_info || Die "Failed to delete '$slave_info': $!"; |
231 | } |
232 | @@ -1716,10 +1664,9 @@ |
233 | if ($option_stream) { |
234 | my $filename_dir = dirname($filename); |
235 | my $filename_name = basename($filename); |
236 | - if ($option_stream eq 'tar') { |
237 | - system("cd $filename_dir; tar chf - $filename_name") |
238 | - and Die "Failed to stream '$filename_name': $!"; |
239 | - } |
240 | + system("cd $filename_dir; $stream_cmd $filename_name") |
241 | + and Die "Failed to stream '$filename_name': $!"; |
242 | + |
243 | unlink $filename || Die "Failed to delete '$filename': $!"; |
244 | } |
245 | } |
246 | @@ -1753,7 +1700,8 @@ |
247 | } |
248 | |
249 | # read command line options |
250 | - $rcode = GetOptions('compress:i' => \$option_compress, |
251 | + $rcode = GetOptions('compress' => \$option_compress, |
252 | + 'compress-threads=i' => \$option_compress_threads, |
253 | 'help' => \$option_help, |
254 | 'version' => \$option_version, |
255 | 'throttle=i' => \$option_throttle, |
256 | @@ -1821,6 +1769,12 @@ |
257 | $option_compress = 0; |
258 | } |
259 | |
260 | + if ($option_stream eq 'tar') { |
261 | + $stream_cmd = 'tar chf -'; |
262 | + } elsif ($option_stream eq 'xbstream') { |
263 | + $stream_cmd = 'xbstream -c' |
264 | + } |
265 | + |
266 | if (@ARGV < 1) { |
267 | print STDERR "$prefix Missing command line argument\n"; |
268 | exit(1); |
269 | @@ -1829,26 +1783,6 @@ |
270 | exit(1); |
271 | } |
272 | |
273 | - if ($option_stream) { |
274 | - if ($option_stream eq 'tar') { |
275 | - if ( !$option_force_tar ) { |
276 | - $option_tar4ibd = 'tar4ibd'; |
277 | - } |
278 | - else { |
279 | - print STDERR "Forcing tar instead of tar4ibd\n"; |
280 | - } |
281 | - } elsif ($option_stream eq 'tar4ibd') { |
282 | - $option_stream = 'tar'; |
283 | - $option_tar4ibd = 'tar4ibd'; |
284 | - } elsif ($option_stream eq 'cpio') { |
285 | - print STDERR "$prefix --stream=cpio is not supported yet\n"; |
286 | - exit(1); |
287 | - } else { |
288 | - print STDERR "$prefix Unknown option --stream=$option_stream\n"; |
289 | - exit(1); |
290 | - } |
291 | - } |
292 | - |
293 | # get options file name |
294 | #$config_file = $ARGV[0]; |
295 | |
296 | @@ -2089,16 +2023,16 @@ |
297 | } elsif ($option_remote_host) { |
298 | # Queue up files for one single scp per database. |
299 | push(@scp_files, "'$file'"); |
300 | - } elsif($option_stream eq 'tar') { |
301 | + } elsif($option_stream) { |
302 | my $ret = 0; |
303 | my $file_name = substr($file, rindex($file, '/') + 1); |
304 | $file_name=~s/([\$\\\" ])/\\$1/g; |
305 | - $ret = system("cd $source_dir; tar cf - $database/$file_name") >> 8; |
306 | - if ($ret == 1) { |
307 | + $ret = system("cd $source_dir; $stream_cmd $database/$file_name") >> 8; |
308 | + if ($ret == 1 && $option_stream eq 'tar') { |
309 | print STDERR "$prefix If you use GNU tar, this warning can be ignored.\n"; |
310 | # Check for non-zero exit code |
311 | } elsif ($ret != 0) { |
312 | - print STDERR "$prefix tar returned with exit code $ret.\n"; |
313 | + print STDERR "$prefix $stream_cmd returned with exit code $ret.\n"; |
314 | # Only treat as fatal cases where the file exists |
315 | if ( -e "$database/$file_name" ) { |
316 | Die "Failed to stream '$database/$file_name': $!"; |
317 | @@ -2383,6 +2317,7 @@ |
318 | return ${$group_hash_ref}{$option_name}; |
319 | } |
320 | |
321 | + |
322 | # check_if_required subroutine returns 1 if the specified database and |
323 | # table needs to be backed up. |
324 | # Parameters: |
325 | @@ -2658,11 +2593,12 @@ |
326 | |
327 | =head1 SYNOPOSIS |
328 | |
329 | -innobackupex [--compress[=LEVEL]] [--include=REGEXP] [--user=NAME] |
330 | +innobackupex [--compress] [--compress-threads=NUMBER-OF-THREADS] |
331 | + [--include=REGEXP] [--user=NAME] |
332 | [--password=WORD] [--port=PORT] [--socket=SOCKET] |
333 | [--no-timestamp] [--ibbackup=IBBACKUP-BINARY] |
334 | - [--slave-info] [--stream=tar] [--force-tar] |
335 | - [--scpopt=OPTIONS-FOR-SCP] [--sshopt=OPTIONS-FOR-SSH] |
336 | + [--slave-info] [--stream=tar|xbstream] [--force-tar] |
337 | + [--scpopt=OPTIONS-FOR-SCP] [--sshopt=OPTIONS-FOR-SSH] |
338 | [--defaults-file=MY.CNF] |
339 | [--databases=LIST] [--remote-host=HOSTNAME] [--no-lock] |
340 | [--tmpdir=DIRECTORY] [--tables-file=FILE] |
341 | @@ -2717,6 +2653,18 @@ |
342 | |
343 | Prepare a backup in BACKUP-DIR by applying the transaction log file named "xtrabackup_logfile" located in the same directory. Also, create new transaction logs. The InnoDB configuration is read from the file "backup-my.cnf". |
344 | |
345 | +=item --compress |
346 | + |
347 | +This option instructs xtrabackup to compress backup copies of InnoDB |
348 | +data files. It is passed directly to the xtrabackup child process. Try |
349 | +'xtrabackup --help' for more details. |
350 | + |
351 | +=item --compress-threads |
352 | + |
353 | +This option specifies the number of worker threads that will be used |
354 | +for parallel compression. It is passed directly to the xtrabackup |
355 | +child process. Try 'xtrabackup --help' for more details. |
356 | + |
357 | =item --copy-back |
358 | |
359 | Copy all the files in a previously made backup from the backup directory to their original locations. |
360 | @@ -2828,7 +2776,7 @@ |
361 | |
362 | =item --stream=[tar|. . .] |
363 | |
364 | -This option specifies the format in which to do the streamed backup. The option accepts a string argument. The backup will be done to STDOUT in the specified format. Currently, the only supported format is tar. Uses tar4ibd, which is available in XtraBackup distributions. |
365 | +This option specifies the format in which to do the streamed backup. The option accepts a string argument. The backup will be done to STDOUT in the specified format. Currently, the only supported formats are tar and xbstream. This option is passed directly to xtrabackup's --stream option. |
366 | |
367 | =item --tables-file=FILE |
368 | |
369 | |
370 | === removed file 'patches/tar4ibd_libtar-1.2.11.patch' |
371 | --- patches/tar4ibd_libtar-1.2.11.patch 2012-02-02 20:35:45 +0000 |
372 | +++ patches/tar4ibd_libtar-1.2.11.patch 1970-01-01 00:00:00 +0000 |
373 | @@ -1,793 +0,0 @@ |
374 | -# (c) 2009 - 2011 Percona Inc. |
375 | -# |
376 | -# This program is free software; you can redistribute it and/or modify |
377 | -# it under the terms of the GNU General Public License as published by |
378 | -# the Free Software Foundation; version 2 of the License. |
379 | -# |
380 | -# This program is distributed in the hope that it will be useful, |
381 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
382 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
383 | -# GNU General Public License for more details. |
384 | -# |
385 | -# You should have received a copy of the GNU General Public License |
386 | -# along with this program; if not, write to the Free Software |
387 | -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
388 | -# |
389 | -# This patch incorporates code covered by the following copyright and |
390 | -# permission notice: |
391 | -# |
392 | -# Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved. |
393 | -# |
394 | -# This program is free software; you can redistribute it and/or modify it under |
395 | -# the terms of the GNU General Public License as published by the Free Software |
396 | -# Foundation; version 2 of the License. |
397 | -# |
398 | -# This program is distributed in the hope that it will be useful, but WITHOUT |
399 | -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
400 | -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
401 | -# |
402 | -# You should have received a copy of the GNU General Public License along with |
403 | -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
404 | -# Place, Suite 330, Boston, MA 02111-1307 USA |
405 | -# |
406 | -# |
407 | ---- a/lib/Makefile.in |
408 | -+++ b/lib/Makefile.in |
409 | -@@ -29,7 +29,7 @@ |
410 | - -I${top_srcdir}/compat \ |
411 | - -I../listhash \ |
412 | - @CPPFLAGS@ |
413 | --CFLAGS = @CFLAGS@ |
414 | -+CFLAGS = @CFLAGS@ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE |
415 | - LDFLAGS = @LDFLAGS@ |
416 | - LIBS = @LIBS@ |
417 | - LIBOBJS = @LIBOBJS@ |
418 | ---- a/lib/append.c |
419 | -+++ b/lib/append.c |
420 | -@@ -27,6 +27,327 @@ |
421 | - # include <unistd.h> |
422 | - #endif |
423 | - |
424 | -+#ifdef HAVE_LIBZ |
425 | -+#include <zlib.h> |
426 | -+#else |
427 | -+#error "zlib not found" |
428 | -+#endif |
429 | -+ |
430 | -+#ifdef POSIX_FADV_NORMAL |
431 | -+#define USE_POSIX_FADVISE |
432 | -+#endif |
433 | -+ |
434 | -+/* all of these ripped from InnoDB code from MySQL 4.0.22 */ |
435 | -+#define UT_HASH_RANDOM_MASK 1463735687 |
436 | -+#define UT_HASH_RANDOM_MASK2 1653893711 |
437 | -+#define FIL_PAGE_LSN 16 |
438 | -+#define FIL_PAGE_FILE_FLUSH_LSN 26 |
439 | -+#define FIL_PAGE_OFFSET 4 |
440 | -+#define FIL_PAGE_DATA 38 |
441 | -+#define FIL_PAGE_DATA_ALIGN_32 40 |
442 | -+#define FIL_PAGE_END_LSN_OLD_CHKSUM 8 |
443 | -+#define FIL_PAGE_SPACE_OR_CHKSUM 0 |
444 | -+#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL |
445 | -+#define FSP_EXTENT_SIZE 64 |
446 | -+#define FSP_HEADER_OFFSET FIL_PAGE_DATA |
447 | -+#define FSP_SPACE_FLAGS 16 /* table->flags & ~DICT_TF_COMPACT */ |
448 | -+#define DICT_TF_ZSSIZE_SHIFT 1 |
449 | -+#define DICT_TF_ZSSIZE_MASK (15 << DICT_TF_ZSSIZE_SHIFT) |
450 | -+#define PAGE_ZIP_MIN_SIZE_SHIFT 10 |
451 | -+#define PAGE_ZIP_MIN_SIZE (1 << PAGE_ZIP_MIN_SIZE_SHIFT) |
452 | -+#define UNIV_PAGE_SIZE (2 * 8192) |
453 | -+#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /* starting from 4.1.x this |
454 | -+ contains the space id of the page */ |
455 | -+#define FIL_PAGE_TYPE 24 /* file page type: FIL_PAGE_INDEX,..., |
456 | -+ 2 bytes. |
457 | -+ |
458 | -+/* defined in libtar.c. if 1, O_DIRECT will be used for input files */ |
459 | -+extern int use_direct; |
460 | -+ |
461 | -+/* command line argument to do page checks (that's it) */ |
462 | -+/* another argument to specify page ranges... seek to right spot and go from there */ |
463 | -+ |
464 | -+typedef unsigned long int ulint; |
465 | -+typedef unsigned char byte; |
466 | -+ |
467 | -+/* innodb function in name; modified slightly to not have the ASM version (lots of #ifs that didn't apply) */ |
468 | -+ulint mach_read_from_4(byte *b) |
469 | -+{ |
470 | -+ return( ((ulint)(b[0]) << 24) |
471 | -+ + ((ulint)(b[1]) << 16) |
472 | -+ + ((ulint)(b[2]) << 8) |
473 | -+ + (ulint)(b[3]) |
474 | -+ ); |
475 | -+} |
476 | -+ |
477 | -+ulint |
478 | -+ut_fold_ulint_pair( |
479 | -+/*===============*/ |
480 | -+ /* out: folded value */ |
481 | -+ ulint n1, /* in: ulint */ |
482 | -+ ulint n2) /* in: ulint */ |
483 | -+{ |
484 | -+ return(((((n1 ^ n2 ^ UT_HASH_RANDOM_MASK2) << 8) + n1) |
485 | -+ ^ UT_HASH_RANDOM_MASK) + n2); |
486 | -+} |
487 | -+ |
488 | -+ulint |
489 | -+ut_fold_binary( |
490 | -+/*===========*/ |
491 | -+ /* out: folded value */ |
492 | -+ byte* str, /* in: string of bytes */ |
493 | -+ ulint len) /* in: length */ |
494 | -+{ |
495 | -+ ulint i; |
496 | -+ ulint fold= 0; |
497 | -+ |
498 | -+ for (i= 0; i < len; i++) |
499 | -+ { |
500 | -+ fold= ut_fold_ulint_pair(fold, (ulint)(*str)); |
501 | -+ |
502 | -+ str++; |
503 | -+ } |
504 | -+ |
505 | -+ return(fold); |
506 | -+} |
507 | -+ |
508 | -+ulint |
509 | -+ut_fold_binary_32( |
510 | -+/*==============*/ |
511 | -+ byte* str, |
512 | -+ ulint len) |
513 | -+{ |
514 | -+ unsigned int* str_end = (unsigned int*) (str + len); |
515 | -+ unsigned int* str_32 = (unsigned int*) str; |
516 | -+ ulint fold = 0; |
517 | -+ |
518 | -+ if (sizeof(unsigned int) != 4) { |
519 | -+ fprintf(stderr, |
520 | -+ "size of int is not 32bit.\n"); |
521 | -+ exit(-1); |
522 | -+ } |
523 | -+ |
524 | -+ while (str_32 < str_end) { |
525 | -+ fold = ut_fold_ulint_pair(fold, (ulint)(*str_32)); |
526 | -+ |
527 | -+ str_32++; |
528 | -+ } |
529 | -+ |
530 | -+ return(fold); |
531 | -+} |
532 | -+ |
533 | -+ulint |
534 | -+buf_calc_page_new_checksum( |
535 | -+/*=======================*/ |
536 | -+ /* out: checksum */ |
537 | -+ byte* page, /* in: buffer page */ |
538 | -+ ulint page_size) |
539 | -+{ |
540 | -+ ulint checksum; |
541 | -+ |
542 | -+ /* Since the fields FIL_PAGE_FILE_FLUSH_LSN and ..._ARCH_LOG_NO |
543 | -+ are written outside the buffer pool to the first pages of data |
544 | -+ files, we have to skip them in the page checksum calculation. |
545 | -+ We must also skip the field FIL_PAGE_SPACE_OR_CHKSUM where the |
546 | -+ checksum is stored, and also the last 8 bytes of page because |
547 | -+ there we store the old formula checksum. */ |
548 | -+ |
549 | -+ checksum= ut_fold_binary(page + FIL_PAGE_OFFSET, |
550 | -+ FIL_PAGE_FILE_FLUSH_LSN - FIL_PAGE_OFFSET) |
551 | -+ + ut_fold_binary(page + FIL_PAGE_DATA, |
552 | -+ page_size - FIL_PAGE_DATA |
553 | -+ - FIL_PAGE_END_LSN_OLD_CHKSUM); |
554 | -+ checksum= checksum & 0xFFFFFFFF; |
555 | -+ |
556 | -+ return(checksum); |
557 | -+} |
558 | -+ |
559 | -+ulint |
560 | -+fsp_header_get_flags( |
561 | -+/*=================*/ |
562 | -+ byte* page) /*!< in: first page of a tablespace */ |
563 | -+{ |
564 | -+ return(mach_read_from_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + page)); |
565 | -+} |
566 | -+ |
567 | -+ulint |
568 | -+dict_table_flags_to_zip_size( |
569 | -+/*=========================*/ |
570 | -+ ulint flags) /*!< in: flags */ |
571 | -+{ |
572 | -+ ulint zip_size = flags & DICT_TF_ZSSIZE_MASK; |
573 | -+ |
574 | -+ if (zip_size) { |
575 | -+ zip_size = ((PAGE_ZIP_MIN_SIZE >> 1) |
576 | -+ << (zip_size >> DICT_TF_ZSSIZE_SHIFT)); |
577 | -+ } |
578 | -+ |
579 | -+ return(zip_size); |
580 | -+} |
581 | -+ |
582 | -+int |
583 | -+fil_fd_get_zip_size( |
584 | -+/*===================*/ |
585 | -+ int fd) |
586 | -+{ |
587 | -+ ulint flags; |
588 | -+ byte buf[UNIV_PAGE_SIZE * 2]; |
589 | -+ byte *page = (byte *) (((unsigned long) buf + UNIV_PAGE_SIZE - 1) & |
590 | -+ ~(UNIV_PAGE_SIZE - 1)); |
591 | -+ |
592 | -+ if(pread(fd, page, UNIV_PAGE_SIZE, 0) != UNIV_PAGE_SIZE) |
593 | -+ return -1; |
594 | -+ |
595 | -+ flags = fsp_header_get_flags(page); |
596 | -+ |
597 | -+ if (flags && flags != (ulint)-1) { |
598 | -+ return(dict_table_flags_to_zip_size(flags)); |
599 | -+ } |
600 | -+ |
601 | -+ return(flags); |
602 | -+} |
603 | -+ |
604 | -+ulint |
605 | -+fil_fd_get_space_id( |
606 | -+/*===================*/ |
607 | -+ int fd) |
608 | -+{ |
609 | -+ byte buf[UNIV_PAGE_SIZE * 2]; |
610 | -+ byte *page = (byte *) (((unsigned long) buf + UNIV_PAGE_SIZE - 1) & |
611 | -+ ~(UNIV_PAGE_SIZE - 1)); |
612 | -+ |
613 | -+ if(pread(fd, page, UNIV_PAGE_SIZE, 0) != UNIV_PAGE_SIZE) |
614 | -+ return -1; |
615 | -+ |
616 | -+ return(mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID)); |
617 | -+} |
618 | -+ |
619 | -+ulint |
620 | -+page_zip_calc_checksum( |
621 | -+/*===================*/ |
622 | -+ const void* data, /*!< in: compressed page */ |
623 | -+ ulint size) /*!< in: size of compressed page */ |
624 | -+{ |
625 | -+ /* Exclude FIL_PAGE_SPACE_OR_CHKSUM, FIL_PAGE_LSN, |
626 | -+ and FIL_PAGE_FILE_FLUSH_LSN from the checksum. */ |
627 | -+ |
628 | -+ const Bytef* s = data; |
629 | -+ uLong adler; |
630 | -+ |
631 | -+ adler = adler32(0L, s + FIL_PAGE_OFFSET, |
632 | -+ FIL_PAGE_LSN - FIL_PAGE_OFFSET); |
633 | -+ adler = adler32(adler, s + FIL_PAGE_TYPE, 2); |
634 | -+ adler = adler32(adler, s + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, |
635 | -+ size - FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); |
636 | -+ |
637 | -+ return((ulint) adler); |
638 | -+} |
639 | -+ |
640 | -+ulint |
641 | -+buf_calc_page_new_checksum_32( |
642 | -+/*==========================*/ |
643 | -+ byte* page, |
644 | -+ ulint page_size) |
645 | -+{ |
646 | -+ ulint checksum; |
647 | -+ |
648 | -+ checksum = ut_fold_binary(page + FIL_PAGE_OFFSET, |
649 | -+ FIL_PAGE_FILE_FLUSH_LSN - FIL_PAGE_OFFSET) |
650 | -+ + ut_fold_binary(page + FIL_PAGE_DATA, |
651 | -+ FIL_PAGE_DATA_ALIGN_32 - FIL_PAGE_DATA) |
652 | -+ + ut_fold_binary_32(page + FIL_PAGE_DATA_ALIGN_32, |
653 | -+ page_size - FIL_PAGE_DATA_ALIGN_32 |
654 | -+ - FIL_PAGE_END_LSN_OLD_CHKSUM); |
655 | -+ checksum= checksum & 0xFFFFFFFF; |
656 | -+ |
657 | -+ return(checksum); |
658 | -+} |
659 | -+ |
660 | -+ulint |
661 | -+buf_calc_page_old_checksum( |
662 | -+/*=======================*/ |
663 | -+ /* out: checksum */ |
664 | -+ byte* page) /* in: buffer page */ |
665 | -+{ |
666 | -+ ulint checksum; |
667 | -+ |
668 | -+ checksum= ut_fold_binary(page, FIL_PAGE_FILE_FLUSH_LSN); |
669 | -+ |
670 | -+ checksum= checksum & 0xFFFFFFFF; |
671 | -+ |
672 | -+ return(checksum); |
673 | -+} |
674 | -+ |
675 | -+int |
676 | -+buf_page_is_corrupted( |
677 | -+/*==================*/ |
678 | -+ /* out: TRUE if corrupted */ |
679 | -+ byte* read_buf, /* in: a database page */ |
680 | -+ ulint page_size, |
681 | -+ ulint zip_size) |
682 | -+{ |
683 | -+ ulint checksum; |
684 | -+ ulint old_checksum; |
685 | -+ ulint checksum_field; |
686 | -+ ulint old_checksum_field; |
687 | -+ |
688 | -+ if (!zip_size && |
689 | -+ mach_read_from_4(read_buf + FIL_PAGE_LSN + 4) |
690 | -+ != mach_read_from_4(read_buf + page_size |
691 | -+ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) { |
692 | -+ |
693 | -+ /* Stored log sequence numbers at the start and the end |
694 | -+ of page do not match */ |
695 | -+ |
696 | -+ return(1); |
697 | -+ } |
698 | -+ |
699 | -+ /* If we use checksums validation, make additional check before returning |
700 | -+ TRUE to ensure that the checksum is not equal to BUF_NO_CHECKSUM_MAGIC which |
701 | -+ might be stored by InnoDB with checksums disabled. |
702 | -+ Otherwise, skip checksum calculation and return FALSE */ |
703 | -+ |
704 | -+ checksum_field = mach_read_from_4(read_buf + |
705 | -+ FIL_PAGE_SPACE_OR_CHKSUM); |
706 | -+ |
707 | -+ if (zip_size) { |
708 | -+ return(checksum_field != BUF_NO_CHECKSUM_MAGIC |
709 | -+ && checksum_field |
710 | -+ != page_zip_calc_checksum(read_buf, zip_size)); |
711 | -+ } |
712 | -+ |
713 | -+ old_checksum = buf_calc_page_old_checksum(read_buf); |
714 | -+ |
715 | -+ old_checksum_field = mach_read_from_4(read_buf + page_size |
716 | -+ - FIL_PAGE_END_LSN_OLD_CHKSUM); |
717 | -+ |
718 | -+ /* There are 2 valid formulas for old_checksum_field: |
719 | -+ 1. Very old versions of InnoDB only stored 8 byte lsn to the start |
720 | -+ and the end of the page. |
721 | -+ 2. Newer InnoDB versions store the old formula checksum there. */ |
722 | -+ |
723 | -+ if (old_checksum_field != mach_read_from_4(read_buf + FIL_PAGE_LSN) |
724 | -+ && old_checksum_field != old_checksum |
725 | -+ && old_checksum_field != BUF_NO_CHECKSUM_MAGIC) { |
726 | -+ |
727 | -+ return(1); |
728 | -+ } |
729 | -+ |
730 | -+ checksum = buf_calc_page_new_checksum(read_buf, page_size); |
731 | -+ checksum_field = mach_read_from_4(read_buf + FIL_PAGE_SPACE_OR_CHKSUM); |
732 | -+ |
733 | -+ /* InnoDB versions < 4.0.14 and < 4.1.1 stored the space id |
734 | -+ (always equal to 0), to FIL_PAGE_SPACE_SPACE_OR_CHKSUM */ |
735 | -+ |
736 | -+ if (checksum_field != 0 && checksum_field != checksum |
737 | -+ && checksum_field != buf_calc_page_new_checksum_32(read_buf, page_size) |
738 | -+ && checksum_field != BUF_NO_CHECKSUM_MAGIC) { |
739 | -+ |
740 | -+ return(1); |
741 | -+ } |
742 | -+ |
743 | -+ return(0); |
744 | -+} |
745 | - |
746 | - struct tar_dev |
747 | - { |
748 | -@@ -69,7 +390,7 @@ |
749 | - (savename ? savename : "[NULL]")); |
750 | - #endif |
751 | - |
752 | -- if (lstat(realname, &s) != 0) |
753 | -+ if (stat(realname, &s) != 0) |
754 | - { |
755 | - #ifdef DEBUG |
756 | - perror("lstat()"); |
757 | -@@ -210,11 +531,17 @@ |
758 | - int |
759 | - tar_append_regfile(TAR *t, char *realname) |
760 | - { |
761 | -- char block[T_BLOCKSIZE]; |
762 | -+ unsigned char buf[T_BLOCKSIZE * 64]; /* 16KB MAX + alignment */ |
763 | -+ unsigned char *block; |
764 | - int filefd; |
765 | -- int i, j; |
766 | -- size_t size; |
767 | -+ int j, k, n_retry; |
768 | -+ long long i, size, offset; |
769 | -+ int page_size = 1 * 1024; /* check 1K, 2K, 4K, 8K and 16K */ |
770 | -+ int page_size_shift = 10; |
771 | -+ int zip_size; |
772 | -+ int is_sys_space; |
773 | - |
774 | -+ block = (unsigned char *)(((unsigned long) buf + 16384 - 1) & ~(16384 - 1)); |
775 | - filefd = open(realname, O_RDONLY); |
776 | - if (filefd == -1) |
777 | - { |
778 | -@@ -224,27 +551,93 @@ |
779 | - return -1; |
780 | - } |
781 | - |
782 | -+#ifdef USE_POSIX_FADVISE |
783 | -+ posix_fadvise(filefd, 0, 0, POSIX_FADV_SEQUENTIAL); |
784 | -+ posix_fadvise(filefd, 0, 0, POSIX_FADV_DONTNEED); |
785 | -+#endif |
786 | -+#if defined(O_DIRECT) |
787 | -+ /* Don't check for errors, continue even if it fails */ |
788 | -+ if (use_direct) |
789 | -+ fcntl(filefd, F_SETFL, O_DIRECT); |
790 | -+#endif |
791 | -+ |
792 | -+ is_sys_space = (fil_fd_get_space_id(filefd) == 0); |
793 | -+ |
794 | -+ zip_size = is_sys_space ? 0 : fil_fd_get_zip_size(filefd); |
795 | -+ if (zip_size == -1) { |
796 | -+ fprintf(stderr, |
797 | -+ "tar4ibd: file '%s' has invalid zip_size value.\n", |
798 | -+ realname); |
799 | -+ return(-1); |
800 | -+ } else if (zip_size != 0) { |
801 | -+ page_size = zip_size; |
802 | -+ } |
803 | -+ |
804 | -+ n_retry = 0; |
805 | - size = th_get_size(t); |
806 | -- for (i = size; i > T_BLOCKSIZE; i -= T_BLOCKSIZE) |
807 | -+ for (i = size, offset = 0; i >= page_size; |
808 | -+ i -= page_size, offset += page_size) |
809 | - { |
810 | -- j = read(filefd, &block, T_BLOCKSIZE); |
811 | -- if (j != T_BLOCKSIZE) |
812 | -+ j = read(filefd, &block[0], page_size); |
813 | -+ if (j != page_size) |
814 | - { |
815 | - if (j != -1) |
816 | - errno = EINVAL; |
817 | - return -1; |
818 | - } |
819 | -- if (tar_block_write(t, &block) == -1) |
820 | -+ if (buf_page_is_corrupted(block, (ulint)page_size, |
821 | -+ (ulint)zip_size)) { |
822 | -+ ulint page_no = (unsigned long) |
823 | -+ (offset >> page_size_shift); |
824 | -+ if (is_sys_space && |
825 | -+ page_no >= FSP_EXTENT_SIZE && |
826 | -+ page_no < FSP_EXTENT_SIZE * 3) { |
827 | -+ fprintf(stderr, "tar4ibd: page %lu seems to " |
828 | -+ "be from the doublewrite buffer. " |
829 | -+ "skipping checksum validation.\n", |
830 | -+ page_no); |
831 | -+ goto write_page; |
832 | -+ } |
833 | -+ if (n_retry > 9) { |
834 | -+ fprintf(stderr, |
835 | -+"The file '%s' may not be InnoDB datafile or may be corrupted.\n", |
836 | -+ realname); |
837 | -+ errno = EIO; |
838 | -+ return -1; |
839 | -+ } |
840 | -+ |
841 | -+ /* retry */ |
842 | -+ if (lseek(filefd, - page_size, SEEK_CUR) == -1) |
843 | -+ return -1; |
844 | -+ |
845 | -+ if (i == size && !zip_size |
846 | -+ && page_size < 16 * 1024) { |
847 | -+ page_size *= 2; |
848 | -+ page_size_shift++; |
849 | -+ } else { |
850 | -+ n_retry++; |
851 | -+ } |
852 | -+ |
853 | -+ i += page_size; |
854 | -+ offset -= page_size; |
855 | -+ |
856 | -+ continue; |
857 | -+ } |
858 | -+write_page: |
859 | -+ for (k = 0; k < page_size / T_BLOCKSIZE; k++) |
860 | -+ if (tar_block_write(t, &block[T_BLOCKSIZE * k]) == -1) |
861 | - return -1; |
862 | -+ n_retry = 0; |
863 | - } |
864 | - |
865 | - if (i > 0) |
866 | - { |
867 | -- j = read(filefd, &block, i); |
868 | -+ j = read(filefd, &block[0], page_size); |
869 | - if (j == -1) |
870 | - return -1; |
871 | -- memset(&(block[i]), 0, T_BLOCKSIZE - i); |
872 | -- if (tar_block_write(t, &block) == -1) |
873 | -+ memset(&(block[i]), 0, T_BLOCKSIZE * 32 - i); |
874 | -+ for (k = 0; k < ((j - 1) / T_BLOCKSIZE + 1); k++) |
875 | -+ if (tar_block_write(t, &block[T_BLOCKSIZE * k]) == -1) |
876 | - return -1; |
877 | - } |
878 | - |
879 | ---- a/lib/extract.c |
880 | -+++ b/lib/extract.c |
881 | -@@ -158,11 +158,11 @@ |
882 | - tar_extract_regfile(TAR *t, char *realname) |
883 | - { |
884 | - mode_t mode; |
885 | -- size_t size; |
886 | -+ size_t i, size; |
887 | - uid_t uid; |
888 | - gid_t gid; |
889 | - int fdout; |
890 | -- int i, k; |
891 | -+ int k; |
892 | - char buf[T_BLOCKSIZE]; |
893 | - char *filename; |
894 | - |
895 | ---- a/lib/libtar.h |
896 | -+++ b/lib/libtar.h |
897 | -@@ -180,7 +180,7 @@ |
898 | - |
899 | - /* decode tar header info */ |
900 | - #define th_get_crc(t) oct_to_int((t)->th_buf.chksum) |
901 | --#define th_get_size(t) oct_to_int((t)->th_buf.size) |
902 | -+#define th_get_size(t) oct_to_longlong((t)->th_buf.size) |
903 | - #define th_get_mtime(t) oct_to_int((t)->th_buf.mtime) |
904 | - #define th_get_devmajor(t) oct_to_int((t)->th_buf.devmajor) |
905 | - #define th_get_devminor(t) oct_to_int((t)->th_buf.devminor) |
906 | -@@ -204,9 +204,9 @@ |
907 | - void th_set_group(TAR *t, gid_t gid); |
908 | - void th_set_mode(TAR *t, mode_t fmode); |
909 | - #define th_set_mtime(t, fmtime) \ |
910 | -- int_to_oct_nonull((fmtime), (t)->th_buf.mtime, 12) |
911 | -+ int_to_oct((fmtime), (t)->th_buf.mtime, 12) |
912 | - #define th_set_size(t, fsize) \ |
913 | -- int_to_oct_nonull((fsize), (t)->th_buf.size, 12) |
914 | -+ longlong_to_oct_nonull((fsize), (t)->th_buf.size, 12) |
915 | - |
916 | - /* encode everything at once (except the pathname and linkname) */ |
917 | - void th_set_from_stat(TAR *t, struct stat *s); |
918 | -@@ -268,13 +268,16 @@ |
919 | - |
920 | - /* string-octal to integer conversion */ |
921 | - int oct_to_int(char *oct); |
922 | -+long oct_to_long(char *oct); |
923 | -+long long oct_to_longlong(char *oct); |
924 | - |
925 | - /* integer to NULL-terminated string-octal conversion */ |
926 | - #define int_to_oct(num, oct, octlen) \ |
927 | -- snprintf((oct), (octlen), "%*lo ", (octlen) - 2, (unsigned long)(num)) |
928 | -+ snprintf((oct), (octlen), "%0*lo", (octlen) - 1, (unsigned long)(num)) |
929 | - |
930 | - /* integer to string-octal conversion, no NULL */ |
931 | - void int_to_oct_nonull(int num, char *oct, size_t octlen); |
932 | -+void longlong_to_oct_nonull(long long num, char *oct, size_t octlen); |
933 | - |
934 | - |
935 | - /***** wrapper.c **********************************************************/ |
936 | ---- a/lib/util.c |
937 | -+++ b/lib/util.c |
938 | -@@ -138,6 +138,14 @@ |
939 | - return i; |
940 | - } |
941 | - |
942 | -+long |
943 | -+oct_to_long(char *oct) |
944 | -+{ |
945 | -+ long i; |
946 | -+ sscanf(oct, "%12lo", &i); |
947 | -+ return i; |
948 | -+} |
949 | -+ |
950 | - |
951 | - /* integer to string-octal conversion, no NULL */ |
952 | - void |
953 | -@@ -147,4 +155,46 @@ |
954 | - oct[octlen - 1] = ' '; |
955 | - } |
956 | - |
957 | -+void |
958 | -+longlong_to_oct_nonull(long long num, char *oct, size_t octlen) |
959 | -+{ |
960 | -+ char buf[100]; |
961 | -+ |
962 | -+ if (num >= (long long)64 * 1024 * 1024 * 1024) { |
963 | -+ oct[0] = 0x80; |
964 | -+ oct[1] = 0; |
965 | -+ oct[2] = 0; |
966 | -+ oct[3] = 0; |
967 | -+ oct[4] = (char)((num >> 56) & 0xFF); |
968 | -+ oct[5] = (char)((num >> 48) & 0xFF); |
969 | -+ oct[6] = (char)((num >> 40) & 0xFF); |
970 | -+ oct[7] = (char)((num >> 32) & 0xFF); |
971 | -+ oct[8] = (char)((num >> 24) & 0xFF); |
972 | -+ oct[9] = (char)((num >> 16) & 0xFF); |
973 | -+ oct[10] = (char)((num >> 8) & 0xFF); |
974 | -+ oct[11] = (char)((num) & 0xFF); |
975 | -+ } else { |
976 | -+ snprintf(buf, octlen + 1, "%0*llo", octlen, num); |
977 | -+ strncpy(oct, buf, octlen); |
978 | -+ } |
979 | -+} |
980 | -+ |
981 | -+long long |
982 | -+oct_to_longlong(char *oct) |
983 | -+{ |
984 | -+ long long i; |
985 | - |
986 | -+ if (oct[0] & 0x80) { |
987 | -+ i = ((long long)((unsigned char)oct[4]) << 56) |
988 | -+ | ((long long)((unsigned char)oct[5]) << 48) |
989 | -+ | ((long long)((unsigned char)oct[6]) << 40) |
990 | -+ | ((long long)((unsigned char)oct[7]) << 32) |
991 | -+ | ((long long)((unsigned char)oct[8]) << 24) |
992 | -+ | ((long long)((unsigned char)oct[9]) << 16) |
993 | -+ | ((long long)((unsigned char)oct[10]) << 8) |
994 | -+ | ((long long)((unsigned char)oct[11])); |
995 | -+ } else { |
996 | -+ sscanf(oct, "%12llo", &i); |
997 | -+ } |
998 | -+ return i; |
999 | -+} |
1000 | ---- a/libtar/Makefile.in |
1001 | -+++ b/libtar/Makefile.in |
1002 | -@@ -29,7 +29,7 @@ |
1003 | - -I${top_srcdir}/lib \ |
1004 | - -I${top_srcdir}/compat \ |
1005 | - @CPPFLAGS@ |
1006 | --CFLAGS = @CFLAGS@ |
1007 | -+CFLAGS = @CFLAGS@ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE |
1008 | - LDFLAGS = @LDFLAGS@ |
1009 | - LIBS = @LIBS@ |
1010 | - LIBOBJS = @LIBOBJS@ |
1011 | -@@ -46,15 +46,15 @@ |
1012 | - ${top_srcdir}/lib/libtar.h \ |
1013 | - ../listhash/libtar_listhash.h |
1014 | - LIBTAR_LIBS = ../lib/libtar.a |
1015 | --ALL = libtar |
1016 | -+ALL = tar4ibd |
1017 | - |
1018 | - |
1019 | - all: ${ALL} |
1020 | - |
1021 | - .PHONY: clean distclean install |
1022 | - |
1023 | --libtar: ${LIBTAR_OBJS} ${LIBTAR_LIBS} ${LIBTAR_HDRS} |
1024 | -- ${CC} ${CFLAGS} ${LDFLAGS} -o libtar libtar.o ${LIBTAR_LIBS} ${LIBS} |
1025 | -+tar4ibd: ${LIBTAR_OBJS} ${LIBTAR_LIBS} ${LIBTAR_HDRS} |
1026 | -+ ${CC} ${CFLAGS} ${LDFLAGS} -o tar4ibd libtar.o ${LIBTAR_LIBS} ${LIBS} |
1027 | - |
1028 | - ${LIBTAR_OBJS}: ${LIBTAR_HDRS} |
1029 | - |
1030 | -@@ -69,5 +69,5 @@ |
1031 | - |
1032 | - install: ${ALL} |
1033 | - ${MKDIR} ${DESTDIR}${bindir} |
1034 | -- ${INSTALL_PROGRAM} libtar ${DESTDIR}${bindir} |
1035 | -+ ${INSTALL_PROGRAM} tar4ibd ${DESTDIR}${bindir} |
1036 | - |
1037 | ---- a/libtar/libtar.c |
1038 | -+++ b/libtar/libtar.c |
1039 | -@@ -14,6 +14,7 @@ |
1040 | - #include <libtar.h> |
1041 | - |
1042 | - #include <stdio.h> |
1043 | -+#include <stdlib.h> |
1044 | - #include <fcntl.h> |
1045 | - #include <errno.h> |
1046 | - #include <sys/param.h> |
1047 | -@@ -40,6 +41,7 @@ |
1048 | - char *progname; |
1049 | - int verbose = 0; |
1050 | - int use_gnu = 0; |
1051 | -+int use_direct = 0; |
1052 | - |
1053 | - #ifdef DEBUG |
1054 | - void |
1055 | -@@ -109,7 +111,7 @@ |
1056 | - char buf[MAXPATHLEN]; |
1057 | - libtar_listptr_t lp; |
1058 | - |
1059 | -- if (tar_open(&t, tarfile, |
1060 | -+ if (tar_fdopen(&t, fileno(stdout), tarfile, |
1061 | - #ifdef HAVE_LIBZ |
1062 | - (use_zlib ? &gztype : NULL), |
1063 | - #else |
1064 | -@@ -164,7 +166,7 @@ |
1065 | - TAR *t; |
1066 | - int i; |
1067 | - |
1068 | -- if (tar_open(&t, tarfile, |
1069 | -+ if (tar_fdopen(&t, fileno(stdin), tarfile, |
1070 | - #ifdef HAVE_LIBZ |
1071 | - (use_zlib ? &gztype : NULL), |
1072 | - #else |
1073 | -@@ -225,7 +227,7 @@ |
1074 | - #ifdef DEBUG |
1075 | - puts("opening tarfile..."); |
1076 | - #endif |
1077 | -- if (tar_open(&t, tarfile, |
1078 | -+ if (tar_fdopen(&t, fileno(stdin), tarfile, |
1079 | - #ifdef HAVE_LIBZ |
1080 | - (use_zlib ? &gztype : NULL), |
1081 | - #else |
1082 | -@@ -264,9 +266,7 @@ |
1083 | - void |
1084 | - usage() |
1085 | - { |
1086 | -- printf("Usage: %s [-C rootdir] [-g] [-z] -x|-t filename.tar\n", |
1087 | -- progname); |
1088 | -- printf(" %s [-C rootdir] [-g] [-z] -c filename.tar ...\n", |
1089 | -+ printf("Usage: %s [-C rootdir] [-d] -c ... > filename.tar\n", |
1090 | - progname); |
1091 | - exit(-1); |
1092 | - } |
1093 | -@@ -287,7 +287,7 @@ |
1094 | - |
1095 | - progname = basename(argv[0]); |
1096 | - |
1097 | -- while ((c = getopt(argc, argv, "cC:gtvVxz")) != -1) |
1098 | -+ while ((c = getopt(argc, argv, "cC:gtvVxzd")) != -1) |
1099 | - switch (c) |
1100 | - { |
1101 | - case 'V': |
1102 | -@@ -300,34 +300,26 @@ |
1103 | - case 'v': |
1104 | - verbose = 1; |
1105 | - break; |
1106 | -- case 'g': |
1107 | -- use_gnu = 1; |
1108 | -- break; |
1109 | - case 'c': |
1110 | - if (mode) |
1111 | - usage(); |
1112 | - mode = MODE_CREATE; |
1113 | - break; |
1114 | -- case 'x': |
1115 | -- if (mode) |
1116 | -- usage(); |
1117 | -- mode = MODE_EXTRACT; |
1118 | -- break; |
1119 | -- case 't': |
1120 | -- if (mode) |
1121 | -- usage(); |
1122 | -- mode = MODE_LIST; |
1123 | -- break; |
1124 | --#ifdef HAVE_LIBZ |
1125 | -- case 'z': |
1126 | -- use_zlib = 1; |
1127 | -+ case 'd': |
1128 | -+#if !defined(O_DIRECT) |
1129 | -+ fprintf(stderr, "tar4ibd: O_DIRECT is not available.\n"); |
1130 | -+ exit(-1); |
1131 | -+#else |
1132 | -+ fprintf(stderr, "tar4ibd: using O_DIRECT for the input file.\n"); |
1133 | -+ use_direct = 1; |
1134 | - break; |
1135 | --#endif /* HAVE_LIBZ */ |
1136 | -+#endif |
1137 | -+ |
1138 | - default: |
1139 | - usage(); |
1140 | - } |
1141 | - |
1142 | -- if (!mode || ((argc - optind) < (mode == MODE_CREATE ? 2 : 1))) |
1143 | -+ if (!mode || ((argc - optind) < (mode == MODE_CREATE ? 1 : 0))) |
1144 | - { |
1145 | - #ifdef DEBUG |
1146 | - printf("argc - optind == %d\tmode == %d\n", argc - optind, |
1147 | -@@ -343,15 +335,14 @@ |
1148 | - switch (mode) |
1149 | - { |
1150 | - case MODE_EXTRACT: |
1151 | -- return extract(argv[optind], rootdir); |
1152 | -+ return extract("<stdin>", rootdir); |
1153 | - case MODE_CREATE: |
1154 | -- tarfile = argv[optind]; |
1155 | - l = libtar_list_new(LIST_QUEUE, NULL); |
1156 | -- for (c = optind + 1; c < argc; c++) |
1157 | -+ for (c = optind; c < argc; c++) |
1158 | - libtar_list_add(l, argv[c]); |
1159 | -- return create(tarfile, rootdir, l); |
1160 | -+ return create("<stdout>", rootdir, l); |
1161 | - case MODE_LIST: |
1162 | -- return list(argv[optind]); |
1163 | -+ return list("<stdin>"); |
1164 | - default: |
1165 | - break; |
1166 | - } |
1167 | |
1168 | === added directory 'src' |
1169 | === renamed file 'Makefile' => 'src/Makefile' |
1170 | --- Makefile 2011-10-05 02:31:10 +0000 |
1171 | +++ src/Makefile 2012-02-10 20:09:18 +0000 |
1172 | @@ -9,137 +9,181 @@ |
1173 | # plugin - XtraBackup for MySQL versions 5.1.* with InnoDB plugin |
1174 | # 5.5 - XtraBackup for MySQL versions 5.5.* |
1175 | |
1176 | -LIBS = -lpthread |
1177 | +LIBS += -lpthread |
1178 | DEFS = -DUNIV_LINUX -DMYSQL_SERVER |
1179 | |
1180 | CFLAGS += -DXTRABACKUP_VERSION=\"$(XTRABACKUP_VERSION)\" -pedantic -Wall -Wundef -Wshadow -fdiagnostics-show-option -fno-strict-aliasing -Wno-strict-aliasing -Wextra -Wformat -Wno-format-nonliteral -Wno-format-security -Wno-long-long -Wmissing-declarations -Wno-redundant-decls --std=gnu99 |
1181 | |
1182 | +ifneq ($(DEBUG),) |
1183 | +CFLAGS += -DXB_DEBUG=1 |
1184 | +endif |
1185 | + |
1186 | TARGET=xtrabackup |
1187 | PREFIX=/usr |
1188 | BIN_DIR=$(PREFIX)/bin |
1189 | |
1190 | +COMMON_INC = -I. -I libarchive/libarchive -I quicklz |
1191 | +XTRABACKUPOBJS = xtrabackup.o stream.o local.o compress.o xbstream_write.o \ |
1192 | + quicklz/quicklz.o |
1193 | +XBSTREAMOBJS = xbstream.o xbstream_write.o xbstream_read.o |
1194 | + |
1195 | +LIBARCHIVE_A = libarchive/libarchive/libarchive.a |
1196 | + |
1197 | default: xtradb |
1198 | |
1199 | # XtraBackup for MySQL 5.1 |
1200 | -5.1: INC = -I. -isystem.. -isystem./../include -isystem./../../include -isystem./../../../include |
1201 | -5.1: INNODBOBJS = ../libinnobase_a-btr0btr.o ../libinnobase_a-btr0cur.o ../libinnobase_a-btr0pcur.o \ |
1202 | - ../libinnobase_a-btr0sea.o ../libinnobase_a-buf0buf.o ../libinnobase_a-buf0flu.o \ |
1203 | - ../libinnobase_a-buf0lru.o ../libinnobase_a-buf0rea.o ../libinnobase_a-data0data.o \ |
1204 | - ../libinnobase_a-data0type.o ../libinnobase_a-dict0boot.o ../libinnobase_a-dict0crea.o \ |
1205 | - ../libinnobase_a-dict0dict.o ../libinnobase_a-dict0load.o ../libinnobase_a-dict0mem.o \ |
1206 | - ../libinnobase_a-dyn0dyn.o ../libinnobase_a-eval0eval.o ../libinnobase_a-eval0proc.o \ |
1207 | - ../libinnobase_a-fil0fil.o ../libinnobase_a-fsp0fsp.o ../libinnobase_a-fut0fut.o \ |
1208 | - ../libinnobase_a-fut0lst.o ../libinnobase_a-ha0ha.o ../libinnobase_a-hash0hash.o \ |
1209 | - ../libinnobase_a-ibuf0ibuf.o ../libinnobase_a-lock0iter.o ../libinnobase_a-lock0lock.o \ |
1210 | - ../libinnobase_a-log0log.o ../libinnobase_a-log0recv.o ../libinnobase_a-mach0data.o \ |
1211 | - ../libinnobase_a-mem0mem.o ../libinnobase_a-mem0pool.o ../libinnobase_a-mtr0log.o \ |
1212 | - ../libinnobase_a-mtr0mtr.o ../libinnobase_a-os0file.o ../libinnobase_a-os0proc.o \ |
1213 | - ../libinnobase_a-os0sync.o ../libinnobase_a-os0thread.o ../libinnobase_a-page0cur.o \ |
1214 | - ../libinnobase_a-page0page.o ../libinnobase_a-lexyy.o ../libinnobase_a-pars0grm.o \ |
1215 | - ../libinnobase_a-pars0opt.o ../libinnobase_a-pars0pars.o ../libinnobase_a-pars0sym.o \ |
1216 | - ../libinnobase_a-que0que.o ../libinnobase_a-read0read.o ../libinnobase_a-rem0cmp.o \ |
1217 | - ../libinnobase_a-rem0rec.o ../libinnobase_a-row0ins.o ../libinnobase_a-row0mysql.o \ |
1218 | - ../libinnobase_a-row0purge.o ../libinnobase_a-row0row.o ../libinnobase_a-row0sel.o \ |
1219 | - ../libinnobase_a-row0uins.o ../libinnobase_a-row0umod.o ../libinnobase_a-row0undo.o \ |
1220 | - ../libinnobase_a-row0upd.o ../libinnobase_a-row0vers.o ../libinnobase_a-srv0que.o \ |
1221 | - ../libinnobase_a-srv0srv.o ../libinnobase_a-srv0start.o ../libinnobase_a-sync0arr.o \ |
1222 | - ../libinnobase_a-sync0rw.o ../libinnobase_a-sync0sync.o ../libinnobase_a-thr0loc.o \ |
1223 | - ../libinnobase_a-trx0purge.o ../libinnobase_a-trx0rec.o ../libinnobase_a-trx0roll.o \ |
1224 | - ../libinnobase_a-trx0rseg.o ../libinnobase_a-trx0sys.o ../libinnobase_a-trx0trx.o \ |
1225 | - ../libinnobase_a-trx0undo.o ../libinnobase_a-usr0sess.o ../libinnobase_a-ut0byte.o \ |
1226 | - ../libinnobase_a-ut0dbg.o ../libinnobase_a-ut0list.o ../libinnobase_a-ut0mem.o \ |
1227 | - ../libinnobase_a-ut0rnd.o ../libinnobase_a-ut0ut.o ../libinnobase_a-ut0vec.o \ |
1228 | - ../libinnobase_a-ut0wqueue.o |
1229 | -5.1: MYSQLOBJS= ../../../mysys/libmysys.a ../../../strings/libmystrings.a ../../../dbug/libdbug.a |
1230 | +5.1: INC = $(COMMON_INC) $(addprefix -isystem$(MYSQL_ROOT_DIR)/, \ |
1231 | + include storage/innobase/include) |
1232 | +5.1: INNODBOBJS = $(addprefix $(MYSQL_ROOT_DIR)/storage/innobase/libinnobase_a-, \ |
1233 | + btr0btr.o btr0cur.o btr0pcur.o \ |
1234 | + btr0sea.o buf0buf.o buf0flu.o buf0lru.o buf0rea.o data0data.o \ |
1235 | + data0type.o dict0boot.o dict0crea.o dict0dict.o dict0load.o dict0mem.o \ |
1236 | + dyn0dyn.o eval0eval.o eval0proc.o fil0fil.o fsp0fsp.o fut0fut.o \ |
1237 | + fut0lst.o ha0ha.o hash0hash.o ibuf0ibuf.o lock0iter.o lock0lock.o \ |
1238 | + log0log.o log0recv.o mach0data.o mem0mem.o mem0pool.o mtr0log.o \ |
1239 | + mtr0mtr.o os0file.o os0proc.o os0sync.o os0thread.o page0cur.o \ |
1240 | + page0page.o lexyy.o pars0grm.o pars0opt.o pars0pars.o pars0sym.o \ |
1241 | + que0que.o read0read.o rem0cmp.o rem0rec.o row0ins.o row0mysql.o \ |
1242 | + row0purge.o row0row.o row0sel.o row0uins.o row0umod.o row0undo.o \ |
1243 | + row0upd.o row0vers.o srv0que.o srv0srv.o srv0start.o sync0arr.o \ |
1244 | + sync0rw.o sync0sync.o thr0loc.o trx0purge.o trx0rec.o trx0roll.o \ |
1245 | + trx0rseg.o trx0sys.o trx0trx.o trx0undo.o usr0sess.o ut0byte.o \ |
1246 | + ut0dbg.o ut0list.o ut0mem.o ut0rnd.o ut0ut.o ut0vec.o ut0wqueue.o) |
1247 | +5.1: MYSQLOBJS= $(addprefix $(MYSQL_ROOT_DIR)/, mysys/libmysys.a \ |
1248 | + strings/libmystrings.a zlib/.libs/libzlt.a dbug/libdbug.a) |
1249 | 5.1: TARGET := xtrabackup_51 |
1250 | -5.1: $(TARGET) |
1251 | +5.1: $(TARGET) xbstream |
1252 | |
1253 | # XtraBackup for MySQL with InnoDB Plugin |
1254 | -plugin: INC = -I. -isystem.. -isystem./../include -isystem./../../include -isystem./../../../include |
1255 | -plugin: INNODBOBJS = ../ha_innodb_plugin_la-btr0btr.o ../ha_innodb_plugin_la-btr0cur.o ../ha_innodb_plugin_la-btr0pcur.o ../ha_innodb_plugin_la-btr0sea.o ../ha_innodb_plugin_la-buf0buddy.o ../ha_innodb_plugin_la-buf0buf.o ../ha_innodb_plugin_la-buf0flu.o ../ha_innodb_plugin_la-buf0lru.o ../ha_innodb_plugin_la-buf0rea.o ../ha_innodb_plugin_la-data0data.o ../ha_innodb_plugin_la-data0type.o ../ha_innodb_plugin_la-dict0boot.o ../ha_innodb_plugin_la-dict0crea.o ../ha_innodb_plugin_la-dict0dict.o ../ha_innodb_plugin_la-dict0load.o ../ha_innodb_plugin_la-dict0mem.o ../ha_innodb_plugin_la-dyn0dyn.o ../ha_innodb_plugin_la-eval0eval.o ../ha_innodb_plugin_la-eval0proc.o ../ha_innodb_plugin_la-fil0fil.o ../ha_innodb_plugin_la-fsp0fsp.o ../ha_innodb_plugin_la-fut0fut.o ../ha_innodb_plugin_la-fut0lst.o ../ha_innodb_plugin_la-ha0ha.o ../ha_innodb_plugin_la-ha0storage.o ../ha_innodb_plugin_la-hash0hash.o ../ha_innodb_plugin_la-ibuf0ibuf.o ../ha_innodb_plugin_la-lock0iter.o ../ha_innodb_plugin_la-lock0lock.o ../ha_innodb_plugin_la-log0log.o ../ha_innodb_plugin_la-log0recv.o ../ha_innodb_plugin_la-mach0data.o ../ha_innodb_plugin_la-mem0mem.o ../ha_innodb_plugin_la-mem0pool.o ../ha_innodb_plugin_la-mtr0log.o ../ha_innodb_plugin_la-mtr0mtr.o ../ha_innodb_plugin_la-os0file.o ../ha_innodb_plugin_la-os0proc.o ../ha_innodb_plugin_la-os0sync.o ../ha_innodb_plugin_la-os0thread.o ../ha_innodb_plugin_la-page0cur.o ../ha_innodb_plugin_la-page0page.o ../ha_innodb_plugin_la-page0zip.o ../ha_innodb_plugin_la-lexyy.o ../ha_innodb_plugin_la-pars0grm.o ../ha_innodb_plugin_la-pars0opt.o ../ha_innodb_plugin_la-pars0pars.o ../ha_innodb_plugin_la-pars0sym.o ../ha_innodb_plugin_la-que0que.o ../ha_innodb_plugin_la-read0read.o ../ha_innodb_plugin_la-rem0cmp.o ../ha_innodb_plugin_la-rem0rec.o ../ha_innodb_plugin_la-row0ext.o ../ha_innodb_plugin_la-row0ins.o ../ha_innodb_plugin_la-row0merge.o ../ha_innodb_plugin_la-row0mysql.o ../ha_innodb_plugin_la-row0purge.o ../ha_innodb_plugin_la-row0row.o ../ha_innodb_plugin_la-row0sel.o ../ha_innodb_plugin_la-row0uins.o ../ha_innodb_plugin_la-row0umod.o ../ha_innodb_plugin_la-row0undo.o ../ha_innodb_plugin_la-row0upd.o ../ha_innodb_plugin_la-row0vers.o ../ha_innodb_plugin_la-srv0que.o ../ha_innodb_plugin_la-srv0srv.o ../ha_innodb_plugin_la-srv0start.o ../ha_innodb_plugin_la-sync0arr.o ../ha_innodb_plugin_la-sync0rw.o ../ha_innodb_plugin_la-sync0sync.o ../ha_innodb_plugin_la-thr0loc.o ../ha_innodb_plugin_la-trx0purge.o ../ha_innodb_plugin_la-trx0rec.o ../ha_innodb_plugin_la-trx0roll.o ../ha_innodb_plugin_la-trx0rseg.o ../ha_innodb_plugin_la-trx0sys.o ../ha_innodb_plugin_la-trx0trx.o ../ha_innodb_plugin_la-trx0undo.o ../ha_innodb_plugin_la-usr0sess.o ../ha_innodb_plugin_la-ut0byte.o ../ha_innodb_plugin_la-ut0dbg.o ../ha_innodb_plugin_la-ut0list.o ../ha_innodb_plugin_la-ut0mem.o ../ha_innodb_plugin_la-ut0rnd.o ../ha_innodb_plugin_la-ut0ut.o ../ha_innodb_plugin_la-ut0vec.o ../ha_innodb_plugin_la-ut0wqueue.o ../ha_innodb_plugin_la-ut0rbt.o |
1256 | +plugin: INC = $(COMMON_INC) $(addprefix -I$(MYSQL_ROOT_DIR)/, \ |
1257 | + include storage/innodb_plugin/include) |
1258 | +plugin: INNODBOBJS = $(addprefix \ |
1259 | + $(MYSQL_ROOT_DIR)/storage/innodb_plugin/ha_innodb_plugin_la-, \ |
1260 | + btr0btr.o btr0cur.o btr0pcur.o btr0sea.o buf0buddy.o buf0buf.o \ |
1261 | + buf0flu.o buf0lru.o buf0rea.o data0data.o data0type.o dict0boot.o \ |
1262 | + dict0crea.o dict0dict.o dict0load.o dict0mem.o dyn0dyn.o eval0eval.o \ |
1263 | + eval0proc.o fil0fil.o fsp0fsp.o fut0fut.o fut0lst.o ha0ha.o \ |
1264 | + ha0storage.o hash0hash.o ibuf0ibuf.o lock0iter.o lock0lock.o log0log.o \ |
1265 | + log0recv.o mach0data.o mem0mem.o mem0pool.o mtr0log.o mtr0mtr.o \ |
1266 | + os0file.o os0proc.o os0sync.o os0thread.o page0cur.o page0page.o \ |
1267 | + page0zip.o lexyy.o pars0grm.o pars0opt.o pars0pars.o pars0sym.o \ |
1268 | + que0que.o read0read.o rem0cmp.o rem0rec.o row0ext.o row0ins.o \ |
1269 | + row0merge.o row0mysql.o row0purge.o row0row.o row0sel.o row0uins.o \ |
1270 | + row0umod.o row0undo.o row0upd.o row0vers.o srv0que.o srv0srv.o \ |
1271 | + srv0start.o sync0arr.o sync0rw.o sync0sync.o thr0loc.o trx0purge.o \ |
1272 | + trx0rec.o trx0roll.o trx0rseg.o trx0sys.o trx0trx.o trx0undo.o \ |
1273 | + usr0sess.o ut0byte.o ut0dbg.o ut0list.o ut0mem.o ut0rnd.o ut0ut.o \ |
1274 | + ut0vec.o ut0wqueue.o ut0rbt.o) |
1275 | |
1276 | -plugin: MYSQLOBJS= ../../../mysys/libmysys.a ../../../strings/libmystrings.a ../../../zlib/.libs/libzlt.a ../../../dbug/libdbug.a |
1277 | +plugin: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, mysys/libmysys.a \ |
1278 | + strings/libmystrings.a zlib/.libs/libzlt.a dbug/libdbug.a) |
1279 | plugin: TARGET := xtrabackup_plugin |
1280 | -plugin: $(TARGET) |
1281 | +plugin: $(TARGET) xbstream |
1282 | |
1283 | # XtraBackup for MySQL 5.5 |
1284 | -5.5: INC = -I. -I.. -I./../include -I./../../include -I./../../../include |
1285 | -5.5: INNODBOBJS= ../libinnobase.a |
1286 | - |
1287 | -5.5: MYSQLOBJS= ../../../mysys/libmysys.a ../../../strings/libstrings.a ../../../zlib/libzlib.a ../../../dbug/libdbug.a |
1288 | +5.5: INC = $(COMMON_INC) $(addprefix -isystem$(MYSQL_ROOT_DIR)/, \ |
1289 | + include storage/innobase/include) |
1290 | +5.5: INNODBOBJS = $(MYSQL_ROOT_DIR)/storage/innobase/libinnobase.a |
1291 | + |
1292 | +ifeq "$(wildcard $(MYSQL_ROOT_DIR)/zlib/.libs/libzlt.a)" "" |
1293 | +xtradb55: LIBZ= -lz |
1294 | +else |
1295 | +xtradb55: LIBZ= $(MYSQL_ROOT_DIR)/zlib/.libs/libzlt.a |
1296 | +endif |
1297 | + |
1298 | +5.5: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, \ |
1299 | + mysys/libmysys.a strings/libstrings.a zlib/libzlib.a dbug/libdbug.a) |
1300 | ifeq ($(shell uname -s),Linux) |
1301 | 5.5: LIBS += -laio |
1302 | endif |
1303 | 5.5: TARGET := xtrabackup_innodb55 |
1304 | # In CMake server builds it is important to build with exactly the same preprocessor flags |
1305 | # as were used to build InnoDB |
1306 | -5.5: DEFS = $(shell grep C_DEFINES ../CMakeFiles/innobase.dir/flags.make | \ |
1307 | - sed -e 's/C_DEFINES = //') |
1308 | -5.5: $(TARGET) |
1309 | +5.5: DEFS = $(shell grep C_DEFINES \ |
1310 | + $(MYSQL_ROOT_DIR)/storage/innobase/CMakeFiles/innobase.dir/flags.make | \ |
1311 | + sed -e 's/C_DEFINES = //') |
1312 | +5.5: $(TARGET) xbstream |
1313 | |
1314 | # XtraBackup for XtraDB |
1315 | -xtradb: INC=-I. -isystem.. -isystem./../include -isystem./../../include -isystem./../../../include |
1316 | -xtradb: INNODBOBJS = ../libinnobase_a-btr0btr.o ../libinnobase_a-btr0cur.o ../libinnobase_a-btr0pcur.o \ |
1317 | - ../libinnobase_a-btr0sea.o ../libinnobase_a-buf0buddy.o ../libinnobase_a-buf0buf.o \ |
1318 | - ../libinnobase_a-buf0flu.o ../libinnobase_a-buf0lru.o ../libinnobase_a-buf0rea.o \ |
1319 | - ../libinnobase_a-data0data.o ../libinnobase_a-data0type.o ../libinnobase_a-dict0boot.o \ |
1320 | - ../libinnobase_a-dict0crea.o ../libinnobase_a-dict0dict.o ../libinnobase_a-dict0load.o \ |
1321 | - ../libinnobase_a-dict0mem.o ../libinnobase_a-dyn0dyn.o ../libinnobase_a-eval0eval.o \ |
1322 | - ../libinnobase_a-eval0proc.o ../libinnobase_a-fil0fil.o ../libinnobase_a-fsp0fsp.o \ |
1323 | - ../libinnobase_a-fut0fut.o ../libinnobase_a-fut0lst.o ../libinnobase_a-ha0ha.o \ |
1324 | - ../libinnobase_a-ha0storage.o ../libinnobase_a-hash0hash.o ../libinnobase_a-ibuf0ibuf.o \ |
1325 | - ../libinnobase_a-lock0iter.o ../libinnobase_a-lock0lock.o ../libinnobase_a-log0log.o \ |
1326 | - ../libinnobase_a-log0recv.o ../libinnobase_a-mach0data.o ../libinnobase_a-mem0mem.o \ |
1327 | - ../libinnobase_a-mem0pool.o ../libinnobase_a-mtr0log.o ../libinnobase_a-mtr0mtr.o \ |
1328 | - ../libinnobase_a-os0file.o ../libinnobase_a-os0proc.o ../libinnobase_a-os0sync.o \ |
1329 | - ../libinnobase_a-os0thread.o ../libinnobase_a-page0cur.o ../libinnobase_a-page0page.o \ |
1330 | - ../libinnobase_a-page0zip.o ../libinnobase_a-lexyy.o ../libinnobase_a-pars0grm.o \ |
1331 | - ../libinnobase_a-pars0opt.o ../libinnobase_a-pars0pars.o ../libinnobase_a-pars0sym.o \ |
1332 | - ../libinnobase_a-que0que.o ../libinnobase_a-read0read.o ../libinnobase_a-rem0cmp.o \ |
1333 | - ../libinnobase_a-rem0rec.o ../libinnobase_a-row0ext.o ../libinnobase_a-row0ins.o \ |
1334 | - ../libinnobase_a-row0merge.o ../libinnobase_a-row0mysql.o ../libinnobase_a-row0purge.o \ |
1335 | - ../libinnobase_a-row0row.o ../libinnobase_a-row0sel.o ../libinnobase_a-row0uins.o \ |
1336 | - ../libinnobase_a-row0umod.o ../libinnobase_a-row0undo.o ../libinnobase_a-row0upd.o \ |
1337 | - ../libinnobase_a-row0vers.o ../libinnobase_a-srv0que.o ../libinnobase_a-srv0srv.o \ |
1338 | - ../libinnobase_a-srv0start.o ../libinnobase_a-sync0arr.o ../libinnobase_a-sync0rw.o \ |
1339 | - ../libinnobase_a-sync0sync.o ../libinnobase_a-thr0loc.o ../libinnobase_a-trx0purge.o \ |
1340 | - ../libinnobase_a-trx0rec.o ../libinnobase_a-trx0roll.o ../libinnobase_a-trx0rseg.o \ |
1341 | - ../libinnobase_a-trx0sys.o ../libinnobase_a-trx0trx.o ../libinnobase_a-trx0undo.o \ |
1342 | - ../libinnobase_a-usr0sess.o ../libinnobase_a-ut0byte.o ../libinnobase_a-ut0dbg.o \ |
1343 | - ../libinnobase_a-ut0list.o ../libinnobase_a-ut0mem.o ../libinnobase_a-ut0rnd.o \ |
1344 | - ../libinnobase_a-ut0ut.o ../libinnobase_a-ut0vec.o ../libinnobase_a-ut0wqueue.o \ |
1345 | - ../libinnobase_a-ut0rbt.o |
1346 | -xtradb: MYSQLOBJS = ../../../mysys/libmysys.a ../../../strings/libmystrings.a ../../../zlib/.libs/libzlt.a ../../../dbug/libdbug.a |
1347 | +xtradb: INC = $(COMMON_INC) $(addprefix -isystem$(MYSQL_ROOT_DIR)/, \ |
1348 | + include storage/innodb_plugin/include) |
1349 | +xtradb: INNODBOBJS = $(addprefix \ |
1350 | + $(MYSQL_ROOT_DIR)/storage/innodb_plugin/libinnobase_a-, \ |
1351 | + btr0btr.o btr0cur.o btr0pcur.o \ |
1352 | + btr0sea.o buf0buddy.o buf0buf.o \ |
1353 | + buf0flu.o buf0lru.o buf0rea.o \ |
1354 | + data0data.o data0type.o dict0boot.o \ |
1355 | + dict0crea.o dict0dict.o dict0load.o \ |
1356 | + dict0mem.o dyn0dyn.o eval0eval.o \ |
1357 | + eval0proc.o fil0fil.o fsp0fsp.o \ |
1358 | + fut0fut.o fut0lst.o ha0ha.o \ |
1359 | + ha0storage.o hash0hash.o ibuf0ibuf.o \ |
1360 | + lock0iter.o lock0lock.o log0log.o \ |
1361 | + log0recv.o mach0data.o mem0mem.o \ |
1362 | + mem0pool.o mtr0log.o mtr0mtr.o \ |
1363 | + os0file.o os0proc.o os0sync.o \ |
1364 | + os0thread.o page0cur.o page0page.o \ |
1365 | + page0zip.o lexyy.o pars0grm.o \ |
1366 | + pars0opt.o pars0pars.o pars0sym.o \ |
1367 | + que0que.o read0read.o rem0cmp.o \ |
1368 | + rem0rec.o row0ext.o row0ins.o \ |
1369 | + row0merge.o row0mysql.o row0purge.o \ |
1370 | + row0row.o row0sel.o row0uins.o \ |
1371 | + row0umod.o row0undo.o row0upd.o \ |
1372 | + row0vers.o srv0que.o srv0srv.o \ |
1373 | + srv0start.o sync0arr.o sync0rw.o \ |
1374 | + sync0sync.o thr0loc.o trx0purge.o \ |
1375 | + trx0rec.o trx0roll.o trx0rseg.o \ |
1376 | + trx0sys.o trx0trx.o trx0undo.o \ |
1377 | + usr0sess.o ut0byte.o ut0dbg.o \ |
1378 | + ut0list.o ut0mem.o ut0rnd.o \ |
1379 | + ut0ut.o ut0vec.o ut0wqueue.o \ |
1380 | + ut0rbt.o) |
1381 | +xtradb: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, mysys/libmysys.a \ |
1382 | + strings/libmystrings.a zlib/.libs/libzlt.a dbug/libdbug.a) |
1383 | xtradb: DEFS += -DXTRADB_BASED |
1384 | xtradb: TARGET := xtrabackup |
1385 | -xtradb: $(TARGET) |
1386 | +xtradb: $(TARGET) xbstream |
1387 | |
1388 | # XtraBackup for XtraDB 5.5 |
1389 | -xtradb55: INC=-I. -isystem.. -isystem./../include -isystem./../../include -isystem./../../../include |
1390 | -xtradb55: INNODBOBJS = ../libinnobase.a |
1391 | +xtradb55: INC = $(COMMON_INC) $(addprefix -isystem$(MYSQL_ROOT_DIR)/, \ |
1392 | + include storage/innobase/include) |
1393 | +xtradb55: INNODBOBJS = $(MYSQL_ROOT_DIR)/storage/innobase/libinnobase.a |
1394 | ifeq ($(shell uname -s),Linux) |
1395 | xtradb55: LIBS += -laio |
1396 | endif |
1397 | -ifeq "$(wildcard ../../../zlib/.libs/libzlt.a)" "" |
1398 | + |
1399 | +ifeq "$(wildcard $(MYSQL_ROOT_DIR)/zlib/.libs/libzlt.a)" "" |
1400 | xtradb55: LIBZ= -lz |
1401 | else |
1402 | -xtradb55: LIBZ= ../../../zlib/.libs/libzlt.a |
1403 | +xtradb55: LIBZ= $(MYSQL_ROOT_DIR)/zlib/.libs/libzlt.a |
1404 | endif |
1405 | -xtradb55: MYSQLOBJS = ../../../mysys/libmysys.a ../../../strings/libstrings.a $(LIBZ) ../../../dbug/libdbug.a |
1406 | -# In CMake server builds it is important to build with exactly the same preprocessor flags |
1407 | -# as were used to build InnoDB |
1408 | -xtradb55: DEFS = $(shell grep C_DEFINES ../CMakeFiles/innobase.dir/flags.make | \ |
1409 | - sed -e 's/C_DEFINES = //') |
1410 | + |
1411 | +xtradb55: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, \ |
1412 | + mysys/libmysys.a strings/libstrings.a zlib/libzlib.a dbug/libdbug.a) |
1413 | +# In CMake server builds it is important to build with exactly the same |
1414 | +# preprocessor flags as were used to build InnoDB |
1415 | +xtradb55: DEFS = $(shell grep C_DEFINES \ |
1416 | + $(MYSQL_ROOT_DIR)/storage/innobase/CMakeFiles/innobase.dir/flags.make | \ |
1417 | + sed -e 's/C_DEFINES = //') |
1418 | xtradb55: DEFS += -DXTRADB_BASED -DXTRADB55 |
1419 | xtradb55: TARGET := xtrabackup_55 |
1420 | -xtradb55: $(TARGET) |
1421 | - |
1422 | +xtradb55: $(TARGET) xbstream |
1423 | + |
1424 | +$(XTRABACKUPOBJS): %.o: %.c |
1425 | + $(CC) $(CFLAGS) $(INC) $(DEFS) -c $< -o $@ |
1426 | + |
1427 | +xbstream.o xbstream_read.o: %.o: %.c |
1428 | + $(CC) $(CFLAGS) $(INC) $(DEFS) -c $< -o $@ |
1429 | + |
1430 | +xbstream: $(XBSTREAMOBJS) $(MYSQLOBJS) local.o |
1431 | + $(CC) $(CFLAGS) $^ $(INC) $(MYSQLOBJS) $(LIBS) -o $@ |
1432 | |
1433 | xtrabackup.o: xtrabackup.c xb_regex.h |
1434 | - $(CC) $(CFLAGS) $(INC) $(DEFS) -c $*.c |
1435 | |
1436 | -$(TARGET): xtrabackup.o $(INNODBOBJS) $(MYSQLOBJS) |
1437 | - $(CC) $(CFLAGS) xtrabackup.o $(INNODBOBJS) $(MYSQLOBJS) $(LIBS) -o $(TARGET) |
1438 | +$(TARGET): $(XTRABACKUPOBJS) $(INNODBOBJS) $(MYSQLOBJS) $(LIBARCHIVE_A) |
1439 | + $(CC) $(CFLAGS) $(XTRABACKUPOBJS) $(INNODBOBJS) $(MYSQLOBJS) $(LIBS) \ |
1440 | + $(LIBARCHIVE_A) -o $(TARGET) |
1441 | |
1442 | clean: |
1443 | - rm -f *.o xtrabackup_* |
1444 | + rm -f $(XTRABACKUPOBJS) $(XBSTREAMOBJS) xtrabackup xtrabackup_* |
1445 | |
1446 | === added file 'src/common.h' |
1447 | --- src/common.h 1970-01-01 00:00:00 +0000 |
1448 | +++ src/common.h 2012-02-10 20:09:18 +0000 |
1449 | @@ -0,0 +1,73 @@ |
1450 | +/****************************************************** |
1451 | +Copyright (c) 2011 Percona Inc. |
1452 | + |
1453 | +Common declarations for XtraBackup. |
1454 | + |
1455 | +This program is free software; you can redistribute it and/or modify |
1456 | +it under the terms of the GNU General Public License as published by |
1457 | +the Free Software Foundation; version 2 of the License. |
1458 | + |
1459 | +This program is distributed in the hope that it will be useful, |
1460 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
1461 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1462 | +GNU General Public License for more details. |
1463 | + |
1464 | +You should have received a copy of the GNU General Public License |
1465 | +along with this program; if not, write to the Free Software |
1466 | +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
1467 | + |
1468 | +*******************************************************/ |
1469 | + |
1470 | +#ifndef XB_COMMON_H |
1471 | +#define XB_COMMON_H |
1472 | + |
1473 | +#include <my_global.h> |
1474 | +#include <mysql_version.h> |
1475 | +#include <fcntl.h> |
1476 | + |
1477 | +#define xb_a(expr) \ |
1478 | + do { \ |
1479 | + if (!(expr)) { \ |
1480 | + msg("Assertion \"%s\" failed at %s:%lu\n", \ |
1481 | + #expr, __FILE__, (unsigned long) __LINE__); \ |
1482 | + abort(); \ |
1483 | + } \ |
1484 | + } while (0); |
1485 | + |
1486 | +#ifdef XB_DEBUG |
1487 | +#define xb_ad(expr) xb_a(expr) |
1488 | +#else |
1489 | +#define xb_ad(expr) |
1490 | +#endif |
1491 | + |
1492 | +static inline int msg(const char *fmt, ...) ATTRIBUTE_FORMAT(printf, 1, 2); |
1493 | +static inline int msg(const char *fmt, ...) |
1494 | +{ |
1495 | + int result; |
1496 | + va_list args; |
1497 | + |
1498 | + va_start(args, fmt); |
1499 | + result = vfprintf(stderr, fmt, args); |
1500 | + va_end(args); |
1501 | + return result; |
1502 | +} |
1503 | + |
1504 | +#if MYSQL_VERSION_ID >= 50500 |
1505 | +# define MY_FREE(a) my_free(a) |
1506 | +#else |
1507 | +# define MY_FREE(a) my_free(a, MYF(0)) |
1508 | +#endif |
1509 | + |
1510 | +/* Use POSIX_FADV_NORMAL when available */ |
1511 | + |
1512 | +#ifdef POSIX_FADV_NORMAL |
1513 | +#define USE_POSIX_FADVISE |
1514 | +#endif |
1515 | + |
1516 | +typedef enum { |
1517 | + XB_STREAM_FMT_NONE, |
1518 | + XB_STREAM_FMT_TAR, |
1519 | + XB_STREAM_FMT_XBSTREAM |
1520 | +} xb_stream_fmt_t; |
1521 | + |
1522 | +#endif |
1523 | |
1524 | === added file 'src/compress.c' |
1525 | --- src/compress.c 1970-01-01 00:00:00 +0000 |
1526 | +++ src/compress.c 2012-02-10 20:09:18 +0000 |
1527 | @@ -0,0 +1,491 @@ |
1528 | +/****************************************************** |
1529 | +Copyright (c) 2011 Percona Inc. |
1530 | + |
1531 | +Compressing datasink implementation for XtraBackup. |
1532 | + |
1533 | +This program is free software; you can redistribute it and/or modify |
1534 | +it under the terms of the GNU General Public License as published by |
1535 | +the Free Software Foundation; version 2 of the License. |
1536 | + |
1537 | +This program is distributed in the hope that it will be useful, |
1538 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
1539 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1540 | +GNU General Public License for more details. |
1541 | + |
1542 | +You should have received a copy of the GNU General Public License |
1543 | +along with this program; if not, write to the Free Software |
1544 | +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
1545 | + |
1546 | +*******************************************************/ |
1547 | + |
1548 | + |
1549 | +#include <my_base.h> |
1550 | +#include <quicklz.h> |
1551 | +#include <univ.i> |
1552 | +#include <zlib.h> |
1553 | +#include "common.h" |
1554 | +#include "datasink.h" |
1555 | +#include "stream.h" |
1556 | +#include "local.h" |
1557 | + |
1558 | +#define COMPRESS_CHUNK_SIZE (64 * 1024UL) |
1559 | +#define MY_QLZ_COMPRESS_OVERHEAD 400 |
1560 | + |
1561 | +typedef struct { |
1562 | + pthread_t id; |
1563 | + uint num; |
1564 | + pthread_mutex_t ctrl_mutex; |
1565 | + pthread_cond_t ctrl_cond; |
1566 | + pthread_mutex_t data_mutex; |
1567 | + pthread_cond_t data_cond; |
1568 | + my_bool started; |
1569 | + my_bool data_avail; |
1570 | + my_bool cancelled; |
1571 | + const char *from; |
1572 | + size_t from_len; |
1573 | + char *to; |
1574 | + size_t to_len; |
1575 | + qlz_state_compress state; |
1576 | + ulong adler; |
1577 | +} comp_thread_ctxt_t; |
1578 | + |
1579 | +typedef struct { |
1580 | + ds_ctxt_t *dest_ctxt; |
1581 | + comp_thread_ctxt_t *threads; |
1582 | + uint nthreads; |
1583 | +} ds_compress_ctxt_t; |
1584 | + |
1585 | +typedef struct { |
1586 | + datasink_t *dest_ds; |
1587 | + ds_file_t *dest_file; |
1588 | + ds_compress_ctxt_t *comp_ctxt; |
1589 | + size_t bytes_processed; |
1590 | +} ds_compress_file_t; |
1591 | + |
1592 | +extern ibool xtrabackup_stream; |
1593 | +extern uint xtrabackup_parallel; |
1594 | +extern ibool xtrabackup_compress_threads; |
1595 | + |
1596 | +static ds_ctxt_t *compress_init(const char *root); |
1597 | +static ds_file_t *compress_open(ds_ctxt_t *ctxt, const char *path, |
1598 | + MY_STAT *mystat); |
1599 | +static int compress_write(ds_file_t *file, const void *buf, size_t len); |
1600 | +static int compress_close(ds_file_t *file); |
1601 | +static void compress_deinit(ds_ctxt_t *ctxt); |
1602 | + |
1603 | +datasink_t datasink_compress = { |
1604 | + &compress_init, |
1605 | + &compress_open, |
1606 | + &compress_write, |
1607 | + &compress_close, |
1608 | + &compress_deinit |
1609 | +}; |
1610 | + |
1611 | +static inline int write_uint32_le(datasink_t *sink, ds_file_t *file, |
1612 | + ulong n); |
1613 | +static inline int write_uint64_le(datasink_t *sink, ds_file_t *file, |
1614 | + ulonglong n); |
1615 | + |
1616 | +static comp_thread_ctxt_t *create_worker_threads(uint n); |
1617 | +static void destroy_worker_threads(comp_thread_ctxt_t *threads, uint n); |
1618 | +static void *compress_worker_thread_func(void *arg); |
1619 | + |
1620 | +static |
1621 | +ds_ctxt_t * |
1622 | +compress_init(const char *root) |
1623 | +{ |
1624 | + ds_ctxt_t *ctxt; |
1625 | + ds_compress_ctxt_t *compress_ctxt; |
1626 | + datasink_t *dest_ds; |
1627 | + ds_ctxt_t *dest_ctxt; |
1628 | + comp_thread_ctxt_t *threads; |
1629 | + |
1630 | + /* Decide whether the compressed data will be stored in local files or |
1631 | + streamed to an archive */ |
1632 | + dest_ds = xtrabackup_stream ? &datasink_stream : &datasink_local; |
1633 | + |
1634 | + dest_ctxt = dest_ds->init(root); |
1635 | + if (dest_ctxt == NULL) { |
1636 | + msg("compress: failed to initialize the target datasink.\n"); |
1637 | + return NULL; |
1638 | + } |
1639 | + |
1640 | + /* Create and initialize the worker threads */ |
1641 | + threads = create_worker_threads(xtrabackup_compress_threads); |
1642 | + if (threads == NULL) { |
1643 | + msg("compress: failed to create worker threads.\n"); |
1644 | + dest_ds->deinit(dest_ctxt); |
1645 | + return NULL; |
1646 | + } |
1647 | + |
1648 | + ctxt = (ds_ctxt_t *) my_malloc(sizeof(ds_ctxt_t) + |
1649 | + sizeof(ds_compress_ctxt_t), |
1650 | + MYF(MY_FAE)); |
1651 | + |
1652 | + compress_ctxt = (ds_compress_ctxt_t *) (ctxt + 1); |
1653 | + compress_ctxt->dest_ctxt = dest_ctxt; |
1654 | + compress_ctxt->threads = threads; |
1655 | + compress_ctxt->nthreads = xtrabackup_compress_threads; |
1656 | + |
1657 | + ctxt->datasink = &datasink_compress; |
1658 | + ctxt->ptr = compress_ctxt; |
1659 | + |
1660 | + return ctxt; |
1661 | +} |
1662 | + |
1663 | +static |
1664 | +ds_file_t * |
1665 | +compress_open(ds_ctxt_t *ctxt, const char *path, MY_STAT *mystat) |
1666 | +{ |
1667 | + ds_compress_ctxt_t *comp_ctxt; |
1668 | + datasink_t *dest_ds; |
1669 | + ds_ctxt_t *dest_ctxt; |
1670 | + ds_file_t *dest_file; |
1671 | + char new_name[FN_REFLEN]; |
1672 | + size_t name_len; |
1673 | + ds_file_t *file; |
1674 | + ds_compress_file_t *comp_file; |
1675 | + |
1676 | + comp_ctxt = (ds_compress_ctxt_t *) ctxt->ptr; |
1677 | + dest_ctxt = comp_ctxt->dest_ctxt; |
1678 | + dest_ds = dest_ctxt->datasink; |
1679 | + |
1680 | + /* Append the .qp extension to the filename */ |
1681 | + fn_format(new_name, path, "", ".qp", MYF(MY_APPEND_EXT)); |
1682 | + |
1683 | + dest_file = dest_ds->open(dest_ctxt, new_name, mystat); |
1684 | + if (dest_file == NULL) { |
1685 | + return NULL; |
1686 | + } |
1687 | + |
1688 | + /* Write the qpress archive header */ |
1689 | + if (dest_ds->write(dest_file, "qpress10", 8) || |
1690 | + write_uint64_le(dest_ds, dest_file, COMPRESS_CHUNK_SIZE)) { |
1691 | + goto err; |
1692 | + } |
1693 | + |
1694 | + /* We are going to create a one-file "flat" (i.e. with no |
1695 | + subdirectories) archive. So strip the directory part from the path and |
1696 | + remove the '.qp' suffix. */ |
1697 | + fn_format(new_name, path, "", "", MYF(MY_REPLACE_DIR)); |
1698 | + |
1699 | + /* Write the qpress file header */ |
1700 | + name_len = strlen(new_name); |
1701 | + if (dest_ds->write(dest_file, "F", 1) || |
1702 | + write_uint32_le(dest_ds, dest_file, name_len) || |
1703 | + /* we want to write the terminating \0 as well */ |
1704 | + dest_ds->write(dest_file, new_name, name_len + 1)) { |
1705 | + goto err; |
1706 | + } |
1707 | + |
1708 | + file = (ds_file_t *) my_malloc(sizeof(ds_file_t) + |
1709 | + sizeof(ds_compress_file_t), |
1710 | + MYF(MY_FAE)); |
1711 | + comp_file = (ds_compress_file_t *) (file + 1); |
1712 | + comp_file->dest_file = dest_file; |
1713 | + comp_file->dest_ds = dest_ds; |
1714 | + comp_file->comp_ctxt = comp_ctxt; |
1715 | + comp_file->bytes_processed = 0; |
1716 | + |
1717 | + file->ptr = comp_file; |
1718 | + file->path = dest_file->path; |
1719 | + |
1720 | + return file; |
1721 | + |
1722 | +err: |
1723 | + dest_ds->close(dest_file); |
1724 | + return NULL; |
1725 | +} |
1726 | + |
1727 | +static |
1728 | +int |
1729 | +compress_write(ds_file_t *file, const void *buf, size_t len) |
1730 | +{ |
1731 | + ds_compress_file_t *comp_file; |
1732 | + ds_compress_ctxt_t *comp_ctxt; |
1733 | + comp_thread_ctxt_t *threads; |
1734 | + comp_thread_ctxt_t *thd; |
1735 | + uint nthreads; |
1736 | + uint i; |
1737 | + const char *ptr; |
1738 | + datasink_t *dest_ds; |
1739 | + ds_file_t *dest_file; |
1740 | + |
1741 | + comp_file = (ds_compress_file_t *) file->ptr; |
1742 | + comp_ctxt = comp_file->comp_ctxt; |
1743 | + dest_ds = comp_file->dest_ds; |
1744 | + dest_file = comp_file->dest_file; |
1745 | + |
1746 | + threads = comp_ctxt->threads; |
1747 | + nthreads = comp_ctxt->nthreads; |
1748 | + |
1749 | + ptr = (const char *) buf; |
1750 | + while (len > 0) { |
1751 | + uint max_thread; |
1752 | + |
1753 | + /* Send data to worker threads for compression */ |
1754 | + for (i = 0; i < nthreads; i++) { |
1755 | + size_t chunk_len; |
1756 | + |
1757 | + thd = threads + i; |
1758 | + |
1759 | + pthread_mutex_lock(&thd->ctrl_mutex); |
1760 | + |
1761 | + chunk_len = (len > COMPRESS_CHUNK_SIZE) ? |
1762 | + COMPRESS_CHUNK_SIZE : len; |
1763 | + thd->from = ptr; |
1764 | + thd->from_len = chunk_len; |
1765 | + |
1766 | + pthread_mutex_lock(&thd->data_mutex); |
1767 | + thd->data_avail = TRUE; |
1768 | + pthread_cond_signal(&thd->data_cond); |
1769 | + pthread_mutex_unlock(&thd->data_mutex); |
1770 | + |
1771 | + len -= chunk_len; |
1772 | + if (len == 0) { |
1773 | + break; |
1774 | + } |
1775 | + ptr += chunk_len; |
1776 | + } |
1777 | + |
1778 | + max_thread = (i < nthreads) ? i : nthreads - 1; |
1779 | + |
1780 | + /* Reap and stream the compressed data */ |
1781 | + for (i = 0; i <= max_thread; i++) { |
1782 | + thd = threads + i; |
1783 | + |
1784 | + pthread_mutex_lock(&thd->data_mutex); |
1785 | + while (thd->data_avail == TRUE) { |
1786 | + pthread_cond_wait(&thd->data_cond, |
1787 | + &thd->data_mutex); |
1788 | + } |
1789 | + |
1790 | + ut_a(threads[i].to_len > 0); |
1791 | + |
1792 | + if (dest_ds->write(dest_file, "NEWBNEWB", 8) || |
1793 | + write_uint64_le(dest_ds, dest_file, |
1794 | + comp_file->bytes_processed)) { |
1795 | + msg("compress: write to the destination stream " |
1796 | + "failed.\n"); |
1797 | + return 1; |
1798 | + } |
1799 | + |
1800 | + comp_file->bytes_processed += threads[i].from_len; |
1801 | + |
1802 | + if (write_uint32_le(dest_ds, dest_file, |
1803 | + threads[i].adler) || |
1804 | + dest_ds->write(dest_file, threads[i].to, |
1805 | + threads[i].to_len)) { |
1806 | + msg("compress: write to the destination stream " |
1807 | + "failed.\n"); |
1808 | + return 1; |
1809 | + } |
1810 | + |
1811 | + pthread_mutex_unlock(&threads[i].data_mutex); |
1812 | + pthread_mutex_unlock(&threads[i].ctrl_mutex); |
1813 | + } |
1814 | + } |
1815 | + |
1816 | + return 0; |
1817 | +} |
1818 | + |
1819 | +static |
1820 | +int |
1821 | +compress_close(ds_file_t *file) |
1822 | +{ |
1823 | + ds_compress_file_t *comp_file; |
1824 | + datasink_t *dest_ds; |
1825 | + ds_file_t *dest_file; |
1826 | + |
1827 | + comp_file = (ds_compress_file_t *) file->ptr; |
1828 | + dest_ds = comp_file->dest_ds; |
1829 | + dest_file = comp_file->dest_file; |
1830 | + |
1831 | + /* Write the qpress file trailer */ |
1832 | + dest_ds->write(dest_file, "ENDSENDS", 8); |
1833 | + |
1834 | + /* Supposedly the number of written bytes should be written as a |
1835 | + "recovery information" in the file trailer, but in reality qpress |
1836 | + always writes 8 zeros here. Let's do the same */ |
1837 | + |
1838 | + write_uint64_le(dest_ds, dest_file, 0); |
1839 | + |
1840 | + dest_ds->close(dest_file); |
1841 | + |
1842 | + MY_FREE(file); |
1843 | + |
1844 | + return 0; |
1845 | +} |
1846 | + |
1847 | +static |
1848 | +void |
1849 | +compress_deinit(ds_ctxt_t *ctxt) |
1850 | +{ |
1851 | + ds_compress_ctxt_t *comp_ctxt; |
1852 | + ds_ctxt_t *dest_ctxt; |
1853 | + datasink_t *dest_ds; |
1854 | + |
1855 | + comp_ctxt = (ds_compress_ctxt_t *) ctxt->ptr;; |
1856 | + |
1857 | + destroy_worker_threads(comp_ctxt->threads, comp_ctxt->nthreads); |
1858 | + |
1859 | + dest_ctxt = comp_ctxt->dest_ctxt; |
1860 | + dest_ds = dest_ctxt->datasink; |
1861 | + |
1862 | + dest_ds->deinit(dest_ctxt); |
1863 | + |
1864 | + MY_FREE(ctxt); |
1865 | +} |
1866 | + |
1867 | +static inline |
1868 | +int |
1869 | +write_uint32_le(datasink_t *sink, ds_file_t *file, ulong n) |
1870 | +{ |
1871 | + char tmp[4]; |
1872 | + |
1873 | + int4store(tmp, n); |
1874 | + return sink->write(file, tmp, sizeof(tmp)); |
1875 | +} |
1876 | + |
1877 | +static inline |
1878 | +int |
1879 | +write_uint64_le(datasink_t *sink, ds_file_t *file, ulonglong n) |
1880 | +{ |
1881 | + char tmp[8]; |
1882 | + |
1883 | + int8store(tmp, n); |
1884 | + return sink->write(file, tmp, sizeof(tmp)); |
1885 | +} |
1886 | + |
1887 | +static |
1888 | +comp_thread_ctxt_t * |
1889 | +create_worker_threads(uint n) |
1890 | +{ |
1891 | + comp_thread_ctxt_t *threads; |
1892 | + uint i; |
1893 | + |
1894 | + threads = (comp_thread_ctxt_t *) |
1895 | + my_malloc(sizeof(comp_thread_ctxt_t) * n, MYF(MY_FAE)); |
1896 | + |
1897 | + for (i = 0; i < n; i++) { |
1898 | + comp_thread_ctxt_t *thd = threads + i; |
1899 | + |
1900 | + thd->num = i + 1; |
1901 | + thd->started = FALSE; |
1902 | + thd->cancelled = FALSE; |
1903 | + thd->data_avail = FALSE; |
1904 | + |
1905 | + thd->to = (char *) my_malloc(COMPRESS_CHUNK_SIZE + |
1906 | + MY_QLZ_COMPRESS_OVERHEAD, |
1907 | + MYF(MY_FAE)); |
1908 | + |
1909 | + /* Initialize the control mutex and condition var */ |
1910 | + if (pthread_mutex_init(&thd->ctrl_mutex, NULL) || |
1911 | + pthread_cond_init(&thd->ctrl_cond, NULL)) { |
1912 | + goto err; |
1913 | + } |
1914 | + |
1915 | + /* Initialize and data mutex and condition var */ |
1916 | + if (pthread_mutex_init(&thd->data_mutex, NULL) || |
1917 | + pthread_cond_init(&thd->data_cond, NULL)) { |
1918 | + goto err; |
1919 | + } |
1920 | + |
1921 | + pthread_mutex_lock(&thd->ctrl_mutex); |
1922 | + |
1923 | + if (pthread_create(&thd->id, NULL, compress_worker_thread_func, |
1924 | + thd)) { |
1925 | + msg("compress: pthread_create() failed: " |
1926 | + "errno = %d\n", errno); |
1927 | + goto err; |
1928 | + } |
1929 | + } |
1930 | + |
1931 | + /* Wait for the threads to start */ |
1932 | + for (i = 0; i < n; i++) { |
1933 | + comp_thread_ctxt_t *thd = threads + i; |
1934 | + |
1935 | + while (thd->started == FALSE) |
1936 | + pthread_cond_wait(&thd->ctrl_cond, &thd->ctrl_mutex); |
1937 | + pthread_mutex_unlock(&thd->ctrl_mutex); |
1938 | + } |
1939 | + |
1940 | + return threads; |
1941 | + |
1942 | +err: |
1943 | + return NULL; |
1944 | +} |
1945 | + |
1946 | +static |
1947 | +void |
1948 | +destroy_worker_threads(comp_thread_ctxt_t *threads, uint n) |
1949 | +{ |
1950 | + uint i; |
1951 | + |
1952 | + for (i = 0; i < n; i++) { |
1953 | + comp_thread_ctxt_t *thd = threads + i; |
1954 | + |
1955 | + pthread_mutex_lock(&thd->data_mutex); |
1956 | + threads[i].cancelled = TRUE; |
1957 | + pthread_cond_signal(&thd->data_cond); |
1958 | + pthread_mutex_unlock(&thd->data_mutex); |
1959 | + |
1960 | + pthread_join(thd->id, NULL); |
1961 | + |
1962 | + pthread_cond_destroy(&thd->data_cond); |
1963 | + pthread_mutex_destroy(&thd->data_mutex); |
1964 | + pthread_cond_destroy(&thd->ctrl_cond); |
1965 | + pthread_mutex_destroy(&thd->ctrl_mutex); |
1966 | + |
1967 | + MY_FREE(thd->to); |
1968 | + } |
1969 | + |
1970 | + MY_FREE(threads); |
1971 | +} |
1972 | + |
1973 | +static |
1974 | +void * |
1975 | +compress_worker_thread_func(void *arg) |
1976 | +{ |
1977 | + comp_thread_ctxt_t *thd = (comp_thread_ctxt_t *) arg; |
1978 | + |
1979 | + pthread_mutex_lock(&thd->ctrl_mutex); |
1980 | + |
1981 | + pthread_mutex_lock(&thd->data_mutex); |
1982 | + |
1983 | + thd->started = TRUE; |
1984 | + pthread_cond_signal(&thd->ctrl_cond); |
1985 | + |
1986 | + pthread_mutex_unlock(&thd->ctrl_mutex); |
1987 | + |
1988 | + while (1) { |
1989 | + thd->data_avail = FALSE; |
1990 | + pthread_cond_signal(&thd->data_cond); |
1991 | + |
1992 | + while (!thd->data_avail && !thd->cancelled) { |
1993 | + pthread_cond_wait(&thd->data_cond, &thd->data_mutex); |
1994 | + } |
1995 | + |
1996 | + if (thd->cancelled) |
1997 | + break; |
1998 | + |
1999 | + thd->to_len = qlz_compress(thd->from, thd->to, thd->from_len, |
2000 | + &thd->state); |
2001 | + |
2002 | + /* qpress uses 0x00010000 as the initial value, but its own |
2003 | + Adler-32 implementation treats the value differently: |
2004 | + 1. higher order bits are the sum of all bytes in the sequence |
2005 | + 2. lower order bits are the sum of resulting values at every |
2006 | + step. |
2007 | + So it's the other way around as compared to zlib's adler32(). |
2008 | + That's why 0x00000001 is being passed here to be compatible |
2009 | + with qpress implementation. */ |
2010 | + |
2011 | + thd->adler = adler32(0x00000001, (uchar *) thd->to, |
2012 | + thd->to_len); |
2013 | + } |
2014 | + |
2015 | + pthread_mutex_unlock(&thd->data_mutex); |
2016 | + |
2017 | + return NULL; |
2018 | +} |
2019 | |
2020 | === added file 'src/compress.h' |
2021 | --- src/compress.h 1970-01-01 00:00:00 +0000 |
2022 | +++ src/compress.h 2012-02-10 20:09:18 +0000 |
2023 | @@ -0,0 +1,28 @@ |
2024 | +/****************************************************** |
2025 | +Copyright (c) 2011 Percona Inc. |
2026 | + |
2027 | +Compression interface for XtraBackup. |
2028 | + |
2029 | +This program is free software; you can redistribute it and/or modify |
2030 | +it under the terms of the GNU General Public License as published by |
2031 | +the Free Software Foundation; version 2 of the License. |
2032 | + |
2033 | +This program is distributed in the hope that it will be useful, |
2034 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
2035 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2036 | +GNU General Public License for more details. |
2037 | + |
2038 | +You should have received a copy of the GNU General Public License |
2039 | +along with this program; if not, write to the Free Software |
2040 | +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
2041 | + |
2042 | +*******************************************************/ |
2043 | + |
2044 | +#ifndef XB_COMPRESS_H |
2045 | +#define XB_COMPRESS_H |
2046 | + |
2047 | +#include "datasink.h" |
2048 | + |
2049 | +extern datasink_t datasink_compress; |
2050 | + |
2051 | +#endif |
2052 | |
2053 | === added file 'src/datasink.h' |
2054 | --- src/datasink.h 1970-01-01 00:00:00 +0000 |
2055 | +++ src/datasink.h 2012-02-10 20:09:18 +0000 |
2056 | @@ -0,0 +1,48 @@ |
2057 | +/****************************************************** |
2058 | +Copyright (c) 2011 Percona Inc. |
2059 | + |
2060 | +Data sink interface. |
2061 | + |
2062 | +This program is free software; you can redistribute it and/or modify |
2063 | +it under the terms of the GNU General Public License as published by |
2064 | +the Free Software Foundation; version 2 of the License. |
2065 | + |
2066 | +This program is distributed in the hope that it will be useful, |
2067 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
2068 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2069 | +GNU General Public License for more details. |
2070 | + |
2071 | +You should have received a copy of the GNU General Public License |
2072 | +along with this program; if not, write to the Free Software |
2073 | +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
2074 | + |
2075 | +*******************************************************/ |
2076 | + |
2077 | +#ifndef XB_DATASINK_H |
2078 | +#define XB_DATASINK_H |
2079 | + |
2080 | +#include <my_global.h> |
2081 | +#include <my_dir.h> |
2082 | + |
2083 | +struct datasink_struct; |
2084 | + |
2085 | +typedef struct { |
2086 | + struct datasink_struct *datasink; |
2087 | + char *root; |
2088 | + void *ptr; |
2089 | +} ds_ctxt_t; |
2090 | + |
2091 | +typedef struct { |
2092 | + void *ptr; |
2093 | + char *path; |
2094 | +} ds_file_t; |
2095 | + |
2096 | +typedef struct datasink_struct { |
2097 | + ds_ctxt_t *(*init)(const char *root); |
2098 | + ds_file_t *(*open)(ds_ctxt_t *ctxt, const char *path, MY_STAT *stat); |
2099 | + int (*write)(ds_file_t *file, const void *buf, size_t len); |
2100 | + int (*close)(ds_file_t *file); |
2101 | + void (*deinit)(ds_ctxt_t *ctxt); |
2102 | +} datasink_t; |
2103 | + |
2104 | +#endif /* XB_DATASINK_H */ |
2105 | |
2106 | === added directory 'src/libarchive' |
2107 | === added file 'src/libarchive/CMakeLists.txt' |
2108 | --- src/libarchive/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
2109 | +++ src/libarchive/CMakeLists.txt 2012-02-10 20:09:18 +0000 |
2110 | @@ -0,0 +1,855 @@ |
2111 | +# |
2112 | +# |
2113 | +PROJECT(libarchive C) |
2114 | +# |
2115 | +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) |
2116 | +SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") |
2117 | +if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) |
2118 | + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) |
2119 | +endif() |
2120 | + |
2121 | +# |
2122 | +# Version - read from 'version' file. |
2123 | +# |
2124 | +FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/build/version _version) |
2125 | +STRING(REGEX REPLACE |
2126 | + "^([0-9])[0-9][0-9][0-9][0-9][0-9][0-9][a-z]?$" "\\1" _major ${_version}) |
2127 | +STRING(REGEX REPLACE |
2128 | + "^[0-9]([0-9][0-9][0-9])[0-9][0-9][0-9][a-z]?$" "\\1" _minor ${_version}) |
2129 | +STRING(REGEX REPLACE |
2130 | + "^[0-9][0-9][0-9][0-9]([0-9][0-9][0-9])[a-z]?$" "\\1" _revision ${_version}) |
2131 | +STRING(REGEX REPLACE |
2132 | + "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]([a-z]?)$" "\\1" _quality ${_version}) |
2133 | +SET(_version_number ${_major}${_minor}${_revision}) |
2134 | +STRING(REGEX REPLACE "[0]*([^0][0-9]*)$" "\\1" _minor ${_minor}) |
2135 | +STRING(REGEX REPLACE "[0]*([^0][0-9]*)$" "\\1" _revision ${_revision}) |
2136 | +# |
2137 | +SET(VERSION "${_major}.${_minor}.${_revision}${_quality}") |
2138 | +SET(BSDCPIO_VERSION_STRING "${VERSION}") |
2139 | +SET(BSDTAR_VERSION_STRING "${VERSION}") |
2140 | +SET(LIBARCHIVE_VERSION_NUMBER "${_version_number}") |
2141 | +SET(LIBARCHIVE_VERSION_STRING "${VERSION}") |
2142 | +# Shared library number |
2143 | +SET(SOVERSION 8) |
2144 | + |
2145 | +# Enable CTest/CDash support |
2146 | +include(CTest) |
2147 | + |
2148 | +# Provide ADD_TEST_28 macro to approximate CMake 2.8 ADD_TEST(NAME). |
2149 | +# TODO: Require CMake 2.8 and drop this workaround (perhaps late 2010). |
2150 | +INCLUDE(AddTest28) |
2151 | + |
2152 | +OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON) |
2153 | +OPTION(ENABLE_TAR "Enable tar building" ON) |
2154 | +OPTION(ENABLE_TAR_SHARED "Enable dynamic build of tar" OFF) |
2155 | +OPTION(ENABLE_CPIO "Enable cpio building" ON) |
2156 | +OPTION(ENABLE_CPIO_SHARED "Enable dynamic build of cpio" OFF) |
2157 | +OPTION(ENABLE_XATTR "Enable extended attribute support" ON) |
2158 | +OPTION(ENABLE_ACL "Enable ACL support" ON) |
2159 | +OPTION(ENABLE_TEST "Enable unit and regression tests" ON) |
2160 | + |
2161 | +IF(ENABLE_TEST) |
2162 | + ENABLE_TESTING() |
2163 | +ENDIF(ENABLE_TEST) |
2164 | +IF(WIN32 AND NOT CYGWIN) |
2165 | + # Currently, dynamic build only. |
2166 | + SET(ENABLE_TAR_SHARED ON) |
2167 | + SET(ENABLE_CPIO_SHARED ON) |
2168 | +ENDIF(WIN32 AND NOT CYGWIN) |
2169 | + |
2170 | +IF(WIN32) |
2171 | + SET(_WIN32_WINNT 0x0500 CACHE INTERNAL "Setting _WIN32_WINNT to 0x0500 for Windows 2000 APIs") |
2172 | + SET(WINVER 0x0500 CACHE INTERNAL "Setting WINVER to 0x0500 for Windows 2000 APIs") |
2173 | +ENDIF(WIN32) |
2174 | + |
2175 | +# |
2176 | +INCLUDE(CheckCSourceRuns) |
2177 | +INCLUDE(CheckFileOffsetBits) |
2178 | +INCLUDE(CheckFuncs) |
2179 | +INCLUDE(CheckHeaderDirent) |
2180 | +INCLUDE(CheckIncludeFile) |
2181 | +INCLUDE(CheckIncludeFiles) |
2182 | +INCLUDE(CheckLibraryExists) |
2183 | +INCLUDE(CheckStructMember) |
2184 | +INCLUDE(CheckSymbolExists) |
2185 | +INCLUDE(CheckTypeExists) |
2186 | +INCLUDE(CheckTypeSize) |
2187 | + |
2188 | +# |
2189 | +# Generate list.h |
2190 | +# |
2191 | +MACRO (GENERATE_LIST_H _listfile _cmlist __list_sources) |
2192 | + SET(_argv ${ARGV}) |
2193 | + # Remove _listfile and _cmlist from _argv |
2194 | + LIST(REMOVE_AT _argv 0 1) |
2195 | + IF (NOT EXISTS "${_listfile}" OR |
2196 | + ${_cmlist} IS_NEWER_THAN "${_listfile}") |
2197 | + |
2198 | + MESSAGE(STATUS "Generating ${_listfile}") |
2199 | + FILE(WRITE ${_listfile} "") |
2200 | + FOREACH (testfile ${_argv}) |
2201 | + IF (testfile MATCHES "^test_[^/]+[.]c$") |
2202 | + FILE(STRINGS ${testfile} testvar REGEX "^DEFINE_TEST") |
2203 | + FOREACH (deftest ${testvar}) |
2204 | + FILE(APPEND ${_listfile} "${deftest}\n") |
2205 | + ENDFOREACH (deftest) |
2206 | + ENDIF (testfile MATCHES "^test_[^/]+[.]c$") |
2207 | + ENDFOREACH (testfile) |
2208 | + |
2209 | + ENDIF (NOT EXISTS "${_listfile}" OR |
2210 | + ${_cmlist} IS_NEWER_THAN "${_listfile}") |
2211 | +ENDMACRO (GENERATE_LIST_H) |
2212 | +# |
2213 | +# Generate installation rules for man pages. |
2214 | +# |
2215 | +MACRO (INSTALL_MAN __mans) |
2216 | + FOREACH (_man ${ARGV}) |
2217 | + STRING(REGEX REPLACE "^.+[.]([1-9])" "\\1" _mansect ${_man}) |
2218 | + INSTALL(FILES ${_man} DESTINATION "share/man/man${_mansect}") |
2219 | + ENDFOREACH (_man) |
2220 | +ENDMACRO (INSTALL_MAN __mans) |
2221 | + |
2222 | +# |
2223 | +# Check compress/decompress libraries |
2224 | +# |
2225 | +IF(WIN32 AND NOT CMAKE_CL_64 AND NOT CYGWIN) |
2226 | + # GnuWin32 is only for Win32, not Win64. |
2227 | + SET(__GNUWIN32PATH "C:/Program Files/GnuWin32") |
2228 | +ENDIF(WIN32 AND NOT CMAKE_CL_64 AND NOT CYGWIN) |
2229 | +IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") |
2230 | + # You have to add a path availabel DLL file into PATH environment variable. |
2231 | + # Maybe DLL path is "C:/Program Files/GnuWin32/bin". |
2232 | + # The zlib and the bzip2 Setup program have installed programs and DLLs into |
2233 | + # "C:/Program Files/GnuWin32" by default. |
2234 | + # This is convenience setting for Windows. |
2235 | + SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) |
2236 | + # |
2237 | + # If you didn't use Setup program or installed into nonstandard path, |
2238 | + # cmake cannot find out your zlib or bzip2 libraries and include files, |
2239 | + # you should execute cmake with -DCMAKE_PREFIX_PATH option. |
2240 | + # e.g. |
2241 | + # cmake -DCMAKE_PREFIX_PATH=<your-GnuWin32-path> <path-to-source> |
2242 | + # |
2243 | + # If compiling error occured in zconf.h, You may need patch to zconf.h. |
2244 | + #--- zconf.h.orig 2005-07-21 00:40:26.000000000 |
2245 | + #+++ zconf.h 2009-01-19 11:39:10.093750000 |
2246 | + #@@ -286,7 +286,7 @@ |
2247 | + # |
2248 | + # #if 1 /* HAVE_UNISTD_H -- this line is updated by ./configure */ |
2249 | + # # include <sys/types.h> /* for off_t */ |
2250 | + #-# include <unistd.h> /* for SEEK_* and off_t */ |
2251 | + #+# include <stdio.h> /* for SEEK_* and off_t */ |
2252 | + # # ifdef VMS |
2253 | + # # include <unixio.h> /* for off_t */ |
2254 | + # # endif |
2255 | +ENDIF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") |
2256 | + |
2257 | +SET(ADDITIONAL_LIBS "") |
2258 | +# |
2259 | +# Find ZLIB |
2260 | +# |
2261 | +FIND_PACKAGE(ZLIB) |
2262 | +IF(ZLIB_FOUND) |
2263 | + SET(HAVE_LIBZ 1) |
2264 | + SET(HAVE_ZLIB_H 1) |
2265 | + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) |
2266 | + LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) |
2267 | +ENDIF(ZLIB_FOUND) |
2268 | +MARK_AS_ADVANCED(CLEAR ZLIB_INCLUDE_DIR) |
2269 | +MARK_AS_ADVANCED(CLEAR ZLIB_LIBRARY) |
2270 | +# |
2271 | +# Find BZip2 |
2272 | +# |
2273 | +FIND_PACKAGE(BZip2) |
2274 | +IF(BZIP2_FOUND) |
2275 | + SET(HAVE_LIBBZ2 1) |
2276 | + SET(HAVE_BZLIB_H 1) |
2277 | + INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR}) |
2278 | + LIST(APPEND ADDITIONAL_LIBS ${BZIP2_LIBRARIES}) |
2279 | +ENDIF(BZIP2_FOUND) |
2280 | +MARK_AS_ADVANCED(CLEAR BZIP2_INCLUDE_DIR) |
2281 | +MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARY) |
2282 | +# |
2283 | +# Find LZMA |
2284 | +# |
2285 | +FIND_PACKAGE(LZMA) |
2286 | +IF(LZMA_FOUND) |
2287 | + SET(HAVE_LIBLZMA 1) |
2288 | + SET(HAVE_LZMA_H 1) |
2289 | + INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIR}) |
2290 | + LIST(APPEND ADDITIONAL_LIBS ${LZMA_LIBRARIES}) |
2291 | + MARK_AS_ADVANCED(CLEAR LZMA_INCLUDE_DIR) |
2292 | + MARK_AS_ADVANCED(CLEAR LZMA_LIBRARY) |
2293 | +ELSEIF(LZMADEC_FOUND) |
2294 | + SET(HAVE_LIBLZMADEC 1) |
2295 | + SET(HAVE_LZMADEC_H 1) |
2296 | + INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR}) |
2297 | + LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES}) |
2298 | + MARK_AS_ADVANCED(CLEAR LZMADEC_INCLUDE_DIR) |
2299 | + MARK_AS_ADVANCED(CLEAR LZMADEC_LIBRARY) |
2300 | +ELSE(LZMA_FOUND) |
2301 | + MARK_AS_ADVANCED(CLEAR LZMA_INCLUDE_DIR) |
2302 | + MARK_AS_ADVANCED(CLEAR LZMA_LIBRARY) |
2303 | +ENDIF(LZMA_FOUND) |
2304 | + |
2305 | +# |
2306 | +# Check headers |
2307 | +# |
2308 | +CHECK_HEADER_DIRENT() |
2309 | + |
2310 | +SET(INCLUDES "") |
2311 | +MACRO (LA_CHECK_INCLUDE_FILE header var) |
2312 | + CHECK_INCLUDE_FILES("${INCLUDES};${header}" ${var}) |
2313 | + IF (${var}) |
2314 | + SET(INCLUDES ${INCLUDES} ${header}) |
2315 | + ENDIF (${var}) |
2316 | +ENDMACRO (LA_CHECK_INCLUDE_FILE) |
2317 | + |
2318 | +# Some FreeBSD headers assume sys/types.h was already included. |
2319 | +LA_CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) |
2320 | + |
2321 | +# Alphabetize the rest unless there's a compelling reason |
2322 | +LA_CHECK_INCLUDE_FILE("acl/libacl.h" HAVE_ACL_LIBACL_H) |
2323 | +LA_CHECK_INCLUDE_FILE("ctype.h" HAVE_CTYPE_H) |
2324 | +LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H) |
2325 | +LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) |
2326 | +LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H) |
2327 | +LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H) |
2328 | +LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H) |
2329 | +LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H) |
2330 | +LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) |
2331 | +LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) |
2332 | +LA_CHECK_INCLUDE_FILE("langinfo.h" HAVE_LANGINFO_H) |
2333 | +LA_CHECK_INCLUDE_FILE("limits.h" HAVE_LIMITS_H) |
2334 | +LA_CHECK_INCLUDE_FILE("linux/fs.h" HAVE_LINUX_FS_H) |
2335 | +LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H) |
2336 | +LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) |
2337 | +LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H) |
2338 | +LA_CHECK_INCLUDE_FILE("poll.h" HAVE_POLL_H) |
2339 | +LA_CHECK_INCLUDE_FILE("process.h" HAVE_PROCESS_H) |
2340 | +LA_CHECK_INCLUDE_FILE("pwd.h" HAVE_PWD_H) |
2341 | +LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H) |
2342 | +LA_CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H) |
2343 | +LA_CHECK_INCLUDE_FILE("stdarg.h" HAVE_STDARG_H) |
2344 | +LA_CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) |
2345 | +LA_CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) |
2346 | +LA_CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) |
2347 | +LA_CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) |
2348 | +LA_CHECK_INCLUDE_FILE("sys/acl.h" HAVE_SYS_ACL_H) |
2349 | +LA_CHECK_INCLUDE_FILE("sys/cdefs.h" HAVE_SYS_CDEFS_H) |
2350 | +LA_CHECK_INCLUDE_FILE("sys/ioctl.h" HAVE_SYS_IOCTL_H) |
2351 | +LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H) |
2352 | +LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H) |
2353 | +LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H) |
2354 | +LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H) |
2355 | +LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) |
2356 | +LA_CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H) |
2357 | +LA_CHECK_INCLUDE_FILE("sys/utime.h" HAVE_SYS_UTIME_H) |
2358 | +LA_CHECK_INCLUDE_FILE("sys/wait.h" HAVE_SYS_WAIT_H) |
2359 | +LA_CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H) |
2360 | +LA_CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) |
2361 | +LA_CHECK_INCLUDE_FILE("utime.h" HAVE_UTIME_H) |
2362 | +LA_CHECK_INCLUDE_FILE("wchar.h" HAVE_WCHAR_H) |
2363 | +LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H) |
2364 | +LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) |
2365 | + |
2366 | + |
2367 | +# |
2368 | +# Some headers require extra includes when they're available. |
2369 | +# |
2370 | + |
2371 | +# |
2372 | +# Find OpenSSL |
2373 | +# |
2374 | +IF(ENABLE_OPENSSL) |
2375 | + FIND_PACKAGE(OpenSSL) |
2376 | +ENDIF() |
2377 | + |
2378 | +# |
2379 | +# How to prove that HASH functions, which have several names on various |
2380 | +# platforms, can be mapped to archive_{hash name}_init, |
2381 | +# archive_{hash name}_update and archive_{hash name}_final through |
2382 | +# archive_hash.h |
2383 | +# |
2384 | +MACRO(CHECK_MD HASH IMPLEMENTATIONS) |
2385 | + IF(HAVE_SYS_TYPES_H) |
2386 | + SET(HASH_HEADER_CONFIG "#define HAVE_SYS_TYPES_H 1\n") |
2387 | + ELSE(HAVE_SYS_TYPES_H) |
2388 | + SET(HASH_HEADER_CONFIG "") |
2389 | + ENDIF(HAVE_SYS_TYPES_H) |
2390 | + |
2391 | + FOREACH(IMPLEMENTATION ${IMPLEMENTATIONS}) |
2392 | + IF(NOT DEFINED ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) |
2393 | + STRING(TOLOWER "${HASH}" lower_hash) |
2394 | + STRING(TOUPPER "${HASH}" hash) |
2395 | + |
2396 | + SET(HASH_REQUIRED_INCLUDES) |
2397 | + SET(TRY_HASH_REQUIRED_INCLUDES |
2398 | + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/libarchive") |
2399 | + SET(HASH_REQUIRED_LIBS) |
2400 | + SET(TRY_HASH_REQUIRED_LIBS) |
2401 | + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) |
2402 | + SET(HASH_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) |
2403 | + SET(TRY_HASH_REQUIRED_INCLUDES |
2404 | + "${TRY_HASH_REQUIRED_INCLUDES};${OPENSSL_INCLUDE_DIR}") |
2405 | + SET(HASH_REQUIRED_LIBS ${OPENSSL_LIBRARIES}) |
2406 | + SET(TRY_HASH_REQUIRED_LIBS |
2407 | + "-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}") |
2408 | + ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) |
2409 | + |
2410 | + SET(SOURCE "#define ${hash}_COMPILE_TEST |
2411 | +#define ARCHIVE_HASH_${hash}_${IMPLEMENTATION} |
2412 | +#define __LIBARCHIVE_BUILD |
2413 | +${HASH_HEADER_CONFIG} |
2414 | +#include \"archive_hash.h\" |
2415 | + |
2416 | +int |
2417 | +main(int argc, char **argv) |
2418 | +{ |
2419 | + archive_${lower_hash}_ctx ctx; |
2420 | + |
2421 | + archive_${lower_hash}_init(&ctx); |
2422 | + archive_${lower_hash}_update(&ctx, *argv, argc); |
2423 | + archive_${lower_hash}_final(&ctx, *argv); |
2424 | + return 0; |
2425 | +} |
2426 | +") |
2427 | + |
2428 | + FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_hash_md.c" "${SOURCE}") |
2429 | + MESSAGE(STATUS "Checking support for ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}") |
2430 | + |
2431 | + TRY_COMPILE(ARCHIVE_HASH_${HASH}_${IMPLEMENTATION} |
2432 | + ${CMAKE_BINARY_DIR} |
2433 | + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_hash_md.c |
2434 | + CMAKE_FLAGS |
2435 | + "${TRY_HASH_REQUIRED_LIBS}" |
2436 | + "${TRY_HASH_REQUIRED_INCLUDES}" |
2437 | + OUTPUT_VARIABLE OUTPUT) |
2438 | + |
2439 | + IF (ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) |
2440 | + MESSAGE(STATUS "Checking support for ARCHIVE_HASH_${HASH}_${IMPLEMENTATION} -- found") |
2441 | + IF (HASH_REQUIRED_INCLUDES) |
2442 | + INCLUDE_DIRECTORIES(${HASH_REQUIRED_INCLUDES}) |
2443 | + ENDIF (HASH_REQUIRED_INCLUDES) |
2444 | + IF (HASH_REQUIRED_LIBS) |
2445 | + LIST(APPEND ADDITIONAL_LIBS ${HASH_REQUIRED_LIBS}) |
2446 | + LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) |
2447 | + ENDIF (HASH_REQUIRED_LIBS) |
2448 | + BREAK() |
2449 | + ENDIF (ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) |
2450 | + |
2451 | + MESSAGE(STATUS "Checking support for ARCHIVE_HASH_${HASH}_${IMPLEMENTATION} -- not found") |
2452 | + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log |
2453 | + "Checking support for ARCHIVE_HASH_${HASH}_${IMPLEMENTATION} failed with the following output:\n" |
2454 | + "${OUTPUT}\n" |
2455 | + "Source file was:\n${SOURCE}\n") |
2456 | + ELSE(NOT DEFINED ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) |
2457 | + IF(ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) |
2458 | + BREAK() |
2459 | + ENDIF(ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) |
2460 | + ENDIF(NOT DEFINED ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) |
2461 | + ENDFOREACH(IMPLEMENTATION) |
2462 | +ENDMACRO(CHECK_MD HASH IMPLEMENTATIONS) |
2463 | + |
2464 | +# |
2465 | +# HASH functions on Windows is defined at archive_windows.c, thus we do not |
2466 | +# need the test what the functions can be mapped to archive_{hash name}_init, |
2467 | +# archive_{hash name}_update and archive_{hash name}_final. |
2468 | +# The functions on Windows use CALG_{hash name} macro to create a crypt object |
2469 | +# and then we need to know what CALG_{hash name} macros is available to show |
2470 | +# ARCHIVE_HASH_{hash name}_WIN macros because Windows 2000 and earlier version |
2471 | +# of Windows XP do not support SHA256, SHA384 and SHA512. |
2472 | +# |
2473 | +MACRO(CHECK_HASH_WIN HASH_LIST) |
2474 | + IF(WIN32 AND NOT CYGWIN) |
2475 | + FOREACH(HASH ${HASH_LIST}) |
2476 | + IF(NOT DEFINED ARCHIVE_HASH_${HASH}_WIN) |
2477 | + STRING(TOUPPER "${HASH}" hash) |
2478 | + SET(ALGID "") |
2479 | + IF ("${HASH}" MATCHES "^MD5$") |
2480 | + SET(ALGID "CALG_MD5") |
2481 | + ENDIF ("${HASH}" MATCHES "^MD5$") |
2482 | + IF ("${HASH}" MATCHES "^SHA1$") |
2483 | + SET(ALGID "CALG_SHA1") |
2484 | + ENDIF ("${HASH}" MATCHES "^SHA1$") |
2485 | + IF ("${HASH}" MATCHES "^SHA256$") |
2486 | + SET(ALGID "CALG_SHA_256") |
2487 | + ENDIF ("${HASH}" MATCHES "^SHA256$") |
2488 | + IF ("${HASH}" MATCHES "^SHA384$") |
2489 | + SET(ALGID "CALG_SHA_384") |
2490 | + ENDIF ("${HASH}" MATCHES "^SHA384$") |
2491 | + IF ("${HASH}" MATCHES "^SHA512$") |
2492 | + SET(ALGID "CALG_SHA_512") |
2493 | + ENDIF ("${HASH}" MATCHES "^SHA512$") |
2494 | + |
2495 | + SET(SOURCE "#define ${hash}_COMPILE_TEST |
2496 | +#define _WIN32_WINNT ${_WIN32_WINNT} |
2497 | +#define WINVER ${WINVER} |
2498 | +#include <windows.h> |
2499 | +#include <wincrypt.h> |
2500 | + |
2501 | +int |
2502 | +main(int argc, char **argv) |
2503 | +{ |
2504 | + return ${ALGID}; |
2505 | +} |
2506 | +") |
2507 | + SET(SOURCE_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_hash_win.c") |
2508 | + |
2509 | + FILE(WRITE "${SOURCE_FILE}" "${SOURCE}") |
2510 | + MESSAGE(STATUS "Checking support for ARCHIVE_HASH_${HASH}_WIN") |
2511 | + |
2512 | + TRY_COMPILE(ARCHIVE_HASH_${HASH}_WIN |
2513 | + ${CMAKE_BINARY_DIR} |
2514 | + ${SOURCE_FILE} |
2515 | + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/libarchive" |
2516 | + OUTPUT_VARIABLE OUTPUT) |
2517 | + |
2518 | + IF (ARCHIVE_HASH_${HASH}_WIN) |
2519 | + MESSAGE(STATUS |
2520 | + "Checking support for ARCHIVE_HASH_${HASH}_WIN -- found") |
2521 | + ELSE (ARCHIVE_HASH_${HASH}_WIN) |
2522 | + MESSAGE(STATUS |
2523 | + "Checking support for ARCHIVE_HASH_${HASH}_WIN -- not found") |
2524 | + FILE(APPEND |
2525 | + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log |
2526 | + "Checking support for ARCHIVE_HASH_${HASH}_WIN failed with the following output:\n" |
2527 | + "${OUTPUT}\n" |
2528 | + "Source file was:\n${SOURCE}\n") |
2529 | + ENDIF (ARCHIVE_HASH_${HASH}_WIN) |
2530 | + |
2531 | + ENDIF(NOT DEFINED ARCHIVE_HASH_${HASH}_WIN) |
2532 | + ENDFOREACH(HASH) |
2533 | + ENDIF(WIN32 AND NOT CYGWIN) |
2534 | +ENDMACRO(CHECK_HASH_WIN HASH_LIST) |
2535 | + |
2536 | +# |
2537 | +# Check MD5/RMD160/SHA support |
2538 | +# |
2539 | +CHECK_MD(MD5 "LIBC;LIBSYSTEM;OPENSSL") |
2540 | +CHECK_MD(RMD160 "LIBC;OPENSSL") |
2541 | +CHECK_MD(SHA1 "LIBC;LIBSYSTEM;OPENSSL") |
2542 | +CHECK_MD(SHA256 "LIBC;LIBC2;LIBC3;LIBSYSTEM;OPENSSL") |
2543 | +CHECK_MD(SHA384 "LIBC;LIBC2;LIBC3;LIBSYSTEM;OPENSSL") |
2544 | +CHECK_MD(SHA512 "LIBC;LIBC2;LIBC3;LIBSYSTEM;OPENSSL") |
2545 | +CHECK_HASH_WIN("MD5;SHA1;SHA256;SHA384;SHA512") |
2546 | + |
2547 | +# |
2548 | +# Find Libxml2 |
2549 | +# |
2550 | +FIND_PACKAGE(LibXml2) |
2551 | +IF(LIBXML2_FOUND) |
2552 | + INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) |
2553 | + LIST(APPEND ADDITIONAL_LIBS ${LIBXML2_LIBRARIES}) |
2554 | + SET(HAVE_LIBXML2 1) |
2555 | + # libxml2's include files use iconv.h |
2556 | + # We need a directory path of iconv.h so that it won't fail to check |
2557 | + # "libxml/xmlreader.h". |
2558 | + FIND_PATH(ICONV_INCLUDE_DIR iconv.h) |
2559 | + INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) |
2560 | + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) |
2561 | + CHECK_INCLUDE_FILES("libxml/xmlreader.h" HAVE_LIBXML_XMLREADER_H) |
2562 | + SET(CMAKE_REQUIRED_INCLUDES "") |
2563 | +ELSE(LIBXML2_FOUND) |
2564 | + # |
2565 | + # Find Expat |
2566 | + # |
2567 | + FIND_PACKAGE(EXPAT) |
2568 | + IF(EXPAT_FOUND) |
2569 | + INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR}) |
2570 | + LIST(APPEND ADDITIONAL_LIBS ${EXPAT_LIBRARIES}) |
2571 | + SET(HAVE_LIBEXPAT 1) |
2572 | + LA_CHECK_INCLUDE_FILE("expat.h" HAVE_EXPAT_H) |
2573 | + ENDIF(EXPAT_FOUND) |
2574 | +ENDIF(LIBXML2_FOUND) |
2575 | + |
2576 | +# |
2577 | +# Check functions |
2578 | +# |
2579 | +CHECK_SYMBOL_EXISTS(CreateHardLinkA "windows.h" HAVE_CREATEHARDLINKA) |
2580 | +CHECK_SYMBOL_EXISTS(CreateHardLinkW "windows.h" HAVE_CREATEHARDLINKW) |
2581 | +CHECK_SYMBOL_EXISTS(_CrtSetReportMode "crtdbg.h" HAVE__CrtSetReportMode) |
2582 | +CHECK_FUNCTION_EXISTS_GLIBC(chflags HAVE_CHFLAGS) |
2583 | +CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN) |
2584 | +CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT) |
2585 | +CHECK_FUNCTION_EXISTS_GLIBC(fchdir HAVE_FCHDIR) |
2586 | +CHECK_FUNCTION_EXISTS_GLIBC(fchflags HAVE_FCHFLAGS) |
2587 | +CHECK_FUNCTION_EXISTS_GLIBC(fchmod HAVE_FCHMOD) |
2588 | +CHECK_FUNCTION_EXISTS_GLIBC(fchown HAVE_FCHOWN) |
2589 | +CHECK_FUNCTION_EXISTS_GLIBC(fcntl HAVE_FCNTL) |
2590 | +CHECK_FUNCTION_EXISTS_GLIBC(fork HAVE_FORK) |
2591 | +CHECK_FUNCTION_EXISTS_GLIBC(fstat HAVE_FSTAT) |
2592 | +CHECK_FUNCTION_EXISTS_GLIBC(ftruncate HAVE_FTRUNCATE) |
2593 | +CHECK_FUNCTION_EXISTS_GLIBC(futimens HAVE_FUTIMENS) |
2594 | +CHECK_FUNCTION_EXISTS_GLIBC(futimes HAVE_FUTIMES) |
2595 | +CHECK_FUNCTION_EXISTS_GLIBC(geteuid HAVE_GETEUID) |
2596 | +CHECK_FUNCTION_EXISTS_GLIBC(getgrgid_r HAVE_GETGRGID_R) |
2597 | +CHECK_FUNCTION_EXISTS_GLIBC(getgrnam_r HAVE_GETGRNAM_R) |
2598 | +CHECK_FUNCTION_EXISTS_GLIBC(getpwnam_r HAVE_GETPWNAM_R) |
2599 | +CHECK_FUNCTION_EXISTS_GLIBC(getpwuid_r HAVE_GETPWUID_R) |
2600 | +CHECK_FUNCTION_EXISTS_GLIBC(getpid HAVE_GETPID) |
2601 | +CHECK_FUNCTION_EXISTS_GLIBC(lchflags HAVE_LCHFLAGS) |
2602 | +CHECK_FUNCTION_EXISTS_GLIBC(lchmod HAVE_LCHMOD) |
2603 | +CHECK_FUNCTION_EXISTS_GLIBC(lchown HAVE_LCHOWN) |
2604 | +CHECK_FUNCTION_EXISTS_GLIBC(link HAVE_LINK) |
2605 | +CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) |
2606 | +CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) |
2607 | +CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) |
2608 | +CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) |
2609 | +CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) |
2610 | +CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) |
2611 | +CHECK_FUNCTION_EXISTS_GLIBC(nl_langinfo HAVE_NL_LANGINFO) |
2612 | +CHECK_FUNCTION_EXISTS_GLIBC(pipe HAVE_PIPE) |
2613 | +CHECK_FUNCTION_EXISTS_GLIBC(poll HAVE_POLL) |
2614 | +CHECK_FUNCTION_EXISTS_GLIBC(readlink HAVE_READLINK) |
2615 | +CHECK_FUNCTION_EXISTS_GLIBC(select HAVE_SELECT) |
2616 | +CHECK_FUNCTION_EXISTS_GLIBC(setenv HAVE_SETENV) |
2617 | +CHECK_FUNCTION_EXISTS_GLIBC(setlocale HAVE_SETLOCALE) |
2618 | +CHECK_FUNCTION_EXISTS_GLIBC(sigaction HAVE_SIGACTION) |
2619 | +CHECK_FUNCTION_EXISTS_GLIBC(strchr HAVE_STRCHR) |
2620 | +CHECK_FUNCTION_EXISTS_GLIBC(strdup HAVE_STRDUP) |
2621 | +CHECK_FUNCTION_EXISTS_GLIBC(strerror HAVE_STRERROR) |
2622 | +CHECK_FUNCTION_EXISTS_GLIBC(strncpy_s HAVE_STRNCPY_S) |
2623 | +CHECK_FUNCTION_EXISTS_GLIBC(strrchr HAVE_STRRCHR) |
2624 | +CHECK_FUNCTION_EXISTS_GLIBC(symlink HAVE_SYMLINK) |
2625 | +CHECK_FUNCTION_EXISTS_GLIBC(timegm HAVE_TIMEGM) |
2626 | +CHECK_FUNCTION_EXISTS_GLIBC(tzset HAVE_TZSET) |
2627 | +CHECK_FUNCTION_EXISTS_GLIBC(unsetenv HAVE_UNSETENV) |
2628 | +CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) |
2629 | +CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) |
2630 | +CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) |
2631 | +CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) |
2632 | +CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) |
2633 | +CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) |
2634 | +CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) |
2635 | +CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) |
2636 | +CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) |
2637 | +CHECK_SYMBOL_EXISTS(wmemcmp "wchar.h" HAVE_WMEMCMP) |
2638 | +CHECK_SYMBOL_EXISTS(wmemcpy "wchar.h" HAVE_WMEMCPY) |
2639 | + |
2640 | +SET(CMAKE_REQUIRED_LIBRARIES "") |
2641 | +CHECK_SYMBOL_EXISTS(fseeko "stdio.h" HAVE_FSEEKO) |
2642 | +CHECK_SYMBOL_EXISTS(strerror_r "string.h" HAVE_STRERROR_R) |
2643 | +CHECK_SYMBOL_EXISTS(strftime "time.h" HAVE_STRFTIME) |
2644 | +CHECK_SYMBOL_EXISTS(vprintf "stdio.h" HAVE_VPRINTF) |
2645 | +CHECK_SYMBOL_EXISTS(cygwin_conv_path "sys/cygwin.h" HAVE_CYGWIN_CONV_PATH) |
2646 | + |
2647 | +CHECK_SYMBOL_EXISTS(major "sys/mkdev.h" MAJOR_IN_MKDEV) |
2648 | +CHECK_SYMBOL_EXISTS(major "sys/sysmacros.h" MAJOR_IN_SYSMACROS) |
2649 | + |
2650 | +IF(HAVE_STRERROR_R) |
2651 | + SET(HAVE_DECL_STRERROR_R 1) |
2652 | +ENDIF(HAVE_STRERROR_R) |
2653 | + |
2654 | +# |
2655 | +# Check defines |
2656 | +# |
2657 | +SET(headers "limits.h") |
2658 | +IF(HAVE_STDINT_H) |
2659 | + LIST(APPEND headers "stdint.h") |
2660 | +ENDIF(HAVE_STDINT_H) |
2661 | +IF(HAVE_INTTYPES_H) |
2662 | + LIST(APPEND headers "inttypes.h") |
2663 | +ENDIF(HAVE_INTTYPES_H) |
2664 | +CHECK_SYMBOL_EXISTS(EFTYPE "errno.h" HAVE_EFTYPE) |
2665 | +CHECK_SYMBOL_EXISTS(EILSEQ "errno.h" HAVE_EILSEQ) |
2666 | +CHECK_SYMBOL_EXISTS(D_MD_ORDER "langinfo.h" HAVE_D_MD_ORDER) |
2667 | +CHECK_SYMBOL_EXISTS(optarg "unistd.h" HAVE_DECL_OPTARG) |
2668 | +CHECK_SYMBOL_EXISTS(optind "unistd.h" HAVE_DECL_OPTIND) |
2669 | +CHECK_SYMBOL_EXISTS(INT64_MAX "${headers}" HAVE_DECL_INT64_MAX) |
2670 | +CHECK_SYMBOL_EXISTS(INT64_MIN "${headers}" HAVE_DECL_INT64_MIN) |
2671 | +CHECK_SYMBOL_EXISTS(UINT32_MAX "${headers}" HAVE_DECL_UINT32_MAX) |
2672 | +CHECK_SYMBOL_EXISTS(UINT64_MAX "${headers}" HAVE_DECL_UINT64_MAX) |
2673 | +CHECK_SYMBOL_EXISTS(SIZE_MAX "${headers}" HAVE_DECL_SIZE_MAX) |
2674 | +CHECK_SYMBOL_EXISTS(SSIZE_MAX "limits.h" HAVE_DECL_SSIZE_MAX) |
2675 | + |
2676 | +# |
2677 | +# Check struct members |
2678 | +# |
2679 | +# Check for birthtime in struct stat |
2680 | +CHECK_STRUCT_MEMBER("struct stat" st_birthtime |
2681 | + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BIRTHTIME) |
2682 | + |
2683 | +# Check for high-resolution timestamps in struct stat |
2684 | +CHECK_STRUCT_MEMBER("struct stat" st_birthtimespec.tv_nsec |
2685 | + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC) |
2686 | +CHECK_STRUCT_MEMBER("struct stat" st_mtimespec.tv_nsec |
2687 | + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC) |
2688 | +CHECK_STRUCT_MEMBER("struct stat" st_mtim.tv_nsec |
2689 | + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) |
2690 | +CHECK_STRUCT_MEMBER("struct stat" st_mtime_n |
2691 | + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIME_N) |
2692 | +CHECK_STRUCT_MEMBER("struct stat" st_umtime |
2693 | + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_UMTIME) |
2694 | +CHECK_STRUCT_MEMBER("struct stat" st_mtime_usec |
2695 | + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIME_USEC) |
2696 | +# Check for block size support in struct stat |
2697 | +CHECK_STRUCT_MEMBER("struct stat" st_blksize |
2698 | + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BLKSIZE) |
2699 | +# Check for st_flags in struct stat (BSD fflags) |
2700 | +CHECK_STRUCT_MEMBER("struct stat" st_flags |
2701 | + "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_FLAGS) |
2702 | +# |
2703 | +# |
2704 | +CHECK_STRUCT_MEMBER("struct tm" tm_sec |
2705 | + "sys/types.h;sys/time.h;time.h" TIME_WITH_SYS_TIME) |
2706 | + |
2707 | +# |
2708 | +# Check for integer types |
2709 | +# |
2710 | +# XXX There must be a way to make this simpler <sigh> XXXX |
2711 | +# |
2712 | +CHECK_TYPE_SIZE("long long int" LONG_LONG_INT) |
2713 | +CHECK_TYPE_SIZE("unsigned long long" UNSIGNED_LONG_LONG) |
2714 | +CHECK_TYPE_SIZE("unsigned long long int" UNSIGNED_LONG_LONG_INT) |
2715 | + |
2716 | +# |
2717 | +CHECK_TYPE_SIZE(dev_t DEV_T) |
2718 | +IF(NOT HAVE_DEV_T) |
2719 | + IF(MSVC) |
2720 | + SET(dev_t "unsigned int") |
2721 | + ENDIF(MSVC) |
2722 | +ENDIF(NOT HAVE_DEV_T) |
2723 | +# |
2724 | +CHECK_TYPE_SIZE(gid_t GID_T) |
2725 | +IF(NOT HAVE_GID_T) |
2726 | + IF(WIN32) |
2727 | + SET(gid_t "short") |
2728 | + ELSE(WIN32) |
2729 | + SET(gid_t "unsigned int") |
2730 | + ENDIF(WIN32) |
2731 | +ENDIF(NOT HAVE_GID_T) |
2732 | +# |
2733 | +CHECK_TYPE_SIZE(id_t ID_T) |
2734 | +IF(NOT HAVE_ID_T) |
2735 | + IF(WIN32) |
2736 | + SET(id_t "short") |
2737 | + ELSE(WIN32) |
2738 | + SET(id_t "unsigned int") |
2739 | + ENDIF(WIN32) |
2740 | +ENDIF(NOT HAVE_ID_T) |
2741 | +# |
2742 | +CHECK_TYPE_SIZE(int32_t INT32_T) |
2743 | +IF(NOT HAVE_INT32_T) |
2744 | + SET(int32_t "int") |
2745 | +ENDIF(NOT HAVE_INT32_T) |
2746 | +# |
2747 | +CHECK_TYPE_SIZE(int64_t INT64_T) |
2748 | +IF(NOT HAVE_INT64_T) |
2749 | + IF(WIN32) |
2750 | + SET(int64_t __int64) |
2751 | + ENDIF(WIN32) |
2752 | +ENDIF(NOT HAVE_INT64_T) |
2753 | +# |
2754 | +CHECK_TYPE_SIZE(intmax_t INTMAX_T) |
2755 | +IF(NOT HAVE_INTMAX_T) |
2756 | + SET(intmax_t "int64_t") |
2757 | +ENDIF(NOT HAVE_INTMAX_T) |
2758 | +# |
2759 | +CHECK_TYPE_SIZE(mode_t MODE_T) |
2760 | +IF(NOT HAVE_MODE_T) |
2761 | + IF(WIN32) |
2762 | + SET(mode_t "unsigned short") |
2763 | + ELSE(WIN32) |
2764 | + SET(mode_t "int") |
2765 | + ENDIF(WIN32) |
2766 | +ENDIF(NOT HAVE_MODE_T) |
2767 | +# |
2768 | +CHECK_TYPE_SIZE(off_t OFF_T) |
2769 | +IF(NOT HAVE_OFF_T) |
2770 | + SET(off_t "__int64") |
2771 | +ENDIF(NOT HAVE_OFF_T) |
2772 | +# |
2773 | +CHECK_TYPE_SIZE(size_t SIZE_T) |
2774 | +IF(NOT HAVE_SIZE_T) |
2775 | + IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) |
2776 | + SET(size_t "uint64_t") |
2777 | + ELSE("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) |
2778 | + SET(size_t "uint32_t") |
2779 | + ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) |
2780 | +ENDIF(NOT HAVE_SIZE_T) |
2781 | +# |
2782 | +CHECK_TYPE_SIZE(ssize_t SSIZE_T) |
2783 | +IF(NOT HAVE_SSIZE_T) |
2784 | + IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) |
2785 | + SET(ssize_t "int64_t") |
2786 | + ELSE("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) |
2787 | + SET(ssize_t "long") |
2788 | + ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) |
2789 | +ENDIF(NOT HAVE_SSIZE_T) |
2790 | +# |
2791 | +CHECK_TYPE_SIZE(uid_t UID_T) |
2792 | +IF(NOT HAVE_UID_T) |
2793 | + IF(WIN32) |
2794 | + SET(uid_t "short") |
2795 | + ELSE(WIN32) |
2796 | + SET(uid_t "unsigned int") |
2797 | + ENDIF(WIN32) |
2798 | +ENDIF(NOT HAVE_UID_T) |
2799 | +# |
2800 | +CHECK_TYPE_SIZE(pid_t PID_T) |
2801 | +IF(NOT HAVE_PID_T) |
2802 | + IF(WIN32) |
2803 | + SET(pid_t "int") |
2804 | + ELSE(WIN32) |
2805 | + MESSAGE(FATAL_ERROR "pid_t doesn't exist on this platform?") |
2806 | + ENDIF(WIN32) |
2807 | +ENDIF(NOT HAVE_PID_T) |
2808 | +# |
2809 | +CHECK_TYPE_SIZE(uint16_t UINT16_T) |
2810 | +IF(NOT HAVE_UINT16_T) |
2811 | + SET(uint16_t "unsigned short") |
2812 | +ENDIF(NOT HAVE_UINT16_T) |
2813 | +# |
2814 | +CHECK_TYPE_SIZE(uint32_t UINT32_T) |
2815 | +IF(NOT HAVE_UINT32_T) |
2816 | + SET(uint32_t "unsigned int") |
2817 | +ENDIF(NOT HAVE_UINT32_T) |
2818 | +# |
2819 | +CHECK_TYPE_SIZE(uint64_t UINT64_T) |
2820 | +IF(NOT HAVE_UINT64_T) |
2821 | + IF(WIN32) |
2822 | + SET(uint64_t "unsigned __int64") |
2823 | + ENDIF(WIN32) |
2824 | +ENDIF(NOT HAVE_UINT64_T) |
2825 | +# |
2826 | +CHECK_TYPE_SIZE(uintmax_t UINTMAX_T) |
2827 | +IF(NOT HAVE_UINTMAX_T) |
2828 | + SET(uintmax_t "uint64_t") |
2829 | +ENDIF(NOT HAVE_UINTMAX_T) |
2830 | +# |
2831 | +CHECK_TYPE_SIZE(intptr_t INTPTR_T) |
2832 | +IF(NOT HAVE_INTPTR_T) |
2833 | + IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) |
2834 | + SET(intptr_t "int64_t") |
2835 | + ELSE() |
2836 | + SET(intptr_t "int32_t") |
2837 | + ENDIF() |
2838 | +ENDIF(NOT HAVE_INTPTR_T) |
2839 | +# |
2840 | +CHECK_TYPE_SIZE(uintptr_t UINTPTR_T) |
2841 | +IF(NOT HAVE_UINTPTR_T) |
2842 | + IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) |
2843 | + SET(uintptr_t "uint64_t") |
2844 | + ELSE() |
2845 | + SET(uintptr_t "uint32_t") |
2846 | + ENDIF() |
2847 | +ENDIF(NOT HAVE_UINTPTR_T) |
2848 | +# |
2849 | +CHECK_TYPE_SIZE(wchar_t SIZEOF_WCHAR_T) |
2850 | +IF(HAVE_SIZEOF_WCHAR_T) |
2851 | + SET(HAVE_WCHAR_T 1) |
2852 | +ENDIF(HAVE_SIZEOF_WCHAR_T) |
2853 | +# |
2854 | +# Check if _FILE_OFFSET_BITS macro needed for large files |
2855 | +# |
2856 | +CHECK_FILE_OFFSET_BITS() |
2857 | + |
2858 | + |
2859 | + |
2860 | +# |
2861 | +# Check for Extended Attribute libraries, headers, and functions |
2862 | +# |
2863 | +IF(ENABLE_XATTR) |
2864 | + LA_CHECK_INCLUDE_FILE(attr/xattr.h HAVE_ATTR_XATTR_H) |
2865 | + LA_CHECK_INCLUDE_FILE(sys/xattr.h HAVE_SYS_XATTR_H) |
2866 | + LA_CHECK_INCLUDE_FILE(sys/extattr.h HAVE_SYS_EXTATTR_H) |
2867 | + CHECK_LIBRARY_EXISTS(attr "setxattr" "" HAVE_ATTR_LIB) |
2868 | + IF(HAVE_ATTR_LIB) |
2869 | + SET(CMAKE_REQUIRED_LIBRARIES "attr") |
2870 | + ENDIF(HAVE_ATTR_LIB) |
2871 | + CHECK_SYMBOL_EXISTS(EXTATTR_NAMESPACE_USER "sys/types.h;sys/extattr.h" HAVE_DECL_EXTATTR_NAMESPACE_USER) |
2872 | + CHECK_FUNCTION_EXISTS_GLIBC(extattr_get_file HAVE_EXTATTR_GET_FILE) |
2873 | + CHECK_FUNCTION_EXISTS_GLIBC(extattr_list_file HAVE_EXTATTR_LIST_FILE) |
2874 | + CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_fd HAVE_EXTATTR_SET_FD) |
2875 | + CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_file HAVE_EXTATTR_SET_FILE) |
2876 | + CHECK_FUNCTION_EXISTS_GLIBC(fsetxattr HAVE_FSETXATTR) |
2877 | + CHECK_FUNCTION_EXISTS_GLIBC(getxattr HAVE_GETXATTR) |
2878 | + CHECK_FUNCTION_EXISTS_GLIBC(lgetxattr HAVE_LGETXATTR) |
2879 | + CHECK_FUNCTION_EXISTS_GLIBC(listxattr HAVE_LISTXATTR) |
2880 | + CHECK_FUNCTION_EXISTS_GLIBC(llistxattr HAVE_LLISTXATTR) |
2881 | + CHECK_FUNCTION_EXISTS_GLIBC(lsetxattr HAVE_LSETXATTR) |
2882 | +ENDIF(ENABLE_XATTR) |
2883 | + |
2884 | +# |
2885 | +# Check for ACL libraries, headers, and functions |
2886 | +# |
2887 | +# The ACL support in libarchive is written against the POSIX1e draft, |
2888 | +# which was never officially approved and varies quite a bit across |
2889 | +# platforms. Worse, some systems have completely non-POSIX acl functions, |
2890 | +# which makes the following checks rather more complex than I would like. |
2891 | +# |
2892 | +IF(ENABLE_ACL) |
2893 | + CHECK_LIBRARY_EXISTS(acl "acl_get_file" "" HAVE_ACL_LIB) |
2894 | + IF(HAVE_ACL_LIB) |
2895 | + SET(CMAKE_REQUIRED_LIBRARIES "acl") |
2896 | + FIND_LIBRARY(ACL_LIBRARY NAMES acl) |
2897 | + LIST(APPEND ADDITIONAL_LIBS ${ACL_LIBRARY}) |
2898 | + ENDIF(HAVE_ACL_LIB) |
2899 | + # |
2900 | + CHECK_FUNCTION_EXISTS_GLIBC(acl_create_entry HAVE_ACL_CREATE_ENTRY) |
2901 | + CHECK_FUNCTION_EXISTS_GLIBC(acl_init HAVE_ACL_INIT) |
2902 | + CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd HAVE_ACL_SET_FD) |
2903 | + CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd_np HAVE_ACL_SET_FD_NP) |
2904 | + CHECK_FUNCTION_EXISTS_GLIBC(acl_set_file HAVE_ACL_SET_FILE) |
2905 | + CHECK_TYPE_EXISTS(acl_permset_t "${INCLUDES}" HAVE_ACL_PERMSET_T) |
2906 | + |
2907 | + # The "acl_get_perm()" function was omitted from the POSIX draft. |
2908 | + # (It's a pretty obvious oversight; otherwise, there's no way to |
2909 | + # test for specific permissions in a permset.) Linux uses the obvious |
2910 | + # name, FreeBSD adds _np to mark it as "non-Posix extension." |
2911 | + # Test for both as a double-check that we really have POSIX-style ACL support. |
2912 | + CHECK_SYMBOL_EXISTS(acl_get_perm "${INCLUDES}" HAVE_ACL_GET_PERM) |
2913 | + CHECK_SYMBOL_EXISTS(acl_get_perm_np "${INCLUDES}" HAVE_ACL_GET_PERM_NP) |
2914 | + CHECK_SYMBOL_EXISTS(acl_get_link "${INCLUDES}" HAVE_ACL_GET_LINK) |
2915 | + CHECK_SYMBOL_EXISTS(acl_get_link_np "${INCLUDES}" HAVE_ACL_GET_LINK_NP) |
2916 | + |
2917 | + # MacOS has an acl.h that isn't POSIX. It can be detected by |
2918 | + # checking for ACL_USER |
2919 | + CHECK_SYMBOL_EXISTS(ACL_USER "${INCLUDES}" HAVE_ACL_USER) |
2920 | +ENDIF(ENABLE_ACL) |
2921 | + |
2922 | +# Generate "config.h" from "build/cmake/config.h.in" |
2923 | +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in |
2924 | + ${CMAKE_CURRENT_BINARY_DIR}/config.h) |
2925 | +INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) |
2926 | +ADD_DEFINITIONS(-DHAVE_CONFIG_H) |
2927 | + |
2928 | +# |
2929 | +# Register installation of PDF documents. |
2930 | +# |
2931 | +IF(WIN32 AND NOT CYGWIN) |
2932 | + # |
2933 | + # On Windows platform, It's better that we install PDF documents |
2934 | + # on one's computer. |
2935 | + # These PDF documents are available in the release package. |
2936 | + # |
2937 | + IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doc/pdf) |
2938 | + INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/pdf |
2939 | + DESTINATION share/man |
2940 | + FILES_MATCHING PATTERN "*.pdf" |
2941 | + ) |
2942 | + ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doc/pdf) |
2943 | +ENDIF(WIN32 AND NOT CYGWIN) |
2944 | +# |
2945 | +# |
2946 | +# |
2947 | +INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/libarchive) |
2948 | +# |
2949 | +IF(MSVC) |
2950 | + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) |
2951 | +ENDIF(MSVC) |
2952 | +# Especially for early development, we want to be a little |
2953 | +# aggressive about diagnosing build problems; this can get |
2954 | +# relaxed somewhat in final shipping versions. |
2955 | +IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") |
2956 | + ADD_DEFINITIONS(-Wall -Werror) |
2957 | +ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") |
2958 | + |
2959 | +IF(ENABLE_TEST) |
2960 | +ADD_CUSTOM_TARGET(run_all_tests) |
2961 | +ENDIF(ENABLE_TEST) |
2962 | + |
2963 | +add_subdirectory(libarchive) |
2964 | +add_subdirectory(tar) |
2965 | +add_subdirectory(cpio) |
2966 | |
2967 | === added file 'src/libarchive/COPYING' |
2968 | --- src/libarchive/COPYING 1970-01-01 00:00:00 +0000 |
2969 | +++ src/libarchive/COPYING 2012-02-10 20:09:18 +0000 |
2970 | @@ -0,0 +1,60 @@ |
2971 | +The libarchive distribution as a whole is Copyright by Tim Kientzle |
2972 | +and is subject to the copyright notice reproduced at the bottom of |
2973 | +this file. |
2974 | + |
2975 | +Each individual file in this distribution should have a clear |
2976 | +copyright/licensing statement at the beginning of the file. If any do |
2977 | +not, please let me know and I will rectify it. The following is |
2978 | +intended to summarize the copyright status of the individual files; |
2979 | +the actual statements in the files are controlling. |
2980 | + |
2981 | +* Except as listed below, all C sources (including .c and .h files) |
2982 | + and documentation files are subject to the copyright notice reproduced |
2983 | + at the bottom of this file. |
2984 | + |
2985 | +* The following source files are also subject in whole or in part to |
2986 | + a 3-clause UC Regents copyright; please read the individual source |
2987 | + files for details: |
2988 | + libarchive/archive_entry.c |
2989 | + libarchive/archive_read_support_compression_compress.c |
2990 | + libarchive/archive_write_set_compression_compress.c |
2991 | + libarchive/mtree.5 |
2992 | + tar/matching.c |
2993 | + |
2994 | +* The following source files are in the public domain: |
2995 | + tar/getdate.c |
2996 | + |
2997 | +* The build files---including Makefiles, configure scripts, |
2998 | + and auxiliary scripts used as part of the compile process---have |
2999 | + widely varying licensing terms. Please check individual files before |
3000 | + distributing them to see if those restrictions apply to you. |
3001 | + |
3002 | +I intend for all new source code to use the license below and hope over |
3003 | +time to replace code with other licenses with new implementations that |
3004 | +do use the license below. The varying licensing of the build scripts |
3005 | +seems to be an unavoidable mess. |
3006 | + |
3007 | + |
3008 | +Copyright (c) 2003-2009 <author(s)> |
3009 | +All rights reserved. |
3010 | + |
3011 | +Redistribution and use in source and binary forms, with or without |
3012 | +modification, are permitted provided that the following conditions |
3013 | +are met: |
3014 | +1. Redistributions of source code must retain the above copyright |
3015 | + notice, this list of conditions and the following disclaimer |
3016 | + in this position and unchanged. |
3017 | +2. Redistributions in binary form must reproduce the above copyright |
3018 | + notice, this list of conditions and the following disclaimer in the |
3019 | + documentation and/or other materials provided with the distribution. |
3020 | + |
3021 | +THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR |
3022 | +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
3023 | +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
3024 | +IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, |
3025 | +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
3026 | +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
3027 | +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
3028 | +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
3029 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
3030 | +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
3031 | |
3032 | === added file 'src/libarchive/INSTALL' |
3033 | --- src/libarchive/INSTALL 1970-01-01 00:00:00 +0000 |
3034 | +++ src/libarchive/INSTALL 2012-02-10 20:09:18 +0000 |
3035 | @@ -0,0 +1,30 @@ |
3036 | +More complete build documentation is available on the libarchive |
3037 | +Wiki: http://libarchive.googlecode.com/ |
3038 | + |
3039 | +On most Unix-like systems, you should be able to install libarchive, |
3040 | +bsdtar, and bsdcpio using the following common steps: |
3041 | + ./configure |
3042 | + make |
3043 | + make install |
3044 | + |
3045 | +If you need to customize the target directories or otherwise adjust |
3046 | +the build setting, use |
3047 | + ./configure --help |
3048 | +to list the configure options. |
3049 | + |
3050 | +If you are developing libarchive and need to update the |
3051 | +configure script and other build files: |
3052 | + /bin/sh build/autogen.sh |
3053 | + |
3054 | +To create a distribution, please use the 'distcheck' target: |
3055 | + /bin/sh build/autogen.sh && ./configure && make distcheck |
3056 | + |
3057 | +On non-Unix-like systems, use the "cmake" utility (available from |
3058 | +http://cmake.org/) to generate suitable build files for your platform. |
3059 | +Cmake requires the name of the directory containing CmakeLists.txt and |
3060 | +the "generator" to use for your build environment. For example, to |
3061 | +build with Xcode on Mac OS, you can use the following command: |
3062 | + cmake -G "Xcode" ~/libarchive-download-dir/ |
3063 | +The result will be appropriate makefiles, solution files, or project |
3064 | +files that can be used with the corresponding development tool. |
3065 | +See the libarchive Wiki or the cmake site for further documentation. |
3066 | \ No newline at end of file |
3067 | |
3068 | === added file 'src/libarchive/Makefile.am' |
3069 | --- src/libarchive/Makefile.am 1970-01-01 00:00:00 +0000 |
3070 | +++ src/libarchive/Makefile.am 2012-02-10 20:09:18 +0000 |
3071 | @@ -0,0 +1,629 @@ |
3072 | +## Process this file with automake to produce Makefile.in |
3073 | + |
3074 | +AUTOMAKE_OPTIONS= foreign subdir-objects |
3075 | +ACLOCAL_AMFLAGS = -I build/autoconf |
3076 | + |
3077 | +# |
3078 | +# What to build and install |
3079 | +# |
3080 | +lib_LTLIBRARIES= libarchive.la |
3081 | +noinst_LTLIBRARIES= libarchive_fe.la |
3082 | +bin_PROGRAMS= $(bsdtar_programs) $(bsdcpio_programs) |
3083 | +man_MANS= $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS) |
3084 | +BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h |
3085 | + |
3086 | +# |
3087 | +# What to test: We always test libarchive, test bsdtar and bsdcpio only |
3088 | +# if we built them. |
3089 | +# |
3090 | +check_PROGRAMS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) |
3091 | +TESTS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) |
3092 | +TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT) |
3093 | +# Always build and test both bsdtar and bsdcpio as part of 'distcheck' |
3094 | +DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio |
3095 | +# Uncommenting this line can help diagnose some errors. This is ordinarily |
3096 | +# enabled in the libarchive development branch but is disabled |
3097 | +# for libarchive production releases. |
3098 | +#AM_CFLAGS=-Wall -Werror |
3099 | +PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@ |
3100 | +AM_CPPFLAGS=$(PLATFORMCPPFLAGS) |
3101 | + |
3102 | +# |
3103 | +# What to include in the distribution |
3104 | +# |
3105 | +EXTRA_DIST= \ |
3106 | + CMakeLists.txt \ |
3107 | + build/autogen.sh \ |
3108 | + build/bump-version.sh \ |
3109 | + build/clean.sh \ |
3110 | + build/cmake \ |
3111 | + build/version \ |
3112 | + build/windows \ |
3113 | + contrib \ |
3114 | + doc \ |
3115 | + examples \ |
3116 | + $(libarchive_EXTRA_DIST) \ |
3117 | + $(libarchive_test_EXTRA_DIST) \ |
3118 | + $(bsdtar_EXTRA_DIST) \ |
3119 | + $(bsdtar_test_EXTRA_DIST) \ |
3120 | + $(bsdcpio_EXTRA_DIST) \ |
3121 | + $(bsdcpio_test_EXTRA_DIST) |
3122 | + |
3123 | +# a) Clean out some unneeded files and directories |
3124 | +# b) Collect all documentation and format it for distribution. |
3125 | +dist-hook: |
3126 | + rm -rf `find $(distdir) -name CVS -type d` |
3127 | + rm -rf `find $(distdir) -name .svn -type d` |
3128 | + rm -f `find $(distdir) -name '*~'` |
3129 | + rm -f `find $(distdir) -name '*.out'` |
3130 | + rm -f `find $(distdir) -name '*.core'` |
3131 | + -rm -f $(distdir)/*/Makefile $(distdir)/*/*/Makefile |
3132 | + cd $(distdir)/doc && /bin/sh update.sh |
3133 | + |
3134 | +# Verify cmake builds as part of the acceptance |
3135 | +distcheck-hook: |
3136 | + mkdir $(distdir)/_build/cmtest |
3137 | + cd $(distdir)/_build/cmtest && cmake ../.. && make && make test |
3138 | + rm -rf $(distdir)/_build/cmtest |
3139 | + |
3140 | +# |
3141 | +# Extra rules for cleanup |
3142 | +# |
3143 | +DISTCLEANFILES= \ |
3144 | + libarchive/test/list.h \ |
3145 | + tar/test/list.h \ |
3146 | + cpio/test/list.h |
3147 | + |
3148 | +distclean-local: |
3149 | + -rm -rf .ref |
3150 | + -rm -rf autom4te.cache/ |
3151 | + -rm -f *~ |
3152 | + -[ -f libarchive/Makefile ] && cd libarchive && make clean |
3153 | + -[ -f libarchive/test/Makefile ] && cd libarchive/test && make clean |
3154 | + -[ -f tar/Makefile ] && cd tar && make clean |
3155 | + -[ -f tar/test/Makefile ] && cd tar/test && make clean |
3156 | + -[ -f cpio/Makefile ] && cd cpio && make clean |
3157 | + -[ -f cpio/test/Makefile ] && cd cpio/test && make clean |
3158 | + |
3159 | +# |
3160 | +# Libarchive headers, source, etc. |
3161 | +# |
3162 | +# |
3163 | + |
3164 | +include_HEADERS= libarchive/archive.h libarchive/archive_entry.h |
3165 | + |
3166 | +libarchive_la_SOURCES= \ |
3167 | + libarchive/archive_check_magic.c \ |
3168 | + libarchive/archive_crc32.h \ |
3169 | + libarchive/archive_endian.h \ |
3170 | + libarchive/archive_entry.c \ |
3171 | + libarchive/archive_entry.h \ |
3172 | + libarchive/archive_entry_copy_stat.c \ |
3173 | + libarchive/archive_entry_link_resolver.c \ |
3174 | + libarchive/archive_entry_private.h \ |
3175 | + libarchive/archive_entry_stat.c \ |
3176 | + libarchive/archive_entry_strmode.c \ |
3177 | + libarchive/archive_entry_xattr.c \ |
3178 | + libarchive/archive_hash.h \ |
3179 | + libarchive/archive_platform.h \ |
3180 | + libarchive/archive_private.h \ |
3181 | + libarchive/archive_read.c \ |
3182 | + libarchive/archive_read_data_into_fd.c \ |
3183 | + libarchive/archive_read_disk.c \ |
3184 | + libarchive/archive_read_disk_entry_from_file.c \ |
3185 | + libarchive/archive_read_disk_private.h \ |
3186 | + libarchive/archive_read_disk_set_standard_lookup.c \ |
3187 | + libarchive/archive_read_extract.c \ |
3188 | + libarchive/archive_read_open_fd.c \ |
3189 | + libarchive/archive_read_open_file.c \ |
3190 | + libarchive/archive_read_open_filename.c \ |
3191 | + libarchive/archive_read_open_memory.c \ |
3192 | + libarchive/archive_read_private.h \ |
3193 | + libarchive/archive_read_support_compression_all.c \ |
3194 | + libarchive/archive_read_support_compression_bzip2.c \ |
3195 | + libarchive/archive_read_support_compression_compress.c \ |
3196 | + libarchive/archive_read_support_compression_gzip.c \ |
3197 | + libarchive/archive_read_support_compression_none.c \ |
3198 | + libarchive/archive_read_support_compression_program.c \ |
3199 | + libarchive/archive_read_support_compression_rpm.c \ |
3200 | + libarchive/archive_read_support_compression_uu.c \ |
3201 | + libarchive/archive_read_support_compression_xz.c \ |
3202 | + libarchive/archive_read_support_format_all.c \ |
3203 | + libarchive/archive_read_support_format_ar.c \ |
3204 | + libarchive/archive_read_support_format_cpio.c \ |
3205 | + libarchive/archive_read_support_format_empty.c \ |
3206 | + libarchive/archive_read_support_format_iso9660.c \ |
3207 | + libarchive/archive_read_support_format_mtree.c \ |
3208 | + libarchive/archive_read_support_format_raw.c \ |
3209 | + libarchive/archive_read_support_format_tar.c \ |
3210 | + libarchive/archive_read_support_format_xar.c \ |
3211 | + libarchive/archive_read_support_format_zip.c \ |
3212 | + libarchive/archive_string.c \ |
3213 | + libarchive/archive_string.h \ |
3214 | + libarchive/archive_string_sprintf.c \ |
3215 | + libarchive/archive_util.c \ |
3216 | + libarchive/archive_virtual.c \ |
3217 | + libarchive/archive_write.c \ |
3218 | + libarchive/archive_write_disk.c \ |
3219 | + libarchive/archive_write_disk_private.h \ |
3220 | + libarchive/archive_write_disk_set_standard_lookup.c \ |
3221 | + libarchive/archive_write_open_fd.c \ |
3222 | + libarchive/archive_write_open_file.c \ |
3223 | + libarchive/archive_write_open_filename.c \ |
3224 | + libarchive/archive_write_open_memory.c \ |
3225 | + libarchive/archive_write_private.h \ |
3226 | + libarchive/archive_write_set_compression_bzip2.c \ |
3227 | + libarchive/archive_write_set_compression_compress.c \ |
3228 | + libarchive/archive_write_set_compression_gzip.c \ |
3229 | + libarchive/archive_write_set_compression_none.c \ |
3230 | + libarchive/archive_write_set_compression_program.c \ |
3231 | + libarchive/archive_write_set_compression_xz.c \ |
3232 | + libarchive/archive_write_set_format.c \ |
3233 | + libarchive/archive_write_set_format_ar.c \ |
3234 | + libarchive/archive_write_set_format_by_name.c \ |
3235 | + libarchive/archive_write_set_format_cpio.c \ |
3236 | + libarchive/archive_write_set_format_cpio_newc.c \ |
3237 | + libarchive/archive_write_set_format_mtree.c \ |
3238 | + libarchive/archive_write_set_format_pax.c \ |
3239 | + libarchive/archive_write_set_format_shar.c \ |
3240 | + libarchive/archive_write_set_format_ustar.c \ |
3241 | + libarchive/archive_write_set_format_zip.c \ |
3242 | + libarchive/config_freebsd.h \ |
3243 | + libarchive/filter_fork.c \ |
3244 | + libarchive/filter_fork.h |
3245 | + |
3246 | +if INC_WINDOWS_FILES |
3247 | +libarchive_la_SOURCES+= \ |
3248 | + libarchive/archive_entry_copy_bhfi.c \ |
3249 | + libarchive/archive_windows.h \ |
3250 | + libarchive/archive_windows.c \ |
3251 | + libarchive/filter_fork_windows.c |
3252 | +endif |
3253 | + |
3254 | +# -no-undefined marks that libarchive doesn't rely on symbols |
3255 | +# defined in the application. This is mandatory for cygwin. |
3256 | +libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION) |
3257 | + |
3258 | +# Manpages to install |
3259 | +libarchive_man_MANS= \ |
3260 | + libarchive/archive_entry.3 \ |
3261 | + libarchive/archive_read.3 \ |
3262 | + libarchive/archive_read_disk.3 \ |
3263 | + libarchive/archive_util.3 \ |
3264 | + libarchive/archive_write.3 \ |
3265 | + libarchive/archive_write_disk.3 \ |
3266 | + libarchive/cpio.5 \ |
3267 | + libarchive/libarchive.3 \ |
3268 | + libarchive/libarchive_internals.3 \ |
3269 | + libarchive/libarchive-formats.5 \ |
3270 | + libarchive/mtree.5 \ |
3271 | + libarchive/tar.5 |
3272 | + |
3273 | +# Additional libarchive files to include in the distribution |
3274 | +libarchive_EXTRA_DIST= \ |
3275 | + libarchive/test/list.h \ |
3276 | + libarchive/archive_windows.c \ |
3277 | + libarchive/archive_windows.h \ |
3278 | + libarchive/filter_fork_windows.c \ |
3279 | + libarchive/CMakeLists.txt \ |
3280 | + $(libarchive_man_MANS) |
3281 | + |
3282 | +# pkgconfig |
3283 | +pkgconfigdir = $(libdir)/pkgconfig |
3284 | +pkgconfig_DATA = build/pkgconfig/libarchive.pc |
3285 | + |
3286 | +# |
3287 | +# |
3288 | +# libarchive_test program |
3289 | +# |
3290 | +# |
3291 | +libarchive_test_SOURCES= \ |
3292 | + $(libarchive_la_SOURCES) \ |
3293 | + libarchive/test/main.c \ |
3294 | + libarchive/test/read_open_memory.c \ |
3295 | + libarchive/test/test.h \ |
3296 | + libarchive/test/test_acl_basic.c \ |
3297 | + libarchive/test/test_acl_freebsd.c \ |
3298 | + libarchive/test/test_acl_pax.c \ |
3299 | + libarchive/test/test_archive_api_feature.c \ |
3300 | + libarchive/test/test_bad_fd.c \ |
3301 | + libarchive/test/test_compat_bzip2.c \ |
3302 | + libarchive/test/test_compat_cpio.c \ |
3303 | + libarchive/test/test_compat_gtar.c \ |
3304 | + libarchive/test/test_compat_gzip.c \ |
3305 | + libarchive/test/test_compat_lzma.c \ |
3306 | + libarchive/test/test_compat_solaris_tar_acl.c \ |
3307 | + libarchive/test/test_compat_tar_hardlink.c \ |
3308 | + libarchive/test/test_compat_xz.c \ |
3309 | + libarchive/test/test_compat_zip.c \ |
3310 | + libarchive/test/test_empty_write.c \ |
3311 | + libarchive/test/test_entry.c \ |
3312 | + libarchive/test/test_extattr_freebsd.c \ |
3313 | + libarchive/test/test_fuzz.c \ |
3314 | + libarchive/test/test_entry_strmode.c \ |
3315 | + libarchive/test/test_link_resolver.c \ |
3316 | + libarchive/test/test_open_fd.c \ |
3317 | + libarchive/test/test_open_file.c \ |
3318 | + libarchive/test/test_open_filename.c \ |
3319 | + libarchive/test/test_pax_filename_encoding.c \ |
3320 | + libarchive/test/test_read_compress_program.c \ |
3321 | + libarchive/test/test_read_data_large.c \ |
3322 | + libarchive/test/test_read_disk.c \ |
3323 | + libarchive/test/test_read_disk_entry_from_file.c \ |
3324 | + libarchive/test/test_read_extract.c \ |
3325 | + libarchive/test/test_read_file_nonexistent.c \ |
3326 | + libarchive/test/test_read_format_ar.c \ |
3327 | + libarchive/test/test_read_format_cpio_bin.c \ |
3328 | + libarchive/test/test_read_format_cpio_bin_Z.c \ |
3329 | + libarchive/test/test_read_format_cpio_bin_be.c \ |
3330 | + libarchive/test/test_read_format_cpio_bin_bz2.c \ |
3331 | + libarchive/test/test_read_format_cpio_bin_gz.c \ |
3332 | + libarchive/test/test_read_format_cpio_bin_lzma.c \ |
3333 | + libarchive/test/test_read_format_cpio_bin_xz.c \ |
3334 | + libarchive/test/test_read_format_cpio_odc.c \ |
3335 | + libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c \ |
3336 | + libarchive/test/test_read_format_cpio_svr4_gzip.c \ |
3337 | + libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c \ |
3338 | + libarchive/test/test_read_format_cpio_svr4c_Z.c \ |
3339 | + libarchive/test/test_read_format_empty.c \ |
3340 | + libarchive/test/test_read_format_gtar_gz.c \ |
3341 | + libarchive/test/test_read_format_gtar_lzma.c \ |
3342 | + libarchive/test/test_read_format_gtar_sparse.c \ |
3343 | + libarchive/test/test_read_format_iso_gz.c \ |
3344 | + libarchive/test/test_read_format_iso_multi_extent.c \ |
3345 | + libarchive/test/test_read_format_isojoliet_bz2.c \ |
3346 | + libarchive/test/test_read_format_isojoliet_long.c \ |
3347 | + libarchive/test/test_read_format_isojoliet_rr.c \ |
3348 | + libarchive/test/test_read_format_isorr_bz2.c \ |
3349 | + libarchive/test/test_read_format_isorr_ce.c \ |
3350 | + libarchive/test/test_read_format_isorr_new_bz2.c \ |
3351 | + libarchive/test/test_read_format_isorr_rr_moved.c \ |
3352 | + libarchive/test/test_read_format_isozisofs_bz2.c \ |
3353 | + libarchive/test/test_read_format_mtree.c \ |
3354 | + libarchive/test/test_read_format_pax_bz2.c \ |
3355 | + libarchive/test/test_read_format_raw.c \ |
3356 | + libarchive/test/test_read_format_tar.c \ |
3357 | + libarchive/test/test_read_format_tar_empty_filename.c \ |
3358 | + libarchive/test/test_read_format_tbz.c \ |
3359 | + libarchive/test/test_read_format_tgz.c \ |
3360 | + libarchive/test/test_read_format_tlz.c \ |
3361 | + libarchive/test/test_read_format_txz.c \ |
3362 | + libarchive/test/test_read_format_tz.c \ |
3363 | + libarchive/test/test_read_format_xar.c \ |
3364 | + libarchive/test/test_read_format_zip.c \ |
3365 | + libarchive/test/test_read_large.c \ |
3366 | + libarchive/test/test_read_pax_truncated.c \ |
3367 | + libarchive/test/test_read_position.c \ |
3368 | + libarchive/test/test_read_truncated.c \ |
3369 | + libarchive/test/test_read_uu.c \ |
3370 | + libarchive/test/test_tar_filenames.c \ |
3371 | + libarchive/test/test_tar_large.c \ |
3372 | + libarchive/test/test_ustar_filenames.c \ |
3373 | + libarchive/test/test_write_compress.c \ |
3374 | + libarchive/test/test_write_compress_bzip2.c \ |
3375 | + libarchive/test/test_write_compress_gzip.c \ |
3376 | + libarchive/test/test_write_compress_lzma.c \ |
3377 | + libarchive/test/test_write_compress_program.c \ |
3378 | + libarchive/test/test_write_compress_xz.c \ |
3379 | + libarchive/test/test_write_disk.c \ |
3380 | + libarchive/test/test_write_disk_failures.c \ |
3381 | + libarchive/test/test_write_disk_hardlink.c \ |
3382 | + libarchive/test/test_write_disk_perms.c \ |
3383 | + libarchive/test/test_write_disk_secure.c \ |
3384 | + libarchive/test/test_write_disk_sparse.c \ |
3385 | + libarchive/test/test_write_disk_symlink.c \ |
3386 | + libarchive/test/test_write_disk_times.c \ |
3387 | + libarchive/test/test_write_format_ar.c \ |
3388 | + libarchive/test/test_write_format_cpio.c \ |
3389 | + libarchive/test/test_write_format_cpio_empty.c \ |
3390 | + libarchive/test/test_write_format_cpio_odc.c \ |
3391 | + libarchive/test/test_write_format_cpio_newc.c \ |
3392 | + libarchive/test/test_write_format_mtree.c \ |
3393 | + libarchive/test/test_write_format_pax.c \ |
3394 | + libarchive/test/test_write_format_shar_empty.c \ |
3395 | + libarchive/test/test_write_format_tar.c \ |
3396 | + libarchive/test/test_write_format_tar_empty.c \ |
3397 | + libarchive/test/test_write_format_tar_ustar.c \ |
3398 | + libarchive/test/test_write_format_zip.c \ |
3399 | + libarchive/test/test_write_format_zip_empty.c \ |
3400 | + libarchive/test/test_write_format_zip_no_compression.c \ |
3401 | + libarchive/test/test_write_open_memory.c |
3402 | + |
3403 | +libarchive_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS) |
3404 | + |
3405 | +# The "list.h" file just lists all of the tests defined in all of the sources. |
3406 | +# Building it automatically provides a sanity-check on libarchive_test_SOURCES |
3407 | +# above. |
3408 | +libarchive/test/list.h: Makefile |
3409 | + cat $(top_srcdir)/libarchive/test/test_*.c | grep DEFINE_TEST > libarchive/test/list.h |
3410 | + |
3411 | +libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test |
3412 | + |
3413 | +libarchive_test_EXTRA_DIST=\ |
3414 | + libarchive/test/test_compat_bzip2_1.tbz.uu \ |
3415 | + libarchive/test/test_compat_bzip2_2.tbz.uu \ |
3416 | + libarchive/test/test_compat_cpio_1.cpio.uu \ |
3417 | + libarchive/test/test_compat_gtar_1.tar.uu \ |
3418 | + libarchive/test/test_compat_gzip_1.tgz.uu \ |
3419 | + libarchive/test/test_compat_gzip_2.tgz.uu \ |
3420 | + libarchive/test/test_compat_lzma_1.tlz.uu \ |
3421 | + libarchive/test/test_compat_lzma_2.tlz.uu \ |
3422 | + libarchive/test/test_compat_lzma_3.tlz.uu \ |
3423 | + libarchive/test/test_compat_solaris_tar_acl.tar.uu \ |
3424 | + libarchive/test/test_compat_tar_hardlink_1.tar.uu \ |
3425 | + libarchive/test/test_compat_xz_1.txz.uu \ |
3426 | + libarchive/test/test_compat_zip_1.zip.uu \ |
3427 | + libarchive/test/test_fuzz_1.iso.Z.uu \ |
3428 | + libarchive/test/test_pax_filename_encoding.tar.uu \ |
3429 | + libarchive/test/test_read_format_ar.ar.uu \ |
3430 | + libarchive/test/test_read_format_cpio_bin_be.cpio.uu \ |
3431 | + libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu \ |
3432 | + libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu \ |
3433 | + libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu \ |
3434 | + libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu \ |
3435 | + libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu \ |
3436 | + libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu \ |
3437 | + libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu \ |
3438 | + libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu \ |
3439 | + libarchive/test/test_read_format_iso.iso.Z.uu \ |
3440 | + libarchive/test/test_read_format_iso_joliet.iso.Z.uu \ |
3441 | + libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu \ |
3442 | + libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu \ |
3443 | + libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu \ |
3444 | + libarchive/test/test_read_format_iso_rockridge.iso.Z.uu \ |
3445 | + libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu \ |
3446 | + libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu \ |
3447 | + libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu\ |
3448 | + libarchive/test/test_read_format_iso_zisofs.iso.Z.uu \ |
3449 | + libarchive/test/test_read_format_mtree.mtree.uu \ |
3450 | + libarchive/test/test_read_format_raw.data.Z.uu \ |
3451 | + libarchive/test/test_read_format_raw.data.uu \ |
3452 | + libarchive/test/test_read_format_tar_empty_filename.tar.uu \ |
3453 | + libarchive/test/test_read_format_zip.zip.uu \ |
3454 | + libarchive/test/CMakeLists.txt \ |
3455 | + libarchive/test/README |
3456 | + |
3457 | +# |
3458 | +# Common code for libarchive frontends (cpio, tar) |
3459 | +# |
3460 | +libarchive_fe_la_SOURCES= \ |
3461 | + libarchive_fe/err.c \ |
3462 | + libarchive_fe/err.h \ |
3463 | + libarchive_fe/lafe_platform.h \ |
3464 | + libarchive_fe/line_reader.c \ |
3465 | + libarchive_fe/line_reader.h \ |
3466 | + libarchive_fe/matching.c \ |
3467 | + libarchive_fe/matching.h \ |
3468 | + libarchive_fe/pathmatch.c \ |
3469 | + libarchive_fe/pathmatch.h |
3470 | + |
3471 | +# |
3472 | +# |
3473 | +# bsdtar source, docs, etc. |
3474 | +# |
3475 | +# |
3476 | + |
3477 | +bsdtar_SOURCES= \ |
3478 | + tar/bsdtar.c \ |
3479 | + tar/bsdtar.h \ |
3480 | + tar/bsdtar_platform.h \ |
3481 | + tar/cmdline.c \ |
3482 | + tar/getdate.c \ |
3483 | + tar/read.c \ |
3484 | + tar/subst.c \ |
3485 | + tar/tree.c \ |
3486 | + tar/tree.h \ |
3487 | + tar/util.c \ |
3488 | + tar/write.c |
3489 | + |
3490 | +if INC_WINDOWS_FILES |
3491 | +bsdtar_SOURCES+= \ |
3492 | + tar/bsdtar_windows.h \ |
3493 | + tar/bsdtar_windows.c |
3494 | +endif |
3495 | + |
3496 | +bsdtar_DEPENDENCIES= libarchive.la libarchive_fe.la |
3497 | + |
3498 | +if STATIC_BSDTAR |
3499 | +bsdtar_ldstatic= -static |
3500 | +bsdtar_ccstatic= -DLIBARCHIVE_STATIC |
3501 | +else |
3502 | +bsdtar_ldstatic= |
3503 | +bsdtar_ccstatic= |
3504 | +endif |
3505 | + |
3506 | +bsdtar_LDADD= libarchive.la libarchive_fe.la |
3507 | +bsdtar_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdtar_ccstatic) $(PLATFORMCPPFLAGS) |
3508 | +bsdtar_LDFLAGS= $(bsdtar_ldstatic) |
3509 | + |
3510 | +bsdtar_EXTRA_DIST= \ |
3511 | + tar/bsdtar.1 \ |
3512 | + tar/bsdtar_windows.h \ |
3513 | + tar/bsdtar_windows.c \ |
3514 | + tar/CMakeLists.txt \ |
3515 | + tar/config_freebsd.h \ |
3516 | + tar/test/list.h |
3517 | + |
3518 | + |
3519 | +if BUILD_BSDTAR |
3520 | +bsdtar_man_MANS= tar/bsdtar.1 |
3521 | +bsdtar_programs= bsdtar |
3522 | +else |
3523 | +bsdtar_man_MANS= |
3524 | +bsdtar_programs= |
3525 | +endif |
3526 | + |
3527 | +# |
3528 | +# bsdtar_test |
3529 | +# |
3530 | + |
3531 | +bsdtar_test_SOURCES= \ |
3532 | + tar/getdate.c \ |
3533 | + tar/test/main.c \ |
3534 | + tar/test/test.h \ |
3535 | + tar/test/test_0.c \ |
3536 | + tar/test/test_basic.c \ |
3537 | + tar/test/test_copy.c \ |
3538 | + tar/test/test_empty_mtree.c \ |
3539 | + tar/test/test_getdate.c \ |
3540 | + tar/test/test_help.c \ |
3541 | + tar/test/test_option_T_upper.c \ |
3542 | + tar/test/test_option_q.c \ |
3543 | + tar/test/test_option_r.c \ |
3544 | + tar/test/test_option_s.c \ |
3545 | + tar/test/test_patterns.c \ |
3546 | + tar/test/test_stdio.c \ |
3547 | + tar/test/test_strip_components.c \ |
3548 | + tar/test/test_symlink_dir.c \ |
3549 | + tar/test/test_version.c \ |
3550 | + tar/test/test_windows.c |
3551 | + |
3552 | +# For now, bsdtar_test uses Windows shims from tar/bsdtar_windows.* |
3553 | +if INC_WINDOWS_FILES |
3554 | +bsdtar_test_SOURCES+= \ |
3555 | + tar/bsdtar_windows.h \ |
3556 | + tar/bsdtar_windows.c |
3557 | +endif |
3558 | + |
3559 | +bsdtar_test_CPPFLAGS=\ |
3560 | + -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \ |
3561 | + -I$(top_srcdir)/tar -I$(top_builddir)/tar/test \ |
3562 | + $(PLATFORMCPPFLAGS) |
3563 | + |
3564 | +tar/test/list.h: Makefile |
3565 | + cat $(top_srcdir)/tar/test/test_*.c | grep DEFINE_TEST > tar/test/list.h |
3566 | + |
3567 | +if BUILD_BSDTAR |
3568 | +bsdtar_test_programs= bsdtar_test |
3569 | +bsdtar_TESTS_ENVIRONMENT= BSDTAR=`cd $(top_builddir);/bin/pwd`/bsdtar$(EXEEXT) BSDTAR_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/tar/test |
3570 | +else |
3571 | +bsdtar_test_programs= |
3572 | +bsdtar_TESTS_ENVIRONMENT= |
3573 | +endif |
3574 | + |
3575 | +bsdtar_test_EXTRA_DIST= \ |
3576 | + tar/test/test_patterns_2.tar.uu \ |
3577 | + tar/test/test_patterns_3.tar.uu \ |
3578 | + tar/test/test_patterns_4.tar.uu \ |
3579 | + tar/test/CMakeLists.txt |
3580 | + |
3581 | + |
3582 | +# |
3583 | +# |
3584 | +# bsdcpio source, docs, etc. |
3585 | +# |
3586 | +# |
3587 | + |
3588 | +bsdcpio_SOURCES= \ |
3589 | + cpio/cmdline.c \ |
3590 | + cpio/cpio.c \ |
3591 | + cpio/cpio.h \ |
3592 | + cpio/cpio_platform.h |
3593 | + |
3594 | +if INC_WINDOWS_FILES |
3595 | +bsdcpio_SOURCES+= \ |
3596 | + cpio/cpio_windows.h \ |
3597 | + cpio/cpio_windows.c |
3598 | +endif |
3599 | + |
3600 | +bsdcpio_DEPENDENCIES = libarchive.la libarchive_fe.la |
3601 | + |
3602 | + |
3603 | +if STATIC_BSDCPIO |
3604 | +bsdcpio_ldstatic= -static |
3605 | +bsdcpio_ccstatic= -DLIBARCHIVE_STATIC |
3606 | +else |
3607 | +bsdcpio_ldstatic= |
3608 | +bsdcpio_ccstatic= |
3609 | +endif |
3610 | + |
3611 | +bsdcpio_LDADD= libarchive_fe.la libarchive.la |
3612 | +bsdcpio_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdcpio_ccstatic) $(PLATFORMCPPFLAGS) |
3613 | +bsdcpio_LDFLAGS= $(bsdcpio_ldstatic) |
3614 | + |
3615 | +bsdcpio_EXTRA_DIST= \ |
3616 | + cpio/test/list.h \ |
3617 | + cpio/bsdcpio.1 \ |
3618 | + cpio/cpio_windows.h \ |
3619 | + cpio/cpio_windows.c \ |
3620 | + cpio/CMakeLists.txt \ |
3621 | + cpio/config_freebsd.h |
3622 | + |
3623 | + |
3624 | +if BUILD_BSDCPIO |
3625 | +# Manpages to install |
3626 | +bsdcpio_man_MANS= cpio/bsdcpio.1 |
3627 | +bsdcpio_programs= bsdcpio |
3628 | +else |
3629 | +bsdcpio_man_MANS= |
3630 | +bsdcpio_programs= |
3631 | +endif |
3632 | + |
3633 | +# |
3634 | +# bsdcpio_test |
3635 | +# |
3636 | + |
3637 | +bsdcpio_test_SOURCES= \ |
3638 | + cpio/cmdline.c \ |
3639 | + cpio/test/main.c \ |
3640 | + cpio/test/test.h \ |
3641 | + cpio/test/test_0.c \ |
3642 | + cpio/test/test_basic.c \ |
3643 | + cpio/test/test_cmdline.c \ |
3644 | + cpio/test/test_format_newc.c \ |
3645 | + cpio/test/test_gcpio_compat.c \ |
3646 | + cpio/test/test_option_B_upper.c \ |
3647 | + cpio/test/test_option_C_upper.c \ |
3648 | + cpio/test/test_option_J_upper.c \ |
3649 | + cpio/test/test_option_L_upper.c \ |
3650 | + cpio/test/test_option_Z_upper.c \ |
3651 | + cpio/test/test_option_a.c \ |
3652 | + cpio/test/test_option_c.c \ |
3653 | + cpio/test/test_option_d.c \ |
3654 | + cpio/test/test_option_f.c \ |
3655 | + cpio/test/test_option_help.c \ |
3656 | + cpio/test/test_option_l.c \ |
3657 | + cpio/test/test_option_lzma.c \ |
3658 | + cpio/test/test_option_m.c \ |
3659 | + cpio/test/test_option_t.c \ |
3660 | + cpio/test/test_option_u.c \ |
3661 | + cpio/test/test_option_version.c \ |
3662 | + cpio/test/test_option_y.c \ |
3663 | + cpio/test/test_option_z.c \ |
3664 | + cpio/test/test_owner_parse.c \ |
3665 | + cpio/test/test_passthrough_dotdot.c \ |
3666 | + cpio/test/test_passthrough_reverse.c \ |
3667 | + cpio/test/test_pathmatch.c |
3668 | + |
3669 | +bsdcpio_test_CPPFLAGS= \ |
3670 | + -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \ |
3671 | + -I$(top_srcdir)/cpio -I$(top_builddir)/cpio/test \ |
3672 | + $(PLATFORMCPPFLAGS) |
3673 | +bsdcpio_test_LDADD=libarchive_fe.la |
3674 | + |
3675 | +cpio/test/list.h: Makefile |
3676 | + cat $(top_srcdir)/cpio/test/test_*.c | grep DEFINE_TEST > cpio/test/list.h |
3677 | + |
3678 | +if BUILD_BSDCPIO |
3679 | +bsdcpio_test_programs= bsdcpio_test |
3680 | +bsdcpio_TESTS_ENVIRONMENT= BSDCPIO=`cd $(top_builddir);/bin/pwd`/bsdcpio$(EXEEXT) BSDCPIO_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/cpio/test |
3681 | +else |
3682 | +bsdcpio_test_programs= |
3683 | +bsdcpio_TESTS_ENVIRONMENT= |
3684 | +endif |
3685 | + |
3686 | +bsdcpio_test_EXTRA_DIST= \ |
3687 | + cpio/test/test_gcpio_compat_ref.bin.uu \ |
3688 | + cpio/test/test_gcpio_compat_ref.crc.uu \ |
3689 | + cpio/test/test_gcpio_compat_ref.newc.uu \ |
3690 | + cpio/test/test_gcpio_compat_ref.ustar.uu \ |
3691 | + cpio/test/test_gcpio_compat_ref_nosym.bin.uu \ |
3692 | + cpio/test/test_gcpio_compat_ref_nosym.crc.uu \ |
3693 | + cpio/test/test_gcpio_compat_ref_nosym.newc.uu \ |
3694 | + cpio/test/test_gcpio_compat_ref_nosym.ustar.uu \ |
3695 | + cpio/test/test_option_f.cpio.uu \ |
3696 | + cpio/test/test_option_m.cpio.uu \ |
3697 | + cpio/test/test_option_t.cpio.uu \ |
3698 | + cpio/test/test_option_t.stdout.uu \ |
3699 | + cpio/test/test_option_tv.stdout.uu \ |
3700 | + cpio/test/CMakeLists.txt |
3701 | |
3702 | === added file 'src/libarchive/NEWS' |
3703 | --- src/libarchive/NEWS 1970-01-01 00:00:00 +0000 |
3704 | +++ src/libarchive/NEWS 2012-02-10 20:09:18 +0000 |
3705 | @@ -0,0 +1,545 @@ |
3706 | +Jun 30, 2010: libarchive 2.8.4 released |
3707 | +Jun 30, 2010: Improved reliability of hash function detection |
3708 | +Jun 30, 2010: Fix issues on ancient FreeBSD, QNX, ancient NetBSD and Minux |
3709 | + |
3710 | +Mar 14, 2010: libarchive 2.8.3 released |
3711 | +Mar 14, 2010: Symlink dereference fix for Linux broke the build there; corrected. |
3712 | + |
3713 | +Mar 14, 2010: libarchive 2.8.2 released |
3714 | +Mar 12, 2010: Fix NULL deference for short self-extracting zip archives. |
3715 | +Mar 12, 2010: Don't dereference symlinks on Linux when reading ACLs. |
3716 | +Mar 07, 2010: Better detection of SHA2 support for old OpenSSL versions. |
3717 | +Mar 07, 2010: Fix parsing of input files for bsdtar -T. |
3718 | +Mar 07, 2010: Do not leak setup_xattr into the global namespace. |
3719 | + |
3720 | +Mar 06, 2010: libarchive 2.8.1 released |
3721 | +Mar 06, 2010: Fix build when an older libarchive is already installed |
3722 | +Mar 03, 2010: Use O_BINARY opening files in bsdtar |
3723 | +Mar 02, 2010: Include missing archive_crc32.h |
3724 | +Mar 01, 2010: Correctly include iconv.h required by libxml2. |
3725 | + |
3726 | +Feb 04, 2010: libarchive 2.8.0 released |
3727 | +Jan 17, 2010: Fix error handling for 'echo nonexistent | cpio -o' |
3728 | +Jan 17, 2010: Don't use futimes() on Cygwin |
3729 | + |
3730 | +Jan 02, 2010: libarchive 2.7.902a released (test release for 2.8) |
3731 | +Jan 02, 2010: Fix tar/test/test_windows on MinGW |
3732 | +Jan 02, 2010: Fix memory leaks in libarchive tests |
3733 | +Jan 01, 2010: Fix memory leak when filter startup fails |
3734 | + |
3735 | +Dec 27, 2009: libarchive 2.7.901a released (test release for 2.8) |
3736 | + |
3737 | +Aug 04, 2009: libarchive 2.7.1 released |
3738 | +Jul 20, 2009: Suppress bogus warning about unxz |
3739 | +Jul 19, 2009: Support Cygwin 1.7 |
3740 | +Jun 11, 2009: Support lzma/xz files compressed with larger buffer sizes. |
3741 | +May 24, 2009: Handle gzip files signed with OpenBSD "gzsig" program. |
3742 | +May 07, 2009: Avoid false failures when reading from pipe. |
3743 | + |
3744 | +Apr 16, 2009: libarchive 2.7.0 released |
3745 | + |
3746 | +Apr 10, 2009: libarchive 2.6.992a released |
3747 | +Apr 09, 2009: Fix SIGPIPE issue building with MSVC. |
3748 | +Apr 09, 2009: Fix several minor memory leaks in libarchive and libarchive_test |
3749 | + |
3750 | +Apr 08, 2009: libarchive 2.6.991a released |
3751 | +Apr 07, 2009: Additional tests added to bsdcpio_test |
3752 | + |
3753 | +Apr 01, 2009: libarchive 2.6.990a released |
3754 | +Apr 01, 2009: Use command-line gunzip, bunzip2, unxz, unlzma for |
3755 | + decompression if the library is built without suitable |
3756 | + libraries. The setup functions return ARCHIVE_WARN |
3757 | + in this case so clients can adapt if necessary. |
3758 | +Apr 01, 2009: Use getpw*_r and getgr*_r functions for thread-safety. |
3759 | +Mar 24, 2009: Add archive_read_next_header2(), which is up to 25% |
3760 | + more efficient for some clients; from Brian Harring. |
3761 | +Mar 22, 2009: PDF versions of manpages are now included in the distribution. |
3762 | +Mar, 2009: Major work to improve Cygwin build by Charles Wilson. |
3763 | +Feb/Mar, 2009: Major work on cmake build support, mostly by Michihiro NAKAJIMA. |
3764 | +Feb/Mar, 2009: Major work on Visual Studio support by Michihiro NAKAJIMA. |
3765 | + All tests now pass. |
3766 | +Feb 25, 2009: Fix Debian Bug #516577 |
3767 | +Feb 21, 2009: Yacc is no longer needed to build; date parser rewritten in C. |
3768 | +Jan/Feb, 2009: Mtree work by Michihiro. |
3769 | +Feb, 2009: Joliet support by Andreas Henriksson. |
3770 | +Jan/Feb, 2009: New options framework by Michihiro. |
3771 | +Feb, 2009: High-res timestamps on Tru64, AIX, and GNU Hurd, by Björn Jacke. |
3772 | +Jan 18, 2009: Extended attributes work on FreeBSD and Linux now with pax format. |
3773 | +Jan 07, 2009: New archive_read_disk_entry_from_file() knows about ACLs, |
3774 | + extended attributes, etc so that bsdtar and bsdcpio don't require |
3775 | + such system-specific knowledge. |
3776 | +Jan 03, 2009: Read filter system extensively refactored. In particular, |
3777 | + read filter pipelines are now built out automatically and individual |
3778 | + filters should be much easier to implement. Documentation on the |
3779 | + Googlecode Wiki explains how to implement new filters. |
3780 | +Dec 28, 2008: Many Windows/Visual Studio fixes from Michihiro NAKAJIMA. |
3781 | + |
3782 | +Dec 28, 2008: Main libarchive development moved from FreeBSD Perforce |
3783 | + server to Google Code. This should make it easier for more |
3784 | + people to participate in libarchive development. |
3785 | + |
3786 | +Dec 28, 2008: libarchive 2.6.0 released |
3787 | +Dec 25, 2008: libarchive 2.5.905a released |
3788 | +Dec 10, 2008: libarchive 2.5.904a released |
3789 | +Dec 04, 2008: libarchive 2.5.903a released |
3790 | +Nov 09, 2008: libarchive 2.5.902a released |
3791 | +Nov 08, 2008: libarchive 2.5.901a released |
3792 | +Nov 08, 2008: Start of pre-release testing for libarchive 2.6 |
3793 | + |
3794 | +Nov 07, 2008: Read filter refactor: The decompression routines just |
3795 | + consume and produce arbitrarily-sized blocks. The reblocking |
3796 | + from read_support_compression_none() has been pulled into the |
3797 | + read core. Also, the decompression bid now makes multiple |
3798 | + passes and stacks read filters. |
3799 | +Oct 21, 2008: bsdcpio: New command-line parser. |
3800 | +Oct 19, 2008: Internal read_ahead change: short reads are now an error |
3801 | +Oct 06, 2008: bsdtar: option parser no longer uses getopt_long(), |
3802 | + gives consistent option parsing on all platforms. |
3803 | +Sep 19, 2008: Jaakko Heinonen: shar utility built on libarchive |
3804 | +Sep 17, 2008: Pedro Giffuni: birthtime support |
3805 | +Sep 17, 2008: Miklos Vajna: lzma reader and test. Note: I still have |
3806 | + some concerns about the auto-detection (LZMA file format |
3807 | + doesn't support auto-detection well), so this is not yet |
3808 | + enabled under archive_read_support_compression_all(). For |
3809 | + now, you must call archive_read_support_compression_lzma() if |
3810 | + you want LZMA read support. |
3811 | +Sep 11, 2008: Ivailo Petrov: Many fixes to Windows build, new solution files |
3812 | +Jul 26, 2008: archive_entry now tracks which values have not been set. |
3813 | + This helps zip extraction (file size is often "unknown") and |
3814 | + time restores (tar usually doesn't know atime). |
3815 | +Jul 26, 2008: Joerg Sonnenberger: Performance improvements to shar writer |
3816 | +Jul 25, 2008: Joerg Sonnenberger: mtree write support |
3817 | + |
3818 | +Jul 02, 2008: libarchive 2.5.5 released |
3819 | + |
3820 | +Jul 02, 2008: libarchive 2.5.5b released |
3821 | +Jul 01, 2008: bsdcpio is being used by enough people, we can call it 1.0.0 now |
3822 | +Jun 20, 2008: bsdcpio: If a -l link fails with EXDEV, copy the file instead |
3823 | +Jun 19, 2008: bsdcpio: additional long options for better GNU cpio compat |
3824 | +Jun 15, 2008: Many small portability and bugfixes since 2.5.4b. |
3825 | + |
3826 | +May 25, 2008: libarchive 2.5.4b released |
3827 | +May 21, 2008: Joerg Sonnenberger: fix bsdtar hardlink handling for newc format |
3828 | + |
3829 | +May 21, 2008: More progress on Windows building. Thanks to "Scott" |
3830 | + for the Windows makefiles, thanks to Kees Zeelenberg for |
3831 | + code contributions. |
3832 | + |
3833 | +May 21, 2008: Fix a number of non-exploitable integer and buffer overflows, |
3834 | + thanks to David Remahl at Apple for pointing these out. |
3835 | + |
3836 | +May 21, 2008: Colin Percival: SIGINFO or SIGUSR1 to bsdtar prints progress info |
3837 | + |
3838 | +May 16, 2008: bsdtar's test harness no longer depends on file ordering. |
3839 | + This was causing spurious test failures on a lot of systems. |
3840 | + Thanks to Bernhard R. Link for the diagnosis. |
3841 | + |
3842 | +May 14, 2008: Joerg Sonnenberger: -s substitution support for bsdtar |
3843 | + |
3844 | +May 13, 2008: Joerg Sonnenberger: Many mtree improvements |
3845 | + |
3846 | +May 11, 2008: Joerg Sonnenberger: fix hardlink extraction when |
3847 | + hardlinks have different permissions from original file |
3848 | + |
3849 | +April 30, 2008: Primary libarchive work has been moved into the FreeBSD |
3850 | + project's Perforce repository: http://perforce.freebsd.org/ |
3851 | + The libarchive project can be browsed at |
3852 | + //depot/user/kientzle/libarchive-portable |
3853 | + Direct link: http://preview.tinyurl.com/46mdgr |
3854 | + |
3855 | +May 04, 2008: libarchive 2.5.3b released |
3856 | + * libarchive: Several fixes to link resolver to address bsdcpio crashes |
3857 | + * bsdcpio: -p hardlink handling fixes |
3858 | + * tar/pax: Ensure ustar dirnames end in '/'; be more careful about |
3859 | + measuring filenames when deciding what pathname fields to use |
3860 | + * libarchive: Mark which entry strings are set; be accurate about |
3861 | + distinguishing empty strings ("") from unset ones (NULL) |
3862 | + * tar: Don't crash reading entries with empty filenames |
3863 | + * libarchive_test, bsdtar_test, bsdcpio_test: Better detaults: |
3864 | + run all tests, delete temp dirs, summarize repeated failures |
3865 | + * -no-undefined to libtool for Cygwin |
3866 | + * libarchive_test: Skip large file tests on systems with 32-bit off_t |
3867 | + * iso9660: Don't bother trying to find the body of an empty file; |
3868 | + this works around strange behavior from some ISO9660 writers |
3869 | + * tar: allow -r -T to be used together |
3870 | + * tar: allow --format with -r or -u |
3871 | + * libarchive: Don't build archive.h |
3872 | + |
3873 | +May 04, 2008: Simplified building: archive.h is no longer constructed |
3874 | + This may require additional #if conditionals on some platforms. |
3875 | + |
3876 | +Mar 30, 2008: libarchive 2.5.1b released |
3877 | + |
3878 | +Mar 15, 2008: libarchive 2.5.0b released |
3879 | +Mar 15, 2008: bsdcpio now seems to correctly write hardlinks into newc, |
3880 | + ustar, and old cpio archives. Just a little more testing before |
3881 | + bsdcpio 1.0 becomes a reality. |
3882 | +Mar 15, 2008: I think the new linkify() interface is finally handling |
3883 | + all known hardlink strategies. |
3884 | +Mar 15, 2008: Mtree read fixes from Joerg Sonnenberger. |
3885 | +Mar 15, 2008: Many new bsdtar and bsdcpio options from Joerg Sonnenberger. |
3886 | +Mar 15, 2008: test harnesses no longer require uudecode; they |
3887 | + now have built-in decoding logic that decodes the reference |
3888 | + files as they are needed. |
3889 | + |
3890 | +Mar 14, 2008: libarchive 2.4.14 released; identical to 2.4.13 except for |
3891 | + a point fix for gname/uname mixup in pax format that was introduced |
3892 | + with the UTF-8 fixes. |
3893 | + |
3894 | +Feb 26, 2008: libarchive 2.4.13 released |
3895 | +Feb 25, 2008: Handle path, linkname, gname, or uname that can't be converted |
3896 | + to/from UTF-8. Implement "hdrcharset" attribute from SUS-2008. |
3897 | +Feb 25, 2008: Fix name clash on NetBSD. |
3898 | +Feb 18, 2008: Fix writing empty 'ar' archives, per Kai Wang |
3899 | +Feb 18, 2008: [bsdtar] Permit appending on block devices. |
3900 | +Feb 09, 2008: New "linkify" resolver to help with newc hardlink writing; |
3901 | + bsdcpio still needs to be converted to use this. |
3902 | +Feb 02, 2008: Windows compatibility fixes from Ivailo Petrov, Kees Zeelenberg |
3903 | +Jan 30, 2008: Ignore hardlink size for non-POSIX tar archives. |
3904 | + |
3905 | +Jan 22, 2008: libarchive 2.4.12 released |
3906 | +Jan 22, 2008: Fix bad padding when writing symlinks to newc cpio archives. |
3907 | +Jan 22, 2008: Verify bsdcpio_test by getting it to work against GNU cpio 2.9. |
3908 | + bsdcpio_test complains about missing options (-y and -z), format |
3909 | + of informational messages (--version, --help), and a minor formatting |
3910 | + issue in odc format output. After this update, bsdcpio_test uncovered |
3911 | + several more cosmetic issues in bsdcpio, all now fixed. |
3912 | +Jan 22, 2008: Experimental support for self-extracting Zip archives. |
3913 | +Jan 22, 2008: Extend hardlink restore strategy to work correctly with |
3914 | + hardlinks extracted from newc cpio files. (Which store the body |
3915 | + only with the last occurrence of a link.) |
3916 | + |
3917 | +Dec 30, 2007: libarchive 2.4.11 released |
3918 | +Dec 30, 2007: Fixed a compile error in bsdcpio on some systems. |
3919 | + |
3920 | +Dec 29, 2007: libarchive 2.4.10 released |
3921 | +Dec 29, 2007: bsdcpio 0.9.0 is ready for wider use. |
3922 | +Dec 29, 2007: Completed initial test harness for bsdcpio. |
3923 | + |
3924 | +Dec 22, 2007: libarchive 2.4.9 released |
3925 | +Dec 22, 2007: Implement the remaining options for bsdcpio: -a, -q, -L, -f, |
3926 | + pattern selection for -i and -it. |
3927 | + |
3928 | +Dec 13, 2007: libarchive 2.4.8 released |
3929 | +Dec 13, 2007: gzip and bzip2 compression now handle zero-byte writes correctly, |
3930 | + Thanks to Damien Golding for bringing this to my attention. |
3931 | + |
3932 | +Dec 12, 2007: libarchive 2.4.7 released |
3933 | + |
3934 | +Dec 10, 2007: libarchive 2.4.6 released |
3935 | +Dec 09, 2007: tar/test/test_copy.c verifies "tar -c | tar -x" copy pipeline |
3936 | +Dec 07, 2007: Fix a couple of minor memory leaks. |
3937 | + |
3938 | +Dec 04, 2007: libarchive 2.4.5 released |
3939 | +Dec 04, 2007: Fix cpio/test/test_write_odc by setting the umask first. |
3940 | + |
3941 | +Dec 03, 2007: libarchive 2.4.4 released |
3942 | +Dec 03, 2007: New configure options --disable-xattr and --disable-acl, |
3943 | + thanks to Samuli Suominen. |
3944 | + |
3945 | +Dec 03, 2007: libarchive 2.4.3 released |
3946 | +Dec 03, 2007: Thanks to Lapo Luchini for sending me a ZIP file that |
3947 | + libarchive couldn't handle. Fixed a bug in handling of |
3948 | + "length at end" flags in ZIP files. |
3949 | +Dec 03, 2007: Fixed bsdcpio -help, bsdtar -help tests. |
3950 | +Dec 02, 2007: First cut at real bsdtar test harness. |
3951 | + |
3952 | +Dec 02, 2007: libarchive 2.4.2 released |
3953 | + |
3954 | +Dec 02, 2007: libarchive 2.4.1 released |
3955 | +Dec 02, 2007: Minor fixes, rough cut of mdoc-to-man conversion for |
3956 | + man pages. |
3957 | + |
3958 | +Oct 30, 2007: libarchive 2.4.0 released |
3959 | +Oct 30, 2007: Minor compile fix thanks to Joerg Schilling. |
3960 | +Oct 30, 2007: Only run the format auction once at the beginning of the |
3961 | + archive. This is simpler and supports better error recovery. |
3962 | +Oct 29, 2007: Test support for very large entries in tar archives: |
3963 | + libarchive_test now exercises entries from 2GB up to 1TB. |
3964 | + |
3965 | +Oct 27, 2007: libarchive 2.3.5 released |
3966 | +Oct 27, 2007: Correct some unnecessary internal data copying in the |
3967 | + "compression none" reader and writer; this reduces user time |
3968 | + by up to 2/3 in some tests. (Thanks to Jan Psota for |
3969 | + publishing his performance test results to GNU tar's bug-tar |
3970 | + mailing list; those results pointed me towards this problem.) |
3971 | +Oct 27, 2007: Fix for skipping archive entries that are exactly |
3972 | + a multiple of 4G on 32-bit platforms. |
3973 | +Oct 25, 2007: Fix for reading very large (>8G) tar archives; this was |
3974 | + broken when I put in support for new GNU tar sparse formats. |
3975 | +Oct 20, 2007: Initial work on new pattern-matching code for cpio; I |
3976 | + hope this eventually replaces the code currently in bsdtar. |
3977 | + |
3978 | +Oct 08, 2007: libarchive 2.3.4 released |
3979 | +Oct 05, 2007: Continuing work on bsdcpio test suite. |
3980 | +Oct 05, 2007: New cpio.5 manpage, updates to "History" of bsdcpio.1 and |
3981 | + bsdtar.1 manpages. |
3982 | +Oct 05, 2007: Fix zip reader to immediately return EOF if you try |
3983 | + to read body of non-regular file. In particular, this fixes |
3984 | + bsdtar extraction of zip archives. |
3985 | + |
3986 | +Sep 30, 2007: libarchive 2.3.3 released |
3987 | +Sep 26, 2007: Rework Makefile.am so that the enable/disable options |
3988 | + actually do the right things. |
3989 | +Sep 26, 2007: cpio-odc and cpio-newc archives no longer write bodies |
3990 | + for non-regular files. |
3991 | +Sep 26, 2007: Test harness for bsdcpio is in place, needs more tests written. |
3992 | + This is much nicer than the ragtag collection of test scripts |
3993 | + that bsdtar has. |
3994 | + |
3995 | +Sep 20, 2007: libarchive 2.3.2 released |
3996 | +Sep 20, 2007: libarchive 2.3.1 broke bsdtar because the archive_write_data() |
3997 | + fix was implemented incorrectly. |
3998 | + |
3999 | +Sep 16, 2007: libarchive 2.3.1 released |
4000 | +Sep 16, 2007: Many fixes to bsdcpio 0.3: handle hardlinks with -p, recognize |
4001 | + block size on writing, fix a couple of segfaults. |
4002 | +Sep 16, 2007: Fixed return value from archive_write_data() when used |
4003 | + with archive_write_disk() to match the documentation and other |
4004 | + instances of this same function. |
4005 | +Sep 15, 2007: Add archive_entry_link_resolver, archive_entry_strmode |
4006 | + |
4007 | +Sep 11, 2007: libarchive 2.2.8 released |
4008 | +Sep 09, 2007: bsdcpio 0.2 supports most (not yet all) of the old POSIX spec. |
4009 | + |
4010 | +Sep 01, 2007: libarchive 2.2.7 released |
4011 | +Aug 31, 2007: Support for reading mtree files, including an mtree.5 manpage |
4012 | + (A little experimental still.) |
4013 | +Aug 18, 2007: Read gtar 1.17 --posix --sparse entries. |
4014 | +Aug 13, 2007: Refined suid/sgid restore handling; it is no longer |
4015 | + an error if suid/sgid bits are dropped when you request |
4016 | + perm restore but don't request owner restore. |
4017 | +Aug 06, 2007: Use --enable-bsdcpio if you want to try bsdcpio |
4018 | + |
4019 | +Aug 05, 2007: libarchive 2.2.6 released |
4020 | +Aug 05, 2007: New configure option --disable-bsdtar, thanks to Joerg |
4021 | + Sonnenberger. |
4022 | +Aug 05, 2007: Several bug fixes from FreeBSD CVS repo. |
4023 | + |
4024 | +Jul 13, 2007: libarchive 2.2.5 released |
4025 | + |
4026 | +Jul 12, 2007: libarchive 2.2.4 released |
4027 | +Jul 12, 2007: Thanks to Colin Percival's help in diagnosing and |
4028 | + fixing several critical security bugs. Details available at |
4029 | + http://security.freebsd.org/advisories/FreeBSD-SA-07:05.libarchive.asc |
4030 | + |
4031 | +May 26, 2007: libarchive 2.2.3 released |
4032 | +May 26, 2007: Fix memory leaks in ZIP reader and shar writer, add some |
4033 | + missing system headers to archive_entry.h, dead code cleanup |
4034 | + from Colin Percival, more tests for gzip/bzip2, fix an |
4035 | + EOF anomaly in bzip2 decompression. |
4036 | + |
4037 | +May 12, 2007: libarchive 2.2.2 released |
4038 | +May 12, 2007: Fix archive_write_disk permission restore by cloning |
4039 | + entry passed into write_header so that permission info is |
4040 | + still available at finish_entry time. (archive_read_extract() |
4041 | + worked okay because it held onto the passed-in entry, but |
4042 | + direct consumers of archive_write_disk would break). This |
4043 | + required fixing archive_entry_clone(), which now works and has |
4044 | + a reasonably complete test case. |
4045 | +May 10, 2007: Skeletal cpio implementation. |
4046 | + |
4047 | +May 06, 2007: libarchive 2.2.1 released |
4048 | +May 06, 2007: Flesh out a lot more of test_entry.c so as to catch |
4049 | + problems such as the device node breakage before releasing <sigh>. |
4050 | +May 05, 2007: Fix a bad bug introduced in 2.1.9 that broke device |
4051 | + node entries in tar archives. |
4052 | +May 03, 2007: Move 'struct stat' out of archive_entry core as well. |
4053 | + This removes some portability headaches and fixes a bunch |
4054 | + of corner cases that arise when manipulating archives on |
4055 | + dissimilar systems. |
4056 | + |
4057 | +Apr 30, 2007: libarchive 2.1.10 released |
4058 | +Apr 31, 2007: Minor code cleanup. |
4059 | + |
4060 | +Apr 24, 2007: libarchive 2.1.9 released |
4061 | +Apr 24, 2007: Fix some recently-introduced problems with libraries |
4062 | + (Just let automake handle it and it all works much better.) |
4063 | + Finish isolating major()/minor()/makedev() in archive_entry.c. |
4064 | + |
4065 | +Apr 23, 2007: libarchive 2.1.8 released |
4066 | +Apr 23, 2007: Minor fixes found from building on MacOS X |
4067 | + |
4068 | +Apr 22, 2007: libarchive 2.1.7 released |
4069 | +Apr 22, 2007: Eliminated all uses of 'struct stat' from the |
4070 | + format readers/writers. This should improve portability; |
4071 | + 'struct stat' is now only used in archive_entry and in |
4072 | + code that actually touches the disk. |
4073 | + |
4074 | +Apr 17, 2007: libarchive 2.1.6 released |
4075 | + Libarchive now compiles and passes all tests on Interix. |
4076 | + |
4077 | +Apr 16, 2007: libarchive 2.1.5 released |
4078 | + |
4079 | +Apr 15, 2007: libarchive 2.1b2 released |
4080 | +Apr 15, 2007: New libarchive_internals.3 documentation of internal APIs. |
4081 | + Not complete, but should prove helpful. |
4082 | +Apr 15, 2007: Experimental "read_compress_program" and "write_compress_program" |
4083 | + for using libarchive with external compression. Not yet |
4084 | + well tested, and likely has portability issues. Feedback |
4085 | + appreciated. |
4086 | + |
4087 | +Apr 14, 2007: libarchive 2.0.31 released |
4088 | +Apr 14, 2007: More fixes for Interix, more 'ar' work |
4089 | + |
4090 | +Apr 14, 2007: libarchive 2.0.30 released |
4091 | +Apr 13, 2007: libarchive now enforces trailing '/' on dirs |
4092 | + written to tar archives |
4093 | + |
4094 | +Apr 11, 2007: libarchive 2.0.29 released |
4095 | +Apr 11, 2007: Make it easier to statically configure for different platforms. |
4096 | +Apr 11, 2007: Updated config.guess, config.sub, libtool |
4097 | + |
4098 | +Apr 06, 2007: libarchive 2.0.28 released |
4099 | +Apr 06, 2007: 'ar' format read/write support thanks to Kai Wang. |
4100 | + |
4101 | +Apr 01, 2007: libarchive 2.0.27 released |
4102 | +Mar 31, 2007: Several minor fixes from Colin Percival and Joerg Sonnenberger. |
4103 | + |
4104 | +Mar 12, 2007: libarchive 2.0.25 released |
4105 | +Mar 12, 2007: Fix broken --unlink flag. |
4106 | + |
4107 | +Mar 11, 2007: libarchive 2.0.24 released |
4108 | +Mar 10, 2007: Correct an ACL blunder that causes any ACL with an entry |
4109 | + that refers to a non-existent user or group to not be restored correctly. |
4110 | + The fix both makes the parser more tolerant (so that archives created |
4111 | + with the buggy ACLs can be read now) and corrects the ACL formatter. |
4112 | +Mar 10, 2007: More work on test portability to Linux. |
4113 | + |
4114 | +Mar 10, 2007: libarchive 2.0.22 released |
4115 | +Mar 10, 2007: Header cleanups; added linux/fs.h, removed |
4116 | + some unnecessary headers, added #include guards in bsdtar. |
4117 | + If you see any obvious compile failures from this, let me know. |
4118 | +Mar 10, 2007: Work on bsdtar test scripts: not yet robust enough |
4119 | + to enable as part of "make check", but getting better. |
4120 | +Mar 10, 2007: libarchive now returns ARCHIVE_FAILED when |
4121 | + a header write fails in a way that only affects this item. |
4122 | + Less bad than ARCHIVE_FATAL, but worse than ARCHIVE_WARN. |
4123 | + |
4124 | +Mar 07, 2007: libarchive 2.0.21 released |
4125 | +Mar 07, 2007: Add some ACL tests (only for the system-independent |
4126 | + portion of the ACL support for now). |
4127 | +Mar 07, 2007: tar's ability to read ACLs off disk got |
4128 | + turned off for FreeBSD; re-enable it. (ACL restores and |
4129 | + libarchive support for storing/reading ACLs from pax |
4130 | + archives was unaffected.) |
4131 | + |
4132 | +Mar 02, 2007: libarchive 2.0.20 released |
4133 | +Mar 2, 2007: It's not perfect, but it's pretty good. |
4134 | + Libarchive 2.0 is officially out of beta. |
4135 | + |
4136 | +Feb 28, 2007: libarchive 2.0b17 released |
4137 | +Feb 27, 2007: Make the GID restore checks more robust by checking |
4138 | + whether the current user has too few or too many privileges. |
4139 | + |
4140 | +Feb 26, 2007: libarchive 2.0b15 released |
4141 | +Feb 26, 2007: Don't lose symlinks when extracting from ISOs. |
4142 | + Thanks to Diego "Flameeyes" Pettenò for telling me about the |
4143 | + broken testcase on Gentoo that (finally!) led me to the cause |
4144 | + of this long-standing bug. |
4145 | + |
4146 | +Feb 26, 2007: libarchive 2.0b14 released |
4147 | +Feb 26, 2007: Fix a broken test on platforms that lack lchmod(). |
4148 | + |
4149 | +Feb 25, 2007: libarchive 2.0b13 released |
4150 | +Feb 25, 2007: Empty archives were being written as empty files, |
4151 | + without a proper end-of-archive marker. Fixed. |
4152 | + |
4153 | +Feb 23, 2007: libarchive 2.0b12 released |
4154 | +Feb 22, 2007: Basic security checks added: _EXTRACT_SECURE_NODOTDOT |
4155 | + and _EXTRACT_SECURE_SYMLINK. These checks used to be in bsdtar, |
4156 | + but they belong down in libarchive where they can be used by |
4157 | + other tools and where they can be better optimized. |
4158 | + |
4159 | +Feb 11, 2007: libarchive 2.0b11 released |
4160 | +Feb 10, 2007: Fixed a bunch of errors in libarchive's handling |
4161 | + of EXTRACT_PERM and EXTRACT_OWNER, especially relating |
4162 | + to SUID and SGID bits. |
4163 | + |
4164 | +Jan 31, 2007: libarchive 2.0b9 released |
4165 | +Jan 31, 2007: Added read support for "empty" archives as a |
4166 | + distinct archive format. Bsdtar uses this to handle, e.g., |
4167 | + "touch foo.tar; tar -rf foo.tar" |
4168 | + |
4169 | +Jan 22, 2007: libarchive 2.0b6 released |
4170 | +Jan 22, 2007: archive_write_disk API is now in place. It provides |
4171 | + a finer-grained interface than archive_read_extract. In particular, |
4172 | + you can use it to create objects on disk without having an archive |
4173 | + around (just feed it archive_entry objects describing what you |
4174 | + want to create), you can override the uname/gname-to-uid/gid lookups |
4175 | + (minitar uses this to avoid getpwXXX() and getgrXXX() bloat). |
4176 | + |
4177 | +Jan 09, 2007: libarchive 2.0a3 released |
4178 | +Jan 9, 2007: archive_extract is now much better; it handles the |
4179 | + most common cases with a minimal number of system calls. |
4180 | + Some features still need a lot of testing, especially corner |
4181 | + cases involving objects that already exist on disk. I expect |
4182 | + the next round of API overhaul will simplify building test cases. |
4183 | +Jan 9, 2007: a number of fixes thanks to Colin Percival, especially |
4184 | + corrections to the skip() framework and handling of large files. |
4185 | +Jan 9, 2007: Fixes for large ISOs. The code should correctly handle |
4186 | + very large ISOs with entries up to 4G. Thanks to Robert Sciuk |
4187 | + for pointing out these issues. |
4188 | + |
4189 | +Sep 05, 2006: libarchive 1.3.1 released |
4190 | +Sep 5, 2006: Bump version to 1.3 for new I/O wrappers. |
4191 | +Sep 4, 2006: New memory and FILE read/write wrappers. |
4192 | +Sep 4, 2006: libarchive test harness is now minimally functional; |
4193 | + it's located a few minor bugs in error-handling logic |
4194 | + |
4195 | +Aug 17, 2006: libarchive 1.2.54 released |
4196 | +Aug 17, 2006: Outline ABI changes for libarchive 2.0; these |
4197 | + are protected behind #ifdef's until I think I've found everything |
4198 | + that needs to change. |
4199 | +Aug 17, 2006: Fix error-handling in archive_read/write_close() |
4200 | + They weren't returning any errors before. |
4201 | +Aug 17, 2006: Fix recursive-add logic to not trigger if it's not set |
4202 | + Fixes a bug adding files when writing archive to pipe or when |
4203 | + using archive_write_open() directly. |
4204 | +Jul 2006: New "skip" handling improves performance extracting |
4205 | + single files from large uncompressed archives. |
4206 | + |
4207 | +Mar 21, 2006: 1.2.52 released |
4208 | +Mar 21, 2006: Fix -p on platforms that don't have platform-specific |
4209 | + extended attribute code. |
4210 | +Mar 20, 2006: Add NEWS file; fill in some older history from other |
4211 | + files. I'll try to keep this file up-to-date from now on. |
4212 | + |
4213 | +OLDER NEWS SUMMARIES |
4214 | + |
4215 | +Mar 19, 2006: libarchive 1.2.51 released |
4216 | +Mar 18, 2006: Many fixes to extended attribute support, including a redesign |
4217 | + of the storage format to simplify debugging. |
4218 | +Mar 12, 2006: Remove 'tp' support; it was a fun idea, but not worth |
4219 | + spending much time on. |
4220 | +Mar 11, 2006: Incorporated Jaakko Heinonen's still-experimental support |
4221 | + for extended attributes (Currently Linux-only.). |
4222 | +Mar 11, 2006: Reorganized distribution package: There is now one tar.gz |
4223 | + file that builds both libarchive and bsdtar. |
4224 | +Feb 13, 2006: Minor bug fixes: correctly read cpio device entries, write |
4225 | + Pax attribute entry names. |
4226 | +Nov 7, 2005: Experimental 'tp' format support in libarchive. Feedback |
4227 | + appreciated; this is not enabled by archive_read_support_format_all() |
4228 | + yet as I'm not quite content with the format detection heuristics. |
4229 | +Nov 7, 2005: Some more portability improvements thanks to Darin Broady, |
4230 | + minor bugfixes. |
4231 | +Oct 12, 2005: Use GNU libtool to build shared libraries on many systems. |
4232 | +Aug 9, 2005: Correctly detect that MacOS X does not have POSIX ACLs. |
4233 | +Apr 17, 2005: Kees Zeelenberg has ported libarchive and bsdtar to Windows: |
4234 | + http://gnuwin32.sourceforge.net/ |
4235 | +Apr 11, 2005: Extended Zip/Zip64 support thanks to Dan Nelson. -L/-h |
4236 | + fix from Jaakko Heinonen. |
4237 | +Mar 12, 2005: archive_read_extract can now handle very long |
4238 | + pathnames (I've tested with pathnames up to 1MB). |
4239 | +Mar 12, 2005: Marcus Geiger has written an article about libarchive |
4240 | + http://xsnil.antbear.org/2005/02/05/archive-mit-libarchive-verarbeiten/ |
4241 | + including examples of using it from Objective-C. His MoinX |
4242 | + http://moinx.antbear.org/ desktop Wiki uses |
4243 | + libarchive for archiving and restoring Wiki pages. |
4244 | +Jan 22, 2005: Preliminary ZIP extraction support, |
4245 | + new directory-walking code for bsdtar. |
4246 | +Jan 16, 2005: ISO9660 extraction code added; manpage corrections. |
4247 | +May 22, 2004: Many gtar-compatible long options have been added; almost |
4248 | + all FreeBSD ports extract correctly with bsdtar. |
4249 | +May 18, 2004: bsdtar can read Solaris, HP-UX, Unixware, star, gtar, |
4250 | + and pdtar archives. |
4251 | |
4252 | === added file 'src/libarchive/README' |
4253 | --- src/libarchive/README 1970-01-01 00:00:00 +0000 |
4254 | +++ src/libarchive/README 2012-02-10 20:09:18 +0000 |
4255 | @@ -0,0 +1,137 @@ |
4256 | +README for libarchive bundle. |
4257 | + |
4258 | +Questions? Issues? |
4259 | + * http://libarchive.googlecode.com/ is the home for ongoing |
4260 | + libarchive development, including issue tracker, additional |
4261 | + documentation, and links to the libarchive mailing lists. |
4262 | + |
4263 | +This distribution bundle includes the following components: |
4264 | + * libarchive: a library for reading and writing streaming archives |
4265 | + * tar: the 'bsdtar' program is a full-featured 'tar' |
4266 | + replacement built on libarchive |
4267 | + * cpio: the 'bsdcpio' program is a different interface to |
4268 | + essentially the same functionality |
4269 | + * examples: Some small example programs that you may find useful. |
4270 | + * examples/minitar: a compact sample demonstrating use of libarchive. |
4271 | + I use this for testing link pollution; it should produce a very |
4272 | + small executable file on most systems. |
4273 | + * contrib: Various items sent to me by third parties; |
4274 | + please contact the authors with any questions. |
4275 | + |
4276 | +The top-level directory contains the following information files: |
4277 | + * NEWS - highlights of recent changes |
4278 | + * COPYING - what you can do with this |
4279 | + * INSTALL - installation instructions |
4280 | + * README - this file |
4281 | + * configure - configuration script, see INSTALL for details. |
4282 | + * CMakeLists.txt - input for "cmake" build tool, see INSTALL |
4283 | + |
4284 | +The following files in the top-level directory are used by the |
4285 | +'configure' script: |
4286 | + * Makefile.am, aclocal.m4, configure.ac |
4287 | + - used to build this distribution, only needed by maintainers |
4288 | + * Makefile.in, config.h.in |
4289 | + - templates used by configure script |
4290 | + |
4291 | +Guide to Documentation installed by this system: |
4292 | + * bsdtar.1 explains the use of the bsdtar program |
4293 | + * bsdcpio.1 explains the use of the bsdcpio program |
4294 | + * libarchive.3 gives an overview of the library as a whole |
4295 | + * archive_read.3, archive_write.3, archive_write_disk.3, and |
4296 | + archive_read_disk.3 provide detailed calling sequences for the read |
4297 | + and write APIs |
4298 | + * archive_entry.3 details the "struct archive_entry" utility class |
4299 | + * archive_internals.3 provides some insight into libarchive's |
4300 | + internal structure and operation. |
4301 | + * libarchive-formats.5 documents the file formats supported by the library |
4302 | + * cpio.5, mtree.5, and tar.5 provide detailed information about these |
4303 | + popular archive formats, including hard-to-find details about |
4304 | + modern cpio and tar variants. |
4305 | +The manual pages above are provided in the 'doc' directory in |
4306 | +a number of different formats. |
4307 | + |
4308 | +You should also read the copious comments in "archive.h" and the |
4309 | +source code for the sample programs for more details. Please let me |
4310 | +know about any errors or omissions you find. |
4311 | + |
4312 | +Currently, the library automatically detects and reads the following: |
4313 | + * gzip compression |
4314 | + * bzip2 compression |
4315 | + * compress/LZW compression |
4316 | + * lzma and xz compression |
4317 | + * GNU tar format (including GNU long filenames, long link names, and |
4318 | + sparse files) |
4319 | + * Solaris 9 extended tar format (including ACLs) |
4320 | + * Old V7 tar archives |
4321 | + * POSIX ustar |
4322 | + * POSIX pax interchange format |
4323 | + * POSIX octet-oriented cpio |
4324 | + * SVR4 ASCII cpio |
4325 | + * POSIX octet-oriented cpio |
4326 | + * Binary cpio (big-endian or little-endian) |
4327 | + * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) |
4328 | + * ZIP archives (with uncompressed or "deflate" compressed entries) |
4329 | + * GNU and BSD 'ar' archives |
4330 | + * 'mtree' format |
4331 | + |
4332 | +The library can write: |
4333 | + * gzip compression |
4334 | + * bzip2 compression |
4335 | + * compress/LZW compression |
4336 | + * lzma and xz compression |
4337 | + * POSIX ustar |
4338 | + * POSIX pax interchange format |
4339 | + * "restricted" pax format, which will create ustar archives except for |
4340 | + entries that require pax extensions (for long filenames, ACLs, etc). |
4341 | + * POSIX octet-oriented cpio |
4342 | + * SVR4 "newc" cpio |
4343 | + * shar archives |
4344 | + * ZIP archives (with uncompressed or "deflate" compressed entries) |
4345 | + * GNU and BSD 'ar' archives |
4346 | + * 'mtree' format |
4347 | + |
4348 | +Notes about the library architecture: |
4349 | + |
4350 | + * This is a heavily stream-oriented system. There is no direct |
4351 | + support for in-place modification or random access. |
4352 | + |
4353 | + * The library is designed to be extended with new compression and |
4354 | + archive formats. The only requirement is that the format be |
4355 | + readable or writable as a stream and that each archive entry be |
4356 | + independent. There are articles on the libarchive Wiki explaining |
4357 | + how to extend libarchive. |
4358 | + |
4359 | + * On read, compression and format are always detected automatically. |
4360 | + |
4361 | + * I've attempted to minimize static link pollution. If you don't |
4362 | + explicitly invoke a particular feature (such as support for a |
4363 | + particular compression or format), it won't get pulled in. |
4364 | + In particular, if you don't explicitly enable a particular |
4365 | + compression or decompression support, you won't need to link |
4366 | + against the corresponding compression or decompression libraries. |
4367 | + This also reduces the size of statically-linked binaries in |
4368 | + environments where that matters. |
4369 | + |
4370 | + * On read, the library accepts whatever blocks you hand it. |
4371 | + Your read callback is free to pass the library a byte at a time |
4372 | + or mmap the entire archive and give it to the library at once. |
4373 | + On write, the library always produces correctly-blocked output. |
4374 | + |
4375 | + * The object-style approach allows you to have multiple archive streams |
4376 | + open at once. bsdtar uses this in its "@archive" extension. |
4377 | + |
4378 | + * The archive itself is read/written using callback functions. |
4379 | + You can read an archive directly from an in-memory buffer or |
4380 | + write it to a socket, if you wish. There are some utility |
4381 | + functions to provide easy-to-use "open file," etc, capabilities. |
4382 | + |
4383 | + * The read/write APIs are designed to allow individual entries |
4384 | + to be read or written to any data source: You can create |
4385 | + a block of data in memory and add it to a tar archive without |
4386 | + first writing a temporary file. You can also read an entry from |
4387 | + an archive and write the data directly to a socket. If you want |
4388 | + to read/write entries to disk, there are convenience functions to |
4389 | + make this especially easy. |
4390 | + |
4391 | + * Note: "pax interchange format" is really an extended tar format, |
4392 | + despite what the name says. |
4393 | |
4394 | === added directory 'src/libarchive/build' |
4395 | === added directory 'src/libarchive/build/autoconf' |
4396 | === added file 'src/libarchive/build/autoconf/check_stdcall_func.m4' |
4397 | --- src/libarchive/build/autoconf/check_stdcall_func.m4 1970-01-01 00:00:00 +0000 |
4398 | +++ src/libarchive/build/autoconf/check_stdcall_func.m4 2012-02-10 20:09:18 +0000 |
4399 | @@ -0,0 +1,51 @@ |
4400 | +# AC_LANG_STDCALL_FUNC_LINK_TRY(FUNCTION, SIGNATURE) |
4401 | +# ------------------------------- |
4402 | +# Produce a source which links correctly iff the FUNCTION exists. |
4403 | +AC_DEFUN([AC_LANG_STDCALL_FUNC_LINK_TRY], |
4404 | +[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) |
4405 | + |
4406 | +# AC_CHECK_STDCALL_FUNC(FUNCTION, SIGNATURE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
4407 | +# ----------------------------------------------------------------- |
4408 | +AC_DEFUN([AC_CHECK_STDCALL_FUNC], |
4409 | +[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])dnl |
4410 | +AC_CACHE_CHECK([for $1], ac_var, |
4411 | +[AC_LINK_IFELSE([AC_LANG_STDCALL_FUNC_LINK_TRY([$1],[$2])], |
4412 | + [AS_VAR_SET(ac_var, yes)], |
4413 | + [AS_VAR_SET(ac_var, no)])]) |
4414 | +AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl |
4415 | +AS_VAR_POPDEF([ac_var])dnl |
4416 | +])# AC_CHECK_FUNC |
4417 | + |
4418 | +# AC_LANG_STDCALL_FUNC_LINK_TRY(C)(FUNCTION, SIGNATURE) |
4419 | +# ---------------------------------- |
4420 | +# Don't include <ctype.h> because on OSF/1 3.0 it includes |
4421 | +# <sys/types.h> which includes <sys/select.h> which contains a |
4422 | +# prototype for select. Similarly for bzero. |
4423 | +m4_define([AC_LANG_STDCALL_FUNC_LINK_TRY(C)], |
4424 | +[AC_LANG_PROGRAM( |
4425 | +[/* System header to define __stub macros and hopefully few prototypes, |
4426 | + which can conflict with char __stdcall $1 ( $2 ) below. */ |
4427 | +#include <assert.h> |
4428 | +/* Override any gcc2 internal prototype to avoid an error. */ |
4429 | +#ifdef __cplusplus |
4430 | +extern "C" |
4431 | +#endif |
4432 | +/* We use char because int might match the return type of a gcc2 |
4433 | + builtin and then its argument prototype would still apply. */ |
4434 | +char __stdcall $1 ( $2 ); |
4435 | +char (*f) ( $2 ); |
4436 | +], |
4437 | +[/* The GNU C library defines this for functions which it implements |
4438 | + to always fail with ENOSYS. Some functions are actually named |
4439 | + something starting with __ and the normal name is an alias. */ |
4440 | +#if defined (__stub_$1) || defined (__stub___$1) |
4441 | +choke me |
4442 | +#else |
4443 | +f = $1; |
4444 | +#endif |
4445 | +])]) |
4446 | + |
4447 | +# AC_LANG_STDCALL_FUNC_LINK_TRY(C++)(FUNCTION) |
4448 | +# ------------------------------------ |
4449 | +m4_copy([AC_LANG_STDCALL_FUNC_LINK_TRY(C)], [AC_LANG_STDCALL_FUNC_LINK_TRY(C++)]) |
4450 | + |
4451 | |
4452 | === added file 'src/libarchive/build/autoconf/compile' |
4453 | --- src/libarchive/build/autoconf/compile 1970-01-01 00:00:00 +0000 |
4454 | +++ src/libarchive/build/autoconf/compile 2012-02-10 20:09:18 +0000 |
4455 | @@ -0,0 +1,143 @@ |
4456 | +#! /bin/sh |
4457 | +# Wrapper for compilers which do not understand `-c -o'. |
4458 | + |
4459 | +scriptversion=2009-10-06.20; # UTC |
4460 | + |
4461 | +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software |
4462 | +# Foundation, Inc. |
4463 | +# Written by Tom Tromey <tromey@cygnus.com>. |
4464 | +# |
4465 | +# This program is free software; you can redistribute it and/or modify |
4466 | +# it under the terms of the GNU General Public License as published by |
4467 | +# the Free Software Foundation; either version 2, or (at your option) |
4468 | +# any later version. |
4469 | +# |
4470 | +# This program is distributed in the hope that it will be useful, |
4471 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
4472 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4473 | +# GNU General Public License for more details. |
4474 | +# |
4475 | +# You should have received a copy of the GNU General Public License |
4476 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
4477 | + |
4478 | +# As a special exception to the GNU General Public License, if you |
4479 | +# distribute this file as part of a program that contains a |
4480 | +# configuration script generated by Autoconf, you may include it under |
4481 | +# the same distribution terms that you use for the rest of that program. |
4482 | + |
4483 | +# This file is maintained in Automake, please report |
4484 | +# bugs to <bug-automake@gnu.org> or send patches to |
4485 | +# <automake-patches@gnu.org>. |
4486 | + |
4487 | +case $1 in |
4488 | + '') |
4489 | + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 |
4490 | + exit 1; |
4491 | + ;; |
4492 | + -h | --h*) |
4493 | + cat <<\EOF |
4494 | +Usage: compile [--help] [--version] PROGRAM [ARGS] |
4495 | + |
4496 | +Wrapper for compilers which do not understand `-c -o'. |
4497 | +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining |
4498 | +arguments, and rename the output as expected. |
4499 | + |
4500 | +If you are trying to build a whole package this is not the |
4501 | +right script to run: please start by reading the file `INSTALL'. |
4502 | + |
4503 | +Report bugs to <bug-automake@gnu.org>. |
4504 | +EOF |
4505 | + exit $? |
4506 | + ;; |
4507 | + -v | --v*) |
4508 | + echo "compile $scriptversion" |
4509 | + exit $? |
4510 | + ;; |
4511 | +esac |
4512 | + |
4513 | +ofile= |
4514 | +cfile= |
4515 | +eat= |
4516 | + |
4517 | +for arg |
4518 | +do |
4519 | + if test -n "$eat"; then |
4520 | + eat= |
4521 | + else |
4522 | + case $1 in |
4523 | + -o) |
4524 | + # configure might choose to run compile as `compile cc -o foo foo.c'. |
4525 | + # So we strip `-o arg' only if arg is an object. |
4526 | + eat=1 |
4527 | + case $2 in |
4528 | + *.o | *.obj) |
4529 | + ofile=$2 |
4530 | + ;; |
4531 | + *) |
4532 | + set x "$@" -o "$2" |
4533 | + shift |
4534 | + ;; |
4535 | + esac |
4536 | + ;; |
4537 | + *.c) |
4538 | + cfile=$1 |
4539 | + set x "$@" "$1" |
4540 | + shift |
4541 | + ;; |
4542 | + *) |
4543 | + set x "$@" "$1" |
4544 | + shift |
4545 | + ;; |
4546 | + esac |
4547 | + fi |
4548 | + shift |
4549 | +done |
4550 | + |
4551 | +if test -z "$ofile" || test -z "$cfile"; then |
4552 | + # If no `-o' option was seen then we might have been invoked from a |
4553 | + # pattern rule where we don't need one. That is ok -- this is a |
4554 | + # normal compilation that the losing compiler can handle. If no |
4555 | + # `.c' file was seen then we are probably linking. That is also |
4556 | + # ok. |
4557 | + exec "$@" |
4558 | +fi |
4559 | + |
4560 | +# Name of file we expect compiler to create. |
4561 | +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` |
4562 | + |
4563 | +# Create the lock directory. |
4564 | +# Note: use `[/\\:.-]' here to ensure that we don't use the same name |
4565 | +# that we are using for the .o file. Also, base the name on the expected |
4566 | +# object file name, since that is what matters with a parallel build. |
4567 | +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d |
4568 | +while true; do |
4569 | + if mkdir "$lockdir" >/dev/null 2>&1; then |
4570 | + break |
4571 | + fi |
4572 | + sleep 1 |
4573 | +done |
4574 | +# FIXME: race condition here if user kills between mkdir and trap. |
4575 | +trap "rmdir '$lockdir'; exit 1" 1 2 15 |
4576 | + |
4577 | +# Run the compile. |
4578 | +"$@" |
4579 | +ret=$? |
4580 | + |
4581 | +if test -f "$cofile"; then |
4582 | + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" |
4583 | +elif test -f "${cofile}bj"; then |
4584 | + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" |
4585 | +fi |
4586 | + |
4587 | +rmdir "$lockdir" |
4588 | +exit $ret |
4589 | + |
4590 | +# Local Variables: |
4591 | +# mode: shell-script |
4592 | +# sh-indentation: 2 |
4593 | +# eval: (add-hook 'write-file-hooks 'time-stamp) |
4594 | +# time-stamp-start: "scriptversion=" |
4595 | +# time-stamp-format: "%:y-%02m-%02d.%02H" |
4596 | +# time-stamp-time-zone: "UTC" |
4597 | +# time-stamp-end: "; # UTC" |
4598 | +# End: |
4599 | |
4600 | === added file 'src/libarchive/build/autoconf/config.guess' |
4601 | --- src/libarchive/build/autoconf/config.guess 1970-01-01 00:00:00 +0000 |
4602 | +++ src/libarchive/build/autoconf/config.guess 2012-02-10 20:09:18 +0000 |
4603 | @@ -0,0 +1,1501 @@ |
4604 | +#! /bin/sh |
4605 | +# Attempt to guess a canonical system name. |
4606 | +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
4607 | +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
4608 | +# Free Software Foundation, Inc. |
4609 | + |
4610 | +timestamp='2009-11-20' |
4611 | + |
4612 | +# This file is free software; you can redistribute it and/or modify it |
4613 | +# under the terms of the GNU General Public License as published by |
4614 | +# the Free Software Foundation; either version 2 of the License, or |
4615 | +# (at your option) any later version. |
4616 | +# |
4617 | +# This program is distributed in the hope that it will be useful, but |
4618 | +# WITHOUT ANY WARRANTY; without even the implied warranty of |
4619 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4620 | +# General Public License for more details. |
4621 | +# |
4622 | +# You should have received a copy of the GNU General Public License |
4623 | +# along with this program; if not, write to the Free Software |
4624 | +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA |
4625 | +# 02110-1301, USA. |
4626 | +# |
4627 | +# As a special exception to the GNU General Public License, if you |
4628 | +# distribute this file as part of a program that contains a |
4629 | +# configuration script generated by Autoconf, you may include it under |
4630 | +# the same distribution terms that you use for the rest of that program. |
4631 | + |
4632 | + |
4633 | +# Originally written by Per Bothner. Please send patches (context |
4634 | +# diff format) to <config-patches@gnu.org> and include a ChangeLog |
4635 | +# entry. |
4636 | +# |
4637 | +# This script attempts to guess a canonical system name similar to |
4638 | +# config.sub. If it succeeds, it prints the system name on stdout, and |
4639 | +# exits with 0. Otherwise, it exits with 1. |
4640 | +# |
4641 | +# You can get the latest version of this script from: |
4642 | +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD |
4643 | + |
4644 | +me=`echo "$0" | sed -e 's,.*/,,'` |
4645 | + |
4646 | +usage="\ |
4647 | +Usage: $0 [OPTION] |
4648 | + |
4649 | +Output the configuration name of the system \`$me' is run on. |
4650 | + |
4651 | +Operation modes: |
4652 | + -h, --help print this help, then exit |
4653 | + -t, --time-stamp print date of last modification, then exit |
4654 | + -v, --version print version number, then exit |
4655 | + |
4656 | +Report bugs and patches to <config-patches@gnu.org>." |
4657 | + |
4658 | +version="\ |
4659 | +GNU config.guess ($timestamp) |
4660 | + |
4661 | +Originally written by Per Bothner. |
4662 | +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, |
4663 | +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
4664 | + |
4665 | +This is free software; see the source for copying conditions. There is NO |
4666 | +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
4667 | + |
4668 | +help=" |
4669 | +Try \`$me --help' for more information." |
4670 | + |
4671 | +# Parse command line |
4672 | +while test $# -gt 0 ; do |
4673 | + case $1 in |
4674 | + --time-stamp | --time* | -t ) |
4675 | + echo "$timestamp" ; exit ;; |
4676 | + --version | -v ) |
4677 | + echo "$version" ; exit ;; |
4678 | + --help | --h* | -h ) |
4679 | + echo "$usage"; exit ;; |
4680 | + -- ) # Stop option processing |
4681 | + shift; break ;; |
4682 | + - ) # Use stdin as input. |
4683 | + break ;; |
4684 | + -* ) |
4685 | + echo "$me: invalid option $1$help" >&2 |
4686 | + exit 1 ;; |
4687 | + * ) |
4688 | + break ;; |
4689 | + esac |
4690 | +done |
4691 | + |
4692 | +if test $# != 0; then |
4693 | + echo "$me: too many arguments$help" >&2 |
4694 | + exit 1 |
4695 | +fi |
4696 | + |
4697 | +trap 'exit 1' 1 2 15 |
4698 | + |
4699 | +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a |
4700 | +# compiler to aid in system detection is discouraged as it requires |
4701 | +# temporary files to be created and, as you can see below, it is a |
4702 | +# headache to deal with in a portable fashion. |
4703 | + |
4704 | +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still |
4705 | +# use `HOST_CC' if defined, but it is deprecated. |
4706 | + |
4707 | +# Portable tmp directory creation inspired by the Autoconf team. |
4708 | + |
4709 | +set_cc_for_build=' |
4710 | +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; |
4711 | +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; |
4712 | +: ${TMPDIR=/tmp} ; |
4713 | + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
4714 | + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || |
4715 | + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || |
4716 | + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; |
4717 | +dummy=$tmp/dummy ; |
4718 | +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; |
4719 | +case $CC_FOR_BUILD,$HOST_CC,$CC in |
4720 | + ,,) echo "int x;" > $dummy.c ; |
4721 | + for c in cc gcc c89 c99 ; do |
4722 | + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then |
4723 | + CC_FOR_BUILD="$c"; break ; |
4724 | + fi ; |
4725 | + done ; |
4726 | + if test x"$CC_FOR_BUILD" = x ; then |
4727 | + CC_FOR_BUILD=no_compiler_found ; |
4728 | + fi |
4729 | + ;; |
4730 | + ,,*) CC_FOR_BUILD=$CC ;; |
4731 | + ,*,*) CC_FOR_BUILD=$HOST_CC ;; |
4732 | +esac ; set_cc_for_build= ;' |
4733 | + |
4734 | +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. |
4735 | +# (ghazi@noc.rutgers.edu 1994-08-24) |
4736 | +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then |
4737 | + PATH=$PATH:/.attbin ; export PATH |
4738 | +fi |
4739 | + |
4740 | +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown |
4741 | +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown |
4742 | +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown |
4743 | +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown |
4744 | + |
4745 | +# Note: order is significant - the case branches are not exclusive. |
4746 | + |
4747 | +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in |
4748 | + *:NetBSD:*:*) |
4749 | + # NetBSD (nbsd) targets should (where applicable) match one or |
4750 | + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, |
4751 | + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently |
4752 | + # switched to ELF, *-*-netbsd* would select the old |
4753 | + # object file format. This provides both forward |
4754 | + # compatibility and a consistent mechanism for selecting the |
4755 | + # object file format. |
4756 | + # |
4757 | + # Note: NetBSD doesn't particularly care about the vendor |
4758 | + # portion of the name. We always set it to "unknown". |
4759 | + sysctl="sysctl -n hw.machine_arch" |
4760 | + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ |
4761 | + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` |
4762 | + case "${UNAME_MACHINE_ARCH}" in |
4763 | + armeb) machine=armeb-unknown ;; |
4764 | + arm*) machine=arm-unknown ;; |
4765 | + sh3el) machine=shl-unknown ;; |
4766 | + sh3eb) machine=sh-unknown ;; |
4767 | + sh5el) machine=sh5le-unknown ;; |
4768 | + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; |
4769 | + esac |
4770 | + # The Operating System including object format, if it has switched |
4771 | + # to ELF recently, or will in the future. |
4772 | + case "${UNAME_MACHINE_ARCH}" in |
4773 | + arm*|i386|m68k|ns32k|sh3*|sparc|vax) |
4774 | + eval $set_cc_for_build |
4775 | + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
4776 | + | grep -q __ELF__ |
4777 | + then |
4778 | + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). |
4779 | + # Return netbsd for either. FIX? |
4780 | + os=netbsd |
4781 | + else |
4782 | + os=netbsdelf |
4783 | + fi |
4784 | + ;; |
4785 | + *) |
4786 | + os=netbsd |
4787 | + ;; |
4788 | + esac |
4789 | + # The OS release |
4790 | + # Debian GNU/NetBSD machines have a different userland, and |
4791 | + # thus, need a distinct triplet. However, they do not need |
4792 | + # kernel version information, so it can be replaced with a |
4793 | + # suitable tag, in the style of linux-gnu. |
4794 | + case "${UNAME_VERSION}" in |
4795 | + Debian*) |
4796 | + release='-gnu' |
4797 | + ;; |
4798 | + *) |
4799 | + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` |
4800 | + ;; |
4801 | + esac |
4802 | + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
4803 | + # contains redundant information, the shorter form: |
4804 | + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
4805 | + echo "${machine}-${os}${release}" |
4806 | + exit ;; |
4807 | + *:OpenBSD:*:*) |
4808 | + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` |
4809 | + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} |
4810 | + exit ;; |
4811 | + *:ekkoBSD:*:*) |
4812 | + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} |
4813 | + exit ;; |
4814 | + *:SolidBSD:*:*) |
4815 | + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} |
4816 | + exit ;; |
4817 | + macppc:MirBSD:*:*) |
4818 | + echo powerpc-unknown-mirbsd${UNAME_RELEASE} |
4819 | + exit ;; |
4820 | + *:MirBSD:*:*) |
4821 | + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} |
4822 | + exit ;; |
4823 | + alpha:OSF1:*:*) |
4824 | + case $UNAME_RELEASE in |
4825 | + *4.0) |
4826 | + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
4827 | + ;; |
4828 | + *5.*) |
4829 | + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` |
4830 | + ;; |
4831 | + esac |
4832 | + # According to Compaq, /usr/sbin/psrinfo has been available on |
4833 | + # OSF/1 and Tru64 systems produced since 1995. I hope that |
4834 | + # covers most systems running today. This code pipes the CPU |
4835 | + # types through head -n 1, so we only detect the type of CPU 0. |
4836 | + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` |
4837 | + case "$ALPHA_CPU_TYPE" in |
4838 | + "EV4 (21064)") |
4839 | + UNAME_MACHINE="alpha" ;; |
4840 | + "EV4.5 (21064)") |
4841 | + UNAME_MACHINE="alpha" ;; |
4842 | + "LCA4 (21066/21068)") |
4843 | + UNAME_MACHINE="alpha" ;; |
4844 | + "EV5 (21164)") |
4845 | + UNAME_MACHINE="alphaev5" ;; |
4846 | + "EV5.6 (21164A)") |
4847 | + UNAME_MACHINE="alphaev56" ;; |
4848 | + "EV5.6 (21164PC)") |
4849 | + UNAME_MACHINE="alphapca56" ;; |
4850 | + "EV5.7 (21164PC)") |
4851 | + UNAME_MACHINE="alphapca57" ;; |
4852 | + "EV6 (21264)") |
4853 | + UNAME_MACHINE="alphaev6" ;; |
4854 | + "EV6.7 (21264A)") |
4855 | + UNAME_MACHINE="alphaev67" ;; |
4856 | + "EV6.8CB (21264C)") |
4857 | + UNAME_MACHINE="alphaev68" ;; |
4858 | + "EV6.8AL (21264B)") |
4859 | + UNAME_MACHINE="alphaev68" ;; |
4860 | + "EV6.8CX (21264D)") |
4861 | + UNAME_MACHINE="alphaev68" ;; |
4862 | + "EV6.9A (21264/EV69A)") |
4863 | + UNAME_MACHINE="alphaev69" ;; |
4864 | + "EV7 (21364)") |
4865 | + UNAME_MACHINE="alphaev7" ;; |
4866 | + "EV7.9 (21364A)") |
4867 | + UNAME_MACHINE="alphaev79" ;; |
4868 | + esac |
4869 | + # A Pn.n version is a patched version. |
4870 | + # A Vn.n version is a released version. |
4871 | + # A Tn.n version is a released field test version. |
4872 | + # A Xn.n version is an unreleased experimental baselevel. |
4873 | + # 1.2 uses "1.2" for uname -r. |
4874 | + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
4875 | + exit ;; |
4876 | + Alpha\ *:Windows_NT*:*) |
4877 | + # How do we know it's Interix rather than the generic POSIX subsystem? |
4878 | + # Should we change UNAME_MACHINE based on the output of uname instead |
4879 | + # of the specific Alpha model? |
4880 | + echo alpha-pc-interix |
4881 | + exit ;; |
4882 | + 21064:Windows_NT:50:3) |
4883 | + echo alpha-dec-winnt3.5 |
4884 | + exit ;; |
4885 | + Amiga*:UNIX_System_V:4.0:*) |
4886 | + echo m68k-unknown-sysv4 |
4887 | + exit ;; |
4888 | + *:[Aa]miga[Oo][Ss]:*:*) |
4889 | + echo ${UNAME_MACHINE}-unknown-amigaos |
4890 | + exit ;; |
4891 | + *:[Mm]orph[Oo][Ss]:*:*) |
4892 | + echo ${UNAME_MACHINE}-unknown-morphos |
4893 | + exit ;; |
4894 | + *:OS/390:*:*) |
4895 | + echo i370-ibm-openedition |
4896 | + exit ;; |
4897 | + *:z/VM:*:*) |
4898 | + echo s390-ibm-zvmoe |
4899 | + exit ;; |
4900 | + *:OS400:*:*) |
4901 | + echo powerpc-ibm-os400 |
4902 | + exit ;; |
4903 | + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) |
4904 | + echo arm-acorn-riscix${UNAME_RELEASE} |
4905 | + exit ;; |
4906 | + arm:riscos:*:*|arm:RISCOS:*:*) |
4907 | + echo arm-unknown-riscos |
4908 | + exit ;; |
4909 | + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) |
4910 | + echo hppa1.1-hitachi-hiuxmpp |
4911 | + exit ;; |
4912 | + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) |
4913 | + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. |
4914 | + if test "`(/bin/universe) 2>/dev/null`" = att ; then |
4915 | + echo pyramid-pyramid-sysv3 |
4916 | + else |
4917 | + echo pyramid-pyramid-bsd |
4918 | + fi |
4919 | + exit ;; |
4920 | + NILE*:*:*:dcosx) |
4921 | + echo pyramid-pyramid-svr4 |
4922 | + exit ;; |
4923 | + DRS?6000:unix:4.0:6*) |
4924 | + echo sparc-icl-nx6 |
4925 | + exit ;; |
4926 | + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) |
4927 | + case `/usr/bin/uname -p` in |
4928 | + sparc) echo sparc-icl-nx7; exit ;; |
4929 | + esac ;; |
4930 | + s390x:SunOS:*:*) |
4931 | + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
4932 | + exit ;; |
4933 | + sun4H:SunOS:5.*:*) |
4934 | + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
4935 | + exit ;; |
4936 | + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) |
4937 | + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
4938 | + exit ;; |
4939 | + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) |
4940 | + echo i386-pc-auroraux${UNAME_RELEASE} |
4941 | + exit ;; |
4942 | + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) |
4943 | + eval $set_cc_for_build |
4944 | + SUN_ARCH="i386" |
4945 | + # If there is a compiler, see if it is configured for 64-bit objects. |
4946 | + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. |
4947 | + # This test works for both compilers. |
4948 | + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then |
4949 | + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ |
4950 | + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ |
4951 | + grep IS_64BIT_ARCH >/dev/null |
4952 | + then |
4953 | + SUN_ARCH="x86_64" |
4954 | + fi |
4955 | + fi |
4956 | + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
4957 | + exit ;; |
4958 | + sun4*:SunOS:6*:*) |
4959 | + # According to config.sub, this is the proper way to canonicalize |
4960 | + # SunOS6. Hard to guess exactly what SunOS6 will be like, but |
4961 | + # it's likely to be more like Solaris than SunOS4. |
4962 | + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
4963 | + exit ;; |
4964 | + sun4*:SunOS:*:*) |
4965 | + case "`/usr/bin/arch -k`" in |
4966 | + Series*|S4*) |
4967 | + UNAME_RELEASE=`uname -v` |
4968 | + ;; |
4969 | + esac |
4970 | + # Japanese Language versions have a version number like `4.1.3-JL'. |
4971 | + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` |
4972 | + exit ;; |
4973 | + sun3*:SunOS:*:*) |
4974 | + echo m68k-sun-sunos${UNAME_RELEASE} |
4975 | + exit ;; |
4976 | + sun*:*:4.2BSD:*) |
4977 | + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` |
4978 | + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 |
4979 | + case "`/bin/arch`" in |
4980 | + sun3) |
4981 | + echo m68k-sun-sunos${UNAME_RELEASE} |
4982 | + ;; |
4983 | + sun4) |
4984 | + echo sparc-sun-sunos${UNAME_RELEASE} |
4985 | + ;; |
4986 | + esac |
4987 | + exit ;; |
4988 | + aushp:SunOS:*:*) |
4989 | + echo sparc-auspex-sunos${UNAME_RELEASE} |
4990 | + exit ;; |
4991 | + # The situation for MiNT is a little confusing. The machine name |
4992 | + # can be virtually everything (everything which is not |
4993 | + # "atarist" or "atariste" at least should have a processor |
4994 | + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" |
4995 | + # to the lowercase version "mint" (or "freemint"). Finally |
4996 | + # the system name "TOS" denotes a system which is actually not |
4997 | + # MiNT. But MiNT is downward compatible to TOS, so this should |
4998 | + # be no problem. |
4999 | + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) |
5000 | + echo m68k-atari-mint${UNAME_RELEASE} |
http:// jenkins. percona. com/view/ Percona% 20Xtrabackup/ job/percona- xtrabackup- param/75/