summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-04-13 13:17:30 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-04-13 13:17:30 -0300
commit99dad96bcc60136d6b99f797405e7cbdd5991d09 (patch)
treef8a20bfee5a1e8e7589b581f8462c3406746483a
parent7b9a203f5c44e907bcfb0faac0743932cc8aa40c (diff)
FullPkg fixes, ban list, etc.
-rwxr-xr-xfullpkg41
1 files changed, 36 insertions, 5 deletions
diff --git a/fullpkg b/fullpkg
index 794b191..ac5b005 100755
--- a/fullpkg
+++ b/fullpkg
@@ -11,7 +11,9 @@
tmp_dir=$(mktemp -d /tmp/$(basename $PWD).XXXXXX)
queue_file=$(mktemp /tmp/queue.XXXXXX)
+ban_file=$(mktemp)
[[ ! -w $queue_file ]] && exit 1
+[[ ! -w $ban_file ]] && exit 1
source /etc/makepkg.conf
source /etc/abs.conf
@@ -77,6 +79,18 @@ check_queue() {
return 0
}
+# Checks if the package is banned from building
+is_banned() {
+ rsync -e ssh -aq $PARABOLAHOST:mips64el/ban $ban_file >/dev/null 2>&1 || {
+ echo ":: Failed to get ban list"
+ return 0
+ }
+
+ grep -w $1 $ban_file >/dev/null 2>&1
+
+ return $?
+}
+
# TODO keep track of spawned fullpkgs
quit() {
@@ -86,10 +100,21 @@ quit() {
}
source PKGBUILD
-msg "Building ${pkgbase} ${pkgname[@]}"
+msg ":: Building ${pkgbase:-${pkgname[@]}}"
+
+# is_built doesn't support version checking
+#is_built ${pkgbase:-${pkgname[0]}}=${pkgver} && exit 0
+is_built ${pkgbase:-${pkgname[0]}} && exit 0
+
+#sudo pacman -Sy
trap "quit" SIGTERM SIGKILL
+if is_banned ${pkgbase:-$pkgname}; then
+ echo "This package is banned from building. Check the ban list"
+ exit 1
+fi
+
check_queue || exit 1
failed=()
@@ -113,15 +138,21 @@ deps=$(echo "${depends[@]} ${makedepends[@]} ${pkgdeps[@]}" | \
msg "Checking dependencies"
plain "${deps[@]}"
-msg "Syncing database"
-sudo pacman -Sy
+#msg "Syncing database"
+#sudo pacman -Sy
for _dep in ${deps[@]}; do
is_built $_dep && continue
+ is_banned $_dep && continue
for _repo in ${REPOS[@]}; do
# TODO find split packages
[[ -e "$ABSROOT/${_repo}/$_dep/PKGBUILD" ]] && {
+# source "$ABSROOT/${_repo}/$_dep/PKGBUILD"
+
+# If this version is built, continue with the next dep
+# is_built $_dep=$pkgver && continue 2
+
cp -r "$ABSROOT/$_repo/$_dep" $tmp_dir/ || {
error "Can't copy $_dep to the work dir."
exit 1
@@ -173,12 +204,12 @@ pushd $tmp_dir/$(basename $PWD) >/dev/null
msg "Syncing database"
sudo pacman -Sy
-
-makepkg --noconfirm -sLcr ; r=$?
+makepkg --noconfirm -sLcr $@ ; r=$?
case $r in
0)
msg "The build was succesful."
mipsrelease *.pkg.tar.*
+ sudo pacman -Sy
;;
1)
error "There were errors while trying to build the package."