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 <[email protected]> Jan
