@dotpi/tools 2.10.2 → 2.11.0
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/dotpi_root/bin/dotpi_prepare_system +63 -61
- package/dotpi_root/dist/@dotpi/module/LICENSE +28 -0
- package/dotpi_root/dist/@dotpi/module/package.json +3 -2
- package/dotpi_root/dist/@dotpi/module/src/install.js +13 -43
- package/dotpi_root/dist/@dotpi/module-module/LICENSE +28 -0
- package/dotpi_root/dist/@dotpi/module-module/package.json +4 -3
- package/dotpi_root/etc/dotpi_environment_default.bash +5 -0
- package/package.json +3 -3
|
@@ -190,35 +190,37 @@ while ! N_PREFIX="$N_PREFIX" bash /tmp/n-install -y -a "$node_arch" "$dotpi_node
|
|
|
190
190
|
sudo mkdir -p -- "$N_PREFIX"
|
|
191
191
|
done
|
|
192
192
|
|
|
193
|
-
|
|
194
193
|
rm -f /tmp/n-install
|
|
195
194
|
|
|
196
195
|
|
|
197
|
-
|
|
198
|
-
# echo "
|
|
199
|
-
# # dotpi: force the usage of -a for correct architecture
|
|
200
|
-
# # (n relies on uname, which tells about the kernel, not the executables)
|
|
201
|
-
|
|
202
|
-
# alias n='${environment_variables[*]} n -a ${node_arch}'
|
|
203
|
-
# " >> "${HOME}/.bashrc" || {
|
|
204
|
-
# error_exit $? "n alias in /root/.bashrc" $error_exit_code_node
|
|
205
|
-
# }
|
|
206
|
-
|
|
207
196
|
source_path="${N_PREFIX}/bin"
|
|
208
197
|
destination_path="/usr/bin"
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
198
|
+
|
|
199
|
+
n_path_to_symlinks() (
|
|
200
|
+
cd "${N_PREFIX}/bin" || {
|
|
201
|
+
error_exit $? "cd ${N_PREFIX}/bin" $error_exit_code_node
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
for executable in * ; do
|
|
205
|
+
sudo ln -s -f "${source_path}/${executable}" "${destination_path}/${executable}" || {
|
|
206
|
+
error_exit $? "symlink to ${destination_path}/${executable}" $error_exit_code_node
|
|
207
|
+
}
|
|
208
|
+
done
|
|
215
209
|
)
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
210
|
+
|
|
211
|
+
# bootstrap: node, npm
|
|
212
|
+
n_path_to_symlinks
|
|
213
|
+
|
|
214
|
+
# pnpm is mandatory for node modules
|
|
215
|
+
for package in "${dotpi_node_install_default[@]}" "${dotpi_node_install[@]}" ; do
|
|
216
|
+
npm -g install "$package" || {
|
|
217
|
+
error_exit $? "npm install ${package}" $error_exit_code_node
|
|
218
|
+
}
|
|
220
219
|
done
|
|
221
220
|
|
|
221
|
+
# update: pnpm
|
|
222
|
+
n_path_to_symlinks
|
|
223
|
+
|
|
222
224
|
############## services and modules
|
|
223
225
|
error_exit_code_services=4
|
|
224
226
|
|
|
@@ -230,46 +232,46 @@ sudo loginctl enable-linger "$FIRSTUSER" || {
|
|
|
230
232
|
|
|
231
233
|
############# dotpi module manager
|
|
232
234
|
|
|
233
|
-
# bootstrap-install
|
|
234
|
-
module_name="@dotpi/module-module"
|
|
235
|
-
source_path="${DOTPI_ROOT}/dist/${module_name}"
|
|
236
|
-
destination_prefix="${DOTPI_ROOT}/lib"
|
|
237
|
-
destination_path="${destination_prefix}/node_modules/${module_name}"
|
|
238
|
-
{
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
} || {
|
|
271
|
-
|
|
272
|
-
}
|
|
235
|
+
# # bootstrap-install
|
|
236
|
+
# module_name="@dotpi/module-module"
|
|
237
|
+
# source_path="${DOTPI_ROOT}/dist/${module_name}"
|
|
238
|
+
# destination_prefix="${DOTPI_ROOT}/lib"
|
|
239
|
+
# destination_path="${destination_prefix}/node_modules/${module_name}"
|
|
240
|
+
# {
|
|
241
|
+
# dotpi echo_info "Install ${module_name}"
|
|
242
|
+
# # minimal install in the modules directory
|
|
243
|
+
# sudo npm install --no-fund \
|
|
244
|
+
# --prefix "$destination_prefix" \
|
|
245
|
+
# --install-strategy nested \
|
|
246
|
+
# --omit dev \
|
|
247
|
+
# --save \
|
|
248
|
+
# --ignore-scripts \
|
|
249
|
+
# -- \
|
|
250
|
+
# "$source_path" || {
|
|
251
|
+
# error_exit $? "dotpi_module: error when installing '${module_name}'" $error_exit_code_services
|
|
252
|
+
# }
|
|
253
|
+
|
|
254
|
+
# (
|
|
255
|
+
# echo "# Install '${module_name}' dependencies"
|
|
256
|
+
# # complete install within the module itself
|
|
257
|
+
# # be sure to install links for relative dependencies also
|
|
258
|
+
# # run postinstall script
|
|
259
|
+
|
|
260
|
+
# sudo rm -rf "${destination_path}/node_modules" || {
|
|
261
|
+
# error_exit $? "rm ${destination_path}/node_modules" $error_exit_code_services
|
|
262
|
+
# }
|
|
263
|
+
|
|
264
|
+
# sudo npm install --no-fund \
|
|
265
|
+
# --prefix "$destination_path" \
|
|
266
|
+
# --omit dev \
|
|
267
|
+
# --install-links \
|
|
268
|
+
# || {
|
|
269
|
+
# error_exit $? "dotpi_module: error when installing '${module_name}' dependencies'" $error_exit_code_services
|
|
270
|
+
# }
|
|
271
|
+
# )
|
|
272
|
+
# } || {
|
|
273
|
+
# error_exit $? "${module_name}" $error_exit_code_services
|
|
274
|
+
# }
|
|
273
275
|
|
|
274
276
|
############## audio
|
|
275
277
|
error_exit_code_audio=6
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Copyright (c) 2023-present IRCAM – Centre Pompidou (France, Paris)
|
|
2
|
+
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
6
|
+
are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above copyright notice, this
|
|
12
|
+
list of conditions and the following disclaimer in the documentation and/or
|
|
13
|
+
other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
* Neither the name of the IRCAM nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
23
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
24
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
25
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
26
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
28
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotpi/module",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "dotpi module management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,5 +11,6 @@
|
|
|
11
11
|
"@dotpi/javascript": "^1.6.3",
|
|
12
12
|
"execa": "^9.5.2",
|
|
13
13
|
"globby": "^14.0.2"
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
|
+
"gitHead": "eda55d63aae1df93a85f0192bfc7305825bfce72"
|
|
15
16
|
}
|
|
@@ -35,17 +35,20 @@ export async function install(modules = [], {
|
|
|
35
35
|
switch (verbose) {
|
|
36
36
|
case '0':
|
|
37
37
|
case 'false':
|
|
38
|
+
case 'none':
|
|
38
39
|
case false:
|
|
39
40
|
verbose = 'none';
|
|
40
41
|
break;
|
|
41
42
|
|
|
42
43
|
case '1':
|
|
43
44
|
case 'true':
|
|
45
|
+
case 'short':
|
|
44
46
|
case true:
|
|
45
47
|
verbose = 'short';
|
|
46
48
|
break;
|
|
47
49
|
|
|
48
50
|
case '2':
|
|
51
|
+
case 'full':
|
|
49
52
|
verbose = 'full';
|
|
50
53
|
break;
|
|
51
54
|
}
|
|
@@ -78,62 +81,29 @@ export async function install(modules = [], {
|
|
|
78
81
|
let cwd;
|
|
79
82
|
|
|
80
83
|
if(verbose === 'full') {
|
|
81
|
-
console.log(`
|
|
84
|
+
console.log(`Installing '${moduleToInstall}'`);
|
|
82
85
|
}
|
|
83
|
-
const moduleDefinition = await definitionGet(moduleToInstall);
|
|
84
|
-
const { name: moduleName } = moduleDefinition;
|
|
85
|
-
|
|
86
|
-
// 2-steps install as npm errors when installing from git
|
|
87
|
-
// npm error git dep preparation failed
|
|
88
|
-
|
|
89
|
-
if(verbose !== 'none') {
|
|
90
|
-
echo.info(`Installing module '${moduleToInstall}' in '${dotpiModulesDestination}'`);
|
|
91
|
-
}
|
|
92
|
-
cwd = dotpiModulesDestination;
|
|
93
|
-
output = await $({
|
|
94
|
-
cwd,
|
|
95
|
-
env: { FORCE_COLOR: 'true' }, // do not remove colors
|
|
96
|
-
verbose: (verbose === 'full' ? 'full' : 'none'),
|
|
97
|
-
// minimal install in the modules directory
|
|
98
|
-
})`
|
|
99
|
-
npm --prefix ${cwd}
|
|
100
|
-
install --no-fund
|
|
101
|
-
--install-strategy nested
|
|
102
|
-
--omit dev
|
|
103
|
-
--save
|
|
104
|
-
--ignore-scripts
|
|
105
|
-
--
|
|
106
|
-
${moduleToInstall}
|
|
107
|
-
`;
|
|
108
86
|
|
|
87
|
+
// create link first, it may be used in postinstall scripts
|
|
109
88
|
await symlink(
|
|
110
89
|
path.join('.', 'node_modules'),
|
|
111
90
|
path.join(dotpiModulesDestination, 'dotpi_modules')
|
|
112
91
|
);
|
|
113
92
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
cwd = path.resolve(dotpiModulesDestination, 'node_modules', moduleName);
|
|
118
|
-
|
|
119
|
-
// perform a clean install
|
|
120
|
-
await fs.rm(path.resolve(cwd, 'node_modules'), {
|
|
121
|
-
recursive: true,
|
|
122
|
-
force: true,
|
|
123
|
-
});
|
|
93
|
+
const moduleDefinition = await definitionGet(moduleToInstall);
|
|
94
|
+
const { name: moduleName } = moduleDefinition;
|
|
124
95
|
|
|
96
|
+
cwd = dotpiModulesDestination;
|
|
125
97
|
output = await $({
|
|
126
98
|
cwd,
|
|
127
99
|
env: { FORCE_COLOR: 'true' }, // do not remove colors
|
|
128
100
|
verbose: (verbose === 'full' ? 'full' : 'none'),
|
|
129
|
-
//
|
|
130
|
-
// be sure to install links for relative dependencies also
|
|
131
|
-
// run postinstall script
|
|
101
|
+
// full install with postinstall scripts for each request
|
|
132
102
|
})`
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
--
|
|
136
|
-
|
|
103
|
+
npx pnpm install
|
|
104
|
+
--dangerously-allow-all-builds
|
|
105
|
+
--
|
|
106
|
+
${moduleToInstall}
|
|
137
107
|
`;
|
|
138
108
|
|
|
139
109
|
} catch (error) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Copyright (c) 2023-present IRCAM – Centre Pompidou (France, Paris)
|
|
2
|
+
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
6
|
+
are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above copyright notice, this
|
|
12
|
+
list of conditions and the following disclaimer in the documentation and/or
|
|
13
|
+
other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
* Neither the name of the IRCAM nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
23
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
24
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
25
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
26
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
28
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotpi/module-module",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "dotpi module management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./bin/dotpi_module",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"license": "BSD-3-clause",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@dotpi/javascript": "^1.6.3",
|
|
14
|
-
"@dotpi/module": "^1.
|
|
14
|
+
"@dotpi/module": "^1.10.0",
|
|
15
15
|
"commander": "^12.1.0"
|
|
16
|
-
}
|
|
16
|
+
},
|
|
17
|
+
"gitHead": "eda55d63aae1df93a85f0192bfc7305825bfce72"
|
|
17
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotpi/tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "Set of scripts for managing dotpi fleets of Raspberry Pi",
|
|
5
5
|
"author": "Jean-Philippe Lambert",
|
|
6
6
|
"contributors": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"license": "BSD-3-Clause",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@dotpi/javascript": "^1.6.3",
|
|
40
|
-
"@dotpi/module": "^1.
|
|
40
|
+
"@dotpi/module": "^1.10.0",
|
|
41
41
|
"chalk": "^5.3.0",
|
|
42
42
|
"commander": "^12.1.0",
|
|
43
43
|
"prompts": "^2.4.2",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"lerna": "^8.2.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "eda55d63aae1df93a85f0192bfc7305825bfce72"
|
|
50
50
|
}
|