1#!/bin/bash
2
3if [ "$#" -ne 2 ]; then
4    echo "Usage: $0 \"<version>\" \"<date>\""
5    exit 1
6fi
7
8cd $(dirname `realpath $0`)/..
9current_version="6\\.x"
10source_dirs="common common_modules common_smp ports ports_module ports_smp ports_arch utility"
11file_list=$(find $source_dirs -type f \( -name "*.[chsS]" -o -name "*.arm" -o -name "*.src" -o -name "*readme*" -o -name "*.mip" \)  -print)
12
13sed -i "s/$current_version  /$1/g" $file_list
14sed -i "s/$current_version/$1/g" $file_list
15sed -i "s/xx-xx-xxxx/$2/g" $file_list
16
17# Update version in port files
18source_dirs="ports ports_module ports_smp ports_arch"
19file_list=$(find $source_dirs -type f -name "*.h" -print)
20sed -i "/\"Copyright/,/[0-9]\.[0-9]/s/[0-9]\.[0-9\.]\+/$1/" $file_list
21