-
Notifications
You must be signed in to change notification settings - Fork 2
/
recursiveGlue.sh
211 lines (202 loc) · 5.19 KB
/
recursiveGlue.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#!/bin/bash
## resolve folder of this script, following all symlinks,
## http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
SCRIPT_SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SCRIPT_SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
SCRIPT_DIR="$( cd -P "$( dirname "$SCRIPT_SOURCE" )" && pwd )"
SCRIPT_SOURCE="$(readlink "$SCRIPT_SOURCE")"
# if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
[[ $SCRIPT_SOURCE != /* ]] && SCRIPT_SOURCE="$SCRIPT_DIR/$SCRIPT_SOURCE"
done
readonly SCRIPT_DIR="$( cd -P "$( dirname "$SCRIPT_SOURCE" )" && pwd )"
# this will remove content of f1 from f2
function remove1from2() {
local f1=${1}
local f2=${2}
grep -v -x -f ${f1} ${f2}
}
function filter2by1() {
local f1=${1}
local f2=${2}
cp ${f2} ${f2}.backup
remove1from2 ${f1} ${f2}.backup > ${f2}
rm ${f2}.backup
}
if [ "x$SCANNED" = "xtrue" ] ; then
echo "skipping all repoquery, processing existing tierX and allWhatever files:"
else
# summ up all. that wil be used fore i686 leaves and for final statistics
# note, that this do not honor the complex repos work as listJavaDependentPkg.sh does. But that do nto hurt at all...
dnf list all | sed "s/\s.*//g" > all.nvras
cat all.nvras | grep -v "\.noarch" > all-archfull.nvras
cat all.nvras | grep -e "\.noarch" > all-noarch.nvras
cat all.nvras | grep -e "\.i686" > all-multilib.nvras
# find transitive depndencies
# will skip check on dead packages and subpackages in nvfrsToNames.sh
export SKIP_CHECK=true;
export CHART=$PWD/edges;
export SKIP_NOARCH_BR=$PWD/br_noarchs; # note that this works only in chart mode
# if you will be running this script for general java bump, you will need SKIP_NOARCH_BR to be empty. But You will also not need 10 tiers, but just two or three.
# Generally, simply run listJavaDependentPkgs with default (adapted to bump) values, and do not use this recursive. But this oen can help if it really goes wild.
rm -rf $CHART
mkdir $CHART
rm $SKIP_NOARCH_BR
# initial load, all what depends on java, mvn and friends in
# build or runtime. result is all.jbump
# cat $SCRIPT_DIR/listJavaDependentPkgs.sh | grep interestingDeps=\" | sed "s/.*interestingDeps=\"//" | sed "s/\".*//" | sed "s/\s\+/\n/g" > tier0.names
echo "java
java-17
java-17-openjdk
java-openjdk
jre
jre-17
jre-17-openjdk
jre-openjdk
java-17-demo
java-17-openjdk-demo
java-demo
java-openjdk-demo
java-17-devel
java-17-openjdk-devel
java-devel
java-devel-openjdk
java-sdk
java-sdk-17
java-sdk-17-openjdk
java-sdk-openjdk
java-17-headless
java-17-openjdk-headless
java-headless
java-openjdk-headless
jre-17-headless
jre-17-openjdk-headless
jre-headless
jre-openjdk-headless
libjava.so
libjsig.so
libjvm.so
libjvm.so
libsyslookup.so
libverify.so
java-17-javadoc
java-17-openjdk-javadoc
java-javadoc
java-17-openjdk-javadoc-zip
java-17-jmods
java-17-openjdk-jmods
java-jmods
java-17-openjdk-src
java-17-src
java-openjdk-src
java-src
java-11
java-11-openjdk
jre-11
jre-11-openjdk
java-11-demo
java-11-openjdk-demo
java-11-devel
java-11-openjdk-devel
java-sdk-11
java-sdk-11-openjdk
java-11-headless
java-11-openjdk-headless
jre-11-headless
jre-11-openjdk-headless
java-11-javadoc
java-11-openjdk-javadoc
java-11-openjdk-javadoc-zip
java-11-jmods
java-11-openjdk-jmods
java-11-openjdk-src
java-11-src
java-1.8.0
java-1.8.0-openjdk
jre-1.8.0
jre-1.8.0-openjdk
java-1.8.0-demo
java-1.8.0-openjdk-demo
java-1.8.0-devel
java-1.8.0-openjdk-devel
java-sdk-1.8.0
java-sdk-1.8.0-openjdk
java-1.8.0-headless
java-1.8.0-openjdk-headless
jre-1.8.0-headless
jre-1.8.0-openjdk-headless
java-1.8.0-javadoc
java-1.8.0-openjdk-javadoc
java-1.8.0-openjdk-javadoc-zip
java-1.8.0-jmods
java-1.8.0-openjdk-jmods
java-1.8.0-openjdk-src
java-1.8.0-src" > tier0.names
echo "autoconf
automake
bash
cairo
cargo
cmake
coreutils
desktop-file-utils
findutils
gcc
gcc-c++
gdk-pixbuf2
gettext
ghc-base
ghc-base-devel
ghc-compiler
glib2
glib2-devel
glibc
gmp
go-rpm-macros
gtk3
hicolor-icon-theme
libappstream-glib
libstdc++
libtool
libX11
make
openssl-devel
openssl-libs
pango
perl-Carp
perl-constant
perl-Exporter
perl-generators
perl-interpreter
perl-libs
perl-PathTools
perl-Scalar-List-Utils
php-common
pkgconf-pkg-config
python3
python3-devel
python3-pytest
python3-setuptools
qt5-qtbase
qt5-qtbase-gui
rust-packaging
rust-web-sys-devel
systemd
texlive-base
texlive-kpathsea
zlib
zlib-devel" > blacklist
# it may happen, that (eg by incorrect spec file) that also transitive depndence is included as top level depndence
# eg something requires ant and java. However and already requires java, so suddenly we will have java deps listed in all tier, which we do not want
for x in `seq 1 11` ; do
base=$(($x-1))
export CHART_TIER=$x
sh $SCRIPT_DIR/listJavaDependentPkgs.sh tier$base.names
cp all.jbump tier$x.names
cp tier$x.names tier$x-all.names # jsut for case...
# now remove all already walked through guys. On tier 1 it do nearly nothing (but eg removal of ant and java put next walk to less then half).As conseqence, on two and up it removes huge numbers
for y in `seq 0 $base` ; do
filter2by1 tier$y.names tier$x.names
done
filter2by1 blacklist tier$x.names
done
fi