Home | History | Annotate | Line # | Download | only in util
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos HERE=`dirname $0`
      4  1.1  christos 
      5  1.1  christos for f in "$@"; do
      6  1.1  christos     # It's worth nothing that 'openssl sha256 -r' assumes that all input
      7  1.1  christos     # is binary.  This isn't quite true, and we know better, so we convert
      8  1.1  christos     # the '*stdin' marker to the filename preceded by a space.  See the
      9  1.1  christos     # sha1sum manual for a specification of the format.
     10  1.1  christos     case "$f" in
     11  1.1  christos         *.c | *.c.in | *.h | *.h.in | *.inc)
     12  1.1  christos             cat "$f" \
     13  1.1  christos                 | $HERE/lang-compress.pl 'C' \
     14  1.1  christos                 | unifdef -DFIPS_MODULE=1 \
     15  1.1  christos                 | openssl sha256 -r \
     16  1.1  christos                 | sed -e "s| \\*stdin|  $f|"
     17  1.1  christos             ;;
     18  1.1  christos         *.pl )
     19  1.1  christos             cat "$f" \
     20  1.1  christos                 | $HERE/lang-compress.pl 'perl' \
     21  1.1  christos                 | openssl sha256 -r \
     22  1.1  christos                 | sed -e "s| \\*stdin|  $f|"
     23  1.1  christos             ;;
     24  1.1  christos         *.S )
     25  1.1  christos             cat "$f" \
     26  1.1  christos                 | $HERE/lang-compress.pl 'S' \
     27  1.1  christos                 | openssl sha256 -r \
     28  1.1  christos                 | sed -e "s| \\*stdin|  $f|"
     29  1.1  christos             ;;
     30  1.1  christos     esac
     31  1.1  christos done
     32