From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Date: Wed, 3 Feb 2021 08:10:59 +0100 From: Michael Olbrich Message-ID: <20210203071059.GJ5577@pengutronix.de> References: <20210202145836.28983-1-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210202145836.28983-1-s.hauer@pengutronix.de> Subject: Re: [ptxdist] [PATCH] rootfs: Fix handling of empty variables List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de On Tue, Feb 02, 2021 at 03:58:36PM +0100, Sascha Hauer wrote: > $(PTXCONF_PROJECT_VENDOR) and $(PTXCONF_ROOTFS_ETC_HOSTNAME) can be > empty variables in which case bash answers with: > > /bin/bash: command substitution: line 0: syntax error near unexpected token `newline' > /bin/bash: command substitution: line 0: `sed -r 's/ ?([\.:;,]) ?/ \1 /' <<< ' This is strange. Why are these variables empty? They are strings in kconfig. The resulting make variables should include the quotes, so they should never be empty. Michael > Fix this warning by putting the variables into quotation marks to make > the empty string explicit. > > Signed-off-by: Sascha Hauer > --- > rules/rootfs.make | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/rules/rootfs.make b/rules/rootfs.make > index 419ca001e..627d33463 100644 > --- a/rules/rootfs.make > +++ b/rules/rootfs.make > @@ -217,11 +217,11 @@ ifdef PTXCONF_ROOTFS_ISSUE > $(call remove_quotes,$(PTXCONF_ROOTFS_ETC_HOSTNAME))) > @$(call install_replace_figlet, rootfs, /etc/issue, \ > @FIGLET:VENDOR@, \ > - `sed -r 's/ ?([\.:;,]) ?/ \1 /' <<< $(PTXCONF_PROJECT_VENDOR)`, \ > + `sed -r 's/ ?([\.:;,]) ?/ \1 /' <<< "$(PTXCONF_PROJECT_VENDOR)"`, \ > etcissue) > @$(call install_replace_figlet, rootfs, /etc/issue, \ > @FIGLET:HOSTNAME@, \ > - `sed -r 's/ ?([\.:;,]) ?/ \1 /' <<< $(PTXCONF_ROOTFS_ETC_HOSTNAME)`, \ > + `sed -r 's/ ?([\.:;,]) ?/ \1 /' <<< "$(PTXCONF_ROOTFS_ETC_HOSTNAME)"`, \ > etcissue) > endif > > -- > 2.20.1 > > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de