diff --git a/backport-make-lib-version-work.patch b/backport-make-lib-version-work.patch new file mode 100644 index 0000000000000000000000000000000000000000..70b6b2f0faa4270a0c4728db0fb5559504af66ce --- /dev/null +++ b/backport-make-lib-version-work.patch @@ -0,0 +1,94 @@ +From e0dab4843ded8af172c2566b4d7313a1a13e7e26 Mon Sep 17 00:00:00 2001 +From: Werner Koch +Date: Wed, 5 Aug 2020 12:19:56 +0200 +Subject: [PATCH] Make --lib-version work again. + +* src/gpg-error.c (main): Add printing code. +-- + +This was lost while changing to the included option parser back in +2018. The new code also does some prettying of the output. + +Fixes-commit: 11ce9bc3d6fe75859e18112824ae7ec3ca0fc8df +Signed-off-by: Werner Koch + +Conflict:NA +Reference:https://github.com/gpg/libgpg-error/commit/e0dab4843ded8af172c2566b4d7313a1a13e7e26 +--- + src/gpg-error.c | 39 ++++++++++++++++++++++++++++++++++++--- + 1 file changed, 36 insertions(+), 3 deletions(-) + +diff --git a/src/gpg-error.c b/src/gpg-error.c +index cc92c10..4e8bd8b 100644 +--- a/src/gpg-error.c ++++ b/src/gpg-error.c +@@ -571,9 +571,11 @@ main (int argc, char *argv[]) + gpgrt_argparse_t pargs = { &argc, &argv }; + + int i; ++ int libversion = 0; + int listmode = 0; + int localemode = 0; + int desc = 0; ++ const char *s, *s2; + const char *source_sym; + const char *error_sym; + gpg_error_t err; +@@ -588,7 +590,7 @@ main (int argc, char *argv[]) + { + switch (pargs.r_opt) + { +- case CMD_LIB_VERSION: break; ++ case CMD_LIB_VERSION: libversion = 1; break; + case CMD_LIST: listmode = 1; break; + case CMD_DEFINES: listmode = 2; break; + case CMD_LOCALE: localemode = 1; break; +@@ -598,7 +600,12 @@ main (int argc, char *argv[]) + } + gpgrt_argparse (NULL, &pargs, NULL); /* Free internal memory. */ + +- if (localemode) ++ if (libversion) ++ { ++ if (argc) ++ gpgrt_usage (1); ++ } ++ else if (localemode) + { + if (argc > 1) + gpgrt_usage (1); +@@ -606,7 +613,33 @@ main (int argc, char *argv[]) + else if ((argc && listmode) || (!argc && !listmode)) + gpgrt_usage (1); + +- if (localemode) ++ ++ if (libversion) ++ { ++ argc--; argv++; ++ printf ("Version from header: %s (0x%06x)\n", ++ GPG_ERROR_VERSION, GPG_ERROR_VERSION_NUMBER); ++ printf ("Version from binary: %s\n", gpg_error_check_version (NULL)); ++ s = gpg_error_check_version ("\x01\x01"); ++ while (*s && *s == '\n') ++ s++; ++ fputs ("Copyright blurb ...: ", stdout); ++ for (; *s; s++) ++ { ++ if (*s == '\n') ++ { ++ for (s2=s+1; *s2 == '\n'; s2++) ++ ; ++ if (!*s2) ++ break; /* Cut off trailing LFs. */ ++ fputs ("\n ", stdout); ++ } ++ else ++ putc (*s, stdout); ++ } ++ putc ('\n', stdout); ++ } ++ else if (localemode) + { + #if HAVE_W32_SYSTEM + if (argc) diff --git a/libgpg-error.spec b/libgpg-error.spec index eda264a602c6e5f72543900fd7af17b7d427623a..22e4c470069cce3375427b62ddf6e0748562a6c5 100644 --- a/libgpg-error.spec +++ b/libgpg-error.spec @@ -1,6 +1,6 @@ Name: libgpg-error Version: 1.38 -Release: 2 +Release: 3 Summary: Library for common error values and messages in GnuPG components. License: LGPLv2+ URL: https://www.gnupg.org/ftp/gcrypt/libgpg-error @@ -10,6 +10,7 @@ Source1: https://www.gnupg.org/ftp/gcrypt/libgpg-error/%{name}-%{version}.tar.gz Patch6000: libgpg-error-1.29-multilib.patch Patch6001: bugfix-corss-build-into-a-seperate-build-dir.patch Patch6002: bugfix-corss-build-detec-hosts-objdump.patch +Patch6003: backport-make-lib-version-work.patch BuildRequires: gcc gawk, gettext, autoconf, automake, gettext-devel, libtool, texinfo, gettext-autopoint hostname @@ -75,6 +76,12 @@ make check %{_mandir}/* %changelog +* Fri Jan 05 2024 yanglu - 1.38-3 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:make the lib-version option work + * Thu Sep 30 2021 zhanzhimin - 1.38-2 - Type:bugfix - Id:NA