镜像自地址
https://github.com/JGZYES/ParlzPackageManger.git
已同步 2026-09-11 08:52:45 +08:00
repo: accept bare (no-extension) binaries as Linux/macOS release assets (e.g. 'pmm' ELF); install_file chmod +x them
这个提交包含在:
+7
-1
@@ -223,7 +223,13 @@ int install_file(const char *url, const char *name) {
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"\"%s\" /S /VERYSILENT /quiet --silent 2>nul", pwin);
|
||||
} else {
|
||||
/* unknown type for this OS: just leave in cache and copy if a single file */
|
||||
/* unknown type for this OS: copy the single file into the install dir;
|
||||
* on Linux/macOS make it executable (bare ELF/script releases). */
|
||||
if (os == OS_LINUX || os == OS_MACOS)
|
||||
snprintf(cmd, sizeof(cmd),
|
||||
"cp -f \"%s\" \"%s/\" 2>/dev/null && chmod +x \"%s/%s\" 2>/dev/null || true",
|
||||
path, dest, dest, bname);
|
||||
else
|
||||
snprintf(cmd, sizeof(cmd), "cp -f \"%s\" \"%s/\" 2>/dev/null || true", path, dest);
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -167,6 +167,7 @@ static int has_ext(const char *name, const char *ext) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int asset_is_junk(const char *name);
|
||||
int asset_matches_os(const char *filename, PmmOS os) {
|
||||
static const char *win_exts[] = { ".exe", ".msi", ".zip", ".7z", NULL };
|
||||
static const char *linux_exts[] = { ".deb", ".rpm", ".appimage", ".tar.gz", ".tgz", ".tar.xz", ".tar.bz2", ".pkg.tar.zst", NULL };
|
||||
@@ -180,6 +181,11 @@ int asset_matches_os(const char *filename, PmmOS os) {
|
||||
}
|
||||
for (int i = 0; exts[i]; i++)
|
||||
if (has_ext(filename, exts[i])) return 1;
|
||||
/* A bare (no-dot) binary counts on Linux/macOS — e.g. a release asset named
|
||||
* "pmm" that is an ELF. Skip obvious junk like README/LICENCE/checksums. */
|
||||
if ((os == OS_LINUX || os == OS_MACOS) && strchr(filename, '.') == NULL
|
||||
&& !asset_is_junk(filename))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户