From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1KvLhQ-0001i9-Sf for garchives@archives.gentoo.org; Thu, 30 Oct 2008 00:47:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4D54BE038D; Thu, 30 Oct 2008 00:47:43 +0000 (UTC) Received: from yw-out-1718.google.com (yw-out-1718.google.com [74.125.46.158]) by pigeon.gentoo.org (Postfix) with ESMTP id 16111E038D for ; Thu, 30 Oct 2008 00:47:43 +0000 (UTC) Received: by yw-out-1718.google.com with SMTP id 5so121561ywm.46 for ; Wed, 29 Oct 2008 17:47:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=VR8RsdZ9EZCpxmDLi4ug+NFV+ptboaboHkDKpMFFdMI=; b=Q7snwQoUskJDsUUF/+1JTkvlQU92aEgz5BNtEH3Mg9HQyZM+yJ8ZzwAaW8E94Yci98 0PBLQ5r7ru9Y7uIfhkTpcQcTWxTdFq7ssPH43oc34IW3XkmOfEOphXM4t+hPZyHRUd9C gSfth6oxKNYz7t5yYwtQ8xQZEnJikQr3nKHoM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=aDyE5dUWVb1smhlZDfwYeyQ4+tHhe4Wu1UJ0Dx08KmjiaDXknxzUhEqkCarsJkXJ2Q OYHJnRJYI43ucrA0wf7811AqqWGrqe8AzWqLoA6OAuhKwKrmZ5ZaidtymR0GK7AOLN+u sg/Awyh97L02leptbeYeQYyTELcVw6Zc12vMM= Received: by 10.90.29.17 with SMTP id c17mr8070677agc.77.1225327661374; Wed, 29 Oct 2008 17:47:41 -0700 (PDT) Received: by 10.90.71.8 with HTTP; Wed, 29 Oct 2008 17:47:41 -0700 (PDT) Message-ID: Date: Wed, 29 Oct 2008 20:47:41 -0400 From: "Joshua Murphy" To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] A question about emerge --info In-Reply-To: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <58965d8a0810291553x50e4068ehc58834dfdbce285b@mail.gmail.com> <350fc7cf0810291609v335f4909nbcd90ab7d368cb5d@mail.gmail.com> <350fc7cf0810291623j5fb5608rf311cd0d2a371d2a@mail.gmail.com> X-Archives-Salt: 8d7d750f-8153-4eda-861f-ec6eeef1f0ac X-Archives-Hash: cdd76d30786151cb3d885acd1aa5814e On Wed, Oct 29, 2008 at 7:51 PM, Andrey Vul wrote: > elif system in ('Linux',): > # Linux based systems > distname,distversion,distid = dist('') > if distname and not terse: > platform = _platform(system,release,machine,processor, > 'with', > distname,distversion,distid) > else: > # If the distribution name is unknown check for libc vs. glibc > libcname,libcversion = libc_ver(sys.executable) > platform = _platform(system,release,machine,processor, > 'with', > libcname+libcversion) Hrm. I know just enough about python to get myself in trouble here... but it looks like a python bug in magicking up the libc name and version... but the below is WAY outside my level of practice with python (it'll take re-reading and digging elsewhere a good few times if I'm ever to make sense of it... ------------------ def libc_ver(executable=sys.executable,lib='',version='', chunksize=2048): """ Tries to determine the libc version that the file executable (which defaults to the Python interpreter) is linked against. Returns a tuple of strings (lib,version) which default to the given parameters in case the lookup fails. Note that the function has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc. The file is read and scanned in chunks of chunksize bytes. """ f = open(executable,'rb') binary = f.read(chunksize) pos = 0 while 1: m = _libc_search.search(binary,pos) if not m: binary = f.read(chunksize) if not binary: break pos = 0 continue libcinit,glibc,glibcversion,so,threads,soversion = m.groups() if libcinit and not lib: lib = 'libc' elif glibc: if lib != 'glibc': lib = 'glibc' version = glibcversion elif glibcversion > version: version = glibcversion elif so: if lib != 'glibc': lib = 'libc' if soversion > version: version = soversion if threads and version[-len(threads):] != threads: version = version + threads pos = m.end() f.close() return lib,version ------------------ It parses the header of an executable and guesses, but... the how is too many directions from this that I'm not seeing it with my haphazard abuse of grep. I'd presume anything that might care what platform it's running on (underneath python itself) would be susceptible, so a word thrown in the direction of upstream python would be the main way to go... though it looks like emerge didn't used to use that call... Portage 2.1.4.5 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r7-mahain i686) ================================================================= System uname: 2.6.25-gentoo-r7-mahain i686 AMD Athlon(tm) MP 2400+ is my output, based on a call in emerge to "uname -mrp" .. not platform.platform() Looks like gentoo-dev aimed to drop that dependency in newer versions after all. -- Poison [BLX] Joshua M. Murphy