penguins-eggs 25.9.7 → 25.9.14

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.
@@ -5,8 +5,6 @@
5
5
  * email: piero.proietti@gmail.com
6
6
  * license: MIT
7
7
  */
8
- // packages
9
- import fs from 'node:fs';
10
8
  import path from 'path';
11
9
  // interfaces
12
10
  // libraries
@@ -22,53 +20,40 @@ export async function liveCreateStructure() {
22
20
  if (this.verbose) {
23
21
  console.log('Ovary: liveCreateStructure');
24
22
  }
25
- Utils.warning(`creating egg in ${this.settings.config.snapshot_dir}`);
26
- let cmd;
27
- if (!fs.existsSync(this.settings.config.snapshot_dir)) {
28
- cmd = `mkdir -p ${this.settings.config.snapshot_dir}`;
29
- tryCatch(cmd, this.verbose);
30
- }
31
- if (!fs.existsSync(this.settings.config.snapshot_dir + '/README.md')) {
32
- cmd = `cp ${path.resolve(__dirname, '../../../conf/README.md')} ${this.settings.config.snapshot_dir}README.md`;
33
- tryCatch(cmd, this.verbose);
34
- }
35
- // Ovarium
36
- if (!fs.existsSync(this.settings.work_dir.ovarium)) {
37
- cmd = `mkdir -p ${this.settings.work_dir.ovarium}`;
38
- tryCatch(cmd, this.verbose);
39
- }
40
- if (!fs.existsSync(this.settings.work_dir.lowerdir)) {
41
- cmd = `mkdir -p ${this.settings.work_dir.lowerdir}`;
42
- tryCatch(cmd, this.verbose);
43
- }
44
- if (!fs.existsSync(this.settings.work_dir.upperdir)) {
45
- cmd = `mkdir -p ${this.settings.work_dir.upperdir}`;
46
- tryCatch(cmd, this.verbose);
47
- }
48
- if (!fs.existsSync(this.settings.work_dir.workdir)) {
49
- cmd = `mkdir -p ${this.settings.work_dir.workdir}`;
50
- tryCatch(cmd, this.verbose);
51
- }
52
- if (!fs.existsSync(this.settings.work_dir.merged)) {
53
- cmd = `mkdir -p ${this.settings.work_dir.merged}`;
54
- tryCatch(cmd, this.verbose);
55
- }
56
- /**
57
- * Creo le directory di destinazione per boot, efi, isolinux e live
58
- */
59
- if (!fs.existsSync(this.settings.iso_work)) {
60
- cmd = `mkdir -p ${this.settings.iso_work}boot/grub/${Utils.uefiFormat()}`;
61
- tryCatch(cmd, this.verbose);
62
- cmd = `mkdir -p ${this.settings.iso_work}isolinux`;
63
- tryCatch(cmd, this.verbose);
64
- cmd = `mkdir -p ${this.settings.iso_work}live`;
65
- tryCatch(cmd, this.verbose);
66
- }
67
- // ln iso
68
- cmd = `ln -s ${this.settings.iso_work} ${this.settings.config.snapshot_dir}/iso`;
69
- tryCatch(cmd, this.verbose);
70
- // ln livefs
71
- cmd = `ln -s ${this.settings.work_dir.merged} ${this.settings.config.snapshot_dir}/livefs`;
23
+ Utils.warning(`creating egg in ${this.nest}`);
24
+ let cmd = '';
25
+ cmd = `# create nest\n`;
26
+ cmd += `mkdir -p ${this.nest}\n`;
27
+ cmd += `# README.md\n`;
28
+ cmd += `cp ${path.resolve(__dirname, '../../../conf/README.md')} ${this.nest}README.md\n`;
29
+ cmd += `# cleaning dotMnt\n`;
30
+ cmd += `rm -rf ${this.dotMnt}efi\n`;
31
+ cmd += `rm -rf ${this.dotMnt}filesystem.squashfs\n`;
32
+ cmd += `rm -rf ${this.dotMnt}/iso\n`;
33
+ cmd += `mkdir -p ${this.dotMnt}/iso/live\n`;
34
+ cmd += `mkdir -p ${this.dotMnt}/iso/boot/grub/${Utils.uefiFormat()}\n`;
35
+ cmd += `mkdir -p ${this.dotMnt}/iso/isolinux\n`;
36
+ cmd += `# cleaning (nest).overlay\n`;
37
+ cmd += `umount ${this.dotLivefs}/* > /dev/null 2>&1\n`;
38
+ cmd += `umount ${this.dotOverlay.lowerdir}/* > /dev/null 2>&1\n`;
39
+ cmd += `umount ${this.dotOverlay.upperdir}/* > /dev/null 2>&1\n`;
40
+ cmd += `umount ${this.dotOverlay.workdir}/* > /dev/null 2>&1\n`;
41
+ cmd += `rm -rf ${this.nest}.overlay\n`;
42
+ cmd += `mkdir -p ${this.dotOverlay.lowerdir}\n`;
43
+ cmd += `mkdir -p ${this.dotOverlay.upperdir}\n`;
44
+ cmd += `mkdir -p ${this.dotOverlay.workdir}\n`;
45
+ cmd += `sleep 1\n`;
46
+ cmd += `# cleaning dotLivefs\n`;
47
+ cmd += `rm -rf ${this.dotLivefs}\n`;
48
+ cmd += `mkdir -p ${this.dotLivefs}\n`;
49
+ cmd += `# cleaning (nest)/ovarium\n`;
50
+ cmd += `rm -rf ${this.nest}ovarium\n`;
51
+ cmd += `mkdir -p ${this.nest}ovarium\n`;
52
+ cmd += `# cleaning (nest)/links\n`;
53
+ cmd += `rm -f ${this.nest}iso\n`;
54
+ cmd += `ln -s ${this.nest}.mnt/iso ${this.nest}/iso\n`;
55
+ cmd += `rm -f ${this.nest}livefs\n`;
56
+ cmd += `ln -s ${this.dotLivefs} ${this.nest}livefs\n`;
72
57
  tryCatch(cmd, this.verbose);
73
58
  }
74
59
  /**
@@ -78,9 +63,7 @@ export async function liveCreateStructure() {
78
63
  async function tryCatch(cmd = '', verbose = false) {
79
64
  try {
80
65
  let echo = Utils.setEcho(verbose);
81
- if (verbose) {
82
- console.log(cmd);
83
- }
66
+ // console.log(cmd)
84
67
  await exec(cmd, echo);
85
68
  }
86
69
  catch (error) {
@@ -47,6 +47,10 @@ export async function produce(kernel = '', clone = false, cryptedclone = false,
47
47
  this.cryptedclone = cryptedclone;
48
48
  const luksName = 'luks-volume';
49
49
  const luksFile = `/tmp/${luksName}`;
50
+ this.nest = this.settings.config.snapshot_dir;
51
+ this.dotMnt = `${this.nest}.mnt`;
52
+ this.dotOverlay = this.settings.work_dir;
53
+ this.dotLivefs = this.settings.work_dir.merged;
50
54
  /**
51
55
  * define kernel
52
56
  */
@@ -5,6 +5,7 @@
5
5
  * email: piero.proietti@gmail.com
6
6
  * license: MIT
7
7
  */
8
+ import { IWorkDir } from '../interfaces/index.js';
8
9
  import CliAutologin from './cli-autologin.js';
9
10
  import Incubator from './incubation/incubator.js';
10
11
  import Settings from './settings.js';
@@ -41,7 +42,6 @@ export default class Ovary {
41
42
  distroLike: string;
42
43
  genisoimage: boolean;
43
44
  incubator: Incubator;
44
- nest: string;
45
45
  settings: Settings;
46
46
  snapshot_basename: string;
47
47
  snapshot_prefix: string;
@@ -53,6 +53,10 @@ export default class Ovary {
53
53
  kernel: string;
54
54
  initrd: string;
55
55
  vmlinuz: string;
56
+ nest: string;
57
+ dotMnt: string;
58
+ dotOverlay: IWorkDir;
59
+ dotLivefs: string;
56
60
  fertilization: typeof fertilization;
57
61
  produce: typeof produce;
58
62
  bindLiveFs: typeof bindLiveFs;
@@ -43,7 +43,6 @@ export default class Ovary {
43
43
  distroLike = '';
44
44
  genisoimage = false;
45
45
  incubator = {};
46
- nest = '';
47
46
  settings = {};
48
47
  snapshot_basename = '';
49
48
  snapshot_prefix = '';
@@ -55,6 +54,10 @@ export default class Ovary {
55
54
  kernel = '';
56
55
  initrd = '';
57
56
  vmlinuz = '';
57
+ nest = '';
58
+ dotMnt = '';
59
+ dotOverlay = {};
60
+ dotLivefs = '';
58
61
  // I put all methods on ovary.d
59
62
  fertilization = fertilization;
60
63
  produce = produce;
@@ -22,13 +22,6 @@ export default class Kernel {
22
22
  * @returns Path al file initramfs.
23
23
  */
24
24
  static initramfs(kernel?: string): string;
25
- /**
26
- * Ricava path per initramfs/initrd
27
- *
28
- * @param kernel - Versione del kernel
29
- * @returns Path al file initramfs
30
- */
31
- static initramfsOld(kernel?: string): string;
32
25
  /**
33
26
  * ALL PRIVATE
34
27
  */
@@ -36,10 +29,10 @@ export default class Kernel {
36
29
  * most of the distros:
37
30
  * debian, fedora, opensuse, rasberry
38
31
  */
39
- private static vmlinuxFromUname;
32
+ private static vmlinuzFromUname;
40
33
  /**
41
34
  * vmlinuxFromCmdline
42
35
  * raspbery /proc/cmdline dont contain it
43
36
  */
44
- private static vmlinuxFromCmdline;
37
+ private static vmlinuzFromCmdline;
45
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);
@@ -126,59 +125,6 @@ export default class Kernel {
126
125
  Utils.warning(`Could not find an initramfs file for kernel ${targetKernel} in ${bootDir}.`);
127
126
  process.exit(1);
128
127
  }
129
- /**
130
- * Ricava path per initramfs/initrd
131
- *
132
- * @param kernel - Versione del kernel
133
- * @returns Path al file initramfs
134
- */
135
- static initramfsOld(kernel = '') {
136
- const distro = new Distro();
137
- let initramfs = '';
138
- if (kernel === '') {
139
- if (!Utils.isContainer()) {
140
- kernel = execSync('uname -r').toString().trim();
141
- }
142
- else {
143
- Utils.warning("cannot work on containers actually!");
144
- process.exit(1);
145
- }
146
- }
147
- // rolling...
148
- if (distro.familyId === "alpine") {
149
- let suffix = kernel.substring(kernel.lastIndexOf('-'));
150
- initramfs = `/boot/initramfs${suffix}`;
151
- }
152
- else if (distro.familyId === "archlinux" && (!Diversions.isManjaroBased(distro.distroId))) {
153
- let suffix = kernel.substring(kernel.lastIndexOf('-'));
154
- initramfs = `/boot/initramfs-linux${suffix}.img`;
155
- }
156
- else if (distro.familyId === "archlinux" && (Diversions.isManjaroBased(distro.distroId))) {
157
- let version = kernel.split('.').slice(0, 2).join('.');
158
- initramfs = `/boot/initramfs-${version}-x86_64.img`;
159
- }
160
- else {
161
- // Gestione generica per le altre distro (Debian, Fedora, SUSE, OpenMamba, cc.)
162
- const candidates = [
163
- `/boot/initrd.img-${kernel}`, // Debian, Ubuntu
164
- `/boot/initramfs-${kernel}.img`, // Fedora, RHEL
165
- `/boot/initramfs-${kernel}-1mamba-x86_64.img`, // Openmamba
166
- `/boot/initrd-${kernel}`, // openSUSE
167
- `/boot/initramfs-${kernel}`, // fallbacks
168
- ];
169
- for (const candidate of candidates) {
170
- if (fs.existsSync(candidate)) {
171
- initramfs = candidate;
172
- break;
173
- }
174
- }
175
- }
176
- if (!fs.existsSync(initramfs)) {
177
- console.error(`ERROR: initramfs file ${initramfs} does not exist!`);
178
- process.exit(1);
179
- }
180
- return initramfs;
181
- }
182
128
  /**
183
129
  * ALL PRIVATE
184
130
  */
@@ -186,7 +132,7 @@ export default class Kernel {
186
132
  * most of the distros:
187
133
  * debian, fedora, opensuse, rasberry
188
134
  */
189
- static vmlinuxFromUname() {
135
+ static vmlinuzFromUname() {
190
136
  const kernelVersion = execSync('uname -r').toString().trim();
191
137
  let kernelPath = `/boot/vmlinuz-${kernelVersion}`;
192
138
  if (fs.existsSync(kernelPath)) {
@@ -200,7 +146,7 @@ export default class Kernel {
200
146
  * vmlinuxFromCmdline
201
147
  * raspbery /proc/cmdline dont contain it
202
148
  */
203
- static vmlinuxFromCmdline() {
149
+ static vmlinuzFromCmdline() {
204
150
  let distro = new Distro();
205
151
  let vmlinuz = '';
206
152
  // Find vmlinuz in /proc/cmdline
@@ -93,7 +93,7 @@ export default class ExportPkg extends Command {
93
93
  }
94
94
  else if (familyId === "debian") {
95
95
  Utils.warning(`exporting Devuan/Debian/Ubuntu DEB packages`);
96
- localPath = `/home/${this.user}/penguins-eggs/dist`;
96
+ localPath = `/home/${this.user}/penguins-eggs/releases`;
97
97
  remotePath = this.Tu.config.remotePathPackages + "/debs";
98
98
  let arch = Utils.uefiArch();
99
99
  if (this.all) {
@@ -106,13 +106,14 @@ export default class ExportPkg extends Command {
106
106
  }
107
107
  else if (familyId === 'fedora') {
108
108
  let repo = 'fedora';
109
+ let ftype = 'fc??';
109
110
  let warning = `exporting Fedora RPM packages`;
110
- filter = `penguins-eggs-[0-9][0-9].[0-9]*.[0-9]*-*.fc??.x86_64.rpm`;
111
111
  if (distro.distroId !== 'Fedora') {
112
112
  repo = 'el9';
113
+ ftype = `el?`;
113
114
  warning = `exporting Almalinux/Rocky RPM packages`;
114
- filter = `penguins-eggs-[0-9][0-9].[0-9]*.[0-9]*-*.fc??.x86_64.rpm`;
115
115
  }
116
+ filter = `penguins-eggs-[0-9][0-9].[0-9]*.[0-9]*-*.${ftype}.x86_64.rpm`;
116
117
  Utils.warning(warning);
117
118
  localPath = `/home/${this.user}/rpmbuild/RPMS/x86_64`;
118
119
  remotePath = this.Tu.config.remotePathPackages + `/` + repo;
@@ -7,8 +7,7 @@
7
7
  */
8
8
  /**
9
9
  * Debian 13 trixe, Ubuntu 24.04 noble usano il formato deb822
10
- *
11
- * esiste un comando per modernizzare le sorgenti:
10
+ * * esiste un comando per modernizzare le sorgenti:
12
11
  * sudo apt modernize-sources
13
12
  */
14
13
  import { Command } from '@oclif/core';
@@ -7,8 +7,7 @@
7
7
  */
8
8
  /**
9
9
  * Debian 13 trixe, Ubuntu 24.04 noble usano il formato deb822
10
- *
11
- * esiste un comando per modernizzare le sorgenti:
10
+ * * esiste un comando per modernizzare le sorgenti:
12
11
  * sudo apt modernize-sources
13
12
  */
14
13
  import { Command, Flags } from '@oclif/core';
@@ -18,11 +17,9 @@ import Distro from '../../classes/distro.js';
18
17
  import Utils from '../../classes/utils.js';
19
18
  import { exec } from '../../lib/utils.js';
20
19
  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';
20
+ const ppaKeyUrl = 'https://pieroproietti.github.io/penguins-eggs/deb/key.asc';
21
+ const ppaKeyPath = '/usr/share/keyrings/penguins-eggs.gpg';
22
+ const ppaSourcesPath = '/etc/apt/sources.list.d/penguins-eggs'; // Base path without extension
26
23
  /**
27
24
  *
28
25
  */
@@ -42,24 +39,34 @@ export default class Ppa extends Command {
42
39
  async run() {
43
40
  const { flags } = await this.parse(Ppa);
44
41
  Utils.titles(this.id + ' ' + this.argv);
45
- let verbose = false;
46
- if (flags.verbose) {
47
- verbose = true;
48
- }
49
42
  const { nointeractive } = flags;
50
43
  if (Utils.isRoot()) {
51
44
  const distro = new Distro();
52
- /**
53
- * Debian
54
- */
55
- if (distro.familyId === 'debian') {
45
+ if (distro.familyId === 'archlinux' && !Diversions.isManjaroBased(distro.distroId)) {
46
+ if (flags.add) {
47
+ Utils.warning(`Are you sure to add Chaotic-AUR to your repositories?`);
48
+ if (await Utils.customConfirm('Select yes to continue...')) {
49
+ await archAdd();
50
+ }
51
+ }
52
+ else if (flags.remove) {
53
+ Utils.warning(`Are you sure to remove Chaotic-AUR to your repositories?`);
54
+ if (await Utils.customConfirm('Select yes to continue...')) {
55
+ await archRemove();
56
+ }
57
+ }
58
+ }
59
+ else if (distro.familyId === 'debian') {
60
+ /**
61
+ * Debian
62
+ */
56
63
  if (flags.add) {
57
- Utils.warning(`Are you sure to add source ${path.basename(ppaName)} to your repositories?`);
64
+ Utils.warning(`Are you sure to add source ${path.basename(ppaSourcesPath)} to your repositories?`);
58
65
  if (nointeractive || (await Utils.customConfirm('Select yes to continue...'))) {
59
- // remove old penguins-eggs-ppa.list
60
- debianRemove();
66
+ // Rimuove sempre le vecchie configurazioni per uno stato pulito
67
+ await debianRemove();
61
68
  if (await is822()) {
62
- debianAdd822();
69
+ await debianAdd822();
63
70
  }
64
71
  else {
65
72
  await debianAdd();
@@ -67,35 +74,18 @@ export default class Ppa extends Command {
67
74
  }
68
75
  }
69
76
  else if (flags.remove) {
70
- Utils.warning(`Are you sure to remove source ${path.basename(ppaName)} to your repositories?`);
77
+ Utils.warning(`Are you sure to remove source ${path.basename(ppaSourcesPath)} to your repositories?`);
71
78
  if (nointeractive || (await Utils.customConfirm('Select yes to continue...'))) {
72
79
  await debianRemove();
73
80
  }
74
81
  }
75
82
  await exec('apt-get update');
76
- /**
77
- * Arch and only Arch! no Manjaro...
78
- */
79
- }
80
- else if (distro.familyId === 'archlinux' && !Diversions.isManjaroBased(distro.distroId)) {
81
- if (flags.add) {
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();
85
- }
86
- }
87
- else if (flags.remove) {
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
- }
92
- }
93
83
  /**
94
84
  * Alle the others
95
85
  */
96
86
  }
97
87
  else {
98
- Utils.warning(`Distro: ${distro.distroId}/${distro.codenameId}, cannot use penguins-eggs-ppa nor chaotic-aur!`);
88
+ Utils.warning(`Distro: ${distro.distroId}/${distro.codenameId}, cannot use penguins-eggs-repo nor chaotic-aur!`);
99
89
  }
100
90
  }
101
91
  }
@@ -127,7 +117,6 @@ async function archRemove() {
127
117
  const path = '/var/cache/pacman/pkg/';
128
118
  const keyring = 'chaotic-keyring.pkg.tar.zst';
129
119
  const mirrorlist = 'chaotic-mirrorlist.pkg.tar.zst';
130
- const echo = Utils.setEcho(true);
131
120
  if (fs.existsSync(path + keyring) && fs.existsSync(path + mirrorlist)) {
132
121
  console.log('to remove chaotic-aur:\n');
133
122
  console.log(`sudo rm ${path}${keyring}`);
@@ -139,47 +128,49 @@ async function archRemove() {
139
128
  }
140
129
  }
141
130
  /**
142
- * debianAdd822
131
+ * debianAdd822 - For modern Debian/Ubuntu with .sources files
143
132
  */
144
133
  async function debianAdd822() {
145
- await exec(`curl -sS https://pieroproietti.github.io/penguins-eggs-ppa/KEY.gpg| gpg --dearmor | sudo tee ${ppaKey} > /dev/null`);
134
+ // --- FIX: Correct GPG key URL ---
135
+ await exec(`curl -fsSL ${ppaKeyUrl} | gpg --dearmor -o ${ppaKeyPath}`);
146
136
  let content = '';
147
137
  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}`);
138
+ content += 'URIs: https://pieroproietti.github.io/penguins-eggs/deb\n'; // Correct URI for packages
139
+ content += 'Suites: stable\n'; // It's better to be specific
140
+ content += 'Components: main\n';
141
+ content += `Signed-By: ${ppaKeyPath}\n`;
142
+ // --- IMPROVEMENT: Use the standard .sources extension ---
143
+ fs.writeFileSync(`${ppaSourcesPath}.sources`, content);
144
+ // --- IMPROVEMENT: Removed unnecessary `touch` command ---
154
145
  }
155
146
  /**
156
- * debianAdd
147
+ * debianAdd - For traditional Debian/Ubuntu with .list files
157
148
  */
158
149
  async function debianAdd() {
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);
150
+ // --- FIX: Correct GPG key URL and remove redundant sudo ---
151
+ await exec(`curl -fsSL ${ppaKeyUrl} | gpg --dearmor -o ${ppaKeyPath}`);
152
+ const content = `deb [signed-by=${ppaKeyPath}] https://pieroproietti.github.io/penguins-eggs/deb stable main\n`;
153
+ fs.writeFileSync(`${ppaSourcesPath}.list`, content);
162
154
  }
163
155
  /**
164
- * is822 (usa lo standard deb822 per le sorgenti)
156
+ * is822 (checks if the system uses the deb822 format)
165
157
  */
166
158
  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
159
  let retval = false;
169
160
  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') {
161
+ const is822Result = (await exec(test, { capture: true, echo: false }));
162
+ if (is822Result.code === 0) {
163
+ if (is822Result.data.trim() === '1') {
173
164
  retval = true;
174
165
  }
175
166
  }
176
167
  return retval;
177
168
  }
178
169
  /**
179
- * debianRemove
170
+ * debianRemove - Cleans up all related PPA files
180
171
  */
181
172
  async function debianRemove() {
182
- await exec(`rm -f ${ppaKey}`);
183
- await exec(`rm -f ${ppaList}`);
184
- await exec(`rm -f ${ppaSources}`);
173
+ // The script runs as root, so sudo inside exec is not needed here
174
+ await exec(`rm -f ${ppaKeyPath}`);
175
+ await exec(`rm -f ${ppaSourcesPath}*`);
185
176
  }
@@ -73,7 +73,7 @@ export default class Update extends Command {
73
73
  */
74
74
  async choosePkg() {
75
75
  const choices = ['Abort'];
76
- choices.push('LAN', 'Source', 'Package_Manager');
76
+ choices.push('LAN', 'Package_Manager', 'Source');
77
77
  const questions = [
78
78
  {
79
79
  choices,
@@ -100,19 +100,19 @@ export default class Update extends Command {
100
100
  cmd = 'sudo pacman -S penguins-eggs';
101
101
  }
102
102
  else if (this.distro.familyId === "debian") {
103
- cmd = 'sudo apt install penguins-eggs';
103
+ cmd = 'sudo apt install penguins-eggs\nsudo apt reinstall penguins-eggs';
104
104
  }
105
105
  else if (this.distro.familyId === "fedora") {
106
- cmd = 'sudo dnf install penguins-eggs\nsudo dnf install penguins-eggs';
106
+ cmd = 'sudo dnf install penguins-eggs\nsudo dnf reinstall penguins-eggs';
107
107
  }
108
108
  else if (this.distro.familyId === "openmamba") {
109
- cmd = 'sudo dnf install penguins-eggs\nsudo dnf install penguins-eggs';
109
+ cmd = 'sudo dnf install penguins-eggs\nsudo dnf reinstall penguins-eggs';
110
110
  }
111
111
  else if (this.distro.familyId === "opensuse") {
112
- cmd = 'sudo zypper install penguins-eggs';
112
+ cmd = 'sudo zypper install penguins-eggs\\zypper install --force penguins-eggs';
113
113
  }
114
114
  Utils.titles(`update`);
115
- Utils.warning(`To update/install penguins-eggs cut and copy follow commands`);
115
+ Utils.warning(`To install/update penguins-eggs cut and copy one of the follow commands`);
116
116
  console.log();
117
117
  console.log(cmd);
118
118
  console.log();
@@ -156,7 +156,7 @@ export default class Update extends Command {
156
156
  let repo = 'debs';
157
157
  filter = `penguins-eggs_??.*.*-?_${Utils.uefiArch()}.deb`;
158
158
  copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
159
- install = `dpkg -i /tmp/${filter}`;
159
+ install = `apt reinstall /tmp/${filter}`;
160
160
  /**
161
161
  * fedora/el9
162
162
  */
@@ -188,7 +188,7 @@ export default class Update extends Command {
188
188
  let repo = 'opensuse';
189
189
  filter = `penguins-eggs-*.*.*-?.opensuse.x86_64.rpm`;
190
190
  copy = `scp ${Tu.config.remoteUser}@${Tu.config.remoteHost}:${Tu.config.remotePathPackages}/${repo}/${filter} /tmp`;
191
- install = `zypper install /tmp/${filter}`;
191
+ install = `zypper install --force /tmp/${filter} || zypper install /tmp/${filter}`;
192
192
  }
193
193
  /**
194
194
  * copy and install
package/package.json CHANGED
@@ -2,41 +2,41 @@
2
2
  "name": "penguins-eggs",
3
3
  "shortName": "eggs",
4
4
  "description": "A remaster system tool, compatible with Arch, Debian, Devuan, Ubuntu and others",
5
- "version": "25.9.7",
5
+ "version": "25.9.14",
6
6
  "author": "Piero Proietti",
7
7
  "bin": {
8
8
  "eggs": "./bin/run.js"
9
9
  },
10
10
  "bugs": "https://github.com/pieroproietti/penguins-eggs/issues",
11
11
  "dependencies": {
12
- "@oclif/core": "^4.5.2",
12
+ "@oclif/core": "^4.5.3",
13
13
  "@oclif/plugin-autocomplete": "^3.2.34",
14
- "@oclif/plugin-help": "^6.2.32",
15
- "@oclif/plugin-version": "^2.2.32",
14
+ "@oclif/plugin-help": "^6.2.33",
15
+ "@oclif/plugin-version": "^2.2.33",
16
16
  "@types/express": "^5.0.3",
17
17
  "ansis": "^4.1.0",
18
- "axios": "^1.11.0",
19
- "chalk": "^5.6.0",
18
+ "axios": "^1.12.2",
19
+ "chalk": "^5.6.2",
20
20
  "cli-cursor": "^5.0.0",
21
- "debug": "^4.4.1",
21
+ "debug": "^4.4.3",
22
22
  "express": "^5.1.0",
23
23
  "ink": "^5",
24
24
  "ink-progress-bar": "^3.0.0",
25
25
  "ink-spinner": "^5.0.0",
26
- "inquirer": "^12.9.4",
26
+ "inquirer": "^12.9.6",
27
27
  "js-yaml": "^4.1.0",
28
28
  "mustache": "^4.2.0",
29
29
  "netmask": "^2.0.2",
30
30
  "react": "^18.3.1",
31
31
  "read": "^4.1.0",
32
32
  "shelljs": "^0.10.0",
33
- "systeminformation": "^5.27.8",
33
+ "systeminformation": "^5.27.10",
34
34
  "tftp": "^0.1.2",
35
35
  "ws": "^8.18.3"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@oclif/prettier-config": "^0.2.1",
39
- "@oclif/test": "^4.1.13",
39
+ "@oclif/test": "^4.1.14",
40
40
  "@types/chai": "^5.2.2",
41
41
  "@types/debug": "^4.1.12",
42
42
  "@types/glob": "^9.0.0",
@@ -46,18 +46,18 @@
46
46
  "@types/mustache": "^4.2.6",
47
47
  "@types/netmask": "^2.0.5",
48
48
  "@types/node": "^22.15.30",
49
- "@types/react": "^18.3.1",
49
+ "@types/react": "^18.3.18",
50
50
  "@types/read": "^0.0.32",
51
51
  "@types/shelljs": "^0.8.17",
52
52
  "@types/ws": "^8.18.1",
53
53
  "chai": "^6.0.1",
54
54
  "eslint": "^9.35.0",
55
- "eslint-config-oclif": "^6.0.101",
55
+ "eslint-config-oclif": "^6.0.104",
56
56
  "eslint-config-prettier": "^10.1.8",
57
57
  "glob": "^11.0.3",
58
58
  "mocha": "^11.7.2",
59
- "oclif": "^4.22.16",
60
- "perrisbrewery": "^10",
59
+ "oclif": "^4.22.22",
60
+ "perrisbrewery": "^25.9.16",
61
61
  "prettier": "^3.6.2",
62
62
  "shx": "^0.4.0",
63
63
  "ts-node": "10.9.2",
@@ -1 +0,0 @@
1
- 3930ad85d31d4d2446c15a710bc0263d2fdb86d17ab6632db42a07a5b60c7404 penguins-eggs_25.9.7-1_amd64.deb