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

echo "Updating main state git repo.."

git -C "${state_dir}" pull

echo "Checking statistics.."

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"

sleep 10

for pkgfile in `cat /tmp/update_packages.$$`; do
	repo=`echo "${pkgfile}" | rev | cut -f 2 -d / | rev`
	OLDIFS="$IFS"
	IFS=" "
	while read pkgname pkgver tag revision; do
		echo "${repo} ${pkgname}"
		if test ! -d "${packages_dir}/${repo}/${pkgname}"; then
			cd "${packages_dir}/${repo}" || exit 1
			pkgctl repo clone --protocol=https "${pkgname}"
			sleep 10
		else
			true
#			git -C "${packages_dir}/${repo}/${pkgname}" pull
		fi
	done < $pkgfile
	IFS="$OLDIFS"
done
# TODO: update all single package directories
# TODO: update all AUR package directories