Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jan 2021 02:29:39 +0000 (UTC)
From:      "Jason E. Hale" <jhale@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r559796 - in head/security: gpgme-cpp gpgme/files
Message-ID:  <202101010229.1012Tdr2005247@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhale
Date: Fri Jan  1 02:29:39 2021
New Revision: 559796
URL: https://svnweb.freebsd.org/changeset/ports/559796

Log:
  security/gpgme-cpp: Fix constness
  
  The 1.15.0 release of gpgme-cpp adds a `Signature::operator<` which is missing
  a const. In 6a6d2a27648, Signature got an operator< . This is used in
  *security/libkleo*, for instance, to sort the signatures for display.
  
  The build failure looks like this (trimmed for brevity, on 13-):
  
  ===
  /usr/include/c++/v1/algorithm:715:71: error: invalid operands to binary
  expression ('const GpgME::UserID::Signature' and 'const
  GpgME::UserID::Signature')
      bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
  
  /wrkdirs/usr/ports/security/libkleo/work/libkleo-20.12.0/src/models/
  useridlistmodel.cpp:203:14: note: in instantiation of function template
  specialization 'std::__1::sort<GpgME::UserID::Signature>' requested here
          std::sort(sigs.begin(), sigs.end());
  ===
  
  PR:		252283
  Submitted by:	adridg

Added:
  head/security/gpgme/files/patch-git-key.h   (contents, props changed)
Modified:
  head/security/gpgme-cpp/Makefile

Modified: head/security/gpgme-cpp/Makefile
==============================================================================
--- head/security/gpgme-cpp/Makefile	Fri Jan  1 02:20:54 2021	(r559795)
+++ head/security/gpgme-cpp/Makefile	Fri Jan  1 02:29:39 2021	(r559796)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-PORTREVISION=	0
+PORTREVISION=	1
 PKGNAMESUFFIX=	-${SLAVEPORT}
 
 MAINTAINER=	jhale@FreeBSD.org

Added: head/security/gpgme/files/patch-git-key.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/gpgme/files/patch-git-key.h	Fri Jan  1 02:29:39 2021	(r559796)
@@ -0,0 +1,29 @@
+The operator< should be const, so it can be applied to const Signatures.
+This fixes a build failure in security/libkleo.
+
+diff --git lang/cpp/src/key.cpp lang/cpp/src/key.cpp
+index e536d080..7411e9e4 100644
+--- lang/cpp/src/key.cpp
++++ lang/cpp/src/key.cpp
+@@ -865,7 +865,7 @@ UserID::Signature::Signature(const shared_gpgme_key_t &k, gpgme_user_id_t u, gpg
+ {
+ }
+ 
+-bool UserID::Signature::operator<(const Signature &other)
++bool UserID::Signature::operator<(const Signature &other) const
+ {
+     // based on cmp_signodes() in g10/keylist.c
+ 
+diff --git lang/cpp/src/key.h lang/cpp/src/key.h
+index a7931672..57001a03 100644
+--- lang/cpp/src/key.h
++++ lang/cpp/src/key.h
+@@ -468,7 +468,7 @@ public:
+     }
+ 
+     /*! Defines a canonical sort order for signatures of the same user ID. */
+-    bool operator<(const Signature &other);
++    bool operator<(const Signature &other) const;
+ 
+     bool isNull() const
+     {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101010229.1012Tdr2005247>