fix: no stable news release for nc28
Some checks failed
/ nextcloud-27 (push) Failing after 3m10s
/ nextcloud-27-app-calendar (push) Successful in 1m22s
/ nextcloud-27-app-contacts (push) Successful in 1m28s
/ nextcloud-27-app-deck (push) Successful in 3m17s
/ nextcloud-27-app-forms (push) Successful in 2m25s
/ nextcloud-27-app-gpoddersync (push) Successful in 1m5s
/ nextcloud-27-app-gpxpod (push) Successful in 2m33s
/ nextcloud-27-app-groupfolders (push) Successful in 1m53s
/ nextcloud-27-app-polls (push) Successful in 3m15s
/ nextcloud-27-app-previewgenerator (push) Successful in 1m10s
/ nextcloud-27-app-mail (push) Failing after 1m6s
/ nextcloud-27-app-news (push) Failing after 53s
/ nextcloud-27-app-nextpod (push) Successful in 57s
/ nextcloud-27-app-notes (push) Failing after 52s
/ nextcloud-27-app-notify-push (push) Failing after 59s
/ nextcloud-27-app-richdocuments (push) Failing after 1m0s
/ nextcloud-27-app-richdocumentscode (push) Failing after 1m18s
/ nextcloud-27-app-talk (push) Failing after 1m14s
/ nextcloud-27-app-tasks (push) Failing after 58s
/ nextcloud-27-app-twofactor-webauthn (push) Successful in 1m39s
/ nextcloud-27-app-user-oidc (push) Successful in 1m44s
/ nextcloud-28 (push) Failing after 3m2s
/ nextcloud-28-app-calendar (push) Failing after 1m2s
/ nextcloud-28-app-contacts (push) Failing after 1m5s
/ nextcloud-28-app-deck (push) Failing after 1m0s
/ nextcloud-28-app-forms (push) Failing after 54s
/ nextcloud-28-app-gpoddersync (push) Successful in 1m15s
/ nextcloud-28-app-gpxpod (push) Failing after 1m7s
/ nextcloud-28-app-groupfolders (push) Failing after 1m3s
/ nextcloud-28-app-polls (push) Failing after 1m2s
/ nextcloud-28-app-previewgenerator (push) Failing after 58s
/ nextcloud-28-app-mail (push) Failing after 56s
/ nextcloud-28-app-news (push) Successful in 1m25s
/ nextcloud-28-app-nextpod (push) Successful in 1m31s
/ nextcloud-28-app-notes (push) Failing after 1m2s
/ nextcloud-28-app-notify-push (push) Failing after 52s
/ nextcloud-28-app-richdocuments (push) Failing after 1m7s
/ nextcloud-28-app-richdocumentscode (push) Failing after 1m14s
/ nextcloud-28-app-talk (push) Failing after 1m10s
/ nextcloud-28-app-tasks (push) Failing after 1m9s
/ nextcloud-28-app-twofactor-webauthn (push) Successful in 3m25s
/ nextcloud-28-app-user-oidc (push) Successful in 2m0s

This commit is contained in:
s3lph 2024-03-04 22:40:54 +01:00
parent 34fe708dae
commit 35130aac11
Signed by: s3lph
GPG key ID: 0AA29A52FB33CFB5

View file

@ -4,7 +4,61 @@
function pre_fetch() {
# Filter from .skel/build-nextcloud-app, but with restriction to stable versions removed
export _NCAPPS_JQ='.[] | select(.id == $app) | .releases[] | select(.version | contains("-") == false) | "\(.version) \(.download) \(.rawPlatformVersionSpec)"'
export _NCAPPS_JQ='.[] | select(.id == $app) | .releases[] | "\(.version) \(.download) \(.rawPlatformVersionSpec)"'
}
function _prepare() {
mkdir -p \
"${PKGDIR}/DEBIAN" \
"${PKGDIR}/usr/share/doc/${PKGNAME}" \
"${PKGDIR}/usr/lib/nextcloud/nextcloud-apps"
VERSION=$(cat "${SRCDIR}/${APP}/appinfo/info.xml" | xq-python -r .info.version | sed -re 's/-/~/g')
SUMMARY=$(cat "${SRCDIR}/${APP}/appinfo/info.xml" | xq-python -r '.info.summary | if type == "array" then (.[] | select(.["@lang"]=="en") | .["#text"]) else (.) end')
DESCRIPTION=$(cat "${SRCDIR}/${APP}/appinfo/info.xml" | xq-python -r '.info.description | if type == "array" then (.[] | select(.["@lang"]=="en") | .["#text"]) else (.) end')
PHP_MIN=$(cat "${SRCDIR}/${APP}/appinfo/info.xml" | xq-python -r '.info.dependencies.php."@min-version"')
PHP_MAX=$(cat "${SRCDIR}/${APP}/appinfo/info.xml" | xq-python -r '.info.dependencies.php."@max-version"')
PHP_DEP=""
# #f [[ "${PHP_MIN}" != "null" ]]; then
# PHP_DEP="${PHP_DEP}, php (>= ${PHP_MIN})"
# fi
# if [[ "${PHP_MAX}" != "null" ]]; then
# # awk increments the last version component, from https://stackoverflow.com/a/69489163
# PHP_MAX=$(echo "${PHP_MAX}" | awk -F. -v OFS=. '{$NF=$NF+1;print}')
# PHP_DEP="${PHP_DEP}, php (<< ${PHP_MAX})"
# fi
cp -r "${SRCDIR}/${APP}" "${PKGDIR}/usr/lib/nextcloud/nextcloud-apps/${APP}"
cat > "${PKGDIR}/DEBIAN/control" <<EOF
Package: ${PKGNAME}
Version: ${VERSION}
Maintainer: ${MAINTAINER}
Section: web
Priority: optional
Architecture: ${ARCH}
Depends: nextcloud-${NCMAJOR}${PHP_DEP}${ADDITIONAL_DEPS}
Provides: nextcloud-app-${APP//_/-}
Conflicts: nextcloud-app-${APP//_/-}
Description: ${SUMMARY}
$(echo ${DESCRIPTION} | fold --width=71 --spaces | sed -re 's/^([^ ])/ \1/g')
EOF
cat > "${PKGDIR}/DEBIAN/postinst" <<EOF
#!/bin/bash
set -exo pipefail
if [[ "\$1" == "configure" ]]; then
$(declare -f postinst_configure_pre | sed -e '1,2d' -e '$d')
# Only run migrations if nextcloud is installed and the app is enabled
if [[ -z "\$(grep installed /var/lib/nextcloud/webroot/config/config.php | grep false)" && \\
-n \$(sudo -u www-data php /var/lib/nextcloud/webroot/occ app:list | grep -B 10000 '^Disabled:' | grep -- "- ${APP}:") ]]; then
sudo -u www-data php /var/lib/nextcloud/webroot/occ upgrade
sudo -u www-data php /var/lib/nextcloud/webroot/occ maintenance:mode --off
fi
$(declare -f postinst_configure_post | sed -e '1,2d' -e '$d')
fi
EOF
}
post_prepare() {