svn commit: r500363 - in head/sysutils: . etc_os-release

Tobias C. Berner tcberner at freebsd.org
Wed May 1 09:01:57 UTC 2019


Moin moin


I don't really see how this escaping-hell is any nicer than using -0 :) .
Generating it via shell-script on the other-hand would also have the
benefit of freebsd-version
not being called when running "make index" and such...

Let's wait and see if we need more of the possible variables, and then
rework it in the next iteration.

mfg Tobias

On Mon, 29 Apr 2019 at 08:56, Alexey Dokuchaev <danfe at freebsd.org> wrote:

> On Sun, Apr 28, 2019 at 07:22:21PM +0000, Tobias C. Berner wrote:
> > New Revision: 500363
> > URL: https://svnweb.freebsd.org/changeset/ports/500363
> >
> > Log:
> >   New port: sysutils/etc_os-release
>
> Perhaps `misc' would've been a better category, since it's not strictly
> an utility.  Missed this in the review, sorry.
>
> > +CONTENTS=    'NAME=FreeBSD\0'$\
> > +             'VERSION=${VERSION}\0'$\
> > +             'ID=${VERSION_ID}\0'$\
> > +             'VERSION_ID=freebsd\0'$\
> > +             'ANSI_COLIR="0;31"\0'$\
> > +             'PRETTY_NAME="FreeBSD ${VERSION}"\0'$\
> > +             'CPE_NAME=cpe:/o:freebsd:freebsd:${VERSION_ID}\0'$\
> > +             'HOME_URL=https://freebsd.org/\0'$\
> > +             'BUG_REPORT_URL=https://bugs.freebsd.org'
>
> Oh, this is so ugly.  Please consider something like this:
>
> CONTENTS=       "NAME=FreeBSD" \
>                 "VERSION=${VERSION}" \
>                 "VERSION_ID=${VERSION_ID}" \
>                 "ID=${OPSYS:tl}" \
>                 "ANSI_COLOR=\\\"0;31\\\"" \
>                 "PRETTY_NAME=\\\"${OPSYS}\ ${VERSION}\\\"" \
>                 "CPE_NAME=cpe:/o:freebsd:freebsd:${VERSION_ID}" \
>                 "HOME_URL=https://freebsd.org/" \
>                 "BUG_REPORT_URL=https://bugs.freebsd.org"
>
> Then you don't need -0 for xargs(1) and there's no extra newline at EOF.
>
> ./danfe
>


More information about the svn-ports-head mailing list