3 # @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
4 ##############################################################################
5 # Copyright (c) 2017 The Linux Foundation and others.
7 # All rights reserved. This program and the accompanying materials
8 # are made available under the terms of the Eclipse Public License v1.0
9 # which accompanies this distribution, and is available at
10 # http://www.eclipse.org/legal/epl-v10.html
12 ##############################################################################
14 # List of files exclude
15 declare -a excludes=("releng-defaults.yaml"
23 echo "Usage: $(basename $0) options (-n [next release]) (-c [current release]) (-p [previous release]) -h for help";
27 if ( ! getopts ":n:c:p:h" opt ); then
31 while getopts ":n:c:p:h" opt; do
43 echo "Invalid option: -$OPTARG" >&2
50 echo "Option -$OPTARG requires an argument." >&2
56 echo "Start Branch Cutting:"
58 while IFS="" read -r y; do
60 for f in "${excludes[@]}"; do
61 if [[ $y =~ $f && $found -eq 0 ]]; then
66 if [[ $found -eq 1 ]]; then
67 echo "Ignore file $y found in excludes list"
69 ./branch_cut.awk -v new_reltag="$new_reltag" -v curr_reltag="$curr_reltag" -v prev_reltag="$prev_reltag" "$y" > "$TEMP"
70 [[ ! -s "$TEMP" ]] && echo "$y: excluded"
71 [[ -s "$TEMP" ]] && mv "$TEMP" "$y" && echo "$y: Done" && let "mod++"
74 done < <(find ../../jjb -name "*.yaml")
76 echo "Modified $mod out of $count files"