Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, Mark Kubacki <wmark@×××××××××.de>
Subject: Re: [gentoo-portage-dev] [PATCH 2/3] Send output of ```emerge --version``` as User-Agent HTTP-header
Date: Thu, 15 Aug 2013 06:25:55
Message-Id: 520C7470.9070605@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 2/3] Send output of ```emerge --version``` as User-Agent HTTP-header by Mark Kubacki
1 On 08/14/2013 01:10 PM, Mark Kubacki wrote:
2 > @@ -892,8 +893,13 @@ class binarytree(object):
3 > # Don't use urlopen for https, since it doesn't support
4 > # certificate/hostname verification (bug #469888).
5 > if parsed_url.scheme not in ('https',):
6 > + trees = load_emerge_config().trees
7 > + user_agent = "Gentoo "+getportageversion(self.settings["PORTDIR"], None,
8 > + self.settings.profile_path, self.settings["CHOST"],
9 > + trees[self.settings['EROOT']]["vartree"].dbapi)
10
11 Generally, your patches look reasonable. However, it's a waste to call
12 load_emerge_config() here, since the caller has certainly loaded the
13 config already. I guess we could have the caller pass the result of
14 getportageversion() as an argument to the binarytree.populate() method.
15 --
16 Thanks,
17 Zac