On 06/21/10 05:04 PM, Danek Duvall wrote:
Danek Duvall wrote:

I went ahead and put in the same quoting function as in the generic
action's __str__() method, so that values with spaces (or other quotes)
will be quoted properly.

This didn't work out as well as I might have hoped.  In particular, it's
caused

     16326 quoting rules in pkgmogrify substitutions are confusing

where you end up getting a pair of quotes at the beginning and end of
strings, which isn't terribly useful and actively breaks older clients.

I don't have a good idea for how to fix this for good, but I've got a good
and ugly hack to fix it:

     http://cr.opensolaris.org/~dduvall/pkg-pmquotes/

The gist is that the extra quoting gets done by default only on
human-readable operations and emit (which has to emit a string that can be
parsed into an action) while the others don't get the quoting because their
bits get passed directly into an already-created action which will do the
quoting when __str__() is called.  And for anyone who wants to override
that behavior for any reason, you can use a "quote" or "noquote" token in
the expando's token list.

Code review comments appreciated before Wednesday.

Given the commentary in bug 16326, this seems like the best option.

src/util/publish/pkgmogrify.py:
  line 412: given line 371, I don't understand the need for
    .get() as opposed to d["quote"]; can you elaborate?


Cheers,
-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to