diff --git a/.travis.yml b/.travis.yml index c8ddd673e..5c92b14f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,13 +47,13 @@ matrix: sudo: required group: edge before_install: - - if test ${TRAVIS_OS_NAME} = "linux"; then sudo apt-get update && sudo apt-mark hold oracle-java9-installer postgresql-9.2 postgresql-9.3 postgresql-9.4 postgresql-9.5 postgresql-9.6 postgresql-client postgresql-client-common postgresql-common postgresql-contrib-9.2 postgresql-contrib-9.3 postgresql-contrib-9.4 postgresql-contrib-9.5 postgresql-contrib-9.6 postgresql-doc && sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y && sudo apt-get install -y autopoint zlib1g-dev libfuse-dev; fi + - if test ${TRAVIS_OS_NAME} = "linux"; then sudo apt-get update && sudo apt-mark hold oracle-java9-installer postgresql-9.2 postgresql-9.3 postgresql-9.4 postgresql-9.5 postgresql-9.6 postgresql-client postgresql-client-common postgresql-common postgresql-contrib-9.2 postgresql-contrib-9.3 postgresql-contrib-9.4 postgresql-contrib-9.5 postgresql-contrib-9.6 postgresql-doc && sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y && sudo apt-get install -y autopoint zlib1g-dev libssl-dev libfuse-dev; fi - if test ${TRAVIS_OS_NAME} = "osx"; then brew update && brew install gettext gnu-sed && brew link --force gettext; fi - if test ${TARGET} = "coverity"; then echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-; fi install: - if test ${TRAVIS_OS_NAME} = "osx"; then export SED="/usr/local/bin/gsed"; fi - - if test ${TARGET} = "shared"; then ./syncsharedlibs.sh; fi - - ./synclibs.sh && ./autogen.sh + - if test ${TARGET} = "shared"; then ./syncsharedlibs.sh --use-head; fi + - ./synclibs.sh --use-head && ./autogen.sh - if test -x "synctestdata.sh"; then ./synctestdata.sh; fi script: - if test ${TRAVIS_OS_NAME} = "linux"; then export PATH=$(echo $PATH | tr ":" "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s/::/:/g"); fi diff --git a/appveyor.yml b/appveyor.yml index dff8687c2..2b2eafc90 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,14 +37,15 @@ environment: - TARGET: mingw-w64 install: +- cmd: git clone https://github.com/codecov/codecov-bash.git ..\codecov-bash - cmd: git clone https://github.com/libyal/vstools.git ..\vstools - cmd: git clone https://github.com/joachimmetz/dokan.git ..\dokan - ps: .\syncwinflexbison.ps1 - ps: .\synczlib.ps1 - cmd: if [%TARGET%]==[cygwin] ( - C:\cygwin\setup-x86.exe -qgnNdO -l C:\cygwin\var\cache\setup -R c:\cygwin -s http://cygwin.mirror.constant.com -P bison -P flex -P python2-devel -P python3-devel ) + C:\cygwin\setup-x86.exe -qgnNdO -l C:\cygwin\var\cache\setup -R c:\cygwin -s http://cygwin.mirror.constant.com -P bison -P flex -P zlib-devel -P openssl-devel -P python2-devel -P python3-devel ) - cmd: if [%TARGET%]==[cygwin64] ( - C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P bison -P flex -P python2-devel -P python3-devel ) + C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P bison -P flex -P zlib-devel -P openssl-devel -P python2-devel -P python3-devel ) - cmd: if [%TARGET%]==[mingw] ( C:\MinGW\bin\mingw-get install -P libz-dev ) @@ -52,44 +53,44 @@ build_script: - ps: .\synclibs.ps1 - ps: .\autogen.ps1 - cmd: if [%TARGET%]==[vs2008] ( - msbuild msvscpp\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) + msbuild /verbosity:quiet msvscpp\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) - cmd: if [%TARGET%]==[vs2010] ( set PYTHONPATH=..\vstools && C:\Python27\python.exe ..\vstools\scripts\msvscpp-convert.py --no-python-dll --output-format 2010 msvscpp\libewf.sln && - msbuild vs2010\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) + msbuild /verbosity:quiet vs2010\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) - cmd: if [%TARGET%]==[vs2012] ( set PYTHONPATH=..\vstools && C:\Python27\python.exe ..\vstools\scripts\msvscpp-convert.py --extend-with-x64 --output-format 2012 --python-path "C:\\Python27-x64" msvscpp\libewf.sln && - msbuild vs2012\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) + msbuild /verbosity:quiet vs2012\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) - cmd: if [%TARGET%]==[vs2013] ( set PYTHONPATH=..\vstools && C:\Python27\python.exe ..\vstools\scripts\msvscpp-convert.py --output-format 2013 msvscpp\libewf.sln && - msbuild vs2013\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) + msbuild /verbosity:quiet vs2013\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) - cmd: if [%TARGET%]==[vs2015] ( set PYTHONPATH=..\vstools && C:\Python27\python.exe ..\vstools\scripts\msvscpp-convert.py --output-format 2015 msvscpp\libewf.sln && - msbuild vs2015\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) + msbuild /verbosity:quiet vs2015\libewf.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) - cmd: if [%TARGET%]==[vs2017] ( set PYTHONPATH=..\vstools && C:\Python27\python.exe ..\vstools\scripts\msvscpp-convert.py --extend-with-x64 --no-python-dll --output-format 2017 msvscpp\libewf.sln && - msbuild vs2017\libewf.sln /property:Platform=Win32 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && - msbuild vs2017\libewf.sln /property:Platform=x64 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) + msbuild /verbosity:quiet vs2017\libewf.sln /property:Platform=Win32 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && + msbuild /verbosity:quiet vs2017\libewf.sln /property:Platform=x64 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" ) - cmd: if [%TARGET%]==[python27] ( C:\Python27\python.exe setup.py bdist_msi ) - cmd: if [%TARGET%]==[python36] ( C:\Python36\python.exe setup.py bdist_msi ) - cmd: if [%TARGET%]==[cygwin] ( xcopy /i /q /s C:\projects\libewf C:\cygwin\home\appveyor\libewf && - C:\cygwin\bin\bash -e -l -c "cd libewf && ./synclibs.sh && ./autogen.sh" ) + C:\cygwin\bin\bash -e -l -c "cd libewf && ./synclibs.sh --use-head && ./autogen.sh" ) - cmd: if [%TARGET%]==[cygwin64] ( xcopy /i /q /s C:\projects\libewf C:\cygwin64\home\appveyor\libewf && - C:\cygwin64\bin\bash -e -l -c "cd libewf && ./synclibs.sh && ./autogen.sh" ) + C:\cygwin64\bin\bash -e -l -c "cd libewf && ./synclibs.sh --use-head && ./autogen.sh" ) - cmd: if [%TARGET%]==[mingw] ( xcopy /i /q /s C:\projects\libewf C:\MinGW\msys\1.0\home\appveyor\libewf && - C:\MinGW\msys\1.0\bin\bash -e -l -c "cd libewf && sed 's/@VERSION@/0.29/g' m4/pkg.m4.in > m4/pkg.m4 && ./synclibs.sh && ./autogen.sh" ) + C:\MinGW\msys\1.0\bin\bash -e -l -c "cd libewf && sed 's/@VERSION@/0.29/g' m4/pkg.m4.in > m4/pkg.m4 && ./synclibs.sh --use-head && ./autogen.sh" ) - cmd: if [%TARGET%]==[mingw-w64] ( xcopy /i /q /s C:\projects\libewf C:\msys64\home\appveyor\libewf && - C:\msys64\usr\bin\bash -e -l -c "cd libewf && ./synclibs.sh && ./autogen.sh" ) + C:\msys64\usr\bin\bash -e -l -c "cd libewf && ./synclibs.sh --use-head && ./autogen.sh" ) test_script: - cmd: rem Run tests @@ -114,3 +115,8 @@ test_script: - cmd: if [%TARGET%]==[mingw-w64] ( C:\msys64\usr\bin\bash -e -l -c "cd libewf && ./runtests.sh" ) +after_test: +- cmd: if [%TARGET%]==[mingw] ( + copy C:\projects\codecov-bash\codecov C:\MinGW\msys\1.0\home\appveyor\libewf\codecov.sh && + C:\MinGW\msys\1.0\bin\bash -e -l -c "cd libewf && chmod a+x ./codecov.sh && ./codecov.sh" ) + diff --git a/common/system_string.h b/common/system_string.h index 5851a290b..2e09cbceb 100644 --- a/common/system_string.h +++ b/common/system_string.h @@ -83,11 +83,11 @@ extern "C" { #endif #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) -#define system_string_vsprintf \ +#define system_string_vsnprintf \ wide_string_vsnwprintf #else -#define system_string_vsprintf( string, size, format, ... ) \ +#define system_string_vsnprintf( string, size, format, ... ) \ wide_string_vsnwprintf( string, size, format, __VA_ARGS__ ) #endif @@ -133,16 +133,19 @@ extern "C" { #endif #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 ) -#define system_string_vsprintf \ +#define system_string_vsnprintf \ narrow_string_vsnprintf #else -#define system_string_vsprintf( string, size, format, ... ) \ +#define system_string_vsnprintf( string, size, format, ... ) \ narrow_string_vsnprintf( string, size, format, __VA_ARGS__ ) #endif #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ +/* For backwards compatibility */ +#define system_string_vsprintf system_string_vsnprintf + #if defined( _cplusplus ) } #endif diff --git a/configure.ac b/configure.ac index 2add90ac7..fb8e02568 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ( 2.59 ) AC_INIT( [libewf], - [20170918], + [20171007], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/dpkg/control b/dpkg/control index 44a4db37f..b36b214b3 100644 --- a/dpkg/control +++ b/dpkg/control @@ -1,7 +1,7 @@ Source: libewf Priority: extra Maintainer: Joachim Metz -Build-Depends: debhelper (>= 9), dh-autoreconf, pkg-config, zlib1g-dev, libssl-dev, libfuse-dev, python-dev, python3-dev +Build-Depends: debhelper (>= 9), dh-autoreconf, pkg-config, zlib1g-dev, libssl-dev, python-dev, python3-dev, libfuse-dev Standards-Version: 3.9.5 Section: libs Homepage: https://github.com/libyal/libewf diff --git a/libewf.ini b/libewf.ini index a8f0fd05a..7d90ae043 100644 --- a/libewf.ini +++ b/libewf.ini @@ -16,7 +16,7 @@ year_of_creation: "2008" [tools] build_dependencies: ["crypto", "fuse"] description: "Several tools for reading and writing EWF files" -names: ["ewfacquire", "ewfacquirestream", "ewfexport", "ewfinfo", "ewfmount", "ewfverify"] +names: ["ewfacquire", "ewfacquirestream", "ewfdebug", "ewfexport", "ewfinfo", "ewfmount", "ewfrecover", "ewfverify"] [mount_tool] missing_backend_error: "No sub system to mount EWF." @@ -42,7 +42,6 @@ main_object_size: "media_size" example: "ewfinfo image.E01" [tests] -features: ["profiles", "valgrind"] profiles: ["libewf", "pyewf", "ewfacquire", "ewfacquire_optical", "ewfacquirestream", "ewfexport", "ewfexport_logical", "ewfinfo", "ewfverify", "ewfverify_logical"] example_filename1: "image1.E01" example_filename2: "image2.Ex02" diff --git a/libewf.spec.in b/libewf.spec.in index 2449a319b..265166b9c 100644 --- a/libewf.spec.in +++ b/libewf.spec.in @@ -41,7 +41,6 @@ BuildRequires: byacc flex @ax_libcdatetime_spec_build_requires@ @ax_libfuse_spec %description tools Several tools for reading and writing EWF files. -It contains tools to acquire, export, query and verify EWF files. %package python Summary: Python 2 bindings for libewf diff --git a/m4/zlib.m4 b/m4/zlib.m4 index 71773f94d..40e055ed7 100644 --- a/m4/zlib.m4 +++ b/m4/zlib.m4 @@ -1,6 +1,6 @@ dnl Functions for zlib dnl -dnl Version: 20160318 +dnl Version: 20171006 dnl Function to detect if zlib is available AC_DEFUN([AX_ZLIB_CHECK_LIB], @@ -264,6 +264,9 @@ AC_DEFUN([AX_ZLIB_CHECK_ENABLE], AC_SUBST( [ax_zlib_spec_build_requires], [zlib-devel]) + AC_SUBST( + [ax_zlib_static_spec_requires], + [zlib-static]) AC_SUBST( [ax_zlib_static_spec_build_requires], [zlib-static]) diff --git a/synclibs.sh b/synclibs.sh index 9be3ffe10..b62c6a403 100755 --- a/synclibs.sh +++ b/synclibs.sh @@ -1,7 +1,10 @@ #!/bin/sh # Script that synchronizes the local library dependencies # -# Version: 20161212 +# Version: 20171003 + +EXIT_SUCCESS=0; +EXIT_FAILURE=1; GIT_URL_PREFIX="https://github.com/libyal"; LOCAL_LIBS="libbfio libcaes libcdata libcdatetime libcerror libcfile libclocale libcnotify libcpath libcsplit libcthreads libfcache libfdata libfguid libfvalue libhmac libodraw libsmdev libsmraw libuna"; @@ -11,11 +14,29 @@ IFS=" "; for LOCAL_LIB in ${LOCAL_LIBS}; do - git clone ${GIT_URL_PREFIX}/${LOCAL_LIB}.git ${LOCAL_LIB}-$$; + GIT_URL="${GIT_URL_PREFIX}/${LOCAL_LIB}.git"; + + git clone --quiet ${GIT_URL} ${LOCAL_LIB}-$$; if ! test -d ${LOCAL_LIB}-$$; then - continue + echo "Unable to git clone: ${GIT_URL}"; + + IFS=$OLDIFS; + + exit ${EXIT_FAILURE}; + fi + (cd ${LOCAL_LIB}-$$ && git fetch --quiet --all --tags --prune) + + LATEST_TAG=`cd ${LOCAL_LIB}-$$ && git describe --tags --abbrev=0`; + + if test -n ${LATEST_TAG} && test "$1" != "--use-head"; + then + echo "Synchronizing: ${LOCAL_LIB} from ${GIT_URL} tag ${LATEST_TAG}"; + + (cd ${LOCAL_LIB}-$$ && git checkout --quiet tags/${LATEST_TAG}); + else + echo "Synchronizing: ${LOCAL_LIB} from ${GIT_URL} HEAD"; fi rm -rf ${LOCAL_LIB}; @@ -23,7 +44,11 @@ do if ! test -d ${LOCAL_LIB}; then - continue + echo "Missing directory: ${LOCAL_LIB}"; + + IFS=$OLDIFS; + + exit ${EXIT_FAILURE}; fi LOCAL_LIB_UPPER=`echo "${LOCAL_LIB}" | tr "[a-z]" "[A-Z]"`; @@ -150,3 +175,5 @@ done IFS=$OLDIFS; +exit ${EXIT_SUCCESS}; + diff --git a/syncsharedlibs.sh b/syncsharedlibs.sh index c20c0c1cb..6ffe277e5 100755 --- a/syncsharedlibs.sh +++ b/syncsharedlibs.sh @@ -1,10 +1,13 @@ #!/bin/sh # Script that synchronizes the shared library dependencies # -# Version: 20170903 +# Version: 20170905 + +EXIT_SUCCESS=0; +EXIT_FAILURE=1; GIT_URL_PREFIX="https://github.com/libyal"; -SHARED_LIBS="libbfio libcaes libcdata libcdatetime libcerror libcfile libclocale libcnotify libcpath libcsplit libcthreads libfcache libfdata libfguid libfvalue libhmac libodraw libsmdev libsmraw libuna"; +SHARED_LIBS="libcerror libcthreads libcdata libcdatetime libclocale libcnotify libcsplit libuna libcfile libcpath libbfio libfcache libfdata libfguid libfvalue libhmac libcaes libodraw libsmdev libsmraw"; if test ${TRAVIS_OS_NAME} != "linux"; then @@ -13,22 +16,60 @@ then exit 1; fi +USE_HEAD=""; + +if test "$1" = "--use-head"; +then + USE_HEAD="--use-head"; +fi + OLDIFS=$IFS; IFS=" "; for SHARED_LIB in ${SHARED_LIBS}; do - git clone ${GIT_URL_PREFIX}/${SHARED_LIB}.git ${SHARED_LIB}-$$; + GIT_URL="${GIT_URL_PREFIX}/${SHARED_LIB}.git"; + + git clone --quiet ${GIT_URL} ${SHARED_LIB}-$$; if ! test -d ${SHARED_LIB}-$$; then - continue + echo "Unable to git clone: ${GIT_URL}"; + + IFS=$OLDIFS; + + exit ${EXIT_FAILURE}; + fi + (cd ${SHARED_LIB}-$$ && git fetch --quiet --all --tags --prune) + + LATEST_TAG=`cd ${SHARED_LIB}-$$ && git describe --tags --abbrev=0`; + + if test -n ${LATEST_TAG} && test -z ${USE_HEAD}; + then + echo "Synchronizing: ${SHARED_LIB} from ${GIT_URL} tag ${LATEST_TAG}"; + + (cd ${SHARED_LIB}-$$ && git checkout --quiet tags/${LATEST_TAG}); + else + echo "Synchronizing: ${SHARED_LIB} from ${GIT_URL} HEAD"; + fi + + (cd ${SHARED_LIB}-$$ && ./synclibs.sh ${USE_HEAD} && ./autogen.sh); + + CONFIGURE_OPTIONS=""; + + (cd ${SHARED_LIB}-$$ && ./configure --help | grep -- '--enable-wide-character-type' > /dev/null); + + if test $? -eq 0; + then + CONFIGURE_OPTIONS="${CONFIGURE_OPTIONS} --enable-wide-character-type"; fi - (cd ${SHARED_LIB}-$$ && ./synclibs.sh && ./autogen.sh && ./configure --prefix=/usr && make && sudo make install); + (cd ${SHARED_LIB}-$$ && ./configure --prefix=/usr ${CONFIGURE_OPTIONS} && make && sudo make install); rm -rf ${SHARED_LIB}-$$; done IFS=$OLDIFS; +exit ${EXIT_SUCCESS}; +