From 37434cd3591e2ad28e6468dd42fbdc9f01f50303 Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Mon, 30 Nov 2020 11:57:28 +0000
Subject: [PATCH] fixed dependency adding
---
main.sh | 50 +++++++++++++++++++++++++++++++++++++-------------
1 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/main.sh b/main.sh
index dd7c9be..76e3f63 100755
--- a/main.sh
+++ b/main.sh
@@ -51,9 +51,6 @@
return 2
fi
- #remove old versions before build
-# rm -f *$1*.tar.*
-
#make and force rebuild if is git package
# Mictosoft fonts have problems with checksums and need a seperate argument
if [[ "$1" == "ttf-ms-win10" ||
@@ -70,12 +67,19 @@
return 1
fi
- #Get build artifact names from PKGBUILD and build artifacts
- #Remove duplicates from the list
+ #Remove old packages from build directory
source PKGBUILD
srcdir="$(pwd)/src"
- ver=$(pkgver)
+ if grep -q 'pkgver() {' PKGBUILD; then
+ ver=$(pkgver)
+ else
+ ver=$pkgver
+ fi
find . -mindepth 1 -maxdepth 1 -type f \( -name "*.pkg.tar.*" -o -name "*.src.tar.*" \) -not -name "*$ver-$pkgrel*" -delete
+
+ #Get build artifact names from PKGBUILD and build artifacts
+ #Remove duplicates from the list
+ pkgs=()
ipkgs=()
for i in ${pkgname[@]}; do
#pkgs+=("$i-$pkgver-$pkgrel")
@@ -197,6 +201,9 @@
#Adding build dependencies is
# Usage: add [package name]
function add {
+ echo @: $@
+# read
+ local i j k
for i in $@; do
cd $BUILDDIR
if [[ -z $(git ls-remote https://aur.archlinux.org/$i.git) ]]; then
@@ -205,21 +212,38 @@
fi
git clone https://aur.archlinux.org/$i.git
cd $i
+ unset depends
+ unset makedepends
+ local makedeps
+ source PKGBUILD
#check for all build dependencies
- for i in ${makedepends[@]}; do
- if pacman -Si $i; then
- makedepends=${makedepends[@]/$delete}
+ for j in ${makedepends[@]}; do
+ k=$(echo $j | sed 's/[>]=.*//g')
+ if ! pacman -Si $k; then
+ makedeps+=($k)
fi &>/dev/null
done
- for i in ${makedepends[@]}; do
- add $i
+ for j in ${depends[@]}; do
+ k=$(echo $j | sed 's/[>]=.*//g')
+ if ! pacman -Si $k; then
+ makedeps+=($k)
+ fi &>/dev/null
done
- if [[ -n "${makedepends[@]}" ]]; then
+ echo $i: ${makedeps[@]}
+# read
+ for j in ${makedeps[@]}; do
+ add $j
+# read
+ done
+ echo $i: ${makedeps[@]}
+# read
+ if [[ -n "${makedeps[@]}" ]]; then
sudo pacman -Sy
fi
-
+#read
#Actually build wanted package
+ cd $BUILDDIR/$i
build_pkg $i -f
done
return 0
--
Gitblit v1.10.0