File: fixver.sh

package info (click to toggle)
allegro4.4 2%3A4.4.3.1-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 20,756 kB
  • sloc: ansic: 164,458; asm: 17,620; cpp: 3,848; javascript: 3,053; objc: 1,687; sh: 1,107; python: 676; pascal: 179; makefile: 57; perl: 29; lisp: 1
file content (29 lines) | stat: -rwxr-xr-x 955 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
#
#  Shell script to adjust the version numbers and dates wherever they appear
#  on the JPGalleg sources and text files.

if [ $# -ne 2 ]; then
   echo "Usage: fixver major minor" 1>&2
   exit 1
fi

ver_str="$1.$2"
year_str="$(date +%Y)"

echo "s/Version [0-9]\.[0-9], by Angelo Mottola, .*/Version $ver_str, by Angelo Mottola, 2000-$year_str/" > fixver.sed
echo "s/JPGalleg [0-9]\.[0-9], by Angelo Mottola, .*/JPGalleg $ver_str, by Angelo Mottola, 2000-$year_str/" >> fixver.sed
echo "s/\"JPGalleg [0-9]\.[0-9], by Angelo Mottola, .*/\"JPGalleg $ver_str, by Angelo Mottola, 2000-$year_str\"/" >> fixver.sed
echo "s/JPGALLEG_VERSION .*/JPGALLEG_VERSION 0x0$1\0$2/" >> fixver.sed

files_list=`find . -type f "(" -name "*.c" -o -name "*.s" -o -name "*.h" -o -name "makefile*" ")"`

for file in $files_list; do
   echo "Patching $file..."
   cp $file fixver.tmp
   sed -f fixver.sed fixver.tmp > $file
done

rm fixver.sed fixver.tmp

echo "Done!"