Skip to content

Commit

Permalink
Fix faulty default theme generating oneliner.
Browse files Browse the repository at this point in the history
grep | cut | perl was rather insane way of doing simple task and RE used
in perl was faulty (greedy any char separator between quotation marks).
Replace it with sed fed up via find+xargs (no -print0 for better
portability).

    find . -name '*.c' -type f | xargs sed \
        '/^[ \t]*format_add("/!d;s///;s/"[^"]*"\(.*\)".*/ \1/'

Comparison of sorted results (diff -u old new | diffstat)
- master: 6 insertions(+), 1132 deletions(-)
- 0.3.1:  6 insertions(+), 20 deletions(-)

Notable changes:

-icq_auth_subscribe  to refuse. Reason: %T%3%n
+icq_auth_subscribe %> (%1) %T%2%n asks for authorisation. Use \"/auth -a %2\" to accept, \"/auth -d %2 [reason]\" to refuse. Reason: %T%3%n

-inet_addr_failed .%n\n
+inet_addr_failed %! (%1) Invalid \"server\".%n\n

-jabber_auth_rejectnoreq  to force unauth.\n
+jabber_auth_rejectnoreq %! (%2) No pending authorization request from %T%1%n. Use \"/auth -d %1\" to force unauth.\n

-jabber_auth_subscribe  to refuse.%n\n
+jabber_auth_subscribe %> (%2) %T%1%n asks for authorisation. Use \"/auth -a %1\" to accept, \"/auth -d %1\" to refuse.%n\n

+jabber_auth_unsubscribe %> (%2) %T%1%n asks for removal. Use \"/auth -d %1\" to delete.%n\n

But there is also screwed: jabber_muc_room_created.

* docs/ekg2book-en/develbook.xml: Improve theme oneliner.
* docs/ekg2book/develbook.xml: Ditto.
  • Loading branch information
przemoc committed Aug 29, 2011
1 parent d3d114a commit f146ad3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/ekg2book-en/develbook.xml
Expand Up @@ -365,9 +365,9 @@ Copyright 2000 Free Software Foundation, Inc.
</para>
<programlisting role="shell">
<![CDATA[
grep -R -I 'format_add("' * | cut -d: -f2- | \
perl -ne '/format_add\("(.*?)".+"(.*)".*/; print $1." ".$2."\n"' \
> my.theme
find . -name '*.c' -type f | xargs sed \
'/^[ \t]*format_add("/!d;s///;s/"[^"]*"\(.*\)".*/ \1/' \
> my.theme
]]>
</programlisting>
<para>
Expand Down
6 changes: 3 additions & 3 deletions docs/ekg2book/develbook.xml
Expand Up @@ -363,9 +363,9 @@ Copyright 2000 Free Software Foundation, Inc.
</para>
<programlisting role="shell">
<![CDATA[
grep -R -I 'format_add("' * | cut -d: -f2- | \
perl -ne '/format_add\("(.*?)".+"(.*)".*/; print $1." ".$2."\n"' \
> my.theme
find . -name '*.c' -type f | xargs sed \
'/^[ \t]*format_add("/!d;s///;s/"[^"]*"\(.*\)".*/ \1/' \
> my.theme
]]>
</programlisting>
<para>
Expand Down

0 comments on commit f146ad3

Please sign in to comment.