mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] rootfs: Fix handling of empty variables
Date: Wed, 3 Feb 2021 08:28:59 +0100	[thread overview]
Message-ID: <20210203072859.GK5577@pengutronix.de> (raw)
In-Reply-To: <20210203072342.GS19583@pengutronix.de>

On Wed, Feb 03, 2021 at 08:23:42AM +0100, Sascha Hauer wrote:
> On Wed, Feb 03, 2021 at 08:10:59AM +0100, Michael Olbrich wrote:
> > 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.
> 
> To be correct PTXCONF_ROOTFS_ETC_HOSTNAME is not empty, it's just not
> defined. That is because ROOTFS_ETC_HOSTNAME depends on ROOTFS_HOSTNAME
> which in my case is set to 'n'.
> 
> I guess PTXCONF_PROJECT_VENDOR will indeed always have quotes as this
> variable doesn't depend on another variable. We could drop this hunk, I
> added it for consistency.

Ah, no I see it. Then it should be:

	`... <<< "$(call remove_quotes,$(PTXCONF_ROOTFS_ETC_HOSTNAME))"`

So, remove the quotes if they are there and always add them.

Michael

-- 
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

      reply	other threads:[~2021-02-03  7:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 14:58 Sascha Hauer
2021-02-03  7:10 ` Michael Olbrich
2021-02-03  7:23   ` Sascha Hauer
2021-02-03  7:28     ` Michael Olbrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210203072859.GK5577@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox