Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 547448 - repos.conf: Repo synchronization logic tackles auto-sync=true and sync-type="" incorrectly, but only for the gentoo
Summary: repos.conf: Repo synchronization logic tackles auto-sync=true and sync-type="...
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-23 04:26 UTC by Adam Feldman
Modified: 2015-04-23 05:34 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Feldman gentoo-dev 2015-04-23 04:26:27 UTC
My gentoo tree is mounted nfs, ro on my virtual machines.  As a result, these systems cannot sync. I created a minimal repos.conf file:

[DEFAULT]
main-repo = gentoo

[gentoo]
location = /var/lib/repos/gentoo

[local]
location = /var/lib/repos/local


A quick snippet from the man page:
auto-sync
This setting determines if the repo will be synced during "emerge  --sync"  or  "emaint sync --auto" runs.  This allows for repositories to be synced only when  desired  via "emaint sync --repo foo". Valid values: yes, no, true, false. If  unset,  the repo will be treated as set yes, true.
sync-type
Specifies type of synchronization performed by `emerge --sync`. Valid  non-empty  values:  cvs, git, rsync, svn, websync (emerge-webrsync) This attribute can be set to empty value to disable  synchronization  of  given repository. Empty value is default.
sync-uri
Specifies  URI  of repository used for synchronization performed by `emerge --sync`. This attribute can be set to empty value to disable  synchronization  of  given repository. Empty value is default.


When performing a sync operation, portage attempted sync the gentoo repo.  However, it did not attempt to sync the local repo, which means the gentoo repo is being handled differently (which I disagree with, and hence the bug report)  I came to the conclusion that the issue is gentoo repo specific by swapping main-repo and arrived at the same issue.  grknight and ecormier on IRC thought this might be related to the fact that auto-sync is on by default, but even if that is the way it is written I think it the logic doesn't make sense as is.


End of the day: if there is no sync-type or sync-uri, a sync shouldn't happen, and it is, but only for the gentoo repo.
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2015-04-23 04:41:50 UTC
That is because, the gentoo repo has backup settings in /usr/lib/portage/config/repos.conf.

In fact you do not even need a gentoo.conf in /etc/portage/repos.conf directory.
It is only needed if you wish to override the default settings.

To fix your problem, just add all entries to your /etc/portage/repos.conf/gentoo.conf

Side note, If I didn't set auto-sync=yes in the defaults for the gentoo repo.  I would have been lambasted and inundated with bug reports and claims of broken portage because emerge --sync didn't sync anything.  When I released the new portage with the plug-in sync system with the additional features and capabilities.
Comment 2 Adam Feldman gentoo-dev 2015-04-23 05:19:02 UTC
(In reply to Brian Dolbec from comment #1)
> That is because, the gentoo repo has backup settings in
> /usr/lib/portage/config/repos.conf.
> 
> In fact you do not even need a gentoo.conf in /etc/portage/repos.conf
> directory.
> It is only needed if you wish to override the default settings.
> 
> To fix your problem, just add all entries to your
> /etc/portage/repos.conf/gentoo.conf
> 
> Side note, If I didn't set auto-sync=yes in the defaults for the gentoo
> repo.  I would have been lambasted and inundated with bug reports and claims
> of broken portage because emerge --sync didn't sync anything.  When I
> released the new portage with the plug-in sync system with the additional
> features and capabilities.

You don't view it as an input validation error (the input being the values set in the config)? The fact that it proceeds despite contradictory flag settings sounds like a bad idea to me.
I have no issue with auto-sync = yes for default.  I just think for a sync operation, you need a:
if sync-type == "" or sync-uri == ""; then
abort syncing repo;
fi

or something like that.  The idea  being that situations that prevent syncing should actually do so, regardless of anything else.
Another reason to advocate for fixing it, this is the result of default settings only, so I think program logic should handle it such that default values don't cause breakage. 

Thoughts?
Comment 3 Adam Feldman gentoo-dev 2015-04-23 05:34:00 UTC
After a quick explanation from Arfrever, I understand that the issue is that it is pulling in values for sync-uri/sync-type from /usr/share/portage/config/repos.conf, so they are non-null, hence the issue.  Switching to invalid.