Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 740092 - Discrepancy in sync-type and sync-uri documented defaults and behavior
Summary: Discrepancy in sync-type and sync-uri documented defaults and behavior
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Documentation (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-02 16:07 UTC by Daniel M. Weeks
Modified: 2020-09-02 16:07 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 Daniel M. Weeks 2020-09-02 16:07:13 UTC
As of protage 2.3.103-r1, sync-type and sync-uri are both documented as having an empty default value and, for either variable, an empty value should disable synchronization.

To start, if both sync-type and sync-uri are commented out (i.e. default - empty) for the main gentoo repository, emerge --sync proceeds anyway as rsync. I believe this behavior is for backwards compatibility but it not in the documentation. This makes it somewhat surprising that explicitly empty values do disable synchronization. This leads to the question - when is empty really empty?.

Different combinations of explicitly and implicitly empty variables have completely different behavior, where they should all disable synchronizing the repo, per documentation:

(I) is implicitly empty, i.e. commented or removed, should use the default - empty
(E) is explicitly set empty

sync-type (I), sync-uri (I) = sync anyway as rsync
sync-type (E), sync-uri (E) = no sync, no hooks run
sync-type (I), sync-uri (E) = emerge immediately returns 1 and prints an error
sync-type (E), sync-uri (I) = no sync and prints a warning, no hooks run

To even further complicate the problem, the behavior changes again when one variable is implicitly or explicitly empty and the other has a value. (git sync-type was used for testing and the local git repo already existed so cases that lacked sync-uri weren't always fatal.)

sync-type (I), sync-uri (S) = no sync, warning, runs hooks
sync-type (E), sync-uri (S) = no sync, warning, does not run hooks
sync-type (S), sync-uri (I) = syncs as sync-type, runs hooks
sync-type (S), sync-uri (E) = emerge returns 1 and prints an error

There is clearly also an inconsistency in when hooks are run but hopefully resolving the empty variable issue will clarify it.

(The original goal was trying to define a repo without a sync operation that would still have hooks run on it. This would provide an opportunity for custom "sync" in a repo hook script. It seems if the above is made consistent, no sync will mean no hooks and that becomes a feature request for another ticket.)

Reproducible: Always