Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 432364 - mercurial.eclass - wrong save http-auth data
Summary: mercurial.eclass - wrong save http-auth data
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Christoph Junghans (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2012-08-22 20:54 UTC by Alexey Shildyakov
Modified: 2012-12-26 23:09 UTC (History)
1 user (show)

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


Attachments
The problem ebuild (xneur-9999.ebuild,2.73 KB, text/plain)
2012-12-18 04:12 UTC, Alexey Shildyakov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shildyakov 2012-08-22 20:54:17 UTC
Use http-based auth when using mercurial.eclass:
EHG_REPO_URI="http://user:password@host/app"

First emerge was successful. Second was failed: authentication error. I checked /usr/portage/distfiles/hg-src/app/app/.hg/hgrc and saw:
[paths]
default = http://user@host/app

Expecting:
default = http://user:password@host/app

When I have changed to expecting string the app was merged successful.
Comment 1 Christoph Junghans (RETIRED) gentoo-dev 2012-12-17 23:47:21 UTC
I guess this is a mercurial issue. However when I run:
$ hg clone http://user:password@host/app
the password has present in app/.hg/hgrc.

Can you check that?

Anyway, looking in mercurial.eclass, the pull command is called without EHG_REPO_URI, which disallow the update of it in the ebuild.
Comment 2 Alexey Shildyakov 2012-12-18 04:11:48 UTC
That what I'm talking about.
Sorry, I haven't writen the problem appears only while using portage. As you said the 'hg clone' itself works fine. But with portage it doesn't create proper hgrc.
The command in second time shows:
 * Updating /usr/portage/distfiles/hg-src/xneur/xneur from http://anonymous:anonymous@hg.itways.ru/xneur
abort: http authorization required
But /usr/portage/distfiles/hg-src/xneur/xneur/.hg/hgrc only contains http://anonymous@hg.itways.ru/xneur
Comment 3 Alexey Shildyakov 2012-12-18 04:12:55 UTC
Created attachment 332614 [details]
The problem ebuild

Maybe I do something wrong, but this ebuild produce the error while emerging second time.
Comment 4 Christoph Junghans (RETIRED) gentoo-dev 2012-12-18 04:56:21 UTC
(In reply to comment #3)
> Created attachment 332614 [details]
> The problem ebuild
> 
> Maybe I do something wrong, but this ebuild produce the error while emerging
> second time.
I got it, the default behavior was changed in mercurial-2.0.1 (clone: don't save user's password in .hg/hgrc). Does the following patch help?

--- /usr/portage/eclass/mercurial.eclass	2012-04-03 13:31:13.000000000 -0600
+++ mercurial.eclass	2012-12-17 21:54:06.160758938 -0700
@@ -113,7 +113,7 @@
 	elif [[ -z "${EHG_OFFLINE}" ]]; then
 		einfo "Updating ${EHG_STORE_DIR}/${EHG_PROJECT}/${module} from ${EHG_REPO_URI}"
 		cd "${module}" || die "failed to cd to ${module}"
-		${EHG_PULL_CMD}
+		${EHG_PULL_CMD} "${EHG_REPO_URI}"
 		# mercurial-2.1: hg pull returns 1 if there are no incoming changesets
 		[[ $? -eq 0 || $? -eq 1 ]] || die "update failed"
 	fi