* tests/misc/cat-proc: Try to avoid any spurious numeric
authorJim Meyering <jim@meyering.net>
Tue, 27 Jun 2006 18:43:58 +0000 (18:43 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 27 Jun 2006 18:43:58 +0000 (18:43 +0000)
differences in frequently-changing /proc/cpuinfo.
Reported by Nelson Beebe.

ChangeLog
tests/misc/cat-proc

index 22f2f58..da7620b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-27  Jim Meyering  <jim@meyering.net>
+
+       * tests/misc/cat-proc: Try to avoid any spurious numeric
+       differences in frequently-changing /proc/cpuinfo.
+       Reported by Nelson Beebe.
+
 2006-06-26  Jim Meyering  <jim@meyering.net>
 
        Attempt rmdir (actually, unlinkat-with-AT_REMOVEDIR) upon any
index 69e2065..b53864e 100755 (executable)
@@ -32,9 +32,10 @@ fail=0
 
 # Yes, parts of /proc/cpuinfo might change between cat runs.
 # If that happens, consider choosing a file that's less likely to change,
-# or just filter out the changing lines.
-cat -E $f | tr -d '$' > out || fail=1
-cat    $f | tr -d '$' > exp || fail=1
+# or just filter out the changing lines.  The sed filter should help
+# to avoid any spurious numeric differences.
+cat -E $f | sed 's/[0-9][0-9]*/D/g' | tr -d '$' > out || fail=1
+cat    $f | sed 's/[0-9][0-9]*/D/g' | tr -d '$' > exp || fail=1
 
 cmp out exp || fail=1
 test $fail = 1 && diff out exp 2> /dev/null