public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: Ulrich Mueller <ulm@gentoo.org>
Cc: gentoo-dev@lists.gentoo.org, Pacho Ramos <pacho@gentoo.org>
Subject: Re: [gentoo-dev] [PATCH] readme.gentoo-r1.eclass: Do not inherit eutils.
Date: Sat, 19 Dec 2015 19:34:57 +0100	[thread overview]
Message-ID: <20151219193457.254ed534.mgorny@gentoo.org> (raw)
In-Reply-To: <22133.41169.638073.889716@a1i15.kph.uni-mainz.de>

[-- Attachment #1: Type: text/plain, Size: 989 bytes --]

On Sat, 19 Dec 2015 19:24:17 +0100
Ulrich Mueller <ulm@gentoo.org> wrote:

> >>>>> On Sat, 19 Dec 2015, Michał Górny wrote:  
> 
> >> +			set -f				# disable filename expansion in echo arguments
> >>  			echo -e ${DOC_CONTENTS} | fold -s -w 70 \
> >>  				| sed 's/[[:space:]]*$//' > "${T}"/README.gentoo  
> 
> > Maybe I'm missing something but is there any reason not to quote
> > "${DOC_CONTENTS}" instead of working around the results of not
> > quoting it?  
> 
> IIUC the intention of not quoting it is to normalise whitespace,
> especially embedded newlines. Unfortunately, I don't see a good way to
> do this differently. Adding another processing step after echo -e is
> too late, because newlines expanded from \n must be kept.

  read -d '' -r -a DOC_CONTENTS <<<"${DOC_CONTENTS}"

This performs word splitting into an array. Then you can do:

  echo -e "${DOC_CONTENTS[*]}" | ...

-- 
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

  reply	other threads:[~2015-12-19 18:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19 17:18 [gentoo-dev] [PATCH] readme.gentoo-r1.eclass: Do not inherit eutils Ulrich Mueller
2015-12-19 17:32 ` Michał Górny
2015-12-19 18:05   ` [gentoo-dev] " Martin Vaeth
2015-12-19 18:24   ` [gentoo-dev] " Ulrich Mueller
2015-12-19 18:34     ` Michał Górny [this message]
2015-12-19 20:17       ` Ulrich Mueller
2015-12-19 20:52         ` Michał Górny
2015-12-19 22:51           ` Ulrich Mueller
2015-12-19 22:56             ` Michał Górny
2015-12-19 23:47               ` [gentoo-dev] " Jonathan Callen
2015-12-20 10:17                 ` Andrew Savchenko
2015-12-19 23:56               ` [gentoo-dev] " Ulrich Mueller
2015-12-20  9:16                 ` Michał Górny
2015-12-20 10:31                   ` Ulrich Mueller
2015-12-20 10:56                     ` Michał Górny
2015-12-20 12:13                       ` Ulrich Mueller
2015-12-21  7:38                         ` Pacho Ramos
2015-12-21  7:55                           ` Ulrich Mueller

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=20151219193457.254ed534.mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=pacho@gentoo.org \
    --cc=ulm@gentoo.org \
    /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