- Allow sudo to keep env
[meego-developer-tools:obs-light.git] / update_fakeobs_version.sh
1 #!/bin/sh
2
3 if [ $# -ne 2 ]; then
4   echo "usage: $0 <old_version> <new_version>"
5   exit 1
6 fi
7
8 OLDVERSION=$1
9 NEWVERSION=$2
10
11 PRJDIR=obslight-fakeobs
12 PACKAGING="$PRJDIR/packaging"
13
14 SPECFILE="$PACKAGING/obslight-fakeobs.spec"
15 YAMLFILE="$PACKAGING/obslight-fakeobs.yaml"
16 DEBIANLOG="$PACKAGING/debian.changelog"
17 DEBIANDSC="$PACKAGING/obslight-fakeobs.dsc"
18 DEBIANRULES="$PACKAGING/debian.rules"
19
20 echo __________________________________________________________________________
21 echo $YAMLFILE
22 grep --color "Version: $OLDVERSION" $YAMLFILE
23 sed -i s/"Version: $OLDVERSION"/"Version: $NEWVERSION"/ $YAMLFILE
24 echo "---"
25 grep --color "Version: $NEWVERSION" $YAMLFILE
26 echo "----------------"
27 echo __________________________________________________________________________
28 echo $SPECFILE
29 grep --color "Version:    $OLDVERSION" $SPECFILE
30 sed -i s/"Version:    $OLDVERSION"/"Version:    $NEWVERSION"/ $SPECFILE
31 echo "---"
32 grep --color "Version:    $NEWVERSION" $SPECFILE
33 echo "----------------"
34 echo __________________________________________________________________________
35 echo $DEBIANLOG
36 grep --color "obslight-fakeobs ($OLDVERSION-1)" $DEBIANLOG
37 sed -i s/"obslight-fakeobs ($OLDVERSION-1)"/"obslight-fakeobs ($NEWVERSION-1)"/ $DEBIANLOG
38 echo "---"
39 grep --color "obslight-fakeobs ($NEWVERSION-1)" $DEBIANLOG
40 echo "----------------"
41 echo __________________________________________________________________________
42 echo $DEBIANDSC
43 grep --color "Version: $OLDVERSION" $DEBIANDSC
44 sed -i s/"Version: $OLDVERSION"/"Version: $NEWVERSION"/ $DEBIANDSC
45 echo "---"
46 grep --color "Version: $NEWVERSION" $DEBIANDSC
47 echo -
48 grep --color "obslight_$OLDVERSION" $DEBIANDSC
49 sed -i s/"obslight-fakeobs_$OLDVERSION"/"obslight-fakeobs_$NEWVERSION"/ $DEBIANDSC
50 echo "---"
51 grep --color "obslight_$NEWVERSION" $DEBIANDSC
52 echo "----------------"
53 echo __________________________________________________________________________
54 echo $DEBIANRULES
55 grep --color "obslight-fakeobs-$OLDVERSION" $DEBIANRULES
56 sed -i s/"obslight-fakeobs-$OLDVERSION-"/"obslight-fakeobs-$NEWVERSION-"/ $DEBIANRULES
57 echo "---"
58 grep --color "obslight-fakeobs-$NEWVERSION" $DEBIANRULES
59 echo "----------------"