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
4
Merge Requests
4
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
cae14d15
Commit
cae14d15
authored
Jun 14, 2017
by
Javier D. Garcia-Lasheras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix URL and version parsing in the SVN fetcher
parent
68c1b82f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
6 deletions
+24
-6
svn.py
hdlmake/fetch/svn.py
+3
-3
core.py
hdlmake/module/core.py
+6
-2
path.py
hdlmake/util/path.py
+15
-1
No files found.
hdlmake/fetch/svn.py
View file @
cae14d15
...
@@ -43,9 +43,9 @@ class Svn(Fetcher):
...
@@ -43,9 +43,9 @@ class Svn(Fetcher):
os
.
mkdir
(
fetchto
)
os
.
mkdir
(
fetchto
)
basename
=
path_utils
.
svn_basename
(
module
.
url
)
basename
=
path_utils
.
svn_basename
(
module
.
url
)
mod_path
=
os
.
path
.
join
(
fetchto
,
basename
)
mod_path
=
os
.
path
.
join
(
fetchto
,
basename
)
cmd
=
"cd {0} && svn checkout {1} "
+
module
.
basename
()
cmd
=
"cd {0} && svn checkout {1} "
+
basename
if
module
.
revision
:
if
module
.
revision
:
cmd
=
cmd
.
format
(
fetchto
,
module
.
url
+
'@'
+
module
.
revision
)
cmd
=
cmd
.
format
(
fetchto
,
module
.
url
+
'@'
+
module
.
revision
)
else
:
else
:
cmd
=
cmd
.
format
(
fetchto
,
module
.
url
)
cmd
=
cmd
.
format
(
fetchto
,
module
.
url
)
success
=
True
success
=
True
...
@@ -54,7 +54,7 @@ class Svn(Fetcher):
...
@@ -54,7 +54,7 @@ class Svn(Fetcher):
if
os
.
system
(
cmd
)
!=
0
:
if
os
.
system
(
cmd
)
!=
0
:
success
=
False
success
=
False
module
.
isfetched
=
True
module
.
isfetched
=
True
module
.
path
=
os
.
path
.
join
(
fetchto
,
module
.
basename
())
module
.
path
=
mod_path
return
success
return
success
@
staticmethod
@
staticmethod
...
...
hdlmake/module/core.py
View file @
cae14d15
...
@@ -50,8 +50,12 @@ class ModuleConfig(object):
...
@@ -50,8 +50,12 @@ class ModuleConfig(object):
self
.
parent
=
parent
self
.
parent
=
parent
if
self
.
source
!=
fetch
.
LOCAL
:
if
self
.
source
!=
fetch
.
LOCAL
:
self
.
url
,
self
.
branch
,
self
.
revision
=
\
if
self
.
source
==
fetch
.
SVN
:
path_mod
.
url_parse
(
url
)
self
.
url
,
self
.
revision
=
\
path_mod
.
svn_parse
(
url
)
else
:
self
.
url
,
self
.
branch
,
self
.
revision
=
\
path_mod
.
url_parse
(
url
)
basename
=
self
.
basename
()
basename
=
self
.
basename
()
path
=
path_mod
.
relpath
(
os
.
path
.
abspath
(
path
=
path_mod
.
relpath
(
os
.
path
.
abspath
(
os
.
path
.
join
(
fetchto
,
basename
)))
os
.
path
.
join
(
fetchto
,
basename
)))
...
...
hdlmake/util/path.py
View file @
cae14d15
...
@@ -29,7 +29,7 @@ import os
...
@@ -29,7 +29,7 @@ import os
def
url_parse
(
url
):
def
url_parse
(
url
):
"""
"""
Check if link to a repo seems to be correct. Filter revision
Check if link to a
Git
repo seems to be correct. Filter revision
number and branch
number and branch
"""
"""
url_clean
,
branch
,
rev
=
None
,
None
,
None
url_clean
,
branch
,
rev
=
None
,
None
,
None
...
@@ -43,6 +43,20 @@ def url_parse(url):
...
@@ -43,6 +43,20 @@ def url_parse(url):
return
(
url_clean
,
branch
,
rev
)
return
(
url_clean
,
branch
,
rev
)
def
svn_parse
(
url
):
"""
Check if link to a SVN repo seems to be correct. Filter revision
number
"""
url_clean
,
rev
=
None
,
None
if
"@"
in
url
:
url_clean
,
rev
=
url
.
split
(
"@"
)
else
:
url_clean
=
url
return
(
url_clean
,
rev
)
def
url_basename
(
url
):
def
url_basename
(
url
):
"""
"""
Get basename from an url
Get basename from an url
...
...
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