Changeset 88cb50a in rtems-source-builder


Ignore:
Timestamp:
Mar 6, 2015, 10:19:21 PM (5 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
55a82ac
Parents:
c4c6264
git-author:
Chris Johns <chrisj@…> (03/06/15 22:19:21)
git-committer:
Chris Johns <chrisj@…> (03/06/15 22:24:51)
Message:

Fix removall for Windows and POSIX file systems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/path.py

    rc4c6264 r88cb50a  
    144144        for name in files:
    145145            file = host(os.path.join(root, name))
    146             if not os.access(file, os.W_OK):
     146            if not os.path.islink(file) and not os.access(file, os.W_OK):
    147147                os.chmod(file, stat.S_IWUSR)
    148148            os.unlink(file)
    149149        for name in dirs:
    150150            dir = host(os.path.join(root, name))
    151             if not os.access(dir, os.W_OK):
    152                 os.chmod(dir, stat.S_IWUSR)
    153             os.rmdir(dir)
    154     if not os.access(path, os.W_OK):
     151            if os.path.islink(dir):
     152                os.unlink(dir)
     153            else:
     154                if not os.access(dir, os.W_OK):
     155                    os.chmod(dir, stat.S_IWUSR)
     156                os.rmdir(dir)
     157    if not os.path.islink(path) and not os.access(path, os.W_OK):
    155158        os.chmod(path, stat.S_IWUSR)
    156     os.rmdir(path)
     159    if os.path.islink(path):
     160        os.unlink(path)
     161    else:
     162        os.rmdir(path)
    157163
    158164def expand(name, paths):
Note: See TracChangeset for help on using the changeset viewer.