[arch-commits] Commit in nextcloud-app-deck/trunk (PKGBUILD)
    David Runge 
    dvzrv at gemini.archlinux.org
       
    Sun May  8 20:06:09 UTC 2022
    
    
  
    Date: Sunday, May 8, 2022 @ 20:06:09
  Author: dvzrv
Revision: 1196296
upgpkg: nextcloud-app-deck 1:1.7.0-2: Rebuild to add more specific dependency on php-interpreter.
Implement a versioned dependency on php-interpreter.
Modified:
  nextcloud-app-deck/trunk/PKGBUILD
----------+
 PKGBUILD |   27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-05-08 19:59:47 UTC (rev 1196295)
+++ PKGBUILD	2022-05-08 20:06:09 UTC (rev 1196296)
@@ -4,7 +4,7 @@
 pkgname=nextcloud-app-deck
 _name=deck
 pkgver=1.7.0
-pkgrel=1
+pkgrel=2
 # upstream doesn't adhere to semver:
 # https://github.com/nextcloud/deck/issues/1197
 epoch=1
@@ -25,8 +25,21 @@
 }
 
 _get_php_versions() {
+  local _phps=(php7 php)
+
   _app_min_php="$(xq '.info.dependencies.php["@min-version"]' "$_name/appinfo/info.xml"| sed 's/"//g')"
   _app_max_php="$(xq '.info.dependencies.php["@max-version"]' "$_name/appinfo/info.xml"| sed 's/"//g')"
+  if [[ $_app_max_php != 'null' ]]; then
+    _app_max_php="$(echo $_app_max_php | awk -F '.' '{print $1"."$2+1}')"
+  fi
+  _system_php=""
+  for _php in "${_phps[@]}"; do
+    if command -v "$_php" > /dev/null; then
+      if [[ -z "$_system_php" ]]; then
+        _system_php="$_php"
+      fi
+    fi
+  done
 }
 
 check() {
@@ -43,12 +56,12 @@
 
   local _php_version="$(php --version |head -n1 |cut -d ' ' -f2 |sed 's/.[0-9]*$//g')"
   if [[ "$(vercmp "$_php_version" "$_app_min_php" )" -lt 0 ]]; then
-    printf "%s requires php >= %s, but %s is provided\n" $pkgname $_app_min_php $_php_version
+    printf "%s requires php-interpreter >= %s, but %s is provided\n" $pkgname $_app_min_php $_php_version
     exit 1
   fi
   if [[ $_app_max_php != 'null' ]]; then
-    if [[ "$(vercmp "$_php_version" "$_app_min_php" )" -lt 0 ]]; then
-      printf "%s requires php <= %s, but %s is provided\n" $pkgname $_app_min_php $_php_version
+    if [[ "$(vercmp "$_php_version" "$_app_max_php" )" -lt 0 ]]; then
+      printf "%s requires php-interpreter < %s, but %s is provided\n" $pkgname $_app_max_php $_php_version
       exit 1
     fi
   fi
@@ -64,16 +77,16 @@
   )
   if [[ "$_app_min_php" != 'null' ]]; then
     depends+=(
-      "php>=$_app_min_php"
+      "php-interpreter>=$_app_min_php"
     )
   fi
   if [[ "$_app_max_php" != 'null' ]]; then
     depends+=(
-      "php<=$_app_max_php"
+      "php-interpreter<$_app_max_php"
     )
   fi
   if [[ "$_app_min_php" == 'null' ]] && [[ "$_app_max_php" == 'null' ]]; then
-    depends+=(php)
+    depends+=(php-interpreter)
   fi
 
   install -vdm 755 "${pkgdir}/usr/share/webapps/nextcloud/apps/"
    
    
More information about the arch-commits
mailing list