Add 'repo.json' to url before giving it to bpkg

This commit is contained in:
Ellwood Zwovic
2017-07-24 17:54:39 -07:00
parent 5fcc8153f6
commit cc53e54877
3 changed files with 9 additions and 12 deletions

View File

@@ -6,7 +6,8 @@ import logging
import pathlib
import shutil
import json
from .bpkg import utils
from . import utils
from . import bpkg
from .bpkg import Package, Repository
from .messages import *
from .bpkg.exceptions import *
@@ -135,7 +136,7 @@ def _install(pipe_to_blender, pkgpath: pathlib.Path, dest: pathlib.Path, searchp
backups = []
for conflict in conflicts:
log.debug("Creating backup of conflict %s", conflict)
backups.append(utils.InplaceBackup(conflict))
backups.append(bpkg.utils.InplaceBackup(conflict))
try:
file_to_extract.extractall(str(dest))
@@ -152,7 +153,7 @@ def _install(pipe_to_blender, pkgpath: pathlib.Path, dest: pathlib.Path, searchp
dest_file = (dest / pkgpath.name)
if dest_file.exists():
backup = utils.InplaceBackup(dest_file)
backup = bpkg.utils.InplaceBackup(dest_file)
try:
shutil.copyfile(str(pkgpath), str(dest_file))
@@ -226,6 +227,7 @@ def refresh(pipe_to_blender, storage_path: pathlib.Path, repository_url: str):
"""Retrieves and stores the given repository"""
log = logging.getLogger(__name__ + '.refresh')
repository_url = utils.add_repojson_to_url(repository_url)
repo_path = storage_path / 'repo.json'
if repo_path.exists():