跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

restore-apt-sources.sh

28 行 · 1.1 KB历史下载
1#!/bin/sh
2# Build mirrors are temporary. Runtime maintenance admits official origins.
3set -eu
4python3 - <<'PY'
5from pathlib import Path
6from urllib.parse import urlsplit
7
8source = Path('/etc/apt/sources.list.d/debian.sources')
9rows = source.read_text().splitlines()
10seen = set()
11for index, row in enumerate(rows):
12 if not row.startswith('URIs:'):
13 continue
14 entries = row.split()[1:]
15 if len(entries) != 1:
16 raise SystemExit('Unexpected Debian source layout; source file was not changed.')
17 uri = urlsplit(entries[0])
18 path = uri.path.rstrip('/')
19 if uri.scheme not in ('http', 'https') or path not in ('/debian', '/debian-security') or uri.query or uri.fragment:
20 raise SystemExit('Unexpected Debian source origin; source file was not changed.')
21 if path in seen:
22 raise SystemExit('Duplicate Debian source; source file was not changed.')
23 seen.add(path)
24 rows[index] = 'URIs: http://deb.debian.org' + path
25if seen != {'/debian', '/debian-security'}:
26 raise SystemExit('Both Debian archive and security sources are required; source file was not changed.')
27source.write_text('\n'.join(rows) + '\n')
28PY