diff --git a/augeas-0.9.0-00-b82149e2.patch b/augeas-0.9.0-00-b82149e2.patch new file mode 100644 index 0000000..8fcd191 --- /dev/null +++ b/augeas-0.9.0-00-b82149e2.patch @@ -0,0 +1,393 @@ +commit b82149e2e30793047c0404669f6727b71263f91c +Author: Matthew Booth +Date: Mon Nov 7 16:53:16 2011 +0000 + + Mdadm_conf: new lens for /etc/mdadm.conf + +diff --git a/lenses/mdadm_conf.aug b/lenses/mdadm_conf.aug +new file mode 100644 +index 0000000..0cd1ac4 +--- /dev/null ++++ b/lenses/mdadm_conf.aug +@@ -0,0 +1,281 @@ ++(****************************************************************************** ++Mdadm_conf module for Augeas ++ ++Author: Matthew Booth ++ ++Copyright (C): ++ 2011 Red Hat Inc. ++ ++Reference: ++ mdadm(5) ++ config.c and policy.c from mdadm-3.2.2 ++ ++License: ++ This file is licensed under the LGPLv2+. ++ ++This is a lens for /etc/mdadm.conf. It aims to parse every valid configuration ++file as of version 3.2.2, and many invalid ones too. This last point is a ++feature, not a bug! madm will generate warnings for invalid configuration which ++do not prevent correct operation of the tool. Wherever possible, we try to ++allow for this behaviour. ++ ++Keywords in mdadm.conf are matched with a case-insensitive prefix match of at ++least 3 characters. Keys in key/value pairs are also matched case-insensitively, ++but require a full match. The exception is POLICY and PART-POLICY, where keys ++are matched case-sensitively. ++ ++N.B. We can't use case-insensitive regular expressions in most places due to bug ++#147. ++*******************************************************************************) ++ ++module Mdadm_conf = ++ ++ autoload xfm ++ ++ ++(****************************************************************************** ++ * PRIMITIVES ++ ******************************************************************************) ++ ++let eol = Util.comment_or_eol ++let comment = Util.comment ++let empty = Util.empty ++let value = /[^ \t\n#]+/ ++let value_no_eq = /[^ \t\n#=]+/ ++let value_no_eq_sl = /[^ \t\n#=\/]+/ ++ ++let continuation = /\n[ \t]+/ ++let space = /[ \t]+/ ++let value_sep = ( del ( continuation | space . continuation? ) " " ++ | comment . del space " " ) ++ ++(* We parse specific keys rather than having a catch-all owing to the varying ++case of the syntax. This means the user can rely on 'array/uuid' rather than ++additionally testing for 'array/UUID'. ++ ++It would be good to have an additional catchall, but I haven't been able to make ++that work. ++*) ++let keyvalue (r:regexp) (lc:string) (uc:string) = ++ [ del ( r . /=/ ) ( uc . "=" ) . label lc . store value ] ++ ++let simplevalue (r:regexp) (lc:string) (uc:string) = ++ [ del r uc . label lc ++ . ( value_sep . [ label "value" . store value ] )* . eol ] ++ ++ ++(****************************************************************************** ++ * DEVICES ++ ******************************************************************************) ++ ++let dev_re = /[dD][eE][vV]([iI]([cC][eE]?)?)?/ ++ ++let dev_containers_re = /[cC][oO][nN][tT][aA][iI][nN][eE][rR][sS]/ ++let dev_partitions_re = /[pP][aA][rR][tT][iI][tT][iI][oO][nN][sS]/ ++ ++let dev_containers = [ del dev_containers_re "containers" . label "containers" ] ++let dev_partitions = [ del dev_partitions_re "partitions" . label "partitions" ] ++let dev_device = [ label "name". store ( value ++ - dev_containers_re ++ - dev_partitions_re ) ] ++ ++(* Strictly there must be at least 1 device, but we err on the side of parsing ++*) ++let dev_devices = ( value_sep . ( dev_containers ++ | dev_partitions ++ | dev_device ) )* ++ ++let device = [ del dev_re "DEVICE" . label "device" . dev_devices . eol ] ++ ++ ++(****************************************************************************** ++ * ARRAY ++ ******************************************************************************) ++ ++let array_re = /[aA][rR][rR]([aA][yY]?)?/ ++ ++let arr_auto_re = /[aA][uU][tT][oO]/ ++let arr_bitmap_re = /[bB][iI][tT][mM][aA][pP]/ ++let arr_container_re = /[cC][oO][nN][tT][aA][iI][nN][eE][rR]/ ++let arr_devices_re = /[dD][eE][vV][iI][cC][eE][sS]/ ++let arr_disks_re = /[dD][iI][sS][kK][sS]/ (* Undocumented *) ++let arr_level_re = /[lL][eE][vV][eE][lL]/ ++let arr_member_re = /[mM][eE][mM][bB][eE][rR]/ ++let arr_metadata_re = /[mM][eE][tT][aA][dD][aA][tT][aA]/ ++let arr_name_re = /[nN][aA][mM][eE]/ ++let arr_num_devices_re = /[nN][uU][mM]-[dD][eE][vV][iI][cC][eE][sS]/ ++let arr_spare_group_re = /[sS][pP][aA][rR][eE]-[gG][rR][oO][uU][pP]/ ++let arr_spares_re = /[sS][pP][aA][rR][eE][sS]/ ++let arr_super_minor_re = /[sS][uU][pP][eE][rR]-[mM][iI][nN][oO][rR]/ ++let arr_uuid_re = /[uU][uU][iI][dD]/ ++ ++let arr_devicename = [ store value_no_eq . label "devicename" ] ++ ++let arr_auto = keyvalue arr_auto_re "auto" "AUTO" ++let arr_bitmap = keyvalue arr_bitmap_re "bitmap" "BITMAP" ++let arr_container = keyvalue arr_container_re "container" "CONTAINER" ++let arr_devices = keyvalue arr_devices_re "devices" "DEVICES" ++let arr_disks = keyvalue arr_disks_re "disks" "DISKS" ++let arr_level = keyvalue arr_level_re "level" "LEVEL" ++let arr_member = keyvalue arr_member_re "member" "MEMBER" ++let arr_metadata = keyvalue arr_metadata_re "metadata" "METADATA" ++let arr_name = keyvalue arr_name_re "name" "NAME" ++let arr_num_devices = keyvalue arr_num_devices_re "num-devices" "NUM-DEVICES" ++let arr_spare_group = keyvalue arr_spare_group_re "spare-group" "SPARE-GROUP" ++let arr_spares = keyvalue arr_spares_re "spares" "SPARES" ++let arr_super_minor = keyvalue arr_super_minor_re "super-minor" "SUPER-MINOR" ++let arr_uuid = keyvalue arr_uuid_re "uuid" "UUID" ++ ++let arr_options = ( value_sep . ( arr_devicename ++ | arr_auto ++ | arr_bitmap ++ | arr_container ++ | arr_devices ++ | arr_disks ++ | arr_level ++ | arr_member ++ | arr_metadata ++ | arr_name ++ | arr_num_devices ++ | arr_spare_group ++ | arr_spares ++ | arr_super_minor ++ | arr_uuid ) )* ++ ++let array = [ del array_re "ARRAY" . label "array" . arr_options . eol ] ++ ++ ++(****************************************************************************** ++ * MAILADDR ++ ******************************************************************************) ++ ++let mailaddr_re = /[mM][aA][iI]([lL]([aA]([dD]([dD][rR]?)?)?)?)?/ ++ ++(* We intentially allow multiple mailaddr values here, even though this is ++invalid and would produce a warning. This is better than not parsing the file. ++*) ++let mailaddr = simplevalue mailaddr_re "mailaddr" "MAILADDR" ++ ++ ++(****************************************************************************** ++ * MAILFROM ++ ******************************************************************************) ++ ++(* N.B. MAILFROM can only be abbreviated to 5 characters *) ++let mailfrom_re = /[mM][aA][iI][lL][fF]([rR]([oO][mM]?)?)?/ ++ ++let mailfrom = [ del mailfrom_re "MAILFROM" . label "mailfrom" ++ . ( value_sep . [ label "value" . store value ] )* . eol ] ++ ++ ++(****************************************************************************** ++ * PROGRAM ++ ******************************************************************************) ++ ++let program_re = /[pP][rR][oO]([gG]([rR]([aA][mM]?)?)?)?/ ++ ++let program = simplevalue program_re "program" "PROGRAM" ++ ++ ++(****************************************************************************** ++ * CREATE ++ ******************************************************************************) ++ ++let create_re = /[cC][rR][eE]([aA]([tT][eE]?)?)?/ ++ ++let cre_auto_re = /[aA][uU][tT][oO]/ ++let cre_owner_re = /[oO][wW][nN][eE][rR]/ ++let cre_group_re = /[gG][rR][oO][uU][pP]/ ++let cre_mode_re = /[mM][oO][dD][eE]/ ++let cre_metadata_re = /[mM][eE][tT][aA][dD][aA][tT][aA]/ ++let cre_symlinks_re = /[sS][yY][mM][lL][iI][nN][kK][sS]/ ++ ++let cre_auto = keyvalue cre_auto_re "auto" "AUTO" ++let cre_group = keyvalue cre_group_re "group" "GROUP" ++let cre_metadata = keyvalue cre_metadata_re "metadata" "METADATA" ++let cre_mode = keyvalue cre_mode_re "mode" "MODE" ++let cre_owner = keyvalue cre_owner_re "owner" "OWNER" ++let cre_symlinks = keyvalue cre_symlinks_re "symlinks" "SYMLINKS" ++ ++let cre_options = ( value_sep . ( arr_auto ++ | cre_owner ++ | cre_group ++ | cre_mode ++ | cre_metadata ++ | cre_symlinks) )* ++ ++let create = [ del create_re "CREATE" . label "create" . cre_options . eol ] ++ ++ ++(****************************************************************************** ++ * HOMEHOST ++ ******************************************************************************) ++ ++let homehost_re = /[hH][oO][mM]([eE]([hH]([oO]([sS][tT]?)?)?)?)?/ ++ ++let homehost = simplevalue homehost_re "homehost" "HOMEHOST" ++ ++ ++(****************************************************************************** ++ * AUTO ++ ******************************************************************************) ++ ++let auto_re = /[aA][uU][tT][oO]?/ ++ ++let aut_plus = [ key "+" . store value ] ++let aut_minus = [ key "-" . store value ] ++let aut_homehost = [ del /homehost/i "homehost" . label "homehost" ] ++ ++let aut_list = ( value_sep . ( aut_plus | aut_minus | aut_homehost ) )* ++ ++let auto = [ del auto_re "AUTO" . label "auto" . aut_list . eol ] ++ ++ ++(****************************************************************************** ++ * POLICY and PART-POLICY ++ ******************************************************************************) ++ ++(* PART-POLICY is undocumented. A cursory inspection of the parsing code ++suggests it's parsed the same way as POLICY, but treated slightly differently ++thereafter. *) ++ ++let policy_re = /[pP][oO][lL]([iI]([cC][yY]?)?)?/ ++let part_policy_re = ++ /[pP][aA][rR]([tT](-([pP]([oO]([lL]([iI]([cC][yY]?)?)?)?)?)?)?)?/ ++ ++(* Unlike everything else, policy keys are matched case sensitive. This means we ++don't have to mess around with explicit option matching, as the match string is ++fixed for a working configuration. *) ++ ++let pol_option (act:string) = ++ [ del ( act . "=" ) ( act . "=" ) . label act . store value ] ++ ++let pol_options = ( value_sep . [ key value_no_eq_sl . del "=" "=" ++ . store value ] )* ++ ++let policy = [ del policy_re "POLICY" . label "policy" ++ . pol_options . eol ] ++let part_policy = [ del part_policy_re "PART-POLICY" . label "part-policy" ++ . pol_options . eol ] ++ ++ ++(****************************************************************************** ++ * LENS ++ ******************************************************************************) ++ ++let lns = (comment ++ | empty ++ | device ++ | array ++ | mailaddr ++ | mailfrom ++ | program ++ | create ++ | homehost ++ | auto ++ | policy ++ | part_policy )* ++ ++let filter = incl "/etc/mdadm.conf" ++ ++let xfm = transform lns filter +diff --git a/lenses/tests/test_mdadm_conf.aug b/lenses/tests/test_mdadm_conf.aug +new file mode 100644 +index 0000000..a7622cd +--- /dev/null ++++ b/lenses/tests/test_mdadm_conf.aug +@@ -0,0 +1,94 @@ ++module Test_mdadm_conf = ++ ++let conf = " ++# Comment ++device containers ++ # Comment ++DEVICE partitions \ndev ++ /dev/hda* \n /dev/hdc* ++deVI ++ARRAY /dev/md0 UUID=c3d3134f-2aa9-4514-9da3-82ccd1cccc7b Name=foo=bar ++ supeR-minor=3 devicEs=/dev/hda,/dev/hdb Level=1 num-devices=5 spares=2 ++ spare-group=bar auTo=yes BITMAP=/path/to/bitmap metadata=frob ++ container=/dev/sda member=1 ++MAIL # Initial comment ++ user@example.com # End of line comment ++MAILF user@example.com # MAILFROM can only be abbreviated to 5 characters ++PROGRA /usr/sbin/handle-mdadm-events ++CREA group=system mode=0640 auto=part-8 ++HOME ++AUT +1.x Homehost -all ++POL domain=domain1 metadata=imsm path=pci-0000:00:1f.2-scsi-* ++ action=spare ++PART domain=domain1 metadata=imsm path=pci-0000:04:00.0-scsi-[01]* ++ action=include ++" ++ ++test Mdadm_conf.lns get conf = ++ {} ++ { "#comment" = "Comment" } ++ { "device" ++ { "containers" } ++ } ++ { "#comment" = "Comment" } ++ { "device" ++ { "partitions" } ++ } ++ { "device" ++ { "name" = "/dev/hda*" } ++ { "name" = "/dev/hdc*" } ++ } ++ { "device" } ++ { "array" ++ { "devicename" = "/dev/md0" } ++ { "uuid" = "c3d3134f-2aa9-4514-9da3-82ccd1cccc7b" } ++ { "name" = "foo=bar" } ++ { "super-minor" = "3" } ++ { "devices" = "/dev/hda,/dev/hdb" } ++ { "level" = "1" } ++ { "num-devices" = "5" } ++ { "spares" = "2" } ++ { "spare-group" = "bar" } ++ { "auto" = "yes" } ++ { "bitmap" = "/path/to/bitmap" } ++ { "metadata" = "frob" } ++ { "container" = "/dev/sda" } ++ { "member" = "1" } ++ } ++ { "mailaddr" ++ { "#comment" = "Initial comment" } ++ { "value" = "user@example.com" } ++ { "#comment" = "End of line comment" } ++ } ++ { "mailfrom" ++ { "value" = "user@example.com" } ++ { "#comment" = "MAILFROM can only be abbreviated to 5 characters" } ++ } ++ { "program" ++ { "value" = "/usr/sbin/handle-mdadm-events" } ++ } ++ { "create" ++ { "group" = "system" } ++ { "mode" = "0640" } ++ { "auto" = "part-8" } ++ } ++ { "homehost" ++ { "value" = "" } ++ } ++ { "auto" ++ { "+" = "1.x" } ++ { "homehost" } ++ { "-" = "all" } ++ } ++ { "policy" ++ { "domain" = "domain1" } ++ { "metadata" = "imsm" } ++ { "path" = "pci-0000:00:1f.2-scsi-*" } ++ { "action" = "spare" } ++ } ++ { "part-policy" ++ { "domain" = "domain1" } ++ { "metadata" = "imsm" } ++ { "path" = "pci-0000:04:00.0-scsi-[01]*" } ++ { "action" = "include" } ++ } diff --git a/augeas-0.9.0-01-f591ddde.patch b/augeas-0.9.0-01-f591ddde.patch new file mode 100644 index 0000000..34e4ebd --- /dev/null +++ b/augeas-0.9.0-01-f591ddde.patch @@ -0,0 +1,173 @@ +commit f591ddde8913633972409b9ebb3967738007730e +Author: David Lutterkort +Date: Sun Nov 13 19:38:39 2011 -0800 + + * src/fa.c (totalize): handle case-insensitive FA's properly + + The convention for case-insensitive FA's is that they do not contain any + transitions on [A-Z], effectively removing upper case letters from the + alphabet. + + totalize used to create transitions into the crash state that did + transition on upper case letters, violating the convention. + +diff --git a/src/fa.c b/src/fa.c +index ecfe8f4..40194e3 100644 +--- a/src/fa.c ++++ b/src/fa.c +@@ -60,6 +60,10 @@ int fa_minimization_algorithm = FA_MIN_HOPCROFT; + * fa_as_regexp, we store regexps on transitions in the re field of each + * transition. TRANS_RE indicates that we do that, and is used by fa_dot to + * produce proper graphs of an automaton transitioning on regexps. ++ * ++ * For case-insensitive regexps (nocase == 1), the FA never has transitions ++ * on uppercase letters [A-Z], effectively removing these letters from the ++ * alphabet. + */ + struct fa { + struct state *initial; +@@ -2344,6 +2348,34 @@ int fa_contains(struct fa *fa1, struct fa *fa2) { + goto done; + } + ++static int add_crash_trans(struct fa *fa, struct state *s, struct state *crash, ++ int min, int max) { ++ int result; ++ ++ if (fa->nocase) { ++ /* Never transition on anything in [A-Z] */ ++ if (min > 'Z' || max < 'A') { ++ result = add_new_trans(s, crash, min, max); ++ } else if (min >= 'A' && max <= 'Z') { ++ result = 0; ++ } else if (max <= 'Z') { ++ /* min < 'A' */ ++ result = add_new_trans(s, crash, min, 'A' - 1); ++ } else if (min >= 'A') { ++ /* max > 'Z' */ ++ result = add_new_trans(s, crash, 'Z' + 1, max); ++ } else { ++ /* min < 'A' && max > 'Z' */ ++ result = add_new_trans(s, crash, min, 'A' - 1); ++ if (result == 0) ++ result = add_new_trans(s, crash, 'Z' + 1, max); ++ } ++ } else { ++ result = add_new_trans(s, crash, min, max); ++ } ++ return result; ++} ++ + static int totalize(struct fa *fa) { + int r; + struct state *crash = add_state(fa, 0); +@@ -2352,42 +2384,25 @@ static int totalize(struct fa *fa) { + F(mark_reachable(fa)); + sort_transition_intervals(fa); + +- if (fa->nocase) { +- r = add_new_trans(crash, crash, UCHAR_MIN, 'A' - 1); +- if (r < 0) +- return -1; +- r = add_new_trans(crash, crash, 'Z' + 1, UCHAR_MAX); +- if (r < 0) +- return -1; +- } else { +- r = add_new_trans(crash, crash, UCHAR_MIN, UCHAR_MAX); +- if (r < 0) +- return -1; +- } ++ r = add_crash_trans(fa, crash, crash, UCHAR_MIN, UCHAR_MAX); ++ if (r < 0) ++ return -1; + + list_for_each(s, fa->initial) { + int next = UCHAR_MIN; + int tused = s->tused; + for (int i=0; i < tused; i++) { + uchar min = s->trans[i].min, max = s->trans[i].max; +- if (fa->nocase) { +- /* Don't add transitions on [A-Z] into crash */ +- if (isupper(min)) min = 'A'; +- if (isupper(max)) max = 'Z'; +- } + if (min > next) { +- r = add_new_trans(s, crash, next, min - 1); ++ r = add_crash_trans(fa, s, crash, next, min - 1); + if (r < 0) + return -1; + } +- if (max + 1 > next) { ++ if (max + 1 > next) + next = max + 1; +- if (fa->nocase && isupper(next)) +- next = 'Z' + 1; +- } + } + if (next <= UCHAR_MAX) { +- r = add_new_trans(s, crash, next, UCHAR_MAX); ++ r = add_crash_trans(fa, s, crash, next, UCHAR_MAX); + if (r < 0) + return -1; + } +@@ -3019,6 +3034,10 @@ int fa_nocase(struct fa *fa) { + /* t->min < 'A' */ + t->max = 'A' - 1; + F(add_new_trans(s, t->to, lc_min, lc_max)); ++ } else if (t->min >= 'A') { ++ /* t->max > 'Z' */ ++ t->min = 'Z' + 1; ++ F(add_new_trans(s, t->to, lc_min, lc_max)); + } else { + /* t->min < 'A' && t->max > 'Z' */ + F(add_new_trans(s, t->to, 'Z' + 1, t->max)); +diff --git a/tests/fatest.c b/tests/fatest.c +index be4460b..e3658ab 100644 +--- a/tests/fatest.c ++++ b/tests/fatest.c +@@ -581,6 +581,24 @@ static void testExpandNoCase(CuTest *tc) { + free(s); + } + ++static void testNoCaseComplement(CuTest *tc) { ++ const char *key_s = "keY"; ++ struct fa *key = make_good_fa(tc, key_s); ++ struct fa *isect = NULL; ++ ++ fa_nocase(key); ++ ++ struct fa *comp = mark(fa_complement(key)); ++ ++ key = make_good_fa(tc, key_s); ++ ++ /* We used to have a bug in totalize that caused the intersection ++ * to contain "keY" */ ++ isect = fa_intersect(key, comp); ++ ++ CuAssertIntEquals(tc, 1, fa_is_basic(isect, FA_EMPTY)); ++} ++ + int main(int argc, char **argv) { + if (argc == 1) { + char *output = NULL; +@@ -605,6 +623,7 @@ int main(int argc, char **argv) { + SUITE_ADD_TEST(suite, testExpandCharRanges); + SUITE_ADD_TEST(suite, testNoCase); + SUITE_ADD_TEST(suite, testExpandNoCase); ++ SUITE_ADD_TEST(suite, testNoCaseComplement); + + CuSuiteRun(suite); + CuSuiteSummary(suite, &output); +diff --git a/tests/modules/pass_nocase.aug b/tests/modules/pass_nocase.aug +index 6d254a3..ef248f4 100644 +--- a/tests/modules/pass_nocase.aug ++++ b/tests/modules/pass_nocase.aug +@@ -10,7 +10,7 @@ test lns1 get "KEY" = { "1" = "KEY" } + test lns1 get "KeY" = { "1" = "KeY" } + + let lns2 = +- let re = /[a-z]/i - /Key/i in ++ let re = /[A-Za-z]+/ - /Key/i in + [ label "1" . store re ] | [ label "2" . store /Key/i ] + + test lns2 get "Key" = { "2" = "Key" } diff --git a/augeas-0.9.0-02-7f92c1be.patch b/augeas-0.9.0-02-7f92c1be.patch new file mode 100644 index 0000000..3d22779 --- /dev/null +++ b/augeas-0.9.0-02-7f92c1be.patch @@ -0,0 +1,149 @@ +commit 7f92c1be2d9b433b08797b81d2971455b4ee2772 +Author: David Lutterkort +Date: Sun Nov 13 19:38:10 2011 -0800 + + Mdadm: use case-insensitive regexps + +diff --git a/lenses/mdadm_conf.aug b/lenses/mdadm_conf.aug +index 0cd1ac4..1193c13 100644 +--- a/lenses/mdadm_conf.aug ++++ b/lenses/mdadm_conf.aug +@@ -68,16 +68,14 @@ let simplevalue (r:regexp) (lc:string) (uc:string) = + * DEVICES + ******************************************************************************) + +-let dev_re = /[dD][eE][vV]([iI]([cC][eE]?)?)?/ ++let dev_re = /dev(i(ce?)?)?/i + +-let dev_containers_re = /[cC][oO][nN][tT][aA][iI][nN][eE][rR][sS]/ +-let dev_partitions_re = /[pP][aA][rR][tT][iI][tT][iI][oO][nN][sS]/ ++let dev_containers_re = /containers/i ++let dev_partitions_re = /partitions/i + + let dev_containers = [ del dev_containers_re "containers" . label "containers" ] + let dev_partitions = [ del dev_partitions_re "partitions" . label "partitions" ] +-let dev_device = [ label "name". store ( value +- - dev_containers_re +- - dev_partitions_re ) ] ++let dev_device = [ label "name". store ( value - dev_containers_re) ] + + (* Strictly there must be at least 1 device, but we err on the side of parsing + *) +@@ -92,22 +90,22 @@ let device = [ del dev_re "DEVICE" . label "device" . dev_devices . eol ] + * ARRAY + ******************************************************************************) + +-let array_re = /[aA][rR][rR]([aA][yY]?)?/ +- +-let arr_auto_re = /[aA][uU][tT][oO]/ +-let arr_bitmap_re = /[bB][iI][tT][mM][aA][pP]/ +-let arr_container_re = /[cC][oO][nN][tT][aA][iI][nN][eE][rR]/ +-let arr_devices_re = /[dD][eE][vV][iI][cC][eE][sS]/ +-let arr_disks_re = /[dD][iI][sS][kK][sS]/ (* Undocumented *) +-let arr_level_re = /[lL][eE][vV][eE][lL]/ +-let arr_member_re = /[mM][eE][mM][bB][eE][rR]/ +-let arr_metadata_re = /[mM][eE][tT][aA][dD][aA][tT][aA]/ +-let arr_name_re = /[nN][aA][mM][eE]/ +-let arr_num_devices_re = /[nN][uU][mM]-[dD][eE][vV][iI][cC][eE][sS]/ +-let arr_spare_group_re = /[sS][pP][aA][rR][eE]-[gG][rR][oO][uU][pP]/ +-let arr_spares_re = /[sS][pP][aA][rR][eE][sS]/ +-let arr_super_minor_re = /[sS][uU][pP][eE][rR]-[mM][iI][nN][oO][rR]/ +-let arr_uuid_re = /[uU][uU][iI][dD]/ ++let array_re = /arr(ay?)?/i ++ ++let arr_auto_re = /auto/i ++let arr_bitmap_re = /bitmap/i ++let arr_container_re = /container/i ++let arr_devices_re = /devices/i ++let arr_disks_re = /disks/i (* Undocumented *) ++let arr_level_re = /level/i ++let arr_member_re = /member/i ++let arr_metadata_re = /metadata/i ++let arr_name_re = /name/i ++let arr_num_devices_re = /num-devices/i ++let arr_spare_group_re = /spare-group/i ++let arr_spares_re = /spares/i ++let arr_super_minor_re = /super-minor/i ++let arr_uuid_re = /uuid/i + + let arr_devicename = [ store value_no_eq . label "devicename" ] + +@@ -149,7 +147,7 @@ let array = [ del array_re "ARRAY" . label "array" . arr_options . eol ] + * MAILADDR + ******************************************************************************) + +-let mailaddr_re = /[mM][aA][iI]([lL]([aA]([dD]([dD][rR]?)?)?)?)?/ ++let mailaddr_re = /mai(l(a(d(dr?)?)?)?)?/i + + (* We intentially allow multiple mailaddr values here, even though this is + invalid and would produce a warning. This is better than not parsing the file. +@@ -162,7 +160,7 @@ let mailaddr = simplevalue mailaddr_re "mailaddr" "MAILADDR" + ******************************************************************************) + + (* N.B. MAILFROM can only be abbreviated to 5 characters *) +-let mailfrom_re = /[mM][aA][iI][lL][fF]([rR]([oO][mM]?)?)?/ ++let mailfrom_re = /mailf(r(om?)?)?/i + + let mailfrom = [ del mailfrom_re "MAILFROM" . label "mailfrom" + . ( value_sep . [ label "value" . store value ] )* . eol ] +@@ -172,7 +170,7 @@ let mailfrom = [ del mailfrom_re "MAILFROM" . label "mailfrom" + * PROGRAM + ******************************************************************************) + +-let program_re = /[pP][rR][oO]([gG]([rR]([aA][mM]?)?)?)?/ ++let program_re = /pro(g(r(am?)?)?)?/i + + let program = simplevalue program_re "program" "PROGRAM" + +@@ -181,14 +179,14 @@ let program = simplevalue program_re "program" "PROGRAM" + * CREATE + ******************************************************************************) + +-let create_re = /[cC][rR][eE]([aA]([tT][eE]?)?)?/ ++let create_re = /cre(a(te?)?)?/i + +-let cre_auto_re = /[aA][uU][tT][oO]/ +-let cre_owner_re = /[oO][wW][nN][eE][rR]/ +-let cre_group_re = /[gG][rR][oO][uU][pP]/ +-let cre_mode_re = /[mM][oO][dD][eE]/ +-let cre_metadata_re = /[mM][eE][tT][aA][dD][aA][tT][aA]/ +-let cre_symlinks_re = /[sS][yY][mM][lL][iI][nN][kK][sS]/ ++let cre_auto_re = /auto/i ++let cre_owner_re = /owner/i ++let cre_group_re = /group/i ++let cre_mode_re = /mode/i ++let cre_metadata_re = /metadata/i ++let cre_symlinks_re = /symlinks/i + + let cre_auto = keyvalue cre_auto_re "auto" "AUTO" + let cre_group = keyvalue cre_group_re "group" "GROUP" +@@ -211,7 +209,7 @@ let create = [ del create_re "CREATE" . label "create" . cre_options . eol ] + * HOMEHOST + ******************************************************************************) + +-let homehost_re = /[hH][oO][mM]([eE]([hH]([oO]([sS][tT]?)?)?)?)?/ ++let homehost_re = /hom(e(h(o(st?)?)?)?)?/i + + let homehost = simplevalue homehost_re "homehost" "HOMEHOST" + +@@ -220,7 +218,7 @@ let homehost = simplevalue homehost_re "homehost" "HOMEHOST" + * AUTO + ******************************************************************************) + +-let auto_re = /[aA][uU][tT][oO]?/ ++let auto_re = /auto?/i + + let aut_plus = [ key "+" . store value ] + let aut_minus = [ key "-" . store value ] +@@ -239,9 +237,8 @@ let auto = [ del auto_re "AUTO" . label "auto" . aut_list . eol ] + suggests it's parsed the same way as POLICY, but treated slightly differently + thereafter. *) + +-let policy_re = /[pP][oO][lL]([iI]([cC][yY]?)?)?/ +-let part_policy_re = +- /[pP][aA][rR]([tT](-([pP]([oO]([lL]([iI]([cC][yY]?)?)?)?)?)?)?)?/ ++let policy_re = /pol(i(cy?)?)?/i ++let part_policy_re = /par(t(-(p(o(l(i(cy?)?)?)?)?)?)?)?/i + + (* Unlike everything else, policy keys are matched case sensitive. This means we + don't have to mess around with explicit option matching, as the match string is diff --git a/augeas-0.9.0-03-59d5c537.patch b/augeas-0.9.0-03-59d5c537.patch new file mode 100644 index 0000000..ec66921 --- /dev/null +++ b/augeas-0.9.0-03-59d5c537.patch @@ -0,0 +1,19 @@ +commit 59d5c537fe4ada10c0f1806716656ee6392f651c +Author: Raphaƫl Pinson +Date: Tue Nov 22 22:28:11 2011 +0100 + + mdadm.aug: dev_device cannot match dev_partitions_re + +diff --git a/lenses/mdadm_conf.aug b/lenses/mdadm_conf.aug +index 1193c13..2f20158 100644 +--- a/lenses/mdadm_conf.aug ++++ b/lenses/mdadm_conf.aug +@@ -75,7 +75,7 @@ let dev_partitions_re = /partitions/i + + let dev_containers = [ del dev_containers_re "containers" . label "containers" ] + let dev_partitions = [ del dev_partitions_re "partitions" . label "partitions" ] +-let dev_device = [ label "name". store ( value - dev_containers_re) ] ++let dev_device = [ label "name". store ( value - dev_containers_re - dev_partitions_re) ] + + (* Strictly there must be at least 1 device, but we err on the side of parsing + *) diff --git a/augeas.spec b/augeas.spec index 3d0077d..1df6c83 100644 --- a/augeas.spec +++ b/augeas.spec @@ -12,6 +12,12 @@ Source0: http://augeas.net/download/%{name}-%{version}.tar.gz # gives the first version where this patch was applied, NUMBER orders patches # against the same version, and HASH is the git commit hash from upstream +Patch0: augeas-0.9.0-00-b82149e2.patch +Patch1: augeas-0.9.0-01-f591ddde.patch +Patch2: augeas-0.9.0-02-7f92c1be.patch +Patch3: augeas-0.9.0-03-59d5c537.patch +Patch4: mdadm_conf-test.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: readline-devel libselinux-devel @@ -49,6 +55,12 @@ The libraries for %{name}. %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 + %build %configure --disable-static make %{?_smp_mflags} @@ -90,6 +102,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/augeas.pc %changelog +* Fri Nov 25 2011 Matthew Booth - 0.9.0-2 +- Include mdadm_conf lens from upstream + * Mon Jul 25 2011 David Lutterkort - 0.9.0-1 - New version; removed patch pathx-whitespace-ea010d8 diff --git a/mdadm_conf-test.patch b/mdadm_conf-test.patch new file mode 100644 index 0000000..468cf5c --- /dev/null +++ b/mdadm_conf-test.patch @@ -0,0 +1,12 @@ +diff -up augeas-0.9.0/build/test-bug-1/etc/logrotate.d/test.orig augeas-0.9.0/build/test-bug-1/etc/logrotate.d/test +diff -up augeas-0.9.0/tests/Makefile.am.orig augeas-0.9.0/tests/Makefile.am +--- augeas-0.9.0/tests/Makefile.am.orig 2011-11-25 16:27:44.265508345 +0000 ++++ augeas-0.9.0/tests/Makefile.am 2011-11-25 16:28:07.363428944 +0000 +@@ -53,6 +53,7 @@ lens_tests = \ + lens-login_defs.sh \ + lens-logrotate.sh \ + lens-lokkit.sh \ ++ lens-mdadm_conf.sh \ + lens-mke2fs.sh \ + lens-modprobe.sh \ + lens-modules_conf.sh \