SHA256
1
0
forked from pool/ipmitool
ipmitool/0006-Make-IANA-PEN-download-configurable-fix-uninitalized.patch
Klaus Kämpf 42f6b48b25 - clean up patches
rename fwum_enhance_output.patch
   to 0001-Enhance-fwum-output.patch
  rename fix_file_permissions.patch
   to 0002-Fix-file-permissions.patch
  rename several_more_compile_fixes.patch
   to 0003-Cleanup-and-compiler-issues-only-no-functional-chang.patch
  rename ipmitool_adjust_suse_paths.patch
   to 0004-Adjust-SUSE-paths.patch
  rename hpm_x_compatibility_msg_is_debug_only.patch
   to 0005-HPM-x-compatibility-message-is-DEBUG-only.patch
  rename autotools_define_DOWNLOAD.diff
   to 0006-Make-IANA-PEN-download-configurable-fix-uninitalized.patch

- Update to version 1.8.18+git20200916.1245aaa387dc:
  * fru: Fix crashes on 6-bit ASCII strings
  * Refix 6e037d6bfbbb93b349c8ca331ebde03a837f76bf
  * oem: Add product ID for YADRO VEGMAN
  * configure.ac: add '--location' for curl to follow location
  * configure.ac: replace '-#' by '--progress-bar' with curl
  * log: refix 16f937a1: Add missing header changes
  * Add version info to debug output
  * doc, ci: Fix an error in package name for Windows
  * doc: Fix a small typo in INSTALL
  * RPM support: updated spec file changelog

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ipmitool?expand=0&rev=53
2020-09-23 07:51:43 +00:00

131 lines
4.5 KiB
Diff

From 44faed961d148ded6e6a75b73a25d85bcbdd843c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
Date: Wed, 23 Sep 2020 09:44:29 +0200
Subject: [PATCH 6/6] Make IANA PEN download configurable - fix uninitalized
DOWNLOAD variable
Currently if you do not have wget and curl requirement met, you get
this error:
[ 93s] configure: WARNING: ** Neither wget nor curl could be found.
[ 93s] configure: WARNING: ** IANA PEN database will not be installed by `make install` !
[ 93s] configure: WARNING: ** Download is:
[ 93s] configure: WARNING:
...
[ 104s] configure: error: conditional "DOWNLOAD" was never defined.
[ 104s] Usually this means the macro was only invoked conditionally.
[ 104s] error: Bad exit status from /var/tmp/rpm-tmp.TYnvu5 (%build)
Internet download is restricted in most build environments.
So there must be a knob to enable/disable IANA PEN database download.
For security reasons and as a good manner for open source tools, the internet
download is by default set to off.
This patch initializes all needed variables and also introduces to make the
IANA PEN internet download configurable.
./configure
then has this additional feature:
--enable-iana-download Download IANA PEN database [default=no]
Depending on whether it has explicitly been enabled this additional output
is shown after build env is successfully set up via ./configure:
Download IANA PEN database : yes
IANA PEN database URL : http://www.iana.org/assignments/enterprise-numbers
The URL is unfortunately hardcoded in the message. I couldn't find a quick
way to show the IANA_PEN_URL variable there, so if this is ever changed (it is
not configurable right now, but maybe with a follow up patch in the future),
it has to be changed in the help string as well.
---
Makefile.am | 5 ++---
configure.ac | 39 ++++++++++++++++++++++++++-------------
2 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index ce3267f00bc8..05fa209e90bc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,7 +41,6 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure configure-stamp \
$(distdir).tar.gz $(distdir).tar.bz2
SUBDIRS = lib src include doc contrib control
-IANA_PEN = http://www.iana.org/assignments/enterprise-numbers
dist-hook:
cp control/ipmitool.spec $(distdir)
@@ -53,8 +52,8 @@ if DOWNLOAD
enterprise-numbers:
@echo Downloading IANA PEN database...
- @$(DOWNLOAD) "$(IANA_PEN)" > tmpfile.$$PPID || {\
- echo "FAILED to download the IANA PEN database"; \
+ @$(DOWNLOAD) "$(IANA_PEN_URL)" > tmpfile.$$PPID || {\
+ echo "FAILED to download the IANA PEN database from $(IANA_PEN_URL)"; \
rm tmpfile.$$PPID; \
false; \
}
diff --git a/configure.ac b/configure.ac
index b421192daef7..c7a20cad1dc3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,23 +56,34 @@ if test "x$exec_prefix" = "xNONE"; then
exec_prefix="$prefix"
fi
-if test "x$WGET" = "x"; then
- if 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` !])
+xiana_pen_url="http://www.iana.org/assignments/enterprise-numbers"
+AC_SUBST(IANA_PEN_URL, xiana_pen_url)
+
+AC_ARG_ENABLE([iana-download],
+ [AC_HELP_STRING([--enable-iana-download],
+ [Download IANA PEN database [default=no]])],
+ [xenable_iana_download=$enableval],
+ [xenable_iana_download=no])
+if test "x$xenable_iana_download" = "xyes"; then
+ if test "x$WGET" = "x"; then
+ if 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` !])
+ xenable_iana_download="no"
+ else
+ DOWNLOAD="$CURL -#"
+ fi
else
- DOWNLOAD="$CURL --location --progress-bar"
- AM_CONDITIONAL([DOWNLOAD], [true])
+ DOWNLOAD="$WGET -c -nd -O -"
fi
+fi
+if test "x$xenable_iana_download" = "xyes"; then
+ AM_CONDITIONAL([DOWNLOAD], [true])
+ AC_SUBST(DOWNLOAD, $DOWNLOAD)
else
- DOWNLOAD="$WGET -c -nd -O -"
- AM_CONDITIONAL([DOWNLOAD], [true])
+ AM_CONDITIONAL([DOWNLOAD], [false])
fi
-AC_MSG_WARN([** Download is:])
-AC_MSG_WARN($DOWNLOAD)
-AC_SUBST(DOWNLOAD, $DOWNLOAD)
-
dnl
dnl set default option values
dnl
@@ -773,4 +784,6 @@ AC_MSG_RESULT([Extra tools])
AC_MSG_RESULT([ ipmievd : yes])
AC_MSG_RESULT([ ipmishell : $xenable_ipmishell])
AC_MSG_RESULT([])
-
+AC_MSG_RESULT([ Download IANA PEN database : $xenable_iana_download])
+AC_MSG_RESULT([ IANA PEN database URL : $xiana_pen_url])
+AC_MSG_RESULT([])
--
2.26.0