community/adman: make adman compatible with heimdal format timestamps

This commit is contained in:
Noel Kuntze 2024-06-10 04:59:55 +02:00 committed by Patrycja Rosa
parent 84ea15b7e2
commit 7c6ac238fd
2 changed files with 19 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Noel Kuntze <noel.kuntze@thermi.consulting>
pkgname=adman
pkgver=0.9.0
pkgrel=3
pkgrel=4
pkgdesc="A tool for performing automated Active Directory management"
url="https://gitlab.com/JonathonReinhart/adman"
arch="noarch"
@ -17,7 +17,9 @@ depends="
makedepends="py3-setuptools"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="adman-$pkgver.tar.gz::https://gitlab.com/JonathonReinhart/adman/-/archive/v$pkgver/adman-v$pkgver.tar.gz"
source="adman-$pkgver.tar.gz::https://gitlab.com/JonathonReinhart/adman/-/archive/v$pkgver/adman-v$pkgver.tar.gz
heimdal-timestamps.patch
"
builddir="$srcdir/$pkgname-v$pkgver"
options="!check" # fail with py3.11 (or other depends?)
@ -35,4 +37,5 @@ package() {
sha512sums="
52d741a27c1e6c5666fa9cb0136ac29ef9e5a3b042b611bc3a9b7ddf8d12c368d32761c52179020a69a1b0e5b30bff3101c01cc853629d70c5948e7d21967caf adman-0.9.0.tar.gz
cf536f493d5754abfa0445fbd0207eb64eb60df6f8c128a5450101cf338f716272ef6f79f224fb62812f1652ab1b2ae2cfad782f443f77c21eafb990c44a1607 heimdal-timestamps.patch
"

View File

@ -0,0 +1,14 @@
# Fix heimdal timestamp reading
--- a/adman/kerberos.py
+++ b/adman/kerberos.py
@@ -157,7 +157,9 @@ def parse_klist_output(output):
if line.startswith('\t'):
return handle_ticket
- parts = line.split(' ')
+ # The Heimdal timestamps look like 'Jun 8 14:00:01 2022' with a double blank on position 4
+ # To circumvent this issue we use re.match instead of split
+ parts = re.match(r'(.+)\s\s([^\d].+)\s\s([^\d].+)',line).groups()
issued = parse_time(parts[0])