aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-11-07 22:25:22 +0200
committerArnold D. Robbins <arnold@skeeve.com>2013-11-07 22:25:22 +0200
commitdb78c6a3ccd2bfde092124eca1d3174ac3902f55 (patch)
treeec38326873548359e4d809e5cd739a072491083c
parent07aa3d5dafee42fcaa3eaa0370a187c5cb53570e (diff)
downloadegawk-db78c6a3ccd2bfde092124eca1d3174ac3902f55.tar.gz
egawk-db78c6a3ccd2bfde092124eca1d3174ac3902f55.tar.bz2
egawk-db78c6a3ccd2bfde092124eca1d3174ac3902f55.zip
Solaris fixes.
-rw-r--r--test/ChangeLog10
-rw-r--r--test/Makefile.am8
-rw-r--r--test/Makefile.in8
-rw-r--r--test/readdir0.awk37
4 files changed, 50 insertions, 13 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index bec7175b..1193a8b5 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,13 @@
+2013-11-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ Solaris fixes.
+
+ * readdir0.awk: Run ls -afi and ls -la separately since POSIX
+ says that -f turns off -l. Thanks to Dagobert Michelsen
+ <dam@opencsw.org> for the report.
+ * Makefile.am (diffout): Don't use POSIX or bash-isms so that
+ it will work on Solaris. Sigh.
+
2013-11-03 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (backsmalls2): New test.
diff --git a/test/Makefile.am b/test/Makefile.am
index 26734173..b92cbf24 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1917,15 +1917,17 @@ pass-fail:
fi
# This target for my convenience to look at all the results
+# Don't use POSIX or bash-isms so that it'll work on !@#$%^&*() Solaris.
diffout:
for i in _* ; \
do \
if [ "$$i" != "_*" ]; then \
echo ============== $$i ============= ; \
- if [ -r $${i#_}.ok ]; then \
- diff -c $${i#_}.ok $$i ; \
+ base=`echo $$i | sed 's/^_//'` ; \
+ if [ -r $${base}.ok ]; then \
+ diff -c $${base}.ok $$i ; \
else \
- diff -c "$(srcdir)"/$${i#_}.ok $$i ; \
+ diff -c "$(srcdir)"/$${base}.ok $$i ; \
fi ; \
fi ; \
done | more
diff --git a/test/Makefile.in b/test/Makefile.in
index 9601241f..1f1a2757 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -3650,15 +3650,17 @@ pass-fail:
fi
# This target for my convenience to look at all the results
+# Don't use POSIX or bash-isms so that it'll work on !@#$%^&*() Solaris.
diffout:
for i in _* ; \
do \
if [ "$$i" != "_*" ]; then \
echo ============== $$i ============= ; \
- if [ -r $${i#_}.ok ]; then \
- diff -c $${i#_}.ok $$i ; \
+ base=`echo $$i | sed 's/^_//'` ; \
+ if [ -r $${base}.ok ]; then \
+ diff -c $${base}.ok $$i ; \
else \
- diff -c "$(srcdir)"/$${i#_}.ok $$i ; \
+ diff -c "$(srcdir)"/$${base}.ok $$i ; \
fi ; \
fi ; \
done | more
diff --git a/test/readdir0.awk b/test/readdir0.awk
index c98ac674..3a114fcd 100644
--- a/test/readdir0.awk
+++ b/test/readdir0.awk
@@ -11,12 +11,35 @@ BEGIN {
}
}
-{
- ino = $1
- name = $NF
- type = substr($2, 1, 1)
- if (type == "-")
- type = "f"
+BEGIN {
+ ls_afi = "ls -afi .."
+ ls_al = "ls -la .. | sed 1d"
+
+ for (i = 1; (ls_afi | getline) > 0; i++) {
+ # inode number is $1, filename is read of record
+ inode = $1
+ $1 = ""
+ $0 = $0
+ sub(/^ */, "")
+ names[i] = $0
+ ino[names[i]] = inode
+ }
+ close(ls_afi)
+
+ for (j = 1; (ls_al | getline) > 0; j++) {
+ type_let = substr($0, 1, 1)
+ if (type_let == "-")
+ type_let = "f"
+ $1 = $2 = $3 = $4 = $5 = $6 = $7 = $8 = ""
+ $0 = $0
+ sub(/^ */, "")
+ type[$0] = type_let
+ }
+ close(ls_al)
- printf "%s/%s/%s\n", ino, name, (ftype_unknown ? "u" : type)
+ if (i != j)
+ printf("mismatch: %d from `ls -afi' and %d from `ls -l'\n", i, j) > "/dev/stderr"
+
+ for (i = 1; i in names; i++)
+ printf("%s/%s/%s\n", ino[names[i]], names[i], type[names[i]])
}