[Notes] [Git][BuildStream/buildstream][juerg/symlinks] WIP



Title: GitLab

Jürg Billeter pushed to branch juerg/symlinks at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • buildstream/utils.py
    ... ... @@ -780,14 +780,14 @@ def _copy_directories(srcdir, destdir, target):
    780 780
     #
    
    781 781
     # Symlink components are allowed in `root`.
    
    782 782
     #
    
    783
    -def _ensure_real_directory(root, path):
    
    783
    +def _ensure_real_directory(root, path, full):
    
    784 784
         destpath = root
    
    785 785
         for name in os.path.split(path):
    
    786 786
             destpath = os.path.join(destpath, name)
    
    787 787
             try:
    
    788 788
                 deststat = os.lstat(destpath)
    
    789 789
                 if not stat.S_ISDIR(deststat.st_mode):
    
    790
    -                raise UtilError('Destination is not a directory {} for {}'.format(destpath, path))
    
    790
    +                raise UtilError('Destination is not a directory {} for {}'.format(destpath[len(root):], full))
    
    791 791
             except FileNotFoundError:
    
    792 792
                 os.makedirs(destpath)
    
    793 793
     
    
    ... ... @@ -830,7 +830,7 @@ def _process_list(srcdir, destdir, filelist, actionfunc, result,
    830 830
     
    
    831 831
             # Ensure that the parent of the destination path exists without symlink
    
    832 832
             # components.
    
    833
    -        _ensure_real_directory(destdir, os.path.dirname(path))
    
    833
    +        _ensure_real_directory(destdir, os.path.dirname(path), path)
    
    834 834
     
    
    835 835
             # Add to the results the list of files written
    
    836 836
             if report_written:
    
    ... ... @@ -856,7 +856,7 @@ def _process_list(srcdir, destdir, filelist, actionfunc, result,
    856 856
     
    
    857 857
             if stat.S_ISDIR(mode):
    
    858 858
                 # Ensure directory exists in destination
    
    859
    -            _ensure_real_directory(os.path.dirname(destpath), os.path.basename(path))
    
    859
    +            _ensure_real_directory(os.path.dirname(destpath), os.path.basename(path), 'none')
    
    860 860
                 permissions.append((destpath, os.stat(srcpath).st_mode))
    
    861 861
     
    
    862 862
             elif stat.S_ISLNK(mode):
    



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