Skip to content

Commit

Permalink
Applied updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Nov 1, 2023
1 parent d33e633 commit 5513031
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 216 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Files to ignore by git
#
# Version: 20230405
# Version: 20230926

# Generic auto-generated build files
*~
Expand All @@ -25,10 +25,13 @@
*.swp
*.Tpo
*.trs
*.whl
/*.egg-info/
__pycache__
.deps
.dirstamp
.libs
.tox
INSTALL
Makefile
Makefile.bcc
Expand Down
18 changes: 6 additions & 12 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,14 @@ library:
(cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS))

distclean: clean
/bin/rm -f Makefile
/bin/rm -f config.status
/bin/rm -f config.cache
/bin/rm -f config.log
/bin/rm -f libfdatetime.pc
/bin/rm -f libfdatetime.spec
-rm -f Makefile
-rm -f config.status
-rm -f config.cache
-rm -f config.log
-rm -f libfdatetime.pc
-rm -f libfdatetime.spec
@for dir in ${subdirs}; do \
(cd $$dir && $(MAKE) distclean) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"

splint:
(cd $(srcdir)/libcerror && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libfdatetime && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/po && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/tests && $(MAKE) splint $(AM_MAKEFLAGS))

9 changes: 7 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,16 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
HOMEBREW_NO_INSTALL_CLEANUP: 1
CC: clang
CFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
CONFIGURE_OPTIONS: ""
- TARGET: macos-x64-gcc
BUILD_ENVIRONMENT: xcode
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
HOMEBREW_NO_INSTALL_CLEANUP: 1
CC: gcc
CFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
CONFIGURE_OPTIONS: ""
- TARGET: macos-pkgbuild
BUILD_ENVIRONMENT: xcode
Expand Down Expand Up @@ -112,14 +117,14 @@ environment:
install:
- cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] (
git clone https://github.com/libyal/vstools.git ..\vstools )
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update -q; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q gettext gnu-sed || true; fi
- ps: If ($env:BUILD_ENVIRONMENT -eq "cygwin64") {
(New-Object Net.WebClient).DownloadFile("https://cygwin.com/setup-x86_64.exe", "C:\\cygwin64\\setup-x86_64.exe") }
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel -P wget )
- cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] (
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gcc gettext-devel libtool make )
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc )
- ps: If ( ( "cygwin64-gcc-no-optimization", "mingw-w64-gcc-no-optimization" ).Contains( $env:TARGET ) ) {
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile ..\codecov.exe }

Expand Down
6 changes: 3 additions & 3 deletions common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MAINTAINERCLEANFILES = \
Makefile.in

distclean: clean
/bin/rm -f config.h
/bin/rm -f types.h
/bin/rm -f Makefile
-rm -f config.h
-rm -f types.h
-rm -f Makefile

3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ AC_PREREQ([2.71])

AC_INIT(
[libfdatetime],
[20230616],
[20231101],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
[include/libfdatetime.h.in])

AM_INIT_AUTOMAKE([gnu 1.6 tar-ustar])
AM_EXTRA_RECURSIVE_TARGETS([sources splint])

AC_CONFIG_MACRO_DIR([m4])

Expand Down
10 changes: 5 additions & 5 deletions include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ MAINTAINERCLEANFILES = \
Makefile.in

distclean: clean
/bin/rm -f libfdatetime.h
/bin/rm -f libfdatetime/definitions.h
/bin/rm -f libfdatetime/features.h
/bin/rm -f libfdatetime/types.h
/bin/rm -f Makefile
-rm -f libfdatetime.h
-rm -f libfdatetime/definitions.h
-rm -f libfdatetime/features.h
-rm -f libfdatetime/types.h
-rm -f Makefile

10 changes: 3 additions & 7 deletions libfdatetime.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ Version: @VERSION@
Release: 1
Summary: Library to support various date and time formats
Group: System Environment/Libraries
License: LGPLv3+
License: LGPL-3.0-or-later
Source: %{name}-%{version}.tar.gz
URL: https://github.com/libyal/libfdatetime
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@libfdatetime_spec_requires@ @ax_libcerror_spec_requires@
BuildRequires: gcc @ax_libcerror_spec_build_requires@

Expand Down Expand Up @@ -48,19 +47,16 @@ rm -rf %{buildroot}
%postun -p /sbin/ldconfig

%files -n libfdatetime
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%attr(755,root,root) %{_libdir}/*.so.*
%{_libdir}/*.so.*

%files -n libfdatetime-static
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%attr(755,root,root) %{_libdir}/*.a
%{_libdir}/*.a

%files -n libfdatetime-devel
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%{_libdir}/*.so
Expand Down
10 changes: 6 additions & 4 deletions libfdatetime/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ MAINTAINERCLEANFILES = \
Makefile.in

distclean: clean
/bin/rm -f libfdatetime_definitions.h
/bin/rm -f libfdatetime.rc
/bin/rm -f Makefile
-rm -f libfdatetime_definitions.h
-rm -f libfdatetime.rc
-rm -f Makefile

splint:
sources-local: $(BUILT_SOURCES)

splint-local:
@echo "Running splint on libfdatetime ..."
-splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(libfdatetime_la_SOURCES)

2 changes: 1 addition & 1 deletion manuals/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ MAINTAINERCLEANFILES = \
Makefile.in

distclean: clean
/bin/rm -f Makefile
-rm -f Makefile

2 changes: 1 addition & 1 deletion msvscpp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ MAINTAINERCLEANFILES = \
Makefile.in

distclean: clean
/bin/rm -f Makefile
-rm -f Makefile

3 changes: 3 additions & 0 deletions po/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ MSGID_BUGS_ADDRESS = @PACKAGE_BUGREPORT@
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =

# Additional make targets.
sources splint:

6 changes: 3 additions & 3 deletions synclibs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# Script that synchronizes the local library dependencies
#
# Version: 20230510
# Version: 20231023

EXIT_SUCCESS=0;
EXIT_FAILURE=1;
Expand Down Expand Up @@ -111,12 +111,12 @@ endif
if test ${LOCAL_LIB} = "libfplist";
then
# TODO: make this more generic to strip the last \\
sed -i'~' 's/libfplist_xml_scanner.c \\/libfplist_xml_scanner.c/' ${LOCAL_LIB_MAKEFILE_AM};
sed -i'~' '/EXTRA_DIST = /,/^$/s/libfplist_xml_scanner.c \\/libfplist_xml_scanner.c/' ${LOCAL_LIB_MAKEFILE_AM};

elif test ${LOCAL_LIB} = "libodraw";
then
# TODO: make this more generic to strip the last \\
sed -i'~' 's/libodraw_cue_scanner.c \\/libodraw_cue_scanner.c/' ${LOCAL_LIB_MAKEFILE_AM};
sed -i'~' '/EXTRA_DIST = /,/^$/s/libodraw_cue_scanner.c \\/libodraw_cue_scanner.c/' ${LOCAL_LIB_MAKEFILE_AM};

else
sed -i'~' '/EXTRA_DIST = /,/^$/d' ${LOCAL_LIB_MAKEFILE_AM};
Expand Down
2 changes: 1 addition & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ MAINTAINERCLEANFILES = \
Makefile.in

distclean: clean
/bin/rm -f Makefile
-rm -f Makefile

75 changes: 41 additions & 34 deletions tests/test_library.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env bash
# Tests library functions and types.
#
# Version: 20230410
# Version: 20231007

EXIT_SUCCESS=0;
EXIT_FAILURE=1;
EXIT_IGNORE=77;

LIBRARY_TESTS="date_time_values error fat_date_time filetime floatingtime hfs_time nsf_timedate posix_time support systemtime";
LIBRARY_TESTS_WITH_INPUT="";
OPTION_SETS="";
OPTION_SETS=();

INPUT_GLOB="*";

Expand Down Expand Up @@ -78,47 +78,54 @@ run_test_with_input()

local TEST_SET_DIRECTORY=$(get_test_set_directory "${TEST_PROFILE_DIRECTORY}" "${TEST_SET_INPUT_DIRECTORY}");

local OLDIFS=${IFS};

# IFS="\n" is not supported by all platforms.
IFS="
";

if test -f "${TEST_SET_DIRECTORY}/files";
then
for INPUT_FILE in `cat ${TEST_SET_DIRECTORY}/files | sed "s?^?${TEST_SET_INPUT_DIRECTORY}/?"`;
IFS="" read -a INPUT_FILES <<< $(cat ${TEST_SET_DIRECTORY}/files | sed "s?^?${TEST_SET_INPUT_DIRECTORY}/?");
else
IFS="" read -a INPUT_FILES <<< $(ls -1d ${TEST_SET_INPUT_DIRECTORY}/${INPUT_GLOB});
fi
for INPUT_FILE in "${INPUT_FILES[@]}";
do
OPTION_INPUT_FILE="${INPUT_FILE}";

if test "${OSTYPE}" = "msys";
then
# A test executable built with MinGW expects a Windows path.
INPUT_FILE=`echo ${INPUT_FILE} | sed 's?/?\\\\?g'`;
fi
local TESTED_WITH_OPTIONS=0;

for OPTION_SET in ${OPTION_SETS[@]};
do
if test "${OSTYPE}" = "msys";
then
# A test executable built with MinGW expects a Windows path.
INPUT_FILE=`echo ${INPUT_FILE} | sed 's?/?\\\\?g'`;
fi
run_test_on_input_file_with_options "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SETS}" "${TEST_EXECUTABLE}" "${INPUT_FILE}";
RESULT=$?;
local TEST_DATA_OPTION_FILE=$(get_test_data_option_file "${TEST_SET_DIRECTORY}" "${OPTION_INPUT_FILE}" "${OPTION_SET}");

if test ${RESULT} -ne ${EXIT_SUCCESS};
if test -f ${TEST_DATA_OPTION_FILE};
then
break;
TESTED_WITH_OPTIONS=1;

IFS=" " read -a OPTIONS <<< $(read_test_data_option_file "${TEST_SET_DIRECTORY}" "${INPUT_FILE}" "${OPTION_SET}");

run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SET}" "${TEST_EXECUTABLE}" "${INPUT_FILE}" "${OPTIONS[@]}";
RESULT=$?;

if test ${RESULT} -ne ${EXIT_SUCCESS};
then
break;
fi
fi
done
else
for INPUT_FILE in `ls -1d ${TEST_SET_INPUT_DIRECTORY}/${INPUT_GLOB}`;
do
if test "${OSTYPE}" = "msys";
then
# A test executable built with MinGW expects a Windows path.
INPUT_FILE=`echo ${INPUT_FILE} | sed 's?/?\\\\?g'`;
fi
run_test_on_input_file_with_options "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "${OPTION_SETS}" "${TEST_EXECUTABLE}" "${INPUT_FILE}";

if test ${TESTED_WITH_OPTIONS} -eq 0;
then
run_test_on_input_file "${TEST_SET_DIRECTORY}" "${TEST_DESCRIPTION}" "default" "" "${TEST_EXECUTABLE}" "${INPUT_FILE}";
RESULT=$?;
fi

if test ${RESULT} -ne ${EXIT_SUCCESS};
then
break;
fi
done
fi
IFS=${OLDIFS};
if test ${RESULT} -ne ${EXIT_SUCCESS};
then
break;
fi
done

if test ${RESULT} -ne ${EXIT_SUCCESS};
then
Expand Down
Loading

0 comments on commit 5513031

Please sign in to comment.