6,566
edits
(→All subsystems: Added an example for hunting down subsystem dependencies.) |
(→Script: Newest version of the script.) |
||
Line 127: | Line 127: | ||
ctor = "\<%s\>::\<%s\>[ \(]" % (subsystem.name, subsystem.name) | ctor = "\<%s\>::\<%s\>[ \(]" % (subsystem.name, subsystem.name) | ||
dtor = "\<%s\>::\~\<%s\>[ \(]" % (subsystem.name, subsystem.name) | dtor = "\<%s\>::\~\<%s\>[ \(]" % (subsystem.name, subsystem.name) | ||
grep_ctor = 'grep -rI "%s\ | grep_ctor = 'grep -rI "%s\|%s"' % (ctor, dtor) | ||
# The grep command for any function implementation. | # The grep command for any function implementation. | ||
Line 136: | Line 136: | ||
# The probable implementation file name. | # The probable implementation file name. | ||
file_name = subsystem.declaration_file[:-3] + "cxx" | file_name = subsystem.declaration_file[:-3] + "cxx" | ||
full_path = file_name | |||
if not subsystem.root_path: | if not subsystem.root_path: | ||
full_path = path + sep + file_name | |||
if access( | if access(full_path, F_OK): | ||
# The Unix grep commands to run. | # The Unix grep commands to run. | ||
cmds = [ | cmds = [ | ||
'%s %s' % (grep_ctor, | '%s %s' % (grep_ctor, full_path), | ||
'%s %s | '%s %s | grep -v "return"' % (grep_any, full_path) | ||
] | ] | ||
Line 150: | Line 151: | ||
lines = pipe.stdout.readlines() | lines = pipe.stdout.readlines() | ||
if len(lines): | if len(lines): | ||
subsystem.add_implementation_file(file_name) | if self.output_full_path: | ||
subsystem.add_implementation_file(full_path) | |||
else: | |||
subsystem.add_implementation_file(file_name) | |||
break | break | ||
Line 158: | Line 162: | ||
cmds = [ | cmds = [ | ||
'cd %s; %s' % (path, grep_ctor), | 'cd %s; %s' % (path, grep_ctor), | ||
'cd %s; %s | 'cd %s; %s | grep -v "return"' % (path, grep_any) | ||
] | ] | ||
Line 307: | Line 311: | ||
# The Unix grep command to run. | # The Unix grep command to run. | ||
cmd = 'cd %s; grep -rI %s "public \<%s\>" | cmd = 'cd %s; grep -rI %s "public \<%s\>" | grep -v "%s::"' % (path, self.grep_exclude_dir, base_name, base_name) | ||
pipe = Popen(cmd, shell=True, stdout=PIPE) | pipe = Popen(cmd, shell=True, stdout=PIPE) | ||
Line 671: | Line 675: | ||
"""Set up the object. | """Set up the object. | ||
@keyword implementation_file: The | @keyword implementation_file: The path of the file containing the subsystem implementation. | ||
@type implementation_file: str or None | @type implementation_file: str or None | ||
""" | """ |