buninu 0.4.10 → 0.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.12 - 2026-09-20
4
+
5
+ ### Fixed
6
+
7
+ - Make Buninu's shell scripts parse and run under bunmsh as well as a POSIX
8
+ shell. The jsmdcui and musl-la launchers now use the `for name; do` form
9
+ accepted by bunmsh, and jsmdcui avoids bracket expressions in parameter
10
+ trimming while preserving case-insensitive Markdown suffix detection
11
+ - Make `make-bunBin.sh` bunmsh-compatible by replacing its `case`, shell-option,
12
+ command-scoped `CDPATH`, `cd --` and `trap` usage with portable conditionals,
13
+ explicit failure handling and temporary-directory cleanup
14
+ - Use explicit `1>&2` stderr redirection in `bun.sh` and `make-bunBin.sh`.
15
+ bunmsh interpreted the abbreviated `>&2` form as an output file named `&2`
16
+
17
+ ## 0.4.11 - 2026-09-20
18
+
19
+ - Emergency fix: multicall.sh on Buninu Linux
20
+ * /proc/$$/cmdline: /bin/bun /bin/sh ...
21
+
3
22
  ## 0.4.10 - 2026-09-20
4
23
 
5
24
  ### Fixed
@@ -1,8 +1,6 @@
1
1
  #!/bin/sh
2
2
 
3
- set -eu
4
-
5
- sd=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
3
+ sd=$(cd "$(dirname "$0")" && pwd)
6
4
 
7
5
  show_help() {
8
6
  cat <<EOF
@@ -28,15 +26,13 @@ no_backup/bin when it is newer than the selected Bun executable.
28
26
  EOF
29
27
  }
30
28
 
31
- case ${1-} in
32
- -h|--help)
33
- show_help
34
- exit 0
35
- ;;
36
- esac
29
+ if [ "${1-}" = -h ] || [ "${1-}" = --help ]; then
30
+ show_help
31
+ exit 0
32
+ fi
37
33
 
38
34
  if [ "$#" -ne 1 ]; then
39
- show_help >&2
35
+ show_help 1>&2
40
36
  exit 2
41
37
  fi
42
38
 
@@ -52,13 +48,16 @@ output=$sd/bunBin.tgz
52
48
 
53
49
  for command in curl unzip tar mktemp; do
54
50
  if ! command -v "$command" >/dev/null 2>&1; then
55
- echo "Required command not found: $command" >&2
51
+ echo "Required command not found: $command" 1>&2
56
52
  exit 127
57
53
  fi
58
54
  done
59
55
 
60
56
  tmp=$(mktemp -d "${TMPDIR:-/tmp}/make-bunBin.XXXXXX")
61
- trap 'rm -rf "$tmp"' EXIT HUP INT TERM
57
+
58
+ cleanup() {
59
+ rm -rf "$tmp"
60
+ }
62
61
 
63
62
  download_bun() {
64
63
  asset=$1
@@ -67,9 +66,18 @@ download_bun() {
67
66
  archive=$tmp/$asset.zip
68
67
 
69
68
  echo "Downloading $asset for Bun $tag..."
70
- curl --fail --location --retry 3 --output "$archive" "$base_url/$asset.zip"
71
- unzip -p "$archive" "$asset/$member" >"$tmp/$destination"
72
- chmod 755 "$tmp/$destination"
69
+ if ! curl --fail --location --retry 3 --output "$archive" "$base_url/$asset.zip"; then
70
+ cleanup
71
+ exit 1
72
+ fi
73
+ if ! unzip -p "$archive" "$asset/$member" >"$tmp/$destination"; then
74
+ cleanup
75
+ exit 1
76
+ fi
77
+ if ! chmod 755 "$tmp/$destination"; then
78
+ cleanup
79
+ exit 1
80
+ fi
73
81
  }
74
82
 
75
83
  download_bun bun-linux-aarch64 bun bun-la
@@ -77,8 +85,15 @@ download_bun bun-linux-x64 bun bun-lx
77
85
  download_bun bun-windows-x64 bun.exe bun-wx.exe
78
86
 
79
87
  # bun.sh extracts this archive directly into no_backup/bin.
80
- tar -czf "$tmp/bunBin.tgz" -C "$tmp" bun-la bun-lx bun-wx.exe
81
- mv "$tmp/bunBin.tgz" "$output"
88
+ if ! tar -czf "$tmp/bunBin.tgz" -C "$tmp" bun-la bun-lx bun-wx.exe; then
89
+ cleanup
90
+ exit 1
91
+ fi
92
+ if ! mv "$tmp/bunBin.tgz" "$output"; then
93
+ cleanup
94
+ exit 1
95
+ fi
96
+ cleanup
82
97
 
83
98
  echo "Created $output"
84
99
  tar -tzvf "$output"
@@ -2,10 +2,15 @@
2
2
 
3
3
  sd=$(dirname "$(realpath "$0")")
4
4
 
5
- for arg do
6
- case "$arg" in
7
- *.[mM][dD]|--demo*|--cdp-maze) exec bun "$sd"/src/index.js --mdcui "$@" ;;
8
- esac
5
+ for arg; do
6
+ if [ "${arg%.md}" != "$arg" ] ||
7
+ [ "${arg%.mD}" != "$arg" ] ||
8
+ [ "${arg%.Md}" != "$arg" ] ||
9
+ [ "${arg%.MD}" != "$arg" ] ||
10
+ [ "${arg#--demo}" != "$arg" ] ||
11
+ [ "$arg" = --cdp-maze ]; then
12
+ exec bun "$sd"/src/index.js --mdcui "$@"
13
+ fi
9
14
  done
10
15
 
11
16
  exec bun "$sd"/src/index.js "$@"
@@ -15,7 +15,7 @@ if [ "$1" = -e ] ; then
15
15
  fi
16
16
 
17
17
  elfdir=
18
- for arg do
18
+ for arg; do
19
19
  if [ -f "$arg" ] ; then
20
20
  elf_magic=$(od -A n -t x1 -N 4 "$arg" 2>/dev/null | tr -d '[:space:]')
21
21
  if [ "$elf_magic" = 7f454c46 ] ; then
package/bin/bun.sh CHANGED
@@ -53,5 +53,5 @@ for pathDir in ${PATH:-} ; do
53
53
  done
54
54
  IFS=$oldIFS
55
55
 
56
- echo "Bun Binary not found: $bunBin (and no external Bun found in PATH)" >&2
56
+ echo "Bun Binary not found: $bunBin (and no external Bun found in PATH)" 1>&2
57
57
  exit 127
package/bin/bunmsh.sh CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  sd=$(dirname "$(realpath "$0")")
4
4
 
5
- exec bun "$sd"/../apps/bunmsh/bunmsh "$@"
5
+ exec bun "$sd"/../apps/bunmsh/index.js "$@"
package/bin/multicall.sh CHANGED
@@ -2,7 +2,18 @@
2
2
 
3
3
  if [ -f /proc/$$/cmdline ] ; then
4
4
  args=$(tr '\0' '\n' < /proc/$$/cmdline)
5
- caller=$(echo "$args" | head -n 1)
5
+ caller=$(printf '%s\n' "$args" | head -n 1)
6
+
7
+ # Buninu Linux implements /bin/sh in Bun. Its interpreter chain makes the
8
+ # first three cmdline entries /bin/bun, /bin/sh, and the invoked launcher;
9
+ # Android's native loader instead keeps the launcher in the first entry.
10
+ # Match only the exact Buninu chain so the existing Android and conventional
11
+ # Linux paths retain their current behaviour.
12
+ second=$(printf '%s\n' "$args" | head -n 2 | tail -n 1)
13
+ if [ "$caller" = /bin/bun ] && [ "$second" = /bin/sh ] ; then
14
+ caller=$(printf '%s\n' "$args" | head -n 3 | tail -n 1)
15
+ fi
16
+
6
17
  callerb=$(basename "$caller")
7
18
  else
8
19
  callerb=$(basename "$0")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buninu",
3
- "version": "0.4.10",
3
+ "version": "0.4.12",
4
4
  "description": "Buninu is a portable, self-bootstrapping Unix-like userspace built on Bun that runs across operating systems",
5
5
  "type": "module",
6
6
  "main": "./bin/init.js",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "scripts": {
55
55
  "start": "bun ./apps/jsgotty/gotty.js --reconnect -r -w --webgl -a 127.0.0.1",
56
- "local": "bun ./apps/bunmsh/bunmsh -c 'exec bunmsh'",
56
+ "local": "bun ./apps/bunmsh/index.js -c 'exec bunmsh'",
57
57
  "check": "node --check ./bin/init.js"
58
58
  }
59
59
  }