forked from importers/git-importer
Add ability to specify non-Factory
This is important for devel-project only imports non-factory is still blocked by assert
This commit is contained in:
parent
1318f9e0c4
commit
531dbc7c1b
@ -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__":
|
||||
|
Loading…
Reference in New Issue
Block a user