2 # Compare the two halves (user and group) of idcache.c.
3 # Once xformed, they'd better be the same:
6 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
7 trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
8 trap '(exit $?); exit $?' 1 2 13 15
12 mkdir -p $tmp || framework_failure=1
13 cd $tmp || framework_failure=1
15 if test $framework_failure = 1; then
16 echo "$0: failure in testing framework" 1>&2
20 # Extract user-oriented functions.
22 'print if /^static struct.*user_alist/ .. /^static struct.*group_alist/' \
23 $srcdir/idcache.c | head -n -3 > u
24 # Extract group-oriented functions.
25 perl -ne 'print if /^static struct.*group_alist/ .. eof' $srcdir/idcache.c > g
27 # Convert user-specific strings of "u" into corresponding group-specific strings
42 s/login name/group name/;
43 s/to be the/to belong to/;
48 # Ensure that the transformed "u" is the same as g.
49 # Any differences here constitute an error.
50 perl -pe "$subst" u | diff -u - g || fail=1