Skip to content

Commit

Permalink
Applied updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Nov 6, 2023
1 parent d54919c commit ee43d1f
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
- name: Prepare build
run: |
./synclibs.sh --use-head && ./autogen.sh && ./configure
./synclibs.sh --use-head && ./autogen.sh && ./configure && make sources >/dev/null
- name: Build Python wheel
run: |
tox -e${{ matrix.toxenv }}
28 changes: 6 additions & 22 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,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 libhmac.pc
/bin/rm -f libhmac.spec
-rm -f Makefile
-rm -f config.status
-rm -f config.cache
-rm -f config.log
-rm -f libhmac.pc
-rm -f libhmac.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)/libcthreads && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libhmac && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/pyhmac && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libclocale && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcnotify && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcsplit && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libuna && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcfile && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/libcpath && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/hmactools && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/po && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/tests && $(MAKE) splint $(AM_MAKEFLAGS))
(cd $(srcdir)/ossfuzz && $(MAKE) splint $(AM_MAKEFLAGS))

2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ build_script:
- sh: if test ${BUILD_ENVIRONMENT} = "xcode"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; tests/build.sh ${CONFIGURE_OPTIONS}; fi
- cmd: if [%BUILD_ENVIRONMENT%]==[python] (
"%PYTHON%" setup.py bdist_wheel )
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make >/dev/null && tox -e${TOXENV}; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV}; fi
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
xcopy /i /q /s C:\projects\libhmac C:\cygwin64\home\appveyor\libhmac &&
C:\cygwin64\bin\bash -e -l -c "cd libhmac && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O './config.guess' && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O './config.sub'" &&
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(
[libhmac],
[20231005],
[20231106],
[[email protected]])

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

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

AC_CONFIG_MACRO_DIR([m4])

Expand Down
4 changes: 2 additions & 2 deletions hmactools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ MAINTAINERCLEANFILES = \
Makefile.in

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

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

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 libhmac.h
/bin/rm -f libhmac/definitions.h
/bin/rm -f libhmac/features.h
/bin/rm -f libhmac/types.h
/bin/rm -f Makefile
-rm -f libhmac.h
-rm -f libhmac/definitions.h
-rm -f libhmac/features.h
-rm -f libhmac/types.h
-rm -f Makefile

10 changes: 6 additions & 4 deletions libhmac/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ MAINTAINERCLEANFILES = \
Makefile.in

distclean: clean
/bin/rm -f libhmac_definitions.h
/bin/rm -f libhmac.rc
/bin/rm -f Makefile
-rm -f libhmac_definitions.h
-rm -f libhmac.rc
-rm -f Makefile

splint:
sources-local: $(BUILT_SOURCES)

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

2 changes: 1 addition & 1 deletion manuals/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,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 @@ -31,5 +31,5 @@ MAINTAINERCLEANFILES = \
Makefile.in

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

4 changes: 2 additions & 2 deletions ossfuzz/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ MAINTAINERCLEANFILES = \
Makefile.in

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

splint:
splint-local:
@echo "Running splint on md5_context_fuzzer ..."
-splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(md5_context_fuzzer_SOURCES)
@echo "Running splint on sha1_context_fuzzer ..."
Expand Down
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:

4 changes: 2 additions & 2 deletions pyhmac-python2/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ MAINTAINERCLEANFILES = \
Makefile.in

clean-local:
/bin/rm -f pyhmac*.[ch]
-rm -f pyhmac*.[ch]

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

4 changes: 2 additions & 2 deletions pyhmac-python3/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ MAINTAINERCLEANFILES = \
Makefile.in

clean-local:
/bin/rm -f pyhmac*.[ch]
-rm -f pyhmac*.[ch]

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

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

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

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 @@ -199,5 +199,5 @@ MAINTAINERCLEANFILES = \
Makefile.in

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

3 changes: 1 addition & 2 deletions tests/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ set -e
./synclibs.sh --use-head
./autogen.sh
./configure "$@"
# make > /dev/null
make
make > /dev/null

34 changes: 19 additions & 15 deletions tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
#
# Script to run Python test scripts.
#
# Version: 20231004
# Version: 20231024

import glob
import os
import sys
import unittest


test_profile = ".pybde"
test_profile = ".pyhmac"
input_glob = "*"
option_sets = ["offset", "password", "recovery_password", "startup_key"]
option_sets = []


def ReadIgnoreList(test_profile):
Expand Down Expand Up @@ -58,18 +58,22 @@ def ReadIgnoreList(test_profile):

setattr(unittest, "source", source_file)

for option_set in option_sets:
test_file = os.path.basename(source_file)
test_options_file_path = os.path.join(
"tests", "input", test_profile, test_set,
f"{test_file:s}.{option_set:s}")
if os.path.isfile(test_options_file_path):
with open(test_options_file_path, "r", encoding="utf-8") as file_object:
lines = [line.strip() for line in file_object.readlines()]
if lines[0] == "# libyal test data options":
for line in lines[1:]:
key, value = line.split("=", maxsplit=1)
setattr(unittest, key, value)
if source_file:
for option_set in option_sets:
test_file = os.path.basename(source_file)
test_options_file_path = os.path.join(
"tests", "input", test_profile, test_set,
f"{test_file:s}.{option_set:s}")
if os.path.isfile(test_options_file_path):
with open(test_options_file_path, "r", encoding="utf-8") as file_object:
lines = [line.strip() for line in file_object.readlines()]
if lines[0] == "# libyal test data options":
for line in lines[1:]:
key, value = line.split("=", maxsplit=1)
if key == 'offset':
value = int(value)

setattr(unittest, key, value)

test_results = test_runner.run(test_scripts)
if not test_results.wasSuccessful():
Expand Down
4 changes: 2 additions & 2 deletions tests/test_runner.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Bash functions to run an executable for testing.
#
# Version: 20231001
# Version: 20231013
#
# When CHECK_WITH_ASAN is set to a non-empty value the test executable
# is run with asan, otherwise it is run without.
Expand Down Expand Up @@ -410,7 +410,7 @@ read_test_data_option_file()

if test "${OPTIONS_STRING}" = "# libyal test data options";
then
OPTIONS_STRING=`tail -n +2 "${TEST_DATA_OPTION_FILE}" | sed 's/^offset=/-o/;s/^password=/-p/;s/^recovery_password=/-r/;s/^startup_key=/-s/' | tr '\n' ' '`;
OPTIONS_STRING=`tail -n +2 "${TEST_DATA_OPTION_FILE}" | sed 's/^offset=/-o/;s/^password=/-p/;s/^recovery_password=/-r/;s/^startup_key=/-s/;s/virtual_address=/-v/' | tr '\n' ' '`;
fi
echo "${OPTIONS_STRING}";
}
Expand Down

0 comments on commit ee43d1f

Please sign in to comment.