penguins-eggs 25.9.3 → 25.9.8

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.
Files changed (98) hide show
  1. package/.oclif.manifest.json +1 -1
  2. package/README.md +45 -45
  3. package/README.pdf +815 -801
  4. package/addons/eggs/adapt/applications/eggs-adapt.desktop +0 -0
  5. package/addons/eggs/pve/applications/eggs-pve.desktop +0 -0
  6. package/addons/eggs/rsupport/applications/eggs-rsupport.desktop +0 -0
  7. package/addons/eggs/theme/applications/install-system.desktop +0 -0
  8. package/assets/calamares/install-system.sh +0 -0
  9. package/assets/penguins-eggs.desktop +0 -0
  10. package/assets/penguins-krill.desktop +0 -0
  11. package/assets/penguins-links-add.desktop +0 -0
  12. package/assets/penguins-live-installer.desktop +0 -0
  13. package/bin/dev.js +0 -0
  14. package/conf/distros/alpine/calamares/calamares-modules/machineid-openrc/machineid-openrc.sh +0 -0
  15. package/conf/distros/bionic/calamares/calamares-modules/after-bootloader/after-bootloader.sh +0 -0
  16. package/conf/distros/bionic/calamares/calamares-modules/before-bootloader/before-bootloader.sh +0 -0
  17. package/conf/distros/bionic/calamares/calamares-modules/before-bootloader-mkdirs/before-bootloader-mkdirs.sh +0 -0
  18. package/conf/distros/bionic/calamares/calamares-modules/bug/bug.sh +0 -0
  19. package/conf/distros/bionic/calamares/calamares-modules/grubcfg/main.py +0 -0
  20. package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
  21. package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
  22. package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
  23. package/conf/distros/fedora/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
  24. package/conf/distros/opensuse/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
  25. package/conf/distros/opensuse/calamares/settings.yml +0 -0
  26. package/conf/distros/opensuse/calamares/zstd2lzo.sh +0 -0
  27. package/conf/exclude.list.d/master.list +4 -0
  28. package/conf/init/unattended.sh +0 -0
  29. package/dist/classes/utils.d/kernel.d.ts +6 -5
  30. package/dist/classes/utils.d/kernel.js +74 -43
  31. package/dist/commands/export/pkg.js +18 -23
  32. package/dist/commands/tools/ppa.d.ts +6 -0
  33. package/dist/commands/tools/ppa.js +73 -26
  34. package/dist/commands/update.d.ts +2 -7
  35. package/dist/commands/update.js +102 -91
  36. package/dist/krill/classes/sequence.d/bootloader.js +1 -2
  37. package/dist/krill/classes/sequence.d/bootloader_config.js +1 -3
  38. package/dist/penguins-eggs_25.9.8-1_amd64.deb +0 -0
  39. package/dist/penguins-eggs_25.9.8-1_amd64.deb.sha256 +1 -0
  40. package/dist/penguins-eggs_25.9.8-1_arm64.deb +0 -0
  41. package/dist/penguins-eggs_25.9.8-1_arm64.deb.sha256 +1 -0
  42. package/dist/penguins-eggs_25.9.8-1_i386.deb +0 -0
  43. package/dist/penguins-eggs_25.9.8-1_i386.deb.sha256 +1 -0
  44. package/eui/eui-autostart-cinnamon.desktop +0 -0
  45. package/eui/eui-autostart-xfce.desktop +0 -0
  46. package/eui/eui-create-image.sh +0 -0
  47. package/eui/eui-start.sh +0 -0
  48. package/package.json +125 -131
  49. package/perrisbrewery/scripts/postinst +0 -0
  50. package/perrisbrewery/scripts/postrm +0 -0
  51. package/perrisbrewery/scripts/preinst +0 -0
  52. package/perrisbrewery/scripts/prerm +0 -0
  53. package/pods/almalinux.sh +0 -0
  54. package/pods/archlinux.sh +0 -0
  55. package/pods/ci/kernel-overlay-install.sh +0 -0
  56. package/pods/ci/minimal/almalinux-container2host.sh +0 -0
  57. package/pods/ci/minimal/archlinux-container2host.sh +0 -0
  58. package/pods/ci/minimal/debian-container2host.sh +0 -0
  59. package/pods/ci/minimal/fedora-container2host.sh +0 -0
  60. package/pods/ci/minimal/manjaro-container2host.sh +0 -0
  61. package/pods/ci/minimal/opensuse-container2host.sh +0 -0
  62. package/pods/ci/penguins-eggs-execute.sh +0 -0
  63. package/pods/ci/penguins-eggs-install.sh +0 -0
  64. package/pods/ci/run +0 -0
  65. package/pods/ci/run-on-almalinux.sh +0 -0
  66. package/pods/ci/run-on-archlinux.sh +0 -0
  67. package/pods/ci/run-on-debian.sh +0 -0
  68. package/pods/ci/run-on-devuan.sh +0 -0
  69. package/pods/ci/run-on-fedora.sh +0 -0
  70. package/pods/ci/run-on-manjaro.sh +0 -0
  71. package/pods/ci/run-on-opensuse.sh +0 -0
  72. package/pods/ci/run-on-rockylinux.sh +0 -0
  73. package/pods/ci/run-on-ubuntu.sh +0 -0
  74. package/pods/debian.sh +0 -0
  75. package/pods/devuan.sh +0 -0
  76. package/pods/fedora.sh +0 -0
  77. package/pods/lmde.sh +0 -0
  78. package/pods/manjaro.sh +0 -0
  79. package/pods/opensuse.sh +0 -0
  80. package/pods/podman.command.sh +0 -0
  81. package/pods/rocky.sh +0 -0
  82. package/pods/run-build-packages-debs.sh +0 -0
  83. package/pods/run-create-debs.sh +0 -0
  84. package/pods/ubuntu.sh +0 -0
  85. package/scripts/99clean +0 -0
  86. package/scripts/adapt.sh +0 -0
  87. package/scripts/bros/waydroid-helper.sh +0 -0
  88. package/scripts/lsb_release +0 -0
  89. package/scripts/mom.sh +0 -0
  90. package/scripts/pve-live.service +0 -0
  91. package/scripts/pve-live.sh +0 -0
  92. package/scripts/resy +0 -0
  93. package/dist/penguins-eggs_25.9.3-1_amd64.deb +0 -0
  94. package/dist/penguins-eggs_25.9.3-1_amd64.deb.sha256 +0 -1
  95. package/dist/penguins-eggs_25.9.3-1_arm64.deb +0 -0
  96. package/dist/penguins-eggs_25.9.3-1_arm64.deb.sha256 +0 -1
  97. package/dist/penguins-eggs_25.9.3-1_i386.deb +0 -0
  98. package/dist/penguins-eggs_25.9.3-1_i386.deb.sha256 +0 -1
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/bin/dev.js CHANGED
File without changes
File without changes
File without changes
@@ -24,6 +24,10 @@ swapfile
24
24
  sys/*
25
25
  tmp/*
26
26
 
27
+ # fedora/el9/etc
28
+ boot/*rescue*
29
+
30
+
27
31
  *.cache # suggestion from blaxbox-ai
28
32
 
29
33
  ######################################################################################################
File without changes
@@ -15,10 +15,11 @@ export default class Kernel {
15
15
  */
16
16
  static vmlinuz(kernel?: string): string;
17
17
  /**
18
- * Ricava path per initramfs/initrd
18
+ * cerca il path per initramfs/initrd nella directory /boot
19
+ * se fallisce, prova la convenzione Arch
19
20
  *
20
- * @param kernel - Versione del kernel
21
- * @returns Path al file initramfs
21
+ * @param kernel - Versione del kernel (es. '6.5.0-14-generic'). Se omessa, usa il kernel in esecuzione.
22
+ * @returns Path al file initramfs.
22
23
  */
23
24
  static initramfs(kernel?: string): string;
24
25
  /**
@@ -28,10 +29,10 @@ export default class Kernel {
28
29
  * most of the distros:
29
30
  * debian, fedora, opensuse, rasberry
30
31
  */
31
- private static vmlinuxFromUname;
32
+ private static vmlinuzFromUname;
32
33
  /**
33
34
  * vmlinuxFromCmdline
34
35
  * raspbery /proc/cmdline dont contain it
35
36
  */
36
- private static vmlinuxFromCmdline;
37
+ private static vmlinuzFromCmdline;
37
38
  }
@@ -9,7 +9,6 @@ import path from 'path';
9
9
  import Distro from '../distro.js';
10
10
  import Utils from '../utils.js';
11
11
  import { execSync } from 'node:child_process';
12
- import Diversions from '../diversions.js';
13
12
  /**
14
13
  * Kernel utilities for managing vmlinuz and initramfs paths
15
14
  */
@@ -22,9 +21,9 @@ export default class Kernel {
22
21
  static vmlinuz(kernel = '') {
23
22
  let vmlinuz = '';
24
23
  if (!Utils.isContainer()) {
25
- vmlinuz = this.vmlinuxFromUname();
24
+ vmlinuz = this.vmlinuzFromUname();
26
25
  if (vmlinuz === '') {
27
- vmlinuz = this.vmlinuxFromCmdline();
26
+ vmlinuz = this.vmlinuzFromCmdline();
28
27
  if (vmlinuz === '') {
29
28
  console.log('vmlinuz not found');
30
29
  process.exit(1);
@@ -42,57 +41,89 @@ export default class Kernel {
42
41
  return vmlinuz;
43
42
  }
44
43
  /**
45
- * Ricava path per initramfs/initrd
44
+ * cerca il path per initramfs/initrd nella directory /boot
45
+ * se fallisce, prova la convenzione Arch
46
46
  *
47
- * @param kernel - Versione del kernel
48
- * @returns Path al file initramfs
47
+ * @param kernel - Versione del kernel (es. '6.5.0-14-generic'). Se omessa, usa il kernel in esecuzione.
48
+ * @returns Path al file initramfs.
49
49
  */
50
50
  static initramfs(kernel = '') {
51
- const distro = new Distro();
52
- let initramfs = '';
53
- if (kernel === '') {
54
- if (!Utils.isContainer()) {
55
- kernel = execSync('uname -r').toString().trim();
56
- }
57
- else {
58
- Utils.warning("cannot work on containers actually!");
51
+ let targetKernel = kernel;
52
+ // 1. Determina la versione del kernel target
53
+ if (targetKernel === '') {
54
+ if (Utils.isContainer()) {
55
+ Utils.warning("Non è possibile determinare il kernel in un container.");
59
56
  process.exit(1);
60
57
  }
58
+ targetKernel = execSync('uname -r').toString().trim();
61
59
  }
62
- // rolling...
63
- if (distro.familyId === "alpine") {
64
- let suffix = kernel.substring(kernel.lastIndexOf('-'));
65
- initramfs = `/boot/initramfs${suffix}`;
60
+ const kernelVersionShort = targetKernel.split('.').slice(0, 2).join('.');
61
+ const bootDir = '/boot';
62
+ // 2. Leggi tutti i file nella directory /boot
63
+ let bootFiles;
64
+ try {
65
+ bootFiles = fs.readdirSync(bootDir);
66
66
  }
67
- else if (distro.familyId === "archlinux" && (!Diversions.isManjaroBased(distro.distroId))) {
68
- let suffix = kernel.substring(kernel.lastIndexOf('-'));
69
- initramfs = `/boot/initramfs-linux${suffix}.img`;
67
+ catch (error) {
68
+ console.error(`ERRORE: Impossibile leggere la directory ${bootDir}.`);
69
+ process.exit(1);
70
70
  }
71
- else if (distro.familyId === "archlinux" && (Diversions.isManjaroBased(distro.distroId))) {
72
- let version = kernel.split('.').slice(0, 2).join('.');
73
- initramfs = `/boot/initramfs-${version}-x86_64.img`;
71
+ // 3. Cerca il file corrispondente con un sistema di priorità
72
+ const candidates = [];
73
+ for (const filename of bootFiles) {
74
+ if ((filename.startsWith('initramfs-') ||
75
+ filename.startsWith('initrd.img-') ||
76
+ filename.startsWith('initrd-')) &&
77
+ (filename.includes(targetKernel) || filename.includes(kernelVersionShort))) {
78
+ candidates.push(filename);
79
+ }
74
80
  }
75
- else {
76
- // Gestione generica per le altre distro (Debian, Fedora, SUSE, OpenMamba, cc.)
77
- const candidates = [
78
- `/boot/initrd.img-${kernel}`, // Debian, Ubuntu
79
- `/boot/initramfs-${kernel}.img`, // Fedora, RHEL
80
- `/boot/initramfs-${kernel}-1mamba-x86_64.img`, // Openmamba
81
- `/boot/initrd-${kernel}`, // openSUSE
82
- `/boot/initramfs-${kernel}`, // fallbacks
83
- ];
84
- for (const candidate of candidates) {
85
- if (fs.existsSync(candidate)) {
86
- initramfs = candidate;
87
- break;
81
+ // Se troviamo almeno un candidato, usiamo quello
82
+ if (candidates.length > 0) {
83
+ let foundPath = path.join(bootDir, candidates[0]);
84
+ /**
85
+ * ma, se sono più di uno, usiamo il più breve
86
+ * per evitare estensioni come -fallback.img, .old, .bak, etc
87
+ */
88
+ if (candidates.length > 1) {
89
+ // Filtra i candidati per escludere quelli di fallback se esiste un'alternativa
90
+ const nonFallbackCandidates = candidates.filter(c => !c.includes('-fallback'));
91
+ const searchArray = nonFallbackCandidates.length > 0 ? nonFallbackCandidates : candidates;
92
+ foundPath = path.join(bootDir, searchArray[0]); // Inizia con il primo
93
+ for (const candidate of searchArray) {
94
+ const current = path.join(bootDir, candidate);
95
+ if (current.length < foundPath.length) {
96
+ foundPath = current;
97
+ }
88
98
  }
89
99
  }
100
+ return foundPath;
90
101
  }
91
- if (!fs.existsSync(initramfs)) {
92
- console.error(`ERROR: initramfs file ${initramfs} does not exist!`);
93
- process.exit(1);
102
+ // 4. Fallback per casi specifici (Arch e Alpine Linux)
103
+ // Questo viene eseguito solo se la ricerca dinamica fallisce.
104
+ const staticFallbacks = [
105
+ // --- Alpine Linux ---
106
+ 'initramfs-lts', // Kernel Long-Term Support
107
+ 'initramfs-virt', // Kernel per ambienti virtualizzati
108
+ 'initramfs-standard', // Kernel standard (meno comune)
109
+ 'initramfs-rpi', // Kernel per Raspberry Pi
110
+ // --- Arch Linux ---
111
+ 'initramfs-linux.img', // Arch Linux standard
112
+ 'initramfs-linux-lts.img', // Arch Linux LTS
113
+ 'initramfs-linux-zen.img', // Arch Linux Zen
114
+ 'initramfs-linux-hardened.img', // Arch Linux hardened
115
+ ];
116
+ for (const fallback of staticFallbacks) {
117
+ const fallbackPath = path.join(bootDir, fallback);
118
+ if (fs.existsSync(fallbackPath)) {
119
+ // Nota: questo potrebbe non corrispondere al 100% al kernel in esecuzione,
120
+ // ma è il comportamento atteso su questi sistemi
121
+ return fallbackPath;
122
+ }
94
123
  }
95
- return initramfs;
124
+ // 5. Se nessuna delle strategie ha funzionato, esci con errore
125
+ Utils.warning(`Could not find an initramfs file for kernel ${targetKernel} in ${bootDir}.`);
126
+ process.exit(1);
96
127
  }
97
128
  /**
98
129
  * ALL PRIVATE
@@ -101,7 +132,7 @@ export default class Kernel {
101
132
  * most of the distros:
102
133
  * debian, fedora, opensuse, rasberry
103
134
  */
104
- static vmlinuxFromUname() {
135
+ static vmlinuzFromUname() {
105
136
  const kernelVersion = execSync('uname -r').toString().trim();
106
137
  let kernelPath = `/boot/vmlinuz-${kernelVersion}`;
107
138
  if (fs.existsSync(kernelPath)) {
@@ -115,7 +146,7 @@ export default class Kernel {
115
146
  * vmlinuxFromCmdline
116
147
  * raspbery /proc/cmdline dont contain it
117
148
  */
118
- static vmlinuxFromCmdline() {
149
+ static vmlinuzFromCmdline() {
119
150
  let distro = new Distro();
120
151
  let vmlinuz = '';
121
152
  // Find vmlinuz in /proc/cmdline
@@ -60,7 +60,7 @@ export default class ExportPkg extends Command {
60
60
  if (process.arch === 'ia32') {
61
61
  arch = 'i386';
62
62
  }
63
- Utils.warning(`alpine apk`);
63
+ Utils.warning(`exporting Alpine APK packages`);
64
64
  localPath = `/home/${this.user}/packages/aports/${arch}`;
65
65
  remotePath = `${this.Tu.config.remotePathPackages}/alpine/${arch}`;
66
66
  filter = `penguins-eggs-*[0-9][0-9].@([0-9]|[0-1][0-9]).@([0-9]|[0-3][0-9])-*.apk`;
@@ -73,7 +73,7 @@ export default class ExportPkg extends Command {
73
73
  * Manjaro
74
74
  */
75
75
  if (Diversions.isManjaroBased(distroId)) {
76
- Utils.warning("manjaro PKGBUILD");
76
+ Utils.warning(`exporting Manjaro .pkg.tar.zst packages`);
77
77
  localPath = `/home/${this.user}/penguins-packs/manjaro/penguins-eggs`;
78
78
  remotePath = this.Tu.config.remotePathPackages + "/manjaro";
79
79
  filter = `penguins-eggs-[0-9][0-9].@([0-9]|[0-1][0-9]).@([0-9]|[0-3][0-9])-*-any.pkg.tar.*`;
@@ -82,7 +82,7 @@ export default class ExportPkg extends Command {
82
82
  */
83
83
  }
84
84
  else {
85
- Utils.warning("aur PKGBUILD");
85
+ Utils.warning(`exporting Arch .pkg.tar.zst packages`);
86
86
  localPath = `/home/${this.user}/penguins-packs/aur/penguins-eggs`;
87
87
  remotePath = this.Tu.config.remotePathPackages + "/aur";
88
88
  filter = `penguins-eggs-[0-9][0-9].@([0-9]|[0-1][0-9]).@([0-9]|[0-3][0-9])-*-any.pkg.tar.zst`;
@@ -92,7 +92,7 @@ export default class ExportPkg extends Command {
92
92
  */
93
93
  }
94
94
  else if (familyId === "debian") {
95
- Utils.warning("debian DEB");
95
+ Utils.warning(`exporting Devuan/Debian/Ubuntu DEB packages`);
96
96
  localPath = `/home/${this.user}/penguins-eggs/dist`;
97
97
  remotePath = this.Tu.config.remotePathPackages + "/debs";
98
98
  let arch = Utils.uefiArch();
@@ -105,22 +105,24 @@ export default class ExportPkg extends Command {
105
105
  */
106
106
  }
107
107
  else if (familyId === 'fedora') {
108
- Utils.warning("fedora RPM");
109
- localPath = `/home/${this.user}/rpmbuild/RPMS/x86_64`;
110
- if (distroId === 'fedora') {
111
- remotePath = this.Tu.config.remotePathPackages + "/fedora";
112
- filter = `penguins-eggs-[0-9][0-9].[0-9]*.[0-9]*-*.fc??.x86_64.rpm`;
113
- }
114
- else {
115
- remotePath = this.Tu.config.remotePathPackages + "/el9";
116
- filter = `penguins-eggs-[0-9][0-9].[0-9]*.[0-9]*-*.el?.x86_64.rpm`;
108
+ let repo = 'fedora';
109
+ let ftype = 'fc??';
110
+ let warning = `exporting Fedora RPM packages`;
111
+ if (distro.distroId !== 'Fedora') {
112
+ repo = 'el9';
113
+ ftype = `el?`;
114
+ warning = `exporting Almalinux/Rocky RPM packages`;
117
115
  }
116
+ filter = `penguins-eggs-[0-9][0-9].[0-9]*.[0-9]*-*.${ftype}.x86_64.rpm`;
117
+ Utils.warning(warning);
118
+ localPath = `/home/${this.user}/rpmbuild/RPMS/x86_64`;
119
+ remotePath = this.Tu.config.remotePathPackages + `/` + repo;
118
120
  /**
119
121
  * openmamba
120
122
  */
121
123
  }
122
124
  else if (familyId === 'openmamba') {
123
- Utils.warning("openmamba rpm packages");
125
+ Utils.warning(`exporting Openmamba RPM packages`);
124
126
  localPath = `/home/${this.user}/rpmbuild/RPMS/x86_64`;
125
127
  remotePath = this.Tu.config.remotePathPackages + "/openmamba";
126
128
  filter = `penguins-eggs-[0-9][0-9].@([0-9]|[0-1][0-9]).@([0-9]|[0-3][0-9])-*mamba.*.rpm`;
@@ -129,17 +131,10 @@ export default class ExportPkg extends Command {
129
131
  */
130
132
  }
131
133
  else if (familyId === 'opensuse') {
132
- Utils.warning("opensuse rpm packages");
134
+ Utils.warning(`exporting OpenSuSE RPM packages`);
133
135
  localPath = `/home/${this.user}/rpmbuild/RPMS/x86_64`;
134
136
  remotePath = this.Tu.config.remotePathPackages + "/opensuse";
135
137
  filter = `penguins-eggs-[0-9][0-9].[0-9]*.[0-9]*-*.opensuse.x86_64.rpm`;
136
- /**
137
- * voidlinux
138
- */
139
- }
140
- else if (familyId === 'voidlinux') {
141
- Utils.warning("voidlinux packages");
142
- process.exit();
143
138
  }
144
139
  let cmd = `#!/bin/bash\n`;
145
140
  cmd += `set -e\n`;
@@ -161,6 +156,7 @@ export default class ExportPkg extends Command {
161
156
  cmd += `# Export packages\n`;
162
157
  cmd += `cp ${localPath}/${filter} ${remoteMountpoint}\n`;
163
158
  cmd += 'sync\n';
159
+ cmd += `\n`;
164
160
  cmd += `# wait before to umount\n`;
165
161
  cmd += 'sleep 2s\n';
166
162
  cmd += `fusermount3 -u ${remoteMountpoint}\n`;
@@ -172,7 +168,6 @@ export default class ExportPkg extends Command {
172
168
  }
173
169
  console.log(`copy: ${localPath}/${filter} to ${this.Tu.config.remoteUser}@${this.Tu.config.remoteHost}:${remotePath}`);
174
170
  }
175
- // console.log(cmd)
176
171
  await exec(cmd, this.echo);
177
172
  }
178
173
  }
@@ -5,6 +5,12 @@
5
5
  * email: piero.proietti@gmail.com
6
6
  * license: MIT
7
7
  */
8
+ /**
9
+ * Debian 13 trixe, Ubuntu 24.04 noble usano il formato deb822
10
+ *
11
+ * esiste un comando per modernizzare le sorgenti:
12
+ * sudo apt modernize-sources
13
+ */
8
14
  import { Command } from '@oclif/core';
9
15
  /**
10
16
  *
@@ -5,13 +5,24 @@
5
5
  * email: piero.proietti@gmail.com
6
6
  * license: MIT
7
7
  */
8
+ /**
9
+ * Debian 13 trixe, Ubuntu 24.04 noble usano il formato deb822
10
+ *
11
+ * esiste un comando per modernizzare le sorgenti:
12
+ * sudo apt modernize-sources
13
+ */
8
14
  import { Command, Flags } from '@oclif/core';
9
15
  import fs from 'node:fs';
16
+ import path from 'node:path';
10
17
  import Distro from '../../classes/distro.js';
11
18
  import Utils from '../../classes/utils.js';
12
19
  import { exec } from '../../lib/utils.js';
13
- const fkey = '/etc/apt/trusted.gpg.d/penguins-eggs-key.gpg';
14
- const flist = '/etc/apt/sources.list.d/penguins-eggs-ppa.list';
20
+ import Diversions from '../../classes/diversions.js';
21
+ const ppaKey = '/usr/share/keyrings/penguins-eggs-ppa.gpg';
22
+ // '/etc/apt/trusted.gpg.d/penguins-eggs-key.gpg'
23
+ const ppaName = `/etc/apt/sources.list.d/penguins-eggs-ppa`;
24
+ const ppaList = ppaName + '.list';
25
+ const ppaSources = ppaName + '.sources';
15
26
  /**
16
27
  *
17
28
  */
@@ -43,39 +54,48 @@ export default class Ppa extends Command {
43
54
  */
44
55
  if (distro.familyId === 'debian') {
45
56
  if (flags.add) {
46
- Utils.warning(`Are you sure to add ${flist} to your repositories?`);
57
+ Utils.warning(`Are you sure to add source ${path.basename(ppaName)} to your repositories?`);
47
58
  if (nointeractive || (await Utils.customConfirm('Select yes to continue...'))) {
48
- await debianAdd();
59
+ // remove old penguins-eggs-ppa.list
60
+ debianRemove();
61
+ if (await is822()) {
62
+ debianAdd822();
63
+ }
64
+ else {
65
+ await debianAdd();
66
+ }
49
67
  }
50
68
  }
51
69
  else if (flags.remove) {
52
- Utils.warning(`Are you sure to remove ${flist} to your repositories?`);
70
+ Utils.warning(`Are you sure to remove source ${path.basename(ppaName)} to your repositories?`);
53
71
  if (nointeractive || (await Utils.customConfirm('Select yes to continue...'))) {
54
72
  await debianRemove();
55
73
  }
56
74
  }
75
+ await exec('apt-get update');
57
76
  /**
58
- * archlinux
77
+ * Arch and only Arch! no Manjaro...
59
78
  */
60
79
  }
61
- if (distro.familyId === 'archlinux') {
80
+ else if (distro.familyId === 'archlinux' && !Diversions.isManjaroBased(distro.distroId)) {
62
81
  if (flags.add) {
63
- if (distro.distroId !== 'Manjarolinux') {
64
- Utils.warning(`Are you sure to add chaotic-aur to your repositories?`);
65
- if (await Utils.customConfirm('Select yes to continue...')) {
66
- await archAdd();
67
- }
82
+ Utils.warning(`Are you sure to add Chaotic-AUR to your repositories?`);
83
+ if (await Utils.customConfirm('Select yes to continue...')) {
84
+ await archAdd();
68
85
  }
69
86
  }
70
87
  else if (flags.remove) {
71
- await archRemove();
88
+ Utils.warning(`Are you sure to remove Chaotic-AUR to your repositories?`);
89
+ if (await Utils.customConfirm('Select yes to continue...')) {
90
+ await archRemove();
91
+ }
72
92
  }
73
- }
74
- else {
75
93
  /**
76
- * Others
94
+ * Alle the others
77
95
  */
78
- Utils.warning(`Distro> ${distro.distroId}/${distro.codenameId}, cannot use this command here!`);
96
+ }
97
+ else {
98
+ Utils.warning(`Distro: ${distro.distroId}/${distro.codenameId}, cannot use penguins-eggs-ppa nor chaotic-aur!`);
79
99
  }
80
100
  }
81
101
  }
@@ -89,7 +109,7 @@ async function archAdd() {
89
109
  const mirrorlist = 'chaotic-mirrorlist.pkg.tar.zst';
90
110
  const echo = Utils.setEcho(true);
91
111
  if (fs.existsSync(path + keyring) && fs.existsSync(path + mirrorlist)) {
92
- console.log('repository chaotic-aur, already present!');
112
+ console.log('repository Chaotic-AUR, already present!');
93
113
  await archRemove();
94
114
  process.exit();
95
115
  }
@@ -118,21 +138,48 @@ async function archRemove() {
118
138
  console.log(`Include = /etc/pacman.d/chaotic-mirrorlist`);
119
139
  }
120
140
  }
141
+ /**
142
+ * debianAdd822
143
+ */
144
+ async function debianAdd822() {
145
+ await exec(`curl -sS https://pieroproietti.github.io/penguins-eggs-ppa/KEY.gpg| gpg --dearmor | sudo tee ${ppaKey} > /dev/null`);
146
+ let content = '';
147
+ content += 'Types: deb\n';
148
+ content += 'URIs: https://pieroproietti.github.io/penguins-eggs-ppa\n';
149
+ content += 'Suites: ./\n';
150
+ content += 'Signed-By: /usr/share/keyrings/penguins-eggs-ppa.gpg\n';
151
+ fs.writeFileSync(ppaSources, content);
152
+ // crea un penguins-eggs-ppa.list vuoto
153
+ await exec(`touch ${ppaList}`);
154
+ }
121
155
  /**
122
156
  * debianAdd
123
157
  */
124
158
  async function debianAdd() {
125
- await exec(`curl -sS https://pieroproietti.github.io/penguins-eggs-ppa/KEY.gpg| gpg --dearmor | sudo tee ${fkey} > /dev/null`);
126
- const content = `deb [signed-by=${fkey}] https://pieroproietti.github.io/penguins-eggs-ppa ./\n`;
127
- fs.writeFileSync(flist, content);
128
- await exec('apt-get update');
159
+ await exec(`curl -sS https://pieroproietti.github.io/penguins-eggs-ppa/KEY.gpg| gpg --dearmor | sudo tee ${ppaKey} > /dev/null`);
160
+ const content = `deb [signed-by=${ppaKey}] https://pieroproietti.github.io/penguins-eggs-ppa ./\n`;
161
+ fs.writeFileSync(ppaList, content);
162
+ }
163
+ /**
164
+ * is822 (usa lo standard deb822 per le sorgenti)
165
+ */
166
+ async function is822() {
167
+ await exec(`curl -sS https://pieroproietti.github.io/penguins-eggs-ppa/KEY.gpg| gpg --dearmor | sudo tee ${ppaKey} > /dev/null`);
168
+ let retval = false;
169
+ const test = `([ -f /etc/apt/sources.list.d/ubuntu.sources ] || [ -f /etc/apt/sources.list.d/debian.sources ]) && echo "1" || echo "0"`;
170
+ const is822 = (await exec(test, { capture: true, echo: false, ignore: false }));
171
+ if (is822.code === 0) {
172
+ if (is822.data.trim() === '1') {
173
+ retval = true;
174
+ }
175
+ }
176
+ return retval;
129
177
  }
130
178
  /**
131
179
  * debianRemove
132
180
  */
133
181
  async function debianRemove() {
134
- await exec('rm -f /etc/apt/trusted.gpg.d/penguins-eggs*');
135
- await exec('rm -f /etc/apt/sources.list.d/penguins-eggs*');
136
- await exec('rm -f /usr/share/keyrings/penguins-eggs*');
137
- await exec('apt-get update');
182
+ await exec(`rm -f ${ppaKey}`);
183
+ await exec(`rm -f ${ppaList}`);
184
+ await exec(`rm -f ${ppaSources}`);
138
185
  }
@@ -30,7 +30,7 @@ export default class Update extends Command {
30
30
  /**
31
31
  *
32
32
  */
33
- getPkgFromRepo(): Promise<void>;
33
+ getPkgFromPackageManager(): Promise<void>;
34
34
  /**
35
35
  * download da LAN
36
36
  */
@@ -38,12 +38,7 @@ export default class Update extends Command {
38
38
  /**
39
39
  *
40
40
  */
41
- getPkgFromSourceforge(): Promise<void>;
42
- /**
43
- *
44
- * @param aptVersion
45
- */
46
- getFromSources(): void;
41
+ getFromSource(): void;
47
42
  /**
48
43
  * show
49
44
  */