File: update-version-and-date.sh

package info (click to toggle)
yadifa 3.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,392 kB
  • sloc: ansic: 254,102; makefile: 1,409; pascal: 971; sh: 706
file content (32 lines) | stat: -rwxr-xr-x 782 bytes parent folder | download
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
30
31
32
#!/bin/sh

SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

d=$(date +'%Y-%m-%d')
ed=$(date +'%Y\\-%m\\-%d')
version=$(cat $SCRIPTPATH/../VERSION)

echo version: $version
echo date: $d
echo escaped date: $ed

cd $SCRIPTPATH

for f in *.man
do
	echo processing escaped date of $f
	sed -i "s/20[0-9][0-9]\\\\-[0-9][0-9]\\\\-[0-9][0-9]/$ed/" $f
done

for f in *.tex
do
	echo processing date of $f
	sed -i "s/20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]/$d/" $f
done

for f in *.man *.tex
do
	echo processing version of $f
	sed -i -e "s/Version: [1-3]\\.[0-9]*[0-9]\\.[0-9]*[0-9]/Version: $version/" -e "s/{[1-3]\\.[0-9]*[0-9]\\.[0-9]*[0-9]}/{$version}/" -e "s/\"[1-3]\\.[0-9]*[0-9]\\.[0-9]*[0-9]\"/{$version}/" -e "s/YADIFA [1-3]\\.[0-9]*[0-9]\\.[0-9]*[0-9]/YADIFA $version/" $f
done