ipmitool: add option to disable registry download
authorOliver Sedlbauer <[email protected]>
Thu, 3 Apr 2025 15:28:46 +0000 (17:28 +0200)
committerRobert Marko <[email protected]>
Wed, 9 Apr 2025 20:49:44 +0000 (22:49 +0200)
Upstream backport

Signed-off-by: Oliver Sedlbauer <[email protected]>
admin/ipmitool/patches/0002-configure.ac-allow-disabling-registry-downloads.patch [new file with mode: 0644]

diff --git a/admin/ipmitool/patches/0002-configure.ac-allow-disabling-registry-downloads.patch b/admin/ipmitool/patches/0002-configure.ac-allow-disabling-registry-downloads.patch
new file mode 100644 (file)
index 0000000..e933f54
--- /dev/null
@@ -0,0 +1,67 @@
+From be11d948f89b10be094e28d8a0a5e8fb532c7b60 Mon Sep 17 00:00:00 2001
+From: Vincent Fazio <[email protected]>
+Date: Wed, 11 Jan 2023 22:55:51 -0600
+Subject: [PATCH] configure.ac: allow disabling registry downloads
+
+Some environments require reproducible builds. Since the IANA PEN
+registry is constantly updating and there is no snapshot available,
+installing ipmitool via `make install` is not reproducible.
+
+Provide a configure mechanism to disable the registry download/install..
+---
+ configure.ac | 30 ++++++++++++++++++++----------
+ 1 file changed, 20 insertions(+), 10 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -18,8 +18,6 @@ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
+ AC_CHECK_PROG([RPMBUILD], [rpmbuild], [rpmbuild], [rpm])
+ AC_CHECK_PROG([SED], [sed], [sed])
+-AC_CHECK_PROG([WGET], [wget], [wget])
+-AC_CHECK_PROG([CURL], [curl], [curl])
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h sys/stat.h unistd.h paths.h])
+@@ -56,21 +54,33 @@ if test "x$exec_prefix" = "xNONE"; then
+       exec_prefix="$prefix"
+ fi
+-if test "x$WGET" = "x"; then
+-      if test "x$CURL" = "x"; then
++dnl allow enabling/disabling the fetching of the IANA PEN registry
++AC_ARG_ENABLE([registry-download],
++      [AC_HELP_STRING([--enable-registry-download],
++                      [download/install the IANA PEN registry [default=yes]])],
++      [xenable_registry_download=$enableval],
++      [xenable_registry_download=yes])
++
++AM_CONDITIONAL([DOWNLOAD], [false])
++
++if test "x$xenable_registry_download" = "xyes"; then
++      AC_CHECK_PROG([WGET], [wget], [wget])
++      AC_CHECK_PROG([CURL], [curl], [curl])
++
++      if test "x$WGET" = "x" && test "x$CURL" = "x"; then
+               AC_MSG_WARN([** Neither wget nor curl could be found.])
+               AC_MSG_WARN([** IANA PEN database will not be installed by `make install` !])
+       else
+-              DOWNLOAD="$CURL --location --progress-bar"
+               AM_CONDITIONAL([DOWNLOAD], [true])
++              if test "x$WGET" != "x"; then
++                      DOWNLOAD="$WGET -c -nd -O -"
++              else
++                      DOWNLOAD="$CURL --location --progress-bar"
++              fi
+       fi
+-else
+-      DOWNLOAD="$WGET -c -nd -O -"
+-      AM_CONDITIONAL([DOWNLOAD], [true])
+ fi
+-AC_MSG_WARN([** Download is:])
+-AC_MSG_WARN($DOWNLOAD)
++AC_MSG_WARN([** Download is: $DOWNLOAD])
+ AC_SUBST(DOWNLOAD, $DOWNLOAD)
+ dnl