Commit 29c65192 authored by Zen Fu's avatar Zen Fu
Browse files

[weblate] Make repo path an argument to script (tails#17377)

The dependencies update script had a hardcoded path making it unable to
work in different environments. This commit adds a command line argument
to the script allowing to pass the weblate repo path.
parent ac138876
......@@ -2,6 +2,7 @@
from bs4 import BeautifulSoup
from operator import attrgetter
from string import Template
import argparse
import git
import io
import itertools
......@@ -292,23 +293,35 @@ def deb_versions(pkgname,suite):
else:
raise err
def main():
import argparse
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument(
"--weblate-version",
help="What Weblate version.")
help="What Weblate version.",
required=True)
parser.add_argument(
"--debian-suite",
choices=['stretch', 'buster', 'bullseye'],
help="Debian suite.")
help="Debian suite.",
required=True)
parser.add_argument(
"--weblate-repo",
help="Path to Weblate repository.",
required=True)
args = parser.parse_args()
return args
def main():
args = parse_arguments()
suite_name = args.debian_suite
suite = getattr(DebianSuite, suite_name)
repo = git.Repo('/home/hefee/git/weblate')
repo = git.Repo(args.weblate_repo)
output = io.BytesIO()
b = repo.commit("weblate-{}".format(args.weblate_version)).tree/"requirements.txt"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment