File: make-abick.sh

package info (click to toggle)
spl 1.0~pre6-3.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,360 kB
  • sloc: ansic: 16,614; yacc: 3,182; sh: 299; makefile: 167; xml: 156
file content (12 lines) | stat: -rw-r--r-- 405 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

set -ue

oldabi="$( grep '^#define SPL_ABICKSUM ' spl.h | cut -f3 -d' '; )"
newabi="$( grep -v '^#define SPL_ABI' spl.h | cksum | cut -f1 -d' '; )"

echo "** Patching ABI checksum (new: $newabi, old: $oldabi) to spl.h."
rm -f spl.h.new
sed -e 's,^\(#define SPL_ABICKSUM\).*,\1 '"$newabi"',' \
    -e '/^#define SPL_ABI(/ s,\(SPL_ABI\)_[0-9]*,\1_'$newabi',' <spl.h >spl.h.new
mv spl.h.new spl.h