Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hdlmake
Manage
Activity
Members
Labels
Plan
Issues
20
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Hdlmake
Commits
3b68b448
Commit
3b68b448
authored
13 years ago
by
Paweł Szostek
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug - it works, but I don't know why..
parent
07a36801
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
hdlmake
+0
-0
0 additions, 0 deletions
hdlmake
src/fetch.py
+21
-123
21 additions, 123 deletions
src/fetch.py
src/hdlmake_kernel.py
+2
-1
2 additions, 1 deletion
src/hdlmake_kernel.py
src/module.py
+1
-1
1 addition, 1 deletion
src/module.py
with
24 additions
and
125 deletions
hdlmake
+
0
−
0
View file @
3b68b448
No preview for this file type
This diff is collapsed.
Click to expand it.
src/fetch.py
+
21
−
123
View file @
3b68b448
...
@@ -4,122 +4,6 @@ import os
...
@@ -4,122 +4,6 @@ import os
import
msg
as
p
import
msg
as
p
import
path
import
path
class
ModuleFetcher
:
def
__init__
(
self
):
pass
def
fetch_single_module
(
self
,
module
):
new_modules
=
[]
p
.
vprint
(
"
Fetching manifest:
"
+
str
(
module
.
manifest
))
if
module
.
source
==
"
local
"
:
p
.
vprint
(
"
ModPath:
"
+
module
.
path
);
if
module
.
source
==
"
svn
"
:
p
.
vprint
(
"
[svn] Fetching to
"
+
module
.
fetchto
)
self
.
__fetch_from_svn
(
module
)
if
module
.
source
==
"
git
"
:
p
.
vprint
(
"
[git] Fetching to
"
+
module
.
fetchto
)
self
.
__fetch_from_git
(
module
)
module
.
parse_manifest
()
if
module
.
root_module
!=
None
:
p
.
vprint
(
"
Encountered root manifest:
"
+
str
(
root_module
))
new_modules
.
append
(
module
.
root_module
)
new_modules
.
extend
(
module
.
local
)
new_modules
.
extend
(
module
.
svn
)
new_modules
.
extend
(
module
.
git
)
return
new_modules
def
__fetch_from_svn
(
self
,
module
):
fetchto
=
module
.
fetchto
if
not
os
.
path
.
exists
(
fetchto
):
os
.
mkdir
(
fetchto
)
cur_dir
=
os
.
getcwd
()
os
.
chdir
(
fetchto
)
url
,
rev
=
self
.
__parse_repo_url
(
module
.
url
)
basename
=
path
.
url_basename
(
url
)
cmd
=
"
svn checkout {0}
"
+
basename
if
rev
:
cmd
=
cmd
.
format
(
url
+
'
@
'
+
rev
)
else
:
cmd
=
cmd
.
format
(
url
)
rval
=
True
p
.
vprint
(
cmd
)
if
os
.
system
(
cmd
)
!=
0
:
rval
=
False
os
.
chdir
(
cur_dir
)
module
.
isfetched
=
True
module
.
revision
=
rev
module
.
path
=
os
.
path
.
join
(
fetchto
,
basename
)
return
rval
def
__fetch_from_git
(
self
,
module
):
fetchto
=
module
.
fetchto
if
not
os
.
path
.
exists
(
fetchto
):
os
.
mkdir
(
fetchto
)
cur_dir
=
os
.
getcwd
()
os
.
chdir
(
fetchto
)
url
,
rev
=
self
.
__parse_repo_url
(
module
.
url
)
basename
=
path
.
url_basename
(
url
)
if
basename
.
endswith
(
"
.git
"
):
basename
=
basename
[:
-
4
]
#remove trailing .git
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
fetchto
,
basename
)):
update_only
=
False
else
:
update_only
=
True
if
update_only
:
cmd
=
"
git --git-dir=
"
+
basename
+
"
/.git pull
"
else
:
cmd
=
"
git clone
"
+
url
rval
=
True
p
.
vprint
(
cmd
)
if
os
.
system
(
cmd
)
!=
0
:
rval
=
False
if
rev
and
rval
:
os
.
chdir
(
basename
)
cmd
=
"
git checkout
"
+
rev
p
.
vprint
(
cmd
)
if
os
.
system
(
cmd
)
!=
0
:
rval
=
False
os
.
chdir
(
cur_dir
)
module
.
isfetched
=
True
module
.
revision
=
rev
module
.
path
=
os
.
path
.
join
(
fetchto
,
basename
)
return
rval
def
__parse_repo_url
(
self
,
url
)
:
"""
Check if link to a repo seems to be correct. Filter revision number
"""
import
re
url_pat
=
re
.
compile
(
"
[
\t
]*([^
\t
]+)[
\t
]*(@[
\t
]*(.+))?[
\t
]*
"
)
url_match
=
re
.
match
(
url_pat
,
url
)
if
url_match
==
None
:
p
.
echo
(
"
Not a correct repo url: {0}. Skipping
"
.
format
(
url
))
if
url_match
.
group
(
3
)
!=
None
:
#there is a revision given
ret
=
(
url_match
.
group
(
1
),
url_match
.
group
(
3
))
else
:
ret
=
(
url_match
.
group
(
1
),
None
)
return
ret
class
ModulePool
(
list
):
class
ModulePool
(
list
):
class
ModuleFetcher
:
class
ModuleFetcher
:
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -222,6 +106,22 @@ class ModulePool(list):
...
@@ -222,6 +106,22 @@ class ModulePool(list):
module
.
revision
=
rev
module
.
revision
=
rev
module
.
path
=
os
.
path
.
join
(
fetchto
,
basename
)
module
.
path
=
os
.
path
.
join
(
fetchto
,
basename
)
return
rval
return
rval
def
__parse_repo_url
(
self
,
url
)
:
"""
Check if link to a repo seems to be correct. Filter revision number
"""
import
re
url_pat
=
re
.
compile
(
"
[
\t
]*([^
\t
]+)[
\t
]*(@[
\t
]*(.+))?[
\t
]*
"
)
url_match
=
re
.
match
(
url_pat
,
url
)
if
url_match
==
None
:
p
.
echo
(
"
Not a correct repo url: {0}. Skipping
"
.
format
(
url
))
if
url_match
.
group
(
3
)
!=
None
:
#there is a revision given
ret
=
(
url_match
.
group
(
1
),
url_match
.
group
(
3
))
else
:
ret
=
(
url_match
.
group
(
1
),
None
)
return
ret
#end class ModuleFetcher
#end class ModuleFetcher
def
__parse_repo_url
(
self
,
url
)
:
def
__parse_repo_url
(
self
,
url
)
:
"""
"""
...
@@ -270,20 +170,18 @@ class ModulePool(list):
...
@@ -270,20 +170,18 @@ class ModulePool(list):
raise
RuntimeError
(
"
Expecting a Module instance
"
)
raise
RuntimeError
(
"
Expecting a Module instance
"
)
if
self
.
__contains
(
new_module
):
if
self
.
__contains
(
new_module
):
return
return
for
mod
in
new_module
.
submodules
():
self
.
add
(
mod
)
if
new_module
.
isfetched
:
if
new_module
.
isfetched
:
self
.
modules
.
append
(
new_module
)
for
mod
in
new_module
.
submodules
():
self
.
add
(
mod
)
self
.
modules
.
append
(
new_module
)
return
True
return
True
def
fetch_all
(
self
):
def
fetch_all
(
self
):
fetcher
=
ModuleFetcher
()
fetcher
=
self
.
ModuleFetcher
()
fetch_queue
=
[
self
.
top_
module
]
fetch_queue
=
[
mod
for
mod
in
self
.
module
s
if
not
mod
.
isfetched
]
while
len
(
fetch_queue
)
>
0
:
while
len
(
fetch_queue
)
>
0
:
cur_mod
=
fetch_queue
.
pop
()
cur_mod
=
fetch_queue
.
pop
()
self
.
add
(
cur_mod
)
new_modules
=
fetcher
.
fetch_single_module
(
cur_mod
)
new_modules
=
fetcher
.
fetch_single_module
(
cur_mod
)
for
mod
in
new_modules
:
for
mod
in
new_modules
:
...
...
This diff is collapsed.
Click to expand it.
src/hdlmake_kernel.py
+
2
−
1
View file @
3b68b448
...
@@ -21,7 +21,8 @@ class HdlmakeKernel(object):
...
@@ -21,7 +21,8 @@ class HdlmakeKernel(object):
if
tm
.
action
==
"
simulation
"
:
if
tm
.
action
==
"
simulation
"
:
self
.
generate_modelsim_makefile
()
self
.
generate_modelsim_makefile
()
elif
tm
.
action
==
"
synthesis
"
:
elif
tm
.
action
==
"
synthesis
"
:
self
.
fetch
()
if
not
self
.
modules_pool
.
is_everything_fetched
():
self
.
fetch
()
self
.
generate_ise_project
()
self
.
generate_ise_project
()
self
.
generate_ise_makefile
()
self
.
generate_ise_makefile
()
self
.
generate_remote_synthesis_makefile
()
self
.
generate_remote_synthesis_makefile
()
...
...
This diff is collapsed.
Click to expand it.
src/module.py
+
1
−
1
View file @
3b68b448
...
@@ -271,7 +271,7 @@ class Module(object):
...
@@ -271,7 +271,7 @@ class Module(object):
def
is_fetched_recursively
(
self
):
def
is_fetched_recursively
(
self
):
if
not
self
.
isfetched
:
if
not
self
.
isfetched
:
return
False
return
False
for
mod
in
self
.
local
+
self
.
svn
+
self
.
git
:
for
mod
in
self
.
submodules
()
:
if
mod
.
is_fetched_recursively
()
==
False
:
if
mod
.
is_fetched_recursively
()
==
False
:
return
False
return
False
return
True
return
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment