-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjppstat-fedora
executable file
·49 lines (39 loc) · 1.47 KB
/
jppstat-fedora
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
#!/bin/sh
PREFIX=/var/ftp/pub/Linux/fedora/linux/development/rawhide/Everything/
PREFIX=/var/ftp/pub/Linux/fedora/linux/releases/29/Everything/
NAME=java-fc-packages
DEST=`pwd`
[ -n "$1" ] && PREFIX="$1" && shift;
[ -n "$1" ] && NAME="$1" && shift;
JAVA_PATTERN='/usr/(share/java|share/netbeans|share/eclipse|lib/eclipse|lib64/eclipse)'
[ -d $PREFIX/source/tree/Packages ] && SOURCE_RPM_PATH="$PREFIX/source/tree/Packages"
[ -z "$SOURCE_RPM_PATH" ] && exit 2;
get_arch_rpmdir()
{
ARCH_RPMDIR=
[ -d "$PREFIX/files/$ARCH/RPMS" ] && ARCH_RPMDIR="$PREFIX/files/$ARCH/RPMS/" && return
[ -d "$PREFIX/$ARCH/os/Packages" ] && ARCH_RPMDIR="$PREFIX/$ARCH/os/Packages/" && return
}
list_java_src_rpm_names()
{
local ARCH
ARCH=$1
for i in `find . -name '*.'$ARCH'.rpm'`; do
if rpmquery -l -p $i | egrep "$JAVA_PATTERN" >/dev/null; then
SRCRPMNAME=`rpmquery --queryformat '%{SOURCERPM}\n' -p $i`;
SRCNAME=`rpmquery --queryformat '%{NAME}\n' -p $SOURCE_RPM_PATH/?/$SRCRPMNAME`;
if [ -z "$ACL" ] || grep '^'$SRCNAME "$ACL" | egrep "$ACLPATTERN" >/dev/null; then
echo $SRCNAME
fi;
fi;
done | sort -u > $DEST/$NAME.$ARCH.src
}
ARCH=x86_64
get_arch_rpmdir
pushd $ARCH_RPMDIR
list_java_src_rpm_names $ARCH
list_java_src_rpm_names noarch
popd
grep -v -E '^(jaffl|gcc|libdb|subversion|fedora-ds-)' $DEST/$NAME.$ARCH.src | sort -u > $DEST/$NAME.$ARCH.src.0
mv $DEST/$NAME.$ARCH.src.0 $DEST/$NAME.$ARCH.src
sort -u $DEST/$NAME.$ARCH.src $DEST/$NAME.noarch.src > $NAME.src