Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 563874 - portage metadata/repo_name vs. repos.conf name
Summary: portage metadata/repo_name vs. repos.conf name
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 240187
  Show dependency tree
 
Reported: 2015-10-23 11:42 UTC by Joakim Tjernlund
Modified: 2016-03-27 15:33 UTC (History)
2 users (show)

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 Joakim Tjernlund 2015-10-23 11:42:59 UTC
If repo_name != name in repos.conf portage tools behave inconsistently:

portageq get_repo_path / <name> uses name in repos.conf

package.mask uses name in repo_name

"portageq repositories_configuration / sometimes complain:
!!! Section 'tm-cusfpv3' in repos.conf has name different from
repository name 'gentoo' set inside repository

What makes most sense to me is to always use name in repos.conf
and ignore repo_name
Comment 1 Arfrever Frehtes Taifersar Arahesis 2015-10-23 15:40:14 UTC
If name of section in repos.conf is different from name set inside repository, then that repository is simply not used at all.

pym/portage/repository/config.py:
	if repo.name != repo_name:
		writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf has name different "
			"from repository name '%s' set inside repository") %
			(repo_name, repo.name), level=logging.ERROR, noiselevel=-1)
>>>		del prepos[repo_name]
		continue
Comment 2 Joakim Tjernlund 2015-10-24 05:43:18 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #1)
> If name of section in repos.conf is different from name set inside
> repository, then that repository is simply not used at all.
> 
> pym/portage/repository/config.py:
> 	if repo.name != repo_name:
> 		writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf has name
> different "
> 			"from repository name '%s' set inside repository") %
> 			(repo_name, repo.name), level=logging.ERROR, noiselevel=-1)
> >>>		del prepos[repo_name]
> 		continue

If this is so, what is the purpose of name in repos.conf?
Seems pointless to me to just repeat the name one more.
Comment 3 Zac Medico gentoo-dev 2015-10-24 07:09:56 UTC
It's useful for the values to correspond, as a sanity check. However, we could add a repos.conf setting to override it.
Comment 4 SpanKY gentoo-dev 2015-10-29 20:03:32 UTC
(In reply to Joakim Tjernlund from comment #2)

if you use portage, you can specify the name *only* in repos.conf and not bother creating the repo_name file.  this makes managing repos easier for people as all the relevant content lives in a single place.
Comment 5 Arfrever Frehtes Taifersar Arahesis 2015-10-31 19:04:25 UTC
(In reply to SpanKY from comment #4)
> (In reply to Joakim Tjernlund from comment #2)
> 
> if you use portage, you can specify the name *only* in repos.conf and not
> bother creating the repo_name file.  this makes managing repos easier for
> people as all the relevant content lives in a single place.

If there is no ${repository_location}/profiles/repo_name and no repo-name attribute in ${repository_location}/metadata/layout.conf, then emerge (but not other tools like portageq) prints a warning:

WARNING: One or more repositories have missing repo_name entries:

        .../profiles/repo_name

NOTE: Each repo_name entry should be a plain text file containing a
unique name for the repository on the first line.
Comment 6 Joakim Tjernlund 2015-11-01 13:37:47 UTC
(In reply to Zac Medico from comment #3)
> It's useful for the values to correspond, as a sanity check. However, we
> could add a repos.conf setting to override it.

I can not see how that would be a sanity check. Insisting on these 2 names
to be the same just makes the name in repos.conf pointless.

If you still want to keep some sort of sanity check, please that as
a NEW option to portage.
Comment 7 Joakim Tjernlund 2015-11-01 13:45:40 UTC
(In reply to SpanKY from comment #4)
> (In reply to Joakim Tjernlund from comment #2)
> 
> if you use portage, you can specify the name *only* in repos.conf and not
> bother creating the repo_name file.  this makes managing repos easier for
> people as all the relevant content lives in a single place.

Yes, I have noticed that too and is using that as an workaround for the
repos I control. It is not without side effects as noted in comment #5

Still, this is not a solution, just a tmp fix to get through the day.

The repo_name only makes sense in a PORTDIR setting and this is obsolete.
Comment 8 Joakim Tjernlund 2015-11-10 21:24:18 UTC
Can we move this on? It is getting difficult.
[gentoo]
location = /usr/portage
sync-type = rsync
sync-uri = rsync://rsync.de.gentoo.org/gentoo-portage
auto-sync = yes

[gentoo2]
location = /usr/portage-git
sync-type = git
sync-uri = https://github.com/gentoo-mirror/gentoo.git
auto-sync = yes



emaint sync -r gentoo2

 * Emaint sync, The specified repos were not found: gentoo2
   ...returning

emaint sync -a
...
!!! Section 'gentoo2' in repos.conf has name different from repository name 'gentoo' set inside repository


BTW, try this:
[gentoo]
location = /usr/portage-git
sync-type = git
sync-uri = https://github.com/gentoo-mirror/gentoo.git
auto-sync = yes

above still wants to clone into /usr/portage for me
Comment 9 Arfrever Frehtes Taifersar Arahesis 2015-12-02 21:56:45 UTC
I think about implementing an attribute, which causes ignoring of internal (i.e. set inside repository) repository name and using of section name as repository name.
Maybe 'ignore-internal-repo-name = true'?
Comment 10 Arfrever Frehtes Taifersar Arahesis 2015-12-02 22:02:13 UTC
Or 'force-user-repo-name = true'?
Comment 11 Joakim Tjernlund 2015-12-02 23:10:39 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #9)
> I think about implementing an attribute, which causes ignoring of internal
> (i.e. set inside repository) repository name and using of section name as
> repository name.
> Maybe 'ignore-internal-repo-name = true'?

yes, but why not just make this default?
What is the use of repo_name now?
I still think the default behaviour should be to use
the name in repos.conf and ignore the old one.

if you really want strict matching you could impl. an option to
enable that, I still would like to know what the use case is though.
Comment 12 Arfrever Frehtes Taifersar Arahesis 2015-12-03 22:57:55 UTC
(In reply to Joakim Tjernlund from comment #11)
> yes, but why not just make this default?

Ignoring profiles/repo_name by default could be PMS-incompatible. So it is better to do it only when forced by user.
Comment 13 Joakim Tjernlund 2015-12-04 07:11:03 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #12)
> (In reply to Joakim Tjernlund from comment #11)
> > yes, but why not just make this default?
> 
> Ignoring profiles/repo_name by default could be PMS-incompatible. So it is
> better to do it only when forced by user.

Could you find out? Seems like none thinks current behaviour is good and
the only reason keep it is fear of breaking something.

I think adding a new option should be a last resort if all else fails.

In any case the behaviour needs to be better specified as there are
other tools than portage and ATM they do not behave consistent.
Comment 14 Joakim Tjernlund 2016-01-15 13:39:27 UTC
ping