File: change-release.sh

package info (click to toggle)
xmlsec1 1.2.14-1%2Bsqueeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,492 kB
  • ctags: 8,701
  • sloc: ansic: 61,722; sh: 11,345; xml: 11,035; makefile: 908; perl: 85
file content (34 lines) | stat: -rwxr-xr-x 757 bytes parent folder | download | duplicates (7)
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
33
34
#!/bin/sh


old_release=$1
new_release=$2

sh_files=`find . -name "*.sh" -print`
am_files=`find . -name "*.am" -print`
in_files=`find . -name "*.in" -print`
html_files=`find . -name "*.html" -print`
sgml_files=`find . -name "*.sgml" -print`
cvsignore_files=`find . -name ".cvsignore" -print`

files="$sh_files $am_files $in_files $html_files $sgml_files $cvsignore_files"
for i in  $files; do
    echo Processing $i ...
    sed "s/$old_release/$new_release/g" $i > $i.tmp
    if [ $? != 0 ]; then
	echo "Failed to process file $i"
	exit 1
    fi
    
    mode=`stat -c "%a" $i`
    chmod $mode $i.tmp
    if [ $? != 0 ]; then
	echo "Failed to retore permissions for $i"
	exit 1
    fi
done

for i in  $files; do
    echo Moving $i ...
    mv $i.tmp $i
done