Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kernel-bitbake-parser
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kernel-bitbake-parser
Commits
0aad7226
Commit
0aad7226
authored
Apr 22, 2015
by
YuriNenakhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatic project file modifying added
parent
7106d817
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
kbparse.py
kbparse.py
+29
-10
No files found.
kbparse.py
View file @
0aad7226
...
@@ -13,6 +13,9 @@ wrk_link1 = proj_dir+'/linux/'
...
@@ -13,6 +13,9 @@ wrk_link1 = proj_dir+'/linux/'
abs_path2
=
re
.
compile
(
'/home.*tmp/sysroots/'
)
abs_path2
=
re
.
compile
(
'/home.*tmp/sysroots/'
)
wrk_link2
=
proj_dir
+
'/sysroots/'
wrk_link2
=
proj_dir
+
'/sysroots/'
is_include_xml
=
re
.
compile
(
"(?P<ib>
\
<option[^
\
>]*valueType=
\"
includePath
\"
\
>).*?(?P<ie>
\
</option
\
>)"
,
re
.
M
|
re
.
S
)
is_define_xml
=
re
.
compile
(
"(?P<db>
\
<option[^
\
>]*valueType=
\"
definedSymbols
\"
\
>).*?(?P<de>
\
</option
\
>)"
,
re
.
M
|
re
.
S
)
is_src_xml
=
re
.
compile
(
"(?P<sb>
\
<sourceEntries
\
>).*?(?P<se>
\
</sourceEntries
\
>)"
,
re
.
M
|
re
.
S
)
is_inc_start
=
re
.
compile
(
'^
\
#include
\
<
\
.
\
.
\
.>
\
search
\
starts
\
here
\
:$'
)
is_inc_start
=
re
.
compile
(
'^
\
#include
\
<
\
.
\
.
\
.>
\
search
\
starts
\
here
\
:$'
)
is_inc_end
=
re
.
compile
(
'^End
\
of
\
search
\
list
\
.$'
)
is_inc_end
=
re
.
compile
(
'^End
\
of
\
search
\
list
\
.$'
)
is_inc_abspath
=
re
.
compile
(
'^
\
s
\
/[^
\
s]*$'
)
is_inc_abspath
=
re
.
compile
(
'^
\
s
\
/[^
\
s]*$'
)
...
@@ -98,12 +101,15 @@ for line in sys.stdin:
...
@@ -98,12 +101,15 @@ for line in sys.stdin:
if
i
in
srcdir
:
if
i
in
srcdir
:
all_paths
.
remove
(
i
)
all_paths
.
remove
(
i
)
xml_includes
=
""
print
(
" ╔════════════════════╗
\n
║ include paths ║
\n
╚════════════════════╝"
)
print
(
" ╔════════════════════╗
\n
║ include paths ║
\n
╚════════════════════╝"
)
for
i
in
inc_paths
:
for
i
in
inc_paths
:
print
(
"<listOptionValue builtIn=
\"
false
\"
value=
\"
"${workspace_loc:"
+
i
+
"}"
\"
/>"
)
xml_includes
+=
"<listOptionValue builtIn=
\"
false
\"
value=
\"
"${workspace_loc:"
+
i
+
"}"
\"
/>
\n
"
xml_includes
=
xml_includes
[:
-
1
]
print
(
xml_includes
)
print
(
" ╔════════════════════╗
\n
║ define symbols ║
\n
╚════════════════════╝"
)
print
(
" ╔════════════════════╗
\n
║ define symbols ║
\n
╚════════════════════╝"
)
xml_defs
=
""
xml_defs
=
"
<listOptionValue builtIn=
\"
false
\"
value=
\"
__GNUC__=4
\"
/>
\n
"
for
i
in
defsyms
:
for
i
in
defsyms
:
i
=
i
.
split
(
"="
)
i
=
i
.
split
(
"="
)
xml_defs
+=
"<listOptionValue builtIn=
\"
false
\"
value=
\"
"
+
i
[
0
]
+
"="
xml_defs
+=
"<listOptionValue builtIn=
\"
false
\"
value=
\"
"
+
i
[
0
]
+
"="
...
@@ -134,3 +140,16 @@ print(xml_src)
...
@@ -134,3 +140,16 @@ print(xml_src)
print
(
" ╔════════════════════╗
\n
║ extra includes ║
\n
╚════════════════════╝"
)
print
(
" ╔════════════════════╗
\n
║ extra includes ║
\n
╚════════════════════╝"
)
for
i
in
extraincs
:
for
i
in
extraincs
:
print
(
re
.
sub
(
leading_project_name
,
""
,
abs2wrklink
(
i
)))
print
(
re
.
sub
(
leading_project_name
,
""
,
abs2wrklink
(
i
)))
proj_data
=
""
with
open
(
".cproject"
,
"r"
)
as
old_proj_file
:
proj_data_tmp
=
old_proj_file
.
readlines
()
for
i
in
proj_data_tmp
:
proj_data
=
proj_data
+
i
with
open
(
".cproject_BAK"
,
"w"
)
as
new_proj_file
:
new_proj_file
.
write
(
proj_data
)
proj_data
=
re
.
sub
(
is_include_xml
,
"
\
g<ib>
\n
"
+
xml_includes
+
"
\n
\
g<ie>"
,
proj_data
)
proj_data
=
re
.
sub
(
is_define_xml
,
"
\
g<db>
\n
"
+
xml_defs
+
"
\n
\
g<de>"
,
proj_data
)
proj_data
=
re
.
sub
(
is_src_xml
,
"
\
g<sb>
\n
"
+
xml_src
+
"
\n
\
g<se>"
,
proj_data
)
with
open
(
".cproject"
,
"w"
)
as
new_proj_file
:
new_proj_file
.
write
(
proj_data
)
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