[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH 2/2] build: add --full to version.sh to guess $(XEN_FULLVERSION)


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 8 Sep 2021 14:27:17 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qbvvTZjgc6qM9fIxlneSsnWKvnclSGDEy1xCwQbgaNc=; b=czu3gQ1Bg2gV/6QZ5LGsTGiVrR9fQZKtQ7U88Q9awiqB9d/i8JXUB+kEZO2N2p3zc+fBtwfFchjEkIHQXq+Dle2jh7O+SFRjXRGB/3PxQzprs1b1NtyH8Wf5CiEwf8S9CV0E3btlQn2yrAD6X3czydT2wIsBUjTvypxHWFv0S3HczOA0EOPtPHqw+5vSyuD/jvJH4JtVCkc4hq4066I/HRH7LmMT+BpW9LPUgUctD7oCs7QD299Rf3yH0zL46sJHtm2L3xyyy3Gzq2A7ysyRGEX/JyXn6biEnkZmigvfPX+HamI1bQjZibSS1j/4iAjQZIVdESjxWKggujxv81D6Yg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y7kjz/k9/vojd9aAtZROHUCRXy4eGpsE2V1LpBQyHrONJy3Hzv99c7BrAEyJgfXOnoQCDX86k9cBw8nzTk4DPZzphDI9g6vGEC4p6KdWGmSTF3JZHQqSx5Lusicy/0KCCHdb9EZVfL2o7HZ/NjQvrd7B384BX+kdonxLs4b8wpQTePwDl2WglukD7f/2CM8mr2WztrArHPj/xvEyT71WAPjx1DRcFifqld1NWtmRmwJwd55Sq+/PS57RdCIUUL3cPeyu4KymFbj449NonxQr4RDCJHP2h8T46ihDk4F1iJ9FZJuirsiBVxJyRPAZGSrzKpuXb345DgaPDlh/CATnvQ==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 08 Sep 2021 12:27:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.09.2021 11:54, Anthony PERARD wrote:
> --- a/tools/flask/policy/Makefile.common
> +++ b/tools/flask/policy/Makefile.common
> @@ -35,7 +35,7 @@ OUTPUT_POLICY ?= $(BEST_POLICY_VER)
>  #
>  ########################################
>  
> -POLICY_FILENAME = $(FLASK_BUILD_DIR)/xenpolicy-$(shell $(MAKE) -C 
> $(XEN_ROOT)/xen xenversion --no-print-directory)
> +POLICY_FILENAME = $(FLASK_BUILD_DIR)/xenpolicy-$(shell 
> $(XEN_ROOT)/version.sh --full $(XEN_ROOT)/xen/Makefile)

Shell scripts better get invoked by "$(SHELL) <script>", to avoid
depending on the script actually being marked as executable (which is
impossible on some file systems).

> --- a/version.sh
> +++ b/version.sh
> @@ -1,5 +1,18 @@
>  #!/bin/sh
>  
> +opt_full=false
> +while [ $# -gt 1 ]; do
> +    case "$1" in
> +        --full) opt_full=true ;;
> +        *) break ;;
> +    esac
> +    shift
> +done
> +
>  MAJOR=`grep "export XEN_VERSION" $1 | sed 's/.*=//g' | tr -s " "`
>  MINOR=`grep "export XEN_SUBVERSION" $1 | sed 's/.*=//g' | tr -s " "`
> -printf "%d.%d" $MAJOR $MINOR
> +
> +if $opt_full; then
> +    EXTRAVERSION=$(grep "export XEN_EXTRAVERSION" $1 | sed 's/^.* ?=\s\+//; 
> s/\$([^)]*)//g; s/ //g')
> +fi
> +printf "%d.%d%s" $MAJOR $MINOR $EXTRAVERSION

I guess you want to clear EXTRAVERSION either prior to the "if" or
in an "else".

With these addressed:
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.