| 1 | #!/bin/bash |
| 2 | set -e |
| 3 | workdir=$(mktemp -d) |
| 4 | cleanup() { |
| 5 | rm -rf "$workdir" |
| 6 | } |
| 7 | trap cleanup EXIT |
| 8 | 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 [ "$sz" -lt 8 ]; then |
| 14 | limit='in the far future' |
| 15 | if [ "$sz" -eq 4 ]; then |
| 16 | limit='after 2106-02-07 06:28:16Z' |
| 17 | fi |
| 18 | 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 [ "$(dpkg-architecture -qDEB_HOST_ARCH_BITS)" == 32 ] && |
| 26 | [ $(date +%s) -lt $(TZ=UTC date +%s --date='2031-02-07') ]; then |
| 27 | 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 |