Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 482464 - sys-apps/portage-2.2.1 egencache gives confusing error when using "--repositories-configuration"
Summary: sys-apps/portage-2.2.1 egencache gives confusing error when using "--reposito...
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
Depends on:
Blocks: 240187
  Show dependency tree
Reported: 2013-08-25 22:11 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2022-10-20 02:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2013-08-25 22:11:38 UTC
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:


main-repo = gentoo

location = /usr/portage
sync-type = rsync
sync-uri = rsync://

location = /graft/repositories/perl-experimental-snapshot/


However, egencache just bails in confusion 

egencache --update --update-use-local-desc 
   --jobs=2 --load-average=3

!!! Error while reading repo config file: File contains no section headers.
file: <io.StringIO>, line: 1
!!! 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.
Comment 1 Zac Medico gentoo-dev 2013-08-26 00:02:04 UTC
You've done it correctly. You can use "$(< /path/to/repos.conf)" without cat.
Comment 2 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2013-08-26 11:26:23 UTC
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  =)
Comment 3 Zac Medico gentoo-dev 2013-08-26 18:14:56 UTC
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).