summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoroweissbarth2020-07-09 09:25:45 +0200
committeroweissbarth2020-07-09 09:25:45 +0200
commited0109bab3295df86133a4e81b12d6f1d61fe50b (patch)
tree68898a416acf1b3a0631d88ac74dcbe94c711818
parent1004182e442728b35c719c3f487c980f93dda06b (diff)
downloadaur-ed0109bab3295df86133a4e81b12d6f1d61fe50b.tar.gz
made exit code much more explicit. checkupdates-aur does not change exit code if no updates exist -> checking output
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rwxr-xr-xcheckupdates+aur.bash21
3 files changed, 24 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e3320380e00b..10db90e8da98 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,12 @@
pkgbase = checkupdates+aur
pkgdesc = combines checkupdates and checkupdates-aur with separator as argument
pkgver = 1
- pkgrel = 2
+ pkgrel = 3
arch = any
license = LGPL3
depends = checkupdates-aur
source = checkupdates+aur.bash
- sha512sums = 84a9e643085c144945cb016017cc6e35609abc9a283f6636175ebb6eb61944e1c6fa31608181a4cd53d486cb99e4f8e6096372ba5c804db283d4fa1f295c7268
+ sha512sums = 5bc4733b1d49b4a6a3e439bd2176eab139f26540057e4bda82a7176713b728eeaa67bfe8dffcfc26ed73cf72b0eb6e52f38f44b3890df5bf9e0628a63bf1cac8
pkgname = checkupdates+aur
diff --git a/PKGBUILD b/PKGBUILD
index 1aea7d3566f5..d2bcbbd59552 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,13 +3,13 @@
pkgname=checkupdates+aur
pkgver=1
-pkgrel=2
+pkgrel=3
pkgdesc='combines checkupdates and checkupdates-aur with separator as argument'
arch=('any')
license=('LGPL3')
depends=('checkupdates-aur')
source=("checkupdates+aur.bash")
-sha512sums=('84a9e643085c144945cb016017cc6e35609abc9a283f6636175ebb6eb61944e1c6fa31608181a4cd53d486cb99e4f8e6096372ba5c804db283d4fa1f295c7268')
+sha512sums=('5bc4733b1d49b4a6a3e439bd2176eab139f26540057e4bda82a7176713b728eeaa67bfe8dffcfc26ed73cf72b0eb6e52f38f44b3890df5bf9e0628a63bf1cac8')
package() {
install -D -m755 "$srcdir/checkupdates+aur.bash" "$pkgdir/usr/bin/checkupdates+aur"
diff --git a/checkupdates+aur.bash b/checkupdates+aur.bash
index ee006c8f3ec9..51a1ffd42e50 100755
--- a/checkupdates+aur.bash
+++ b/checkupdates+aur.bash
@@ -1,4 +1,23 @@
#!/usr/bin/bash
/usr/bin/checkupdates
+pac_updates=$?
+
printf "$1"
-/usr/bin/checkupdates-aur
+
+aur_output=$(checkupdates-aur)
+printf "$aur_output"
+
+if [[ $aur_output ]]; then
+ aur_updates=0
+else
+ aur_updates=2
+fi
+
+if [ $pac_updates -eq 2 ] && [ $aur_updates -eq 2 ]; then
+ exit 2
+elif [ $pac_updates -eq 0 ] || [ $aur_updates -eq 0 ]; then
+ exit 0
+else
+ exit 1
+fi
+