@@ -91,24 +91,15 @@ def get_latest_ungoogled_chromium_tag():
9191 return tag_data[0]['name']
9292
9393
94−def get_ungoogled_chromium_channel():
95− """Returns a dictionary for the ungoogled-chromium channel."""
96− latest_tag = get_latest_ungoogled_chromium_tag()
97− version = latest_tag.split('-')[0]
98− if version == last_channels['ungoogled-chromium']['version']:
99− # No update available -> keep the cached information (no refetching required):
100− return last_channels['ungoogled-chromium']
101− channel = {
94+def get_latest_ungoogled_chromium_build():
95+ """Returns a dictionary for the latest ungoogled-chromium build."""
96+ tag = get_latest_ungoogled_chromium_tag()
97+ version = tag.split('-')[0]
98+ return {
99+ 'channel': 'ungoogled-chromium',
102100 'version': version,
103− 'sha256': nix_prefetch_url(f'{BUCKET_URL}/chromium-{version}.tar.xz'),
104− 'deps': get_channel_dependencies(version)
105− }
106− repo_url = 'https://github.com/Eloston/ungoogled-chromium.git'
107− channel['deps']['ungoogled-patches'] = {
108− 'rev': latest_tag,
109− 'sha256': nix_prefetch_git(repo_url, latest_tag)['sha256']
101+ 'ungoogled_tag': tag
110102 }
111− return channel
112103
113104
114105channels = {}
@@ -118,6 +109,8 @@ last_channels = load_json(JSON_PATH)
118109print(f'GET {HISTORY_URL}', file=sys.stderr)
119110with urlopen(HISTORY_URL) as resp:
120111 builds = csv.DictReader(iterdecode(resp, 'utf-8'))
112+ builds = list(builds)
113+ builds.append(get_latest_ungoogled_chromium_build())
121114 for build in builds:
122115 channel_name = build['channel']
123116
@@ -134,13 +127,18 @@ with urlopen(HISTORY_URL) as resp:
134127 continue
135128
136129 channel = {'version': build['version']}
137− suffix = 'unstable' if channel_name == 'dev' else channel_name
130+ if channel_name == 'dev':
131+ google_chrome_suffix = 'unstable'
132+ elif channel_name == 'ungoogled-chromium':
133+ google_chrome_suffix = 'stable'
134+ else:
135+ google_chrome_suffix = channel_name
138136
139137 try:
140138 channel['sha256'] = nix_prefetch_url(f'{BUCKET_URL}/chromium-{build["version"]}.tar.xz')
141139 channel['sha256bin64'] = nix_prefetch_url(
142− f'{DEB_URL}/google-chrome-{suffix}/' +
143− f'google-chrome-{suffix}_{build["version"]}-1_amd64.deb')
140+ f'{DEB_URL}/google-chrome-{google_chrome_suffix}/' +
141+ f'google-chrome-{google_chrome_suffix}_{build["version"]}-1_amd64.deb')
144142 except subprocess.CalledProcessError:
145143 # This build isn't actually available yet. Continue to
146144 # the next one.
@@ -149,6 +147,12 @@ with urlopen(HISTORY_URL) as resp:
149147 channel['deps'] = get_channel_dependencies(channel['version'])
150148 if channel_name == 'stable':
151149 channel['chromedriver'] = get_matching_chromedriver(channel['version'])
150+ elif channel_name == 'ungoogled-chromium':
151+ ungoogled_repo_url = 'https://github.com/Eloston/ungoogled-chromium.git'
152+ channel['deps']['ungoogled-patches'] = {
153+ 'rev': build['ungoogled_tag'],
154+ 'sha256': nix_prefetch_git(ungoogled_repo_url, build['ungoogled_tag'])['sha256']
155+ }
152156
153157 channels[channel_name] = channel
154158
@@ -167,8 +171,6 @@ with open(JSON_PATH, 'w') as out:
167171 return 3
168172 print(f'Error: Unexpected channel: {channel_name}', file=sys.stderr)
169173 sys.exit(1)
170− # Get the special ungoogled-chromium channel:
171− channels['ungoogled-chromium'] = get_ungoogled_chromium_channel()
172174 sorted_channels = OrderedDict(sorted(channels.items(), key=get_channel_key))
173175 json.dump(sorted_channels, out, indent=2)
174176 out.write('\n')