Compare commits

..
Author SHA1 Message Date
sisungo 2938e9e969 feat: add package ca-certificates
Signed-off-by: sisungo <[email protected]>
2026-07-04 12:35:05 +08:00
2 changed files with 28 additions and 39 deletions
-39
View File
@@ -30,45 +30,6 @@ def download(url, output):
last_percent = percent
try:
if url.startswith("file://"):
file_path = url[7:]
if not os.path.exists(file_path):
raise Exception("File not found: " + file_path)
total_size = os.path.getsize(file_path)
if total_size <= 0:
print("Copying...")
with open(file_path, "rb") as src, open(output, "wb") as dst:
while True:
chunk = src.read(8192)
if not chunk:
break
dst.write(chunk)
print("Download completed: " + output)
return output
sys.stdout.write("downloading... 0%")
sys.stdout.flush()
with open(file_path, "rb") as src, open(output, "wb") as dst:
downloaded = 0
block_size = 8192
while True:
chunk = src.read(block_size)
if not chunk:
break
dst.write(chunk)
downloaded += len(chunk)
percent = int(downloaded * 100 / total_size)
report_progress(percent)
if last_percent != 100:
report_progress(100)
sys.stdout.write("\n")
print("Download completed: " + output)
return output
req = urllib.request.Request(url, method="GET")
req.add_header(
"User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
+28
View File
@@ -0,0 +1,28 @@
import os
from lib.make import *
version("2026.7.4")
source_url(
"https://gitea.semilabs.org/semios/ca-certificates/releases/download/v2026.07.04/ca-certificates-2026.07.04.tar"
)
block_hook("autolink")
def build():
for i in os.listdir("."):
link(f"share/ca-certificates/{i}", f"/share/ca-certificates/{i}")
on_build(build)
def pack(composer):
composer.makedir("share")
composer.add_dir(".", "share/ca-certificates")
package("ca-certificates")
arch_any()
on_pack(pack)