linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / tools / inputmethods / fcitx5 / update.py
blobe3513c747fcd29ca6d589d99eab791b1bc260a1c
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i python3 -p nix-prefetch-github python3Packages.requests
4 from nix_prefetch_github import *
5 import json
6 import requests
7 import subprocess
9 REPOS = [ "libime", "xcb-imdkit", "fcitx5", "fcitx5-gtk", "fcitx5-qt", "fcitx5-configtool", "fcitx5-lua",
10 "fcitx5-rime", "fcitx5-chinese-addons", "fcitx5-table-extra", "fcitx5-table-other" ]
12 OWNER = "fcitx"
14 def get_latest_tag(repo, owner=OWNER):
15 r = requests.get( 'https://api.github.com/repos/{}/{}/tags'.format(owner,repo)
16 , auth=('poscat', 'db5e6fd16d0eb8c36385d3d944e058a1178b4265'))
17 return r.json()[0].get("name")
19 def main():
20 sources = dict()
21 for repo in REPOS:
22 rev = get_latest_tag(repo)
23 if repo == "fcitx5-qt":
24 subprocess.run(["nix-update", "--commit", "--version", rev, "libsForQt5.{}".format(repo)])
25 else:
26 subprocess.run(["nix-update", "--commit", "--version", rev, repo])
28 if __name__ == "__main__":
29 main ()