MCPcopy Create free account
hub / github.com/boostorg/build / rm

Method rm

test/BoostBuild.py:387–413  ·  view source on GitHub ↗
(self, names)

Source from the content-addressed store, hash-verified

385 os.utime(path, None)
386
387 def rm(self, names):
388 if not type(names) == list:
389 names = [names]
390
391 if names == ["."]:
392 # If we are deleting the entire workspace, there is no need to wait
393 # for a clock tick.
394 self.last_build_timestamp = 0
395
396 # Avoid attempts to remove the current directory.
397 os.chdir(self.original_workdir)
398 for name in names:
399 n = glob.glob(self.native_file_name(name))
400 if n: n = n[0]
401 if not n:
402 n = self.glob_file(name.replace("$toolset", self.toolset + "*")
403 )
404 if n:
405 if os.path.isdir(n):
406 shutil.rmtree(n, ignore_errors=False)
407 else:
408 os.unlink(n)
409
410 # Create working dir root again in case we removed it.
411 if not os.path.exists(self.workdir):
412 os.mkdir(self.workdir)
413 os.chdir(self.workdir)
414
415 def expand_toolset(self, name):
416 """

Callers 15

test_basicFunction · 0.95
test_toolsetFunction · 0.95
test_basicFunction · 0.95
test_project_configFunction · 0.95
test_exitFunction · 0.95
inline.pyFile · 0.80
stage.pyFile · 0.80
rescan_header.pyFile · 0.80
prebuilt.pyFile · 0.80

Calls 3

native_file_nameMethod · 0.95
glob_fileMethod · 0.95
unlinkMethod · 0.80

Tested by 8

test_basicFunction · 0.76
test_toolsetFunction · 0.76
test_basicFunction · 0.76
test_project_configFunction · 0.76
test_exitFunction · 0.76
test_glob_archiveFunction · 0.64
test_oneFunction · 0.64