home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / YaST2 / scrconf / cfg_hardware.scr < prev    next >
Encoding:
Text File  |  2006-11-29  |  1.4 KB  |  53 lines

  1. /**
  2.  * File:    cfg_hardware.scr
  3.  * Summary:    Agent for /etc/sysconfig/hardware/*
  4.  * Author:    Jiri Srain <jsrain@suse.cz>
  5.  * Access:    read / write
  6.  *
  7.  * General syntax:
  8.  *     # comment0
  9.  *     VAR1=val1 # comment1
  10.  *     VAR2="val 2 #blah" # comment2
  11.  *     VAR3='val3 x #blah2' # comment3
  12.  *
  13.  * $Id: cfg_hardware.scr 17865 2004-06-16 12:30:01Z arvin $
  14.  *
  15.  * <p>Reads/writes <tt>/etc/sysconfig/hardware/hwcfg-*</tt>. For more details
  16.  * see its own documentation.</p>
  17.  */
  18. .sysconfig.hardware
  19.  
  20. `ag_ini(
  21.     `IniAgent( [ "/etc/sysconfig/hardware/hwcfg-*" ],
  22.     $[
  23.         /* values at the top level, allow comments after value */
  24.         "options"    : [ "global_values", "comments_last", ],
  25.         /* empty lines, comments after value and whole-line comments */
  26.         "comments"    : [ "^[ \t]*$", "[ \t]*#.*$", "^[ \t]*#.*$" ],
  27.         /* matching rules */
  28.         "params"    : [
  29.         /* VAR1="val1" */
  30.         $[
  31.             "match" : [ "^[ \t]*([a-zA-Z0-9_]+)=\"([^\"]*)\"", "%s='%s'"],
  32.             /* multiple line rules */
  33.             "multiline" : [ "([^=]+)=\"([^\"]*)", "([^\"]*\")" ],
  34.         ],
  35.         /* VAR1='val1' */
  36.         $[
  37.             "match" : [ "^[ \t]*([a-zA-Z0-9_]+)='([^']*)'", "%s='%s'"],
  38.             /* multiple line rules */
  39.             "multiline" : [ "([^=]+)=('[^']*)", "([^']*')" ],
  40.         ],
  41.         /* VAR1=val1 */
  42.         $[
  43.             "match" : [ "^[ \t]*([a-zA-Z0-9_]+)=([^ \t\"$`'\\#]*)$", "%s='%s'" ],
  44.         ],
  45.         ],
  46.         /* matching rules */
  47.         "rewrite"    : [
  48.         ["/etc/sysconfig/hardware/hwcfg-(.*)",
  49.          "/etc/sysconfig/hardware/hwcfg-%s"],
  50.         ],
  51.     ]
  52. ))
  53.