oh-my-devpod 0.15.5 → 0.15.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-devpod",
3
- "version": "0.15.5",
3
+ "version": "0.15.7",
4
4
  "description": "Ubuntu productivity tool manager with the omd terminal interface",
5
5
  "license": "MIT",
6
6
  "author": "zhangdw156",
package/runtime/VERSION CHANGED
@@ -1 +1 @@
1
- 0.15.5
1
+ 0.15.7
package/runtime/bin/omd CHANGED
Binary file
@@ -201,14 +201,6 @@ trusted_prefix_resolved() {
201
201
  printf '%s\n' "${resolved}"
202
202
  }
203
203
 
204
- trusted_prefixes_equivalent() {
205
- local first="$1" second="$2" first_resolved second_resolved
206
- [[ "${first}" == /* && "${second}" == /* ]] || return 1
207
- first_resolved="$(trusted_prefix_resolved "${first}")" || return 1
208
- second_resolved="$(trusted_prefix_resolved "${second}")" || return 1
209
- [[ "${first_resolved}" == "${second_resolved}" ]]
210
- }
211
-
212
204
  prepare_prefix_parent() {
213
205
  if path_has_no_symlink_components "$(dirname "${prefix}")"; then
214
206
  ensure_safe_parent "${prefix}"
@@ -509,41 +501,25 @@ write_inventory_record() {
509
501
  mv -f "${temporary}" "${destination}"
510
502
  }
511
503
 
512
- legacy_formula_is_managed() {
513
- local owner_home="$1" formula="$2" owner_uid="${3:-}" marker marker_prefix
514
- marker="${owner_home}/.local/state/oh-my-devpod/managed/${formula}"
515
- [[ -f "${marker}" && ! -L "${marker}" ]] || return 1
516
- if [[ "${test_mode}" != "1" && -n "${owner_uid}" ]]; then
517
- [[ "$(stat_uid "${marker}")" == "${owner_uid}" ]] || return 1
518
- fi
519
- grep -qx 'managed_by=oh-my-devpod' "${marker}" || return 1
520
- grep -Fqx "component=${formula}" "${marker}" || return 1
521
- grep -qx 'kind=brew-formula' "${marker}" || return 1
522
- grep -Fqx "artifact=${formula}" "${marker}" || return 1
523
- marker_prefix="$(sed -n 's/^brew_prefix=//p' "${marker}")"
524
- [[ -n "${marker_prefix}" ]] || return 1
525
- trusted_prefixes_equivalent "${marker_prefix}" "${prefix}"
526
- }
527
-
528
504
  stage_legacy_inventory() {
529
- local owner_home="$1" owner_uid="$2" installation_id="$3" staging="$4" formula state provenance
505
+ local installation_id="$1" staging="$2" formula
530
506
  mkdir -p "${staging}"
531
507
  [[ -d "${prefix}/Cellar" ]] || return 0
532
508
  while IFS= read -r formula; do
533
509
  [[ -n "${formula}" ]] || continue
534
- state=external
535
- provenance=legacy-preexisting
536
- if legacy_formula_is_managed "${owner_home}" "${formula}" "${owner_uid}"; then
537
- state=managed
538
- provenance=legacy-marker
539
- fi
540
- write_inventory_record "${formula}" "${installation_id}" "${state}" "${provenance}" "${staging}/${formula}"
510
+ write_inventory_record "${formula}" "${installation_id}" managed legacy-managed-prefix "${staging}/${formula}"
541
511
  done < <(find "${prefix}/Cellar" -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | LC_ALL=C sort -u)
542
512
  }
543
513
 
544
514
  legacy_inventory_record_is_recoverable() {
545
- local record="$1" formula="$2" installation_id="$3"
515
+ local record="$1" formula="$2" installation_id="$3" service_uid="$4" service_gid="$5" mode
546
516
  [[ -f "${record}" && ! -L "${record}" ]] || return 1
517
+ if [[ "${test_mode}" != "1" ]]; then
518
+ [[ "$(stat_uid "${record}")" == "${service_uid}" && "$(stat_gid "${record}")" == "${service_gid}" ]] || return 1
519
+ mode="$(stat_mode "${record}")" || return 1
520
+ [[ "${mode}" =~ ^[0-7]{3,4}$ ]] || return 1
521
+ (( (8#${mode} & 8#022) == 0 )) || return 1
522
+ fi
547
523
  grep -qx 'managed_by=oh-my-devpod' "${record}" || return 1
548
524
  grep -Fqx "component=${formula}" "${record}" || return 1
549
525
  grep -qx 'kind=brew-formula' "${record}" || return 1
@@ -554,33 +530,8 @@ legacy_inventory_record_is_recoverable() {
554
530
  grep -qx 'provenance=legacy-preexisting' "${record}"
555
531
  }
556
532
 
557
- member_identity_for_recovery() {
558
- local record="$1" user uid home mode current_uid current_home
559
- [[ -f "${record}" && ! -L "${record}" ]] || return 1
560
- user="$(basename "${record}")"
561
- valid_account_name "${user}" || return 1
562
- if [[ "${test_mode}" != "1" ]]; then
563
- [[ "$(stat_uid "${record}")" == "0" && "$(stat_gid "${record}")" == "0" ]] || return 1
564
- mode="$(stat_mode "${record}")" || return 1
565
- [[ "${mode}" =~ ^[0-7]{3,4}$ ]] || return 1
566
- (( (8#${mode} & 8#022) == 0 )) || return 1
567
- fi
568
- grep -qx 'managed_by=oh-my-devpod' "${record}" || return 1
569
- grep -Fqx "user=${user}" "${record}" || return 1
570
- uid="$(sed -n 's/^uid=//p' "${record}")"
571
- home="$(sed -n 's/^home=//p' "${record}")"
572
- [[ "${uid}" =~ ^[0-9]+$ ]] || return 1
573
- [[ "${home}" == /* && -d "${home}" && ! -L "${home}" ]] || return 1
574
- if [[ "${test_mode}" != "1" ]]; then
575
- current_uid="$(id -u "${user}" 2>/dev/null)" || return 1
576
- current_home="$(passwd_home "${user}")"
577
- [[ "${uid}" == "${current_uid}" && "${home}" == "${current_home}" ]] || return 1
578
- fi
579
- printf '%s\t%s\n' "${uid}" "${home}"
580
- }
581
-
582
533
  recover_legacy_inventory() {
583
- local installation_id service_uid service_gid record formula member identity member_uid member_home recovered
534
+ local installation_id service_uid service_gid record formula recovered
584
535
  installation_id="$(manifest_value installation_id || true)"
585
536
  [[ -n "${installation_id}" ]] || return 0
586
537
  service_uid="$(account_uid "${service_user}")"
@@ -588,21 +539,14 @@ recover_legacy_inventory() {
588
539
  while IFS= read -r -d '' record; do
589
540
  formula="$(basename "${record}")"
590
541
  valid_formula_name "${formula}" || continue
591
- legacy_inventory_record_is_recoverable "${record}" "${formula}" "${installation_id}" || continue
592
- while IFS= read -r -d '' member; do
593
- identity="$(member_identity_for_recovery "${member}" || true)"
594
- [[ -n "${identity}" ]] || continue
595
- IFS=$'\t' read -r member_uid member_home <<< "${identity}"
596
- legacy_formula_is_managed "${member_home}" "${formula}" "${member_uid}" || continue
597
- recovered="${inventory_dir}/.${formula}.recovered.$$"
598
- write_inventory_record "${formula}" "${installation_id}" managed legacy-marker-recovered "${recovered}"
599
- chmod 0644 "${recovered}"
600
- if [[ "${test_mode}" != "1" ]]; then
601
- chown "${service_uid}:${service_gid}" "${recovered}"
602
- fi
603
- mv -f "${recovered}" "${record}"
604
- break
605
- done < <(find "${members_dir}" -mindepth 1 -maxdepth 1 -type f -print0)
542
+ legacy_inventory_record_is_recoverable "${record}" "${formula}" "${installation_id}" "${service_uid}" "${service_gid}" || continue
543
+ recovered="${inventory_dir}/.${formula}.recovered.$$"
544
+ write_inventory_record "${formula}" "${installation_id}" managed legacy-managed-prefix-recovered "${recovered}"
545
+ chmod 0644 "${recovered}"
546
+ if [[ "${test_mode}" != "1" ]]; then
547
+ chown "${service_uid}:${service_gid}" "${recovered}"
548
+ fi
549
+ mv -f "${recovered}" "${record}"
606
550
  done < <(find "${inventory_dir}" -mindepth 1 -maxdepth 1 -type f -print0)
607
551
  }
608
552
 
@@ -672,7 +616,7 @@ initialize_shared_state() {
672
616
  if [[ -e "${prefix}" || -L "${prefix}" ]]; then
673
617
  legacy_info="$(validate_legacy_prefix)"
674
618
  IFS=$'\t' read -r legacy_owner legacy_uid legacy_gid legacy_home <<< "${legacy_info}"
675
- stage_legacy_inventory "${legacy_home}" "${legacy_uid}" "${installation_id}" "${inventory_staging}"
619
+ stage_legacy_inventory "${installation_id}" "${inventory_staging}"
676
620
  else
677
621
  created_prefix=1
678
622
  if ! initialize_prefix "${mirror_profile}"; then
@@ -16,6 +16,7 @@ name = "Micromamba"
16
16
  description = "Lightweight Conda-compatible package manager"
17
17
  category = "foundation"
18
18
  module = "modules/core/micromamba.sh"
19
+ provider = "linuxbrew"
19
20
  requires = []
20
21
  install_requires = ["linuxbrew"]
21
22
  uninstall = true
@@ -26,6 +27,7 @@ name = "Zsh"
26
27
  description = "Interactive shell"
27
28
  category = "foundation"
28
29
  module = "modules/core/zsh.sh"
30
+ provider = "linuxbrew"
29
31
  requires = []
30
32
  install_requires = ["linuxbrew"]
31
33
  uninstall = true
@@ -36,6 +38,7 @@ name = "uv"
36
38
  description = "Fast Python package and project manager"
37
39
  category = "foundation"
38
40
  module = "modules/core/uv.sh"
41
+ provider = "linuxbrew"
39
42
  requires = []
40
43
  install_requires = ["linuxbrew"]
41
44
  uninstall = true
@@ -46,6 +49,7 @@ name = "Git"
46
49
  description = "Version control client"
47
50
  category = "development"
48
51
  module = "modules/tools/git.sh"
52
+ provider = "linuxbrew"
49
53
  requires = []
50
54
  install_requires = ["linuxbrew"]
51
55
  uninstall = true
@@ -56,6 +60,7 @@ name = "GitHub CLI"
56
60
  description = "Official command-line client for GitHub"
57
61
  category = "development"
58
62
  module = "modules/tools/gh.sh"
63
+ provider = "linuxbrew"
59
64
  requires = []
60
65
  install_requires = ["linuxbrew"]
61
66
  uninstall = true
@@ -76,6 +81,7 @@ name = "ripgrep"
76
81
  description = "Fast recursive text search"
77
82
  category = "terminal"
78
83
  module = "modules/tools/ripgrep.sh"
84
+ provider = "linuxbrew"
79
85
  requires = []
80
86
  install_requires = ["linuxbrew"]
81
87
  uninstall = true
@@ -86,6 +92,7 @@ name = "fzf"
86
92
  description = "Interactive fuzzy finder"
87
93
  category = "terminal"
88
94
  module = "modules/tools/fzf.sh"
95
+ provider = "linuxbrew"
89
96
  requires = []
90
97
  install_requires = ["linuxbrew"]
91
98
  uninstall = true
@@ -96,6 +103,7 @@ name = "bat"
96
103
  description = "Syntax-aware cat replacement"
97
104
  category = "terminal"
98
105
  module = "modules/tools/bat.sh"
106
+ provider = "linuxbrew"
99
107
  requires = []
100
108
  install_requires = ["linuxbrew"]
101
109
  uninstall = true
@@ -106,6 +114,7 @@ name = "fd"
106
114
  description = "Friendly and fast find replacement"
107
115
  category = "terminal"
108
116
  module = "modules/tools/fd.sh"
117
+ provider = "linuxbrew"
109
118
  requires = []
110
119
  install_requires = ["linuxbrew"]
111
120
  uninstall = true
@@ -116,6 +125,7 @@ name = "jq"
116
125
  description = "JSON processor"
117
126
  category = "terminal"
118
127
  module = "modules/tools/jq.sh"
128
+ provider = "linuxbrew"
119
129
  requires = []
120
130
  install_requires = ["linuxbrew"]
121
131
  uninstall = true
@@ -126,6 +136,7 @@ name = "yq"
126
136
  description = "YAML, JSON, XML, CSV, TOML, and properties processor"
127
137
  category = "terminal"
128
138
  module = "modules/tools/yq.sh"
139
+ provider = "linuxbrew"
129
140
  requires = []
130
141
  install_requires = ["linuxbrew"]
131
142
  uninstall = true
@@ -136,6 +147,7 @@ name = "Atuin"
136
147
  description = "Shell history search and synchronization"
137
148
  category = "terminal"
138
149
  module = "modules/tools/atuin.sh"
150
+ provider = "linuxbrew"
139
151
  requires = []
140
152
  install_requires = ["linuxbrew"]
141
153
  uninstall = true
@@ -146,6 +158,7 @@ name = "Zellij"
146
158
  description = "Terminal workspace and multiplexer"
147
159
  category = "terminal"
148
160
  module = "modules/tools/zellij.sh"
161
+ provider = "linuxbrew"
149
162
  requires = []
150
163
  install_requires = ["linuxbrew"]
151
164
  uninstall = true
@@ -156,6 +169,7 @@ name = "Yazi"
156
169
  description = "Terminal file manager"
157
170
  category = "terminal"
158
171
  module = "modules/tools/yazi.sh"
172
+ provider = "linuxbrew"
159
173
  requires = []
160
174
  install_requires = ["linuxbrew"]
161
175
  uninstall = true
@@ -166,6 +180,7 @@ name = "btop"
166
180
  description = "Interactive resource monitor"
167
181
  category = "terminal"
168
182
  module = "modules/tools/btop.sh"
183
+ provider = "linuxbrew"
169
184
  requires = []
170
185
  install_requires = ["linuxbrew"]
171
186
  uninstall = true
@@ -176,6 +191,7 @@ name = "witr"
176
191
  description = "Trace processes, ports, containers, and files to their launch chain"
177
192
  category = "terminal"
178
193
  module = "modules/tools/witr.sh"
194
+ provider = "linuxbrew"
179
195
  requires = []
180
196
  install_requires = ["linuxbrew"]
181
197
  uninstall = true
@@ -186,6 +202,7 @@ name = "Neovim"
186
202
  description = "Modern terminal editor"
187
203
  category = "editor"
188
204
  module = "modules/tools/neovim.sh"
205
+ provider = "linuxbrew"
189
206
  requires = []
190
207
  install_requires = ["linuxbrew"]
191
208
  uninstall = true