diff options
Diffstat (limited to 'local-certificates/PKGBUILD')
-rw-r--r-- | local-certificates/PKGBUILD | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/local-certificates/PKGBUILD b/local-certificates/PKGBUILD index 99d1fef2d..fec55f1eb 100644 --- a/local-certificates/PKGBUILD +++ b/local-certificates/PKGBUILD @@ -3,7 +3,7 @@ pkgname='local-certificates' arch=('any') pkgver=2024.03.07.05.12.53 -pkgrel=2 +pkgrel=3 pkgdesc='Certificate for local version of https://arch.eckner.net' license=('GPL') install='local-certificates.install' @@ -43,8 +43,17 @@ package() { install -d "${pkgdir}/usr/share/ca-certificates/trust-source/anchors" for s in *{,.old}.cert.pem *{,.old}.crt; do [ -f "$s" ] || continue - install \ - "${s}" \ - "${pkgdir}/usr/share/ca-certificates/trust-source/anchors/${s#????-??-??T??:??:??.}" + if [ $(date -d"$(openssl x509 -noout -enddate -in "$s" | cut -d= -f2)" +%s) -lt $(($(date +%s)-24*60*60*7)) ]; then + continue + fi + t="${pkgdir}/usr/share/ca-certificates/trust-source/anchors/${s#????-??-??T??:??:??.}" + if [ -f "${t}" ]; then + t="${t%.crt}.2.crt" + fi + while [ -f "${t}" ]; do + t="${t%.crt}" + t="${t%.*}.$((${t##*.}+1)).crt" + done + install "${s}" "${t}" done } |