GNU bug report logs -
#37556
gpg "-unknown" version string
Previous Next
Reported by: Juanma Barranquero <lekktu <at> gmail.com>
Date: Sun, 29 Sep 2019 23:01:01 UTC
Severity: normal
Tags: fixed, patch
Found in version 27.0.50
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37556 in the body.
You can then email your comments to 37556 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
larsi <at> gnus.org, bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Sun, 29 Sep 2019 23:01:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juanma Barranquero <lekktu <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
larsi <at> gnus.org, bug-gnu-emacs <at> gnu.org
.
(Sun, 29 Sep 2019 23:01:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Package: emacs
Version: 27.0.50
X-Debbugs-Cc: larsi <at> gnus.org
This is related to bug# 35629.
This commit
commit 42ba6200af10c00c72ac13912d6fb42a7af88058
Author: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: 2019-08-26 08:02:31 +0200
Allow finding gpg2 binaries when gpg2 has an "unknown" version string
* lisp/epg-config.el (epg-find-configuration): Allow finding a
usable configuration even if the version string looks like "gpg
(GnuPG) 2.2.15-unknown" (bug#35629).
fixes one function, but there are other uses of version-related functions
in epg, for example
(defun epg-required-version-p (protocol required-version)
"Verify a sufficient version of GnuPG for specific protocol.
PROTOCOL is symbol, either `OpenPGP' or `CMS'. REQUIRED-VERSION
is a string containing the required version number. Return
non-nil if that version or higher is installed."
(let ((version (cdr (assq 'version (epg-find-configuration protocol)))))
(and (stringp version)
(version<= required-version version))))
which calls epg-find-configuration (which is protected by the above
change), and then version<= (which fails).
This makes epg-tests.el fail on my gpg, from MSYS2:
$ gpg --version
gpg (GnuPG) 2.2.17-unknown
libgcrypt 1.8.4
Fixing this with another let binding around `version<=' is trivial, but it
is a kludge.
I think it makes more sense just adding "-unknown" to the formats
recognized by default with version-regexp-alist.
(Note: after working around this bug, epg tests still fail for me, but for
unrelated reasons.)
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Mon, 30 Sep 2019 05:35:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 37556 <at> debbugs.gnu.org (full text, mbox):
Juanma Barranquero <lekktu <at> gmail.com> writes:
> I think it makes more sense just adding "-unknown" to the formats
> recognized by default with version-regexp-alist.
Hm... I guess that would make sense, but might there be other
ramifications? All callers to version-to-list may get other data back
than they are used to?
I don't know much about how that function is used in general, though.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Mon, 30 Sep 2019 07:18:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 37556 <at> debbugs.gnu.org (full text, mbox):
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Mon, 30 Sep 2019 07:34:45 +0200
> Cc: 37556 <at> debbugs.gnu.org
>
> Juanma Barranquero <lekktu <at> gmail.com> writes:
>
> > I think it makes more sense just adding "-unknown" to the formats
> > recognized by default with version-regexp-alist.
>
> Hm... I guess that would make sense, but might there be other
> ramifications? All callers to version-to-list may get other data back
> than they are used to?
"-unknown" is unusual in version strings, IME. If this is somehow
related to gpg, maybe we should chop that before we invoke the
version-comparison functions, in gpg-related Lisp files only?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Mon, 30 Sep 2019 07:50:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 37556 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Mon, Sep 30, 2019 at 9:17 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> "-unknown" is unusual in version strings, IME.
Yes, but, why would that be a problem? It's not like we're going to find a
lot of strings 1.2.3-unknown that aren't really version numbers, are we?
> If this is somehow
> related to gpg, maybe we should chop that before we invoke the
> version-comparison functions, in gpg-related Lisp files only?
Chopping would mean that 2.2.17 and 2.2.17-unknown are equal, but currently
2.2.17-unknown (in epg) is less than 2.2.17.
Certainly the problem can be fixed by wrapping more code with (let
((version-regexp-alist (cons ...)) ...). It's just that it seems a bit
kludgy to me. But whatever, not really a big issue.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Mon, 30 Sep 2019 08:47:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 37556 <at> debbugs.gnu.org (full text, mbox):
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Mon, 30 Sep 2019 09:49:06 +0200
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 37556 <at> debbugs.gnu.org
>
> Chopping would mean that 2.2.17 and 2.2.17-unknown are equal, but currently 2.2.17-unknown (in epg) is less
> than 2.2.17.
You are saying that -unknown is in this case the same as -alpha. My
problem is how to be sure this is the case everywhere where -unknown
could be used.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Mon, 30 Sep 2019 09:34:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 37556 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Mon, Sep 30, 2019 at 10:46 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> You are saying that -unknown is in this case the same as -alpha.
In fact, Lars gave it priority -4, so like a snapshot.
> My problem is how to be sure this is the case everywhere where -unknown
> could be used.
True, but if -unknown is really uncommon, we can deal with the problems as
they are reported (if ever).
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Mon, 30 Sep 2019 14:05:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 37556 <at> debbugs.gnu.org (full text, mbox):
Juanma Barranquero <lekktu <at> gmail.com> writes:
> On Mon, Sep 30, 2019 at 10:46 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>> You are saying that -unknown is in this case the same as -alpha.
>
> In fact, Lars gave it priority -4, so like a snapshot.
>
>> My problem is how to be sure this is the case everywhere where -unknown
>> could be used.
>
> True, but if -unknown is really uncommon, we can deal with the problems as
> they are reported (if ever).
Looking at the code, just keeping this in epg* is really awkward,
because we compare the version strings afterwards (in other contexts)
with version<=, which will then fail.
So I think this patch is needed to fix the epg problem. But I'm not
confident that it won't change behaviour for other users of these
version functions.
On the other hand, we have been adding to this alist over the years
without anything blowing up (that I know of), so perhaps it is safe-ish?
If it turns out to be a problem, it's easy enough to back out (but then
I don't really know how to fix the original epg problem in a sensible
manner).
diff --git a/lisp/subr.el b/lisp/subr.el
index 45b99a82d2..efe530cd54 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -5285,6 +5285,8 @@ version-regexp-alist
("^[-._+]$" . -4)
;; treat "1.2.3-CVS" as snapshot release
("^[-._+ ]?\\(cvs\\|git\\|bzr\\|svn\\|hg\\|darcs\\)$" . -4)
+ ;; treat "-unknown" the same as snapshots.
+ ("^[-._+ ]?unknown$" . -4)
("^[-._+ ]?alpha$" . -3)
("^[-._+ ]?beta$" . -2)
("^[-._+ ]?\\(pre\\|rc\\)$" . -1))
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) patch.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Mon, 30 Sep 2019 14:05:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Mon, 30 Sep 2019 14:26:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 37556 <at> debbugs.gnu.org (full text, mbox):
Juanma Barranquero <lekktu <at> gmail.com> writes:
>> If this is somehow related to gpg, maybe we should chop that before
>> we invoke the version-comparison functions, in gpg-related Lisp files
>> only?
>
> Chopping would mean that 2.2.17 and 2.2.17-unknown are equal, but currently
> 2.2.17-unknown (in epg) is less than 2.2.17.
I don't understand why making -unknown equivalent to a lesser version
makes sense. Shouldn't 2.2.17 and 2.2.17-unknown in fact be equal?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Mon, 30 Sep 2019 14:43:01 GMT)
Full text and
rfc822 format available.
Message #31 received at 37556 <at> debbugs.gnu.org (full text, mbox):
Noam Postavsky <npostavs <at> gmail.com> writes:
> Juanma Barranquero <lekktu <at> gmail.com> writes:
>
>>> If this is somehow related to gpg, maybe we should chop that before
>>> we invoke the version-comparison functions, in gpg-related Lisp files
>>> only?
>>
>> Chopping would mean that 2.2.17 and 2.2.17-unknown are equal, but currently
>> 2.2.17-unknown (in epg) is less than 2.2.17.
>
> I don't understand why making -unknown equivalent to a lesser version
> makes sense. Shouldn't 2.2.17 and 2.2.17-unknown in fact be equal?
Should they? 2.2.17-pre and 2.2.17-alpha should be less than 2.2.17,
but how do we know that -unknown isn't something -alpha-ish?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Mon, 30 Sep 2019 14:47:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 37556 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>> I don't understand why making -unknown equivalent to a lesser version
>> makes sense. Shouldn't 2.2.17 and 2.2.17-unknown in fact be equal?
>
> Should they? 2.2.17-pre and 2.2.17-alpha should be less than 2.2.17,
> but how do we know that -unknown isn't something -alpha-ish?
It's "unknown", so it could be something opposite-of-alpha-ish too,
right? On average, 0 seems right.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Tue, 01 Oct 2019 12:10:01 GMT)
Full text and
rfc822 format available.
Message #37 received at 37556 <at> debbugs.gnu.org (full text, mbox):
Noam Postavsky <npostavs <at> gmail.com> writes:
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>>> I don't understand why making -unknown equivalent to a lesser version
>>> makes sense. Shouldn't 2.2.17 and 2.2.17-unknown in fact be equal?
>>
>> Should they? 2.2.17-pre and 2.2.17-alpha should be less than 2.2.17,
>> but how do we know that -unknown isn't something -alpha-ish?
>
> It's "unknown", so it could be something opposite-of-alpha-ish too,
> right? On average, 0 seems right.
That's possible. Does anybody know how usual these -unknown things are,
and why they exist?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Tue, 01 Oct 2019 15:00:02 GMT)
Full text and
rfc822 format available.
Message #40 received at 37556 <at> debbugs.gnu.org (full text, mbox):
> >>> I don't understand why making -unknown equivalent to a lesser version
> >>> makes sense. Shouldn't 2.2.17 and 2.2.17-unknown in fact be equal?
> >>
> >> Should they? 2.2.17-pre and 2.2.17-alpha should be less than 2.2.17,
> >> but how do we know that -unknown isn't something -alpha-ish?
> >
> > It's "unknown", so it could be something opposite-of-alpha-ish too,
> > right? On average, 0 seems right.
>
> That's possible. Does anybody know how usual these -unknown things are,
> and why they exist?
I don't know "why", but I described when the suffix was added in the
past post.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35629#11
> GnuPG's autogen.sh makes "-unknown" suffix version configure script if
> source code directory doesn't have .git directory.
If you have the repository, autogen.sh can set an apropriate revision
number. I guess "-unknown" version means "unknown version" literally,
because they couldn't decide the source code revision without
repository.
--
Kazuhiro Ito
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Sun, 13 Oct 2019 03:02:01 GMT)
Full text and
rfc822 format available.
Message #43 received at 37556 <at> debbugs.gnu.org (full text, mbox):
Juanma Barranquero <lekktu <at> gmail.com> writes:
> This commit
>
> commit 42ba6200af10c00c72ac13912d6fb42a7af88058
> Author: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: 2019-08-26 08:02:31 +0200
>
> Allow finding gpg2 binaries when gpg2 has an "unknown" version string
>
> * lisp/epg-config.el (epg-find-configuration): Allow finding a
> usable configuration even if the version string looks like "gpg
> (GnuPG) 2.2.15-unknown" (bug#35629).
>
> fixes one function, but there are other uses of version-related
> functions in epg, for example
I've now reverted this patch, and pushed the more general
version-regexp-alist patch. I rated -unknown as -alpha -- there was
some discussion about whether that's best, but no conclusion was
reached, really. It can be tweaked later if that's problematic.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 13 Oct 2019 03:02:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 27.1, send any further explanations to
37556 <at> debbugs.gnu.org and Juanma Barranquero <lekktu <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 13 Oct 2019 03:02:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37556
; Package
emacs
.
(Sun, 13 Oct 2019 05:14:01 GMT)
Full text and
rfc822 format available.
Message #50 received at 37556-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sun, Oct 13, 2019 at 5:01 AM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> I've now reverted this patch, and pushed the more general
> version-regexp-alist patch. I rated -unknown as -alpha -- there was
> some discussion about whether that's best, but no conclusion was
> reached, really. It can be tweaked later if that's problematic.
Thanks. Closing this bug.
[Message part 2 (text/html, inline)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 10 Nov 2019 12:24:13 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 279 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.