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

Method rm

v2/test/BoostBuild.py:374–400  ·  view source on GitHub ↗
(self, names)

Source from the content-addressed store, hash-verified

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

Callers 15

test_basicFunction · 0.95
test_basicFunction · 0.95
test_exitFunction · 0.95
inline.pyFile · 0.80
stage.pyFile · 0.80
rescan_header.pyFile · 0.80
prebuilt.pyFile · 0.80
test_oneFunction · 0.80
build_dir.pyFile · 0.80

Calls 3

native_file_nameMethod · 0.95
glob_fileMethod · 0.95
unlinkMethod · 0.80

Tested by 5

test_basicFunction · 0.76
test_basicFunction · 0.76
test_exitFunction · 0.76
test_oneFunction · 0.64