penguins-eggs 9.3.28 → 9.3.30
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/.oclif.manifest.json +1 -1
- package/dist/classes/bleach.js +22 -22
- package/dist/classes/daddy.js +25 -25
- package/dist/classes/family/archlinux.js +16 -16
- package/dist/classes/family/debian.js +23 -23
- package/dist/classes/family/fedora.js +14 -14
- package/dist/classes/family/suse.js +14 -14
- package/dist/classes/incubation/distros/bionic.js +5 -4
- package/dist/classes/incubation/distros/buster.js +5 -4
- package/dist/classes/incubation/distros/focal.js +5 -4
- package/dist/classes/incubation/distros/jessie.js +2 -2
- package/dist/classes/incubation/distros/rolling.js +6 -4
- package/dist/classes/incubation/fisherman-helper/displaymanager.js +2 -2
- package/dist/classes/incubation/fisherman-helper/packages.js +6 -6
- package/dist/classes/incubation/fisherman.js +13 -17
- package/dist/classes/incubation/incubator.js +26 -25
- package/dist/classes/incubation/installer.js +5 -5
- package/dist/classes/keyboards.js +5 -5
- package/dist/classes/locales.js +6 -6
- package/dist/classes/n8.js +1 -1
- package/dist/classes/network.js +6 -0
- package/dist/classes/ovary.js +235 -225
- package/dist/classes/pacman.js +121 -121
- package/dist/classes/pve-live.js +2 -2
- package/dist/classes/pxe.js +32 -32
- package/dist/classes/settings.js +24 -24
- package/dist/classes/sources_list.js +8 -8
- package/dist/classes/systemctl.js +11 -11
- package/dist/classes/tailor.js +57 -57
- package/dist/classes/tools.js +2 -2
- package/dist/classes/users.js +2 -2
- package/dist/classes/utils.js +12 -12
- package/dist/classes/xdg.js +38 -38
- package/dist/classes/yolk.js +27 -27
- package/dist/commands/adapt.js +15 -9
- package/dist/commands/analyze.js +11 -11
- package/dist/commands/calamares.js +19 -19
- package/dist/commands/config.js +67 -67
- package/dist/commands/cuckoo.js +8 -8
- package/dist/commands/dad.js +8 -8
- package/dist/commands/export/deb.js +9 -9
- package/dist/commands/export/iso.js +8 -8
- package/dist/commands/install.js +8 -8
- package/dist/commands/kill.js +11 -12
- package/dist/commands/mom.js +5 -5
- package/dist/commands/produce.js +15 -15
- package/dist/commands/status.js +2 -2
- package/dist/commands/syncfrom.js +34 -34
- package/dist/commands/syncto.js +42 -42
- package/dist/commands/tools/clean.js +7 -7
- package/dist/commands/tools/ppa.js +17 -17
- package/dist/commands/tools/skel.js +11 -11
- package/dist/commands/tools/stat.js +2 -2
- package/dist/commands/tools/yolk.js +6 -6
- package/dist/commands/update.js +21 -21
- package/dist/commands/wardrobe/get.js +13 -7
- package/dist/commands/wardrobe/list.js +11 -5
- package/dist/commands/wardrobe/show.js +10 -7
- package/dist/commands/wardrobe/wear.js +16 -10
- package/dist/components/elements/information.js +16 -16
- package/dist/components/finished.js +4 -4
- package/dist/components/install.js +4 -4
- package/dist/components/keyboard.js +4 -4
- package/dist/components/location.js +4 -4
- package/dist/components/network.js +4 -4
- package/dist/components/partitions.js +4 -4
- package/dist/components/summary.js +4 -4
- package/dist/components/users.js +4 -4
- package/dist/components/welcome.js +4 -4
- package/dist/krill/krill-prepare.js +84 -84
- package/dist/krill/krill-sequence.js +140 -140
- package/dist/krill/modules/add-user.js +6 -6
- package/dist/krill/modules/bootloader-config-ubuntu.js +21 -21
- package/dist/krill/modules/bootloader.js +6 -6
- package/dist/krill/modules/change-password.js +2 -2
- package/dist/krill/modules/del-live-user.js +5 -5
- package/dist/krill/modules/fstab.js +10 -10
- package/dist/krill/modules/grubcfg.js +3 -3
- package/dist/krill/modules/initramfs-cfg.js +3 -3
- package/dist/krill/modules/initramfs.js +9 -9
- package/dist/krill/modules/locale.js +4 -4
- package/dist/krill/modules/m-keyboard.js +9 -9
- package/dist/krill/modules/m-timezone.js +3 -3
- package/dist/krill/modules/machine-id.js +3 -3
- package/dist/krill/modules/mkfs.js +6 -6
- package/dist/krill/modules/mount-fs.js +13 -13
- package/dist/krill/modules/mount-vfs.js +12 -12
- package/dist/krill/modules/network-cfg.js +5 -5
- package/dist/krill/modules/packages.js +10 -10
- package/dist/krill/modules/partition.js +69 -69
- package/dist/krill/modules/umount.js +6 -6
- package/dist/krill/modules/unpackfs.js +4 -4
- package/dist/lib/cli-autologin.js +12 -12
- package/dist/lib/select_keyboard_layout.js +2 -2
- package/dist/lib/select_keyboard_model.js +2 -2
- package/dist/lib/select_keyboard_option.js +2 -2
- package/dist/lib/select_keyboard_variant.js +2 -2
- package/dist/lib/select_languages.js +2 -2
- package/package.json +1 -1
package/dist/classes/tailor.js
CHANGED
|
@@ -10,14 +10,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
const chalk_1 = __importDefault(require("chalk"));
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const utils_1 = __importDefault(require("./utils"));
|
|
14
|
+
const utils_2 = require("../lib/utils");
|
|
15
15
|
const fs_1 = __importDefault(require("fs"));
|
|
16
16
|
const path_1 = __importDefault(require("path"));
|
|
17
17
|
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
18
|
+
const pacman_1 = __importDefault(require("./pacman"));
|
|
19
|
+
const distro_1 = __importDefault(require("./distro"));
|
|
20
|
+
const sources_list_1 = __importDefault(require("./sources_list"));
|
|
21
21
|
const pjson = require('../../package.json');
|
|
22
22
|
/**
|
|
23
23
|
*
|
|
@@ -43,13 +43,13 @@ class Tailor {
|
|
|
43
43
|
*/
|
|
44
44
|
async prepare(verbose = true, no_accessories = false, no_firmwares = false) {
|
|
45
45
|
this.verbose = verbose;
|
|
46
|
-
this.echo =
|
|
47
|
-
|
|
46
|
+
this.echo = utils_1.default.setEcho(verbose);
|
|
47
|
+
utils_1.default.warning(`preparing ${this.costume}`);
|
|
48
48
|
/**
|
|
49
49
|
* check curl presence
|
|
50
50
|
*/
|
|
51
|
-
if (!
|
|
52
|
-
|
|
51
|
+
if (!pacman_1.default.packageIsInstalled('curl')) {
|
|
52
|
+
utils_1.default.pressKeyToExit('In this tailoring shop we use curl. sudo apt update | apt install curl');
|
|
53
53
|
process.exit();
|
|
54
54
|
}
|
|
55
55
|
const tailorList = `${this.costume}/index.yml`;
|
|
@@ -62,7 +62,7 @@ class Tailor {
|
|
|
62
62
|
this.titles(`${this.category}: ${this.costume}`);
|
|
63
63
|
console.log('Tailor\'s list ' + chalk_1.default.cyan(tailorList) + ' is not found \non your wardrobe ' + chalk_1.default.cyan(this.wardrobe) + '.\n');
|
|
64
64
|
console.log('Costume will not be installed, operations will abort.\n');
|
|
65
|
-
|
|
65
|
+
utils_1.default.pressKeyToExit();
|
|
66
66
|
process.exit();
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
@@ -70,7 +70,7 @@ class Tailor {
|
|
|
70
70
|
this.titles(`${this.category}: ${this.costume}`);
|
|
71
71
|
console.log('Tailor\'s list ' + chalk_1.default.cyan(tailorList) + ' is not found \non your wardrobe ' + chalk_1.default.cyan(this.wardrobe) + '.\n');
|
|
72
72
|
console.log('Accessory will not be installed, operations will continue.\n');
|
|
73
|
-
|
|
73
|
+
utils_1.default.pressKeyToExit();
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
case 'try_accessory': {
|
|
@@ -82,19 +82,19 @@ class Tailor {
|
|
|
82
82
|
* distro e sources_list
|
|
83
83
|
* vengono definite qua perchè servono a tutti
|
|
84
84
|
*/
|
|
85
|
-
const distro = new
|
|
86
|
-
const sources_list = new
|
|
85
|
+
const distro = new distro_1.default();
|
|
86
|
+
const sources_list = new sources_list_1.default();
|
|
87
87
|
let step = '';
|
|
88
88
|
if (this.materials.distributions !== undefined) {
|
|
89
89
|
step = 'analyzing distribution';
|
|
90
|
-
|
|
90
|
+
utils_1.default.warning(step);
|
|
91
91
|
if (!await sources_list.distribution(this.materials.distributions)) {
|
|
92
92
|
switch (this.category) {
|
|
93
93
|
case 'costume': {
|
|
94
94
|
this.titles('step');
|
|
95
95
|
console.log('Costume ' + chalk_1.default.cyan(this.materials.name) + ' is not compatible \nwith your ' + chalk_1.default.cyan(distro.distroId + '/' + distro.codenameId) + ' system.\n');
|
|
96
96
|
console.log('Costume will not be installed, operations will abort.\n');
|
|
97
|
-
|
|
97
|
+
utils_1.default.pressKeyToExit();
|
|
98
98
|
process.exit();
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
@@ -102,7 +102,7 @@ class Tailor {
|
|
|
102
102
|
this.titles('step');
|
|
103
103
|
console.log('Accessory ' + chalk_1.default.cyan(this.materials.name) + ' is not compatible \nwith your ' + chalk_1.default.cyan(distro.distroId + '/' + distro.codenameId) + ' system.\n');
|
|
104
104
|
console.log('Accessory will not be installed, operations will continue.\n');
|
|
105
|
-
|
|
105
|
+
utils_1.default.pressKeyToExit();
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
case 'try_accessory': {
|
|
@@ -117,7 +117,7 @@ class Tailor {
|
|
|
117
117
|
*/
|
|
118
118
|
if (this.materials.sequence !== undefined) {
|
|
119
119
|
step = 'analyzing sequence';
|
|
120
|
-
|
|
120
|
+
utils_1.default.warning(step);
|
|
121
121
|
/**
|
|
122
122
|
* sequence/repositories
|
|
123
123
|
*/
|
|
@@ -128,7 +128,7 @@ class Tailor {
|
|
|
128
128
|
// evito di fallire se sources_list non è presente
|
|
129
129
|
if (this.materials.sequence.repositories.sources_list !== undefined) {
|
|
130
130
|
step = 'analyzing sources_list';
|
|
131
|
-
|
|
131
|
+
utils_1.default.warning(step);
|
|
132
132
|
// controllo i componenti solo se Debian/Devuab
|
|
133
133
|
if (distro.distroId === 'Debian' || distro.distroId === 'Devuan') {
|
|
134
134
|
await sources_list.components(this.materials.sequence.repositories.sources_list);
|
|
@@ -139,19 +139,19 @@ class Tailor {
|
|
|
139
139
|
*/
|
|
140
140
|
if (this.materials.sequence.repositories.sources_list_d !== undefined && this.materials.sequence.repositories.sources_list_d[0] !== null) {
|
|
141
141
|
step = 'adding repositories to /etc/apt/sources_list_d';
|
|
142
|
-
|
|
142
|
+
utils_1.default.warning(step);
|
|
143
143
|
for (const cmd of this.materials.sequence.repositories.sources_list_d) {
|
|
144
144
|
try {
|
|
145
145
|
// repeat 3 times if fail curl or others commands
|
|
146
146
|
for (let i = 0; i < 2; i++) {
|
|
147
|
-
const result = await (0,
|
|
147
|
+
const result = await (0, utils_2.exec)(cmd, this.echo);
|
|
148
148
|
if (result.code === 0) {
|
|
149
149
|
break;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
catch (error) {
|
|
154
|
-
await
|
|
154
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
@@ -163,18 +163,18 @@ class Tailor {
|
|
|
163
163
|
process.exit();
|
|
164
164
|
}
|
|
165
165
|
step = 'updating repositories';
|
|
166
|
-
|
|
166
|
+
utils_1.default.warning(step);
|
|
167
167
|
if (this.materials.sequence.repositories.update) {
|
|
168
|
-
await (0,
|
|
168
|
+
await (0, utils_2.exec)('apt-get update', utils_1.default.setEcho(false));
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
171
|
* sequence/repositories/upgrade
|
|
172
172
|
*/
|
|
173
173
|
if (this.materials.sequence.repositories.upgrade !== undefined) {
|
|
174
174
|
step = 'apt-get full-upgrade';
|
|
175
|
-
|
|
175
|
+
utils_1.default.warning(step);
|
|
176
176
|
if (this.materials.sequence.repositories.upgrade) {
|
|
177
|
-
await (0,
|
|
177
|
+
await (0, utils_2.exec)('apt-get full-upgrade -y', utils_1.default.setEcho(false));
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -184,14 +184,14 @@ class Tailor {
|
|
|
184
184
|
*/
|
|
185
185
|
if (this.materials.sequence.preinst !== undefined && Array.isArray(this.materials.sequence.preinst)) {
|
|
186
186
|
step = 'preinst scripts';
|
|
187
|
-
|
|
187
|
+
utils_1.default.warning(step);
|
|
188
188
|
for (const script of this.materials.sequence.preinst) {
|
|
189
189
|
if (fs_1.default.existsSync(`${this.costume}/${script}`)) {
|
|
190
|
-
await (0,
|
|
190
|
+
await (0, utils_2.exec)(`${this.costume}/${script}`, utils_1.default.setEcho(true));
|
|
191
191
|
}
|
|
192
192
|
else {
|
|
193
193
|
// exec script real env
|
|
194
|
-
await (0,
|
|
194
|
+
await (0, utils_2.exec)(`${script}`, utils_1.default.setEcho(true));
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -245,14 +245,14 @@ class Tailor {
|
|
|
245
245
|
*/
|
|
246
246
|
if (this.materials.sequence.debs !== undefined && this.materials.sequence.debs) {
|
|
247
247
|
step = 'installing local packages';
|
|
248
|
-
|
|
248
|
+
utils_1.default.warning(step);
|
|
249
249
|
let pathDebs = `${this.costume}/debs/${distro.codenameLikeId}`;
|
|
250
250
|
if (!fs_1.default.existsSync(pathDebs)) {
|
|
251
251
|
pathDebs = `${this.costume}/debs`;
|
|
252
252
|
}
|
|
253
253
|
// if exists pathDebs
|
|
254
254
|
if (fs_1.default.existsSync(pathDebs)) {
|
|
255
|
-
await (0,
|
|
255
|
+
await (0, utils_2.exec)(`dpkg -i ${pathDebs}/*.deb`);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
@@ -266,8 +266,8 @@ class Tailor {
|
|
|
266
266
|
pip += `, ${elem}`;
|
|
267
267
|
}
|
|
268
268
|
step = `installing python packages pip ${pip.slice(2)}`;
|
|
269
|
-
|
|
270
|
-
await (0,
|
|
269
|
+
utils_1.default.warning(step);
|
|
270
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
271
271
|
}
|
|
272
272
|
/**
|
|
273
273
|
* sequence/accessories
|
|
@@ -317,29 +317,29 @@ class Tailor {
|
|
|
317
317
|
*/
|
|
318
318
|
if (this.materials.customize.dirs && fs_1.default.existsSync(`/${this.costume}/dirs`)) {
|
|
319
319
|
step = 'copying dirs';
|
|
320
|
-
|
|
320
|
+
utils_1.default.warning(step);
|
|
321
321
|
let cmd = `rsync -avx ${this.costume}/dirs/* /`;
|
|
322
|
-
await (0,
|
|
322
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
323
323
|
// chown root:root /etc -R
|
|
324
324
|
cmd = 'chown root:root /etc/sudoers.d /etc/skel -R';
|
|
325
|
-
await (0,
|
|
325
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
326
326
|
/**
|
|
327
327
|
* Copyng skel in /home/user
|
|
328
328
|
*/
|
|
329
329
|
if (fs_1.default.existsSync(`${this.costume}/dirs/etc/skel`)) {
|
|
330
|
-
const user = await
|
|
330
|
+
const user = await utils_1.default.getPrimaryUser();
|
|
331
331
|
step = `copying skel in /home/${user}/`;
|
|
332
|
-
|
|
332
|
+
utils_1.default.warning(step);
|
|
333
333
|
cmd = `rsync -avx ${this.costume}/dirs/etc/skel/.config /home/${user}/`;
|
|
334
|
-
await (0,
|
|
335
|
-
await (0,
|
|
334
|
+
await (0, utils_2.exec)(cmd, this.echo);
|
|
335
|
+
await (0, utils_2.exec)(`chown ${user}:${user} /home/${user}/ -R`);
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
/**
|
|
339
339
|
* customize/hostname
|
|
340
340
|
*/
|
|
341
341
|
if (this.materials.customize.hostname) {
|
|
342
|
-
|
|
342
|
+
utils_1.default.warning(`changing hostname = ${this.materials.name}`);
|
|
343
343
|
await this.hostname();
|
|
344
344
|
}
|
|
345
345
|
/**
|
|
@@ -347,15 +347,15 @@ class Tailor {
|
|
|
347
347
|
*/
|
|
348
348
|
if (this.materials.customize.scripts !== undefined && Array.isArray(this.materials.customize.scripts)) {
|
|
349
349
|
step = 'customize script';
|
|
350
|
-
|
|
350
|
+
utils_1.default.warning(step);
|
|
351
351
|
for (const script of this.materials.customize.scripts) {
|
|
352
352
|
if (fs_1.default.existsSync(`${this.costume}/${script}`)) {
|
|
353
353
|
// exec script in costume passing costume-name
|
|
354
|
-
await (0,
|
|
354
|
+
await (0, utils_2.exec)(`${this.costume}/${script} ${this.materials.name}`, utils_1.default.setEcho(true));
|
|
355
355
|
}
|
|
356
356
|
else {
|
|
357
357
|
// exec script real env
|
|
358
|
-
await (0,
|
|
358
|
+
await (0, utils_2.exec)(`${script}`, utils_1.default.setEcho(true));
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
}
|
|
@@ -364,9 +364,9 @@ class Tailor {
|
|
|
364
364
|
* reboot
|
|
365
365
|
*/
|
|
366
366
|
if (this.materials.reboot) {
|
|
367
|
-
|
|
368
|
-
await
|
|
369
|
-
await (0,
|
|
367
|
+
utils_1.default.warning('Reboot');
|
|
368
|
+
await utils_1.default.pressKeyToExit('system need to reboot', true);
|
|
369
|
+
await (0, utils_2.exec)('reboot');
|
|
370
370
|
}
|
|
371
371
|
else {
|
|
372
372
|
console.log(`You look good with: ${this.materials.name}`);
|
|
@@ -383,16 +383,16 @@ class Tailor {
|
|
|
383
383
|
const packages_we_want = '/tmp/packages_we_want';
|
|
384
384
|
const packages_not_exists = '/tmp/packages_not_exists';
|
|
385
385
|
const packages_exists = '/tmp/packages_exists';
|
|
386
|
-
await (0,
|
|
387
|
-
await (0,
|
|
388
|
-
await (0,
|
|
386
|
+
await (0, utils_2.exec)(`rm -f ${packages_we_want}`);
|
|
387
|
+
await (0, utils_2.exec)(`rm -f ${packages_not_exists}`);
|
|
388
|
+
await (0, utils_2.exec)(`rm -f ${packages_exists}`);
|
|
389
389
|
/**
|
|
390
390
|
* packages_we_want
|
|
391
391
|
*/
|
|
392
392
|
let content = '';
|
|
393
393
|
packages.sort();
|
|
394
394
|
for (const elem of packages) {
|
|
395
|
-
if (!
|
|
395
|
+
if (!pacman_1.default.packageIsInstalled(elem)) {
|
|
396
396
|
content += elem + '\n';
|
|
397
397
|
}
|
|
398
398
|
}
|
|
@@ -400,12 +400,12 @@ class Tailor {
|
|
|
400
400
|
/**
|
|
401
401
|
* packages_exists
|
|
402
402
|
*/
|
|
403
|
-
await (0,
|
|
403
|
+
await (0, utils_2.exec)(`apt-cache --no-generate pkgnames | sort | comm -12 - ${packages_we_want} > ${packages_exists}`);
|
|
404
404
|
/**
|
|
405
405
|
* packages_not_exists
|
|
406
406
|
*/
|
|
407
407
|
if (verbose) {
|
|
408
|
-
await (0,
|
|
408
|
+
await (0, utils_2.exec)(`apt-cache --no-generate pkgnames | sort | comm -13 - ${packages_we_want} > ${packages_not_exists}`);
|
|
409
409
|
const not_exist_packages = fs_1.default.readFileSync(packages_not_exists, 'utf-8').split('\n');
|
|
410
410
|
if (not_exist_packages.length > 1) { // Una riga c'è sempre
|
|
411
411
|
let content = '';
|
|
@@ -416,7 +416,7 @@ class Tailor {
|
|
|
416
416
|
this.titles('tailor');
|
|
417
417
|
console.log('Following packages from ' + chalk_1.default.cyan(this.materials.name) + ' section: ' + chalk_1.default.cyan(section) + ', was not found:');
|
|
418
418
|
console.log(content);
|
|
419
|
-
|
|
419
|
+
utils_1.default.pressKeyToExit('Press a key to continue...');
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
return fs_1.default.readFileSync(packages_exists, 'utf-8').split('\n');
|
|
@@ -446,7 +446,7 @@ class Tailor {
|
|
|
446
446
|
const limit = 3;
|
|
447
447
|
for (let tempts = 1; tempts < limit; tempts++) {
|
|
448
448
|
this.titles(step);
|
|
449
|
-
|
|
449
|
+
utils_1.default.warning(`tempts ${tempts} of ${limit}`);
|
|
450
450
|
if (await tryCheckSuccess(cmd, this.echo)) {
|
|
451
451
|
break;
|
|
452
452
|
}
|
|
@@ -463,7 +463,7 @@ class Tailor {
|
|
|
463
463
|
*/
|
|
464
464
|
let file = '/etc/hostname';
|
|
465
465
|
let text = this.materials.name;
|
|
466
|
-
await (0,
|
|
466
|
+
await (0, utils_2.exec)(`rm ${file} `, this.echo);
|
|
467
467
|
fs_1.default.writeFileSync(file, text);
|
|
468
468
|
/**
|
|
469
469
|
* hosts
|
|
@@ -479,7 +479,7 @@ class Tailor {
|
|
|
479
479
|
text += 'ff02:: 1 ip6 - allnodes\n';
|
|
480
480
|
text += 'ff02:: 2 ip6 - allrouters\n';
|
|
481
481
|
text += 'ff02:: 3 ip6 - allhosts\n';
|
|
482
|
-
await (0,
|
|
482
|
+
await (0, utils_2.exec)(`rm ${file} `, this.echo);
|
|
483
483
|
fs_1.default.writeFileSync(file, text);
|
|
484
484
|
/**
|
|
485
485
|
* chenge config.snapshot.basename
|
|
@@ -514,7 +514,7 @@ exports.default = Tailor;
|
|
|
514
514
|
async function tryCheckSuccess(cmd, echo) {
|
|
515
515
|
let success = false;
|
|
516
516
|
try {
|
|
517
|
-
await (0,
|
|
517
|
+
await (0, utils_2.exec)(cmd, echo);
|
|
518
518
|
success = true;
|
|
519
519
|
}
|
|
520
520
|
catch {
|
package/dist/classes/tools.js
CHANGED
|
@@ -11,7 +11,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
13
13
|
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
14
|
-
const
|
|
14
|
+
const settings_1 = __importDefault(require("./settings"));
|
|
15
15
|
/**
|
|
16
16
|
* Utils: general porpourse utils
|
|
17
17
|
* @remarks all the utilities
|
|
@@ -44,7 +44,7 @@ class Tools {
|
|
|
44
44
|
/**
|
|
45
45
|
* da eggs
|
|
46
46
|
*/
|
|
47
|
-
const settings = new
|
|
47
|
+
const settings = new settings_1.default();
|
|
48
48
|
settings.load();
|
|
49
49
|
this.snapshot_dir = settings.config.snapshot_dir;
|
|
50
50
|
this.snapshot_name = settings.config.snapshot_prefix + settings.config.snapshot_basename + '_'; // + Utils.machineArch() + '_'
|
package/dist/classes/users.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
const
|
|
7
|
+
const utils_1 = require("../lib/utils");
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
@@ -116,7 +116,7 @@ class Users {
|
|
|
116
116
|
default: {
|
|
117
117
|
if (fs_1.default.existsSync(this.home)) {
|
|
118
118
|
hasHome = true;
|
|
119
|
-
const sizeUser = await (0,
|
|
119
|
+
const sizeUser = await (0, utils_1.exec)(` du --block-size=1 --summarize ${this.home} | awk '{print $1}'`, { echo: false, ignore: false, capture: true });
|
|
120
120
|
size = Number.parseInt(sizeUser.data);
|
|
121
121
|
}
|
|
122
122
|
saveIt = true;
|
package/dist/classes/utils.js
CHANGED
|
@@ -17,13 +17,13 @@ const path_1 = __importDefault(require("path"));
|
|
|
17
17
|
const os_1 = __importDefault(require("os"));
|
|
18
18
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
19
19
|
const chalk_1 = __importDefault(require("chalk"));
|
|
20
|
-
const
|
|
20
|
+
const pacman_1 = __importDefault(require("./pacman"));
|
|
21
21
|
// import { green, whiteBright } from 'chalk'
|
|
22
22
|
const child_process_1 = require("child_process");
|
|
23
23
|
const netmask_1 = require("netmask");
|
|
24
24
|
// libraries
|
|
25
|
-
const
|
|
26
|
-
const
|
|
25
|
+
const utils_1 = require("../lib/utils");
|
|
26
|
+
const distro_1 = __importDefault(require("./distro"));
|
|
27
27
|
const pjson = require('../../package.json');
|
|
28
28
|
/**
|
|
29
29
|
* Utils: general porpourse utils
|
|
@@ -97,7 +97,7 @@ class Utils {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
// Arch
|
|
100
|
-
let distro = new
|
|
100
|
+
let distro = new distro_1.default();
|
|
101
101
|
if (distro.distroId === 'Arch' || distro.distroId === 'RebornOS') {
|
|
102
102
|
vmlinuz = '/boot/vmlinuz-linux';
|
|
103
103
|
}
|
|
@@ -115,23 +115,23 @@ class Utils {
|
|
|
115
115
|
const path = vmlinuz.substring(0, vmlinuz.lastIndexOf('/')) + '/';
|
|
116
116
|
let initrd = '';
|
|
117
117
|
let version = '';
|
|
118
|
-
if (
|
|
118
|
+
if (pacman_1.default.distro().familyId === 'debian') {
|
|
119
119
|
initrd = 'initrd.img';
|
|
120
120
|
version = vmlinuz.substring(vmlinuz.indexOf('-'));
|
|
121
121
|
}
|
|
122
|
-
else if (
|
|
122
|
+
else if (pacman_1.default.distro().familyId === 'fedora') {
|
|
123
123
|
initrd = 'initramfs';
|
|
124
124
|
version = vmlinuz.substring(vmlinuz.indexOf('-')) + '.img';
|
|
125
125
|
}
|
|
126
|
-
else if (
|
|
126
|
+
else if (pacman_1.default.distro().familyId === 'archlinux') {
|
|
127
127
|
initrd = 'initramfs';
|
|
128
128
|
version = vmlinuz.substring(vmlinuz.indexOf('-')) + '.img';
|
|
129
129
|
}
|
|
130
|
-
else if (
|
|
130
|
+
else if (pacman_1.default.distro().familyId === 'suse') {
|
|
131
131
|
initrd = 'initrd';
|
|
132
132
|
version = vmlinuz.substring(vmlinuz.indexOf('-'));
|
|
133
133
|
}
|
|
134
|
-
let distro = new
|
|
134
|
+
let distro = new distro_1.default();
|
|
135
135
|
if (distro.distroId === 'Arch' || distro.distroId === 'RebornOS') {
|
|
136
136
|
initrd = '/boot/initramfs-linux.img';
|
|
137
137
|
}
|
|
@@ -167,7 +167,7 @@ class Utils {
|
|
|
167
167
|
* Return the primary user's name
|
|
168
168
|
*/
|
|
169
169
|
static async getPrimaryUser() {
|
|
170
|
-
let primaryUser = (await (0,
|
|
170
|
+
let primaryUser = (await (0, utils_1.exec)('/usr/bin/logname 2>/dev/null || echo ${SUDO_USER:-${USER}}', { echo: false, ignore: false, capture: true })).data.trim();
|
|
171
171
|
// if logname don't work seem we get '' so:
|
|
172
172
|
if (primaryUser === '') {
|
|
173
173
|
primaryUser = shelljs_1.default.exec('echo $SUDO_USER', { silent: true }).stdout.trim();
|
|
@@ -287,10 +287,10 @@ class Utils {
|
|
|
287
287
|
else if (arch === 'armel') {
|
|
288
288
|
machineUEFI = 'arm-efi';
|
|
289
289
|
}
|
|
290
|
-
if (
|
|
290
|
+
if (pacman_1.default.distro().familyId === 'fedora') {
|
|
291
291
|
machineUEFI = 'i386-efi';
|
|
292
292
|
}
|
|
293
|
-
else if (
|
|
293
|
+
else if (pacman_1.default.distro().familyId === 'suse') {
|
|
294
294
|
machineUEFI = 'i386-efi';
|
|
295
295
|
}
|
|
296
296
|
return machineUEFI;
|