extfs: rpm: use printf instead of echo, when retrieving fields.
commita6cd7c9f45d42dff0daa97937abe5e50489affb0
authorMooffie <mooffie@gmail.com>
Wed, 8 Mar 2017 16:56:05 +0000 (8 18:56 +0200)
committerMooffie <mooffie@gmail.com>
Wed, 8 Mar 2017 23:03:42 +0000 (9 01:03 +0200)
treec19279c5c9ea6c106c478bb1817055042798f059
parent25aa5db3fd956e99ccb2074a21b7ef650eacc7e8
extfs: rpm: use printf instead of echo, when retrieving fields.

We switch to using 'echo' instead of 'printf', for the reason described in a
previous commit.

This time, however, we don't do this in order to preserve the value of the
DESCRIPTION field (because we retrieve it using some other command). We do this
for two reasons:

* As chance would have it, we have the string '\c' in our DESCRIPTION. It turns
  out that Dash's echo interprets '\c' to mean the end of the data[1], so
  fields stored in $AllTAGS after DESCRIPTION aren't seen by our sed script
  (resulting in the helper not reporting a few file entries).

* We also have '\n' in DESCRIPTION. This would translate, by echo, into
  newline, failing the naive sed script.

[1] See "\c as in SYSV echo - abort all processing..." in the source code of
    Dash: https://github.com/gioele/dash/blob/master/src/bltin/printf.c

Signed-off-by: Mooffie <mooffie@gmail.com>
src/vfs/extfs/helpers/rpm