On 30/09/13 16:16, Kristoffer Knigga wrote:
> I apologize if this isn't the correct forum for such a question, but I can't
> seem to find any other.
>
> I am trying to use Augeas to disable all debuginfo and source yum
> repositories on some machines. The path expression I've come up with seems
> to work with 'match':
>
> augtool> match /files/etc/yum.repos.d/*/*[label() =~
> regexp('.*-debuginfo|.*-source')]
> /files/etc/yum.repos.d/fedora-updates-testing.repo/updates-testing-debuginfo
> = (none)
> /files/etc/yum.repos.d/fedora-updates-testing.repo/updates-testing-source =
> (none)
> /files/etc/yum.repos.d/fedora-updates.repo/updates-debuginfo = (none)
> /files/etc/yum.repos.d/fedora-updates.repo/updates-source = (none)
> /files/etc/yum.repos.d/fedora.repo/fedora-debuginfo = (none)
> /files/etc/yum.repos.d/fedora.repo/fedora-source = (none)
> /files/etc/yum.repos.d/local.repo/local-base-source = (none)
> /files/etc/yum.repos.d/local.repo/local-base-debuginfo = (none)
> /files/etc/yum.repos.d/local.repo/local-updates-source = (none)
> /files/etc/yum.repos.d/local.repo/local-updates-debuginfo = (none)
> /files/etc/yum.repos.d/local.repo/local-custom-source = (none)
> ...
>
> But when tried with 'set' I get "error: Too many matches for path expression":
>
> augtool> set /files/etc/yum.repos.d/*/*[label() =~
> regexp('.*-debuginfo|.*-source')]/enabled 0
> error: Too many matches for path expression
>
>
> Should I be able to do such a mass change with one command?
Yes, but not that one. You need to use "setm" instead, which is
designed for this scenario. Try something like:
setm /files/etc/yum.repos.d/*/*[label() =~
regexp('.*-debuginfo|.*-source')] enabled 0
See also "augtool help setm".
Regards,
--
Dominic Cleal
Red Hat Engineering
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel