[pacman-dev] [PATCH 0/1] Simple config parser added to scripts library

lolilolicon lolilolicon at gmail.com
Fri Sep 30 07:37:47 EDT 2011

We're aware of many duplicates in our scripts, among which are things like

  eval $(awk '/DBPath/ {print $1$2$3}' @sysconfdir@/pacman.conf)

which is obviously utterly hackish and potentially dangerous, yet (shockingly)
quite a common practice in our scripts.  Trying to fix all these here and
there is a waste of time.

As suggested by Dave, I took the liberty to add a config parser to the scripts
library.  Currently there're only two functions conf_key_val and conf_key_set,
which are modified from pacman-key's get_from().  The usage is a bit different,
as described in the commit message.

If we agree on this change, feel free to port our scripts to use this.

lolilolicon (1):
  scripts/library: add config_parser.sh

 scripts/library/README           |    3 ++
 scripts/library/config_parser.sh |   56 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100644 scripts/library/config_parser.sh


More information about the pacman-dev mailing list