diff mbox series

[kvm-unit-tests,2/3] configure: s390x: Check if the host key document exists

Message ID 20210318125015.45502-3-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series scripts: Fix PV run handling | expand

Commit Message

Janosch Frank March 18, 2021, 12:50 p.m. UTC
I'd rather have a readable error message than make failing the build
with cryptic errors.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 configure | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Thomas Huth June 7, 2021, 9:48 a.m. UTC | #1
On 18/03/2021 13.50, Janosch Frank wrote:
> I'd rather have a readable error message than make failing the build
> with cryptic errors.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>   configure | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/configure b/configure
> index cdcd34e9..4d4bb646 100755
> --- a/configure
> +++ b/configure
> @@ -121,6 +121,11 @@ while [[ "$1" = -* ]]; do
>       esac
>   done
>   
> +if [ "$host_key_document" ] && [ ! -f "$host_key_document" ]; then

Use [ -n "$host_key_document" ] instead of just
  [ "$host_key_document" ] ?

With that fixed:

Reviewed-by: Thomas Huth <thuth@redhat.com>


> +    echo "Host key document doesn't exist at the specified location."
> +    exit 1
> +fi
> +
>   if [ "$erratatxt" ] && [ ! -f "$erratatxt" ]; then
>       echo "erratatxt: $erratatxt does not exist or is not a regular file"
>       exit 1
>
David Hildenbrand June 7, 2021, 9:56 a.m. UTC | #2
On 07.06.21 11:48, Thomas Huth wrote:
> On 18/03/2021 13.50, Janosch Frank wrote:
>> I'd rather have a readable error message than make failing the build
>> with cryptic errors.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>    configure | 5 +++++
>>    1 file changed, 5 insertions(+)
>>
>> diff --git a/configure b/configure
>> index cdcd34e9..4d4bb646 100755
>> --- a/configure
>> +++ b/configure
>> @@ -121,6 +121,11 @@ while [[ "$1" = -* ]]; do
>>        esac
>>    done
>>    
>> +if [ "$host_key_document" ] && [ ! -f "$host_key_document" ]; then
> 
> Use [ -n "$host_key_document" ] instead of just
>    [ "$host_key_document" ] ?
> 
> With that fixed:
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> 
>> +    echo "Host key document doesn't exist at the specified location."
>> +    exit 1
>> +fi
>> +
>>    if [ "$erratatxt" ] && [ ! -f "$erratatxt" ]; then
^should we adjust that then as well?
diff mbox series

Patch

diff --git a/configure b/configure
index cdcd34e9..4d4bb646 100755
--- a/configure
+++ b/configure
@@ -121,6 +121,11 @@  while [[ "$1" = -* ]]; do
     esac
 done
 
+if [ "$host_key_document" ] && [ ! -f "$host_key_document" ]; then
+    echo "Host key document doesn't exist at the specified location."
+    exit 1
+fi
+
 if [ "$erratatxt" ] && [ ! -f "$erratatxt" ]; then
     echo "erratatxt: $erratatxt does not exist or is not a regular file"
     exit 1