@@ -44,6 +44,37 @@ function get_pr_relval_args() {
44
44
echo " ${WF_ARGS} "
45
45
}
46
46
47
+ # Function to extract filenames by headername and append to changed-files.txt atomically
48
+ function extract_filenames() {
49
+ local headername=" $1 "
50
+ local input_file=" ./etc/dependencies/usedby.out"
51
+ local temp_file=$( mktemp) # Create a temporary file for atomic update
52
+
53
+ # Extract lines starting with headername, split them, and append each filename to the temp file
54
+ grep " ^$headername " " $input_file " | while read -r line; do
55
+ # Split the line into an array
56
+ IFS=' ' read -r -a array <<< " $line"
57
+
58
+ # Loop through each element after the first (which is the headername)
59
+ for filename in " ${array[@]: 1} " ; do
60
+ echo " $filename " >> " $temp_file "
61
+ done
62
+ done
63
+
64
+ # Remove duplicates in temp file and append to changed-files.txt atomically
65
+ sort -u " $temp_file " >> changed-files.txt
66
+ rm " $temp_file " # Clean up temp file
67
+ }
68
+
69
+ # Function to process each line in $WORKSPACE/changed-files
70
+ function process_changed_files() {
71
+ # Iterate over each line in $WORKSPACE/changed-files
72
+ while IFS= read -r headername; do
73
+ # Call the function to extract filenames and append them atomically
74
+ extract_filenames " $headername "
75
+ done < " $WORKSPACE /changed_files"
76
+ }
77
+
47
78
# Constants
48
79
echo LD_LIBRARY_PATH=${LD_LIBRARY_PATH} || true
49
80
ls ${LD_LIBRARY_PATH} || true
@@ -824,8 +855,6 @@ if ! $CMSDIST_ONLY ; then # If a CMSSW specific PR was specified #
824
855
exit 0
825
856
fi
826
857
827
- git diff --name-only $CMSSW_VERSION > $WORKSPACE /changed-files
828
-
829
858
# look for any other error in general
830
859
if ! grep " ALL_OK" $GIT_MERGE_RESULT_FILE ; then
831
860
echo " There was an issue with git-cms-merge-topic you can see the log here: ${PR_RESULT_URL} /git-merge-result" > ${RESULTS_DIR} /10-report.res
@@ -1141,6 +1170,14 @@ GENERAL_ERRORS=`grep "ALL_OK" $WORKSPACE/build.log` || true
1141
1170
1142
1171
rm -f $WORKSPACE /deprecated-warnings.log
1143
1172
get_compilation_warnings $WORKSPACE /build.log > $WORKSPACE /all-warnings.log
1173
+
1174
+ git diff --name-only $CMSSW_VERSION > $WORKSPACE /changed-files
1175
+ pushd ..
1176
+ SCRAM_TOOL_HOME=` scram b echo_SCRAM_TOOL_HOME 2> /dev/null | tail -1 | cut -d' ' -f3`
1177
+ SCRAM_TOOL_HOME=$SCRAM_TOOL_HOME ./config/SCRAM/findDependencies.py -rel ` pwd` -arch ${SCRAM_ARCH}
1178
+ process_changed_files
1179
+ popd
1180
+
1144
1181
for i in $( get_warnings_files $WORKSPACE /all-warnings.log) ; do
1145
1182
echo $i > $WORKSPACE /warning.log
1146
1183
grep " : warning: " $WORKSPACE /all-warnings.log | grep " /$i " >> $WORKSPACE /warning.log
0 commit comments