mag

a binary package manager in one C file: apk and pacman repos, CRUX, Void and Exherbo ports
git clone https://github.com/tortr-rs/mag
Log | Files | Refs | README | LICENSE

commit 629adf9c36ce866ebd3639bab8b8ecf5b8bae7f3
parent c26035856a4c6a410e852e11908bc2805a7bdd90
Author: torter <koubbamohamedrayan@gmail.com>
Date:   Sat, 14 Nov 2026 23:17:38 +0000

mag: pkgsrc comes from ftp.netbsd.org, cdn.netbsd.org's certificate chain does not verify with libressl

Diffstat:
Mmag.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mag.c b/mag.c @@ -942,7 +942,7 @@ static struct recipe *parse_pkgsrc(const char *id, const char *dir, const char * } free(c2); } - if (r->url && r->sha512) push(&r->alts, fmt("https://cdn.netbsd.org/pub/pkgsrc/distfiles/%s%s%s", var_get(&vs, "DIST_SUBDIR") ? var_get(&vs, "DIST_SUBDIR") : "", var_get(&vs, "DIST_SUBDIR") ? "/" : "", dfile)); + if (r->url && r->sha512) push(&r->alts, fmt("https://ftp.netbsd.org/pub/pkgsrc/distfiles/%s%s%s", var_get(&vs, "DIST_SUBDIR") ? var_get(&vs, "DIST_SUBDIR") : "", var_get(&vs, "DIST_SUBDIR") ? "/" : "", dfile)); /* the dependencies: DEPENDS and BUILD_DEPENDS lines look like pkg>=1.0:../../category/pkg, and buildlink3 includes */ { static const char *const names[] = { "DEPENDS", "BUILD_DEPENDS", "TOOL_DEPENDS", "BUILD_TOOL_DEPENDS", NULL }; @@ -1777,7 +1777,7 @@ static int cmd_sync(void) { const char *url = getenv("MAG_SYNC_URL"), *cmd = getenv("MAG_FETCH"); char *file = fmt("%s/var/cache/mag/pkgsrc.tar.xz", root), *part = fmt("%s.part", file), *tmp = fmt("%s/usr/pkgsrc.sync", root), *tree = fmt("%s/usr/pkgsrc", root), *from = fmt("%s/pkgsrc", tmp); - char *dl[] = { "/bin/sh", "-c", "set -f; $0 \"$1\" \"$2\"", (char *)(cmd ? cmd : "ftp -o"), part, (char *)(url ? url : "https://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.xz"), NULL }; + char *dl[] = { "/bin/sh", "-c", "set -f; $0 \"$1\" \"$2\"", (char *)(cmd ? cmd : "ftp -o"), part, (char *)(url ? url : "https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc.tar.xz"), NULL }; char *un[] = { "tar", "-xf", file, "-C", tmp, NULL }; char *rm[] = { "rm", "-rf", tree, NULL }; char *dir = xstrdup(file);