penguins-eggs 25.11.8 → 25.11.21

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 (166) hide show
  1. package/.oclif.manifest.json +149 -140
  2. package/README.md +90 -132
  3. package/README.pdf +1343 -2331
  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/archlinux/calamares/modules/bootloader.yml +1 -1
  16. package/conf/distros/archlinux/calamares/modules/partition.yml +385 -8
  17. package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
  18. package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
  19. package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
  20. package/conf/distros/fedora/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
  21. package/conf/distros/focal/calamares/calamares-modules/.keepit +0 -0
  22. package/conf/distros/focal/calamares/calamares-modules/cleanup/cleanup.sh +20 -0
  23. package/conf/distros/focal/calamares/calamares-modules/cleanup/module.yml +9 -0
  24. package/conf/distros/focal/calamares/calamares-modules/sources-yolk/module.yml +8 -0
  25. package/conf/distros/focal/calamares/calamares-modules/sources-yolk/sources-yolk.sh +50 -0
  26. package/conf/distros/focal/calamares/calamares-modules/sources-yolk-undo/module.yml +8 -0
  27. package/conf/distros/focal/calamares/libexec/.keepit +0 -0
  28. package/conf/distros/focal/calamares/libexec/README.md +5 -0
  29. package/conf/distros/focal/calamares/libexec/calamares-aptsources.sh +15 -0
  30. package/conf/distros/focal/calamares/libexec/calamares-l10n-helper.sh +38 -0
  31. package/conf/distros/focal/calamares/libexec/calamares-logs-helper.sh +34 -0
  32. package/conf/distros/focal/calamares/libexec/calamares-nomodeset.sh +19 -0
  33. package/conf/distros/focal/calamares/modules/after_bootloader_context.yml +26 -0
  34. package/conf/distros/focal/calamares/modules/before_bootloader_context.yml +12 -0
  35. package/conf/distros/focal/calamares/modules/bootloader.yml +86 -0
  36. package/conf/distros/focal/calamares/modules/bootloader.yml.old +35 -0
  37. package/conf/distros/focal/calamares/modules/displaymanager.yml +12 -0
  38. package/conf/distros/focal/calamares/modules/finished.yml +6 -0
  39. package/conf/distros/focal/calamares/modules/fstab.yml +63 -0
  40. package/conf/distros/focal/calamares/modules/grubcfg.yml +51 -0
  41. package/conf/distros/focal/calamares/modules/keyboard.yml +29 -0
  42. package/conf/distros/focal/calamares/modules/locale.yml +7 -0
  43. package/conf/distros/focal/calamares/modules/machineid.yml +10 -0
  44. package/conf/distros/focal/calamares/modules/mount.yml +20 -0
  45. package/conf/distros/focal/calamares/modules/netinstall.yml +5 -0
  46. package/conf/distros/focal/calamares/modules/packages.mustache +5 -0
  47. package/conf/distros/focal/calamares/modules/partition.yml +21 -0
  48. package/conf/distros/focal/calamares/modules/removeuser.mustache +3 -0
  49. package/conf/distros/focal/calamares/modules/shellprocess@aptsources.yml +11 -0
  50. package/conf/distros/focal/calamares/modules/shellprocess@boot_deploy.yml +9 -0
  51. package/conf/distros/focal/calamares/modules/shellprocess@boot_reconfigure.yml +15 -0
  52. package/conf/distros/focal/calamares/modules/shellprocess@install_translations.yml +8 -0
  53. package/conf/distros/focal/calamares/modules/shellprocess@logs.yml +8 -0
  54. package/conf/distros/focal/calamares/modules/shellprocess@mkinitramfs.yml +6 -0
  55. package/conf/distros/focal/calamares/modules/shellprocess@nomodeset.yml +12 -0
  56. package/conf/distros/focal/calamares/modules/umount.yml +4 -0
  57. package/conf/distros/focal/calamares/modules/unpackfs.mustache +6 -0
  58. package/conf/distros/focal/calamares/modules/users.yml +27 -0
  59. package/conf/distros/focal/calamares/modules/welcome.yml +24 -0
  60. package/conf/distros/focal/calamares/settings.yml +97 -0
  61. package/conf/distros/noble/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
  62. package/conf/distros/noble/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
  63. package/conf/distros/noble/calamares/libexec/calamares-aptsources.sh +0 -0
  64. package/conf/distros/noble/calamares/libexec/calamares-l10n-helper.sh +0 -0
  65. package/conf/distros/noble/calamares/libexec/calamares-logs-helper.sh +0 -0
  66. package/conf/distros/noble/calamares/libexec/calamares-nomodeset.sh +0 -0
  67. package/conf/distros/opensuse/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
  68. package/conf/distros/opensuse/calamares/settings.yml +0 -0
  69. package/conf/distros/opensuse/calamares/zstd2lzo.sh +0 -0
  70. package/conf/distros/trixie/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
  71. package/conf/distros/trixie/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
  72. package/conf/distros/trixie/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
  73. package/conf/init/unattended.sh +0 -0
  74. package/dist/appimage/first-run-check.d.ts +8 -0
  75. package/dist/appimage/first-run-check.js +13 -0
  76. package/dist/appimage/prerequisites.d.ts +34 -0
  77. package/dist/appimage/prerequisites.js +350 -0
  78. package/dist/bin/dev.cmd +3 -0
  79. package/dist/bin/dev.js +6 -0
  80. package/dist/bin/run.cmd +3 -0
  81. package/dist/bin/run.js +5 -0
  82. package/dist/classes/cli-autologin.js +4 -4
  83. package/dist/classes/distro.js +11 -27
  84. package/dist/classes/diversions.d.ts +5 -0
  85. package/dist/classes/diversions.js +23 -7
  86. package/dist/classes/incubation/customize/customize-partitions.js +8 -1
  87. package/dist/classes/incubation/fisherman-helper/packages.js +1 -1
  88. package/dist/classes/incubation/incubator.js +2 -2
  89. package/dist/classes/pacman.d/archlinux.js +5 -5
  90. package/dist/classes/pacman.d/debian.js +0 -2
  91. package/dist/classes/pacman.d/opensuse.js +2 -2
  92. package/dist/classes/pacman.js +10 -11
  93. package/dist/classes/utils.d.ts +4 -0
  94. package/dist/classes/utils.js +19 -3
  95. package/dist/commands/calamares.js +1 -1
  96. package/dist/commands/config.js +2 -2
  97. package/dist/commands/{analyze.d.ts → export/appimage.d.ts} +10 -9
  98. package/dist/commands/export/appimage.js +76 -0
  99. package/dist/commands/export/iso.js +1 -1
  100. package/dist/commands/export/pkg.d.ts +1 -1
  101. package/dist/commands/export/pkg.js +2 -2
  102. package/dist/commands/{install.d.ts → krill.d.ts} +3 -4
  103. package/dist/commands/{install.js → krill.js} +5 -6
  104. package/dist/commands/produce.js +1 -1
  105. package/dist/commands/setup.d.ts +21 -0
  106. package/dist/commands/setup.js +90 -0
  107. package/dist/commands/tools/repo.d.ts +0 -5
  108. package/dist/commands/tools/repo.js +205 -127
  109. package/dist/commands/update.d.ts +1 -1
  110. package/dist/commands/update.js +68 -59
  111. package/dist/krill/components/information.js +2 -2
  112. package/dist/krill/components/title.js +13 -13
  113. package/dist/lib/utils.d.ts +16 -0
  114. package/dist/lib/utils.js +24 -32
  115. package/dracut/create-symlink +0 -0
  116. package/dracut/export +0 -0
  117. package/dracut/export-dracut-analysis +0 -0
  118. package/dracut/export-dracut-log +0 -0
  119. package/dracut/mkisofs +0 -0
  120. package/dracut/modules.d/00debug-shell/debug-hook.sh +0 -0
  121. package/dracut/modules.d/00debug-shell/module-setup.sh +0 -0
  122. package/dracut/modules.d/90block/block-cmdline.sh +0 -0
  123. package/dracut/modules.d/90block/module-setup.sh +0 -0
  124. package/dracut/modules.d/95iso-scan/iso-scan-fallback.sh +0 -0
  125. package/dracut/modules.d/95iso-scan/iso-scan.sh +0 -0
  126. package/dracut/modules.d/95iso-scan/module-setup.sh +0 -0
  127. package/dracut/modules.d/95luks-loop/luks-loop.sh +0 -0
  128. package/dracut/modules.d/95luks-loop/module-setup.sh +0 -0
  129. package/dracut/renew-initramfs +0 -0
  130. package/dracut/sbin2bin +0 -0
  131. package/dracut/update-dracut-conf-d +0 -0
  132. package/dracut/update-dracut-modules +0 -0
  133. package/eui/eui-autostart-cinnamon.desktop +0 -0
  134. package/eui/eui-autostart-xfce.desktop +0 -0
  135. package/eui/eui-create-image.sh +0 -0
  136. package/eui/eui-start.sh +0 -0
  137. package/manpages/doc/man/eggs.1.gz +0 -0
  138. package/manpages/doc/man/eggs.html +582 -9
  139. package/package.json +125 -130
  140. package/perrisbrewery/scripts/postinst +0 -0
  141. package/perrisbrewery/scripts/postrm +0 -0
  142. package/perrisbrewery/scripts/preinst +0 -0
  143. package/perrisbrewery/scripts/prerm +0 -0
  144. package/perrisbrewery/template/dependencies.yaml +0 -5
  145. package/perrisbrewery/template/man.template.md +7 -0
  146. package/scripts/99clean +0 -0
  147. package/scripts/_eggs +28 -47
  148. package/scripts/adapt.sh +0 -0
  149. package/scripts/appimage-build.sh +152 -0
  150. package/scripts/appimage-install.sh +43 -0
  151. package/scripts/bros/waydroid-helper.sh +0 -0
  152. package/scripts/eggs.bash +3 -4
  153. package/scripts/lsb_release +0 -0
  154. package/scripts/mom.sh +0 -0
  155. package/scripts/pve-live.service +0 -0
  156. package/scripts/pve-live.sh +0 -0
  157. package/scripts/resy +0 -0
  158. package/dist/classes/distro-hossein.d.ts +0 -52
  159. package/dist/classes/distro-hossein.js +0 -239
  160. package/dist/classes/incubation/incubator.d/bionic.d.ts +0 -32
  161. package/dist/classes/incubation/incubator.d/bionic.js +0 -83
  162. package/dist/commands/analyze.js +0 -95
  163. package/dist/commands/pods.d.ts +0 -22
  164. package/dist/commands/pods.js +0 -92
  165. package/scripts/boot-encrypted-root.sh +0 -220
  166. package/scripts/mount-encrypted-home.sh +0 -324
@@ -5,14 +5,8 @@
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
- * * esiste un comando per modernizzare le sorgenti:
11
- * sudo apt modernize-sources
12
- */
13
8
  import { Command, Flags } from '@oclif/core';
14
9
  import fs from 'node:fs';
15
- import path from 'node:path';
16
10
  import Distro from '../../classes/distro.js';
17
11
  import Utils from '../../classes/utils.js';
18
12
  import { exec } from '../../lib/utils.js';
@@ -21,21 +15,23 @@ const repoUrl = `https://penguins-eggs.net/repos`; // no slash at end
21
15
  const repoKeyUrl = repoUrl + '/KEY.asc';
22
16
  let repoPath = '/etc/apt/sources.list.d/penguins-repos'; // Base path without extension
23
17
  const repoKeyPath = '/usr/share/keyrings/penguins-repos.gpg';
24
- // RPM (Fedora/EL)
25
- const rpmKeyUrl = repoUrl + '/rpm/RPM-GPG-KEY-penguins-eggs';
26
- const rpmKeyOwner = 'piero.proietti@gmail.com'; // Per cercare e rimuovere la chiave
27
- const rpmRepoFilePath = '/etc/yum.repos.d/penguins-eggs.repo'; // Percorso di destinazione
28
- const rpmRepoFedoraUrl = repoUrl + '/rpm/fedora/penguins-eggs.repo';
29
- const rpmRepoEl9Url = repoUrl + '/rpm/el9/penguins-eggs.repo';
30
- // openSUSE
31
- const opensuseRepoUrl = repoUrl + '/rpm/opensuse/penguins-eggs.repo';
32
- const opensuseRepoName = 'penguins-eggs'; // Dal file .repo
33
18
  // Alpine
34
19
  const alpineRepoUrl = repoUrl + '/alpine/';
35
20
  const alpineKeyName = 'piero.proietti@gmail.com-662b958c';
36
21
  const alpineKeyUrl = repoUrl + `/alpine/${alpineKeyName}.rsa.pub`;
37
22
  const alpineKeyPath = `/etc/apk/keys/${alpineKeyName}.rsa.pub`;
38
23
  const alpineRepoFile = '/etc/apk/repositories';
24
+ // RPM (Fedora/EL)
25
+ const rpmKeyUrl = repoKeyUrl;
26
+ const rpmKeyOwner = 'piero.proietti@gmail.com'; // Per cercare e rimuovere la chiave
27
+ const rpmRepoFilePath = '/etc/yum.repos.d/penguins-eggs.repo'; // Percorso di destinazione
28
+ const rpmRepoFedoraUrl = repoUrl + '/rpm/fedora/42';
29
+ const rpmRepoEl9Url = repoUrl + '/rpm/el9';
30
+ // RPM (openSUSE)
31
+ const opensuseKeyUrl = repoKeyUrl;
32
+ const opensuseRepoUrl = repoUrl + '/rpm/opensuse/leap';
33
+ const opensuseRepoFilePath = '/etc/zypp/repos.d/penguins-eggs.repo'; // NUOVO
34
+ const opensuseKeyOwner = rpmKeyOwner; // RIUTILIZZA
39
35
  /**
40
36
  *
41
37
  */
@@ -58,19 +54,21 @@ export default class Repo extends Command {
58
54
  const { nointeractive } = flags;
59
55
  if (Utils.isRoot()) {
60
56
  const distro = new Distro();
57
+ const msgReposAdd = 'Are you sure you want to add https://penguins-eggs.net/repos to your repositories?';
58
+ const msgReposRemove = 'Are you sure to remove https://penguins-eggs.net/repos to your repositories?';
61
59
  if (distro.familyId === 'alpine') {
62
60
  /**
63
61
  * Alpine
64
62
  */
65
63
  if (flags.add) {
66
- Utils.warning(`Sei sicuro di voler aggiungere penguins-repos ai tuoi repository?`);
67
- if (nointeractive || (await Utils.customConfirm('Seleziona per continuare...'))) {
64
+ Utils.warning(msgReposAdd);
65
+ if (nointeractive || (await Utils.customConfirm('Select yes to continue'))) {
68
66
  await alpineRepoAdd();
69
67
  }
70
68
  }
71
69
  else if (flags.remove) {
72
- Utils.warning(`Sei sicuro di voler rimuovere penguins-repos dai tuoi repository?`);
73
- if (nointeractive || (await Utils.customConfirm('Seleziona per continuare...'))) {
70
+ Utils.warning(msgReposRemove);
71
+ if (nointeractive || (await Utils.customConfirm('Select yes to continue'))) {
74
72
  await alpineRepoRemove();
75
73
  }
76
74
  }
@@ -78,14 +76,14 @@ export default class Repo extends Command {
78
76
  }
79
77
  else if (distro.familyId === 'archlinux') {
80
78
  if (flags.add) {
81
- Utils.warning(`Are you sure to add penguins-repos to your repositories?`);
82
- if (await Utils.customConfirm('Select yes to continue...')) {
79
+ Utils.warning(msgReposAdd);
80
+ if (await Utils.customConfirm('Select yes to continue')) {
83
81
  await archlinuxRepoAdd(distro.distroId);
84
82
  }
85
83
  }
86
84
  else if (flags.remove) {
87
- Utils.warning(`Are you sure to remove penguins-repos to your repositories?`);
88
- if (await Utils.customConfirm('Select yes to continue...')) {
85
+ Utils.warning(msgReposRemove);
86
+ if (await Utils.customConfirm('Select yes to continue')) {
89
87
  await archlinuxRepoRemove(distro.distroId);
90
88
  }
91
89
  }
@@ -95,10 +93,10 @@ export default class Repo extends Command {
95
93
  * Debian
96
94
  */
97
95
  if (flags.add) {
98
- Utils.warning(`Are you sure to add source ${path.basename(repoPath)} to your repositories?`);
99
- if (nointeractive || (await Utils.customConfirm('Select yes to continue...'))) {
96
+ Utils.warning(msgReposAdd);
97
+ if (nointeractive || (await Utils.customConfirm('Select yes to continue'))) {
100
98
  await debianRemove();
101
- if (await is822()) {
99
+ if (await debianIs822()) {
102
100
  await debianAdd822();
103
101
  }
104
102
  else {
@@ -107,8 +105,8 @@ export default class Repo extends Command {
107
105
  }
108
106
  }
109
107
  else if (flags.remove) {
110
- Utils.warning(`Are you sure to remove source ${path.basename(repoPath)} to your repositories?`);
111
- if (nointeractive || (await Utils.customConfirm('Select yes to continue...'))) {
108
+ Utils.warning(msgReposRemove);
109
+ if (nointeractive || (await Utils.customConfirm('Select yes to continue'))) {
112
110
  await debianRemove();
113
111
  }
114
112
  await exec('apt-get update');
@@ -120,18 +118,18 @@ export default class Repo extends Command {
120
118
  */
121
119
  let repoUrl = rpmRepoFedoraUrl;
122
120
  if (distro.distroId !== 'Fedora') {
123
- repoUrl = rpmRepoEl9Url; // Supponiamo che non-Fedora in questa famiglia sia EL
124
- Utils.warning(`Rilevato ${distro.distroId}. Utilizzo del repository EL9.`);
121
+ // RHEL9
122
+ repoUrl = rpmRepoEl9Url;
125
123
  }
126
124
  if (flags.add) {
127
- Utils.warning(`Sei sicuro di voler aggiungere penguins-repos ai tuoi repository?`);
125
+ Utils.warning(msgReposAdd);
128
126
  if (nointeractive || (await Utils.customConfirm('Seleziona sì per continuare...'))) {
129
127
  await rpmRepoAdd(repoUrl, rpmKeyUrl);
130
128
  }
131
129
  }
132
130
  else if (flags.remove) {
133
- Utils.warning(`Sei sicuro di voler rimuovere penguins-repos dai tuoi repository?`);
134
- if (nointeractive || (await Utils.customConfirm('Seleziona per continuare...'))) {
131
+ Utils.warning(msgReposRemove);
132
+ if (nointeractive || (await Utils.customConfirm('Select yes to continue'))) {
135
133
  await rpmRepoRemove(rpmRepoFilePath, rpmKeyOwner);
136
134
  }
137
135
  }
@@ -142,31 +140,92 @@ export default class Repo extends Command {
142
140
  * openSUSE
143
141
  */
144
142
  if (flags.add) {
145
- Utils.warning(`Sei sicuro di voler aggiungere penguins-repos ai tuoi repository?`);
146
- if (nointeractive || (await Utils.customConfirm('Seleziona per continuare...'))) {
147
- await opensuseRepoAdd(opensuseRepoUrl);
143
+ Utils.warning(msgReposAdd);
144
+ if (nointeractive || (await Utils.customConfirm('Select yes to continue'))) {
145
+ // Passiamo sia repoUrl che keyUrl
146
+ await opensuseRepoAdd(opensuseRepoUrl, opensuseKeyUrl);
148
147
  }
149
148
  }
150
149
  else if (flags.remove) {
151
- Utils.warning(`Sei sicuro di voler rimuovere penguins-repos dai tuoi repository?`);
152
- if (nointeractive || (await Utils.customConfirm('Seleziona per continuare...'))) {
153
- await opensuseRepoRemove(opensuseRepoName);
150
+ Utils.warning(msgReposRemove);
151
+ if (nointeractive || (await Utils.customConfirm('Select yes to continue'))) {
152
+ // RIUTILIZZIAMO la funzione di rimozione di Fedora!
153
+ await rpmRepoRemove(opensuseRepoFilePath, opensuseKeyOwner);
154
154
  }
155
155
  }
156
+ // Aggiungiamo un refresh finale
157
+ await exec('zypper refresh');
156
158
  }
157
159
  else {
158
160
  /**
159
161
  * All the others
160
162
  */
161
- Utils.warning(`Distro: ${distro.distroId}/${distro.codenameId}, cannot use penguins-repo nor chaotic-aur!`);
163
+ Utils.warning(`Distro: ${distro.distroId}/${distro.codenameId}, cannot use penguins-eggs.net/repos nor chaotic-aur!`);
162
164
  }
163
165
  }
164
166
  }
165
167
  }
168
+ /** ===============================================
169
+ * ALPINE
170
+ * ===============================================
171
+ */
166
172
  /**
167
- * ARCH
173
+ * alpineRepoAdd()
174
+ */
175
+ async function alpineRepoAdd() {
176
+ console.log('Adding Alpine repository...');
177
+ const echo = Utils.setEcho(true);
178
+ if (fs.existsSync(alpineKeyPath)) {
179
+ console.log('Chiave già esistente.');
180
+ }
181
+ else {
182
+ await exec(`curl -fsSL ${alpineKeyUrl} -o ${alpineKeyPath}`, echo);
183
+ }
184
+ const repoFileContent = fs.readFileSync(alpineRepoFile, 'utf8');
185
+ if (repoFileContent.includes(alpineRepoUrl)) {
186
+ console.log('La linea del repository è già presente in /etc/apk/repositories.');
187
+ }
188
+ else {
189
+ fs.appendFileSync(alpineRepoFile, `\n${alpineRepoUrl}\n`);
190
+ console.log('Repository aggiunto.');
191
+ }
192
+ console.log('Esegui "apk update" per aggiornare i repository.');
193
+ }
194
+ /**
195
+ * alpineRepoRemove()
196
+ */
197
+ async function alpineRepoRemove() {
198
+ console.log('Rimozione repository Alpine...');
199
+ const echo = Utils.setEcho(true);
200
+ // Rimuovi chiave
201
+ if (fs.existsSync(alpineKeyPath)) {
202
+ await exec(`rm -f ${alpineKeyPath}`, echo);
203
+ console.log('Chiave del repository rimossa.');
204
+ }
205
+ else {
206
+ console.log('Chiave del repository non trovata.');
207
+ }
208
+ // Rimuovi da /etc/apk/repositories
209
+ if (fs.existsSync(alpineRepoFile)) {
210
+ let content = fs.readFileSync(alpineRepoFile, 'utf8');
211
+ if (content.includes(alpineRepoUrl)) {
212
+ const newLines = content.split('\n').filter(line => line.trim() !== alpineRepoUrl);
213
+ fs.writeFileSync(alpineRepoFile, newLines.join('\n'));
214
+ console.log('Linea del repository rimossa da /etc/apk/repositories.');
215
+ }
216
+ else {
217
+ console.log('Linea del repository non trovata in /etc/apk/repositories.');
218
+ }
219
+ }
220
+ console.log('Esegui "apk update" per aggiornare i repository.');
221
+ }
222
+ /** ===============================================
223
+ * ARCH
224
+ * ===============================================
225
+ */
226
+ /**
227
+ * archlinuxRepoAdd()
168
228
  */
169
- // archlinuxRepoAdd
170
229
  async function archlinuxRepoAdd(distroId = "Arch") {
171
230
  console.log(`Adding penguins-repos for ${distroId}`);
172
231
  const repoBlockIdentifier = '# penguins-repos';
@@ -199,7 +258,10 @@ async function archlinuxRepoAdd(distroId = "Arch") {
199
258
  console.log('Repository successfully removed!');
200
259
  console.log(message);
201
260
  }
202
- // archlinuxRepoRemove
261
+ /**
262
+ * archlinuxRepoRemove()
263
+ * @param distroId
264
+ */
203
265
  async function archlinuxRepoRemove(distroId = 'Arch') {
204
266
  console.log(`Removing penguins-repos for ${distroId}`);
205
267
  const repoBlockIdentifier = '# penguins-repos';
@@ -230,7 +292,9 @@ async function archlinuxRepoRemove(distroId = 'Arch') {
230
292
  console.log('The repository was not present in /etc/pacman.conf.');
231
293
  }
232
294
  }
233
- // archlinuxAurAdd
295
+ /**
296
+ * archlinuxAurAdd()
297
+ */
234
298
  async function archlinuxAurAdd() {
235
299
  const path = '/var/cache/pacman/pkg/';
236
300
  const keyring = 'chaotic-keyring.pkg.tar.zst';
@@ -248,7 +312,9 @@ async function archlinuxAurAdd() {
248
312
  const chaoticAppend = '\n[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist\n\n';
249
313
  fs.appendFileSync('/etc/pacman.conf', chaoticAppend);
250
314
  }
251
- // archlinuxAurRemove
315
+ /**
316
+ * archlinuxAurRemove()
317
+ */
252
318
  async function archlinuxAurRemove() {
253
319
  const path = '/var/cache/pacman/pkg/';
254
320
  const keyring = 'chaotic-keyring.pkg.tar.zst';
@@ -263,22 +329,29 @@ async function archlinuxAurRemove() {
263
329
  console.log(`Include = /etc/pacman.d/chaotic-mirrorlist`);
264
330
  }
265
331
  }
332
+ /** ===============================================
333
+ * DEBIAN
334
+ * ===============================================
335
+ */
266
336
  /**
267
- * DEBIAN
337
+ * debianAdd()
268
338
  */
269
- // debianAdd
270
339
  async function debianAdd() {
271
340
  await exec(`curl -fsSL ${repoKeyUrl} | gpg --dearmor -o ${repoKeyPath}`);
272
341
  const content = `deb [signed-by=${repoKeyPath}] ${repoUrl}/deb stable main\n`;
273
342
  fs.writeFileSync(`${repoPath}.list`, content);
274
343
  }
275
- // debianRemove
344
+ /**
345
+ * debianRemove()
346
+ */
276
347
  async function debianRemove() {
277
348
  await exec(`rm -f ${repoKeyPath}`);
278
349
  await exec(`rm -f ${repoPath}*`);
279
350
  }
280
- // is822
281
- async function is822() {
351
+ /**
352
+ * debianIs822()
353
+ **/
354
+ async function debianIs822() {
282
355
  let retval = false;
283
356
  const test = `([ -f /etc/apt/sources.list.d/ubuntu.sources ] || [ -f /etc/apt/sources.list.d/debian.sources ]) && echo "1" || echo "0"`;
284
357
  const is822Result = (await exec(test, { capture: true, echo: false }));
@@ -289,7 +362,9 @@ async function is822() {
289
362
  }
290
363
  return retval;
291
364
  }
292
- // debianAdd822
365
+ /**
366
+ * debianAdd822()
367
+ */
293
368
  async function debianAdd822() {
294
369
  await exec(`curl -fsSL ${repoKeyUrl} | gpg --dearmor -o ${repoKeyPath}`);
295
370
  let content = '';
@@ -300,78 +375,64 @@ async function debianAdd822() {
300
375
  content += `Signed-By: ${repoKeyPath}\n`;
301
376
  fs.writeFileSync(`${repoPath}.sources`, content);
302
377
  }
303
- // ... [funzioni DEBIAN esistenti] ...
378
+ /** ===============================================
379
+ * Fedora/EL9
380
+ * ===============================================
381
+ */
304
382
  /**
305
- * ALPINE
383
+ * rpmRepoAdd()
384
+ * @param repoUrl
385
+ * @param keyUrl
306
386
  */
307
- async function alpineRepoAdd() {
308
- console.log('Aggiunta repository Alpine...');
309
- const echo = Utils.setEcho(true);
310
- if (fs.existsSync(alpineKeyPath)) {
311
- console.log('Chiave già esistente.');
312
- }
313
- else {
314
- await exec(`curl -fsSL ${alpineKeyUrl} -o ${alpineKeyPath}`, echo);
315
- }
316
- const repoFileContent = fs.readFileSync(alpineRepoFile, 'utf8');
317
- if (repoFileContent.includes(alpineRepoUrl)) {
318
- console.log('La linea del repository è già presente in /etc/apk/repositories.');
319
- }
320
- else {
321
- fs.appendFileSync(alpineRepoFile, `\n${alpineRepoUrl}\n`);
322
- console.log('Repository aggiunto.');
323
- }
324
- console.log('Esegui "apk update" per aggiornare i repository.');
325
- }
326
- async function alpineRepoRemove() {
327
- console.log('Rimozione repository Alpine...');
387
+ /**
388
+ * rpmRepoAdd()
389
+ * @param repoUrl
390
+ * @param keyUrl
391
+ */
392
+ async function rpmRepoAdd(repoUrl, keyUrl) {
393
+ console.log(`Adding RPM repository for ${repoUrl}...`);
328
394
  const echo = Utils.setEcho(true);
329
- // Rimuovi chiave
330
- if (fs.existsSync(alpineKeyPath)) {
331
- await exec(`rm -f ${alpineKeyPath}`, echo);
332
- console.log('Chiave del repository rimossa.');
395
+ // 1. Definisci il contenuto del file .repo
396
+ const repoContent = `
397
+ [penguins-eggs]
398
+ name=penguins-eggs.net repos
399
+ baseurl=${repoUrl}
400
+ enabled=1
401
+ gpgcheck=1
402
+ gpgkey=${keyUrl}
403
+ `;
404
+ // keyUrl (https://penguins-eggs.net/repos/KEY.asc) è già corretto per il campo gpgkey
405
+ try {
406
+ // 2. Scrivi il file .repo
407
+ fs.writeFileSync(rpmRepoFilePath, repoContent.trim());
408
+ console.log(`Repository file created at ${rpmRepoFilePath}`);
409
+ // 3. Importa la chiave GPG nel database RPM
410
+ // (dnf lo farebbe comunque, ma importarlo è più pulito)
411
+ await exec(`rpm --import ${keyUrl}`, echo);
412
+ console.log(`GPG key imported from ${keyUrl}`);
413
+ // 4. Pulisci la cache per forzare l'aggiornamento
414
+ await exec('dnf clean metadata', echo);
415
+ console.log('Repository added. Use "dnf check-update" to refresh.');
333
416
  }
334
- else {
335
- console.log('Chiave del repository non trovata.');
417
+ catch (error) {
418
+ console.error(`Failed to add RPM repository: ${error.message}`);
336
419
  }
337
- // Rimuovi da /etc/apk/repositories
338
- if (fs.existsSync(alpineRepoFile)) {
339
- let content = fs.readFileSync(alpineRepoFile, 'utf8');
340
- if (content.includes(alpineRepoUrl)) {
341
- const newLines = content.split('\n').filter(line => line.trim() !== alpineRepoUrl);
342
- fs.writeFileSync(alpineRepoFile, newLines.join('\n'));
343
- console.log('Linea del repository rimossa da /etc/apk/repositories.');
344
- }
345
- else {
346
- console.log('Linea del repository non trovata in /etc/apk/repositories.');
347
- }
348
- }
349
- console.log('Esegui "apk update" per aggiornare i repository.');
350
420
  }
351
421
  /**
352
- * RPM (Fedora/EL)
422
+ * rpmRepoRemove()
423
+ * @param repoFilePath
424
+ * @param keyOwner
353
425
  */
354
- async function rpmRepoAdd(repoUrl, keyUrl) {
355
- console.log(`Aggiunta repository RPM da ${repoUrl}...`);
356
- const echo = Utils.setEcho(true);
357
- // Assicura che dnf-plugins-core sia installato
358
- await exec('dnf install dnf-plugins-core -y', echo);
359
- // Aggiungi repo
360
- await exec(`dnf config-manager --add-repo ${repoUrl}`, echo);
361
- // Importa chiave
362
- await exec(`rpm --import ${keyUrl}`, echo);
363
- console.log('Repository aggiunto. Esegui "dnf check-update" per aggiornare.');
364
- }
365
426
  async function rpmRepoRemove(repoFilePath, keyOwner) {
366
- console.log('Rimozione repository RPM...');
427
+ console.log('Removing RPM repo...');
367
428
  const echo = Utils.setEcho(true);
368
429
  // Rimuovi file .repo
369
430
  if (fs.existsSync(repoFilePath)) {
370
431
  await exec(`rm -f ${repoFilePath}`, echo);
371
- console.log(`Rimosso ${repoFilePath}.`);
432
+ console.log(`Removed ${repoFilePath}.`);
372
433
  }
373
434
  else {
374
- console.log(`File repository ${repoFilePath} non trovato.`);
435
+ console.log(`File repository ${repoFilePath} not found.`);
375
436
  }
376
437
  // Rimuovi chiave GPG
377
438
  const findKeyCmd = `rpm -q gpg-pubkey --qf '%{name}-%{version}-%{release} %{summary}\n' | grep '${keyOwner}' | cut -d' ' -f1`;
@@ -386,28 +447,45 @@ async function rpmRepoRemove(repoFilePath, keyOwner) {
386
447
  }
387
448
  }
388
449
  else {
389
- console.log('Nessuna chiave GPG corrispondente da rimuovere.');
450
+ console.log('No GPG key to remove.');
390
451
  }
391
- console.log('Repository rimosso. Esegui "dnf check-update" per aggiornare.');
452
+ console.log('Repository removed. Use "dnf check-update" to refresh.');
392
453
  }
454
+ /** ===============================================
455
+ * Opensuse
456
+ * ===============================================
457
+ */
393
458
  /**
394
- * openSUSE
459
+ * opensuseRepoAdd()
460
+ * @param repoUrl
461
+ * @param keyUrl
395
462
  */
396
- async function opensuseRepoAdd(repoUrl) {
397
- console.log(`Aggiunta repository openSUSE da ${repoUrl}...`);
463
+ async function opensuseRepoAdd(repoUrl, keyUrl) {
464
+ console.log(`Adding repository openSUSE ${repoUrl}`);
398
465
  const echo = Utils.setEcho(true);
399
- // zypper ar <url>
400
- await exec(`zypper addrepo ${repoUrl}`, echo);
401
- // Refresh e importa chiave
402
- await exec(`zypper --gpg-auto-import-keys refresh`, echo);
403
- console.log('Repository aggiunto.');
404
- }
405
- async function opensuseRepoRemove(repoName) {
406
- console.log(`Rimozione repository openSUSE: ${repoName}...`);
407
- const echo = Utils.setEcho(true);
408
- // zypper rr <name>
409
- await exec(`zypper removerepo ${repoName}`, echo);
410
- // Refresh
411
- await exec(`zypper refresh`, echo);
412
- console.log('Repository rimosso.');
466
+ // 1. Definisci il contenuto del file .repo
467
+ const repoContent = `
468
+ [penguins-eggs]
469
+ name=penguins-eggs.net repos
470
+ baseurl=${repoUrl}
471
+ enabled=1
472
+ gpgcheck=1
473
+ repo_gpgcheck=0
474
+ gpgkey=${keyUrl}
475
+ autorefresh=1
476
+ `;
477
+ // gpgcheck=1 -> Controlla i pacchetti RPM (corretto)
478
+ // repo_gpgcheck=0 -> NON controllare i metadati/repomd.xml (risolve il prompt)
479
+ try {
480
+ // 2. Scrivi il file .repo nella directory di zypper
481
+ fs.writeFileSync(opensuseRepoFilePath, repoContent.trim());
482
+ console.log(`Repository file created at ${opensuseRepoFilePath}`);
483
+ // 3. Importa la chiave GPG nel database RPM (stesso comando di Fedora)
484
+ await exec(`rpm --import ${keyUrl}`, echo);
485
+ console.log(`GPG key imported from ${keyUrl}`);
486
+ console.log('Repository added. Use "zypper refresh" to update.');
487
+ }
488
+ catch (error) {
489
+ console.error(`Failed to add openSUSE repository: ${error.message}`);
490
+ }
413
491
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * ./src/commands/syncfrom.ts
2
+ * ./src/commands/update.ts
3
3
  * penguins-eggs v.25.7.x / ecmascript 2020
4
4
  * author: Piero Proietti
5
5
  * email: piero.proietti@gmail.com
@@ -1,5 +1,5 @@
1
1
  /**
2
- * ./src/commands/syncfrom.ts
2
+ * ./src/commands/update.ts
3
3
  * penguins-eggs v.25.7.x / ecmascript 2020
4
4
  * author: Piero Proietti
5
5
  * email: piero.proietti@gmail.com
@@ -127,68 +127,77 @@ export default class Update extends Command {
127
127
  let filter = '';
128
128
  let copy = '';
129
129
  let install = '';
130
- /**
131
- * Alpine
132
- */
133
- if (this.distro.familyId === 'alpine') {
134
- let repo = `alpine/x86_64`;
135
- filter = `penguins-eggs-*-*.*.?-r?.apk`;
136
- copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
137
- install = `apk add /tmp/${filter}`;
130
+ let repo = '';
131
+ if (Utils.isAppImage()) {
132
+ console.log("AppImage: penguins-eggs-*-x86_64.AppImage will be installed as /usr/local/bin/eggs");
133
+ filter = `penguins-eggs-*-x86_64.AppImage`;
134
+ copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${filter} /tmp`;
135
+ install = `mkdir -p /usr/local/bin |mv /tmp/${filter} /usr/local/bin/eggs`;
136
+ }
137
+ else {
138
138
  /**
139
- * Arch
139
+ * Alpine
140
140
  */
141
- }
142
- else if (this.distro.familyId === 'archlinux') {
143
- let repo = "aur";
144
- filter = `penguins-eggs-??.*.*-?-any.pkg.tar.zst`;
145
- if (Diversions.isManjaroBased(this.distro.distroId)) {
146
- repo = 'manjaro';
147
- filter = `penguins-eggs-??.*.*-?-any.pkg.tar.*`;
141
+ if (this.distro.familyId === 'alpine') {
142
+ repo = `alpine/x86_64`;
143
+ filter = `penguins-eggs-*-*.*.?-r?.apk`;
144
+ copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
145
+ install = `apk add /tmp/${filter}`;
146
+ /**
147
+ * Arch
148
+ */
148
149
  }
149
- copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
150
- install = `pacman -U /tmp/${filter}`;
151
- /**
152
- * Devuan/Debian/Ubuntu
153
- */
154
- }
155
- else if (this.distro.familyId === "debian") {
156
- let repo = 'debs';
157
- filter = `penguins-eggs_??.*.*-?_${Utils.uefiArch()}.deb`;
158
- copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
159
- install = `apt reinstall /tmp/${filter}`;
160
- /**
161
- * fedora/el9
162
- */
163
- }
164
- else if (this.distro.familyId === "fedora") {
165
- let repo = 'fedora';
166
- let ftype = 'fc??';
167
- if (this.distro.distroId !== 'Fedora') {
168
- repo = 'el9';
169
- ftype = 'el?';
150
+ else if (this.distro.familyId === 'archlinux') {
151
+ repo = "aur";
152
+ filter = `penguins-eggs-??.*.*-?-any.pkg.tar.zst`;
153
+ if (Diversions.isManjaroBased(this.distro.distroId)) {
154
+ repo = 'manjaro';
155
+ filter = `penguins-eggs-??.*.*-?-any.pkg.tar.*`;
156
+ }
157
+ copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
158
+ install = `pacman -U /tmp/${filter}`;
159
+ /**
160
+ * Devuan/Debian/Ubuntu
161
+ */
162
+ }
163
+ else if (this.distro.familyId === "debian") {
164
+ repo = 'debs';
165
+ filter = `penguins-eggs_??.*.*-?_${Utils.uefiArch()}.deb`;
166
+ copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
167
+ install = `apt reinstall /tmp/${filter}`;
168
+ /**
169
+ * fedora/el9
170
+ */
171
+ }
172
+ else if (this.distro.familyId === "fedora") {
173
+ repo = 'fedora';
174
+ let ftype = 'fc??';
175
+ if (this.distro.distroId !== 'Fedora') {
176
+ repo = 'el9';
177
+ ftype = 'el?';
178
+ }
179
+ filter = `penguins-eggs-??.*.*-?.${ftype}.x86_64.rpm`;
180
+ copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
181
+ install = `dnf reinstall /tmp/${filter} || dnf install /tmp/${filter}`;
182
+ /**
183
+ * openmamba
184
+ */
185
+ }
186
+ else if (this.distro.familyId === "openmamba") {
187
+ repo = 'openmamba';
188
+ filter = `penguins-eggs-??.*.*-?mamba.x86_64.rpm`;
189
+ copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
190
+ install = `dnf reinstall /tmp/${filter} || dnf install /tmp/${filter}`;
191
+ /**
192
+ * opensuse
193
+ */
194
+ }
195
+ else if (this.distro.familyId === "opensuse") {
196
+ repo = 'opensuse';
197
+ filter = `penguins-eggs-*.*.*-?.opensuse.x86_64.rpm`;
198
+ copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
199
+ install = `zypper install --force /tmp/${filter} || zypper install /tmp/${filter}`;
170
200
  }
171
- filter = `penguins-eggs-??.*.*-?.${ftype}.x86_64.rpm`;
172
- copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
173
- install = `dnf reinstall /tmp/${filter} || dnf install /tmp/${filter}`;
174
- /**
175
- * openmamba
176
- */
177
- }
178
- else if (this.distro.familyId === "openmamba") {
179
- let repo = 'openmamba';
180
- filter = `penguins-eggs-??.*.*-?mamba.x86_64.rpm`;
181
- copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
182
- install = `dnf reinstall /tmp/${filter} || dnf install /tmp/${filter}`;
183
- /**
184
- * opensuse
185
- */
186
- }
187
- else if (this.distro.familyId === "opensuse") {
188
- let repo = 'opensuse';
189
- filter = `penguins-eggs-*.*.*-?.opensuse.x86_64.rpm`;
190
- copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
191
- install = `zypper install --force /tmp/${filter} || zypper install /tmp/${filter}`;
192
201
  }
193
202
  /**
194
203
  * copy and install