Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmozhijin committed Sep 16, 2024
1 parent 9330003 commit 12ab3a5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions build_helper/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ def apt(*args: str) -> None:
if build:
# 清理空间
logger.info("清理空间")
try:
sudo("rm", "-rf", "/etc/apt/sources.list.d/*", "/usr/share/dotnet", "/usr/local/lib/android", "/opt/ghc",
"/etc/mysql", "/etc/php")
sudo("rm", "-rf", "/etc/apt/sources.list.d/*", "/usr/share/dotnet", "/usr/local/lib/android", "/opt/ghc",
"/etc/mysql", "/etc/php")


if False:
# 移除 swap 文件
sudo("swapoff", "-a")
sudo("rm", "-f", "/mnt/swapfile")

# 创建根分区映像文件
root_avail_kb = int(subprocess.check_output(["df", "--block-size=1024", "--output=avail", "/"]).decode().splitlines()[-1])
root_size_kb = (root_avail_kb - 1048576) * 1024
Expand Down Expand Up @@ -126,9 +127,6 @@ def apt(*args: str) -> None:
subprocess.run(["df", "-hT", github_workspace])
sudo("btrfs", "filesystem", "usage", github_workspace)

except subprocess.CalledProcessError as e:
logger.exception(f"创建或挂载分区时发生错误: {e}")


def apply_patch(patch: str, target: str) -> bool:
result = subprocess.run(["patch", "-p1", "-d", target],
Expand Down

0 comments on commit 12ab3a5

Please sign in to comment.