depot/third_party/nixpkgs/pkgs/tools/inputmethods/fcitx5/update.py
Default email 5e9e1146e1 Project import generated by Copybara.
GitOrigin-RevId: 18036c0be90f4e308ae3ebcab0e14aae0336fe42
2023-08-05 00:07:22 +02:00

44 lines
1.1 KiB
Python
Executable file

#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p nix-update python3Packages.requests
from nix_prefetch_github import *
import requests
import subprocess
REPOS = [
"libime",
"xcb-imdkit",
"fcitx5",
"fcitx5-anthy",
"fcitx5-chewing",
"fcitx5-chinese-addons",
"fcitx5-configtool",
"fcitx5-gtk",
"fcitx5-hangul",
"fcitx5-lua",
"fcitx5-m17n",
"fcitx5-qt",
"fcitx5-rime",
"fcitx5-skk",
"fcitx5-table-extra",
"fcitx5-table-other",
"fcitx5-unikey"
]
OWNER = "fcitx"
def get_latest_tag(repo, owner=OWNER):
r = requests.get('https://api.github.com/repos/{}/{}/tags'.format(owner,repo))
return r.json()[0].get("name")
def main():
for repo in REPOS:
rev = get_latest_tag(repo)
if repo == "fcitx5-qt":
subprocess.run(["nix-update", "--commit", "--version", rev, "libsForQt5.{}".format(repo)])
else:
subprocess.run(["nix-update", "--commit", "--version", rev, repo])
if __name__ == "__main__":
main ()