m4/version.m4: Define libquvi_scripts_r*
[libquvi-scripts.git] / stamp.sh
blob943530c8164d00ab3cf52d2bf4775a7f3f13084e
1 #!/bin/sh
2 # stamp.sh for libquvi-scripts
3 # - stamps the lua scripts to match the version
5 stamp_scripts()
7 [ -z $1 ] && (echo "error: define path to top source dir" ; exit 1)
8 [ -z $2 ] && (echo "error: define path to top dist dir" ; exit 1)
9 if [ -x "$2/gen-ver.sh" ]; then
10 D='common/ media/ playlist/ scan/ util/'
11 VN=`$2/gen-ver.sh $1`
12 for d in $D; do
13 find "$2/share/$d" -name '*.lua' \
14 -exec echo "Stamp {}" \; \
15 -exec sed -i "s/^\(-- libquvi-scripts\).*/\1 $VN/" {} \;
16 done
18 exit 0
21 help()
23 echo "Usage: $0 [-h] [top_srcdir]
24 -h Show this help and exit"
25 exit 0
28 while [ $# -gt 0 ]
30 case "$1" in
31 -h) help;;
32 *) break;;
33 esac
34 shift
35 done
37 echo "Find and stamp lua scripts..."
38 stamp_scripts $1 $2