This repository has been archived by the owner on Sep 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
global_reports.sh
executable file
·102 lines (73 loc) · 4.03 KB
/
global_reports.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/sh
source ./config.sh
modules=$(ls "$topdir/modules" | sed -e "s/^bootstrap$//g")
mkdir -p "$topdir/global_reports"
echo ""
echo "Producing 'all-binary-pkgs' list..."
for module in $modules; do
cat "$topdir/modules/$module/all/runtime-binary-packages-short.txt"
done | sort | uniq | sort > "$topdir/global_reports/all-binary-pkgs.txt"
echo ""
echo "Producing 'all-binary-pkgs-counted' list..."
for module in $modules; do
cat "$topdir/modules/$module/all/runtime-binary-packages-short.txt"
done | sort | uniq -c | sort \
> "$topdir/global_reports/all-binary-pkgs-counted.txt"
echo ""
echo "Producing 'all-binary-pkgs-occurrences' list..."
while read pkg_row; do
pkg=$(echo $pkg_row | sed -e "s/.* //")
printf "$pkg_row\t"
for module in $modules; do
cat "$topdir/modules/$module/all/runtime-binary-packages-short.txt" \
| grep "^$pkg$" > /dev/null
if [ $? -eq 0 ]; then
printf "$module, "
fi
done | sed 's/, $//'
printf "\n"
done < "$topdir/global_reports/all-binary-pkgs.txt" | column -ts $'\t' \
> "$topdir/global_reports/all-binary-pkgs-occurrences.txt"
echo ""
echo "Producing 'missing-build-deps-binary-pkgs' list..."
for module in $modules; do
cat "$topdir/modules/$module/all/buildtime-binary-packages-short.txt"
done | sort | uniq | sort \
> "$topdir/global_reports/missing-build-deps-binary-pkgs.txt"
echo ""
echo "Producing 'missing-build-deps-binary-pkgs-counted' list..."
for module in $modules; do
cat "$topdir/modules/$module/all/buildtime-binary-packages-short.txt"
done | sort | uniq -c | sort \
> "$topdir/global_reports/missing-build-deps-binary-pkgs-counted.txt"
echo ""
echo "Producing 'missing-build-deps-binary-pkgs-unmodularized' list..."
comm -13 \
"$topdir/global_reports/all-binary-pkgs.txt" \
"$topdir/global_reports/missing-build-deps-binary-pkgs.txt" \
> "$topdir/global_reports/missing-build-deps-binary-pkgs-unmodularized.txt"
echo ""
echo "Generating README in the global_reports directory..."
{
cat << EOF
# Dependency reports
This directory contains global reports - a view on all modules at once.
For more details **individual modules** and **architecture-specific** information, please click on individual module names in thee table below.
## Files
### Runtime dependencies
* [**all-binary-pkgs.txt**](all-binary-pkgs.txt) - All binary packages included in all modules.
* [**all-binary-pkgs-counted.txt**](all-binary-pkgs-counted.txt) - All binary packages included in all modules, with a number saying in how many modules the package is.
* [**all-binary-pkgs-occurrences.txt**](all-binary-pkgs-occurrences.txt) - All binary packages included in all modules, with a list of modules they are included in.
### Build dependencies
* [**missing-build-deps-binary-pkgs.txt**](missing-build-deps-binary-pkgs.txt) - Missing build dependencies of all modules. Some of these packages might be already modularized, the build dependency just need to be defined.
* [**missing-build-deps-binary-pkgs-counted.txt**](missing-build-deps-binary-pkgs-counted.txt) - Missing build dependencies of all modules. Some of these packages might be already modularized, the build dependency just need to be defined. With a number representing how many modules are missing such dependency.
* [**missing-build-deps-binary-pkgs-unmodularized.txt**](missing-build-deps-binary-pkgs-unmodularized.txt) - Missing build dependencies of all modules. None of these packages are included in modules, so they need to get modularized.
## There are $(ls "$topdir/modules" | wc -l) modules:
![module-deps](../img/module-deps.png)
| Module | RPM components | RPMs missing in buildroot |
|---|---|---|
EOF
for module in $modules; do
echo "| [**$module**](../modules/$module) | **$(cat "$topdir/modules/$module/all/runtime-binary-packages-short.txt" | wc -l)** pkgs | [**$(cat "$topdir/modules/$module/all/buildtime-binary-packages-short.txt" | wc -l)** pkgs missing](../modules/$module/all/buildtime-binary-packages-short.txt) |"
done
} > "$topdir/global_reports/README.md"