From d05274e46ccb2a8d491696b7de43d678cf950732 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 21:15:27 +0000 Subject: [PATCH 1/8] Fix local zip URLs with spaces, decode folder names in manifests, stop uid matching across catalog entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - #17: percent-encode the path in the file:// URL for local zips - #10: manifest_str decodes JSON escapes (\u03c0ToniC -> πToniC) - #22: when an installed folder's mpc-plugin.json id names a catalog entry, only that entry matches (no uid fallback) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01CpoP2prQZ6KeK3GtEkzmBY --- src/manager.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/manager.c b/src/manager.c index a3c16d5..88351a2 100644 --- a/src/manager.c +++ b/src/manager.c @@ -2375,7 +2375,15 @@ static int add_local(const device_t *d, pkg_t *pkg, int n) { snprintf(p->kind, sizeof p->kind, "instrument"); snprintf(p->dist, sizeof p->dist, "release"); snprintf(p->latest, sizeof p->latest, "%s", mf.version[0] ? mf.version : "local"); - snprintf(p->url, sizeof p->url, "file://%s", path); + { /* percent-encode: libcurl rejects a raw space, and a drive's name (/media/MPC SD Card) is not the user's to choose */ + size_t o = snprintf(p->url, sizeof p->url, "file://"); + for (const char *q = path; *q && o + 4 < sizeof p->url; q++) { + unsigned char ch = (unsigned char)*q; + if (isalnum(ch) || strchr("-._~/", ch)) p->url[o++] = (char)ch; + else o += snprintf(p->url + o, 4, "%%%02X", ch); + } + p->url[o] = 0; + } snprintf(p->sha, sizeof p->sha, "%s", sha); snprintf(p->channel, sizeof p->channel, "stable"); snprintf(p->tags, sizeof p->tags, "local"); @@ -2478,13 +2486,16 @@ static void scan_installed(const device_t *d, pkg_t *pkg, int n) { jobject(js, manifest_member, &mf); free(js); } + int idknown = 0; /* the folder's own id names a catalog entry: it is that entry only (Machinemodule and its Gen2 build share a uid / name) */ + for (int i = 0; i < n && mf.id[0] && !idknown; i++) + idknown = !is_addin(&pkg[i]) && !strcmp(mf.id, !strncmp(pkg[i].id, "local-", 6) ? pkg[i].id + 6 : pkg[i].id); for (int i = 0; i < n; i++) { pkg_t *p = &pkg[i]; if (is_addin(p)) continue; /* a local zip's card is "local-": it is the same plugin as the installed (else it would offer Install forever, never Remove) */ const char *pid = !strncmp(p->id, "local-", 6) ? p->id + 6 : p->id; int hit = mf.id[0] ? !strcmp(mf.id, pid) : !strcmp(en->name, p->name); - for (int c = 0; c < 4 && !hit; c++) hit = p->uids[c][0] && !strcasecmp(p->uids[c], en->uid); + for (int c = 0; c < 4 && !hit && !idknown; c++) hit = p->uids[c][0] && !strcasecmp(p->uids[c], en->uid); if (!hit || p->installed[0]) continue; snprintf(p->installed, sizeof p->installed, "%s", mf.version[0] ? mf.version : "?"); snprintf(p->folder, sizeof p->folder, "%s", folder); @@ -2708,8 +2719,8 @@ static void manifest_str(const char *dir, const char *key, char *out, size_t n) if (!s) return; char *k = strstr(s, pat); if (k && (k = strchr(k + strlen(pat), ':')) && (k = strchr(k, '"'))) { - char *e = strchr(++k, '"'); - if (e && (size_t)(e - k) < n) { memcpy(out, k, e - k); out[e - k] = 0; } + char dec[512]; /* decoded: "\u03c0ToniC" is the folder πToniC, not the literal backslash text */ + if (jstr(k, dec, sizeof dec) && strlen(dec) < n) snprintf(out, n, "%s", dec); } free(s); } From 5b0abb3d3ae70a7d27441cf44f36c59945178797 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 21:36:23 +0000 Subject: [PATCH 2/8] Open the restart prompt at first start when an update left the wrong skin in place An update brings the packaged light skin back while the saved theme may be dark. The swap was already queued but never shown. The first start after that now prepares it and opens the restart prompt (CANCEL keeps it queued). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01CpoP2prQZ6KeK3GtEkzmBY --- src/manager.c | 19 ++++++++++++++++++- tests/drive.c | 5 +++++ tests/run.sh | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/manager.c b/src/manager.c index 88351a2..654347a 100644 --- a/src/manager.c +++ b/src/manager.c @@ -140,6 +140,7 @@ typedef struct { char kb_key[16]; /* that key */ int theme, theme_applied, theme_can; /* 0 dark, 1 light: the one wanted, the one in `Plugin Skins` at MPC's start, and whether the folder holds both skins */ char own[300]; /* this plugin's own folder (its skins live there) */ + int theme_seen, theme_boot; /* theme_init ran once; the wanted theme differed from the skin in place at that first start (an update brings the packaged skin) */ int tsel, reprompt; /* which usable location new installs go to; CHANGE re-prepares and reopens the prompt */ int sort; /* 0 last updated, 1 newest (first release), 2 most downloaded, 3 name */ char azf; /* the A-Z filter: 0 none, '#' or 'A'..'Z' (the first letter or digit of the name) */ @@ -1555,6 +1556,7 @@ static void theme_init(mgr_t *m) { /* after the device probe: where the settin m->theme = theme_read(m->dev->base, ".openmpcpm-theme", 1); /* light is the default */ snprintf(a, sizeof a, "%s/Plugin Skins", m->own); m->theme_applied = theme_read(a, ".theme", 1); /* inside the skin itself: a reinstall of this plugin brings the packaged (dark) skin and this file together */ + if (!m->theme_seen) { m->theme_seen = 1; m->theme_boot = m->theme_can && m->theme != m->theme_applied; } } } @@ -3036,6 +3038,7 @@ static void do_launch(mgr_t *m) { #endif } +static int count_queued(const mgr_t *m); static void *worker(void *ud) { mgr_t *m = ud; mkdir(WORK, 0755); @@ -3049,7 +3052,21 @@ static void *worker(void *ud) { m->busy = job; m->rev++; pthread_mutex_unlock(&m->mu); - if (job == J_REFRESH) do_refresh(m); + if (job == J_REFRESH) { + do_refresh(m); + /* An update brings the packaged (light) skin back while the saved choice may be dark: the swap is already queued, but nobody + * would see it. The first start after that prepares it and opens the restart prompt (CANCEL keeps it queued). */ + pthread_mutex_lock(&m->mu); + int boot = m->theme_boot && theme_dirty(m) && count_queued(m) == 1 && !m->dev->problem[0] && !m->quit; + m->theme_boot = 0; + pthread_mutex_unlock(&m->mu); + if (boot) { + do_prepare(m); + pthread_mutex_lock(&m->mu); + if (m->ready) m->confirm = 1; + pthread_mutex_unlock(&m->mu); + } + } else if (job == J_PREPARE) do_prepare(m); else if (job == J_LAUNCH) do_launch(m); else if (job == J_PATCH) do_patch(m); diff --git a/tests/drive.c b/tests/drive.c index efcbe67..b47a80b 100644 --- a/tests/drive.c +++ b/tests/drive.c @@ -169,6 +169,11 @@ int main(int argc, char **argv) { if (argc > 1 && !strncmp(argv[1], "theme", 5)) { /* both skins in the plugin folder (tests/run.sh sets PM_OWN): the switch, the prompt, then APPLY */ printf("start: can=%s theme=%s |%s| apply_state=%s\n", get("theme_can"), get("theme"), get("theme_txt"), get("apply_state")); if (!strcmp(argv[1], "themeshow")) { e->destroy(m); return 0; } + if (!strcmp(argv[1], "themeboot")) { /* an update brought the light skin back while dark is chosen: the first start prepares the swap and opens the prompt */ + for (int i = 0; i < 60 && strcmp(get("confirm"), "1"); i++) sleep(1); + printf("boot: confirm=%s apply_state=%s |%s|\n", get("confirm"), get("apply_state"), get("confirm_txt1")); + e->destroy(m); return 0; + } set("theme_btn", "1"); press("theme_btn"); /* one tap, delivered twice (a Live III does that) */ printf("pressed: theme=%s |%s| apply_state=%s status: %s\n", get("theme"), get("theme_txt"), get("apply_state"), get("status")); press("apply"); diff --git a/tests/run.sh b/tests/run.sh index 2482180..47ca9aa 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -368,6 +368,10 @@ sh /tmp/openmpc-pm/apply.sh [ -d "/tmp/own/Plugin Skins.light" ] && [ -d "/tmp/own/Plugin Skins.dark" ] || { echo "FAIL: a skin variant was lost"; exit 1; } /tmp/drive_addins themeshow > /tmp/theme2.out grep -qF "start: can=1 theme=1 |LIGHT| apply_state=0" /tmp/theme2.out +# an update brought the packaged light skin back while dark is saved: the first start prepares the swap and opens the restart prompt by itself +echo light > "/tmp/own/Plugin Skins/.theme"; echo dark > /media/az01-internal/.openmpcpm-theme +/tmp/drive_addins themeboot > /tmp/theme3.out +grep -qF "boot: confirm=1 apply_state=3 |Theme: dark|" /tmp/theme3.out || { cat /tmp/theme3.out; exit 1; } unset PM_OWN echo "theme OK" fi # theme From 2b6dba0049e6580de9b3740944079c0765f8d360 Mon Sep 17 00:00:00 2001 From: sd88me <323365234+sd88me@users.noreply.github.com> Date: Thu, 19 Nov 2026 08:46:27 +1100 Subject: [PATCH 3/8] Regression tests for #17 (drive name with a space), #10 (JSON-escaped folder), #22 (shared uid) Co-Authored-By: Claude --- tests/drive.c | 1 + tests/fixture.py | 8 ++++++++ tests/run.sh | 27 ++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/tests/drive.c b/tests/drive.c index b47a80b..868eeea 100644 --- a/tests/drive.c +++ b/tests/drive.c @@ -372,6 +372,7 @@ int main(int argc, char **argv) { printf("after APPLY:\n"); cards(); e->destroy(m); return 0; } + if (argc > 1 && !strcmp(argv[1], "twin")) { set("kind", "2"); set("tab", "1"); printf("INSTALLED effects:\n"); cards(); e->destroy(m); return 0; } /* #22 */ if (argc > 1 && !strcmp(argv[1], "status")) { cards(); e->destroy(m); return 0; } /* what the manager says on its own (the last apply) */ if (argc > 2 && !strcmp(argv[1], "one")) { /* queue the effect called argv[2] and APPLY: the prepare step's verdict */ if (argc > 4) set("tab", argv[4]); diff --git a/tests/fixture.py b/tests/fixture.py index cfca189..c8d630f 100755 --- a/tests/fixture.py +++ b/tests/fixture.py @@ -84,6 +84,14 @@ def pkg(name, files, date): pkg("Newlib", [("Newlib-1.0.0/install.sh", "#!/bin/sh\nexit 0\n"), ("Newlib-1.0.0/mpc-plugin.json", '{"arch": "armv7", "max_glibc": "9.99"}\n')], "2024-12-01") pkg("Oldos", [("Oldos-1.0.0/install.sh", "#!/bin/sh\nexit 0\n"), ("Oldos-1.0.0/mpc-plugin.json", '{"arch": "armv7", "os_compat": ["2.x"]}\n')], "2024-11-01") pkg("Evil", [("Evil-1.0.0/install.sh", "#!/bin/sh\nexit 0\n"), ("Evil-1.0.0/../escape.txt", "x")], "2025-01-01") +# #10: a package whose manifest folder holds a JSON escape (written by a tool that escapes non-ASCII): the plugin folder is "πToniC" +pkg("PiToniC", [("PiToniC-1.0.0/install.sh", "#!/bin/sh\nexit 0\n"), ("PiToniC-1.0.0/uninstall.sh", "#!/bin/sh\nexit 0\n"), + ("PiToniC-1.0.0/mpc-plugin.json", json.dumps({"folder": "portable/\u03c0ToniC", "arch": "armv7"}) + "\n")], "2024-10-01") +# #22: Machinemodule's shape: twin-a lists the VST uid in the catalog, twin-b (its Gen2 build) does not but its package ships the same uid; twin-b is installed (tests/run.sh, section regress) +for tid, tname in (("twin-a", "Twin A"), ("twin-b", "Twin B")): + pkg(tname.replace(" ", ""), [(tname.replace(" ", "") + "-1.0.0/install.sh", "#!/bin/sh\nexit 0\n")], "2024-09-01") + plugins[-1].update({"id": tid, "name": tname}) + if tid == "twin-a": plugins[-1]["components"] = [{"uid": "TWN1", "name": tname}] # only the first lists the uid, as machinemodule does (the Gen2 entry does not) import copy so = copy.deepcopy(plugins[0]) # an entry made for another MPC (the catalog's "devices"): hidden when the model is known and not listed so.update({"id": "sample-only", "name": "Sample only addin", "devices": ["mpc-sample"]}) diff --git a/tests/run.sh b/tests/run.sh index 47ca9aa..fa6c5d2 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Offline tests in the gcc:12 Docker image (needs network: they read the live catalog and download one zip). -# ONLY=
tests/run.sh one section (ONLY=devices:2/4: a quarter of the fake devices, as CI runs them) (devices addins links vst2 pick theme safety arch web) in a minute or two; no ONLY: everything (about 9 minutes) +# ONLY=
tests/run.sh one section (ONLY=devices:2/4: a quarter of the fake devices, as CI runs them) (devices addins links regress vst2 pick theme safety arch web) in a minute or two; no ONLY: everything (about 9 minutes) # tests/run.sh the wrapper host test, each fake device in tests/devices/, then the addin flow against # an offline fixture (tests/fixture.py: three addin packages and a file:// catalog) # A fake device is a shell script that builds the device's files inside the container: MPC.settings (the real format, @@ -80,6 +80,31 @@ grep -q "apply_state 3" /tmp/links-yes.out grep -q "/linky.*install.sh\|Linky-1.0.0/install.sh" /tmp/openmpc-pm/apply.sh echo "links OK" fi # links +if want regress; then +echo "== regress (offline fixture): #17 a drive with a space, #10 a JSON-escaped folder name, #22 two entries with one uid" +rm -rf /media /sdcard /nvme /synths /data /tmp/openmpc-pm /tmp/pm-mounts; mkdir -p /media +sh tests/devices/mpc-one.sh +# #17: a local zip on a drive whose name has a space: the file:// address is percent-encoded, so the download works +mkdir -p "/media/MY CARD/Synths" "/media/MY CARD/local-plugins" +sed -i "s|/media/CARD/Synths|/media/MY CARD/Synths|" /media/az01-internal/Settings/MPC/MPC.settings +cp /p/vst/build/tests/Linky-1.0.0-mpc-armv7.zip "/media/MY CARD/local-plugins/Spacey-1.0.0.zip" +rm -rf /tmp/openmpc-pm; /tmp/drive_addins one Spacey-1.0.0 1 > /tmp/reg-space.out +grep -q "apply_state 3" /tmp/reg-space.out || { cat /tmp/reg-space.out; echo "FAIL #17: a local zip on a drive with a space did not reach ready"; exit 1; } +# #10: the manifest folder "πToniC" is the folder πToniC (the apply step checks and backs up that folder) +rm -rf /tmp/openmpc-pm; /tmp/drive_addins one PiToniC > /tmp/reg-pi.out +grep -q "apply_state 3" /tmp/reg-pi.out || { cat /tmp/reg-pi.out; exit 1; } +grep -qF "πToniC" /tmp/openmpc-pm/apply.sh && ! grep -qF "u03c0" /tmp/openmpc-pm/apply.sh || { grep -n "ToniC\|u03c0" /tmp/openmpc-pm/apply.sh; echo "FAIL #10: the folder name was not decoded"; exit 1; } +# #22: Twin B is installed (its manifest id says so) with the uid that only Twin A lists in the catalog: Twin A must stay not installed +sh tests/devices/mpc-one.sh +T="/media/az01-internal/Synths/acme - VST - Twin B"; mkdir -p "$T"; : > "$T/twin.so" +echo "{\"schema\":1,\"id\":\"twin-b\",\"version\":\"1.0.0\"}" > "$T/mpc-plugin.json" +sed -i "s|\r\$|\r|" /media/az01-internal/Settings/MPC/MPC.settings +grep -q 54574e31 /media/az01-internal/Settings/MPC/MPC.settings || { echo "FAIL: test setup"; exit 1; } +rm -rf /tmp/openmpc-pm; /tmp/drive_addins twin > /tmp/reg-twin.out +grep -q "card 1: TB .*state=3 inst=1" /tmp/reg-twin.out || { cat /tmp/reg-twin.out; echo "FAIL #22: Twin B is not listed as installed"; exit 1; } +grep -q "card 2: -" /tmp/reg-twin.out || { cat /tmp/reg-twin.out; echo "FAIL #22: Twin A counted as installed through the shared uid"; exit 1; } +echo "regress OK" +fi # regress if want vst2; then echo "== vst2 (offline fixture): MPC OS 3.10.1, VST2 Support on: move the old installs, install into VST2 Plugins with a plugin.json" rm -rf /media /sdcard /nvme /synths /data /tmp/openmpc-pm /tmp/pm-mounts; mkdir -p /media From bed1365496791a38b225fedaa139268ead20856a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 00:02:53 +0000 Subject: [PATCH 4/8] APPLY: removals unpack only the package scripts, zips go once unpacked, a clear error when temporary space is short REMOVE needs the package's uninstall.sh, so every queued removal downloaded and unpacked its whole zip into /tmp/openmpc-pm (RAM) before anything ran. Removing every plugin on a Force filled it and failed as "could not be unpacked". Removals now unpack only the top-level files, each zip is deleted once unpacked, leftovers from a failed APPLY are cleared, and a package that will not fit says so before downloading. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CpoP2rYBzwj7RsAk3nfygS --- src/manager.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/manager.c b/src/manager.c index a3c16d5..00e3919 100644 --- a/src/manager.c +++ b/src/manager.c @@ -2754,6 +2754,13 @@ static void prepare(mgr_t *m, pkg_t *q) { pthread_mutex_lock(&m->mu); for (int i = 0; i < m->npkg; i++) if (m->pkg[i].queued) q[nq++] = m->pkg[i]; m->failed = 0; + /* packages left in WORK by an APPLY that failed or was cancelled take RAM that this one needs */ + for (int i = 0; i < m->npkg; i++) + if (!m->pkg[i].queued && safe(m->pkg[i].id)) { + char st[300]; + snprintf(st, sizeof st, "rm -rf '" WORK "/%s' '" WORK "/%s.zip'", m->pkg[i].id, m->pkg[i].id); + sh(st); + } m->downloading = 1; m->progress = 0; pthread_mutex_unlock(&m->mu); @@ -2767,14 +2774,26 @@ static void prepare(mgr_t *m, pkg_t *q) { if (is_addin(p) && p->queued == Q_REMOVE) continue; /* removed by the uninstall.sh in its folder: nothing to fetch */ if (!p->url[0] || strlen(p->sha) != 64 || !safe(p->id) || !safe(p->name)) { err = "has no download in the catalog"; break; } snprintf(path, sizeof path, WORK "/%s.zip", p->id); + /* WORK is RAM (small on a Force): the zip and its unpacked copy must fit beside what is already unpacked. Said plainly + * instead of failing later as "could not be unpacked" (Force, 2026-11-18: REMOVE of every plugin filled /tmp) */ + struct statvfs tv; + if (p->size > 0 && !statvfs(WORK, &tv) && (unsigned long long)tv.f_bavail * tv.f_frsize < (unsigned long long)p->size * 3 + (8ull << 20)) { + snprintf(why, sizeof why, "not enough temporary space (%lld MB free, needs about %lld MB): APPLY fewer changes at once", + (long long)((unsigned long long)tv.f_bavail * tv.f_frsize >> 20), (p->size * 3 >> 20) + 8); + err = why; + break; + } if (download(m, p, path)) { snprintf(why, sizeof why, "download failed after 3 retries (%s)", m->fetch_err[0] ? m->fetch_err : "no connection error: the file was incomplete or its checksum did not match"); err = why; break; } if ((err = inspect_zip(path))) break; - snprintf(cmd, sizeof cmd, "rm -rf '" WORK "/%s' && unzip -q -o '%s' -d '" WORK "/%s'", p->id, path, p->id); - if (sh(cmd)) { err = "could not be unpacked"; break; } + /* A removal runs only the package's top-level files (uninstall.sh, plugin_list.awk, mpc-plugin.json): the plugin folder inside + * is not unpacked. The zip goes once unpacked, so WORK holds one zip at a time, not every queued package's. */ + snprintf(cmd, sizeof cmd, "rm -rf '" WORK "/%s' && unzip -q -o '%s' %s-d '" WORK "/%s'; r=$?; rm -f '%s'; exit $r", + p->id, path, p->queued == Q_REMOVE ? "-x '*/*/*' " : "", p->id, path); + if (sh(cmd)) { snprintf(why, sizeof why, "could not be unpacked (temporary space full? %s)", WORK); err = why; break; } p->dir[0] = 0; /* the zip holds one top folder with install.sh / uninstall.sh */ snprintf(path, sizeof path, WORK "/%s", p->id); DIR *d = opendir(path); From a6d03e0b0faaec936c342ec5f6aaa12c87f51fed Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 00:02:53 +0000 Subject: [PATCH 5/8] An MPC.settings entry whose plugin folder was deleted is not an install A plugin deleted by another tool kept its MPC.settings entry, so the manager counted it installed and UPDATE ALL put it back where it was deleted (the internal SD on a Force) instead of on the picked drive. An entry whose file is gone while its Synths folder is there now reads as not installed; a drive that is not mounted keeps its plugins listed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CpoP2rYBzwj7RsAk3nfygS --- src/manager.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/manager.c b/src/manager.c index 00e3919..577e219 100644 --- a/src/manager.c +++ b/src/manager.c @@ -2462,6 +2462,16 @@ static void scan_installed(const device_t *d, pkg_t *pkg, int n) { char *sl = strrchr(folder, '/'); if (!sl) continue; *sl = 0; + /* An entry whose plugin folder is gone from a drive that is there (deleted by hand or by another tool, the entry left behind) + * is not an install: counted as one, UPDATE put the plugin back where it was deleted instead of on the picked drive (Force, + * 2026-11-18). A drive that is not mounted (its Synths folder missing too) keeps its plugins listed as installed. */ + if (!is_file(en->file)) { + char drv[256]; /* the Synths folder: what comes before "/ - VST - " (also in the SDK layout's ".../VST/x.so") */ + snprintf(drv, sizeof drv, "%s", folder); + char *v = strstr(drv, " - VST - "); + while (v && v > drv && v[-1] != '/') v--; + if (v && v > drv + 1) { v[-1] = 0; if (is_dir(drv)) continue; } + } /* Akai's SDK layout keeps the binary one level down (" - VST - /VST/-arm64.so"): the plugin folder is the parent */ if (!strstr((sl = strrchr(folder, '/')) ? sl : folder, " - VST - ") && sl && sl != folder) { *sl = 0; From cad78b93b0dd74126676b830df66a27467d35640 Mon Sep 17 00:00:00 2001 From: sd88me <323365234+sd88me@users.noreply.github.com> Date: Thu, 19 Nov 2026 11:18:21 +1100 Subject: [PATCH 6/8] Say why an addin cannot be installed when /data/mpc-addins is not writable (#5) The 'has no install location' message covered the Synths folders and the addins folder alike; a Live 1 report listed usable Synths folders and still got it. Co-Authored-By: Claude --- src/manager.c | 3 ++- tests/run.sh | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/manager.c b/src/manager.c index 654347a..32f6cd9 100644 --- a/src/manager.c +++ b/src/manager.c @@ -2950,7 +2950,8 @@ static void prepare(mgr_t *m, pkg_t *q) { snprintf(dirp, sizeof dirp, "%s/%s", target, strrchr(fo, '/') ? strrchr(fo, '/') + 1 : fo); /* quoted below (shq): L'Cronx - VST - ... */ char dq[1200]; shq(dirp, dq, sizeof dq); - if (!synths[0] || !safe(synths) || (is_addin(p) && !m->dev->addins[0])) { err = "has no install location"; break; } + if (is_addin(p) && !m->dev->addins[0]) { err = "cannot be installed: this MPC has no writable " ADDINS_DIR " for addins"; break; } + if (!synths[0] || !safe(synths)) { err = "has no install location"; break; } if (is_addin(p) && p->queued == Q_INSTALL) fprintf(f, "echo '-- install %s %s'\nitem '%s' '%s' install '%s' sh '%s/install.sh' -y -n -t '%s' && rm -rf '" WORK "/%s' '" WORK "/%s.zip'\n", p->id, p->latest, p->id, dq, p->latest, p->dir, synths, p->id, p->id); diff --git a/tests/run.sh b/tests/run.sh index fa6c5d2..9f7cfb3 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -103,6 +103,11 @@ grep -q 54574e31 /media/az01-internal/Settings/MPC/MPC.settings || { echo "FAIL: rm -rf /tmp/openmpc-pm; /tmp/drive_addins twin > /tmp/reg-twin.out grep -q "card 1: TB .*state=3 inst=1" /tmp/reg-twin.out || { cat /tmp/reg-twin.out; echo "FAIL #22: Twin B is not listed as installed"; exit 1; } grep -q "card 2: -" /tmp/reg-twin.out || { cat /tmp/reg-twin.out; echo "FAIL #22: Twin A counted as installed through the shared uid"; exit 1; } +# #5: an addin on an MPC with no writable /data says so, not "has no install location" (which is about the Synths folders) +rm -rf /media /sdcard /nvme /synths /data /tmp/openmpc-pm /tmp/pm-mounts; mkdir -p /media; sh tests/devices/mpc-one.sh +rm -rf /tmp/openmpc-pm; /tmp/drive_addins one "Beta addin" 3 > /tmp/reg-noaddin.out || true +grep -qF "this MPC has no writable /data/mpc-addins for addins" /tmp/reg-noaddin.out || { cat /tmp/reg-noaddin.out; echo "FAIL #5: the addin message"; exit 1; } +! grep -q "has no install location" /tmp/reg-noaddin.out || { echo "FAIL #5: the misleading message"; exit 1; } echo "regress OK" fi # regress if want vst2; then From 85123774d98dcccba55f70bca1b7e18e5fd1ace2 Mon Sep 17 00:00:00 2001 From: sd88me <323365234+sd88me@users.noreply.github.com> Date: Thu, 19 Nov 2026 11:18:21 +1100 Subject: [PATCH 7/8] Web page: Plugin Manager version and GitHub link in the header, a GitHub link per plugin in its details (#13) Co-Authored-By: Claude --- src/web_page.h | 7 ++++--- src/web_page.html | 7 ++++--- tests/run.sh | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/web_page.h b/src/web_page.h index c0ccd60..9be23e6 100644 --- a/src/web_page.h +++ b/src/web_page.h @@ -21,6 +21,7 @@ static const char WEB_PAGE[] = ".card h2 { font:700 22px/1.05 system-ui; text-transform:uppercase; margin:0; cursor:pointer; } .card h2:hover { color:var(--a); }\n" ".by { color:var(--m); font-size:13px; margin-top:2px; }\n" ".ver { font:500 12px/1 system-ui; background:#1b1c1f; color:#f4f4f4; border-radius:3px; padding:6px 8px; white-space:nowrap; }\n" + ".hdver { font:500 13px system-ui; margin:0 auto 6px 12px; align-self:flex-end; } .hdver a { color:inherit; }\n" ".card p { margin:0; font-size:14px; }\n" ".tags { display:flex; gap:6px; flex-wrap:wrap; }\n" ".tag { font:600 10px/1 system-ui; letter-spacing:.1em; text-transform:uppercase; color:var(--m); border:1px solid var(--l); border-radius:3px; padding:5px 7px; }\n" @@ -50,7 +51,7 @@ static const char WEB_PAGE[] = ".pg { height:6px; background:var(--l); border-radius:3px; overflow:hidden; margin:4px 0 0; } .pg i { display:block; height:100%; background:var(--a); }\n" "\n" "
\n" - "

Plugin Manager

\n" + "

Plugin Manager

\n" "

Loading…

\n" "
\n" "
\n" @@ -108,7 +109,7 @@ static const char WEB_PAGE[] = " try {\n" " const t = await (await fetch('/api/state', {cache: 'no-store'})).text();\n" " if (t == load.last) return; // unchanged: keep the page as it is (an open file picker, a half-typed search)\n" - " load.last = t; S = JSON.parse(t); if (!S.busy && !S.queued) load.restart = false; draw();\n" + " load.last = t; S = JSON.parse(t); { const a = document.querySelector('#pmver a'); if (a && S.version) a.textContent = 'v' + S.version + ' · GitHub'; } if (!S.busy && !S.queued) load.restart = false; draw();\n" " }\n" " catch (e) {\n" " $('st').className = 'e';\n" @@ -152,7 +153,7 @@ static const char WEB_PAGE[] = " (big && (c.tags || []).length \? `
${c.tags.map(x => `#${esc(x)}`).join('')}
` : '') +\n" " `
Updated
${esc(c.updated || v.date || 'n/a')}
Downloads
${(c.downloads || 0).toLocaleString()}
` +\n" " (big && tested \? `
Tested on
${tested}
` : '') + (big && c.license \? `
Licence
${esc(c.license)}
` : '') +\n" - " (big && c.repo \? `
Source
${esc(c.repo)}
` : '') + `
` +\n" + " (big && c.repo && /^[\\w.-]+\\/[\\w.-]+$/.test(c.repo) \? `
GitHub
${esc(c.repo)}
` : big && c.repo \? `
Source
${esc(c.repo)}
` : '') + `` +\n" " `
${b}
${open[p.id] || ''}`;\n" "}\n" "function more(id) { draw.modal = id; $('modal').hidden = false; draw(); }\n" diff --git a/src/web_page.html b/src/web_page.html index 471943d..cbb401a 100644 --- a/src/web_page.html +++ b/src/web_page.html @@ -19,6 +19,7 @@ .card h2 { font:700 22px/1.05 system-ui; text-transform:uppercase; margin:0; cursor:pointer; } .card h2:hover { color:var(--a); } .by { color:var(--m); font-size:13px; margin-top:2px; } .ver { font:500 12px/1 system-ui; background:#1b1c1f; color:#f4f4f4; border-radius:3px; padding:6px 8px; white-space:nowrap; } +.hdver { font:500 13px system-ui; margin:0 auto 6px 12px; align-self:flex-end; } .hdver a { color:inherit; } .card p { margin:0; font-size:14px; } .tags { display:flex; gap:6px; flex-wrap:wrap; } .tag { font:600 10px/1 system-ui; letter-spacing:.1em; text-transform:uppercase; color:var(--m); border:1px solid var(--l); border-radius:3px; padding:5px 7px; } @@ -48,7 +49,7 @@ .pg { height:6px; background:var(--l); border-radius:3px; overflow:hidden; margin:4px 0 0; } .pg i { display:block; height:100%; background:var(--a); }
-

Plugin Manager

+

Plugin Manager

Loading…

@@ -106,7 +107,7 @@ try { const t = await (await fetch('/api/state', {cache: 'no-store'})).text(); if (t == load.last) return; // unchanged: keep the page as it is (an open file picker, a half-typed search) - load.last = t; S = JSON.parse(t); if (!S.busy && !S.queued) load.restart = false; draw(); + load.last = t; S = JSON.parse(t); { const a = document.querySelector('#pmver a'); if (a && S.version) a.textContent = 'v' + S.version + ' · GitHub'; } if (!S.busy && !S.queued) load.restart = false; draw(); } catch (e) { $('st').className = 'e'; @@ -150,7 +151,7 @@ (big && (c.tags || []).length ? `
${c.tags.map(x => `#${esc(x)}`).join('')}
` : '') + `
Updated
${esc(c.updated || v.date || 'n/a')}
Downloads
${(c.downloads || 0).toLocaleString()}
` + (big && tested ? `
Tested on
${tested}
` : '') + (big && c.license ? `
Licence
${esc(c.license)}
` : '') + - (big && c.repo ? `
Source
${esc(c.repo)}
` : '') + `
` + + (big && c.repo && /^[\w.-]+\/[\w.-]+$/.test(c.repo) ? `
GitHub
${esc(c.repo)}
` : big && c.repo ? `
Source
${esc(c.repo)}
` : '') + `` + `
${b}
${open[p.id] || ''}`; } function more(id) { draw.modal = id; $('modal').hidden = false; draw(); } diff --git a/tests/run.sh b/tests/run.sh index 9f7cfb3..6c08521 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -546,6 +546,7 @@ grep -q "\"id\":\"new-os-only\"" /tmp/web-3101.out || { echo "min_os 3.10.1 must rm -rf /media /sdcard /nvme /synths /data /tmp/openmpc-pm /tmp/pm-mounts; mkdir -p /media sh tests/devices/mpc-one.sh && sh tests/addins.sh grep -q "

Plugin Manager

" /tmp/web.out +grep -q "href=\"https://github.com/open-mpc/plugin-manager\"" /tmp/web.out && grep -q "github.com/\${esc(c.repo)}" /tmp/web.out && grep -q "\"version\":\"" /tmp/web.out # #13: the version, the project link, a GitHub link per plugin grep -q "^screen status: On your phone or computer: http://[0-9.]*:8790$" /tmp/web.out # the address on the screen grep -q "404 Not Found" /tmp/web.out [ "$(grep -c "403 Forbidden" /tmp/web.out)" = 2 ] # no X-PM header; a foreign Origin From 7e33b7cecae3a302a332a29d2bee155b03aa2f31 Mon Sep 17 00:00:00 2001 From: sd88me <323365234+sd88me@users.noreply.github.com> Date: Thu, 19 Nov 2026 13:21:03 +1100 Subject: [PATCH 8/8] 1.3.6 Co-Authored-By: Claude --- src/manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/manager.c b/src/manager.c index 30026c0..c093088 100644 --- a/src/manager.c +++ b/src/manager.c @@ -74,7 +74,7 @@ typedef struct { #endif /* The version of this build, shown on the ABOUT page. The release workflow fails when its version input differs from this. */ #ifndef PM_VERSION -#define PM_VERSION "1.3.5" +#define PM_VERSION "1.3.6" #endif #define WORK "/tmp/openmpc-pm" #define MAXPKG 1024 /* cards kept: the catalog (272 plugins on 2026-11-17), then local zips and unregistered folders; what does not fit is logged */