Commit 5acbb696 authored by Ad Schellevis's avatar Ad Schellevis

(dev) change order of directories to crawl, prefix overlapping filenames

parent e864e859
...@@ -48,8 +48,9 @@ class DependancyCrawler(object): ...@@ -48,8 +48,9 @@ class DependancyCrawler(object):
def fetch_php(self, src_filename): def fetch_php(self, src_filename):
# create a new list for this base filename # create a new list for this base filename
# to avoid too much complexity, we will assume that filenames are unique.
base_filename = os.path.basename(src_filename) base_filename = os.path.basename(src_filename)
if base_filename in self._all_dependancies:
base_filename = '%s__%s' % (src_filename.split('/')[-2], base_filename)
self._all_dependancies[base_filename] = [] self._all_dependancies[base_filename] = []
source_data = open(src_filename).read() source_data = open(src_filename).read()
...@@ -74,7 +75,7 @@ class DependancyCrawler(object): ...@@ -74,7 +75,7 @@ class DependancyCrawler(object):
self._all_dependancies[base_filename].append(dep_filename) self._all_dependancies[base_filename].append(dep_filename)
data = data[strlen+startpos:] data = data[strlen+startpos:]
def crawl(self, root, analyse_dirs=('www', 'etc', 'captiveportal', 'sbin')): def crawl(self, root, analyse_dirs=('etc','www', 'captiveportal', 'sbin')):
""" Crawl through legacy code """ Crawl through legacy code
:param root: start crawling at :param root: start crawling at
:param analyse_dirs: only analyse these directories :param analyse_dirs: only analyse these directories
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment