-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjppstat
executable file
·72 lines (62 loc) · 2.07 KB
/
jppstat
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
#!/bin/sh
PREFIX=/var/ftp/pub/Linux/ALT/Sisyphus
NAME=java-alt-packages
ACL=
ACLPATTERN='(viy|@java)'
DEST=`pwd`
[ -n "$1" ] && PREFIX="$1" && shift;
[ -n "$1" ] && NAME="$1" && shift;
[ -n "$1" ] && ACL="$1" && shift;
[ -z "$ACL" ] || [ -e "$ACL" ] || exit 4;
# todo:
# add `pwd` to ACL if relative
JAVA_PATTERN='/usr/(share/java|share/netbeans|share/eclipse|lib/eclipse|lib64/eclipse)'
[ -d $PREFIX/files/SRPMS ] && SOURCE_RPM_PATH="$PREFIX/files/SRPMS"
[ -d $PREFIX/source/SRPMS ] && SOURCE_RPM_PATH="$PREFIX/source/SRPMS"
[ -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()
{
for i in *.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=noarch
get_arch_rpmdir
if [ -n "$ARCH_RPMDIR" ]; then
pushd $ARCH_RPMDIR
list_java_src_rpm_names
popd
if [ "$NAME" = "java-alt-packages" ]; then
# jpackage-utils
for i in jpackage-generic-compat rpm-build-java java-common java-stub-javadoc java-devel-default; do
echo $i >> $DEST/$NAME.noarch.src
done
fi
else
touch $DEST/$NAME.noarch.src
fi
ARCH=i586
get_arch_rpmdir
[ -z "$ARCH_RPMDIR" ] && ARCH=x86_64
get_arch_rpmdir
pushd $ARCH_RPMDIR
list_java_src_rpm_names
popd
grep -v -E '^(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
if [ -f $PREFIX/files/list/list.src.classic ]; then
for i in `cat ./$NAME.src`; do grep "^$i" $PREFIX/files/list/list.src.classic ; done | sort -u > $DEST/$NAME.owners
fi