Changeset 255e032 in rtems-source-builder


Ignore:
Timestamp:
Apr 15, 2013, 1:15:01 AM (6 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
ff91af2
Parents:
c95c245
Message:

PR 2115 - Fix checking when the path does not fully exist.

Location:
source-builder/sb
Files:
2 edited

Legend:

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

    rc95c245 r255e032  
    262262                self.defaults.load(m)
    263263        # Check the prefix permission
    264         if not self.no_install() and not path.iswritable(self.defaults['_prefix']):
     264        if not self.no_install() and not path.ispathwritable(self.defaults['_prefix']):
    265265            raise error.general('prefix is not writable: %s' % (path.host(self.defaults['_prefix'])))
    266266
  • source-builder/sb/path.py

    rc95c245 r255e032  
    9393    return os.access(host(path), os.W_OK)
    9494
     95def ispathwritable(path):
     96    path = host(path)
     97    while len(path) != 0:
     98        if os.path.exists(path):
     99            return iswritable(path)
     100        path = os.path.dirname(path)
     101    return False
     102
    95103def mkdir(path):
    96104    path = host(path)
Note: See TracChangeset for help on using the changeset viewer.