blob: c0a808a34513592d3a01e5dd24bfdd2e0fe1adbd (
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
|
#!/bin/bash
source /etc/make.conf
outputdir=${1:-$(mktemp -d)}
if [[ ! (-d $outputdir && -w $outputdir) ]]
then
echo "$outputdir is not writable"
fi
echo "Generating metadata at $outputdir"
time ./instruo -p portage -n gentoo -o $outputdir 2>$outputdir/error_output
echo "Running diff..."
declare -i error_count=0 total_num=0
for category_dir in ${PORTDIR:-/usr/portage}/*
do
category=${category_dir##*\/}
cache_dir=${PORTDIR:-/usr/portage}/metadata/cache/${category}
if [[ -d $cache_dir ]]
then
for path in $cache_dir/*
do
filename=${path##*\/}
diff -u $cache_dir/$file $outputdir/$category/$filename > $outputdir/$category/$filename.diff 2>>$outputdir/error_output
error_count+=$(($? != 0))
total_num+=1
done
fi
done
echo "$((total_num - error_count)) out of $total_num metadata files are correct. See file.diff for more details."
|