~michel-slm/myrepos-utils

d78cc155020d0b4d5bfbd1081249a6faa570864c — Michel Lind 4 months ago 4e4eeac
allow configuring a repo in a nested path

Signed-off-by: Michel Lind <salimma@fedoraproject.org>
1 files changed, 6 insertions(+), 1 deletions(-)

M myrepos_utils/utils.py
M myrepos_utils/utils.py => myrepos_utils/utils.py +6 -1
@@ 12,6 12,7 @@

import configparser
import os
import pathlib
import subprocess

CONFIG = configparser.ConfigParser()


@@ 80,7 81,11 @@ def config_repo(
    if res.returncode != 0:
        return res.returncode

    res = subprocess.run(["mr", "-d", checkout_dir, "co"])
    checkout_dirname = os.path.dirname(checkout_dir)
    checkout_basename = os.path.basename(checkout_dir)
    if checkout_dirname:
        pathlib.Path(checkout_dirname).mkdir(parents=True, exist_ok=True)
    res = subprocess.run(["mr", "-d", checkout_basename, "co"], cwd=checkout_dirname)
    return res.returncode