I've been using egencache to perform an automated cache-enabled version of a repository for a while, and I noticed after upgrading portage it tells me the "--portdir-overlay" parameter is deprecated. So I threw together a repos.conf file as below, to match the target I'm generating: -------------------- [DEFAULT] main-repo = gentoo [gentoo] location = /usr/portage sync-type = rsync sync-uri = rsync://rsync.gentoo.org/gentoo-portage [perl-experimental-snapshots] location = /graft/repositories/perl-experimental-snapshot/ --------------------- However, egencache just bails in confusion egencache --update --update-use-local-desc --repo=perl-experimental-snapshots --repositories-configuration=/graft/repositories/perl-experimental-snapshot-scripts/repos.conf --jobs=2 --load-average=3 !!! Error while reading repo config file: File contains no section headers. file: <io.StringIO>, line: 1 '/graft/repositories/perl-experimental-snapshot-scripts/repos.conf' !!! main-repo not set in DEFAULT and PORTDIR is empty. usage: egencache [options] <action> ... [atom] ... egencache: error: Unable to locate repository named 'perl-experimental-snapshots' which gives me the impression its trying to parse the file *name* like its file *contents* egencache --update --update-use-local-desc --repo=perl-experimental-snapshots --repositories-configuration="$(cat /graft/repositories/perl-experimental-snapshot-scripts/repos.conf )" --jobs=2 --load-average=3 ^ this however, doesn't give any errors. I can't confirm it works, but strace does seem to report that this hack makes it return to normal behaviour.
You've done it correctly. You can use "$(< /path/to/repos.conf)" without cat.
Hrm, I guess reading the docs it does kinda make sense looking backwards, it just wasn't obvious it would work that way looking forwards. ( That, and expecting an inline form of an INI-format-like file just struck me as weird ). It seems plausible you could add an edge case for when the contents was a filename ( or even have an argument that provided a filename instead of this one ). And thanks for the $(< ) trick, didn't realise that =)
We can definitely clarify the documentation. The reason that it uses the INI format directly is that this option is a convenience for people who don't want to bother with a separate config file (if they wanted to use config files then they could use --config-root instead).