From 531dbc7c1b8f333be222de980215f6a6898bc1bf Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Wed, 7 Aug 2024 16:55:05 +0200 Subject: [PATCH] Add ability to specify non-Factory This is important for devel-project only imports non-factory is still blocked by assert --- git-importer.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/git-importer.py b/git-importer.py index a97d2ab..7327e1c 100755 --- a/git-importer.py +++ b/git-importer.py @@ -42,8 +42,8 @@ PROJECTS = [ ] -def export_package(package, repodir, cachedir, gc): - exporter = GitExporter(URL_OBS, "openSUSE:Factory", package, repodir, cachedir) +def export_package(project, package, repodir, cachedir, gc): + exporter = GitExporter(URL_OBS, project, package, repodir, cachedir) exporter.set_gc_interval(gc) exporter.export_as_git() @@ -51,6 +51,12 @@ def export_package(package, repodir, cachedir, gc): def main(): parser = argparse.ArgumentParser(description="OBS history importer into git") parser.add_argument("packages", help="OBS package names", nargs="*") + parser.add_argument( + "-p", + "--project", + default="openSUSE:Factory", + help="Project to import/export, default is openSUSE:Factory", + ) parser.add_argument( "-r", "--repodir", @@ -110,10 +116,10 @@ def main(): if not args.cachedir: args.cachedir = pathlib.Path("~/.cache/git-import/").expanduser() - importer = Importer(URL_OBS, "openSUSE:Factory", args.packages) + importer = Importer(URL_OBS, args.project, args.packages) importer.import_into_db() for package in args.packages: - export_package(package, args.repodir, args.cachedir, args.gc) + export_package(args.project, package, args.repodir, args.cachedir, args.gc) if __name__ == "__main__":