From d3c8aecc8b34137eed877baa23f6dbe60831c94e Mon Sep 17 00:00:00 2001 From: Joao Eriberto Mota Filho Date: Mon, 16 Aug 2021 22:32:27 -0300 Subject: [PATCH 1/4] Make configure.ac compliant with autoconf >= 2.70 autoconf >= 2.70 produces the following warnings in current configure.ac: configure.ac:51: warning: The macro `AC_HEADER_STDC' is obsolete. configure.ac:51: You should run autoupdate. ./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from... configure.ac:51: the top level configure.ac:75: warning: AC_OUTPUT should be used without arguments. configure.ac:75: You should run autoupdate. This PR fixes those warnings. --- configure.ac | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 407ff19..7c654e8 100644 --- a/configure.ac +++ b/configure.ac @@ -3,9 +3,10 @@ dnl dnl Process this file with autoconf to produce a configure script. dnl -AC_PREREQ(2.50) +AC_PREREQ([2.69]) -AC_INIT(hexedit.c) +AC_INIT +AC_CONFIG_SRCDIR([hexedit.c]) AC_CONFIG_HEADERS(config.h) define(TheVERSION, 1.5) @@ -48,7 +49,7 @@ dnl whether functions and headers are available, whether they work, etc. AC_SYS_LARGEFILE dnl Checks for header files. -AC_HEADER_STDC +AC_PROG_EGREP AC_HEADER_STAT AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h unistd.h libgen.h sys/mount.h) @@ -72,4 +73,5 @@ $ac_includes_default #endif ) -AC_OUTPUT(Makefile Makefile-build hexedit.1) +AC_CONFIG_FILES([Makefile Makefile-build hexedit.1]) +AC_OUTPUT From 5930d6bfe0285ed9ddb172b4c65364049f6b91d1 Mon Sep 17 00:00:00 2001 From: Joao Eriberto Mota Filho Date: Tue, 31 Aug 2021 21:29:33 -0300 Subject: [PATCH 2/4] Add a CI test for GitHub It will run after each push to test an initial build, install and uninstall. After this a distclean and a second build and install will run to test if these actions execute twice. Any error in source code will break the build and invalidate the CI test. Currently, part of the test is disabled because the uninstall target doesn't exist yet. --- .github/workflows/full-check.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/full-check.yml diff --git a/.github/workflows/full-check.yml b/.github/workflows/full-check.yml new file mode 100644 index 0000000..79f44f1 --- /dev/null +++ b/.github/workflows/full-check.yml @@ -0,0 +1,27 @@ +name: full-check + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: install_dependencies + run: sudo apt install libncurses5-dev + - name: first_build + run: | + ./autogen.sh + ./configure + make + sudo make install +# sudo make uninstall +# make distclean +# - name: second_build_to_test_build_twice +# run: | +# ./autogen.sh +# ./configure +# make +# sudo make install From 486d1735b13fd433453518e3becf6d84c6ba94c5 Mon Sep 17 00:00:00 2001 From: Joao Eriberto Mota Filho Date: Tue, 31 Aug 2021 22:22:20 -0300 Subject: [PATCH 3/4] Add uninstall target This PR depends of #54. This PR will add uninstall target and improve the CI tests. --- .github/workflows/full-check.yml | 16 ++++++++-------- Makefile.in | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/full-check.yml b/.github/workflows/full-check.yml index 79f44f1..a4fe55e 100644 --- a/.github/workflows/full-check.yml +++ b/.github/workflows/full-check.yml @@ -17,11 +17,11 @@ jobs: ./configure make sudo make install -# sudo make uninstall -# make distclean -# - name: second_build_to_test_build_twice -# run: | -# ./autogen.sh -# ./configure -# make -# sudo make install + sudo make uninstall + make distclean + - name: second_build_to_test_build_twice + run: | + ./autogen.sh + ./configure + make + sudo make install diff --git a/Makefile.in b/Makefile.in index a62b753..0a6c8f8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46,3 +46,7 @@ install: $(PRODUCT) $(INSTALL) -m 755 $(PRODUCT) $(DESTDIR)$(bindir) $(INSTALL) -d -m 755 $(DESTDIR)$(mandir)/man1 $(INSTALL) -m 644 $(PRODUCT).1 $(DESTDIR)$(mandir)/man1 + +uninstall: + test -f $(DESTDIR)$(bindir)/$(PRODUCT) && rm -f $(DESTDIR)$(bindir)/$(PRODUCT) + test -f $(DESTDIR)$(mandir)/man1/$(PRODUCT).1 && rm -r $(DESTDIR)$(mandir)/man1/$(PRODUCT).1 From 2b002538dee2e6c1f737188dd79bb7806e2f584d Mon Sep 17 00:00:00 2001 From: Joao Eriberto Mota Filho Date: Tue, 31 Aug 2021 22:32:00 -0300 Subject: [PATCH 4/4] Test hexedit -v --- .github/workflows/full-check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/full-check.yml b/.github/workflows/full-check.yml index a4fe55e..078a84e 100644 --- a/.github/workflows/full-check.yml +++ b/.github/workflows/full-check.yml @@ -25,3 +25,6 @@ jobs: ./configure make sudo make install + - name: run_hexedit_to_show_version + run: | + hexedit -v 2>&1 | grep maximize