Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 08535177 authored by LuK1337's avatar LuK1337
Browse files

fixup! roomservice: Migrate from GitHub API to git ls-remote

Change-Id: Ide422d1b056816114c7e372bcd296dbf8675ec95
parent 13ba07f9
Loading
Loading
Loading
Loading
+1 −14
Original line number Original line Diff line number Diff line
@@ -16,10 +16,8 @@


from __future__ import print_function
from __future__ import print_function


import base64
import glob
import glob
import json
import json
import netrc
import os
import os
import re
import re
import subprocess
import subprocess
@@ -51,17 +49,6 @@ if not depsonly:


repositories = []
repositories = []


try:
    authtuple = netrc.netrc().authenticators("api.github.com")

    if authtuple:
        auth_string = ('%s:%s' % (authtuple[0], authtuple[2])).encode()
        githubauth = base64.encodestring(auth_string).decode().replace('\n', '')
    else:
        githubauth = None
except:
    githubauth = None

if not depsonly:
if not depsonly:
    githubreq = urllib.request.Request("https://raw.githubusercontent.com/LineageOS/mirror/main/default.xml")
    githubreq = urllib.request.Request("https://raw.githubusercontent.com/LineageOS/mirror/main/default.xml")
    try:
    try:
@@ -268,7 +255,7 @@ def get_default_or_fallback_revision(repo_name):


    try:
    try:
        stdout = subprocess.run(
        stdout = subprocess.run(
            ["git", "ls-remote", "-b", "https://:@github.com/LineageOS/" + repo_name],
            ["git", "ls-remote", "-h", "https://:@github.com/LineageOS/" + repo_name],
            stdout=subprocess.PIPE,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            stderr=subprocess.PIPE,
        ).stdout.decode()
        ).stdout.decode()