public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] Undocumented subarches, e.g. core2
@ 2011-06-22 21:03 Sebastian Pipping
  2011-06-22 21:14 ` Peter Stuge
  2011-06-23 18:23 ` Sebastian Pipping
  0 siblings, 2 replies; 5+ messages in thread
From: Sebastian Pipping @ 2011-06-22 21:03 UTC (permalink / raw
  To: gentoo-catalyst

Hello!


It looks like there are subarches supported by catalyst 2.0.6.916 that
are not documented on

  http://www.gentoo.org/proj/en/releng/catalyst/

Would you mind if I add any findings to that page?

Best,



Sebastian



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-catalyst] Undocumented subarches, e.g. core2
  2011-06-22 21:03 [gentoo-catalyst] Undocumented subarches, e.g. core2 Sebastian Pipping
@ 2011-06-22 21:14 ` Peter Stuge
  2011-06-23 18:23 ` Sebastian Pipping
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Stuge @ 2011-06-22 21:14 UTC (permalink / raw
  To: gentoo-catalyst

Sebastian Pipping wrote:
> It looks like there are subarches supported by catalyst 2.0.6.916 that
> are not documented on
> 
>   http://www.gentoo.org/proj/en/releng/catalyst/
> 
> Would you mind if I add any findings to that page?

I say go for it while you are looking at stuff in this area. There's
very little activity on the list. :)


//Peter



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-catalyst] Undocumented subarches, e.g. core2
  2011-06-22 21:03 [gentoo-catalyst] Undocumented subarches, e.g. core2 Sebastian Pipping
  2011-06-22 21:14 ` Peter Stuge
@ 2011-06-23 18:23 ` Sebastian Pipping
  2011-06-24  0:27   ` Sebastian Pipping
  1 sibling, 1 reply; 5+ messages in thread
From: Sebastian Pipping @ 2011-06-23 18:23 UTC (permalink / raw
  To: gentoo-catalyst, Raúl Porcel

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

Hello again,


attached is a new script to generate the table of subarches in GuideXML
for copy and paste.  With such a script I expect that it will be easier
to keep the table in sync in the future.  I would like to see

 1) that script integrated into the catalyst_2 branch

 2) its output replace the current table shown at
    http://www.gentoo.org/proj/en/releng/catalyst/

Please review and feed back.  The script outputs both GuideXML and a
plain text version.  I'll paste the plain text output here to ease up
review:

=======================================================================
alpha    [ 8] alpha ev4 ev45 ev5 ev56 ev6 ev67 pca56
amd64    [12] amd64 amdfam10 athlon64 athlon64-sse3 athlonfx barcelona
              core2 k8 k8-sse3 nocona opteron opteron-sse3
arm      [13] arm armeb armv4l armv4tl armv5teb armv5tejl armv5tel
              armv5tl armv6j armv6z armv6zk armv7a armv7a_hardfp
hppa     [ 3] hppa hppa1.1 hppa2.0
ia64     [ 1] ia64
mips     [27] cobalt cobalt_n32 ip27 ip27_n32 ip28 ip28_n32 ip30
              ip30_n32 loongson2e loongson2e_n32 loongson2f
              loongson2f_n32 mips mips1 mips2 mips3 mips3_n32 mips3_n64
              mips4 mips4_n32 mipsel mipsel1 mipsel2 mipsel3
              mipsel3_n32 mipsel4 mipsel4_n32
ppc      [ 6] g3 g4 g5 power power-ppc ppc
ppc64    [ 7] 970 cell power3 power4 power5 power6 ppc64
s390     [ 1] s390
s390x    [ 1] s390x
sh       [12] sh sh2 sh2a sh2aeb sh2eb sh3 sh3eb sh4 sh4a sh4aeb sh4eb
              sheb
sparc    [ 1] sparc
sparc64  [ 1] sparc64
x86      [23] athlon athlon-4 athlon-mp athlon-tbird athlon-xp i386
              i486 i586 i686 k6 k6-2 k6-3 pentium pentium-m pentium-mmx
              pentium2 pentium3 pentium3m pentium4 pentium4m pentiumpro
              prescott x86
=======================================================================

Best,



Sebastian

[-- Attachment #2: make_subarch_table_guidexml.py --]
[-- Type: text/x-python, Size: 3127 bytes --]

#! /usr/bin/env python
# Copyright (C) 2011 Sebastian Pipping <sebastian@pipping.org>
# Licensed under GPL v2 or later

# 2011-06-23 20:14 UTC+2


import os
import re
import textwrap


_pattern_arch_generic = re.compile('^class arch_([a-z0-9_.-]+)\\(generic_([a-z0-9_.-]+)\\):')
_pattern_arch_arch = re.compile('^class arch_([a-z0-9_.-]+)\\(arch_([a-z0-9_.-]+)\\):')
_pattern_title = re.compile('"([a-z0-9_.-]+)"[ \\t]*:[ \\t]*arch_([a-z0-9_.-]+),?')

_pattern_arch_genericliases = {
	'armeb':'arm',
	'sheb':'sh',
	'mipsel':'mips',
}


def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_genericrch_id):
	x = _pattern_arch_generic.search(line)
	if x is not None:
		subarch = x.group(1)
		arch = x.group(2)

		# Apply alias grouping
		arch = _pattern_arch_genericliases.get(arch, arch)

		assert(subarch not in subarch_id_to_pattern_arch_genericrch_id)
		subarch_id_to_pattern_arch_genericrch_id[subarch] = arch

		return

	x = _pattern_arch_arch.search(line)
	if x is not None:
		child_subarch = x.group(1)
		parent_subarch = x.group(2)

		assert(child_subarch not in subarch_id_to_pattern_arch_genericrch_id)
		subarch_id_to_pattern_arch_genericrch_id[child_subarch] = subarch_id_to_pattern_arch_genericrch_id[parent_subarch]

		return

	for x in re.finditer(_pattern_title, line):
		subarch_title = x.group(1)
		subarch_id = x.group(2)

		assert(subarch_title not in subarch_title_to_subarch_id)
		subarch_title_to_subarch_id[subarch_title] = subarch_id


def handle_file(fn, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_genericrch_id):
	f = open(fn, 'r')
	for l in f:
		line = l.rstrip()
		handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_genericrch_id)
	f.close()


def dump(subarch_title_to_subarch_id, subarch_id_to_pattern_arch_genericrch_id):
	arch_id_to_subarch_titles = dict()
	for subarch_title, subarch_id in subarch_title_to_subarch_id.items():
		arch_id = subarch_id_to_pattern_arch_genericrch_id.get(subarch_id, subarch_id)

		if arch_id not in arch_id_to_subarch_titles:
			arch_id_to_subarch_titles[arch_id] = set()
		arch_id_to_subarch_titles[arch_id].add(subarch_title)

	# GuideXML version
	print """
<table>
<tr>
<th>Architecture</th>
<th>Sub-architectures</th>
</tr>"""

	for arch_id, subarch_titles in sorted(arch_id_to_subarch_titles.items()):
		print """<tr>
<ti><c>%s</c></ti>
<ti><c>%s</c></ti>
</tr>""" % (arch_id, '\n'.join(textwrap.wrap(' '.join(sorted(subarch_titles)), 60)))

	print """</tr>
</table>
"""

	# Plain text
	for arch_id, subarch_titles in sorted(arch_id_to_subarch_titles.items()):
		print '%-8s [%2d] %s' % (arch_id, len(subarch_titles), ' '.join(sorted(subarch_titles)))


if __name__ == '__main__':
	subarch_title_to_subarch_id = dict()
	subarch_id_to_pattern_arch_genericrch_id = dict()

	for (dirpath, dirnames, filenames) in os.walk('arch'):
		for _fn in filenames:
			if not _fn.endswith('.py'):
				continue

			fn = os.path.join(dirpath, _fn)
			handle_file(fn, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_genericrch_id)

	dump(subarch_title_to_subarch_id, subarch_id_to_pattern_arch_genericrch_id)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-catalyst] Undocumented subarches, e.g. core2
  2011-06-23 18:23 ` Sebastian Pipping
@ 2011-06-24  0:27   ` Sebastian Pipping
  2011-06-24  0:31     ` Peter Stuge
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Pipping @ 2011-06-24  0:27 UTC (permalink / raw
  To: gentoo-catalyst

On 06/23/2011 08:23 PM, Sebastian Pipping wrote:
>  2) its output replace the current table shown at
>     http://www.gentoo.org/proj/en/releng/catalyst/

Done.  On the web after next sync.



Sebastian



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-catalyst] Undocumented subarches, e.g. core2
  2011-06-24  0:27   ` Sebastian Pipping
@ 2011-06-24  0:31     ` Peter Stuge
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stuge @ 2011-06-24  0:31 UTC (permalink / raw
  To: gentoo-catalyst

Sebastian Pipping wrote:
> On 06/23/2011 08:23 PM, Sebastian Pipping wrote:
> >  2) its output replace the current table shown at
> >     http://www.gentoo.org/proj/en/releng/catalyst/
> 
> Done.  On the web after next sync.

Well done! \o/


//Peter



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-24  0:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-22 21:03 [gentoo-catalyst] Undocumented subarches, e.g. core2 Sebastian Pipping
2011-06-22 21:14 ` Peter Stuge
2011-06-23 18:23 ` Sebastian Pipping
2011-06-24  0:27   ` Sebastian Pipping
2011-06-24  0:31     ` Peter Stuge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox