module path is now stored as a relative path

parent 8a382781
......@@ -183,7 +183,7 @@ class ActionCore(Action):
% mod_aux.parent.url)
else:
self._print_comment("# * This is the root module")
print("%s\t%s" % (path_mod.relpath(mod_aux.path),
print("%s\t%s" % (mod_aux.path,
_convert_to_source_name(mod_aux.source)))
if self.options.withfiles:
self._print_file_list(mod_aux.files)
......
......@@ -92,16 +92,15 @@ class ActionTree(Action):
unfetched_modules = True
else:
if mod_aux.parent:
hierarchy.add_node(path.relpath(mod_aux.path))
hierarchy.add_edge(path.relpath(mod_aux.parent.path),
path.relpath(mod_aux.path))
hierarchy.add_node(mod_aux.path)
hierarchy.add_edge(mod_aux.parent.path, mod_aux.path)
else:
hierarchy.add_node(path.relpath(mod_aux.path))
top_id = path.relpath(mod_aux.path)
hierarchy.add_node(mod_aux.path)
top_id = mod_aux.path
if self.options.withfiles:
if len(mod_aux.files):
for file_aux in mod_aux.files:
hierarchy.add_edge(path.relpath(mod_aux.path),
hierarchy.add_edge(mod_aux.path,
path.relpath(file_aux.path))
if unfetched_modules:
......
......@@ -106,8 +106,7 @@ class Git(Fetcher):
checkout_id = module.revision
logging.debug("Git commit requested: %s", checkout_id)
else:
checkout_id = self.get_submodule_commit(
path_utils.relpath(module.path))
checkout_id = self.get_submodule_commit(module.path)
logging.debug("Git submodule commit: %s", checkout_id)
if checkout_id is not None:
logging.info("Checking out version %s", checkout_id)
......
......@@ -26,7 +26,6 @@ from __future__ import absolute_import
import os
import logging
from hdlmake.util import path as path_mod
from .configparser import ConfigParser
......@@ -278,9 +277,9 @@ class ManifestParser(ConfigParser):
path_aux = os.path.join(path, filename)
if not isinstance(path_aux, str):
raise ValueError("Path must be an instance of str")
if not path_mod.is_abs_path(path_aux):
raise ValueError(
"Manifest path must be absolute path")
#if not path_mod.is_abs_path(path_aux):
# raise ValueError(
# "Manifest path must be absolute path")
return path_aux
return None
manifest = _search_for_manifest(path)
......
......@@ -53,7 +53,8 @@ class ModuleConfig(object):
self.url, self.branch, self.revision = \
path_mod.url_parse(url)
basename = self.basename()
path = os.path.abspath(os.path.join(fetchto, basename))
path = path_mod.relpath(os.path.abspath(
os.path.join(fetchto, basename)))
# Check if the module dir exists and is not empty
if os.path.exists(path) and os.listdir(path):
self.path = path
......
......@@ -103,8 +103,7 @@ class Module(ModuleContent):
return
logging.debug("Removing " + self.path)
try:
command_tmp = (path_mod.rmdir_command() + " " +
path_mod.relpath(self.path))
command_tmp = path_mod.rmdir_command() + " " + self.path
Popen(command_tmp,
stdout=PIPE,
stdin=PIPE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment