1
0
mirror of https://github.com/azure-rtos/guix.git synced 2025-01-28 07:03:11 +08:00
guix/scripts/update_patch.sh

22 lines
693 B
Bash
Raw Permalink Normal View History

2023-12-28 13:06:22 +08:00
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 \"<version>\" \"<date>\""
exit 1
fi
# Change the current working directory to the parent directory of this script.
cd $(dirname `realpath $0`)/..
current_version="6\\.x"
source_dirs="common ports"
file_list=$(find $source_dirs -type f -name '*.[ch]' -print)
sed -i "s/$current_version /$1/g" $file_list
sed -i "s/$current_version/$1/g" $file_list
sed -i "s/xx-xx-xxxx/$2/g" $file_list
sed -i "s/xx\/xx\/xxxx/${2:0:2}\/${2:3:2}\/${2:6:4}/g" readme/*
# Update version in port files
source_dirs="ports"
file_list=$(find $source_dirs -type f -name "*.h" -print)
sed -i "/\"Copyright/,/[0-9]\.[0-9]/s/[0-9]\.[0-9\.]\+/$1/" $file_list