Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 296085 - emerge --sync overrides sync uri if .git exists
Summary: emerge --sync overrides sync uri if .git exists
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 559054 (view as bug list)
Depends on:
Blocks: 240187 549914
  Show dependency tree
 
Reported: 2009-12-07 15:40 UTC by peyser.alex
Modified: 2015-09-22 01:41 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 peyser.alex 2009-12-07 15:40:07 UTC
emerge --sync assumes that if a .git dir exists, that git will be used to pull the portage tree. It ignores SYNC. 

This makes having private git sync points on portage problematic -- if I want to use git to pull when I sync, there should be a SYNC value to specify that. It should definitely not silently override explicit values, particularly with unclear internal errors like "git pull error" or even worse "Type emerge dev-util/git to enable git support" (since rsync --sync doesn't filter out .git!).

My use case is that I use normal rsync's of portage, but I like to be able to roll back portage temporarily when upstream updates would knock out my system, at least until I figure a work-around. Hunting through gentoo's cvs to temporarily rescue a system is extremely labor intensive, particularly when the problem is initially unclear.

The logic here is unclear -- if I'm using git to update portage, why would I indirect through emerge at all? The metadata is mostly in the tree, so I would use an explicit git pull and emerge --metadata; presumably I know what the hell I'm doing if I'm using non-standard interfaces. And what if I were using a non-standard GIT_DIR? There's no way to specify that.

It seems like a hack for a very particular use case.

Reproducible: Always

Steps to Reproduce:
1. Have a .git subdirectory in /usr/portage
2. emerge --sync
3.

Actual Results:  
git pull silently replaces the SYNC in make.conf.

Expected Results:  
That the SYNC I explicitly place in make.conf is the one that is used.
Comment 1 peyser.alex 2009-12-07 15:42:09 UTC
Oh -- and on top of that, it doesn't appear to be documented behavior at all, which makes the behavior particularly mysterious (not even commented in init.py where it occurs).
Comment 2 Zac Medico gentoo-dev 2009-12-07 20:39:24 UTC
The current behavior is for funtoo, but we can change it to rely on SYNC and advise the funtoo people to set an appropriate SYNC value in their base profile.
Comment 3 Zac Medico gentoo-dev 2009-12-28 06:56:18 UTC
(In reply to comment #0)
> The logic here is unclear -- if I'm using git to update portage, why would I
> indirect through emerge at all? The metadata is mostly in the tree, so I would
> use an explicit git pull and emerge --metadata; presumably I know what the hell
> I'm doing if I'm using non-standard interfaces. And what if I were using a
> non-standard GIT_DIR? There's no way to specify that.

The emerge --sync code path for git has some special timestamp handling code so that the metadata cache works. This is necessary since the timestamps of the ebuilds are compared to the timestamps of the cache entries in $PORTDIR/metadata/cache in order to validate the cache. There has been some discussion about a new cache validation mechanism that would solve this problem:

http://archives.gentoo.org/gentoo-dev/msg_cfa80e33ee5fa6f854120ddfb9b468b3.xml

According to the git faq they have specific reasons for not preserving timestamps:

http://git.or.cz/gitwiki/GitFaq#Whyisn.27tGitpreservingmodificationtimeonfiles.3F
Comment 4 Zac Medico gentoo-dev 2015-08-28 20:27:38 UTC
We can add a repos.conf setting for this. You'll need to have --exclude=/.git in your rsync excludes for this repo.
Comment 5 Zac Medico gentoo-dev 2015-08-28 20:28:18 UTC
*** Bug 559054 has been marked as a duplicate of this bug. ***
Comment 6 Zac Medico gentoo-dev 2015-08-29 21:10:08 UTC
There's a patch in the following branch:

https://github.com/zmedico/portage/tree/bug_296085

It can be installed like this:

echo '=sys-apps/portage-9999 **' >> /etc/portage/package.accept_keywords
portage_LIVE_BRANCH=bug_296085 \
portage_LIVE_REPO=https://github.com/zmedico/portage.git \
emerge -1 =sys-apps/portage-9999
Comment 7 gentoo-user 2015-08-29 22:27:53 UTC
(In reply to Zac Medico from comment #6)
> There's a patch in the following branch:
> 
> https://github.com/zmedico/portage/tree/bug_296085
> 
> It can be installed like this:
> 
> echo '=sys-apps/portage-9999 **' >> /etc/portage/package.accept_keywords
> portage_LIVE_BRANCH=bug_296085 \
> portage_LIVE_REPO=https://github.com/zmedico/portage.git \
> emerge -1 =sys-apps/portage-9999

Patch works for me.
Comment 9 Brian Dolbec (RETIRED) gentoo-dev 2015-09-22 01:41:47 UTC
Released in portage-2.2.21