Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
5acbb696
Commit
5acbb696
authored
Jul 20, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(dev) change order of directories to crawl, prefix overlapping filenames
parent
e864e859
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
crawl_legacy_deps.py
scripts/development/crawl_legacy_deps.py
+3
-2
No files found.
scripts/development/crawl_legacy_deps.py
View file @
5acbb696
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment