All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] build: don't mandate availability of a fetcher program
@ 2019-03-14 14:08 Wei Liu
  2019-04-04 13:13 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2019-03-14 14:08 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Ian Jackson, Samuel Thibault

It is common that build hosts are isolated from outside world. They
don't necessarily have wget or ftp installed.

Turn the error into warning in configure. And point FETCHER to `false'
command if neither wget nor ftp is available, so any attempt to
download will result in error.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 m4/fetcher.m4     |  4 +++-
 stubdom/configure | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 tools/configure   | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 93 insertions(+), 3 deletions(-)

diff --git a/m4/fetcher.m4 b/m4/fetcher.m4
index 86f33b3937..c1a72c189c 100644
--- a/m4/fetcher.m4
+++ b/m4/fetcher.m4
@@ -1,5 +1,6 @@
 AC_DEFUN([AX_CHECK_FETCHER], [
 AC_PATH_PROG([WGET],[wget], [no])
+AC_PATH_PROG([FALSE],[false], [/bin/false])
 AS_IF([test x"$WGET" != x"no"], [
     FETCHER="$WGET -c -O"
 ], [
@@ -7,7 +8,8 @@ AS_IF([test x"$WGET" != x"no"], [
     AS_IF([test x"$FTP" != x"no"], [
         FETCHER="$FTP -o"
     ], [
-        AC_MSG_ERROR([cannot find wget or ftp])
+        FETCHER="$FALSE"
+        AC_MSG_WARN([cannot find wget or ftp])
     ])
 ])
 AC_SUBST(FETCHER)
diff --git a/stubdom/configure b/stubdom/configure
index df3f763a7b..beeb8db2e1 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -625,6 +625,7 @@ CFLAGS
 CC
 FETCHER
 FTP
+FALSE
 WGET
 CMAKE
 extfiles
@@ -2362,6 +2363,47 @@ $as_echo "no" >&6; }
 fi
 
 
+# Extract the first word of "false", so it can be a program name with args.
+set dummy false; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_FALSE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $FALSE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FALSE="$FALSE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_FALSE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_FALSE" && ac_cv_path_FALSE="/bin/false"
+  ;;
+esac
+fi
+FALSE=$ac_cv_path_FALSE
+if test -n "$FALSE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FALSE" >&5
+$as_echo "$FALSE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 if test x"$WGET" != x"no"; then :
 
     FETCHER="$WGET -c -O"
@@ -2415,7 +2457,9 @@ fi
 
 else
 
-        as_fn_error $? "cannot find wget or ftp" "$LINENO" 5
+        FETCHER="$FALSE"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find wget or ftp" >&5
+$as_echo "$as_me: WARNING: cannot find wget or ftp" >&2;}
 
 fi
 
diff --git a/tools/configure b/tools/configure
index b66d3f6fba..92ead93335 100755
--- a/tools/configure
+++ b/tools/configure
@@ -644,6 +644,7 @@ system_aio
 zlib
 FETCHER
 FTP
+FALSE
 WGET
 pixman_LIBS
 pixman_CFLAGS
@@ -8219,6 +8220,47 @@ $as_echo "no" >&6; }
 fi
 
 
+# Extract the first word of "false", so it can be a program name with args.
+set dummy false; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_FALSE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $FALSE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_FALSE="$FALSE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_FALSE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_FALSE" && ac_cv_path_FALSE="/bin/false"
+  ;;
+esac
+fi
+FALSE=$ac_cv_path_FALSE
+if test -n "$FALSE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FALSE" >&5
+$as_echo "$FALSE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 if test x"$WGET" != x"no"; then :
 
     FETCHER="$WGET -c -O"
@@ -8272,7 +8314,9 @@ fi
 
 else
 
-        as_fn_error $? "cannot find wget or ftp" "$LINENO" 5
+        FETCHER="$FALSE"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find wget or ftp" >&5
+$as_echo "$as_me: WARNING: cannot find wget or ftp" >&2;}
 
 fi
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] build: don't mandate availability of a fetcher program
  2019-03-14 14:08 [PATCH] build: don't mandate availability of a fetcher program Wei Liu
@ 2019-04-04 13:13 ` Wei Liu
  2019-04-04 13:15   ` Andrew Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2019-04-04 13:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Ian Jackson, Samuel Thibault

On Thu, Mar 14, 2019 at 02:08:47PM +0000, Wei Liu wrote:
> It is common that build hosts are isolated from outside world. They
> don't necessarily have wget or ftp installed.
> 
> Turn the error into warning in configure. And point FETCHER to `false'
> command if neither wget nor ftp is available, so any attempt to
> download will result in error.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Ping?

This one is rather low risk. I intend to commit it if I don't hear back
by next week.

Wei.

> ---
>  m4/fetcher.m4     |  4 +++-
>  stubdom/configure | 46 +++++++++++++++++++++++++++++++++++++++++++++-
>  tools/configure   | 46 +++++++++++++++++++++++++++++++++++++++++++++-
>  3 files changed, 93 insertions(+), 3 deletions(-)
> 
> diff --git a/m4/fetcher.m4 b/m4/fetcher.m4
> index 86f33b3937..c1a72c189c 100644
> --- a/m4/fetcher.m4
> +++ b/m4/fetcher.m4
> @@ -1,5 +1,6 @@
>  AC_DEFUN([AX_CHECK_FETCHER], [
>  AC_PATH_PROG([WGET],[wget], [no])
> +AC_PATH_PROG([FALSE],[false], [/bin/false])
>  AS_IF([test x"$WGET" != x"no"], [
>      FETCHER="$WGET -c -O"
>  ], [
> @@ -7,7 +8,8 @@ AS_IF([test x"$WGET" != x"no"], [
>      AS_IF([test x"$FTP" != x"no"], [
>          FETCHER="$FTP -o"
>      ], [
> -        AC_MSG_ERROR([cannot find wget or ftp])
> +        FETCHER="$FALSE"
> +        AC_MSG_WARN([cannot find wget or ftp])
>      ])
>  ])
>  AC_SUBST(FETCHER)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] build: don't mandate availability of a fetcher program
  2019-04-04 13:13 ` Wei Liu
@ 2019-04-04 13:15   ` Andrew Cooper
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2019-04-04 13:15 UTC (permalink / raw)
  To: Wei Liu, xen-devel; +Cc: Samuel Thibault, Ian Jackson

On 04/04/2019 14:13, Wei Liu wrote:
> On Thu, Mar 14, 2019 at 02:08:47PM +0000, Wei Liu wrote:
>> It is common that build hosts are isolated from outside world. They
>> don't necessarily have wget or ftp installed.
>>
>> Turn the error into warning in configure. And point FETCHER to `false'
>> command if neither wget nor ftp is available, so any attempt to
>> download will result in error.
>>
>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Ping?
>
> This one is rather low risk. I intend to commit it if I don't hear back
> by next week.

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-04 13:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14 14:08 [PATCH] build: don't mandate availability of a fetcher program Wei Liu
2019-04-04 13:13 ` Wei Liu
2019-04-04 13:15   ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.