Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
75dbfdde
Commit
75dbfdde
authored
Oct 29, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove undocumented and inconsistent behaviour of gitsm.
parent
86d08faf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
71 deletions
+0
-71
git.py
hdlmake/fetch/git.py
+0
-53
module.py
hdlmake/module/module.py
+0
-18
No files found.
hdlmake/fetch/git.py
View file @
75dbfdde
...
...
@@ -90,56 +90,3 @@ class Git(Fetcher):
class
GitSM
(
Git
):
def
__init__
(
self
):
self
.
submodule
=
True
def
get_git_toplevel
(
module
):
"""Get the top level for the Git repository"""
cur_dir
=
os
.
getcwd
()
try
:
os
.
chdir
(
path_utils
.
rel2abs
(
module
.
path
))
if
not
os
.
path
.
exists
(
".gitmodules"
):
return
None
return
shell
.
run
(
"git rev-parse --show-toplevel"
)
finally
:
os
.
chdir
(
cur_dir
)
def
get_git_submodules
(
module
):
"""Get a dictionary containing the git submodules
that are listed in the module's path"""
submodule_dir
=
path_utils
.
rel2abs
(
module
.
path
)
if
module
.
isfetched
==
False
:
logging
.
debug
(
"Cannot check submodules, module
%
s is not fetched"
,
submodule_dir
)
return
{}
logging
.
debug
(
"Checking git submodules in
%
s"
,
submodule_dir
)
cur_dir
=
os
.
getcwd
()
try
:
os
.
chdir
(
submodule_dir
)
if
not
os
.
path
.
exists
(
".gitmodules"
):
return
{}
config_submodules
=
{}
config_content
=
Popen
(
"git config -f .gitmodules --list"
,
stdout
=
PIPE
,
stdin
=
PIPE
,
close_fds
=
not
shell
.
check_windows_tools
(),
shell
=
True
)
config_lines
=
[
line
.
strip
()
.
decode
(
'utf-8'
)
for
line
in
config_content
.
stdout
.
readlines
()]
config_submodule_lines
=
[
line
for
line
in
config_lines
if
line
.
startswith
(
"submodule"
)]
for
line
in
config_submodule_lines
:
line_split
=
line
.
split
(
"="
)
lhs
=
line_split
[
0
]
rhs
=
line_split
[
1
]
lhs_split
=
lhs
.
split
(
"."
)
module_name
=
'.'
.
join
(
lhs_split
[
1
:
-
1
])
if
module_name
not
in
config_submodules
:
config_submodules
[
module_name
]
=
{}
config_submodules
[
module_name
][
lhs_split
[
-
1
]]
=
rhs
if
len
(
list
(
config_submodules
))
>
0
:
logging
.
info
(
"Found git submodules in
%
s:
%
s"
,
module
.
path
,
str
(
config_submodules
))
finally
:
os
.
chdir
(
cur_dir
)
return
config_submodules
hdlmake/module/module.py
View file @
75dbfdde
...
...
@@ -157,7 +157,6 @@ class Module(object):
self
.
_process_manifest_files
()
self
.
_process_manifest_modules
()
self
.
_process_manifest_makefiles
()
self
.
_process_git_submodules
()
def
_process_manifest_universal
(
self
):
"""Method processing the universal manifest directives;
...
...
@@ -260,23 +259,6 @@ class Module(object):
parent
=
self
,
url
=
path
,
source
=
m
,
fetchto
=
fetchto
))
self
.
modules
[
m
]
=
mods
def
_process_git_submodules
(
self
):
"""Get the submodules if found in the Manifest path"""
if
not
self
.
source
==
'gitsm'
:
return
git_submodule_dict
=
git
.
get_git_submodules
(
self
)
git_toplevel
=
git
.
get_git_toplevel
(
self
)
for
submodule_key
in
git_submodule_dict
.
keys
():
url
=
git_submodule_dict
[
submodule_key
][
"url"
]
path
=
git_submodule_dict
[
submodule_key
][
"path"
]
path
=
os
.
path
.
join
(
git_toplevel
,
path
)
fetchto
=
os
.
path
.
sep
.
join
(
path
.
split
(
os
.
path
.
sep
)[:
-
1
])
self
.
modules
[
'git'
]
.
append
(
self
.
action
.
new_module
(
parent
=
self
,
url
=
url
,
fetchto
=
fetchto
,
source
=
'git'
))
def
_process_manifest_makefiles
(
self
):
"""Get the extra makefiles defined in the HDLMake module"""
# Included Makefiles
...
...
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