'Set the relative import directory to be this blob\'s location.'

def _set_reldirlib_from_blob(self, blob):

    if (blob is None):
        return
    blob_src = blob.get('src')
    if (blob_src and (blob.get('ilk') == 'blob')):
        reldirpath = dirname(blob_src)
        reldirlib = self.mgr.db.get_lang_lib(self.trg.lang, 'reldirlib', [reldirpath])
        newlibs = self.libs[:]
        if (newlibs[0].name == 'reldirlib'):
            newlibs[0] = reldirlib
        else:
            newlibs.insert(0, reldirlib)
        self.log('imports::    setting    reldirlib    to:    %r', reldirpath)
        self.libs = newlibs
