[Notes] [Git][BuildStream/buildstream][master] 2 commits: element.py: Use _force_rmtree instead of custom code.



Title: GitLab

Jim MacArthur pushed to branch master at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • buildstream/element.py
    ... ... @@ -1410,16 +1410,9 @@ class Element(Plugin):
    1410 1410
     
    
    1411 1411
                 finally:
    
    1412 1412
                     # Staging may produce directories with less than 'rwx' permissions
    
    1413
    -                # for the owner, which will break tempfile, so we need to use chmod
    
    1414
    -                # occasionally.
    
    1415
    -                def make_dir_writable(fn, path, excinfo):
    
    1416
    -                    os.chmod(os.path.dirname(path), 0o777)
    
    1417
    -                    if os.path.isdir(path):
    
    1418
    -                        os.rmdir(path)
    
    1419
    -                    else:
    
    1420
    -                        os.remove(path)
    
    1421
    -                shutil.rmtree(temp_staging_directory, onerror=make_dir_writable)
    
    1422
    -
    
    1413
    +                # for the owner, which breaks tempfile. _force_rmtree will deal
    
    1414
    +                # with these.
    
    1415
    +                utils._force_rmtree(temp_staging_directory)
    
    1423 1416
             # Ensure deterministic mtime of sources at build time
    
    1424 1417
             vdirectory.set_deterministic_mtime()
    
    1425 1418
             # Ensure deterministic owners of sources at build time
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]