Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/check
blob: f711bc67c859fa70f62c1f7835838172aa07d5a9 (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
#!/bin/oksh

BASE="${0%/*}/.."
. "${BASE}/conf/default.conf"

if test ! -d "${state_dir}"; then
	echo "no upstream git state repo of packages.. exiting.."
	exit 1
fi

if test ! -d "${packages_dir}"; then
	echo "no directory for uptream package descriptions.. exiting.."
	exit 1
fi

find "${state_dir}"/{core,extra}-{any,x86_64} -type f > /tmp/update_packages.$$
nof_packages=`cat /tmp/update_packages.$$ | wc -l`

nof_checked_out_packages=`find "${packages_dir}" -type f -name PKGBUILD | wc -l`

echo "${nof_packages} packages in state repo"
echo "${nof_checked_out_packages} packages are checked out"

> "${data_dir}/stats"
echo "packages_state\t${nof_packages}" >> "${data_dir}/stats"
echo "packages_repos\t${nof_checked_out_packages}" >> "${data_dir}/stats"

# find duplicate entries in state repo
> "${data_dir}/duplicates"
for duplicate in `find "${state_dir}"/{core,extra}-{any,x86_64} -type f | \
	rev | cut -f 1 -d / | rev | sort | uniq -D | uniq`; do
	for packages in `ls ${state_dir}/{core,extra}-{any,x86_64}/$duplicate 2>/dev/null`; do
		for instance in `echo $packages | rev | cut -f 1,2 -d / | rev`; do
			echo -n "${instance} " >> "${data_dir}/duplicates"
			cat "${state_dir}/$instance" >> "${data_dir}/duplicates"
		done
	done
done

# TODO: update all single package directories
# TODO: update all AUR package directories