install: -dpkg/-msi with a URL force install type (download.deb/download.msi)

这个提交包含在:
JGZYES
2026-09-02 13:19:57 +08:00
父节点 a207683f6e
当前提交 fa9e78f564
+4 -1
查看文件
@@ -578,10 +578,13 @@ int main(int argc, char **argv) {
if (pdm_install_file(pkg) == 0) ok++; else fprintf(stderr, "pmm: failed to install %s\n", pkg); if (pdm_install_file(pkg) == 0) ok++; else fprintf(stderr, "pmm: failed to install %s\n", pkg);
continue; continue;
} }
/* direct URL install: pmm install https://.../foo.zip */ /* direct URL install: pmm install https://.../foo.zip
* (with -dpkg/-msi the type is forced regardless of URL extension) */
if (strncmp(pkg, "http://", 7) == 0 || strncmp(pkg, "https://", 8) == 0) { if (strncmp(pkg, "http://", 7) == 0 || strncmp(pkg, "https://", 8) == 0) {
const char *bn = strrchr(pkg, '/'); const char *bn = strrchr(pkg, '/');
bn = bn ? bn + 1 : pkg; bn = bn ? bn + 1 : pkg;
if (forced == 1) bn = "download.deb";
else if (forced == 2) bn = "download.msi";
if (install_file(pkg, bn) == 0) ok++; if (install_file(pkg, bn) == 0) ok++;
else fprintf(stderr, "pmm: failed to install %s\n", pkg); else fprintf(stderr, "pmm: failed to install %s\n", pkg);
continue; continue;