[csw-devel] SF.net SVN: gar:[20424] csw/mgar/gar/v2/lib/python
chninkel at users.sourceforge.net
chninkel at users.sourceforge.net
Mon Mar 11 17:54:52 CET 2013
Revision: 20424
http://gar.svn.sourceforge.net/gar/?rev=20424&view=rev
Author: chninkel
Date: 2013-03-11 16:54:52 +0000 (Mon, 11 Mar 2013)
Log Message:
-----------
gar/v2: first try the elf file parser with hachoir parser since it's what we are interested in
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/inspective_package.py
csw/mgar/gar/v2/lib/python/inspective_package_test.py
Modified: csw/mgar/gar/v2/lib/python/inspective_package.py
===================================================================
--- csw/mgar/gar/v2/lib/python/inspective_package.py 2013-03-11 16:06:01 UTC (rev 20423)
+++ csw/mgar/gar/v2/lib/python/inspective_package.py 2013-03-11 16:54:52 UTC (rev 20424)
@@ -61,7 +61,8 @@
else:
raise package.PackageError(msg)
if sharedlib_utils.IsBinary(file_info, check_consistency=False):
- parser = hachoir_parser.createParser(full_path)
+ parser_tag = ('class', hachoir_parser.program.elf.ElfFile)
+ parser = hachoir_parser.createParser(full_path, tags=[parser_tag])
if not parser:
logging.warning("Can't parse file %s", file_path)
else:
Modified: csw/mgar/gar/v2/lib/python/inspective_package_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/inspective_package_test.py 2013-03-11 16:06:01 UTC (rev 20423)
+++ csw/mgar/gar/v2/lib/python/inspective_package_test.py 2013-03-11 16:54:52 UTC (rev 20424)
@@ -140,8 +140,10 @@
self.mox.StubOutWithMock(hachoir_parser, 'createParser',
use_mock_anything=True)
hachoir_parser_mock = self.mox.CreateMockAnything()
+ parser_tag = ('class', hachoir_parser.program.elf.ElfFile)
hachoir_parser.createParser(
- u'/fake/path/CSWfoo/root/foo-file').AndReturn(hachoir_parser_mock)
+ u'/fake/path/CSWfoo/root/foo-file',
+ tags = [parser_tag]).AndReturn(hachoir_parser_mock)
self.mox.StubOutWithMock(os, 'access')
os.access(u'/fake/path/CSWfoo/root/foo-file', os.R_OK).AndReturn(True)
machine_mock = self.mox.CreateMockAnything()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list