|
|
419917 |
From 0353d704879f20983184f8bded4f16538d72f7cc Mon Sep 17 00:00:00 2001
|
|
|
419917 |
From: Sumit Bose <sbose@redhat.com>
|
|
|
419917 |
Date: Wed, 10 Mar 2021 18:12:09 +0100
|
|
|
419917 |
Subject: [PATCH] build: add --with-vendor-error-message configure option
|
|
|
419917 |
|
|
|
419917 |
With the new configure option --with-vendor-error-message a packager or
|
|
|
419917 |
a distribution can add a message if adcli returns with an error.
|
|
|
419917 |
|
|
|
419917 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1889386
|
|
|
419917 |
---
|
|
|
419917 |
configure.ac | 15 +++++++++++++++
|
|
|
419917 |
tools/tools.c | 6 ++++++
|
|
|
419917 |
2 files changed, 21 insertions(+)
|
|
|
419917 |
|
|
|
419917 |
diff --git a/configure.ac b/configure.ac
|
|
|
419917 |
index baa0d3b..7dfba97 100644
|
|
|
419917 |
--- a/configure.ac
|
|
|
419917 |
+++ b/configure.ac
|
|
|
419917 |
@@ -123,6 +123,21 @@ if test "$sasl_invalid" = "yes"; then
|
|
|
419917 |
AC_MSG_ERROR([Couldn't find Cyrus SASL headers])
|
|
|
419917 |
fi
|
|
|
419917 |
|
|
|
419917 |
+# --------------------------------------------------------------------
|
|
|
419917 |
+# Vendor error message
|
|
|
419917 |
+
|
|
|
419917 |
+AC_ARG_WITH([vendor-error-message],
|
|
|
419917 |
+ [AS_HELP_STRING([--with-vendor-error-message=ARG],
|
|
|
419917 |
+ [Add a vendor specific error message shown if a adcli command fails]
|
|
|
419917 |
+ )],
|
|
|
419917 |
+ [AS_IF([test "x$withval" != "x"],
|
|
|
419917 |
+ [AC_DEFINE_UNQUOTED([VENDOR_MSG],
|
|
|
419917 |
+ ["$withval"],
|
|
|
419917 |
+ [Vendor specific error message])],
|
|
|
419917 |
+ [AC_MSG_ERROR([--with-vendor-error-message requires an argument])]
|
|
|
419917 |
+ )],
|
|
|
419917 |
+ [])
|
|
|
419917 |
+
|
|
|
419917 |
# --------------------------------------------------------------------
|
|
|
419917 |
# Documentation options
|
|
|
419917 |
|
|
|
419917 |
diff --git a/tools/tools.c b/tools/tools.c
|
|
|
419917 |
index d0dcf98..84bbba9 100644
|
|
|
419917 |
--- a/tools/tools.c
|
|
|
419917 |
+++ b/tools/tools.c
|
|
|
419917 |
@@ -538,6 +538,12 @@ main (int argc,
|
|
|
419917 |
|
|
|
419917 |
if (conn)
|
|
|
419917 |
adcli_conn_unref (conn);
|
|
|
419917 |
+#ifdef VENDOR_MSG
|
|
|
419917 |
+ if (ret != 0) {
|
|
|
419917 |
+ fprintf (stderr, VENDOR_MSG"\n");
|
|
|
419917 |
+ }
|
|
|
419917 |
+#endif
|
|
|
419917 |
+
|
|
|
419917 |
return ret;
|
|
|
419917 |
}
|
|
|
419917 |
|
|
|
419917 |
--
|
|
|
419917 |
2.30.2
|
|
|
419917 |
|