+# function to parse release partizipation information
+# call: getrpinfo "projectname"
+# result: $return_from_getrpinfo
+# because bash supports only returning numeric values a variable $return_from_getrpinfo is used
+
+function getrpinfo {
+
+ local requested=$1
+
+ # clean up first
+ local rpdetails=""
+ local rpline=""
+ local rprepo=""
+ local rpproject=""
+ local current_branch_starting_letter=""
+ return_from_getrpinfo=""
+
+ # finds first matching line in the array using grep (currently every line shows the same partizipation for the project (NOT repository!) )
+ # this is much faster then looping line by line
+ rpline=$(IFS=$'\n'; echo "${rparray[*]}" | grep -m 1 ";${requested};");
+ rpline=$(echo ${rpline} | tr -d '^M')
+ rprepo=$(echo ${rpline} | awk -F ";" '{print $1}');
+ rpproject=$(echo ${rpline} | awk -F ";" '{print $2}');
+ # concatenate details to do an easy grep later on to find out if or if not the project/repo has partizipated to a release
+ rpdetails=$(echo ${rpline} | awk -F ";" '{print "-" $3 "-" $4 "-" $5 "-" $6 "-" $7 "-" $8 "-" $9 "-" $10 "-" $11 "-" $12 "-"}');
+
+ # result will be e.g. "-g" and this avoids false positives with the "m" release
+ # (because "m" is also used to indicate the maintenance release, e.g. "gm")
+ current_branch_starting_letter="-${branch:0:1}"
+
+ #echo "DBUG: getrpinfo ****************************";
+ #echo "DBUG: getrpinfo requested = \"${requested}\"";
+ #echo "DBUG: getrpinfo rpproject = \"${rpproject}\"";
+ #echo "DBUG: getrpinfo rpdetails = \"${rpdetails}\"";
+ #echo "DBUG: current branch = \"${branch}\"";
+ #echo "DBUG: starting_letter = \"${current_branch_starting_letter}\"";
+
+ # check
+ if [[ ${rpproject} = ${requested} ]] && [[ "${rpdetails}" == *"${current_branch_starting_letter}"* ]]; then
+ return_from_getrpinfo="project partizipated"
+ #echo "DBUG: getrpinfo return = \"${return_from_getrpinfo}\"";
+ return 0;
+ fi
+
+ #echo "DBUG: getrpinfo requested \"${requested}\" NOT FOUND in list"
+ return_from_getrpinfo=""
+
+}
+