All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Becker <chemobejk@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH RESEND] core: enhance printvars for variables with newlines
Date: Thu, 19 Apr 2018 10:58:34 +0300	[thread overview]
Message-ID: <CAOJ2eMcpV1LnHn-sMwxU=owx-6-wKhG7Z-t95n2=zhK4Maikug@mail.gmail.com> (raw)
In-Reply-To: <20180419074749.GB2496@scaer>

Hi,

On Thu, Apr 19, 2018 at 10:47 AM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Compare with the non-expanded, raw value:
>
>     $ eval make -s printvars VARS=SYSTEMD_USERS QUOTED_VARS=YES RAW_VARS=YES
>     SYSTEMD_USERS=' - - input -1 * - - - Input device group
>             - - systemd-journal -1 * - - - Journal
>             - - render -1 * - - - DRI rendering nodes
>             - - kvm -1 * - - - kvm nodes
>             systemd-bus-proxy -1 systemd-bus-proxy -1 * - - - Proxy D-Bus messages to/from a bus
>             systemd-journal-gateway -1 systemd-journal-gateway -1 * /var/log/journal - - Journal Gateway
>             systemd-journal-remote -1 systemd-journal-remote -1 * /var/log/journal/remote - - Journal Remote
>             systemd-journal-upload -1 systemd-journal-upload -1 * - - - Journal Upload
>             $(SYSTEMD_COREDUMP_USER)
>             $(SYSTEMD_NETWORKD_USER)
>             $(SYSTEMD_RESOLVED_USER)
>             $(SYSTEMD_TIMESYNCD_USER)'
>
> So, newlines are still present, and we can especially see this is the
> case around the variables that are expanded to empty (the coredump,
> networkd, resolved, and timesyncd users).
>
> So, the whole excuse for the change, as explained in the commit log,
> does not stand: newlines are preserved.

Can you please explain to me how to detect reliably where the variable
content ends with QUOTED_VARS=YES? Example of variables with and
without newlines in the same output:

$ external/scripts/buildstep.sh printvars QUOTED_VARS=1
VARS="CANFESTIVAL_INSTALL_TARGET_CMDS SYSTEMD_USERS"
CANFESTIVAL_INSTALL_TARGET_CMDS='       for d in src drivers ; do
PATH="/workarea/stefanb/repos/buildroot-new/output/host/bin:/workarea/stefanb/repos/buildroot-new/output/host/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/stefanb/.local/bin:/home/stefanb/bin"
/usr/bin/make -j1 -C ./$d install
PYTHON=/workarea/stefanb/repos/buildroot-new/output/host/bin/python2
DESTDIR=/workarea/stefanb/repos/buildroot-new/output/target || exit 1
; done'
SYSTEMD_USERS=' - - input -1 * - - - Input device group
        - - systemd-journal -1 * - - - Journal
...
        systemd-resolve -1 systemd-resolve -1 * - - - Network Name
Resolution Manager
        systemd-timesync -1 systemd-timesync -1 * - - - Network Time
Synchronization'

$ external/scripts/buildstep.sh printvars QUOTED_VARS=1
VARS="CANFESTIVAL_INSTALL_TARGET_CMDS SYSTEMD_USERS" | wc -l
13

MULTILINE_VARS=YES adds an additional seperator that makes it possible
to reliably detect the end of the variable content.


One improvement idea would be to use the content of MULTILINE_VARS as
the separator, e.g.

.... MULTILINE_VARS=some-random-seperator-XYZ ...
START-some-random-seperator-XYZ VAR
line 1
line 2
...
END-some-random-seperator-XYZ VAR

That way you could cases where the variable content matches a fixed separator.

Regards, Stefan

      reply	other threads:[~2018-04-19  7:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOJ2eMdEHvZeJ6rECyRkzMZN0UYJ2CYK4yMgR9d89P%2B-tWYJYw@mail.gmail.com>
2018-04-16 11:58 ` [Buildroot] [PATCH RESEND] core: enhance printvars for variables with newlines Stefan Becker
2018-04-16 12:28   ` Yann E. MORIN
2018-04-18 22:27   ` Arnout Vandecappelle
2018-04-19  7:14     ` Stefan Becker
2018-04-19  7:40       ` [Buildroot] [PATCH v2] " Stefan Becker
2018-04-19  8:08         ` Yann E. MORIN
2018-12-16 13:54       ` [Buildroot] [PATCH RESEND] " Thomas Petazzoni
2018-12-16 14:57         ` Stefan Becker
2018-12-16 15:14           ` Thomas Petazzoni
2018-12-16 15:33             ` Stefan Becker
2018-12-16 16:19               ` Stefan Becker
2018-12-17 20:08             ` Trent Piepho
2018-12-18  0:24               ` Carlos Santos
2018-12-18  1:19                 ` Trent Piepho
2018-04-19  7:47     ` Yann E. MORIN
2018-04-19  7:58       ` Stefan Becker [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='CAOJ2eMcpV1LnHn-sMwxU=owx-6-wKhG7Z-t95n2=zhK4Maikug@mail.gmail.com' \
    --to=chemobejk@gmail.com \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.