-
Notifications
You must be signed in to change notification settings - Fork 2
/
vercheck
64 lines (56 loc) · 1.39 KB
/
vercheck
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
59
60
61
62
63
64
#!/usr/bin/env bash
repo="$1"
pacbsd_path="$2"
archlinux_path="$3"
die() {
echo "$@"
exit 1
}
if [ -z "${repo}" ] || [ -z "${pacbsd_path}" ] || [ -z "${archlinux_path}" ] ; then
echo "usage: $0 repository PacBSD_tree ArchLinux_tree"
exit
fi
if [ ! -d "${pacbsd_path}/${repo}" ]; then
die "No such repo ${repo} in PacBSD tree"
fi
if [ ! -e /usr/bin/abs ]; then
die "abs tool is not installed. Run 'pacman -s abs'"
else
su root -c abs "${repo}"
fi
for i in "${pacbsd_path}/${repo}/"*; do
unset absdpkgver
unset linuxpkgver
if [ -d "${i}" ]; then
source "${i}/PKGBUILD"
pacbsdpkgver="${pkgver}"
unset pkgver
if [ -d "${archlinux_path}/${repo}/${i##*/}" ]; then
source "${archlinux_path}/${repo}/${i##*/}/PKGBUILD"
linuxpkgver="${pkgver}"
unset pkgver
else
## check in other repo incase they're different
for i in core extra community; do
#skip the repo in $repo
if [ "${i}" == "${repo}" ]; then
continue
else
if [ -d "${archlinux_path}/${i}/${i##*/}" ]; then
source "${archlinux_path}/${i}/${i##*/}/PKGBUILD"
linuxpkgver="${pkgver}"
unset pkgver
# break, no point in continuing the loop
break
fi
fi
done
continue
fi
check=$(vercmp "${pacbsdpkgver}" "${linuxpkgver}")
if [ "${check}" -lt "0" ]; then
echo "${i} needs updating: PacBSD: ${pacbsdpkgver} ArchLinux: ${linuxpkgver}"
fi
unset check
fi
done