Skip to content
Browse files

Merge branch 'master' of github.com:libarchive/libarchive

  • Loading branch information...
2 parents 0cc23ce + 4b5f651 commit a07cc61826439d7b03fe9897f3c44c6dc54d0a11 @kientzle kientzle committed
Showing with 8,839 additions and 868 deletions.
  1. +11 −0 .gitignore
  2. +194 −78 CMakeLists.txt
  3. +44 −2 Makefile.am
  4. +29 −0 NEWS
  5. +1 −1 README
  6. +35 −0 build/README.txt
  7. +5 −0 build/autogen.sh
  8. +1 −1 build/bump-version.sh
  9. +22 −0 build/cmake/FindLibGCC.cmake
  10. +23 −0 build/cmake/FindNettle.cmake
  11. +34 −0 build/cmake/FindPCREPOSIX.cmake
  12. +106 −0 build/cmake/LibarchiveCheckCSourceCompiles.cmake
  13. +102 −0 build/cmake/LibarchiveCheckCSourceRuns.cmake
  14. +24 −0 build/cmake/config.h.in
  15. +1 −0 build/makerelease.sh
  16. +1 −1 build/version
  17. +146 −45 configure.ac
  18. +24 −66 contrib/libarchive.spec
  19. +3 −1 cpio/cpio.c
  20. +0 −1 cpio/test/main.c
  21. +1 −1 cpio/test/test_extract_cpio_lzo.c
  22. +2 −0 doc/update.sh
  23. +10 −7 examples/minitar/minitar.c
  24. +3 −4 examples/untar.c
  25. +3 −0 libarchive/CMakeLists.txt
  26. +22 −2 libarchive/archive.h
  27. +4 −2 libarchive/archive_crypto.c
  28. +1 −1 libarchive/archive_entry.h
  29. +1 −1 libarchive/archive_entry_sparse.c
  30. +2 −0 libarchive/archive_match.c
  31. +1 −1 libarchive/archive_ppmd7.c
  32. +44 −28 libarchive/archive_read.c
  33. +198 −0 libarchive/archive_read_append_filter.c
  34. +5 −5 libarchive/archive_read_disk_entry_from_file.c
  35. +5 −5 libarchive/archive_read_disk_windows.c
  36. +15 −0 libarchive/archive_read_private.h
  37. +105 −0 libarchive/archive_read_set_format.c
  38. +1 −0 libarchive/archive_read_support_filter_bzip2.c
  39. +1 −0 libarchive/archive_read_support_filter_compress.c
  40. +1 −0 libarchive/archive_read_support_filter_gzip.c
  41. +1 −0 libarchive/archive_read_support_filter_lrzip.c
  42. +5 −4 libarchive/archive_read_support_filter_lzop.c
  43. +1 −0 libarchive/archive_read_support_filter_program.c
  44. +1 −0 libarchive/archive_read_support_filter_rpm.c
  45. +1 −0 libarchive/archive_read_support_filter_uu.c
  46. +3 −0 libarchive/archive_read_support_filter_xz.c
  47. +114 −35 libarchive/archive_read_support_format_rar.c
  48. +12 −12 libarchive/archive_read_support_format_tar.c
  49. +8 −4 libarchive/archive_read_support_format_xar.c
  50. +25 −8 libarchive/archive_read_support_format_zip.c
  51. +68 −0 libarchive/archive_util.c
  52. +10 −6 libarchive/archive_virtual.c
  53. +1 −1 libarchive/archive_windows.c
  54. +10 −3 libarchive/archive_write.c
  55. +6 −1 libarchive/archive_write_add_filter_lrzip.c
  56. +18 −8 libarchive/archive_write_disk_posix.c
  57. +4 −1 libarchive/archive_write_format.3
  58. +2 −1 libarchive/archive_write_set_format.c
  59. +6 −2 libarchive/archive_write_set_format_7zip.c
  60. +1 −1 libarchive/archive_write_set_format_ar.c
  61. +1 −0 libarchive/archive_write_set_format_by_name.c
  62. +10 −0 libarchive/archive_write_set_format_iso9660.c
  63. +2 −2 libarchive/archive_write_set_format_mtree.c
  64. +4 −1 libarchive/archive_write_set_format_pax.c
  65. +125 −0 libarchive/archive_write_set_format_raw.c
  66. +4 −1 libarchive/archive_write_set_format_zip.c
  67. +9 −0 libarchive/test/CMakeLists.txt
  68. +12 −1 libarchive/test/main.c
  69. +3 −0 libarchive/test/test.h
  70. +63 −0 libarchive/test/test_archive_string.c
  71. +204 −0 libarchive/test/test_archive_write_add_filter_by_name.c
  72. +285 −0 libarchive/test/test_archive_write_set_format_by_name.c
  73. +228 −194 libarchive/test/test_fuzz.c
  74. +299 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu
  75. +299 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu
  76. +299 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu
  77. +299 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu
  78. +299 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu
  79. +299 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu
  80. +299 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu
  81. +299 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu
  82. +299 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu
  83. +75 −0 libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu
  84. +73 −16 libarchive/test/test_read_format_7zip.c
  85. +2,248 −11 libarchive/test/test_read_format_rar.c
  86. +56 −0 libarchive/test/test_read_format_tar_empty_pax.c
  87. +10 −0 libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu
  88. +59 −0 libarchive/test/test_read_format_zip_sfx.c
  89. +34 −0 libarchive/test/test_read_format_zip_sfx.uu
  90. +220 −0 libarchive/test/test_read_set_format.c
  91. +26 −2 libarchive/test/test_read_truncated_filter.c
  92. +1 −0 libarchive/test/test_sparse_basic.c
  93. +4 −2 libarchive/test/test_write_disk_appledouble.c
  94. +4 −2 libarchive/test/test_write_disk_hfs_compression.c
  95. +4 −2 libarchive/test/test_write_disk_mac_metadata.c
  96. +4 −2 libarchive/test/test_write_disk_no_hfs_compression.c
  97. +9 −8 libarchive/test/test_write_filter_lzop.c
  98. +25 −271 libarchive/test/test_write_format_7zip.c
  99. +299 −0 libarchive/test/test_write_format_7zip_empty.c
  100. +174 −0 libarchive/test/test_write_format_7zip_large.c
  101. +123 −0 libarchive/test/test_write_format_mtree.c
  102. +123 −0 libarchive/test/test_write_format_raw.c
  103. +77 −0 libarchive/test/test_write_format_raw_b64.c
  104. +2 −2 tar/bsdtar.c
  105. +1 −1 tar/bsdtar.h
  106. +6 −2 tar/subst.c
  107. +0 −1 tar/test/main.c
  108. +12 −6 tar/test/test_option_b.c
  109. +1 −1 tar/util.c
View
11 .gitignore
@@ -1,4 +1,5 @@
*.o
+*.exe
*.lo
*.cmake
.libs/
@@ -73,6 +74,7 @@ doc/text/*.txt
doc/wiki/*.wiki
libarchive-*.tar.gz
+libarchive-*.zip
Testing/
libarchive/libarchive.a
@@ -80,3 +82,12 @@ libarchive/libarchive.so
libarchive/libarchive.so.*
.DS_Store
+
+bsdcpio_test.log
+bsdcpio_test.trs
+bsdtar_test.log
+bsdtar_test.trs
+build/autoconf/test-driver
+libarchive_test.log
+libarchive_test.trs
+test-suite.log
View
272 CMakeLists.txt
@@ -15,7 +15,7 @@ endif()
# RelWithDebInfo : Release build with Debug Info
# MinSizeRel : Release Min Size build
IF(NOT CMAKE_BUILD_TYPE)
- SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
+ SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
# Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the
# value type is "UNINITIALIZED".
@@ -63,8 +63,8 @@ SET(LIBARCHIVE_VERSION_STRING "${VERSION}")
# libarchive 2.8 == interface version 10 = 2 + 8
# libarchive 2.9 == interface version 11 = 2 + 9
# libarchive 3.0 == interface version 12
-# libarchive 3.x == interface version 12 + x
-math(EXPR INTERFACE_VERSION "12 + ${_minor}")
+# libarchive 3.1 == interface version 13
+math(EXPR INTERFACE_VERSION "13 + ${_minor}")
# Set SOVERSION == Interface version
# ?? Should there be more here ??
@@ -151,27 +151,55 @@ OPTION(ENABLE_XATTR "Enable extended attribute support" ON)
OPTION(ENABLE_ACL "Enable ACL support" ON)
OPTION(ENABLE_ICONV "Enable iconv support" ON)
OPTION(ENABLE_TEST "Enable unit and regression tests" ON)
+SET(POSIX_REGEX_LIB "AUTO" CACHE STRING "Choose what library should provide POSIX regular expression support")
+SET(ENABLE_SAFESEH "AUTO" CACHE STRING "Enable use of /SAFESEH linker flag (MSVC only)")
+SET(WINDOWS_VERSION "" CACHE STRING "Set Windows version to use (Windows only)")
IF(ENABLE_TEST)
ENABLE_TESTING()
ENDIF(ENABLE_TEST)
IF(WIN32)
- IF(MSVC60)
- SET(WINVER 0x0400)
- ELSE()
+ IF(WINDOWS_VERSION STREQUAL "WIN8")
+ SET(WINVER 0x0602)
+ ELSEIF(WINDOWS_VERSION STREQUAL "WIN7")
+ SET(WINVER 0x0601)
+ ELSEIF(WINDOWS_VERSION STREQUAL "WS08")
+ SET(WINVER 0x0600)
+ ELSEIF(WINDOWS_VERSION STREQUAL "VISTA")
+ SET(WINVER 0x0600)
+ ELSEIF(WINDOWS_VERSION STREQUAL "WS03")
+ SET(WINVER 0x0502)
+ ELSEIF(WINDOWS_VERSION STREQUAL "WINXP")
+ SET(WINVER 0x0501)
+ ELSE(WINDOWS_VERSION STREQUAL "WIN8")
+ # The default is to use Windows 2000 API.
SET(WINVER 0x0500)
- ENDIF()
+ ENDIF(WINDOWS_VERSION STREQUAL "WIN8")
SET(_WIN32_WINNT ${WINVER})
ENDIF(WIN32)
+IF(MSVC)
+ IF(ENABLE_SAFESEH STREQUAL "YES")
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH")
+ SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH")
+ SET(CMAKE_REQUIRED_LINKER_FLAGS "/SAFESEH")
+ ELSEIF(ENABLE_SAFESEH STREQUAL "NO")
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
+ SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
+ SET(CMAKE_REQUIRED_LINKER_FLAGS "/SAFESEH:NO")
+ ENDIF(ENABLE_SAFESEH STREQUAL "YES")
+ENDIF(MSVC)
+
IF("${CMAKE_C_PLATFORM_ID}" MATCHES "^(HP-UX)$")
ADD_DEFINITIONS(-D_XOPEN_SOURCE=500) # Ask wchar.h for mbstate_t
ENDIF()
#
-INCLUDE(CheckCSourceCompiles)
-INCLUDE(CheckCSourceRuns)
+INCLUDE(LibarchiveCheckCSourceCompiles)
+INCLUDE(LibarchiveCheckCSourceRuns)
INCLUDE(CheckFileOffsetBits)
INCLUDE(CheckFuncs)
INCLUDE(CheckHeaderDirent)
@@ -235,9 +263,9 @@ MACRO (TRY_MACRO_FOR_LIBRARY INCLUDES LIBRARIES
ENDIF(NOT "${PREV_VAR_WITH_LIB}" STREQUAL "${LIBRARIES}")
# Check if the library can be used with the macro.
IF("${TRY_TYPE}" MATCHES "COMPILES")
- CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR})
+ LIBARCHIVE_CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR})
ELSEIF("${TRY_TYPE}" MATCHES "RUNS")
- CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR})
+ LIBARCHIVE_CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR})
ELSE("${TRY_TYPE}" MATCHES "COMPILES")
MESSAGE(FATAL_ERROR "UNKNOWN KEYWORD \"${TRY_TYPE}\" FOR TRY_TYPE")
ENDIF("${TRY_TYPE}" MATCHES "COMPILES")
@@ -416,7 +444,7 @@ LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H)
LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H)
-CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
+LIBARCHIVE_CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
#include <ext2fs/ext2_fs.h>
int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS)
@@ -479,7 +507,7 @@ FOREACH (it ${_HEADER})
SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
ENDFOREACH (it)
-CHECK_C_SOURCE_COMPILES(
+LIBARCHIVE_CHECK_C_SOURCE_COMPILES(
"#define __EXTENSIONS__ 1
${_INCLUDE_FILES}
int main() { return 0;}"
@@ -489,16 +517,17 @@ CHECK_C_SOURCE_COMPILES(
# Find Nettle
#
IF(ENABLE_NETTLE)
- CHECK_LIBRARY_EXISTS(nettle "nettle_sha1_digest" "" NETTLE_FOUND)
+ FIND_PACKAGE(Nettle)
IF(NETTLE_FOUND)
- CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
- SET(CMAKE_REQUIRED_LIBRARIES "nettle")
- FIND_LIBRARY(NETTLE_LIBRARY NAMES nettle)
- LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARY})
- CMAKE_POP_CHECK_STATE() # Restore the state of the variables
- ELSE(NETTLE_FOUND)
- SET(ENABLE_NETTLE OFF)
+ SET(HAVE_LIBNETTLE 1)
+ SET(HAVE_NETTLE_MD5_H 1)
+ SET(HAVE_NETTLE_RIPEMD160_H 1)
+ SET(HAVE_NETTLE_SHA_H 1)
+ INCLUDE_DIRECTORIES(${NETTLE_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARIES})
ENDIF(NETTLE_FOUND)
+ MARK_AS_ADVANCED(CLEAR NETTLE_INCLUDE_DIR)
+ MARK_AS_ADVANCED(CLEAR NETTLE_LIBRARIES)
ENDIF(ENABLE_NETTLE)
#
@@ -529,13 +558,8 @@ ENDIF(NOT OPENSSL_FOUND)
# required libraries.
#
MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION)
- IF(HAVE_SYS_TYPES_H)
- SET(CRYPTO_HEADER_CONFIG "#define HAVE_SYS_TYPES_H 1\n")
- ELSE(HAVE_SYS_TYPES_H)
- SET(CRYPTO_HEADER_CONFIG "")
- ENDIF(HAVE_SYS_TYPES_H)
-
FOREACH(ALGORITHM ${ALGORITHMS})
+ IF(NOT ARCHIVE_CRYPTO_${ALGORITHM})
STRING(TOLOWER "${ALGORITHM}" lower_algorithm)
STRING(TOUPPER "${ALGORITHM}" algorithm)
IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND)
@@ -548,7 +572,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION)
# Probe the local implementation for whether this
# crypto implementation is available on this platform.
SET(TRY_CRYPTO_REQUIRED_INCLUDES
- "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/libarchive;${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp")
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive;${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp")
SET(TRY_CRYPTO_REQUIRED_LIBS)
IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND)
SET(TRY_CRYPTO_REQUIRED_INCLUDES
@@ -556,6 +580,8 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION)
SET(TRY_CRYPTO_REQUIRED_LIBS
"-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}")
ELSEIF("${IMPLEMENTATION}" MATCHES "^NETTLE$" AND NETTLE_FOUND)
+ SET(TRY_CRYPTO_REQUIRED_INCLUDES
+ "${TRY_CRYPTO_REQUIRED_INCLUDES};${NETTLE_INCLUDE_DIR}")
SET(TRY_CRYPTO_REQUIRED_LIBS
"-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}")
ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND)
@@ -563,10 +589,15 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION)
"-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}")
ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h)
+ FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h"
+ CONFDEFS_H)
FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/libarchive/archive_crypto.c"
ARCHIVE_CRYPTO_C)
- SET(SOURCE "
+ SET(SOURCE "${CONFDEFS_H}
+
#define ARCHIVE_${algorithm}_COMPILE_TEST
#define ARCHIVE_CRYPTO_${algorithm}_${IMPLEMENTATION}
#define PLATFORM_CONFIG_H \"check_crypto_md.h\"
@@ -588,10 +619,16 @@ main(int argc, char **argv)
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c" "${SOURCE}")
MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}")
+ IF(CMAKE_REQUIRED_LINKER_FLAGS)
+ SET(CHECK_CRYPTO_ADD_LINKER_FLAGS
+ "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}")
+ ELSE(CMAKE_REQUIRED_LINKER_FLAGS)
+ SET(CHECK_CRYPTO_ADD_LINKER_FLAGS)
+ ENDIF(CMAKE_REQUIRED_LINKER_FLAGS)
TRY_COMPILE(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c
- CMAKE_FLAGS
+ CMAKE_FLAGS ${CHECK_CRYPTO_ADD_LINKER_FLAGS}
"${TRY_CRYPTO_REQUIRED_LIBS}"
"${TRY_CRYPTO_REQUIRED_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
@@ -599,6 +636,7 @@ main(int argc, char **argv)
# Inform user whether or not we found it; if not, log why we didn't.
IF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION})
MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- found")
+ SET(ARCHIVE_CRYPTO_${ALGORITHM} 1)
ELSE (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION})
MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- not found")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
@@ -617,6 +655,7 @@ main(int argc, char **argv)
LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS)
ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND)
ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION})
+ ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM})
ENDFOREACH(ALGORITHM ${ALGORITHMS})
ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION)
@@ -632,6 +671,7 @@ ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION)
MACRO(CHECK_CRYPTO_WIN CRYPTO_LIST)
IF(WIN32 AND NOT CYGWIN)
FOREACH(CRYPTO ${CRYPTO_LIST})
+ IF(NOT ARCHIVE_CRYPTO_${CRYPTO})
IF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN)
STRING(TOUPPER "${CRYPTO}" crypto)
SET(ALGID "")
@@ -651,9 +691,14 @@ MACRO(CHECK_CRYPTO_WIN CRYPTO_LIST)
SET(ALGID "CALG_SHA_512")
ENDIF ("${CRYPTO}" MATCHES "^SHA512$")
- SET(SOURCE "#define ${crypto}_COMPILE_TEST
-#define _WIN32_WINNT ${_WIN32_WINNT}
-#define WINVER ${WINVER}
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h)
+ FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h"
+ CONFDEFS_H)
+
+ SET(SOURCE "${CONFDEFS_H}
+
+#define ${crypto}_COMPILE_TEST
#include <windows.h>
#include <wincrypt.h>
@@ -668,15 +713,22 @@ main(int argc, char **argv)
FILE(WRITE "${SOURCE_FILE}" "${SOURCE}")
MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN")
+ IF(CMAKE_REQUIRED_LINKER_FLAGS)
+ SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS
+ "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}")
+ ELSE(CMAKE_REQUIRED_LINKER_FLAGS)
+ SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS)
+ ENDIF(CMAKE_REQUIRED_LINKER_FLAGS)
TRY_COMPILE(ARCHIVE_CRYPTO_${CRYPTO}_WIN
${CMAKE_BINARY_DIR}
${SOURCE_FILE}
- CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/libarchive"
+ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive" ${CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS}
OUTPUT_VARIABLE OUTPUT)
IF (ARCHIVE_CRYPTO_${CRYPTO}_WIN)
MESSAGE(STATUS
"Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- found")
+ SET(ARCHIVE_CRYPTO_${CRYPTO} 1)
ELSE (ARCHIVE_CRYPTO_${CRYPTO}_WIN)
MESSAGE(STATUS
"Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- not found")
@@ -688,6 +740,7 @@ main(int argc, char **argv)
ENDIF (ARCHIVE_CRYPTO_${CRYPTO}_WIN)
ENDIF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN)
+ ENDIF(NOT ARCHIVE_CRYPTO_${CRYPTO})
ENDFOREACH(CRYPTO)
ENDIF(WIN32 AND NOT CYGWIN)
ENDMACRO(CHECK_CRYPTO_WIN CRYPTO_LIST)
@@ -715,7 +768,7 @@ MACRO(CHECK_ICONV LIB TRY_ICONV_CONST)
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /WX")
ENDIF (MSVC)
#
- CHECK_C_SOURCE_COMPILES(
+ LIBARCHIVE_CHECK_C_SOURCE_COMPILES(
"#include <stdlib.h>
#include <iconv.h>
int main() {
@@ -868,49 +921,112 @@ ELSE(LIBXML2_FOUND)
ENDIF(LIBXML2_FOUND)
MARK_AS_ADVANCED(CLEAR LIBXML2_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR LIBXML2_LIBRARIES)
+
#
-# Find Libregex
+# POSIX Regular Expression support
#
-FIND_PATH(REGEX_INCLUDE_DIR regex.h)
-IF(REGEX_INCLUDE_DIR)
- CHECK_FUNCTION_EXISTS_GLIBC(regcomp HAVE_REGCOMP_LIBC)
+IF(POSIX_REGEX_LIB MATCHES "^(AUTO|LIBC|LIBREGEX)$")
#
- # If libc does not provide regex, find libregex.
+ # If PCREPOSIX is not found or not requested, try using regex
+ # from libc or libregex
#
- IF(NOT HAVE_REGCOMP_LIBC)
- CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
- FIND_LIBRARY(REGEX_LIBRARY regex)
- IF(REGEX_LIBRARY)
- SET(CMAKE_REQUIRED_LIBRARIES ${REGEX_LIBRARY})
- CHECK_FUNCTION_EXISTS_GLIBC(regcomp HAVE_REGCOMP_LIBREGEX)
- IF(HAVE_REGCOMP_LIBREGEX)
- LIST(APPEND ADDITIONAL_LIBS ${REGEX_LIBRARY})
- #
- # If regex.h is not found, retry looking for regex.h at
- # REGEX_INCLUDE_DIR
- #
- IF(NOT HAVE_REGEX_H)
- UNSET(HAVE_REGEX_H CACHE)
- INCLUDE_DIRECTORIES(${REGEX_INCLUDE_DIR})
- SET(CMAKE_REQUIRED_INCLUDES ${REGEX_INCLUDE_DIR})
- LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H)
- ENDIF(NOT HAVE_REGEX_H)
- # Test if a macro is needed for the library.
- TRY_MACRO_FOR_LIBRARY(
- "${REGEX_INCLUDE_DIR}" "${REGEX_LIBRARY}"
- COMPILES
- "#include <stddef.h>\n#include <regex.h>\nint main() {regex_t r;return regcomp(&r, \"\", 0);}"
- "USE_REGEX_DLL;USE_REGEX_STATIC")
- IF(USE_REGEX_DLL)
- ADD_DEFINITIONS(-DUSE_REGEX_DLL)
- ELSEIF(USE_REGEX_STATIC)
- ADD_DEFINITIONS(-DUSE_REGEX_STATIC)
- ENDIF(USE_REGEX_DLL)
- ENDIF(HAVE_REGCOMP_LIBREGEX)
- ENDIF(REGEX_LIBRARY)
- CMAKE_POP_CHECK_STATE() # Restore the state of the variables
- ENDIF(NOT HAVE_REGCOMP_LIBC)
-ENDIF(REGEX_INCLUDE_DIR)
+ FIND_PATH(REGEX_INCLUDE_DIR regex.h)
+ IF(REGEX_INCLUDE_DIR)
+ CHECK_FUNCTION_EXISTS_GLIBC(regcomp HAVE_REGCOMP_LIBC)
+ #
+ # If libc does not provide regex, find libregex.
+ #
+ IF(NOT HAVE_REGCOMP_LIBC)
+ CMAKE_PUSH_CHECK_STATE() # Save the state of the variables
+ FIND_LIBRARY(REGEX_LIBRARY regex)
+ IF(REGEX_LIBRARY)
+ SET(CMAKE_REQUIRED_LIBRARIES ${REGEX_LIBRARY})
+ CHECK_FUNCTION_EXISTS_GLIBC(regcomp HAVE_REGCOMP_LIBREGEX)
+ IF(HAVE_REGCOMP_LIBREGEX)
+ LIST(APPEND ADDITIONAL_LIBS ${REGEX_LIBRARY})
+ #
+ # If regex.h is not found, retry looking for regex.h at
+ # REGEX_INCLUDE_DIR
+ #
+ IF(NOT HAVE_REGEX_H)
+ UNSET(HAVE_REGEX_H CACHE)
+ INCLUDE_DIRECTORIES(${REGEX_INCLUDE_DIR})
+ SET(CMAKE_REQUIRED_INCLUDES ${REGEX_INCLUDE_DIR})
+ LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H)
+ ENDIF(NOT HAVE_REGEX_H)
+ # Test if a macro is needed for the library.
+ TRY_MACRO_FOR_LIBRARY(
+ "${REGEX_INCLUDE_DIR}" "${REGEX_LIBRARY}"
+ COMPILES
+ "#include <stddef.h>\n#include <regex.h>\nint main() {regex_t r;return regcomp(&r, \"\", 0);}"
+ "USE_REGEX_DLL;USE_REGEX_STATIC")
+ IF(USE_REGEX_DLL)
+ ADD_DEFINITIONS(-DUSE_REGEX_DLL)
+ ELSEIF(USE_REGEX_STATIC)
+ ADD_DEFINITIONS(-DUSE_REGEX_STATIC)
+ ENDIF(USE_REGEX_DLL)
+ ENDIF(HAVE_REGCOMP_LIBREGEX)
+ ENDIF(REGEX_LIBRARY)
+ CMAKE_POP_CHECK_STATE() # Restore the state of the variables
+ ENDIF(NOT HAVE_REGCOMP_LIBC)
+ ENDIF(REGEX_INCLUDE_DIR)
+ IF(HAVE_REGCOMP_LIBC OR HAVE_REGCOMP_LIBREGEX)
+ SET(FOUND_POSIX_REGEX_LIB 1)
+ ENDIF(HAVE_REGCOMP_LIBC OR HAVE_REGCOMP_LIBREGEX)
+ENDIF(POSIX_REGEX_LIB MATCHES "^(AUTO|LIBC|LIBREGEX)$")
+
+IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$")
+ #
+ # If requested, try finding library for PCREPOSIX
+ #
+ FIND_PACKAGE(LibGCC)
+ FIND_PACKAGE(PCREPOSIX)
+ IF(PCREPOSIX_FOUND)
+ INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${PCREPOSIX_LIBRARIES})
+ # Test if a macro is needed for the library.
+ TRY_MACRO_FOR_LIBRARY(
+ "${PCRE_INCLUDE_DIR}" "${PCREPOSIX_LIBRARIES}"
+ COMPILES
+ "#include <pcreposix.h>\nint main() {regex_t r;return regcomp(&r, \"\", 0);}"
+ "WITHOUT_PCRE_STATIC;PCRE_STATIC")
+ IF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC)
+ ADD_DEFINITIONS(-DPCRE_STATIC)
+ ELSEIF(NOT WITHOUT_PCRE_STATIC AND NOT PCRE_STATIC AND PCRE_FOUND)
+ # Determine if pcre static libraries are to be used.
+ LIST(APPEND ADDITIONAL_LIBS ${PCRE_LIBRARIES})
+ SET(TMP_LIBRARIES ${PCREPOSIX_LIBRARIES} ${PCRE_LIBRARIES})
+ MESSAGE(STATUS "trying again with -lpcre included")
+ TRY_MACRO_FOR_LIBRARY(
+ "${PCRE_INCLUDE_DIR}" "${TMP_LIBRARIES}"
+ COMPILES
+ "#include <pcreposix.h>\nint main() {regex_t r;return regcomp(&r, \"\", 0);}"
+ "WITHOUT_PCRE_STATIC;PCRE_STATIC")
+ IF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC)
+ ADD_DEFINITIONS(-DPCRE_STATIC)
+ ELSEIF(NOT WITHOUT_PCRE_STATIC AND NOT PCRE_STATIC AND MSVC AND LIBGCC_FOUND)
+ # When doing a Visual Studio build using pcre static libraries
+ # built using the mingw toolchain, -lgcc is needed to resolve
+ # ___chkstk_ms.
+ MESSAGE(STATUS "Visual Studio build detected, trying again with -lgcc included")
+ LIST(APPEND ADDITIONAL_LIBS ${LIBGCC_LIBRARIES})
+ SET(TMP_LIBRARIES ${PCREPOSIX_LIBRARIES} ${PCRE_LIBRARIES} ${LIBGCC_LIBRARIES})
+ TRY_MACRO_FOR_LIBRARY(
+ "${PCRE_INCLUDE_DIR}" "${TMP_LIBRARIES}"
+ COMPILES
+ "#include <pcreposix.h>\nint main() {regex_t r;return regcomp(&r, \"\", 0);}"
+ "WITHOUT_PCRE_STATIC;PCRE_STATIC")
+ IF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC)
+ ADD_DEFINITIONS(-DPCRE_STATIC)
+ ENDIF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC)
+ ENDIF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC)
+ ENDIF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC)
+ ENDIF(PCREPOSIX_FOUND)
+ MARK_AS_ADVANCED(CLEAR PCRE_INCLUDE_DIR)
+ MARK_AS_ADVANCED(CLEAR PCREPOSIX_LIBRARIES)
+ MARK_AS_ADVANCED(CLEAR PCRE_LIBRARIES)
+ MARK_AS_ADVANCED(CLEAR LIBGCC_LIBRARIES)
+ENDIF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$")
#
# Check functions
@@ -1015,14 +1131,14 @@ CMAKE_POP_CHECK_STATE() # Restore the state of the variables
# Make sure we have the POSIX version of readdir_r, not the
# older 2-argument version.
-CHECK_C_SOURCE_COMPILES(
+LIBARCHIVE_CHECK_C_SOURCE_COMPILES(
"#include <dirent.h>\nint main() {DIR *d = opendir(\".\"); struct dirent e,*r; return readdir_r(d,&e,&r);}"
HAVE_READDIR_R)
# Only detect readlinkat() if we also have AT_FDCWD in unistd.h.
# NOTE: linux requires fcntl.h for AT_FDCWD.
-CHECK_C_SOURCE_COMPILES(
+LIBARCHIVE_CHECK_C_SOURCE_COMPILES(
"#include <fcntl.h>\n#include <unistd.h>\nint main() {char buf[10]; return readlinkat(AT_FDCWD, \"\", buf, 0);}"
HAVE_READLINKAT)
@@ -1031,10 +1147,10 @@ CHECK_C_SOURCE_COMPILES(
# of interest and verify that the result can be linked.
# CHECK_FUNCTION_EXISTS doesn't accept a header argument,
# CHECK_SYMBOL_EXISTS doesn't test linkage.
-CHECK_C_SOURCE_COMPILES(
+LIBARCHIVE_CHECK_C_SOURCE_COMPILES(
"#include <sys/mkdev.h>\nint main() { return major(256); }"
MAJOR_IN_MKDEV)
-CHECK_C_SOURCE_COMPILES(
+LIBARCHIVE_CHECK_C_SOURCE_COMPILES(
"#include <sys/sysmacros.h>\nint main() { return major(256); }"
MAJOR_IN_SYSMACROS)
View
46 Makefile.am
@@ -120,6 +120,7 @@ libarchive_la_SOURCES= \
libarchive/archive_rb.c \
libarchive/archive_rb.h \
libarchive/archive_read.c \
+ libarchive/archive_read_append_filter.c \
libarchive/archive_read_data_into_fd.c \
libarchive/archive_read_disk_entry_from_file.c \
libarchive/archive_read_disk_posix.c \
@@ -131,6 +132,7 @@ libarchive_la_SOURCES= \
libarchive/archive_read_open_filename.c \
libarchive/archive_read_open_memory.c \
libarchive/archive_read_private.h \
+ libarchive/archive_read_set_format.c \
libarchive/archive_read_set_options.c \
libarchive/archive_read_support_filter_all.c \
libarchive/archive_read_support_filter_bzip2.c \
@@ -197,6 +199,7 @@ libarchive_la_SOURCES= \
libarchive/archive_write_set_format_iso9660.c \
libarchive/archive_write_set_format_mtree.c \
libarchive/archive_write_set_format_pax.c \
+ libarchive/archive_write_set_format_raw.c \
libarchive/archive_write_set_format_shar.c \
libarchive/archive_write_set_format_ustar.c \
libarchive/archive_write_set_format_v7tar.c \
@@ -233,14 +236,32 @@ libarchive_man_MANS= \
libarchive/archive_entry_stat.3 \
libarchive/archive_entry_time.3 \
libarchive/archive_read.3 \
+ libarchive/archive_read_data.3 \
libarchive/archive_read_disk.3 \
+ libarchive/archive_read_extract.3 \
+ libarchive/archive_read_filter.3 \
+ libarchive/archive_read_format.3 \
+ libarchive/archive_read_free.3 \
+ libarchive/archive_read_header.3 \
+ libarchive/archive_read_new.3 \
+ libarchive/archive_read_open.3 \
libarchive/archive_read_set_options.3 \
libarchive/archive_util.3 \
libarchive/archive_write.3 \
+ libarchive/archive_write_blocksize.3 \
+ libarchive/archive_write_data.3 \
libarchive/archive_write_disk.3 \
+ libarchive/archive_write_filter.3 \
+ libarchive/archive_write_finish_entry.3 \
+ libarchive/archive_write_format.3 \
+ libarchive/archive_write_free.3 \
+ libarchive/archive_write_header.3 \
+ libarchive/archive_write_new.3 \
+ libarchive/archive_write_open.3 \
libarchive/archive_write_set_options.3 \
libarchive/cpio.5 \
libarchive/libarchive.3 \
+ libarchive/libarchive_changes.3 \
libarchive/libarchive_internals.3 \
libarchive/libarchive-formats.5 \
libarchive/mtree.5 \
@@ -303,7 +324,9 @@ libarchive_test_SOURCES= \
libarchive/test/test_archive_set_error.c \
libarchive/test/test_archive_string.c \
libarchive/test/test_archive_string_conversion.c \
+ libarchive/test/test_archive_write_add_filter_by_name.c \
libarchive/test/test_archive_write_set_filter_option.c \
+ libarchive/test/test_archive_write_set_format_by_name.c \
libarchive/test/test_archive_write_set_format_option.c \
libarchive/test/test_archive_write_set_option.c \
libarchive/test/test_archive_write_set_options.c \
@@ -392,6 +415,7 @@ libarchive_test_SOURCES= \
libarchive/test/test_read_format_rar.c \
libarchive/test/test_read_format_raw.c \
libarchive/test/test_read_format_tar.c \
+ libarchive/test/test_read_format_tar_empty_pax.c \
libarchive/test/test_read_format_tar_empty_filename.c \
libarchive/test/test_read_format_tar_filename.c \
libarchive/test/test_read_format_tbz.c \
@@ -405,9 +429,11 @@ libarchive_test_SOURCES= \
libarchive/test/test_read_format_zip_comment_stored.c \
libarchive/test/test_read_format_zip_filename.c \
libarchive/test/test_read_format_zip_mac_metadata.c \
+ libarchive/test/test_read_format_zip_sfx.c \
libarchive/test/test_read_large.c \
libarchive/test/test_read_pax_truncated.c \
libarchive/test/test_read_position.c \
+ libarchive/test/test_read_set_format.c \
libarchive/test/test_read_truncated.c \
libarchive/test/test_read_truncated_filter.c \
libarchive/test/test_sparse_basic.c \
@@ -441,6 +467,8 @@ libarchive_test_SOURCES= \
libarchive/test/test_write_filter_uuencode.c \
libarchive/test/test_write_filter_xz.c \
libarchive/test/test_write_format_7zip.c \
+ libarchive/test/test_write_format_7zip_empty.c \
+ libarchive/test/test_write_format_7zip_large.c \
libarchive/test/test_write_format_ar.c \
libarchive/test/test_write_format_cpio.c \
libarchive/test/test_write_format_cpio_empty.c \
@@ -460,6 +488,8 @@ libarchive_test_SOURCES= \
libarchive/test/test_write_format_mtree_no_separator.c \
libarchive/test/test_write_format_mtree_quoted_filename.c\
libarchive/test/test_write_format_pax.c \
+ libarchive/test/test_write_format_raw.c \
+ libarchive/test/test_write_format_raw_b64.c \
libarchive/test/test_write_format_shar_empty.c \
libarchive/test/test_write_format_tar.c \
libarchive/test/test_write_format_tar_empty.c \
@@ -532,6 +562,16 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_rar_multivolume_single_file.part1.rar.uu \
libarchive/test/test_rar_multivolume_single_file.part2.rar.uu \
libarchive/test/test_rar_multivolume_single_file.part3.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu \
+ libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu \
libarchive/test/test_read_filter_grzip.tar.grz.uu \
libarchive/test/test_read_filter_lrzip.tar.lrz.uu \
libarchive/test/test_read_filter_lzop.tar.lzo.uu \
@@ -629,6 +669,7 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_read_format_rar_windows.rar.uu \
libarchive/test/test_read_format_raw.data.Z.uu \
libarchive/test/test_read_format_raw.data.uu \
+ libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu \
libarchive/test/test_read_format_tar_empty_filename.tar.uu \
libarchive/test/test_read_format_tar_filename_koi8r.tar.Z.uu \
libarchive/test/test_read_format_ustar_filename_cp866.tar.Z.uu \
@@ -645,6 +686,7 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu \
libarchive/test/test_read_format_zip_length_at_end.zip.uu \
libarchive/test/test_read_format_zip_mac_metadata.zip.uu \
+ libarchive/test/test_read_format_zip_sfx.uu \
libarchive/test/test_read_format_zip_symlink.zip.uu \
libarchive/test/test_read_format_zip_ux.zip.uu \
libarchive/test/test_read_large_splitted_rar_aa.uu \
@@ -659,9 +701,9 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_splitted_rar_seek_support_aa.uu \
libarchive/test/test_splitted_rar_seek_support_ab.uu \
libarchive/test/test_splitted_rar_seek_support_ac.uu \
- libarchive/test/test_write_disk_hfs_appledouble.cpio.gz.uu \
+ libarchive/test/test_write_disk_appledouble.cpio.gz.uu \
libarchive/test/test_write_disk_hfs_compression.tgz.uu \
- libarchive/test/test_write_disk_mac_metaata.tar.gz.uu \
+ libarchive/test/test_write_disk_mac_metadata.tar.gz.uu \
libarchive/test/test_write_disk_no_hfs_compression.tgz.uu \
libarchive/test/CMakeLists.txt \
libarchive/test/README
View
29 NEWS
@@ -1,3 +1,32 @@
+Feb 09, 2013: libarchive 3.1.2 released
+
+Jan 28, 2013: libarchive's new website moved to http://www.libarchive.org.
+
+Jan 13, 2013: libarchive 3.1.1 released
+
+Jan 13, 2013: libarchive 3.1.0 released
+
+Dec 07, 2012: Implement functions to manually set the format and filters used.
+
+Nov 11, 2012: Add support for __MACOSX directory in Zip archives, which resource
+ forks are stored in.
+
+Oct 20, 2012: Add support for writing v7 tar format.
+
+Oct 09, 2012: Add support for grzip compression.
+
+Oct 07, 2012: Introduce b64encode filter.
+Oct 07, 2012: Introduce uuencode filter.
+
+Oct 06, 2012: Add support for lzop.
+
+Sep 27, 2012: Implement function used to seek within data blocks.
+ (Currently only supported for uncompressed RAR archives).
+
+Apr 22, 2012: Add basic archive read and write filter support for lrzip.
+
+Mar 27, 2012: libarchive 3.0.4 released
+
Feb 05, 2012: libarchive development now hosted at GitHub.
http://libarchive.github.com/
Feb 05, 2012: libarchive's issue tracker remains at Google Code.
View
2 README
@@ -1,7 +1,7 @@
README for libarchive bundle.
Questions? Issues?
- * http://libarchive.github.com/ is the home for ongoing
+ * http://www.libarchive.org is the home for ongoing
libarchive development, including documentation, and
links to the libarchive mailing lists.
* To report an issue, use the issue tracker at
View
35 build/README.txt
@@ -0,0 +1,35 @@
+Notes on making a new release of libarchive
+===========================================
+
+The following serves as a guide for libarchive developers on the general
+process to be followed when making a new release of libarchive.
+
+* Update build/version with the version number of the release to be made.
+* If the library's ABI has changed, the library's soname major version *MUST*
+ be updated. Update configure.ac and CMakeLists.txt appropriately.
+ - For configure.ac, the variable ARCHIVE_INTERFACE needs to be updated.
+ - For CMakeLists.txt, the variable INTERFACE_VERSION needs to be updated.
+* Update the entries in the NEWS file accordingly.
+* Run `build/makerelease.sh` from the top source directory. Running this script
+ will do the following.
+ - Removes all Makefile.am development build specific CFLAGS from
+ Makefile.am.
+ - Update configure scripts and header files with the appropriate version
+ number from build/version.
+ - Rebuild the documentation directory.
+ - Runs a full cmake build and test.
+ - Runs a full autotools build and test.
+ - Builds the .tar.gz and .zip distribution files.
+* Commit all changed files into git.
+ - This should be build/version, NEWS, and the files edited by running
+ build/makerelease.sh.
+* Tag the release appropriately. The tag should also have an appropriate
+ message.
+ - The git command is as follows:
+ $ git tag -m "Libarchive <version>" v<version>
+ Replace <version> with the version to be released.
+* Copy all the generated wiki files and commit them into the libarchive.wiki
+ repository. Overwrite any preexisting files with the same name (these files
+ are always autogenerated from the libarchive release after every release).
+* Update the libarchive.org website accordingly.
+* Make an announcement to the libarchive-announce mailing list.
View
5 build/autogen.sh
@@ -48,6 +48,11 @@ perl -p -i -e "s/^(#define\tARCHIVE_VERSION_STRING).*/\$1 \"libarchive $VS\"/" l
perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_S\]),.*\)/$1,['"$VS"'])/' configure.ac
perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_N\]),.*\)/$1,['"$VN"'])/' configure.ac
+# Remove developer CFLAGS if a release build is being made
+if [ -n "${MAKE_LIBARCHIVE_RELEASE}" ]; then
+ perl -p -i -e "s/^(DEV_CFLAGS.*)/# \$1/" Makefile.am
+fi
+
set -xe
aclocal -I build/autoconf
View
2 build/bump-version.sh
@@ -31,6 +31,6 @@ echo $ANNOUNCE
# Add a version notice to NEWS
mv NEWS NEWS.bak
chmod +w NEWS.bak
-echo > NEWS
echo $ANNOUNCE >> NEWS
+echo >> NEWS
cat NEWS.bak >> NEWS
View
22 build/cmake/FindLibGCC.cmake
@@ -0,0 +1,22 @@
+# - Find libgcc
+# Find the libgcc library.
+#
+# LIBGCC_LIBRARIES - List of libraries when using libgcc
+# LIBGCC_FOUND - True if libgcc found.
+
+IF (LIBGCC_LIBRARY)
+ # Already in cache, be silent
+ SET(LIBGCC_FIND_QUIETLY TRUE)
+ENDIF (LIBGCC_LIBRARY)
+
+FIND_LIBRARY(LIBGCC_LIBRARY NAMES gcc libgcc)
+
+# handle the QUIETLY and REQUIRED arguments and set LIBGCC_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGCC DEFAULT_MSG LIBGCC_LIBRARY)
+
+IF(LIBGCC_FOUND)
+ SET(LIBGCC_LIBRARIES ${LIBGCC_LIBRARY})
+ SET(HAVE_LIBGCC 1)
+ENDIF(LIBGCC_FOUND)
View
23 build/cmake/FindNettle.cmake
@@ -0,0 +1,23 @@
+# - Find Nettle
+# Find the Nettle include directory and library
+#
+# NETTLE_INCLUDE_DIR - where to find <nettle/sha.h>, etc.
+# NETTLE_LIBRARIES - List of libraries when using libnettle.
+# NETTLE_FOUND - True if libnettle found.
+
+IF (NETTLE_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(NETTLE_FIND_QUIETLY TRUE)
+ENDIF (NETTLE_INCLUDE_DIR)
+
+FIND_PATH(NETTLE_INCLUDE_DIR nettle/md5.h nettle/ripemd160.h nettle/sha.h)
+FIND_LIBRARY(NETTLE_LIBRARY NAMES nettle libnettle)
+
+# handle the QUIETLY and REQUIRED arguments and set NETTLE_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETTLE DEFAULT_MSG NETTLE_LIBRARY NETTLE_INCLUDE_DIR)
+
+IF(NETTLE_FOUND)
+ SET(NETTLE_LIBRARIES ${NETTLE_LIBRARY})
+ENDIF(NETTLE_FOUND)
View
34 build/cmake/FindPCREPOSIX.cmake
@@ -0,0 +1,34 @@
+# - Find pcreposix
+# Find the native PCRE and PCREPOSIX include and libraries
+#
+# PCRE_INCLUDE_DIR - where to find pcreposix.h, etc.
+# PCREPOSIX_LIBRARIES - List of libraries when using libpcreposix.
+# PCRE_LIBRARIES - List of libraries when using libpcre.
+# PCREPOSIX_FOUND - True if libpcreposix found.
+# PCRE_FOUND - True if libpcre found.
+
+IF (PCRE_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(PCRE_FIND_QUIETLY TRUE)
+ENDIF (PCRE_INCLUDE_DIR)
+
+FIND_PATH(PCRE_INCLUDE_DIR pcreposix.h)
+FIND_LIBRARY(PCREPOSIX_LIBRARY NAMES pcreposix libpcreposix)
+FIND_LIBRARY(PCRE_LIBRARY NAMES pcre libpcre)
+
+# handle the QUIETLY and REQUIRED arguments and set PCREPOSIX_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCREPOSIX DEFAULT_MSG PCREPOSIX_LIBRARY PCRE_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY)
+
+IF(PCREPOSIX_FOUND)
+ SET(PCREPOSIX_LIBRARIES ${PCREPOSIX_LIBRARY})
+ SET(HAVE_LIBPCREPOSIX 1)
+ SET(HAVE_PCREPOSIX_H 1)
+ENDIF(PCREPOSIX_FOUND)
+
+IF(PCRE_FOUND)
+ SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
+ SET(HAVE_LIBPCRE 1)
+ENDIF(PCRE_FOUND)
View
106 build/cmake/LibarchiveCheckCSourceCompiles.cmake
@@ -0,0 +1,106 @@
+# - Check if given C source compiles and links into an executable
+# CHECK_C_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
+# <code> - source code to try to compile, must define 'main'
+# <var> - variable to store whether the source code compiled
+# <fail-regex> - fail if test output matches this regex
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+
+#=============================================================================
+# Copyright 2005-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+#
+# Extra arguments added by libarchive
+# CMAKE_REQUIRED_LINKER_FLAGS = string of linker command line flags
+#
+
+include(CMakeExpandImportedTargets)
+
+
+macro(LIBARCHIVE_CHECK_C_SOURCE_COMPILES SOURCE VAR)
+ if("${VAR}" MATCHES "^${VAR}$")
+ set(_FAIL_REGEX)
+ set(_key)
+ foreach(arg ${ARGN})
+ if("${arg}" MATCHES "^(FAIL_REGEX)$")
+ set(_key "${arg}")
+ elseif(_key)
+ list(APPEND _${_key} "${arg}")
+ else()
+ message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
+ endif()
+ endforeach()
+ set(MACRO_CHECK_FUNCTION_DEFINITIONS
+ "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ if(CMAKE_REQUIRED_LIBRARIES)
+ # this one translates potentially used imported library targets to their files on disk
+ CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
+ set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+ "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ if(CMAKE_REQUIRED_LINKER_FLAGS)
+ set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS
+ "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}")
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+ "${SOURCE}\n")
+
+ message(STATUS "Performing Test ${VAR}")
+ try_compile(${VAR}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ${CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS}
+ "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
+ "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
+ OUTPUT_VARIABLE OUTPUT)
+
+ foreach(_regex ${_FAIL_REGEX})
+ if("${OUTPUT}" MATCHES "${_regex}")
+ set(${VAR} 0)
+ endif()
+ endforeach()
+
+ if(${VAR})
+ set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ message(STATUS "Performing Test ${VAR} - Success")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "${OUTPUT}\n"
+ "Source file was:\n${SOURCE}\n")
+ else()
+ message(STATUS "Performing Test ${VAR} - Failed")
+ set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
+ "${OUTPUT}\n"
+ "Source file was:\n${SOURCE}\n")
+ endif()
+ endif()
+endmacro()
+
View
102 build/cmake/LibarchiveCheckCSourceRuns.cmake
@@ -0,0 +1,102 @@
+# - Check if the given C source code compiles and runs.
+# CHECK_C_SOURCE_RUNS(<code> <var>)
+# <code> - source code to try to compile
+# <var> - variable to store the result
+# (1 for success, empty for failure)
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+
+#=============================================================================
+# Copyright 2006-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+#
+# Extra arguments added by libarchive
+# CMAKE_REQUIRED_LINKER_FLAGS = string of linker command line flags
+#
+
+include(CMakeExpandImportedTargets)
+
+
+macro(LIBARCHIVE_CHECK_C_SOURCE_RUNS SOURCE VAR)
+ if("${VAR}" MATCHES "^${VAR}$")
+ set(MACRO_CHECK_FUNCTION_DEFINITIONS
+ "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ if(CMAKE_REQUIRED_LIBRARIES)
+ # this one translates potentially used imported library targets to their files on disk
+ CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
+ set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
+ "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ if(CMAKE_REQUIRED_LINKER_FLAGS)
+ set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS
+ "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}")
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
+ "${SOURCE}\n")
+
+ message(STATUS "Performing Test ${VAR}")
+ try_run(${VAR}_EXITCODE ${VAR}_COMPILED
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ${CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS}
+ -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
+ "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
+ "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
+ COMPILE_OUTPUT_VARIABLE OUTPUT)
+ # if it did not compile make the return value fail code of 1
+ if(NOT ${VAR}_COMPILED)
+ set(${VAR}_EXITCODE 1)
+ endif()
+ # if the return value was 0 then it worked
+ if("${${VAR}_EXITCODE}" EQUAL 0)
+ set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ message(STATUS "Performing Test ${VAR} - Success")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "${OUTPUT}\n"
+ "Return value: ${${VAR}}\n"
+ "Source file was:\n${SOURCE}\n")
+ else()
+ if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ set(${VAR} "${${VAR}_EXITCODE}")
+ else()
+ set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ endif()
+
+ message(STATUS "Performing Test ${VAR} - Failed")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
+ "${OUTPUT}\n"
+ "Return value: ${${VAR}_EXITCODE}\n"
+ "Source file was:\n${SOURCE}\n")
+
+ endif()
+ endif()
+endmacro()
+
View
24 build/cmake/config.h.in
@@ -579,6 +579,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `expat' library (-lexpat). */
#cmakedefine HAVE_LIBEXPAT 1
+/* Define to 1 if you have the `gcc' library (-lgcc). */
+#cmakedefine HAVE_LIBGCC 1
+
/* Define to 1 if you have the `lzma' library (-llzma). */
#cmakedefine HAVE_LIBLZMA 1
@@ -588,6 +591,15 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `lzo2' library (-llzo2). */
#cmakedefine HAVE_LIBLZO2 1
+/* Define to 1 if you have the `nettle' library (-lnettle). */
+#cmakedefine HAVE_LIBNETTLE 1
+
+/* Define to 1 if you have the `pcre' library (-lpcre). */
+#cmakedefine HAVE_LIBPCRE 1
+
+/* Define to 1 if you have the `pcreposix' library (-lpcreposix). */
+#cmakedefine HAVE_LIBPCREPOSIX 1
+
/* Define to 1 if you have the `xml2' library (-lxml2). */
#cmakedefine HAVE_LIBXML2 1
@@ -697,6 +709,15 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#cmakedefine HAVE_NDIR_H 1
+/* Define to 1 if you have the <nettle/md5.h> header file. */
+#cmakedefine HAVE_NETTLE_MD5_H 1
+
+/* Define to 1 if you have the <nettle/ripemd160.h> header file. */
+#cmakedefine HAVE_NETTLE_RIPEMD160_H 1
+
+/* Define to 1 if you have the <nettle/sha.h> header file. */
+#cmakedefine HAVE_NETTLE_SHA_H 1
+
/* Define to 1 if you have the `nl_langinfo' function. */
#cmakedefine HAVE_NL_LANGINFO 1
@@ -706,6 +727,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the <paths.h> header file. */
#cmakedefine HAVE_PATHS_H 1
+/* Define to 1 if you have the <pcreposix.h> header file. */
+#cmakedefine HAVE_PCREPOSIX_H 1
+
/* Define to 1 if you have the `pipe' function. */
#cmakedefine HAVE_PIPE 1
View
1 build/makerelease.sh
@@ -46,6 +46,7 @@ rm -rf _cmtest
#
# Construct and verify the autoconf build system
#
+export MAKE_LIBARCHIVE_RELEASE="1"
/bin/sh build/autogen.sh
# Get the newest config.guess/config.sub from savannah.gnu.org
View
2 build/version
@@ -1 +1 @@
-3000200a
+3001002
View
191 configure.ac
@@ -4,8 +4,8 @@ dnl First, define all of the version numbers up front.
dnl In particular, this allows the version macro to be used in AC_INIT
dnl These first two version numbers are updated automatically on each release.
-m4_define([LIBARCHIVE_VERSION_S],[3.0.200a])
-m4_define([LIBARCHIVE_VERSION_N],[3000200])
+m4_define([LIBARCHIVE_VERSION_S],[3.1.2])
+m4_define([LIBARCHIVE_VERSION_N],[3001002])
dnl bsdtar and bsdcpio versioning tracks libarchive
m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())
@@ -37,8 +37,8 @@ ARCHIVE_MINOR=$(( (LIBARCHIVE_VERSION_N() / 1000) % 1000 ))
# Libarchive 2.8 == libtool interface 10 = 2 + 8
# Libarchive 2.9 == libtool interface 11 = 2 + 8
# Libarchive 3.0 == libtool interface 12
-# Libarchive 3.x == libtool interface 12 + x
-ARCHIVE_INTERFACE=`echo $((12 + ${ARCHIVE_MINOR}))`
+# Libarchive 3.1 == libtool interface 13
+ARCHIVE_INTERFACE=`echo $((13 + ${ARCHIVE_MINOR}))`
# Libarchive revision is bumped on any source change === libtool revision
ARCHIVE_REVISION=$(( LIBARCHIVE_VERSION_N() % 1000 ))
# Libarchive minor is bumped on any interface addition === libtool age
@@ -218,7 +218,7 @@ AS_VAR_IF([ac_cv_have_decl_EXT2_IOC_GETFLAGS], [yes],
AC_CHECK_HEADERS([inttypes.h io.h langinfo.h limits.h])
AC_CHECK_HEADERS([linux/fiemap.h linux/fs.h linux/magic.h linux/types.h])
-AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h regex.h signal.h spawn.h])
+AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h signal.h spawn.h])
AC_CHECK_HEADERS([stdarg.h stdint.h stdlib.h string.h])
AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/extattr.h])
AC_CHECK_HEADERS([sys/ioctl.h sys/mkdev.h sys/mount.h])
@@ -247,7 +247,29 @@ AC_ARG_WITH([bz2lib],
if test "x$with_bz2lib" != "xno"; then
AC_CHECK_HEADERS([bzlib.h])
- AC_CHECK_LIB(bz2,BZ2_bzDecompressInit)
+ case "$host_os" in
+ *mingw* | *cygwin*)
+ dnl AC_CHECK_LIB cannot be used on the Windows port of libbz2, therefore
+ dnl use AC_LINK_IFELSE.
+ AC_MSG_CHECKING([for BZ2_bzDecompressInit in -lbz2])
+ old_LIBS="$LIBS"
+ LIBS="-lbz2 $LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(#include <bzlib.h>
+ int main() { return BZ2_bzDecompressInit(NULL, 0, 0); })],
+ [ac_cv_lib_bz2_BZ2_bzDecompressInit=yes],
+ [ac_cv_lib_bz2_BZ2_bzDecompressInit=no])
+ LIBS="$old_LIBS"
+ AC_MSG_RESULT($ac_cv_lib_bz2_BZ2_bzDecompressInit)
+ if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then
+ AC_DEFINE([HAVE_LIBBZ2], [1], [Define to 1 if you have the `bz2' library (-lbz2).])
+ LIBS="-lbz2 $LIBS"
+ fi
+ ;;
+ *)
+ AC_CHECK_LIB(bz2,BZ2_bzDecompressInit)
+ ;;
+ esac
fi
AC_ARG_WITH([lzmadec],
@@ -324,12 +346,61 @@ if test "x$ac_cv_header_libxml_xmlreader_h" != "xyes"; then
fi
fi
-AC_ARG_WITH([libregex],
- AS_HELP_STRING([--without-libregex], [Don't build support for regex through libregex]))
-
-if test "x$with_libregex" != "xno"; then
+AC_ARG_ENABLE([posix-regex-lib],
+ [AS_HELP_STRING([--enable-posix-regex-lib],
+ [choose what library to use for POSIX regular expression support (default: auto)])
+ AS_HELP_STRING([--enable-posix-regex-lib=libc], [use libc POSIX regular expression support])
+ AS_HELP_STRING([--enable-posix-regex-lib=libregex], [use libregex POSIX regular expression support])
+ AS_HELP_STRING([--enable-posix-regex-lib=libpcreposix], [use libpcreposix POSIX regular expression support])
+ AS_HELP_STRING([--disable-posix-regex-lib], [don't enable POSIX regular expression support])],
+ [], [enable_posix_regex_lib=auto])
+
+posix_regex_lib_found=
+if test "$enable_posix_regex_lib" = "auto" || test "$enable_posix_regex_lib" = "libc" || test "$enable_posix_regex_lib" = "libregex"; then
+ AC_CHECK_HEADERS([regex.h])
if test "x$ac_cv_header_regex_h" != "xno"; then
- AC_CHECK_FUNC(regcomp, , [AC_CHECK_LIB(regex,regcomp)])
+ AC_CHECK_FUNC(regcomp)
+ if test "x$ac_cv_func_regcomp" = xyes; then
+ posix_regex_lib_found=1
+ else
+ AC_CHECK_LIB(regex,regcomp)
+ if test "x$ac_cv_lib_regex_regcomp" = xyes; then
+ posix_regex_lib_found=1
+ fi
+ fi
+ fi
+fi
+if test -z $posix_regex_lib_found && (test "$enable_posix_regex_lib" = "auto" || test "$enable_posix_regex_lib" = "libpcreposix"); then
+ AC_CHECK_HEADERS([pcreposix.h])
+ AC_CHECK_LIB(pcreposix,regcomp)
+ if test "x$ac_cv_lib_pcreposix_regcomp" != xyes; then
+ AC_MSG_NOTICE(trying libpcreposix check again with libpcre)
+ unset ac_cv_lib_pcreposix_regcomp
+ AC_CHECK_LIB(pcre,pcre_exec)
+ AC_CHECK_LIB(pcreposix,regcomp)
+ if test "x$ac_cv_lib_pcre_pcre_exec" = xyes && test "x$ac_cv_lib_pcreposix_regcomp" = xyes; then
+ AC_MSG_CHECKING(if PCRE_STATIC needs to be defined)
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(#include <pcreposix.h>
+ int main() { return regcomp(NULL, NULL, 0); })],
+ [without_pcre_static=yes],
+ [without_pcre_static=no])
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(#define PCRE_STATIC
+ #include <pcreposix.h>
+ int main() { return regcomp(NULL, NULL, 0); })],
+ [with_pcre_static=yes],
+ [with_pcre_static=no])
+ if test "x$without_pcre_static" != xyes && test "x$with_pcre_static" = xyes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([PCRE_STATIC], [1], [Define to 1 if PCRE_STATIC needs to be defined.])
+ elif test "x$without_pcre_static" = xyes || test "x$with_pcre_static" = xyes; then
+ AC_MSG_RESULT(no)
+ fi
+ posix_regex_lib_found=1
+ fi
+ else
+ posix_regex_lib_found=1
fi
fi
@@ -562,10 +633,8 @@ AC_SYS_LARGEFILE
dnl NOTE: Crypto checks must run last.
AC_DEFUN([CRYPTO_CHECK], [
if test "$found_$1" != yes; then
- saved_LIBS="$LIBS"
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I. -I$srcdir -I$srcdir/libarchive"
- LIBS="$LIBS $mdLIBS $4"
touch "check_crypto_md.h"
AC_MSG_CHECKING([support for ARCHIVE_CRYPTO_$1_$2])
AC_LINK_IFELSE([AC_LANG_SOURCE([
@@ -587,15 +656,10 @@ main(int argc, char **argv)
])],
[ AC_MSG_RESULT([yes])
found_$1=yes
- if [[ -n "$4" ]]; then
- # The .$4 avoids -e, which doesn't work on Solaris 10
- # The _$mdLIBS allows .$4 to match at beginning of string <sigh>
- test -n "$(echo _$mdLIBS | $GREP .$4)" || mdLIBS="$mdLIBS $4"
- fi
+ found_$2=yes
AC_DEFINE(ARCHIVE_CRYPTO_$1_$2, 1, [ $1 via ARCHIVE_CRYPTO_$1_$2 supported.])
],
[ AC_MSG_RESULT([no])])
- LIBS="$saved_LIBS"
CPPFLAGS="$saved_CPPFLAGS"
rm "check_crypto_md.h"
fi
@@ -605,8 +669,6 @@ AC_DEFUN([CRYPTO_CHECK_WIN], [
if test "$found_$1" != yes; then
AC_MSG_CHECKING([support for ARCHIVE_CRYPTO_$1_WIN])
AC_LINK_IFELSE([AC_LANG_SOURCE([
-#define _WIN32_WINNT 0x0500
-#define WINVER 0x0500
#define ARCHIVE_$1_COMPILE_TEST
#include <windows.h>
#include <wincrypt.h>
@@ -622,6 +684,7 @@ main(int argc, char **argv)
])],
[ AC_MSG_RESULT([yes])
found_$1=yes
+ found_WIN=yes
AC_DEFINE(ARCHIVE_CRYPTO_$1_WIN, 1, [ $1 via ARCHIVE_CRYPTO_$1_WIN supported.])
],
[ AC_MSG_RESULT([no])])
@@ -629,12 +692,7 @@ main(int argc, char **argv)
])
case "$host_os" in
- *mingw* )
- CRYPTO_CHECK_WIN(MD5, CALG_MD5)
- CRYPTO_CHECK_WIN(SHA1, CALG_SHA1)
- CRYPTO_CHECK_WIN(SHA256, CALG_SHA_256)
- CRYPTO_CHECK_WIN(SHA384, CALG_SHA_384)
- CRYPTO_CHECK_WIN(SHA512, CALG_SHA_512)
+ *mingw* | *cygwin*)
;;
*)
CRYPTO_CHECK(MD5, LIBC, md5)
@@ -658,30 +716,73 @@ case "$host_os" in
esac
if test "x$with_nettle" != "xno"; then
- CRYPTO_CHECK(MD5, NETTLE, md5, -lnettle)
- CRYPTO_CHECK(RMD160, NETTLE, rmd160, -lnettle)
- CRYPTO_CHECK(SHA1, NETTLE, sha1, -lnettle)
- CRYPTO_CHECK(SHA256, NETTLE, sha256, -lnettle)
- CRYPTO_CHECK(SHA384, NETTLE, sha384, -lnettle)
- CRYPTO_CHECK(SHA512, NETTLE, sha512, -lnettle)
+ AC_CHECK_HEADERS([nettle/md5.h nettle/ripemd160.h nettle/sha.h])
+ saved_LIBS=$LIBS
+ AC_CHECK_LIB(nettle,main)
+ CRYPTO_CHECK(MD5, NETTLE, md5)
+ CRYPTO_CHECK(RMD160, NETTLE, rmd160)
+ CRYPTO_CHECK(SHA1, NETTLE, sha1)
+ CRYPTO_CHECK(SHA256, NETTLE, sha256)
+ CRYPTO_CHECK(SHA384, NETTLE, sha384)
+ CRYPTO_CHECK(SHA512, NETTLE, sha512)
+ if test "x$found_NETTLE" != "xyes"; then
+ LIBS=$saved_LIBS
+ fi
fi
if test "x$with_openssl" != "xno"; then
- CRYPTO_CHECK(MD5, OPENSSL, md5, -lcrypto)
- CRYPTO_CHECK(RMD160, OPENSSL, rmd160, -lcrypto)
- CRYPTO_CHECK(SHA1, OPENSSL, sha1, -lcrypto)
- CRYPTO_CHECK(SHA256, OPENSSL, sha256, -lcrypto)
- CRYPTO_CHECK(SHA384, OPENSSL, sha384, -lcrypto)
- CRYPTO_CHECK(SHA512, OPENSSL, sha512, -lcrypto)
+ AC_CHECK_HEADERS([openssl/evp.h])
+ saved_LIBS=$LIBS
+ case "$host_os" in
+ *mingw* | *cygwin*)
+ case "$host_cpu" in
+ x86_64)
+ AC_CHECK_LIB(eay64,main)
+ if test "x$ac_cv_lib_eay64_main" != "xyes"; then
+ AC_CHECK_LIB(eay32,main)
+ fi
+ ;;
+ *)
+ AC_CHECK_LIB(eay32,main)
+ ;;
+ esac
+ ;;
+ *)
+ AC_CHECK_LIB(crypto,main)
+ ;;
+ esac
+ CRYPTO_CHECK(MD5, OPENSSL, md5)
+ CRYPTO_CHECK(RMD160, OPENSSL, rmd160)
+ CRYPTO_CHECK(SHA1, OPENSSL, sha1)
+ CRYPTO_CHECK(SHA256, OPENSSL, sha256)
+ CRYPTO_CHECK(SHA384, OPENSSL, sha384)
+ CRYPTO_CHECK(SHA512, OPENSSL, sha512)
+ if test "x$found_OPENSSL" != "xyes"; then
+ LIBS=$saved_LIBS
+ fi
fi
# Probe libmd AFTER OpenSSL/libcrypto.
# The two are incompatible and OpenSSL is more complete.
-CRYPTO_CHECK(MD5, LIBMD, md5, -lmd)
-CRYPTO_CHECK(RMD160, LIBMD, rmd160, -lmd)
-CRYPTO_CHECK(SHA1, LIBMD, sha1, -lmd)
-CRYPTO_CHECK(SHA256, LIBMD, sha256, -lmd)
-CRYPTO_CHECK(SHA512, LIBMD, sha512, -lmd)
+AC_CHECK_HEADERS([md5.h ripemd.h sha.h sha256.h sha512.h])
+saved_LIBS=$LIBS
+AC_CHECK_LIB(md,main)
+CRYPTO_CHECK(MD5, LIBMD, md5)
+CRYPTO_CHECK(RMD160, LIBMD, rmd160)
+CRYPTO_CHECK(SHA1, LIBMD, sha1)
+CRYPTO_CHECK(SHA256, LIBMD, sha256)
+CRYPTO_CHECK(SHA512, LIBMD, sha512)
+if test "x$found_LIBMD" != "xyes"; then
+ LIBS=$saved_LIBS
+fi
-LIBS="$LIBS $mdLIBS"
+case "$host_os" in
+ *mingw* | *cygwin*)
+ CRYPTO_CHECK_WIN(MD5, CALG_MD5)
+ CRYPTO_CHECK_WIN(SHA1, CALG_SHA1)
+ CRYPTO_CHECK_WIN(SHA256, CALG_SHA_256)
+ CRYPTO_CHECK_WIN(SHA384, CALG_SHA_384)
+ CRYPTO_CHECK_WIN(SHA512, CALG_SHA_512)
+ ;;
+esac
AC_OUTPUT
View
90 contrib/libarchive.spec
@@ -1,14 +1,11 @@
-# $LastChangedRevision$, $LastChangedDate$
Summary: Library to create and read several different archive formats
-Summary(pl): Biblioteka do tworzenia i odczytu r�nych format�w archiw�w
Name: libarchive
-Version: 2.0a3
+Version: 3.1.2
Release: 1
License: BSD
Group: Libraries
-Source0: http://people.freebsd.org/~kientzle/libarchive/src/%{name}-%{version}.tar.gz
-Patch: %{name}-0123457890.patch
-URL: http://people.freebsd.org/~kientzle/libarchive/
+Source0: http://libarchive.org/downloads/%{name}-%{version}.tar.gz
+URL: http:/libarchive.org/
Requires: glibc
Requires: zlib
Requires: bzip2
@@ -24,57 +21,47 @@ Libarchive is a programming library that can create and read several
different streaming archive formats, including most popular TAR
variants and several CPIO formats. It can also write SHAR archives.
-%description -l pl
-Libarchive jest bibliotek� s�u�ac� to tworzenia i odczytu wielu
-r�nych strumieniowych format�w archiw�w, w��czaj�c w to popularne
-odmiany TAR oraz wiele format�w CPIO. Biblioteka ta potrafi tak�e
-zapisywa� archiwa SHAR.
-
%package devel
Summary: Header files for libarchive library
-Summary(pl): Pliki nag��wkowe biblioteki libarchive
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
Header files for libarchive library.
-%description devel -l pl
-Pliki nag��wkowe biblioteki libarchive.
-
%package static
Summary: Static libarchive library
-Summary(pl): Statyczna biblioteka libarchive
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
%description static
Static libarchive library.
-%description static -l pl
-Statyczna biblioteka libarchive.
-
%package -n bsdtar
Summary: bsdtar - tar(1) implementation based on libarchive
-Summary(pl): bsdtar - implementacja programu tar(1) oparta na libarchive
Group: Applications/Archiving
Requires: %{name} = %{version}-%{release}
%description -n bsdtar
bsdtar - tar(1) implementation based on libarchive.
-%description -n bsdtar -l pl
-bsdtar - implementacja programu tar(1), oparta na libarchive.
+%package -n bsdcpio
+Summary: bsdcpio - cpio(1) implementation based on libarchive
+Group: Applications/Archiving
+Requires: %{name} = %{version}-%{release}
+
+%description -n bsdcpio
+bsdcpio - cpio(1) implementation based on libarchive
%prep
%setup -q
-%patch0 -p1
%build
mkdir -p %{buildroot}
./configure \
--prefix=%{_prefix} \
--libexecdir=%{_libexecdir} \
+--libdir=%{_libdir} \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
--enable-shared=yes \
@@ -85,63 +72,34 @@ make | tee %{buildroot}/make.log
%install
[ "%buildroot" != "/" ] && [ -d %buildroot ] && rm -rf %buildroot;
make DESTDIR=%buildroot install
-# original install builds, but does install bsdtar
-cp .libs/%{name}.a %{buildroot}%{_libdir}
-cp bsdtar %{buildroot}%{_bindir}
-cp tar/bsdtar.1 %{buildroot}%{_mandir}/man1
%clean
rm -fr %buildroot
%files
-%defattr(644,root,root,755)
+%{_libdir}/libarchive.so*
+
+%files static
%{_libdir}/libarchive.a
%files devel
-%defattr(644,root,root,755)
+%{_libdir}/pkgconfig/libarchive.pc
%{_libdir}/libarchive.la
%{_includedir}/*.h
%doc %{_mandir}/man3/*
%doc %{_mandir}/man5/*
%files -n bsdtar
-%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/bsdtar
%doc %{_mandir}/man1/bsdtar.1*
-%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%files -n bsdcpio
+%attr(755,root,root) %{_bindir}/bsdcpio
+%doc %{_mandir}/man1/bsdcpio.1*
+
%changelog
-* %{date} PLD Team <feedback@pld-linux.org>
-All persons listed below can be reached at <cvs_login>@pld-linux.org
-
-$Log: libarchive.spec,v $
-Release 1 2006/12/12 rm1023@dcx.com
-- added libarchive-0123457890.patch for "0123457890" error
-- replaced libarchive-1.3.1.tar.gz with libarchive-2.0a3.tar.gz
-- removed obsolete -CVE-2006-5680.patch and -man_progname.patch
-
-Revision 1.6 2006/11/15 10:41:28 qboosh
-- BR: acl-devel,attr-devel
-- devel deps
-
-Revision 1.5 2006/11/08 22:22:25 twittner
-- up to 1.3.1
-- added BR: e2fsprogs-devel
-- added -CVE-2006-5680.patch against entering an infinite
-loop in corrupt archives
-- added bsdtar package (bsdtar is included now in libarchive
-sources)
-- rel. 0.1 for testing
-
-Revision 1.4 2005/12/15 18:26:36 twittner
-- up to 1.2.37
-- removed -shared.patch (no longer needed)
-
-Revision 1.3 2005/10/05 17:00:12 arekm
-- up to 1.02.034
-
-Revision 1.2 2005/07/27 20:17:21 qboosh
-- typo
-
-Revision 1.1 2005/07/27 08:36:03 adamg
-- new
+* Wed May 01 2013 Nikolai Lifanov <lifanov@mail.lifanov.com> - 3.1.2-1
+- Initial package
+- contrib/libarchive.spec by PLD team overhaul
+- Added "bsdcpio" package
+- Fixed build on x86_64 platform
View
4 cpio/cpio.c
@@ -1235,8 +1235,10 @@ cpio_rename(const char *name)
if (t == NULL)
return (name);
to = fopen("CONOUT$", "w");
- if (to == NULL)
+ if (to == NULL) {
+ fclose(t);
return (name);
+ }
fprintf(to, "%s (Enter/./(new name))? ", name);
fclose(to);
#else
View
1 cpio/test/main.c
@@ -391,7 +391,6 @@ failure_finish(void *extra)
fprintf(stderr,
" *** forcing core dump so failure can be debugged ***\n");
abort();
- exit(1);
}
}
View
2 cpio/test/test_extract_cpio_lzo.c
@@ -27,7 +27,7 @@ __FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_lzo)
{
- const char *reffile = "test_extract.cpio.lrz";
+ const char *reffile = "test_extract.cpio.lzo";
int f;
extract_reference_file(reffile);
View
2 doc/update.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+set -e
+
#
# Simple script to repopulate the 'doc' tree from
# the mdoc man pages stored in each project.
View
17 examples/minitar/minitar.c
@@ -231,27 +231,27 @@ create(const char *filename, int compress, const char **argv)
switch (compress) {
#ifndef NO_BZIP2_CREATE
case 'j': case 'y':
- archive_write_set_compression_bzip2(a);
+ archive_write_add_filter_bzip2(a);
break;
#endif
#ifndef NO_COMPRESS_CREATE
case 'Z':
- archive_write_set_compression_compress(a);
+ archive_write_add_filter_compress(a);
break;
#endif
#ifndef NO_GZIP_CREATE
case 'z':
- archive_write_set_compression_gzip(a);
+ archive_write_add_filter_gzip(a);
break;
#endif
default:
- archive_write_set_compression_none(a);
+ archive_write_add_filter_none(a);
break;
}
archive_write_set_format_ustar(a);
if (strcmp(filename, "-") == 0)
filename = NULL;
- archive_write_open_file(a, filename);
+ archive_write_open_filename(a, filename);
disk = archive_read_disk_new();
#ifndef NO_LOOKUP
@@ -361,7 +361,7 @@ extract(const char *filename, int do_extract, int flags)
#endif
if (filename != NULL && strcmp(filename, "-") == 0)
filename = NULL;
- if ((r = archive_read_open_file(a, filename, 10240))) {
+ if ((r = archive_read_open_filename(a, filename, 10240))) {
errmsg(archive_error_string(a));
errmsg("\n");
exit(r);
@@ -400,7 +400,7 @@ copy_data(struct archive *ar, struct archive *aw)
int r;
const void *buff;
size_t size;
- off_t offset;
+ int64_t offset;
for (;;) {
r = archive_read_data_block(ar, &buff, &size, &offset);
@@ -427,6 +427,9 @@ msg(const char *m)
static void
errmsg(const char *m)
{
+ if (m == NULL) {
+ m = "Error: No error description provided.\n";
+ }
write(2, m, strlen(m));
}
View
7 examples/untar.c
@@ -53,7 +53,6 @@
*/
#include <sys/types.h>
-__FBSDID("$FreeBSD$");
#include <sys/stat.h>
@@ -158,8 +157,8 @@ extract(const char *filename, int do_extract, int flags)
*/
if (filename != NULL && strcmp(filename, "-") == 0)
filename = NULL;
- if ((r = archive_read_open_file(a, filename, 10240)))
- fail("archive_read_open_file()",
+ if ((r = archive_read_open_filename(a, filename, 10240)))
+ fail("archive_read_open_filename()",
archive_error_string(a), r);
for (;;) {
r = archive_read_next_header(a, &entry);
@@ -200,7 +199,7 @@ copy_data(struct archive *ar, struct archive *aw)
int r;
const void *buff;
size_t size;
-#if ARCHIVE_VERSION >= 3000000
+#if ARCHIVE_VERSION_NUMBER >= 3000000
int64_t offset;
#else
off_t offset;
View
3 libarchive/CMakeLists.txt
@@ -45,6 +45,7 @@ SET(libarchive_SOURCES
archive_rb.c
archive_rb.h
archive_read.c
+ archive_read_append_filter.c
archive_read_data_into_fd.c
archive_read_disk_entry_from_file.c
archive_read_disk_posix.c
@@ -56,6 +57,7 @@ SET(libarchive_SOURCES
archive_read_open_filename.c
archive_read_open_memory.c
archive_read_private.h
+ archive_read_set_format.c
archive_read_set_options.c
archive_read_support_filter_all.c
archive_read_support_filter_bzip2.c
@@ -123,6 +125,7 @@ SET(libarchive_SOURCES
archive_write_set_format_iso9660.c
archive_write_set_format_mtree.c
archive_write_set_format_pax.c
+ archive_write_set_format_raw.c
archive_write_set_format_shar.c
archive_write_set_format_ustar.c
archive_write_set_format_v7tar.c
View
24 libarchive/archive.h
@@ -124,13 +124,13 @@ extern "C" {
* assert that ARCHIVE_VERSION_NUMBER >= 2012108.
*/
/* Note: Compiler will complain if this does not match archive_entry.h! */
-#define ARCHIVE_VERSION_NUMBER 3000200
+#define ARCHIVE_VERSION_NUMBER 3001002
__LA_DECL int archive_version_number(void);
/*
* Textual name/version of the library, useful for version displays.
*/
-#define ARCHIVE_VERSION_STRING "libarchive 3.0.200a"
+#define ARCHIVE_VERSION_STRING "libarchive 3.1.2"
__LA_DECL const char * archive_version_string(void);
/* Declare our basic types. */
@@ -372,6 +372,17 @@ __LA_DECL int archive_read_support_format_tar(struct archive *);
__LA_DECL int archive_read_support_format_xar(struct archive *);
__LA_DECL int archive_read_support_format_zip(struct archive *);
+/* Functions to manually set the format and filters to be used. This is
+ * useful to bypass the bidding process when the format and filters to use
+ * is known in advance.
+ */
+__LA_DECL int archive_read_set_format(struct archive *, int);
+__LA_DECL int archive_read_append_filter(struct archive *, int);
+__LA_DECL int archive_read_append_filter_program(struct archive *,
+ const char *);
+__LA_DECL int archive_read_append_filter_program_signature
+ (struct archive *, const char *, const void * /* match */, size_t);
+
/* Set various callbacks. */
__LA_DECL int archive_read_set_open_callback(struct archive *,
archive_open_callback *);
@@ -659,6 +670,7 @@ __LA_DECL int archive_write_set_format_mtree_classic(struct archive *);
/* TODO: int archive_write_set_format_old_tar(struct archive *); */
__LA_DECL int archive_write_set_format_pax(struct archive *);
__LA_DECL int archive_write_set_format_pax_restricted(struct archive *);
+__LA_DECL int archive_write_set_format_raw(struct archive *);
__LA_DECL int archive_write_set_format_shar(struct archive *);
__LA_DECL int archive_write_set_format_shar_dump(struct archive *);
__LA_DECL int archive_write_set_format_ustar(struct archive *);
@@ -868,6 +880,10 @@ __LA_DECL int archive_read_disk_set_metadata_filter_callback(struct archive *,
int (*_metadata_filter_func)(struct archive *, void *,
struct archive_entry *), void *_client_data);
+/* Simplified cleanup interface;
+ * This calls archive_read_free() or archive_write_free() as needed. */
+__LA_DECL int archive_free(struct archive *);
+
/*
* Accessor functions to read/set various information in
* the struct archive object:
@@ -1014,6 +1030,10 @@ __LA_DECL int archive_match_include_gname(struct archive *, const char *);
__LA_DECL int archive_match_include_gname_w(struct archive *,
const wchar_t *);
+/* Utility functions */
+/* Convenience function to sort a NULL terminated list of strings */
+__LA_DECL int archive_utility_string_sort(char **);
+
#ifdef __cplusplus
}
#endif
View
6 libarchive/archive_crypto.c
@@ -1222,8 +1222,10 @@ __archive_stub_sha512final(archive_sha512_ctx *ctx, void *md)
* 2. libc2
* 3. libc3
* 4. libSystem
- * 5. OpenSSL
- * 6. Windows API
+ * 5. Nettle
+ * 6. OpenSSL
+ * 7. libmd
+ * 8. Windows API
*/
const struct archive_crypto __archive_crypto =
{
View
2 libarchive/archive_entry.h
@@ -29,7 +29,7 @@
#define ARCHIVE_ENTRY_H_INCLUDED
/* Note: Compiler will complain if this does not match archive.h! */
-#define ARCHIVE_VERSION_NUMBER 3000200
+#define ARCHIVE_VERSION_NUMBER 3001002
/*
* Note: archive_entry.h is for use outside of libarchive; the
View
2 libarchive/archive_entry_sparse.c
@@ -58,7 +58,7 @@ archive_entry_sparse_add_entry(struct archive_entry *entry,
if (offset < 0 || length < 0)
/* Invalid value */
return;
- if (offset + length < 0 ||
+ if (offset > INT64_MAX - length ||
offset + length > archive_entry_size(entry))
/* A value of "length" parameter is too large. */
return;
View
2 libarchive/archive_match.c
@@ -1376,6 +1376,7 @@ add_entry(struct archive_match *a, int flag,
archive_mstring_copy_wcs(&(f->pathname), pathname);
a->exclusion_tree.rbt_ops = &rb_ops_wcs;
#else
+ (void)rb_ops_wcs;
pathname = archive_entry_pathname(entry);
if (pathname == NULL) {
free(f);
@@ -1515,6 +1516,7 @@ time_excluded(struct archive_match *a, struct archive_entry *entry)
pathname = archive_entry_pathname_w(entry);
a->exclusion_tree.rbt_ops = &rb_ops_wcs;
#else
+ (void)rb_ops_wcs;
pathname = archive_entry_pathname(entry);
a->exclusion_tree.rbt_ops = &rb_ops_mbs;
#endif
View
2 libarchive/archive_ppmd7.c
@@ -990,7 +990,7 @@ static void RangeEnc_ShiftLow(CPpmd7z_RangeEnc *p)
p->Cache = (Byte)((UInt32)p->Low >> 24);
}
p->CacheSize++;
- p->Low = (UInt32)p->Low << 8;
+ p->Low = ((UInt32)p->Low << 8) & 0xFFFFFFFF;
}
static void RangeEnc_Encode(CPpmd7z_RangeEnc *p, UInt32 start, UInt32 size, UInt32 total)
View
72 libarchive/archive_read.c
@@ -57,8 +57,6 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read.c 201157 2009-12-29 05:30:2
static int choose_filters(struct archive_read *);
static int choose_format(struct archive_read *);
-static void free_filters(struct archive_read *);
-static int close_filters(struct archive_read *);
static struct archive_vtable *archive_read_vtable(void);
static int64_t _archive_filter_bytes(struct archive *, int);
static int _archive_filter_code(struct archive *, int);
@@ -455,7 +453,7 @@ int
archive_read_open1(struct archive *_a)
{
struct archive_read *a = (struct archive_read *)_a;
- struct archive_read_filter *filter;
+ struct archive_read_filter *filter, *tmp;
int slot, e;
unsigned int i;
@@ -472,7 +470,7 @@ archive_read_open1(struct archive *_a)
/* Open data source. */
if (a->client.opener != NULL) {
- e =(a->client.opener)(&a->archive, a->client.dataset[0].data);
+ e = (a->client.opener)(&a->archive, a->client.dataset[0].data);
if (e != 0) {
/* If the open failed, call the closer to clean up. */
if (a->client.closer) {
@@ -499,25 +497,37 @@ archive_read_open1(struct archive *_a)
filter->sswitch = client_switch_proxy;
filter->name = "none";
filter->code = ARCHIVE_FILTER_NONE;
- a->filter = filter;
- client_switch_proxy(a->filter, 0);
a->client.dataset[0].begin_position = 0;