[csw-maintainers] Processing csw.conf

Maciej (Matchek) Bliziński maciej at opencsw.org
Sun Mar 18 08:47:12 CET 2012


What's the best way to process the csw.conf file?

I looked into pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf
and slow this:

# Source csw.conf, if it exists
if [ -f $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf ] ; then
  . $PKG_INSTALL_ROOT/opt/csw/etc/csw.conf
fi
if [ -f $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf ] ; then
  . $PKG_INSTALL_ROOT/etc/opt/csw/csw.conf
fi
(...)
  # Determine if service should be started or not
  daemon=yes
  if [ "$autoenable_daemons" = "no" ]; then
    daemon=no
  fi
  eval autoenable_service="\$autoenable_$service"
  if [ "$autoenable_service" = "no" ]; then
    daemon=no
  elif [ "$autoenable_service" = "yes" ]; then
    daemon=yes
  fi

Is the idea that each and every postinstall script that needs to
determine the settings, must on their own figure out:

- the location of the file
- how to read the file (source or parse)
- how to extract specific variables

I thought we had some kind of a library that solves this once for
good. Do we have anything like it?

(more context: https://www.opencsw.org/mantis/view.php?id=4409)

Maciej


More information about the maintainers mailing list