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__":