penguins-eggs 9.6.34 → 10.0.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/.oclif.manifest.json +1458 -1
- package/README.md +823 -8
- package/addons/eggs/theme/livecd/grub.main.cfg +4 -4
- package/addons/eggs/theme/livecd/isolinux.main.cfg +5 -5
- package/bin/dev.cmd +1 -1
- package/bin/dev.js +6 -0
- package/bin/run.js +5 -0
- package/conf/derivatives.yaml +2 -0
- package/conf/distros/buster/calamares/calamares-modules/bootloader-config/bootloader-config.sh +3 -3
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +1 -1
- package/conf/distros/buster/calamares/modules/fstab.yml +1 -1
- package/conf/distros/focal/calamares/modules/fstab.yml +1 -1
- package/conf/{exclude.list.homes → exclude.list.d/home.list} +6 -1
- package/conf/{exclude.list.template → exclude.list.d/master.list} +15 -24
- package/conf/exclude.list.d/var.list +21 -0
- package/conf/tools.yaml +1 -3
- package/dist/classes/bleach.d.ts +37 -0
- package/dist/classes/bleach.js +43 -91
- package/dist/classes/cfs.d.ts +17 -0
- package/dist/classes/cfs.js +15 -12
- package/dist/classes/compressors.d.ts +53 -0
- package/dist/classes/compressors.js +51 -58
- package/dist/classes/daddy.d.ts +18 -0
- package/dist/classes/daddy.js +93 -101
- package/dist/classes/distro.d.ts +26 -0
- package/dist/classes/distro.js +45 -27
- package/dist/classes/families/archlinux.d.ts +61 -0
- package/dist/classes/families/archlinux.js +56 -113
- package/dist/classes/families/debian.d.ts +65 -0
- package/dist/classes/families/debian.js +68 -143
- package/dist/classes/families/fedora.d.ts +52 -0
- package/dist/classes/families/fedora.js +43 -99
- package/dist/classes/families/mockup.d.ts +60 -0
- package/dist/classes/families/mockup.js +27 -46
- package/dist/classes/families/suse.d.ts +52 -0
- package/dist/classes/families/suse.js +45 -97
- package/dist/classes/incubation/branding.d.ts +17 -0
- package/dist/classes/incubation/branding.js +33 -32
- package/dist/classes/incubation/distros/bionic.d.ts +32 -0
- package/dist/classes/incubation/distros/bionic.js +15 -15
- package/dist/classes/incubation/distros/buster.d.ts +32 -0
- package/dist/classes/incubation/distros/buster.js +15 -15
- package/dist/classes/incubation/distros/focal.d.ts +32 -0
- package/dist/classes/incubation/distros/focal.js +15 -15
- package/dist/classes/incubation/distros/jessie.d.ts +31 -0
- package/dist/classes/incubation/distros/jessie.js +11 -13
- package/dist/classes/incubation/distros/rolling.d.ts +32 -0
- package/dist/classes/incubation/distros/rolling.js +15 -16
- package/dist/classes/incubation/fisherman-helper/displaymanager.d.ts +11 -0
- package/dist/classes/incubation/fisherman-helper/displaymanager.js +8 -9
- package/dist/classes/incubation/fisherman-helper/packages.d.ts +20 -0
- package/dist/classes/incubation/fisherman-helper/packages.js +17 -17
- package/dist/classes/incubation/fisherman-helper/settings.d.ts +15 -0
- package/dist/classes/incubation/fisherman-helper/settings.js +30 -28
- package/dist/classes/incubation/fisherman.d.ts +77 -0
- package/dist/classes/incubation/fisherman.js +137 -132
- package/dist/classes/incubation/incubator.d.ts +40 -0
- package/dist/classes/incubation/incubator.js +93 -87
- package/dist/classes/incubation/installer.d.ts +13 -0
- package/dist/classes/incubation/installer.js +27 -12
- package/dist/classes/initrd.d.ts +41 -0
- package/dist/classes/initrd.js +42 -44
- package/dist/classes/keyboards.d.ts +50 -0
- package/dist/classes/keyboards.js +110 -107
- package/dist/classes/locales.d.ts +21 -0
- package/dist/classes/locales.js +30 -34
- package/dist/classes/n8.d.ts +17 -0
- package/dist/classes/n8.js +16 -22
- package/dist/classes/network.d.ts +37 -0
- package/dist/classes/network.js +21 -25
- package/dist/classes/ovary.d.ts +205 -0
- package/dist/classes/ovary.js +1262 -1334
- package/dist/classes/pacman.d.ts +149 -0
- package/dist/classes/pacman.js +347 -426
- package/dist/classes/pve-live.d.ts +17 -0
- package/dist/classes/pve-live.js +23 -25
- package/dist/classes/pxe.d.ts +65 -0
- package/dist/classes/pxe.js +206 -210
- package/dist/classes/settings.d.ts +53 -0
- package/dist/classes/settings.js +99 -102
- package/dist/classes/sources_list.d.ts +28 -0
- package/dist/classes/sources_list.js +35 -39
- package/dist/classes/systemctl.d.ts +47 -0
- package/dist/classes/systemctl.js +35 -39
- package/dist/classes/tailor.d.ts +46 -0
- package/dist/classes/tailor.js +225 -241
- package/dist/classes/tools.d.ts +30 -0
- package/dist/classes/tools.js +20 -26
- package/dist/classes/users.d.ts +28 -0
- package/dist/classes/users.js +22 -16
- package/dist/classes/utils.d.ts +318 -0
- package/dist/classes/utils.js +91 -76
- package/dist/classes/xdg.d.ts +45 -0
- package/dist/classes/xdg.js +129 -133
- package/dist/classes/yolk.d.ts +33 -0
- package/dist/classes/yolk.js +54 -60
- package/dist/commands/adapt.d.ts +17 -0
- package/dist/commands/adapt.js +21 -25
- package/dist/commands/analyze.d.ts +26 -0
- package/dist/commands/analyze.js +60 -74
- package/dist/commands/calamares.d.ts +29 -0
- package/dist/commands/calamares.js +53 -60
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +120 -142
- package/dist/commands/cuckoo.d.ts +16 -0
- package/dist/commands/cuckoo.js +24 -28
- package/dist/commands/dad.d.ts +19 -0
- package/dist/commands/dad.js +26 -30
- package/dist/commands/export/deb.d.ts +19 -0
- package/dist/commands/export/deb.js +33 -42
- package/dist/commands/export/iso.d.ts +19 -0
- package/dist/commands/export/iso.js +24 -28
- package/dist/commands/install.d.ts +37 -0
- package/dist/commands/install.js +68 -68
- package/dist/commands/kill.d.ts +24 -0
- package/dist/commands/kill.js +31 -38
- package/dist/commands/mom.d.ts +16 -0
- package/dist/commands/mom.js +20 -22
- package/dist/commands/produce.d.ts +33 -0
- package/dist/commands/produce.js +100 -92
- package/dist/commands/status.d.ts +23 -0
- package/dist/commands/status.js +14 -20
- package/dist/commands/syncfrom.d.ts +45 -0
- package/dist/commands/syncfrom.js +99 -109
- package/dist/commands/syncto.d.ts +40 -0
- package/dist/commands/syncto.js +152 -216
- package/dist/commands/tools/clean.d.ts +18 -0
- package/dist/commands/tools/clean.js +21 -25
- package/dist/commands/tools/ppa.d.ts +26 -0
- package/dist/commands/tools/ppa.js +46 -50
- package/dist/commands/tools/skel.d.ts +18 -0
- package/dist/commands/tools/skel.js +27 -31
- package/dist/commands/tools/stat.d.ts +31 -0
- package/dist/commands/tools/stat.js +21 -25
- package/dist/commands/tools/yolk.d.ts +24 -0
- package/dist/commands/tools/yolk.js +23 -27
- package/dist/commands/update.d.ts +47 -0
- package/dist/commands/update.js +66 -70
- package/dist/commands/wardrobe/get.d.ts +23 -0
- package/dist/commands/wardrobe/get.js +26 -28
- package/dist/commands/wardrobe/list.d.ts +24 -0
- package/dist/commands/wardrobe/list.js +69 -67
- package/dist/commands/wardrobe/show.d.ts +25 -0
- package/dist/commands/wardrobe/show.js +57 -52
- package/dist/commands/wardrobe/wear.d.ts +26 -0
- package/dist/commands/wardrobe/wear.js +39 -41
- package/dist/components/finished.d.ts +15 -0
- package/dist/components/finished.js +37 -42
- package/dist/components/information.d.ts +8 -0
- package/dist/components/information.js +155 -0
- package/dist/components/install.d.ts +15 -0
- package/dist/components/install.js +31 -35
- package/dist/components/keyboard.d.ts +16 -0
- package/dist/components/keyboard.js +37 -40
- package/dist/components/location.d.ts +16 -0
- package/dist/components/location.js +38 -38
- package/dist/components/network.d.ts +19 -0
- package/dist/components/network.js +47 -48
- package/dist/components/partitions.d.ts +16 -0
- package/dist/components/partitions.js +47 -51
- package/dist/components/steps.d.ts +13 -0
- package/dist/components/steps.js +148 -0
- package/dist/components/summary.d.ts +24 -0
- package/dist/components/summary.js +53 -54
- package/dist/components/title.d.ts +12 -0
- package/dist/components/title.js +35 -0
- package/dist/components/users.d.ts +24 -0
- package/dist/components/users.js +43 -43
- package/dist/components/welcome.d.ts +13 -0
- package/dist/components/welcome.js +37 -38
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -5
- package/dist/interfaces/i-addons.d.ts +13 -0
- package/dist/interfaces/i-addons.js +8 -3
- package/dist/interfaces/i-analyze.d.ts +17 -0
- package/dist/interfaces/i-analyze.js +11 -16
- package/dist/interfaces/i-app.d.ts +14 -0
- package/dist/interfaces/i-app.js +8 -2
- package/dist/interfaces/i-branding.d.ts +36 -0
- package/dist/interfaces/i-branding.js +8 -2
- package/dist/interfaces/i-calamares-partition.d.ts +18 -0
- package/dist/interfaces/i-calamares-partition.js +3 -4
- package/dist/interfaces/i-config-tools.d.ts +18 -0
- package/dist/interfaces/i-config-tools.js +8 -2
- package/dist/interfaces/i-devices.d.ts +20 -0
- package/dist/interfaces/i-devices.js +8 -2
- package/dist/interfaces/i-distro.d.ts +27 -0
- package/dist/interfaces/i-distro.js +3 -4
- package/dist/interfaces/i-drive-list.d.ts +33 -0
- package/dist/interfaces/i-drive-list.js +3 -4
- package/dist/interfaces/i-eggs-config.d.ts +32 -0
- package/dist/interfaces/i-eggs-config.js +3 -4
- package/dist/interfaces/i-excludes.d.ts +14 -0
- package/dist/interfaces/i-excludes.js +8 -0
- package/dist/interfaces/i-exec.d.ts +11 -0
- package/dist/interfaces/i-exec.js +3 -4
- package/dist/interfaces/i-initrd.d.ts +13 -0
- package/dist/interfaces/i-initrd.js +8 -2
- package/dist/interfaces/i-install.d.ts +16 -0
- package/dist/interfaces/i-install.js +8 -2
- package/dist/interfaces/i-installer.d.ts +17 -0
- package/dist/interfaces/i-installer.js +8 -2
- package/dist/interfaces/i-krill-config.d.ts +33 -0
- package/dist/interfaces/i-krill-config.js +3 -4
- package/dist/interfaces/i-krill.d.ts +42 -0
- package/dist/interfaces/i-krill.js +8 -2
- package/dist/interfaces/i-materia.d.ts +41 -0
- package/dist/interfaces/i-materia.js +8 -2
- package/dist/interfaces/i-net.d.ts +16 -0
- package/dist/interfaces/i-net.js +8 -2
- package/dist/interfaces/i-packages.d.ts +29 -0
- package/dist/interfaces/i-packages.js +3 -4
- package/dist/interfaces/i-partitions.d.ts +16 -0
- package/dist/interfaces/i-partitions.js +8 -2
- package/dist/interfaces/i-pxe.d.ts +21 -0
- package/dist/interfaces/i-pxe.js +8 -39
- package/dist/interfaces/i-remix.d.ts +21 -0
- package/dist/interfaces/i-remix.js +3 -4
- package/dist/interfaces/i-settings.d.ts +39 -0
- package/dist/interfaces/i-settings.js +8 -2
- package/dist/interfaces/i-user.d.ts +14 -0
- package/dist/interfaces/i-user.js +8 -2
- package/dist/interfaces/i-workdir.d.ts +14 -0
- package/dist/interfaces/i-workdir.js +8 -2
- package/dist/interfaces/i-xkb-model.d.ts +24 -0
- package/dist/interfaces/i-xkb-model.js +8 -2
- package/dist/interfaces/index.d.ts +25 -0
- package/dist/interfaces/index.js +3 -4
- package/dist/krill/modules/add-user.d.ts +20 -0
- package/dist/krill/modules/add-user.js +11 -15
- package/dist/krill/modules/bootloader-config-arch.d.ts +14 -0
- package/dist/krill/modules/bootloader-config-arch.js +15 -11
- package/dist/krill/modules/bootloader-config-debian.d.ts +10 -0
- package/dist/krill/modules/bootloader-config-debian.js +20 -16
- package/dist/krill/modules/bootloader-config.d.ts +10 -0
- package/dist/krill/modules/bootloader-config.js +3 -6
- package/dist/krill/modules/bootloader.d.ts +14 -0
- package/dist/krill/modules/bootloader.js +9 -13
- package/dist/krill/modules/change-password.d.ts +15 -0
- package/dist/krill/modules/change-password.js +5 -8
- package/dist/krill/modules/del-live-user.d.ts +14 -0
- package/dist/krill/modules/del-live-user.js +8 -12
- package/dist/krill/modules/fstab.d.ts +14 -0
- package/dist/krill/modules/fstab.js +69 -46
- package/dist/krill/modules/grubcfg.d.ts +17 -0
- package/dist/krill/modules/grubcfg.js +8 -17
- package/dist/krill/modules/hostname.d.ts +13 -0
- package/dist/krill/modules/hostname.js +11 -17
- package/dist/krill/modules/initramfs-cfg.d.ts +14 -0
- package/dist/krill/modules/initramfs-cfg.js +6 -15
- package/dist/krill/modules/initramfs.d.ts +13 -0
- package/dist/krill/modules/initramfs.js +17 -19
- package/dist/krill/modules/locale-cfg.d.ts +10 -0
- package/dist/krill/modules/locale-cfg.js +8 -12
- package/dist/krill/modules/locale.d.ts +13 -0
- package/dist/krill/modules/locale.js +7 -11
- package/dist/krill/modules/m-keyboard.d.ts +14 -0
- package/dist/krill/modules/m-keyboard.js +14 -18
- package/dist/krill/modules/m-timezone.d.ts +14 -0
- package/dist/krill/modules/m-timezone.js +8 -12
- package/dist/krill/modules/machine-id.d.ts +15 -0
- package/dist/krill/modules/machine-id.js +6 -10
- package/dist/krill/modules/mkfs.d.ts +13 -0
- package/dist/krill/modules/mkfs.js +33 -23
- package/dist/krill/modules/mount-fs.d.ts +17 -0
- package/dist/krill/modules/mount-fs.js +20 -26
- package/dist/krill/modules/mount-vfs.d.ts +17 -0
- package/dist/krill/modules/mount-vfs.js +16 -21
- package/dist/krill/modules/network-cfg.d.ts +19 -0
- package/dist/krill/modules/network-cfg.js +28 -31
- package/dist/krill/modules/packages.d.ts +14 -0
- package/dist/krill/modules/packages.js +17 -21
- package/dist/krill/modules/partition.d.ts +20 -0
- package/dist/krill/modules/partition.js +80 -86
- package/dist/krill/modules/remove-installer-link.d.ts +13 -0
- package/dist/krill/modules/remove-installer-link.js +7 -11
- package/dist/krill/modules/umount.d.ts +14 -0
- package/dist/krill/modules/umount.js +9 -13
- package/dist/krill/modules/unpackfs.d.ts +13 -0
- package/dist/krill/modules/unpackfs.js +7 -11
- package/dist/krill/prepare.d.ts +77 -0
- package/dist/krill/{krill-prepare.js → prepare.js} +136 -130
- package/dist/krill/sequence.d.ts +156 -0
- package/dist/krill/sequence.js +640 -0
- package/dist/lib/cli-autologin.d.ts +43 -0
- package/dist/lib/cli-autologin.js +88 -92
- package/dist/lib/get_address.d.ts +8 -0
- package/dist/lib/get_address.js +9 -11
- package/dist/lib/get_dns.d.ts +8 -0
- package/dist/lib/get_dns.js +9 -11
- package/dist/lib/get_domain.d.ts +8 -0
- package/dist/lib/get_domain.js +9 -11
- package/dist/lib/get_gateway.d.ts +8 -0
- package/dist/lib/get_gateway.js +9 -11
- package/dist/lib/get_hostname.d.ts +8 -0
- package/dist/lib/get_hostname.js +9 -11
- package/dist/lib/get_netmask.d.ts +8 -0
- package/dist/lib/get_netmask.js +9 -11
- package/dist/lib/get_password.d.ts +8 -0
- package/dist/lib/get_password.js +10 -13
- package/dist/lib/get_userfullname.d.ts +8 -0
- package/dist/lib/get_userfullname.js +9 -11
- package/dist/lib/get_username.d.ts +8 -0
- package/dist/lib/get_username.js +9 -12
- package/dist/lib/kill_me_softly.d.ts +11 -0
- package/dist/lib/kill_me_softly.js +19 -24
- package/dist/lib/select_address_type.d.ts +8 -0
- package/dist/lib/select_address_type.js +9 -12
- package/dist/lib/select_filesystem_type.d.ts +8 -0
- package/dist/lib/select_filesystem_type.js +19 -17
- package/dist/lib/select_installation_device.d.ts +8 -0
- package/dist/lib/select_installation_device.js +11 -15
- package/dist/lib/select_installation_mode.d.ts +8 -0
- package/dist/lib/select_installation_mode.js +9 -11
- package/dist/lib/select_interface.d.ts +8 -0
- package/dist/lib/select_interface.js +9 -12
- package/dist/lib/select_keyboard_layout.d.ts +11 -0
- package/dist/lib/select_keyboard_layout.js +11 -15
- package/dist/lib/select_keyboard_model.d.ts +11 -0
- package/dist/lib/select_keyboard_model.js +11 -15
- package/dist/lib/select_keyboard_option.d.ts +11 -0
- package/dist/lib/select_keyboard_option.js +11 -15
- package/dist/lib/select_keyboard_variant.d.ts +11 -0
- package/dist/lib/select_keyboard_variant.js +11 -15
- package/dist/lib/select_languages.d.ts +8 -0
- package/dist/lib/select_languages.js +11 -15
- package/dist/lib/select_regions.d.ts +8 -0
- package/dist/lib/select_regions.js +9 -11
- package/dist/lib/select_user_swap_choice.d.ts +8 -0
- package/dist/lib/select_user_swap_choice.js +13 -17
- package/dist/lib/select_zones.d.ts +8 -0
- package/dist/lib/select_zones.js +9 -11
- package/dist/lib/utils.d.ts +34 -0
- package/dist/lib/utils.js +24 -14
- package/manpages/doc/man/eggs.1.gz +0 -0
- package/manpages/doc/man/eggs.html +130 -76
- package/package.json +55 -74
- package/scripts/_eggs +9 -7
- package/scripts/eggs.bash +4 -4
- package/LICENSE +0 -339
- package/bin/dev +0 -17
- package/bin/run +0 -5
- package/conf/exclude.list.custom +0 -3
- package/dist/components/elements/information.js +0 -194
- package/dist/components/elements/steps.js +0 -152
- package/dist/components/elements/title.js +0 -36
- package/dist/interfaces/i-filters.js +0 -3
- package/dist/krill/krill-sequence.js +0 -645
- package/dist/lib/dependencies.js +0 -120
- package/manpages/doc/man/README.md +0 -0
- /package/conf/{exclude.list.usr → exclude.list.d/usr.list} +0 -0
package/dist/classes/pacman.js
CHANGED
|
@@ -1,232 +1,52 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
2
|
+
* ./src/classes/pacman.ts
|
|
3
|
+
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
*/
|
|
8
|
+
import { execSync } from 'node:child_process';
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
// _dirname
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
import shx from 'shelljs';
|
|
13
|
+
import { exec } from '../lib/utils.js';
|
|
14
|
+
import Distro from './distro.js';
|
|
15
|
+
import Archlinux from './families/archlinux.js';
|
|
16
|
+
import Debian from './families/debian.js';
|
|
17
|
+
import Fedora from './families/fedora.js';
|
|
18
|
+
import Suse from './families/suse.js';
|
|
19
|
+
import Settings from './settings.js';
|
|
20
|
+
import Utils from './utils.js';
|
|
21
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
23
22
|
const config_file = '/etc/penguins-eggs.d/eggs.yaml';
|
|
24
23
|
const config_tools = '/etc/penguins-eggs.d/tools.yaml';
|
|
25
24
|
/**
|
|
26
25
|
* Utils: general porpouse utils
|
|
27
26
|
* @remarks all the utilities
|
|
28
27
|
*/
|
|
29
|
-
class Pacman {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
28
|
+
export default class Pacman {
|
|
29
|
+
static debs4calamares = ['calamares', 'qml-module-qtquick2', 'qml-module-qtquick-controls'];
|
|
30
|
+
distro = {};
|
|
31
|
+
remix = {};
|
|
34
32
|
/**
|
|
35
33
|
*
|
|
36
|
-
* @
|
|
37
|
-
*/
|
|
38
|
-
static distro() {
|
|
39
|
-
const remix = {};
|
|
40
|
-
const distro = new distro_1.default(remix);
|
|
41
|
-
return distro;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @returns grub
|
|
46
|
-
*/
|
|
47
|
-
static whichGrubIsInstalled() {
|
|
48
|
-
let grubInstalled = '';
|
|
49
|
-
if (this.distro().familyId === 'debian') {
|
|
50
|
-
if (this.packageIsInstalled('grub-common')) {
|
|
51
|
-
grubInstalled = 'grub';
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
else if (this.distro().familyId === 'fedora') {
|
|
55
|
-
if (this.packageIsInstalled('grub2-common.noarch')) {
|
|
56
|
-
grubInstalled = 'grub2';
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
else if (this.distro().familyId === 'archlinux') {
|
|
60
|
-
if (this.packageIsInstalled('grub')) {
|
|
61
|
-
grubInstalled = 'grub';
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else if (this.distro().familyId === 'suse' && this.packageIsInstalled('grub2')) {
|
|
65
|
-
grubInstalled = 'grub2';
|
|
66
|
-
}
|
|
67
|
-
return grubInstalled;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* check if it's installed xorg
|
|
71
|
-
* @returns
|
|
72
|
-
*/
|
|
73
|
-
static isInstalledXorg() {
|
|
74
|
-
let installed = false;
|
|
75
|
-
if (this.distro().familyId === 'debian') {
|
|
76
|
-
if (debian_1.default.packageIsInstalled('xserver-xorg-core')) {
|
|
77
|
-
installed = true;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
else if (this.distro().familyId === 'fedora') {
|
|
81
|
-
if (fedora_1.default.packageIsInstalled('xorg-x11-server-Xorg.x86_64')) {
|
|
82
|
-
installed = true;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else if (this.distro().familyId === 'archlinux') {
|
|
86
|
-
if (archlinux_1.default.packageIsInstalled('xorg-server-common')) {
|
|
87
|
-
installed = true;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else if (this.distro().familyId === 'suse') {
|
|
91
|
-
if (suse_1.default.packageIsInstalled('xorg-x11-server')) {
|
|
92
|
-
installed = true;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return installed;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* check if it's installed wayland
|
|
99
|
-
* @returns true if wayland
|
|
100
|
-
*/
|
|
101
|
-
static isInstalledWayland() {
|
|
102
|
-
let installed = false;
|
|
103
|
-
if (this.distro().familyId === 'debian') {
|
|
104
|
-
if (debian_1.default.packageIsInstalled('xwayland')) {
|
|
105
|
-
installed = true;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
else if (this.distro().familyId === 'fedora') {
|
|
109
|
-
if (fedora_1.default.packageIsInstalled('xorg-x11-server-Xwayland*')) {
|
|
110
|
-
installed = true;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
else if (this.distro().familyId === 'archlinux') {
|
|
114
|
-
if (archlinux_1.default.packageIsInstalled('xwayland')) {
|
|
115
|
-
installed = true;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
else if (this.distro().familyId === 'suse') {
|
|
119
|
-
if (suse_1.default.packageIsInstalled('xwayland*')) {
|
|
120
|
-
installed = true;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return installed;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Check se la macchina ha grub adatto ad efi
|
|
127
|
-
* Forse conviene spostarlo in pacman
|
|
34
|
+
* @param verbose
|
|
128
35
|
*/
|
|
129
|
-
static
|
|
130
|
-
let isUefi = false;
|
|
36
|
+
static async autocompleteInstall(verbose = false) {
|
|
131
37
|
if (this.distro().familyId === 'debian') {
|
|
132
|
-
if (
|
|
133
|
-
if (
|
|
134
|
-
|
|
38
|
+
if (Pacman.packageIsInstalled('bash-completion')) {
|
|
39
|
+
if (fs.existsSync('/usr/share/bash-completion/completions/')) {
|
|
40
|
+
await exec(`cp ${__dirname}/../../scripts/eggs.bash /usr/share/bash-completion/completions/`);
|
|
41
|
+
}
|
|
42
|
+
else if (fs.existsSync('/etc/bash_completion.d/')) {
|
|
43
|
+
await exec(`cp ${__dirname}/../../scripts/eggs.bash /etc/bash_completion.d/`);
|
|
135
44
|
}
|
|
136
45
|
}
|
|
137
46
|
}
|
|
138
|
-
else if (
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
else if (Pacman.distro().familyId === 'archlinux') {
|
|
142
|
-
isUefi = true;
|
|
143
|
-
}
|
|
144
|
-
else if (Pacman.distro().familyId === 'suse') {
|
|
145
|
-
isUefi = true;
|
|
146
|
-
}
|
|
147
|
-
return isUefi;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
*
|
|
151
|
-
* @returns true se GUI
|
|
152
|
-
*/
|
|
153
|
-
static isInstalledGui() {
|
|
154
|
-
return this.isInstalledXorg() || this.isInstalledWayland();
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* controlla se è operante xserver-xorg-core
|
|
158
|
-
*/
|
|
159
|
-
static isRunningXorg() {
|
|
160
|
-
return process.env.XDG_SESSION_TYPE === 'x11';
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Constrolla se è operante wayland
|
|
164
|
-
*/
|
|
165
|
-
static isRunningWayland() {
|
|
166
|
-
return process.env.XDG_SESSION_TYPE === 'wayland';
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Check if the system is GUI able
|
|
170
|
-
*/
|
|
171
|
-
static isRunningGui() {
|
|
172
|
-
return this.isRunningXorg() || this.isRunningWayland();
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Check if the system is just CLI
|
|
176
|
-
*/
|
|
177
|
-
static isRunningCli() {
|
|
178
|
-
return !this.isRunningGui();
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Crea array packages dei pacchetti da installare
|
|
182
|
-
*
|
|
183
|
-
* probabilmente non usata
|
|
184
|
-
*
|
|
185
|
-
*/
|
|
186
|
-
static packages(remove = false, verbose = false) {
|
|
187
|
-
let packages = [];
|
|
188
|
-
/*
|
|
189
|
-
if (this.distro().familyId === 'debian') {
|
|
190
|
-
packages = Debian.packages(remove, verbose)
|
|
191
|
-
} else if (this.distro().familyId === 'fedora') {
|
|
192
|
-
packages = Fedora.packages(remove, verbose)
|
|
193
|
-
} else if (this.distro().familyId === 'archlinux') {
|
|
194
|
-
packages = Archlinux.packages(remove, verbose)
|
|
195
|
-
} else if (this.distro().familyId === 'suse') {
|
|
196
|
-
packages = Suse.packages(remove, verbose)
|
|
197
|
-
}
|
|
198
|
-
*/
|
|
199
|
-
return packages;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Restituisce VERO se i prerequisiti sono installati
|
|
203
|
-
*/
|
|
204
|
-
static async prerequisitesCheck(verbose = false) {
|
|
205
|
-
let installed = true;
|
|
206
|
-
const packages = this.packages(false, verbose);
|
|
207
|
-
if (packages.length > 0) {
|
|
208
|
-
installed = false;
|
|
209
|
-
}
|
|
210
|
-
return installed;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
*
|
|
214
|
-
*/
|
|
215
|
-
static async prerequisitesInstall(verbose = true) {
|
|
216
|
-
let retVal = false;
|
|
217
|
-
if (this.distro().familyId === 'debian') {
|
|
218
|
-
retVal = await debian_1.default.prerequisitesInstall(verbose);
|
|
219
|
-
}
|
|
220
|
-
else if (this.distro().familyId === 'fedora') {
|
|
221
|
-
retVal = await fedora_1.default.prerequisitesInstall(verbose);
|
|
222
|
-
}
|
|
223
|
-
else if (this.distro().familyId === 'archlinux') {
|
|
224
|
-
retVal = await archlinux_1.default.prerequisitesInstall(verbose);
|
|
225
|
-
}
|
|
226
|
-
else if (this.distro().familyId === 'suse') {
|
|
227
|
-
retVal = await suse_1.default.prerequisitesInstall(verbose);
|
|
47
|
+
else if (this.distro().familyId === 'archlinux' && Pacman.packageIsInstalled('bash-completion')) {
|
|
48
|
+
await exec(`cp ${__dirname}/../../scripts/eggs.bash /usr/share/bash-completion/completions/`);
|
|
228
49
|
}
|
|
229
|
-
return retVal;
|
|
230
50
|
}
|
|
231
51
|
/**
|
|
232
52
|
* return true if calamares is installed
|
|
@@ -234,49 +54,38 @@ class Pacman {
|
|
|
234
54
|
static calamaresExists() {
|
|
235
55
|
return this.commandIsInstalled('calamares');
|
|
236
56
|
}
|
|
237
|
-
/**
|
|
238
|
-
* Controlla se calamares è installabile
|
|
239
|
-
* @returns
|
|
240
|
-
*/
|
|
241
|
-
static isCalamaresAvailable() {
|
|
242
|
-
let result = this.distro().isCalamaresAvailable;
|
|
243
|
-
if (process.arch === 'arm' || process.arch === 'arm64') {
|
|
244
|
-
result = false;
|
|
245
|
-
}
|
|
246
|
-
return result;
|
|
247
|
-
}
|
|
248
57
|
/**
|
|
249
58
|
*
|
|
250
59
|
*/
|
|
251
60
|
static async calamaresInstall(verbose = false) {
|
|
252
61
|
if (this.isInstalledGui()) {
|
|
253
62
|
if (this.distro().familyId === 'debian') {
|
|
254
|
-
await
|
|
63
|
+
await Debian.calamaresInstall(verbose);
|
|
255
64
|
}
|
|
256
65
|
else if (this.distro().familyId === 'fedora') {
|
|
257
|
-
await
|
|
66
|
+
await Fedora.calamaresInstall(verbose);
|
|
258
67
|
}
|
|
259
68
|
else if (this.distro().familyId === 'archlinux') {
|
|
260
69
|
if (this.distro().distroId === 'ManjaroLinux') {
|
|
261
70
|
const cmd = `pacman -Sy --noconfirm calamares`;
|
|
262
71
|
try {
|
|
263
|
-
await
|
|
72
|
+
await exec(cmd, Utils.setEcho(true));
|
|
264
73
|
}
|
|
265
74
|
catch {
|
|
266
|
-
|
|
75
|
+
Utils.error(`manjaro: ${cmd}`); // + e.error)
|
|
267
76
|
}
|
|
268
77
|
}
|
|
269
78
|
else {
|
|
270
|
-
await
|
|
79
|
+
await Archlinux.calamaresInstall(verbose);
|
|
271
80
|
}
|
|
272
81
|
}
|
|
273
82
|
else if (this.distro().familyId === 'suse') {
|
|
274
|
-
await
|
|
83
|
+
await Suse.calamaresInstall(verbose);
|
|
275
84
|
}
|
|
276
85
|
// remove others calamares links
|
|
277
|
-
await
|
|
278
|
-
await
|
|
279
|
-
await
|
|
86
|
+
await exec('rm -f /usr/share/applications/calamares-eggs-debugging.desktop');
|
|
87
|
+
await exec('rm -f /usr/share/applications/calamares-eggs.desktop');
|
|
88
|
+
await exec('rm -f /usr/share/applications/calamares.desktop');
|
|
280
89
|
}
|
|
281
90
|
}
|
|
282
91
|
/**
|
|
@@ -284,16 +93,16 @@ class Pacman {
|
|
|
284
93
|
*/
|
|
285
94
|
static async calamaresPolicies() {
|
|
286
95
|
if (this.distro().familyId === 'debian') {
|
|
287
|
-
await
|
|
96
|
+
await Debian.calamaresPolicies();
|
|
288
97
|
}
|
|
289
98
|
else if (this.distro().familyId === 'fedora') {
|
|
290
|
-
await
|
|
99
|
+
await Fedora.calamaresPolicies();
|
|
291
100
|
}
|
|
292
101
|
else if (this.distro().familyId === 'archlinux') {
|
|
293
|
-
await
|
|
102
|
+
await Archlinux.calamaresPolicies();
|
|
294
103
|
}
|
|
295
104
|
else if (this.distro().familyId === 'suse') {
|
|
296
|
-
await
|
|
105
|
+
await Suse.calamaresPolicies();
|
|
297
106
|
}
|
|
298
107
|
}
|
|
299
108
|
/**
|
|
@@ -302,44 +111,45 @@ class Pacman {
|
|
|
302
111
|
static async calamaresRemove(verbose = true) {
|
|
303
112
|
let retVal = false;
|
|
304
113
|
if (this.distro().familyId === 'debian') {
|
|
305
|
-
retVal = await
|
|
114
|
+
retVal = await Debian.calamaresRemove(verbose);
|
|
306
115
|
}
|
|
307
116
|
else if (this.distro().familyId === 'fedora') {
|
|
308
|
-
retVal = await
|
|
117
|
+
retVal = await Fedora.calamaresRemove(verbose);
|
|
309
118
|
}
|
|
310
119
|
else if (this.distro().familyId === 'archlinux') {
|
|
311
|
-
retVal = await
|
|
120
|
+
retVal = await Archlinux.calamaresRemove(verbose);
|
|
312
121
|
}
|
|
313
122
|
else if (this.distro().familyId === 'suse') {
|
|
314
|
-
retVal = await
|
|
123
|
+
retVal = await Suse.calamaresRemove(verbose);
|
|
315
124
|
}
|
|
316
125
|
return retVal;
|
|
317
126
|
}
|
|
318
127
|
/**
|
|
319
|
-
*
|
|
128
|
+
*
|
|
129
|
+
* @param cmd
|
|
320
130
|
*/
|
|
321
|
-
static
|
|
322
|
-
|
|
323
|
-
|
|
131
|
+
static commandIsInstalled(cmd) {
|
|
132
|
+
let installed = false;
|
|
133
|
+
// if (shx.exec(`command -V ${cmd} &>/dev/null`).code == 0) {
|
|
134
|
+
// remove output
|
|
135
|
+
if (shx.exec(`command -V ${cmd} >/dev/null 2>&1`).code == 0) {
|
|
136
|
+
installed = true;
|
|
137
|
+
}
|
|
138
|
+
return installed;
|
|
324
139
|
}
|
|
325
140
|
/**
|
|
326
|
-
*
|
|
141
|
+
* Restituisce VERO se i file di configurazione SONO presenti
|
|
327
142
|
*/
|
|
328
|
-
static
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
const result = utils_1.default.machineId() !== settings.config.machine_id;
|
|
332
|
-
if (verbose && result) {
|
|
333
|
-
console.log('configurationMachineNew: True');
|
|
334
|
-
}
|
|
335
|
-
return result;
|
|
143
|
+
static configurationCheck() {
|
|
144
|
+
const confExists = fs.existsSync(config_file);
|
|
145
|
+
return confExists;
|
|
336
146
|
}
|
|
337
147
|
/**
|
|
338
148
|
*
|
|
339
149
|
*/
|
|
340
150
|
static async configurationFresh() {
|
|
341
151
|
const config = {};
|
|
342
|
-
config.version =
|
|
152
|
+
config.version = Utils.getPackageVersion();
|
|
343
153
|
config.snapshot_dir = '/home/eggs';
|
|
344
154
|
config.snapshot_prefix = '';
|
|
345
155
|
config.snapshot_excludes = '/etc/penguins-eggs.d/exclude.list';
|
|
@@ -355,8 +165,8 @@ class Pacman {
|
|
|
355
165
|
config.compression = 'xz';
|
|
356
166
|
config.ssh_pass = false;
|
|
357
167
|
config.timezone = 'Europe/Rome';
|
|
358
|
-
//config.locales_default = '__NOT_USED_MORE'
|
|
359
|
-
//config.locales = ['__NOT_USED_MORE']
|
|
168
|
+
// config.locales_default = '__NOT_USED_MORE'
|
|
169
|
+
// config.locales = ['__NOT_USED_MORE']
|
|
360
170
|
// config.timezone = 'America/New_York'
|
|
361
171
|
// const env = process.env
|
|
362
172
|
// config.locales_default = env.LANG !== undefined ? env.LANG : 'en_US.UTF-8'
|
|
@@ -366,17 +176,17 @@ class Pacman {
|
|
|
366
176
|
config.force_installer = false;
|
|
367
177
|
console.log('Due the lacks of calamares package set force_installer = false');
|
|
368
178
|
}
|
|
369
|
-
if (!Pacman.isUefi() &&
|
|
179
|
+
if (!Pacman.isUefi() && Utils.uefiArch() !== "i386") {
|
|
370
180
|
config.make_efi = false;
|
|
371
|
-
console.log('Due the lacks of grub-efi-' +
|
|
181
|
+
console.log('Due the lacks of grub-efi-' + Utils.uefiArch() + '-bin package set make_efi = false');
|
|
372
182
|
}
|
|
373
183
|
/**
|
|
374
184
|
* Salvo la configurazione di eggs.yaml
|
|
375
185
|
*/
|
|
376
|
-
config.machine_id =
|
|
377
|
-
config.vmlinuz =
|
|
378
|
-
config.initrd_img =
|
|
379
|
-
const settings = new
|
|
186
|
+
config.machine_id = Utils.machineId();
|
|
187
|
+
config.vmlinuz = Utils.vmlinuz();
|
|
188
|
+
config.initrd_img = Utils.initrdImg();
|
|
189
|
+
const settings = new Settings();
|
|
380
190
|
await settings.save(config);
|
|
381
191
|
}
|
|
382
192
|
/**
|
|
@@ -384,103 +194,83 @@ class Pacman {
|
|
|
384
194
|
*/
|
|
385
195
|
static async configurationInstall(links = true, verbose = true) {
|
|
386
196
|
const confRoot = '/etc/penguins-eggs.d';
|
|
387
|
-
if (!
|
|
388
|
-
|
|
197
|
+
if (!fs.existsSync(confRoot)) {
|
|
198
|
+
execSync(`mkdir ${confRoot}`);
|
|
389
199
|
}
|
|
200
|
+
console.log('configurationInstall: ' + confRoot);
|
|
390
201
|
const addons = `${confRoot}/addons`;
|
|
391
|
-
if (
|
|
392
|
-
|
|
202
|
+
if (fs.existsSync(addons)) {
|
|
203
|
+
execSync(`rm -rf ${addons}`);
|
|
393
204
|
}
|
|
394
205
|
const distros = `${confRoot}/distros`;
|
|
395
|
-
if (
|
|
396
|
-
|
|
206
|
+
if (fs.existsSync(distros)) {
|
|
207
|
+
execSync(`rm -rf ${distros}`);
|
|
397
208
|
}
|
|
398
|
-
|
|
209
|
+
execSync(`mkdir -p ${distros}`);
|
|
399
210
|
/**
|
|
400
211
|
* We use /etc/penguins-eggs.d/init for our init scripts:
|
|
401
212
|
* # unattended.sh -> eggs install --unattended
|
|
402
213
|
* # cuckoo -> eggs cuckoo
|
|
403
214
|
*/
|
|
404
215
|
const init = `${confRoot}/init`;
|
|
405
|
-
if (
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
216
|
+
if (fs.existsSync(init)) {
|
|
217
|
+
execSync(`rm -rf ${init}`);
|
|
218
|
+
}
|
|
219
|
+
execSync(`mkdir -p ${init}`);
|
|
220
|
+
shx.ln('-s', path.resolve(__dirname, '../../addons'), addons);
|
|
221
|
+
shx.cp(path.resolve(__dirname, '../../conf/README.md'), confRoot);
|
|
222
|
+
shx.cp(path.resolve(__dirname, '../../conf/tools.yaml'), config_tools);
|
|
223
|
+
shx.cp(path.resolve(__dirname, '../../conf/krill.yaml'), confRoot);
|
|
224
|
+
shx.cp(path.resolve(__dirname, '../../conf/derivatives.yaml'), confRoot);
|
|
414
225
|
// init
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
226
|
+
shx.cp(path.resolve(__dirname, '../../conf/init/unattended.sh'), '/etc/penguins-eggs.d/init');
|
|
227
|
+
shx.chmod('+x', '/etc/penguins-eggs.d/init/unattended.sh');
|
|
228
|
+
shx.cp(path.resolve(__dirname, '../../conf/init/cuckoo.sh'), '/etc/penguins-eggs.d/init');
|
|
229
|
+
shx.chmod('+x', '/etc/penguins-eggs.d/init/cuckoo.sh');
|
|
419
230
|
// creazione cartella exclude.list.d
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list.custom'), '/etc/penguins-eggs.d/exclude.list.d');
|
|
423
|
-
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list.homes'), '/etc/penguins-eggs.d/exclude.list.d');
|
|
424
|
-
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list.usr'), '/etc/penguins-eggs.d/exclude.list.d');
|
|
231
|
+
execSync(`mkdir -p /etc/penguins-eggs.d/exclude.list.d`);
|
|
232
|
+
shx.cp(path.resolve(__dirname, '../../conf/exclude.list.d/*'), '/etc/penguins-eggs.d/exclude.list.d');
|
|
425
233
|
await this.configurationFresh();
|
|
426
234
|
}
|
|
427
235
|
/**
|
|
428
|
-
*
|
|
236
|
+
* Ritorna vero se machine-id è uguale
|
|
429
237
|
*/
|
|
430
|
-
static async
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
await (0, utils_2.exec)('rm /etc/calamares -rf', echo);
|
|
238
|
+
static async configurationMachineNew(verbose = false) {
|
|
239
|
+
const settings = new Settings();
|
|
240
|
+
await settings.load();
|
|
241
|
+
const result = Utils.machineId() !== settings.config.machine_id;
|
|
242
|
+
if (verbose && result) {
|
|
243
|
+
console.log('configurationMachineNew: True');
|
|
437
244
|
}
|
|
245
|
+
return result;
|
|
438
246
|
}
|
|
439
247
|
/**
|
|
440
|
-
*
|
|
441
|
-
* @param verbose
|
|
248
|
+
* Rimozione dei file di configurazione
|
|
442
249
|
*/
|
|
443
|
-
static async
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
await (0, utils_2.exec)(`cp ${__dirname}/../../scripts/eggs.bash /usr/share/bash-completion/completions/`);
|
|
448
|
-
}
|
|
449
|
-
else if (node_fs_1.default.existsSync('/etc/bash_completion.d/')) {
|
|
450
|
-
await (0, utils_2.exec)(`cp ${__dirname}/../../scripts/eggs.bash /etc/bash_completion.d/`);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
250
|
+
static async configurationRemove(verbose = true) {
|
|
251
|
+
const echo = Utils.setEcho(verbose);
|
|
252
|
+
if (fs.existsSync('/etc/penguins-eggs.d')) {
|
|
253
|
+
await exec('rm /etc/penguins-eggs.d -rf', echo);
|
|
453
254
|
}
|
|
454
|
-
|
|
455
|
-
await
|
|
255
|
+
if (fs.existsSync('/etc/calamares')) {
|
|
256
|
+
await exec('rm /etc/calamares -rf', echo);
|
|
456
257
|
}
|
|
457
258
|
}
|
|
458
259
|
/**
|
|
459
|
-
*
|
|
260
|
+
*
|
|
261
|
+
* @returns
|
|
460
262
|
*/
|
|
461
|
-
static
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
if (!node_fs_1.default.existsSync(man1Dir)) {
|
|
466
|
-
(0, utils_2.exec)(`mkdir ${man1Dir} -p`);
|
|
467
|
-
}
|
|
468
|
-
const manPageDest = man1Dir + 'eggs.1.gz';
|
|
469
|
-
(0, utils_2.exec)(`cp ${manPageSrc} ${manPageDest}`);
|
|
470
|
-
if (shelljs_1.default.exec('which mandb', { silent: true }).stdout.trim() !== '') {
|
|
471
|
-
await (0, utils_2.exec)('mandb > /dev/null');
|
|
472
|
-
if (verbose) {
|
|
473
|
-
console.log('manPage eggs installed...');
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
263
|
+
static distro() {
|
|
264
|
+
const remix = {};
|
|
265
|
+
const distro = new Distro(remix);
|
|
266
|
+
return distro;
|
|
477
267
|
}
|
|
478
268
|
/**
|
|
479
269
|
* distroTemplateCheck
|
|
480
270
|
*/
|
|
481
271
|
static distroTemplateCheck() {
|
|
482
|
-
const codenameLikeId = this.distro()
|
|
483
|
-
return
|
|
272
|
+
const { codenameLikeId } = this.distro();
|
|
273
|
+
return fs.existsSync(`/etc/penguins-eggs.d/distros/${codenameLikeId}`);
|
|
484
274
|
}
|
|
485
275
|
/**
|
|
486
276
|
*
|
|
@@ -489,9 +279,9 @@ class Pacman {
|
|
|
489
279
|
if (verbose) {
|
|
490
280
|
console.log('distroTemplateInstall');
|
|
491
281
|
}
|
|
492
|
-
const echo =
|
|
493
|
-
const rootPen =
|
|
494
|
-
await
|
|
282
|
+
const echo = Utils.setEcho(verbose);
|
|
283
|
+
const rootPen = Utils.rootPenguin();
|
|
284
|
+
await exec(`mkdir /etc/penguins-eggs.d/distros/${this.distro().codenameLikeId}`);
|
|
495
285
|
/**
|
|
496
286
|
* Debian 10 - Buster: è il master per tutte le distro
|
|
497
287
|
*/
|
|
@@ -501,42 +291,42 @@ class Pacman {
|
|
|
501
291
|
*/
|
|
502
292
|
if (this.distro().codenameLikeId === 'jessie') {
|
|
503
293
|
const dest = '/etc/penguins-eggs.d/distros/jessie';
|
|
504
|
-
await
|
|
294
|
+
await exec(`cp -r ${rootPen}/conf/distros/jessie/krill ${dest}/krill`, echo);
|
|
505
295
|
/**
|
|
506
296
|
* Debian 9 stretch: eredita grub, isolinux e locales da buster, contiene krill al posto di calamares
|
|
507
297
|
*/
|
|
508
298
|
}
|
|
509
299
|
else if (this.distro().codenameLikeId === 'stretch') {
|
|
510
300
|
const dest = '/etc/penguins-eggs.d/distros/stretch';
|
|
511
|
-
await
|
|
301
|
+
await exec(`cp -r ${rootPen}/conf/distros/jessie/krill ${dest}/krill`, echo);
|
|
512
302
|
/**
|
|
513
303
|
* Debian 10 buster: eredita tutto da buster
|
|
514
304
|
*/
|
|
515
305
|
}
|
|
516
306
|
else if (this.distro().codenameLikeId === 'buster') {
|
|
517
307
|
const dest = '/etc/penguins-eggs.d/distros/buster';
|
|
518
|
-
await
|
|
308
|
+
await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
519
309
|
/**
|
|
520
310
|
* Debian 11 bullseye: eredita tutto da buster
|
|
521
311
|
*/
|
|
522
312
|
}
|
|
523
313
|
else if (this.distro().codenameLikeId === 'bullseye') {
|
|
524
314
|
const dest = '/etc/penguins-eggs.d/distros/bullseye';
|
|
525
|
-
await
|
|
315
|
+
await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
526
316
|
/**
|
|
527
317
|
* Debian 12 bookworm: eredita tutto da buster
|
|
528
318
|
*/
|
|
529
319
|
}
|
|
530
320
|
else if (this.distro().codenameLikeId === 'bookworm') {
|
|
531
321
|
const dest = '/etc/penguins-eggs.d/distros/bookworm';
|
|
532
|
-
await
|
|
322
|
+
await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
533
323
|
/**
|
|
534
324
|
* Debian 13 trixie: eredita tutto da buster
|
|
535
325
|
*/
|
|
536
326
|
}
|
|
537
327
|
else if (this.distro().codenameLikeId === 'trixie') {
|
|
538
328
|
const dest = '/etc/penguins-eggs.d/distros/trixie';
|
|
539
|
-
await
|
|
329
|
+
await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
540
330
|
/***********************************************************************************
|
|
541
331
|
* Devuan
|
|
542
332
|
**********************************************************************************/
|
|
@@ -546,21 +336,21 @@ class Pacman {
|
|
|
546
336
|
}
|
|
547
337
|
else if (this.distro().codenameLikeId === 'beowulf') {
|
|
548
338
|
const dest = '/etc/penguins-eggs.d/distros/beowulf';
|
|
549
|
-
await
|
|
339
|
+
await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
550
340
|
/**
|
|
551
341
|
* Devuan chimaera: eredita tutto da buster
|
|
552
342
|
*/
|
|
553
343
|
}
|
|
554
344
|
else if (this.distro().codenameLikeId === 'chimaera') {
|
|
555
345
|
const dest = '/etc/penguins-eggs.d/distros/chimaera';
|
|
556
|
-
await
|
|
346
|
+
await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
557
347
|
/**
|
|
558
348
|
* Devuan daedalus: eredita tutto da buster
|
|
559
349
|
*/
|
|
560
350
|
}
|
|
561
351
|
else if (this.distro().codenameLikeId === 'daedalus') {
|
|
562
352
|
const dest = '/etc/penguins-eggs.d/distros/daedalus';
|
|
563
|
-
await
|
|
353
|
+
await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
564
354
|
/***********************************************************************************
|
|
565
355
|
* Ubuntu
|
|
566
356
|
**********************************************************************************/
|
|
@@ -571,15 +361,15 @@ class Pacman {
|
|
|
571
361
|
else if (this.distro().codenameLikeId === 'bionic') {
|
|
572
362
|
const dest = '/etc/penguins-eggs.d/distros/bionic';
|
|
573
363
|
const bionic = `${rootPen}/conf/distros/bionic/*`;
|
|
574
|
-
await
|
|
364
|
+
await exec(`cp -r ${bionic} ${dest}`, echo);
|
|
575
365
|
// Poi da buster
|
|
576
|
-
await
|
|
577
|
-
await
|
|
578
|
-
await
|
|
579
|
-
await
|
|
580
|
-
await
|
|
581
|
-
await
|
|
582
|
-
await
|
|
366
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
|
|
367
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
368
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
|
|
369
|
+
await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
370
|
+
await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
371
|
+
await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
372
|
+
await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
583
373
|
/**
|
|
584
374
|
* Ubuntu focal: eredita da focal e buster
|
|
585
375
|
*/
|
|
@@ -587,14 +377,14 @@ class Pacman {
|
|
|
587
377
|
else if (this.distro().codenameLikeId === 'focal') {
|
|
588
378
|
const dest = '/etc/penguins-eggs.d/distros/focal';
|
|
589
379
|
const focal = `${rootPen}/conf/distros/focal/*`;
|
|
590
|
-
await
|
|
591
|
-
await
|
|
592
|
-
await
|
|
593
|
-
await
|
|
594
|
-
await
|
|
595
|
-
await
|
|
596
|
-
await
|
|
597
|
-
await
|
|
380
|
+
await exec(`cp -r ${focal} ${dest}`, echo);
|
|
381
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
|
|
382
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
383
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
|
|
384
|
+
await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
385
|
+
await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
386
|
+
await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
387
|
+
await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
598
388
|
/**
|
|
599
389
|
* Ubuntu 21.10 impish: eredita da focal e buster
|
|
600
390
|
*/
|
|
@@ -602,14 +392,14 @@ class Pacman {
|
|
|
602
392
|
else if (this.distro().codenameLikeId === 'impish') {
|
|
603
393
|
const dest = '/etc/penguins-eggs.d/distros/impish';
|
|
604
394
|
const focal = `${rootPen}/conf/distros/focal/*`;
|
|
605
|
-
await
|
|
606
|
-
await
|
|
607
|
-
await
|
|
608
|
-
await
|
|
609
|
-
await
|
|
610
|
-
await
|
|
611
|
-
await
|
|
612
|
-
await
|
|
395
|
+
await exec(`cp -r ${focal} ${dest}`, echo);
|
|
396
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
|
|
397
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
398
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
|
|
399
|
+
await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
400
|
+
await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
401
|
+
await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
402
|
+
await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
613
403
|
/**
|
|
614
404
|
* Ubuntu 22.04 jammy: eredita da focal e buster
|
|
615
405
|
*/
|
|
@@ -617,14 +407,14 @@ class Pacman {
|
|
|
617
407
|
else if (this.distro().codenameLikeId === 'jammy') {
|
|
618
408
|
const dest = '/etc/penguins-eggs.d/distros/jammy';
|
|
619
409
|
const focal = `${rootPen}/conf/distros/focal/*`;
|
|
620
|
-
await
|
|
621
|
-
await
|
|
622
|
-
await
|
|
623
|
-
await
|
|
624
|
-
await
|
|
625
|
-
await
|
|
626
|
-
await
|
|
627
|
-
await
|
|
410
|
+
await exec(`cp -r ${focal} ${dest}`, echo);
|
|
411
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
|
|
412
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
413
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
|
|
414
|
+
await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
415
|
+
await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
416
|
+
await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
417
|
+
await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
628
418
|
/**
|
|
629
419
|
* Ubuntu lunar/rhino: eredita da devel e buster
|
|
630
420
|
*
|
|
@@ -633,14 +423,14 @@ class Pacman {
|
|
|
633
423
|
else if (this.distro().codenameLikeId === 'devel') {
|
|
634
424
|
const dest = '/etc/penguins-eggs.d/distros/devel';
|
|
635
425
|
const focal = `${rootPen}/conf/distros/devel/*`;
|
|
636
|
-
await
|
|
637
|
-
await
|
|
638
|
-
await
|
|
639
|
-
await
|
|
640
|
-
await
|
|
641
|
-
await
|
|
642
|
-
await
|
|
643
|
-
await
|
|
426
|
+
await exec(`cp -r ${focal} ${dest}`, echo);
|
|
427
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
|
|
428
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
429
|
+
await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
|
|
430
|
+
await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
431
|
+
await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
432
|
+
await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
433
|
+
await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
644
434
|
/***********************************************************************************
|
|
645
435
|
* Fedora
|
|
646
436
|
**********************************************************************************/
|
|
@@ -651,7 +441,7 @@ class Pacman {
|
|
|
651
441
|
else if (this.distro().codenameLikeId === 'thirtyfive') {
|
|
652
442
|
const dest = '/etc/penguins-eggs.d/distros/thirtyfive/';
|
|
653
443
|
const thirtytive = `${rootPen}/conf/distros/thirtyfive/*`;
|
|
654
|
-
await
|
|
444
|
+
await exec(`cp -r ${thirtytive} ${dest}`, echo);
|
|
655
445
|
/***********************************************************************************
|
|
656
446
|
* Arch Linux
|
|
657
447
|
**********************************************************************************/
|
|
@@ -662,7 +452,7 @@ class Pacman {
|
|
|
662
452
|
else if (this.distro().codenameLikeId === 'rolling') {
|
|
663
453
|
const dest = '/etc/penguins-eggs.d/distros/rolling/';
|
|
664
454
|
const rolling = `${rootPen}/conf/distros/rolling/*`;
|
|
665
|
-
await
|
|
455
|
+
await exec(`cp -r ${rolling} ${dest}`, echo);
|
|
666
456
|
/***********************************************************************************
|
|
667
457
|
* openSuse
|
|
668
458
|
**********************************************************************************/
|
|
@@ -673,29 +463,145 @@ class Pacman {
|
|
|
673
463
|
else if (this.distro().codenameLikeId === 'tumbleweed') {
|
|
674
464
|
const dest = '/etc/penguins-eggs.d/distros/tumbleweed/';
|
|
675
465
|
const tumbleweed = `${rootPen}/conf/distros/tumbleweed/*`;
|
|
676
|
-
await
|
|
466
|
+
await exec(`cp -r ${tumbleweed} ${dest}`, echo);
|
|
677
467
|
}
|
|
678
468
|
}
|
|
679
469
|
/**
|
|
680
|
-
*
|
|
681
|
-
* @
|
|
470
|
+
* Controlla se calamares è installabile
|
|
471
|
+
* @returns
|
|
682
472
|
*/
|
|
683
|
-
static
|
|
473
|
+
static isCalamaresAvailable() {
|
|
474
|
+
let result = this.distro().isCalamaresAvailable;
|
|
475
|
+
if (process.arch === 'arm' || process.arch === 'arm64') {
|
|
476
|
+
result = false;
|
|
477
|
+
}
|
|
478
|
+
return result;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
*
|
|
482
|
+
* @returns true se GUI
|
|
483
|
+
*/
|
|
484
|
+
static isInstalledGui() {
|
|
485
|
+
return this.isInstalledXorg() || this.isInstalledWayland();
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* check if it's installed wayland
|
|
489
|
+
* @returns true if wayland
|
|
490
|
+
*/
|
|
491
|
+
static isInstalledWayland() {
|
|
684
492
|
let installed = false;
|
|
685
493
|
if (this.distro().familyId === 'debian') {
|
|
686
|
-
|
|
494
|
+
if (Debian.packageIsInstalled('xwayland')) {
|
|
495
|
+
installed = true;
|
|
496
|
+
}
|
|
687
497
|
}
|
|
688
498
|
else if (this.distro().familyId === 'fedora') {
|
|
689
|
-
|
|
499
|
+
if (Fedora.packageIsInstalled('xorg-x11-server-Xwayland*')) {
|
|
500
|
+
installed = true;
|
|
501
|
+
}
|
|
690
502
|
}
|
|
691
503
|
else if (this.distro().familyId === 'archlinux') {
|
|
692
|
-
|
|
504
|
+
if (Archlinux.packageIsInstalled('xwayland')) {
|
|
505
|
+
installed = true;
|
|
506
|
+
}
|
|
693
507
|
}
|
|
694
|
-
else if (this.distro().familyId === 'suse') {
|
|
695
|
-
installed =
|
|
508
|
+
else if (this.distro().familyId === 'suse' && Suse.packageIsInstalled('xwayland*')) {
|
|
509
|
+
installed = true;
|
|
696
510
|
}
|
|
697
511
|
return installed;
|
|
698
512
|
}
|
|
513
|
+
/**
|
|
514
|
+
* check if it's installed xorg
|
|
515
|
+
* @returns
|
|
516
|
+
*/
|
|
517
|
+
static isInstalledXorg() {
|
|
518
|
+
let installed = false;
|
|
519
|
+
if (this.distro().familyId === 'debian') {
|
|
520
|
+
if (Debian.packageIsInstalled('xserver-xorg-core')) {
|
|
521
|
+
installed = true;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
else if (this.distro().familyId === 'fedora') {
|
|
525
|
+
if (Fedora.packageIsInstalled('xorg-x11-server-Xorg.x86_64')) {
|
|
526
|
+
installed = true;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
530
|
+
if (Archlinux.packageIsInstalled('xorg-server-common')) {
|
|
531
|
+
installed = true;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
else if (this.distro().familyId === 'suse' && Suse.packageIsInstalled('xorg-x11-server')) {
|
|
535
|
+
installed = true;
|
|
536
|
+
}
|
|
537
|
+
return installed;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Check if the system is just CLI
|
|
541
|
+
*/
|
|
542
|
+
static isRunningCli() {
|
|
543
|
+
return !this.isRunningGui();
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Check if the system is GUI able
|
|
547
|
+
*/
|
|
548
|
+
static isRunningGui() {
|
|
549
|
+
return this.isRunningXorg() || this.isRunningWayland();
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Constrolla se è operante wayland
|
|
553
|
+
*/
|
|
554
|
+
static isRunningWayland() {
|
|
555
|
+
return process.env.XDG_SESSION_TYPE === 'wayland';
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* controlla se è operante xserver-xorg-core
|
|
559
|
+
*/
|
|
560
|
+
static isRunningXorg() {
|
|
561
|
+
return process.env.XDG_SESSION_TYPE === 'x11';
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Check se la macchina ha grub adatto ad efi
|
|
565
|
+
* Forse conviene spostarlo in pacman
|
|
566
|
+
*/
|
|
567
|
+
static isUefi() {
|
|
568
|
+
let isUefi = false;
|
|
569
|
+
if (this.distro().familyId === 'debian') {
|
|
570
|
+
if (Utils.uefiArch() !== 'i386' && this.packageIsInstalled('grub-efi-' + Utils.uefiArch() + '-bin')) {
|
|
571
|
+
isUefi = true;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
else if (Pacman.distro().familyId === 'fedora') {
|
|
575
|
+
isUefi = true;
|
|
576
|
+
}
|
|
577
|
+
else if (Pacman.distro().familyId === 'archlinux') {
|
|
578
|
+
isUefi = true;
|
|
579
|
+
}
|
|
580
|
+
else if (Pacman.distro().familyId === 'suse') {
|
|
581
|
+
isUefi = true;
|
|
582
|
+
}
|
|
583
|
+
return isUefi;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Installa manPage
|
|
587
|
+
*/
|
|
588
|
+
static async manPageInstall(verbose = false) {
|
|
589
|
+
const manPageSrc = path.resolve(__dirname, '../../manpages/doc/man/eggs.roll.gz');
|
|
590
|
+
if (fs.existsSync(manPageSrc)) {
|
|
591
|
+
const man1Dir = '/usr/share/man/man1/';
|
|
592
|
+
if (!fs.existsSync(man1Dir)) {
|
|
593
|
+
exec(`mkdir ${man1Dir} -p`);
|
|
594
|
+
}
|
|
595
|
+
const manPageDest = man1Dir + 'eggs.1.gz';
|
|
596
|
+
exec(`cp ${manPageSrc} ${manPageDest}`);
|
|
597
|
+
if (shx.exec('which mandb', { silent: true }).stdout.trim() !== '') {
|
|
598
|
+
await exec('mandb > /dev/null');
|
|
599
|
+
if (verbose) {
|
|
600
|
+
console.log('manPage eggs installed...');
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
699
605
|
/**
|
|
700
606
|
* restuisce VERO se il pacchetto è installato
|
|
701
607
|
* @param debPackage
|
|
@@ -703,7 +609,7 @@ class Pacman {
|
|
|
703
609
|
static async packageAptAvailable(packageName) {
|
|
704
610
|
let available = false;
|
|
705
611
|
if (this.distro().familyId === 'debian') {
|
|
706
|
-
available =
|
|
612
|
+
available = Debian.packageIsInstalled(packageName);
|
|
707
613
|
}
|
|
708
614
|
return available;
|
|
709
615
|
}
|
|
@@ -715,26 +621,10 @@ class Pacman {
|
|
|
715
621
|
static async packageAptLast(debPackage) {
|
|
716
622
|
let version = '';
|
|
717
623
|
if (this.distro().familyId === 'debian') {
|
|
718
|
-
version = await
|
|
624
|
+
version = await Debian.packageAptLast(debPackage);
|
|
719
625
|
}
|
|
720
626
|
return version;
|
|
721
627
|
}
|
|
722
|
-
static async packageNpmLast(packageNpm = 'penguins-eggs') {
|
|
723
|
-
return shelljs_1.default.exec('npm show ' + packageNpm + ' version', { silent: true }).stdout.trim();
|
|
724
|
-
}
|
|
725
|
-
/**
|
|
726
|
-
*
|
|
727
|
-
* @param cmd
|
|
728
|
-
*/
|
|
729
|
-
static commandIsInstalled(cmd) {
|
|
730
|
-
let installed = false;
|
|
731
|
-
// if (shx.exec(`command -V ${cmd} &>/dev/null`).code == 0) {
|
|
732
|
-
// remove output
|
|
733
|
-
if (shelljs_1.default.exec(`command -V ${cmd} >/dev/null 2>&1`).code == 0) {
|
|
734
|
-
installed = true;
|
|
735
|
-
}
|
|
736
|
-
return installed;
|
|
737
|
-
}
|
|
738
628
|
/**
|
|
739
629
|
* Install the package packageName
|
|
740
630
|
* @param packageName {string} Pacchetto Debian da installare
|
|
@@ -743,32 +633,63 @@ class Pacman {
|
|
|
743
633
|
static async packageInstall(packageName) {
|
|
744
634
|
let retVal = false;
|
|
745
635
|
if (this.distro().familyId === 'debian') {
|
|
746
|
-
retVal = await
|
|
636
|
+
retVal = await Debian.packageInstall(packageName);
|
|
747
637
|
}
|
|
748
638
|
else if (this.distro().familyId === 'archlinux') {
|
|
749
|
-
retVal = await
|
|
639
|
+
retVal = await Archlinux.packageInstall(packageName);
|
|
750
640
|
}
|
|
751
641
|
else if (this.distro().familyId === 'fedora') {
|
|
752
|
-
retVal = await
|
|
642
|
+
retVal = await Fedora.packageInstall(packageName);
|
|
753
643
|
}
|
|
754
644
|
return retVal;
|
|
755
645
|
}
|
|
646
|
+
/**
|
|
647
|
+
* restuisce VERO se il pacchetto è installato
|
|
648
|
+
* @param debPackage
|
|
649
|
+
*/
|
|
650
|
+
static packageIsInstalled(packageName) {
|
|
651
|
+
let installed = false;
|
|
652
|
+
if (this.distro().familyId === 'debian') {
|
|
653
|
+
installed = Debian.packageIsInstalled(packageName);
|
|
654
|
+
}
|
|
655
|
+
else if (this.distro().familyId === 'fedora') {
|
|
656
|
+
installed = Fedora.packageIsInstalled(packageName);
|
|
657
|
+
}
|
|
658
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
659
|
+
installed = Archlinux.packageIsInstalled(packageName);
|
|
660
|
+
}
|
|
661
|
+
else if (this.distro().familyId === 'suse') {
|
|
662
|
+
installed = Suse.packageIsInstalled(packageName);
|
|
663
|
+
}
|
|
664
|
+
return installed;
|
|
665
|
+
}
|
|
666
|
+
static async packageNpmLast(packageNpm = 'penguins-eggs') {
|
|
667
|
+
return shx.exec('npm show ' + packageNpm + ' version', { silent: true }).stdout.trim();
|
|
668
|
+
}
|
|
756
669
|
/**
|
|
757
670
|
*
|
|
758
|
-
* @
|
|
759
|
-
*
|
|
760
|
-
* Probabilmente da rimuovere, viene usata solo da prerequisitesRemove
|
|
761
|
-
*
|
|
671
|
+
* @returns grub
|
|
762
672
|
*/
|
|
763
|
-
static
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
if (
|
|
767
|
-
|
|
673
|
+
static whichGrubIsInstalled() {
|
|
674
|
+
let grubInstalled = '';
|
|
675
|
+
if (this.distro().familyId === 'debian') {
|
|
676
|
+
if (this.packageIsInstalled('grub-common')) {
|
|
677
|
+
grubInstalled = 'grub';
|
|
768
678
|
}
|
|
769
679
|
}
|
|
770
|
-
|
|
680
|
+
else if (this.distro().familyId === 'fedora') {
|
|
681
|
+
if (this.packageIsInstalled('grub2-common.noarch')) {
|
|
682
|
+
grubInstalled = 'grub2';
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
686
|
+
if (this.packageIsInstalled('grub')) {
|
|
687
|
+
grubInstalled = 'grub';
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
else if (this.distro().familyId === 'suse' && this.packageIsInstalled('grub2')) {
|
|
691
|
+
grubInstalled = 'grub2';
|
|
692
|
+
}
|
|
693
|
+
return grubInstalled;
|
|
771
694
|
}
|
|
772
695
|
}
|
|
773
|
-
Pacman.debs4calamares = ['calamares', 'qml-module-qtquick2', 'qml-module-qtquick-controls'];
|
|
774
|
-
exports.default = Pacman;
|