]> The Tcpdump Group git mirrors - tcpdump/commitdiff
tests: On HP-UX use "diff -c" by default. [skip ci]
authorDenis Ovsienko <[email protected]>
Wed, 18 Sep 2024 12:27:50 +0000 (13:27 +0100)
committerDenis Ovsienko <[email protected]>
Wed, 18 Sep 2024 12:30:41 +0000 (13:30 +0100)
HP-UX diff does not support the -u flag.  Based on the feedback from
Richard Lloyd of Connect Internet Solutions.

CHANGES
tests/TESTrun

diff --git a/CHANGES b/CHANGES
index d20baa7d6a2b694d920174b10171c1fb421f6919..2c68ec0f4de8fb0fffc02d54788c055400d4d3d0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -64,6 +64,7 @@ DayOfTheWeek, Month DD, YYYY / The Tcpdump Group
       CMake: Skip snprintf(3) tests when cross-compiling.
       Makefile.in: Do not install a version-suffixed tcpdump binary if the
         .devel file does not exists.
+      tests: On HP-UX use "diff -c" by default.
     Documentation:
       man: Clarify the "any" pseudo-interface further.
 
index 0a1a255ccc82991d7da1b80d7e0bb8afd5761024..e7bf6ce1b2930c74321a7445609d355554e1114c 100755 (executable)
@@ -39,8 +39,12 @@ mkpath($newdir);
 mkpath($diffdir);
 my $origdir = getcwd();
 my $srcdir  = $ENV{'srcdir'} || ".";
-# Default to unified diff and allow to fall back to basic diff if necessary.
-my $diff_flags = defined $ENV{'DIFF_FLAGS'} ? $ENV{'DIFF_FLAGS'} : '-u';
+# Default to unified context diff (on HP-UX diff does not support it, so
+# default to the closest alternative) and allow to fall back to another diff
+# format if necessary.
+my $diff_flags = defined $ENV{'DIFF_FLAGS'} ? $ENV{'DIFF_FLAGS'} :
+       $^O eq 'hpux' ? '-c' :
+       '-u';
 
 #
 # Force UTC, so time stamps are printed in a standard time zone, and