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 <gentoo-user+bounces-85674-garchives=archives.gentoo.org@lists.gentoo.org>) id 1KvKvW-0004pC-GO for garchives@archives.gentoo.org; Wed, 29 Oct 2008 23:58:14 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9818AE030C; Wed, 29 Oct 2008 23:58:12 +0000 (UTC) Received: from mail-gx0-f11.google.com (mail-gx0-f11.google.com [209.85.217.11]) by pigeon.gentoo.org (Postfix) with ESMTP id 514B0E030C for <gentoo-user@lists.gentoo.org>; Wed, 29 Oct 2008 23:58:12 +0000 (UTC) Received: by gxk4 with SMTP id 4so6667gxk.10 for <gentoo-user@lists.gentoo.org>; Wed, 29 Oct 2008 16:58:10 -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:references; bh=F/sXRRJhihF1Bxio9wzMEFM5e1vttfJ/dn73pmoDvfM=; b=lQR+zTi63L8tOEfuaNA2USofSvqSakqoZY5DmOcYjJ0y1pde+iDxgSmTxxA1YRUV9C MHDZiDRsLYrgPsUZR1jxilXdrEp20OYK0z0TivEfo46LyykLC6wvCgrhOh/WFzFf8X0y ge0N0PKjEgpQRHF6s+wu7ZRKLCYGRmlM2X6QM= 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:references; b=DM5p3Hgg/YjPhbxxcGti7HZzuZXTbhtzDApzltYFg6ofJi41bv1gdX+PPWJj7T6DOW vERWKrrQENedTufYS/X1VOtw1xNGqCHIV5ghyxz8WUTR5i5JEQqJffm5GUtpOhxIaUSP Tzbm9f3Msf7GMgY8+s/kiwsGlsE4OY9Idj7iU= Received: by 10.151.113.11 with SMTP id q11mr9031131ybm.82.1225324652493; Wed, 29 Oct 2008 16:57:32 -0700 (PDT) Received: by 10.150.198.18 with HTTP; Wed, 29 Oct 2008 16:57:32 -0700 (PDT) Message-ID: <350fc7cf0810291657t20e74d6ag70b05bf8e23973ba@mail.gmail.com> Date: Wed, 29 Oct 2008 16:57:32 -0700 From: "Andrey Falko" <ma3oxuct@gmail.com> To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] A question about emerge --info In-Reply-To: <e38d12ff0810291651y245cba2k89b9cb2b8ee39dd9@mail.gmail.com> Precedence: bulk List-Post: <mailto:gentoo-user@lists.gentoo.org> List-Help: <mailto:gentoo-user+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-user.gentoo.org> X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_53870_980454.1225324652474" References: <58965d8a0810291553x50e4068ehc58834dfdbce285b@mail.gmail.com> <350fc7cf0810291609v335f4909nbcd90ab7d368cb5d@mail.gmail.com> <e38d12ff0810291613t6205b80em1294991c930ce1cf@mail.gmail.com> <350fc7cf0810291623j5fb5608rf311cd0d2a371d2a@mail.gmail.com> <e38d12ff0810291632gde628e5p5edadfc87f2704a8@mail.gmail.com> <e38d12ff0810291641t7bb26b6fo1ea6ecc2aa4ef19c@mail.gmail.com> <e38d12ff0810291651y245cba2k89b9cb2b8ee39dd9@mail.gmail.com> X-Archives-Salt: ea954bdc-574d-4166-87b1-d8862c722e03 X-Archives-Hash: c4cea56b934f2633d488f254b6eadf14 ------=_Part_53870_980454.1225324652474 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Oct 29, 2008 at 4:51 PM, Andrey Vul <andrey.vul@gmail.com> wrote: > Found the code, and it's actually part of python (as of 2.4). > Gentoo sets aliased to 1 when printing the system uname. > /usr/lib/python2.{4,5,6}/platform.py: > > def _platform(*args): > > """ Helper to format the platform string in a filename > compatible format e.g. "system-version-machine". > """ > # Format the platform string > platform = string.join( > map(string.strip, > filter(len,args)), > '-') > > # Cleanup some possible filename obstacles... > replace = string.replace > platform = replace(platform,' ','_') > platform = replace(platform,'/','-') > platform = replace(platform,'\\','-') > platform = replace(platform,':','-') > platform = replace(platform,';','-') > platform = replace(platform,'"','-') > platform = replace(platform,'(','-') > platform = replace(platform,')','-') > > # No need to report 'unknown' information... > platform = replace(platform,'unknown','') > > # Fold '--'s and remove trailing '-' > while 1: > cleaned = replace(platform,'--','-') > if cleaned == platform: > break > platform = cleaned > while platform[-1] == '-': > platform = platform[:-1] > > return platform > > def platform(aliased=0, terse=0): > > """ Returns a single string identifying the underlying platform > with as much useful information as possible (but no more :). > > The output is intended to be human readable rather than > machine parseable. It may look different on different > platforms and this is intended. > > If "aliased" is true, the function will use aliases for > various platforms that report system names which differ from > their common names, e.g. SunOS will be reported as > Solaris. The system_alias() function is used to implement > this. > > Setting terse to true causes the function to return only the > absolute minimum information needed to identify the platform. > > """ > result = _platform_cache.get((aliased, terse), None) > if result is not None: > return result > > # Get uname information and then apply platform specific cosmetics > # to it... > system,node,release,version,machine,processor = uname() > if machine == processor: > processor = '' > if aliased: > system,release,version = system_alias(system,release,version) > > if system == 'Windows': > # MS platforms > rel,vers,csd,ptype = win32_ver(version) > if terse: > platform = _platform(system,release) > else: > platform = _platform(system,release,version,csd) > > 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) > elif system == 'Java': > # Java platforms > r,v,vminfo,(os_name,os_version,os_arch) = java_ver() > if terse: > platform = _platform(system,release,version) > else: > platform = _platform(system,release,version, > 'on', > os_name,os_version,os_arch) > > elif system == 'MacOS': > # MacOS platforms > if terse: > platform = _platform(system,release) > else: > platform = _platform(system,release,machine) > > else: > # Generic handler > if terse: > platform = _platform(system,release) > else: > bits,linkage = architecture(sys.executable) > platform = > _platform(system,release,machine,processor,bits,linkage) > > _platform_cache[(aliased, terse)] = platform > return platform > > > Proof: run /usr/lib/python2.{4,5,6}/platform.py > aliased and terse have no effect wrt output > (kernel_version-with-libc_version) > -- > Andrey Vul > > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > A: Top-posting. > Q: What is the most annoying thing in e-mail? > > Good digging around :). So this is a python bug then? Or does portage need to be update for some change that went into python? Actually, is this really even a bug...its just a minor cosmetic problem really. ------=_Part_53870_980454.1225324652474 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline <br><br><div class="gmail_quote">On Wed, Oct 29, 2008 at 4:51 PM, Andrey Vul <span dir="ltr"><<a href="mailto:andrey.vul@gmail.com">andrey.vul@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Found the code, and it's actually part of python (as of 2.4).<br> Gentoo sets aliased to 1 when printing the system uname.<br> /usr/lib/python2.{4,5,6}/platform.py:<br> <br> def _platform(*args):<br> <br> """ Helper to format the platform string in a filename<br> compatible format e.g. "system-version-machine".<br> """<br> # Format the platform string<br> platform = string.join(<br> map(string.strip,<br> filter(len,args)),<br> '-')<br> <br> # Cleanup some possible filename obstacles...<br> replace = string.replace<br> platform = replace(platform,' ','_')<br> platform = replace(platform,'/','-')<br> platform = replace(platform,'\\','-')<br> platform = replace(platform,':','-')<br> platform = replace(platform,';','-')<br> platform = replace(platform,'"','-')<br> platform = replace(platform,'(','-')<br> platform = replace(platform,')','-')<br> <br> # No need to report 'unknown' information...<br> platform = replace(platform,'unknown','')<br> <br> # Fold '--'s and remove trailing '-'<br> while 1:<br> cleaned = replace(platform,'--','-')<br> if cleaned == platform:<br> break<br> platform = cleaned<br> while platform[-1] == '-':<br> platform = platform[:-1]<br> <br> return platform<br> <br> def platform(aliased=0, terse=0):<br> <br> """ Returns a single string identifying the underlying platform<br> with as much useful information as possible (but no more :).<br> <br> The output is intended to be human readable rather than<br> machine parseable. It may look different on different<br> platforms and this is intended.<br> <br> If "aliased" is true, the function will use aliases for<br> various platforms that report system names which differ from<br> their common names, e.g. SunOS will be reported as<br> Solaris. The system_alias() function is used to implement<br> this.<br> <br> Setting terse to true causes the function to return only the<br> absolute minimum information needed to identify the platform.<br> <br> """<br> result = _platform_cache.get((aliased, terse), None)<br> if result is not None:<br> return result<br> <br> # Get uname information and then apply platform specific cosmetics<br> # to it...<br> system,node,release,version,machine,processor = uname()<br> if machine == processor:<br> processor = ''<br> if aliased:<br> system,release,version = system_alias(system,release,version)<br> <br> if system == 'Windows':<br> # MS platforms<br> rel,vers,csd,ptype = win32_ver(version)<br> if terse:<br> platform = _platform(system,release)<br> else:<br> platform = _platform(system,release,version,csd)<br> <br> elif system in ('Linux',):<br> # Linux based systems<br> distname,distversion,distid = dist('')<br> if distname and not terse:<br> platform = _platform(system,release,machine,processor,<br> 'with',<br> distname,distversion,distid)<br> else:<br> # If the distribution name is unknown check for libc vs. glibc<br> libcname,libcversion = libc_ver(sys.executable)<br> platform = _platform(system,release,machine,processor,<br> 'with',<br> libcname+libcversion)<br> elif system == 'Java':<br> # Java platforms<br> r,v,vminfo,(os_name,os_version,os_arch) = java_ver()<br> if terse:<br> platform = _platform(system,release,version)<br> else:<br> platform = _platform(system,release,version,<br> 'on',<br> os_name,os_version,os_arch)<br> <br> elif system == 'MacOS':<br> # MacOS platforms<br> if terse:<br> platform = _platform(system,release)<br> else:<br> platform = _platform(system,release,machine)<br> <br> else:<br> # Generic handler<br> if terse:<br> platform = _platform(system,release)<br> else:<br> bits,linkage = architecture(sys.executable)<br> platform = _platform(system,release,machine,processor,bits,linkage)<br> <br> _platform_cache[(aliased, terse)] = platform<br> return platform<br> <br> <br> Proof: run /usr/lib/python2.{4,5,6}/platform.py<br> aliased and terse have no effect wrt output (kernel_version-with-libc_version)<br> <div><div></div><div class="Wj3C7c">--<br> Andrey Vul<br> <br> A: Because it messes up the order in which people normally read text.<br> Q: Why is top-posting such a bad thing?<br> A: Top-posting.<br> Q: What is the most annoying thing in e-mail?<br> <br> </div></div></blockquote></div><br>Good digging around :). So this is a python bug then? Or does portage need to be update for some change that went into python? Actually, is this really even a bug...its just a minor cosmetic problem really.<br> ------=_Part_53870_980454.1225324652474--