mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 08:11:16 +00:00
build_manifest.py: Use .format instead %s for templates
This commit is contained in:
parent
c457ca0570
commit
6e77bfb893
1 changed files with 6 additions and 5 deletions
|
@ -25,10 +25,10 @@ GSTREAMER_MODULES: List[str] = [
|
||||||
|
|
||||||
MANIFEST_TEMPLATE: str = """<?xml version="1.0" encoding="UTF-8"?>
|
MANIFEST_TEMPLATE: str = """<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<manifest>
|
<manifest>
|
||||||
<remote fetch="%s" name="user"/>
|
<remote fetch="{}" name="user"/>
|
||||||
<remote fetch="https://gitlab.freedesktop.org/gstreamer/" name="gstreamer"/>
|
<remote fetch="https://gitlab.freedesktop.org/gstreamer/" name="gstreamer"/>
|
||||||
<remote fetch="git://anongit.freedesktop.org/gstreamer/" name="origin"/>
|
<remote fetch="git://anongit.freedesktop.org/gstreamer/" name="origin"/>
|
||||||
%s
|
{}
|
||||||
</manifest>"""
|
</manifest>"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ def request(path: str) -> Dict[str, str]:
|
||||||
return requests.get('https://gitlab.gnome.org/api/v4/' + path, headers=gitlab_header).json()
|
return requests.get('https://gitlab.gnome.org/api/v4/' + path, headers=gitlab_header).json()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def find_repository_sha(module: str, branchname: str) -> Tuple[str, str]:
|
def find_repository_sha(module: str, branchname: str) -> Tuple[str, str]:
|
||||||
for project in request('projects?search=' + module):
|
for project in request('projects?search=' + module):
|
||||||
if project['name'] != module:
|
if project['name'] != module:
|
||||||
|
@ -82,7 +83,7 @@ if __name__ == "__main__":
|
||||||
# Shouldn't be needed.
|
# Shouldn't be needed.
|
||||||
remote: str = "git://anongit.freedesktop.org/gstreamer/"
|
remote: str = "git://anongit.freedesktop.org/gstreamer/"
|
||||||
projects: str = ''
|
projects: str = ''
|
||||||
project_template: str = ' <project name="%s" remote="%s" revision="%s" />\n'
|
project_template: str = " <project name=\"{}\" remote=\"{}\" revision=\"{}\" />\n"
|
||||||
user_remote: str = os.path.dirname(os.environ['CI_PROJECT_URL'])
|
user_remote: str = os.path.dirname(os.environ['CI_PROJECT_URL'])
|
||||||
for module in GSTREAMER_MODULES:
|
for module in GSTREAMER_MODULES:
|
||||||
print(f"Checking {module}:", end=' ')
|
print(f"Checking {module}:", end=' ')
|
||||||
|
@ -98,7 +99,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
if not revision:
|
if not revision:
|
||||||
revision = 'master'
|
revision = 'master'
|
||||||
projects += project_template % (module, remote, revision)
|
projects += project_template.format(module, remote, revision)
|
||||||
|
|
||||||
with open('manifest.xml', mode='w') as manifest:
|
with open('manifest.xml', mode='w') as manifest:
|
||||||
print(MANIFEST_TEMPLATE % (user_remote, projects), file=manifest)
|
print(MANIFEST_TEMPLATE.format(user_remote, projects), file=manifest)
|
||||||
|
|
Loading…
Reference in a new issue