aboutsummaryrefslogtreecommitdiff
blob: 3a45fc1a88cee7256e963c0bace191c2125cd174 (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
#!/bin/bash

. ../init.sh || exit 1

PORTDIR=$(DEBUG=: q -Ch 2>&1 | grep ^PORTDIR | awk '{print $NF}')
if [[ -d "${PORTDIR}"/metadata/md5-cache ]] &&
	"$s"/atom-explode.py < /dev/null >& /dev/null ;
then
	pushd "${PORTDIR}"/metadata/md5-cache >/dev/null || exit $?

	if [[ $1 == -v ]] ; then
		find . -mindepth 2 -type f -printf '%P\n%f\n' | while read line ; do
			echo "TESTING $line: "
			"$b"/e "${line}"
		done
		exit 0
	fi

	# split the disk i/o out so both tests are CPU bound only
	files=$(find . -mindepth 2 -type f ! -name "Manifest.*" -printf '%P\n%f\n')
	popd >/dev/null
else
	files=$(xzcat ebuildlist.xz)
fi

printf "atom_explode():"
time echo "${files}" | "$b"/e > "$b"/me || exit $?
echo

printf "portage:"
time echo "${files}" | "$s"/atom-explode.py > "$b"/py || xzcat portageatoms.xz > "$b"/py
echo

diff -U 0 "$b"/me "$b"/py
tend $? "portage-utils vs portage atom parsing"

end