summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/eplain/base/fix-checksum
blob: c2f830f10f3a58cec29ac2091b4afadf0ac30c35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# This file is public domain.

# Fix a checksum line in the files given as arguments.

tmpfile=/tmp/checksum$$

for f in $*
do
  checksum=""
  newchecksum=`wc < $f | sed "s/^ *//"`
  while test "$checksum" != "$newchecksum"
  do
    sed -e "1,50s/checksum = .*,/checksum = \"$newchecksum\",/" $f > $tmpfile
    checksum="$newchecksum"
    newchecksum=`wc < $tmpfile | sed "s/^ *//"`
  done
  mv -f $tmpfile $f
done