91 lines
2.6 KiB
Diff
91 lines
2.6 KiB
Diff
From fe898b9211fd0a6d273c438c21755e39b9b221b3 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?=
|
|
<jan.christian@gruenhage.xyz>
|
|
Date: Wed, 15 Jun 2022 13:05:40 +0200
|
|
Subject: [PATCH 1/2] disables version check
|
|
|
|
Void ships GnuPG in a new enough version anyway, so this check is not
|
|
necessary. The reason to disable the check is that it's broken rn:
|
|
|
|
```
|
|
error determining fileno for STDIN: Illegal seek at (eval 270) line 55.
|
|
Use of uninitialized value $line in pattern match (m//) at /usr/share/perl5/vendor_perl/GnuPG/Interface.pm line 827.
|
|
Use of uninitialized value $a in split at /usr/share/perl5/vendor_perl/GnuPG/Interface.pm line 841.
|
|
Use of uninitialized value $a in split at /usr/share/perl5/vendor_perl/GnuPG/Interface.pm line 841.
|
|
GnuPG Version 1.4 or 2.2+ required at (eval 270) line 55.
|
|
```
|
|
---
|
|
lib/GnuPG/Interface.pm | 18 ++----------------
|
|
t/version_updates.t | 30 ------------------------------
|
|
2 files changed, 2 insertions(+), 46 deletions(-)
|
|
delete mode 100644 t/version_updates.t
|
|
|
|
diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
|
|
index 905ae30..7fd2321 100644
|
|
--- a/lib/GnuPG/Interface.pm
|
|
+++ b/lib/GnuPG/Interface.pm
|
|
@@ -818,22 +818,8 @@ sub search_keys( $% ) {
|
|
}
|
|
|
|
sub _version {
|
|
- my ( $self ) = @_;
|
|
-
|
|
- my $out = IO::Handle->new;
|
|
- my $handles = GnuPG::Handles->new( stdout => $out );
|
|
- my $pid = $self->wrap_call( commands => [ '--no-options', '--version' ], handles => $handles );
|
|
- my $line = $out->getline;
|
|
- $line =~ /(\d+\.\d+\.\d+)/;
|
|
-
|
|
- my $version = $1;
|
|
- unless ($self->cmp_version($version, '2.2') >= 0 or
|
|
- ($self->cmp_version($version, '1.4') >= 0 and $self->cmp_version($version, '1.5') < 0 )) {
|
|
- croak "GnuPG Version 1.4 or 2.2+ required";
|
|
- }
|
|
- waitpid $pid, 0;
|
|
-
|
|
- return $version;
|
|
+ # version detection is broken, hardcoding that we're on 2.2+
|
|
+ return '2.3.7';
|
|
}
|
|
|
|
sub cmp_version($$) {
|
|
diff --git a/t/version_updates.t b/t/version_updates.t
|
|
deleted file mode 100644
|
|
index 758ee7b..0000000
|
|
--- a/t/version_updates.t
|
|
+++ /dev/null
|
|
@@ -1,30 +0,0 @@
|
|
-#!/usr/bin/perl -w
|
|
-
|
|
-use strict;
|
|
-
|
|
-use lib './t';
|
|
-use MyTest;
|
|
-use MyTestSpecific;
|
|
-
|
|
-TEST
|
|
-{
|
|
- my $gpg = GnuPG::Interface->new(call => './test/fake-gpg-v1');
|
|
- return ($gpg->version() eq '1.4.23');
|
|
-};
|
|
-
|
|
-
|
|
-TEST
|
|
-{
|
|
- my $gpg = GnuPG::Interface->new(call => './test/fake-gpg-v2');
|
|
- return ($gpg->version() eq '2.2.12');
|
|
-};
|
|
-
|
|
-TEST
|
|
-{
|
|
- my $gpg = GnuPG::Interface->new(call => './test/fake-gpg-v1');
|
|
- my $v1 = $gpg->version();
|
|
- $gpg->call('./test/fake-gpg-v2');
|
|
- my $v2 = $gpg->version();
|
|
-
|
|
- return ($v1 eq '1.4.23' && $v2 eq '2.2.12');
|
|
-}
|
|
--
|
|
2.36.1
|
|
|