Unverified Commit e7e1dc3f authored by Andrej Shadura's avatar Andrej Shadura
Browse files

Expand the use of pathlib



Signed-off-by: Andrej Shadura's avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
parent b7522f9f
......@@ -117,9 +117,9 @@ def do_dput(self, subcmd, opts, proj_name, dsc_or_changes_file):
# Filenames in the .dsc are relative to the directory where it appears.
# We need to make it absolute before we chdir elsewhere.
dsc_or_changes_file = os.path.abspath(dsc_or_changes_file)
dsc_file = os.path.abspath(dsc_file)
dscdir = os.path.dirname(dsc_file)
dsc_or_changes_file = Path(dsc_or_changes_file).resolve()
dsc_file = Path(dsc_file).resolve()
dscdir = Path(dsc_file).resolve().parent
# Get the list of packages
# TODO: Probably it can be done after checking out the project
......@@ -188,11 +188,11 @@ def do_dput(self, subcmd, opts, proj_name, dsc_or_changes_file):
# adding local_file_list to the package as links
for f in local_file_list:
filepath = os.path.join(dscdir, f)
filepath = dscdir / f
os.symlink(filepath, f)
package.addfile(f)
f = os.path.basename(dsc_file)
f = dsc_file.name
os.symlink(dsc_file, f)
package.addfile(f)
......@@ -209,7 +209,7 @@ def do_dput(self, subcmd, opts, proj_name, dsc_or_changes_file):
package.addfile(f)
if changes is not None:
f = os.path.basename(dsc_or_changes_file)
f = dsc_or_changes_file.name
os.symlink(dsc_or_changes_file, f)
package.addfile(f)
......
Supports Markdown
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