forked from jvm-repo-rebuild/reproducible-central
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathport-to-results.sh
executable file
·68 lines (48 loc) · 1.57 KB
/
port-to-results.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
source "${SCRIPTDIR}/bin/includes/bashcolors.sh"
source "${SCRIPTDIR}/bin/includes/logging.sh"
content_dir="content"
project_count=0
max_projects=$1
echo "Max projects: $max_projects"
is_in_csv() {
local group_id=$1
local artifact_id=$2
local version=$3
grep -E "^${group_id}:${artifact_id}:${version}$" diffoscope-failures/could-not-even-start.txt
return $?
}
for buildspec in $(find $content_dir -name "*.buildspec")
do
# Source the buildspec file
source $buildspec
if [[ "${jdk}" == ??.0.* || -n "${RB_SHELL}" || ${command} == SHELL* ]]
then
continue
fi
# Todo: verify this manually later by running all releases here
if is_in_csv $groupId $artifactId $version
then
info "Skipping $buildspec as it is marked as 'could not even start'"
continue
fi
# Check if this is a Maven project
if [[ "$tool" != mvn* ]]
then
info "Skipping $buildspec as it's not a Maven project"
continue
fi
mkdir -p results/$groupId/$artifactId/$version
cp $buildspec results/$groupId/$artifactId/$version
info "Processed Maven project: $groupId:$artifactId:$version"
if [[ -n "$max_projects" ]]; then
if (( project_count >= max_projects )); then
info "Reached maximum number of Maven projects ($max_projects). Stopping."
break
fi
fi
# Increment project count
((project_count++))
done
echo "Total projects processed: $project_count"