Skip to content

Commit

Permalink
Applied updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Sep 4, 2019
1 parent 32c43ea commit 7d9c37e
Show file tree
Hide file tree
Showing 14 changed files with 237 additions and 87 deletions.
80 changes: 32 additions & 48 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,32 @@ matrix:
dist: xenial
sudo: required
group: edge
- name: "Linux with gcc on PowerPC 64-bit"
env:
- CONFIGURE_OPTIONS=""
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc"
compiler: gcc
os: linux-ppc64le
dist: xenial
sudo: required
group: edge
- name: "Linux with gcc on s390x (Docker)"
env:
- DOCKERHUB_REPO="s390x/ubuntu"
- DOCKERHUB_TAG="bionic"
- CONFIGURE_OPTIONS=""
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="docker"
compiler: gcc
os: linux
dist: xenial
sudo: required
group: edge
services:
- docker
- name: "Linux with gcc and wide character type (wchar_t) support"
env:
- CONFIGURE_OPTIONS="--enable-wide-character-type"
Expand Down Expand Up @@ -197,54 +223,12 @@ matrix:
os: osx
osx_image: xcode8.3
before_install:
- if test ${TRAVIS_OS_NAME} = "linux"; then
sudo apt-get update && sudo apt-mark hold mysql-server-5.7 && sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y --allow-unauthenticated && sudo apt-get install -y autopoint zlib1g-dev;
elif 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
- .travis/before_install.sh
install:
- if test ${TRAVIS_OS_NAME} = "osx"; then
export SED="/usr/local/bin/gsed";
fi
- ./synclibs.sh --use-head && ./autogen.sh
- if test ${TARGET} = "linux-gcc-shared" || test ${TARGET} = "linux-gcc-shared-wide-character-type"; then
./configure > /dev/null && make > /dev/null && ./syncsharedlibs.sh --use-head;
fi
- if test -x "synctestdata.sh"; then
./synctestdata.sh;
fi
- .travis/install.sh
script:
- if test ${TRAVIS_OS_NAME} = "linux"; then
export PATH=$(echo $PATH | tr ":" "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s/::/:/g");
fi
- if test ${TARGET} = "linux-gcc-python-setup-py" || test ${TARGET} = "macos-gcc-python-setup-py"; then
./configure ${CONFIGURE_OPTIONS} && make > /dev/null && python ./setup.py build;
elif test ${TARGET} != "coverity"; then
./configure ${CONFIGURE_OPTIONS} && make > /dev/null; RESULT=$?;
if test ${RESULT} -eq 0; then
if test ${TARGET} = "macos-gcc-python" || test ${TARGET} = "macos-gcc-pkgbuild"; then
install_name_tool -change /usr/local/lib/libpff.1.dylib ${PWD}/libpff/.libs/libpff.1.dylib ./pypff/.libs/pypff.so;
fi;
make check CHECK_WITH_STDERR=1; RESULT=$?;
fi;
if test ${RESULT} -ne 0; then
if test -f tests/test-suite.log; then
cat tests/test-suite.log;
fi;
return ${RESULT};
fi;
if test ${TARGET} = "macos-gcc-pkgbuild"; then
VERSION=`sed '5!d; s/^ \[//;s/\],$//' configure.ac` &&
make install DESTDIR=${PWD}/osx-pkg &&
mkdir -p ${PWD}/osx-pkg/usr/share/doc/libpff &&
cp AUTHORS COPYING NEWS README ${PWD}/osx-pkg/usr/share/doc/libpff &&
pkgbuild --root osx-pkg --identifier com.github.libyal.libpff --version ${VERSION} --ownership recommended ../libpff-${VERSION}.pkg;
fi
fi
- .travis/script.sh
after_success:
- if test ${TARGET} = "linux-gcc-no-optimization"; then
curl -o codecov.sh -s https://codecov.io/bash && sed 's/ -execdir / -exec /' -i ./codecov.sh && /bin/bash ./codecov.sh -n ${TARGET} -y .codecov.yml;
fi
- if test ${TARGET} = "linux-gcc-no-optimization"; then
curl -o codecov.sh -s https://codecov.io/bash && sed 's/ -execdir / -exec /' -i ./codecov.sh && /bin/bash ./codecov.sh -n ${TARGET} -y .codecov.yml;
fi
39 changes: 39 additions & 0 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
# Script to run before_install step on Travis-CI
#
# Version: 20190808

# Exit on error.
set -e;

if test ${TARGET} = "docker";
then
sudo apt-get update;
sudo apt-mark hold mysql-server-5.7 postgresql-9.4 postgresql-client-9.4 postgresql-9.5 postgresql-client-9.5 postgresql-9.6 postgresql-client-9.6 postgresql-10 postgresql-client-10;
sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y --allow-unauthenticated;

sudo apt-get install -y qemu-user-static;

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes;

elif test ${TRAVIS_OS_NAME} = "linux" || test ${TRAVIS_OS_NAME} = "linux-ppc64le";
then
sudo apt-get update;
sudo apt-mark hold mysql-server-5.7 postgresql-9.4 postgresql-client-9.4 postgresql-9.5 postgresql-client-9.5 postgresql-9.6 postgresql-client-9.6 postgresql-10 postgresql-client-10;
sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y --allow-unauthenticated;

sudo apt-get install -y autopoint zlib1g-dev;

elif 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

32 changes: 32 additions & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh
# Script to run install step on Travis-CI
#
# Version: 20190802

# Exit on error.
set -e;

if test ${TARGET} != "docker";
then
if test ${TRAVIS_OS_NAME} = "osx";
then
export SED="/usr/local/bin/gsed";
fi

./synclibs.sh --use-head;
./autogen.sh;

if test ${TARGET} = "linux-gcc-shared" || test ${TARGET} = "linux-gcc-shared-wide-character-type";
then
./configure > /dev/null;
make > /dev/null;

./syncsharedlibs.sh --use-head;
fi

if test -x "synctestdata.sh";
then
./synctestdata.sh;
fi
fi

31 changes: 31 additions & 0 deletions .travis/runtests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
# Script to run tests on Travis-CI
#
# Version: 20190808

./configure ${CONFIGURE_OPTIONS};
RESULT=$?;

if test ${RESULT} -eq 0;
then
make > /dev/null;
RESULT=$?;
fi
if test ${RESULT} -eq 0;
then
if test ${TARGET} = "macos-gcc-python" || test ${TARGET} = "macos-gcc-pkgbuild";
then
install_name_tool -change /usr/local/lib/libpff.1.dylib ${PWD}/libpff/.libs/libpff.1.dylib ./pypff/.libs/pypff.so;
fi
make check CHECK_WITH_STDERR=1;
RESULT=$?;
fi
if test ${RESULT} -ne 0;
then
if test -f tests/test-suite.log;
then
cat tests/test-suite.log;
fi
fi
exit ${RESULT};

39 changes: 39 additions & 0 deletions .travis/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
# Script to run script step on Travis-CI
#
# Version: 20190808

# Exit on error.
set -e;

if test ${TRAVIS_OS_NAME} = "linux" || test ${TRAVIS_OS_NAME} = "linux-ppc64le";
then
export PATH=$(echo $PATH | tr ":" "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s/::/:/g");
fi

if test ${TARGET} = "docker";
then
docker run -t -v "${PWD}:/libpff" ${DOCKERHUB_REPO}:${DOCKERHUB_TAG} sh -c "cd libpff && .travis/script_docker.sh";

elif test ${TARGET} = "linux-gcc-python-setup-py" || test ${TARGET} = "macos-gcc-python-setup-py";
then
./configure ${CONFIGURE_OPTIONS};
make > /dev/null;
python ./setup.py build;

elif test ${TARGET} != "coverity";
then
.travis/runtests.sh;

if test ${TARGET} = "macos-gcc-pkgbuild";
then
export VERSION=`sed '5!d; s/^ \[//;s/\],$//' configure.ac`;

make install DESTDIR=${PWD}/osx-pkg;
mkdir -p ${PWD}/osx-pkg/usr/share/doc/libpff;
cp AUTHORS COPYING NEWS README ${PWD}/osx-pkg/usr/share/doc/libpff;

pkgbuild --root osx-pkg --identifier com.github.libyal.libpff --version ${VERSION} --ownership recommended ../libpff-${VERSION}.pkg;
fi
fi

29 changes: 29 additions & 0 deletions .travis/script_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
# Script to run script step on Travis-CI with Docker
#
# Version: 20190809

# Exit on error.
set -e;

export DEBIAN_FRONTEND="noninteractive";

apt-get update -q;

# Install add-apt-repository and locale-gen.
apt-get install -y locales software-properties-common;

# Set locale to US English and UTF-8.
locale-gen en_US.UTF-8;

# Install packages essential for building.
apt-get install -y autoconf automake build-essential git libtool pkg-config autopoint;

export LANG="en_US.UTF-8";

./synclibs.sh --use-head;

./autogen.sh;

.travis/runtests.sh;

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ( 2.59 )

AC_INIT(
[libpff],
[20190725],
[20190904],
[[email protected]])

AC_CONFIG_SRCDIR(
Expand Down
16 changes: 8 additions & 8 deletions libpff/libpff_item_values.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ int libpff_item_values_get_record_entry_by_utf8_name(
libbfio_handle_t *file_io_handle,
libpff_offsets_index_t *offsets_index,
int record_set_index,
const uint8_t *utf8_name,
size_t utf8_name_length,
const uint8_t *utf8_string,
size_t utf8_string_length,
uint32_t value_type,
libpff_record_entry_t **record_entry,
uint8_t flags,
Expand Down Expand Up @@ -744,8 +744,8 @@ int libpff_item_values_get_record_entry_by_utf8_name(
result = libpff_table_get_record_entry_by_utf8_name(
item_values->table,
record_set_index,
utf8_name,
utf8_name_length,
utf8_string,
utf8_string_length,
value_type,
record_entry,
flags,
Expand Down Expand Up @@ -781,8 +781,8 @@ int libpff_item_values_get_record_entry_by_utf16_name(
libbfio_handle_t *file_io_handle,
libpff_offsets_index_t *offsets_index,
int record_set_index,
const uint16_t *utf16_name,
size_t utf16_name_length,
const uint16_t *utf16_string,
size_t utf16_string_length,
uint32_t value_type,
libpff_record_entry_t **record_entry,
uint8_t flags,
Expand Down Expand Up @@ -846,8 +846,8 @@ int libpff_item_values_get_record_entry_by_utf16_name(
result = libpff_table_get_record_entry_by_utf16_name(
item_values->table,
record_set_index,
utf16_name,
utf16_name_length,
utf16_string,
utf16_string_length,
value_type,
record_entry,
flags,
Expand Down
8 changes: 4 additions & 4 deletions libpff/libpff_item_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ int libpff_item_values_get_record_entry_by_utf8_name(
libbfio_handle_t *file_io_handle,
libpff_offsets_index_t *offsets_index,
int record_set_index,
const uint8_t *utf8_name,
size_t utf8_name_length,
const uint8_t *utf8_string,
size_t utf8_string_length,
uint32_t value_type,
libpff_record_entry_t **record_entry,
uint8_t flags,
Expand All @@ -159,8 +159,8 @@ int libpff_item_values_get_record_entry_by_utf16_name(
libbfio_handle_t *file_io_handle,
libpff_offsets_index_t *offsets_index,
int record_set_index,
const uint16_t *utf16_name,
size_t utf16_name_length,
const uint16_t *utf16_string,
size_t utf16_string_length,
uint32_t value_type,
libpff_record_entry_t **record_entry,
uint8_t flags,
Expand Down
18 changes: 9 additions & 9 deletions libpff/libpff_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,8 +1797,8 @@ int libpff_table_get_record_entry_by_type(
int libpff_table_get_record_entry_by_utf8_name(
libpff_table_t *table,
int set_index,
const uint8_t *utf8_name,
size_t utf8_name_length,
const uint8_t *utf8_string,
size_t utf8_string_length,
uint32_t value_type,
libpff_record_entry_t **record_entry,
uint8_t flags,
Expand Down Expand Up @@ -1846,7 +1846,7 @@ int libpff_table_get_record_entry_by_utf8_name(
"%s: retrieving table set: %d name: %s\n",
function,
set_index,
utf8_name );
utf8_string );
*/
}
#endif
Expand All @@ -1868,8 +1868,8 @@ int libpff_table_get_record_entry_by_utf8_name(
}
result = libpff_record_set_get_entry_by_utf8_name(
record_set,
utf8_name,
utf8_name_length,
utf8_string,
utf8_string_length,
value_type,
record_entry,
flags,
Expand Down Expand Up @@ -1902,8 +1902,8 @@ int libpff_table_get_record_entry_by_utf8_name(
int libpff_table_get_record_entry_by_utf16_name(
libpff_table_t *table,
int set_index,
const uint16_t *utf16_name,
size_t utf16_name_length,
const uint16_t *utf16_string,
size_t utf16_string_length,
uint32_t value_type,
libpff_record_entry_t **record_entry,
uint8_t flags,
Expand Down Expand Up @@ -1973,8 +1973,8 @@ int libpff_table_get_record_entry_by_utf16_name(
}
result = libpff_record_set_get_entry_by_utf16_name(
record_set,
utf16_name,
utf16_name_length,
utf16_string,
utf16_string_length,
value_type,
record_entry,
flags,
Expand Down
Loading

0 comments on commit 7d9c37e

Please sign in to comment.