diff --git a/source-builder/sb/bootstrap.py b/source-builder/sb/bootstrap.py index 9fcd685..f433949 100644 --- a/source-builder/sb/bootstrap.py +++ b/source-builder/sb/bootstrap.py @@ -44,7 +44,7 @@ def _collect(path_, file): def _grep(file, pattern): rege = re.compile(pattern) try: - f = open(file, 'r') + f = open(path.host(file), 'r') matches = [rege.match(l) != None for l in f.readlines()] f.close() except IOError, err: @@ -92,7 +92,7 @@ class autoreconf: bsp_specs = _collect(self.cwd, 'bsp_specs') try: acinclude = path.join(self.cwd, 'acinclude.m4') - b = open(acinclude, 'w') + b = open(path.host(acinclude), 'w') b.write('# RTEMS_CHECK_BSPDIR(RTEMS_BSP_FAMILY) ' + os.linesep) b.write('AC_DEFUN([RTEMS_CHECK_BSPDIR],' + os.linesep) b.write('[' + os.linesep) @@ -121,7 +121,7 @@ class autoreconf: if _grep(makefile, 'stamp-h\.in'): stamp_h = path.join(self.cwd, 'stamp-h.in') try: - t = open(stamp_h, 'w') + t = open(path.host(stamp_h), 'w') t.write('timestamp') t.close() except IOError, err: @@ -168,7 +168,7 @@ class ampolish3: if self.command.exit_code != 0: raise error.general('error: ampolish3: %s' % (' '.join(self.command.cmd))) try: - p = open(self.preinstall, 'w') + p = open(path.host(self.preinstall), 'w') for l in self.command.output: p.write(l) p.close() diff --git a/source-builder/sb/macros.py b/source-builder/sb/macros.py index 1c46ec8..200dabb 100644 --- a/source-builder/sb/macros.py +++ b/source-builder/sb/macros.py @@ -334,14 +334,15 @@ class macros: for n in names: if path.exists(n): try: - mc = open(n, 'r') + mc = open(path.host(n), 'r') macros = self.parse(mc) mc.close() self.files += [n] return except IOError, err: pass - raise error.general('opening macro file: %s' % (path.host(name))) + raise error.general('opening macro file: %s' % \ + (path.host(self.expand(name)))) def get(self, key): if type(key) is not str: diff --git a/source-builder/sb/reports.py b/source-builder/sb/reports.py index abeb17e..9567819 100644 --- a/source-builder/sb/reports.py +++ b/source-builder/sb/reports.py @@ -314,7 +314,7 @@ class report: outfile.close() if name is not None: try: - o = open(name, "w") + o = open(path.host(name), "w") o.write(self.out) o.close() del o