| 374 | os.utime(path, None) |
| 375 | |
| 376 | def rm(self, names): |
| 377 | if not type(names) == types.ListType: |
| 378 | names = [names] |
| 379 | |
| 380 | if names == ["."]: |
| 381 | # If we are deleting the entire workspace, there is no need to wait |
| 382 | # for a clock tick. |
| 383 | self.last_build_timestamp = 0 |
| 384 | |
| 385 | # Avoid attempts to remove the current directory. |
| 386 | os.chdir(self.original_workdir) |
| 387 | for name in names: |
| 388 | n = glob.glob(self.native_file_name(name)) |
| 389 | if n: n = n[0] |
| 390 | if not n: |
| 391 | n = self.glob_file(name.replace("$toolset", self.toolset + "*") |
| 392 | ) |
| 393 | if n: |
| 394 | if os.path.isdir(n): |
| 395 | shutil.rmtree(n, ignore_errors=False) |
| 396 | else: |
| 397 | os.unlink(n) |
| 398 | |
| 399 | # Create working dir root again in case we removed it. |
| 400 | if not os.path.exists(self.workdir): |
| 401 | os.mkdir(self.workdir) |
| 402 | os.chdir(self.workdir) |
| 403 | |
| 404 | def expand_toolset(self, name): |
| 405 | """ |