summaryrefslogtreecommitdiffstats
path: root/rebuild-scripts/buildcheck
blob: be2bba455d1ed54506266092a3016bfe1b145a1a (plain)
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
#!/bin/bash

# if this one is rebuild again it will confuse the script:
PACKAGESUPTO=recode
byebye()
{
	[[ -e "${TMPDIR}" ]] && rm -f "${TMPDIR}/owners.list" "${TMPDIR}/repoquery" "${TMPDIR}/repoquery-noarch" "${TMPDIR}/result"
	[[ -e "${TMPDIR}" ]] && rmdir "${TMPDIR}"
	local return=${1}
	shift
	[[ "${1}" ]] && echo $@
	exit ${return}
}



if ! TMPDIR="$(mktemp -d)"
then
	byebye 1 Could not create TMPDIR
fi
echo "TMPDIR is $TMPDIR"

if ! wget --quiet -O ${TMPDIR}/owners.list http://cvs.fedora.redhat.com/viewcvs/*checkout*/owners/owners.list?root=extras
then
	byebye 2 Failed to get owners.list	
fi

if ! repoquery -a --repoid=buildcheck-extras-development-sources --repoid=buildcheck-extras-development-buildsys  --qf='%{buildtime} %{name} %{version}-%{release}' *.src | sort | grep -B 9999 ${PACKAGESUPTO} | head -n -1  > ${TMPDIR}/repoquery
then
	byebye 3 Repoquery failed
fi

if ! repoquery -a --repoid=buildcheck-extras-development-x86 --repoid=buildcheck-extras-development-x64 --repoid=buildcheck-extras-development-ppc --repoid=buildcheck-extras-development-buildsys  --qf='%{buildtime} %{name} %{arch} %{version}-%{release}' | sort | grep ' noarch ' | awk '{print $2}' > ${TMPDIR}/repoquery-noarch
then
	byebye 3 Repoquery failed
fi



while read buildtime name verrel
do
	if ownerstring="$(grep \|${name}\| ${TMPDIR}/owners.list)"
	then
		echo "${ownerstring}" | while IFS='|' read ignoredone ignoredtwo ignoredthree emailone emailtwo emailthree emailfour alsoignored 
		do
			echo ${emailone} ${name} ${verrel} | sed 's|@|_AT_|' >> ${TMPDIR}/result
		done
	else
		echo No owner found for "${name}" >&2
	fi
done < ${TMPDIR}/repoquery

sort < ${TMPDIR}/result | uniq | column -t > extras-tobuild
sort < ${TMPDIR}/result | uniq | column -t | grep -f ${TMPDIR}/repoquery-noarch > extras-tobuild-noarch
sort < ${TMPDIR}/result | uniq | column -t | grep -v -f ${TMPDIR}/repoquery-noarch > extras-tobuild-arch


byebye 0