|
Packit Service |
a2ae7a |
(* Parsing yum's config files *)
|
|
Packit Service |
a2ae7a |
module Yum =
|
|
Packit Service |
a2ae7a |
autoload xfm
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* INI File settings
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let comment = IniFile.comment "#" "#"
|
|
Packit Service |
a2ae7a |
let sep = IniFile.sep "=" "="
|
|
Packit Service |
a2ae7a |
let empty = Util.empty
|
|
Packit Service |
a2ae7a |
let eol = IniFile.eol
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* ENTRY
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let list_entry (list_key:string) =
|
|
Packit Service |
a2ae7a |
let list_value = store /[^# \t\r\n,][^ \t\r\n,]*[^# \t\r\n,]|[^# \t\r\n,]/ in
|
|
Packit Service |
a2ae7a |
let list_sep = del /([ \t]*(,[ \t]*|\r?\n[ \t]+))|[ \t]+/ "\n\t" in
|
|
Packit Service |
a2ae7a |
[ key list_key . sep . Sep.opt_space . list_value ]
|
|
Packit Service |
a2ae7a |
. (list_sep . Build.opt_list [ label list_key . list_value ] list_sep)?
|
|
Packit Service |
a2ae7a |
. eol
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let entry_re = IniFile.entry_re - ("baseurl" | "gpgkey" | "exclude")
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let entry = IniFile.entry entry_re sep comment
|
|
Packit Service |
a2ae7a |
| empty
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let entries =
|
|
Packit Service |
a2ae7a |
let list_entry_elem (k:string) = list_entry k . entry*
|
|
Packit Service |
a2ae7a |
in entry*
|
|
Packit Service |
a2ae7a |
| entry* . Build.combine_three_opt
|
|
Packit Service |
a2ae7a |
(list_entry_elem "baseurl")
|
|
Packit Service |
a2ae7a |
(list_entry_elem "gpgkey")
|
|
Packit Service |
a2ae7a |
(list_entry_elem "exclude")
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(***********************************************************************a
|
|
Packit Service |
a2ae7a |
* TITLE
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
let title = IniFile.title IniFile.record_re
|
|
Packit Service |
a2ae7a |
let record = [ title . entries ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* LENS & FILTER
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
let lns = (empty | comment)* . record*
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let filter = (incl "/etc/yum.conf")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/yum.repos.d/*.repo")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/yum/yum-cron*.conf")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/yum/pluginconf.d/*")
|
|
Packit Service |
a2ae7a |
. (excl "/etc/yum/pluginconf.d/versionlock.list")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/dnf/dnf.conf")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/dnf/automatic.conf")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/dnf/plugins/*.conf")
|
|
Packit Service |
a2ae7a |
. Util.stdexcl
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let xfm = transform lns filter
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Local Variables: *)
|
|
Packit Service |
a2ae7a |
(* mode: caml *)
|
|
Packit Service |
a2ae7a |
(* End: *)
|