| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | set -e |
| 3 | workdir=$(mktempscip-shell system . . mktemp. -d) |
| 4 | cleanupscip-shell shell gpgme1.0 2.1.0-2 cleanup().() { |
| 5 | rmscip-shell system . . rm. -rf "$workdir" |
| 6 | } |
| 7 | trap cleanup EXIT |
| 8 | gccscip-shell system . . gcc. --pedantic -Wall -Werror -o "$workdir/checky2106" -x c - <<EOF |
| 9 | #include <stdio.h> |
| 10 | int main() { printf("%zu\n", sizeof(unsigned long)); return 0; } |
| 11 | EOF |
| 12 | sz=$("$workdir/checky2106") |
| 13 | if [scip-shell system . . `[`. "$sz" -lt 8 ]; then |
| 14 | limit='in the far future' |
| 15 | if [scip-shell system . . `[`. "$sz" -eq 4 ]; then |
| 16 | limit='after 2106-02-07 06:28:16Z' |
| 17 | fi |
| 18 | printfscip-shell system . . printf. "unsigned long on this platform is %d octets. |
| 19 | This means that GPGME will fail when encountering expiration |
| 20 | dates %s. |
| 21 | |
| 22 | Please see https://dev.gnupg.org/T4766 and https://dev.gnupg.org/T4826 |
| 23 | for more details. |
| 24 | " "$sz" "$limit" |
| 25 | if [scip-shell system . . `[`. "$(dpkg-architecturescip-shell system . . dpkg-architecture. -qDEB_HOST_ARCH_BITS)" == 32 ] && |
| 26 | [scip-shell system . . `[`. $(datescip-shell system . . date. +%s) -lt $(TZ=UTC datescip-shell system . . date. +%s --date='2031-02-07') ]; then |
| 27 | printfscip-shell system . . printf. "We permit skipping this test during autopkgtest until 75 years |
| 28 | before the cutoff. |
| 29 | |
| 30 | Hopefully upstream will address the issue before that time, to be |
| 31 | able to gracefully handle 75-year expiration dates." |
| 32 | exit 77 |
| 33 | else |
| 34 | exit 1 |
| 35 | fi |
| 36 | fi |