penguins-eggs 10.0.1 → 10.0.3

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 (44) hide show
  1. package/.oclif.manifest.json +7 -8
  2. package/README.md +38 -38
  3. package/addons/eggs/theme/livecd/grub.main.cfg +3 -3
  4. package/addons/eggs/theme/livecd/isolinux.main.cfg +3 -3
  5. package/dist/classes/incubation/fisherman-helper/packages.js +8 -1
  6. package/dist/classes/xdg.js +3 -0
  7. package/dist/commands/adapt.d.ts +2 -2
  8. package/dist/commands/analyze.d.ts +2 -2
  9. package/dist/commands/calamares.d.ts +8 -8
  10. package/dist/commands/config.d.ts +5 -5
  11. package/dist/commands/cuckoo.d.ts +1 -1
  12. package/dist/commands/dad.d.ts +4 -4
  13. package/dist/commands/export/deb.d.ts +4 -4
  14. package/dist/commands/export/iso.d.ts +4 -4
  15. package/dist/commands/install.d.ts +15 -15
  16. package/dist/commands/install.js +6 -20
  17. package/dist/commands/kill.d.ts +4 -4
  18. package/dist/commands/mom.d.ts +1 -1
  19. package/dist/commands/produce.d.ts +18 -18
  20. package/dist/commands/status.d.ts +2 -2
  21. package/dist/commands/syncfrom.d.ts +5 -5
  22. package/dist/commands/syncto.d.ts +4 -4
  23. package/dist/commands/tools/clean.d.ts +3 -3
  24. package/dist/commands/tools/ppa.d.ts +5 -5
  25. package/dist/commands/tools/skel.d.ts +3 -3
  26. package/dist/commands/tools/stat.d.ts +3 -3
  27. package/dist/commands/tools/yolk.d.ts +2 -2
  28. package/dist/commands/update.d.ts +2 -2
  29. package/dist/commands/wardrobe/get.d.ts +3 -3
  30. package/dist/commands/wardrobe/list.d.ts +4 -4
  31. package/dist/commands/wardrobe/show.d.ts +5 -5
  32. package/dist/commands/wardrobe/wear.d.ts +6 -6
  33. package/dist/interfaces/i-packages.d.ts +4 -17
  34. package/dist/interfaces/i-packages.js +0 -14
  35. package/dist/krill/modules/packages.js +37 -27
  36. package/dist/krill/prepare.d.ts +2 -1
  37. package/dist/krill/prepare.js +4 -2
  38. package/dist/krill/sequence.d.ts +2 -1
  39. package/dist/krill/sequence.js +62 -42
  40. package/dist/lib/cli-autologin.js +1 -1
  41. package/manpages/doc/man/eggs.1.gz +0 -0
  42. package/manpages/doc/man/eggs.html +9 -9
  43. package/package.json +14 -11
  44. package/scripts/resy +10 -6
@@ -23,12 +23,12 @@ export default class Install extends Command {
23
23
  static examples = [
24
24
  'sudo eggs install',
25
25
  'sudo eggs install --unattended --halt',
26
- 'sudo eggs install --custom it',
26
+ 'sudo eggs install --chroot',
27
27
  ];
28
28
  static flags = {
29
29
  btrfs: Flags.boolean({ char: 'b', description: 'Format btrfs' }),
30
30
  crypted: Flags.boolean({ char: 'k', description: 'Crypted CLI installation' }),
31
- custom: Flags.string({ char: 'c', description: 'custom unattended configuration' }),
31
+ chroot: Flags.boolean({ char: 'c', description: 'chroot before to end' }),
32
32
  domain: Flags.string({ char: 'd', description: 'Domain name, defult: .local' }),
33
33
  halt: Flags.boolean({ char: 'H', description: 'Halt the system after installation' }),
34
34
  help: Flags.help({ char: 'h' }),
@@ -57,22 +57,6 @@ export default class Install extends Command {
57
57
  let krillConfig = {};
58
58
  const content = fs.readFileSync('/etc/penguins-eggs.d/krill.yaml', 'utf8');
59
59
  krillConfig = yaml.load(content);
60
- /* removed
61
- if (custom !== undefined) {
62
- const fname = path.basename(custom)
63
- const url = `https://raw.githubusercontent.com/pieroproietti/penguins-wardrobe/main/config/${fname}.yaml`
64
- let res: AxiosResponse
65
- await axios.get(url, {httpsAgent: agent})
66
- .then(function (response) {
67
- krillConfig = yaml.load(response.data) as IKrillConfig
68
- })
69
- .catch(function (error) {
70
- const content = fs.readFileSync('/etc/penguins-eggs.d/krill.yaml', 'utf8')
71
- krillConfig = yaml.load(content) as IKrillConfig
72
- })
73
- }
74
- }
75
- end removed */
76
60
  // nointeractive
77
61
  const { nointeractive } = flags;
78
62
  // halt
@@ -80,6 +64,8 @@ export default class Install extends Command {
80
64
  // hostname
81
65
  const { ip } = flags;
82
66
  const { random } = flags;
67
+ // chroot before to end
68
+ const { chroot } = flags;
83
69
  let domain = '';
84
70
  if (flags.domain) {
85
71
  domain = flags.domain;
@@ -89,14 +75,14 @@ export default class Install extends Command {
89
75
  const { small } = flags;
90
76
  const { none } = flags;
91
77
  let { crypted } = flags;
92
- const { pve } = flags;
78
+ const pve = flags.pve;
93
79
  if (pve) {
94
80
  crypted = false;
95
81
  }
96
82
  const { verbose } = flags;
97
83
  if (Utils.isRoot()) {
98
84
  if (Utils.isLive()) {
99
- const krill = new Krill(unattended, nointeractive, halt);
85
+ const krill = new Krill(unattended, nointeractive, halt, chroot);
100
86
  await krill.prepare(krillConfig, ip, random, domain, suspend, small, none, crypted, pve, flags.btrfs, verbose);
101
87
  }
102
88
  else {
@@ -13,10 +13,10 @@ export default class Kill extends Command {
13
13
  static description: string;
14
14
  static examples: string[];
15
15
  static flags: {
16
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
17
- isos: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
18
- nointeractive: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
19
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
16
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
17
+ isos: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ nointeractive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
20
  };
21
21
  config_file: string;
22
22
  snapshot_dir: string;
@@ -10,7 +10,7 @@ export default class Mom extends Command {
10
10
  static description: string;
11
11
  static examples: string[];
12
12
  static flags: {
13
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
13
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
14
14
  };
15
15
  run(): Promise<void>;
16
16
  }
@@ -10,24 +10,24 @@ export default class Produce extends Command {
10
10
  static description: string;
11
11
  static examples: string[];
12
12
  static flags: {
13
- addons: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
14
- basename: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
15
- clone: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
16
- cryptedclone: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
17
- excludes: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
18
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
19
- links: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
20
- max: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
21
- noicons: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
22
- nointeractive: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
23
- prefix: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
24
- release: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
25
- script: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
26
- standard: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
27
- theme: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
28
- unsecure: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
29
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
30
- yolk: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
13
+ addons: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ basename: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ clone: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
+ cryptedclone: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
+ excludes: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
19
+ links: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ max: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
+ noicons: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
+ nointeractive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
23
+ prefix: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
+ release: import("@oclif/core/interfaces").BooleanFlag<boolean>;
25
+ script: import("@oclif/core/interfaces").BooleanFlag<boolean>;
26
+ standard: import("@oclif/core/interfaces").BooleanFlag<boolean>;
27
+ theme: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
28
+ unsecure: import("@oclif/core/interfaces").BooleanFlag<boolean>;
29
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
30
+ yolk: import("@oclif/core/interfaces").BooleanFlag<boolean>;
31
31
  };
32
32
  run(): Promise<void>;
33
33
  }
@@ -13,8 +13,8 @@ export default class Status extends Command {
13
13
  static description: string;
14
14
  static examples: string[];
15
15
  static flags: {
16
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
17
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
16
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
17
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
18
  };
19
19
  /**
20
20
  *
@@ -14,11 +14,11 @@ export default class Syncfrom extends Command {
14
14
  static description: string;
15
15
  static examples: string[];
16
16
  static flags: {
17
- delete: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
18
- file: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
19
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
20
- rootdir: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
21
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
17
+ delete: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
20
+ rootdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
22
  };
23
23
  echo: {};
24
24
  luksName: string;
@@ -14,10 +14,10 @@ export default class Syncto extends Command {
14
14
  static description: string;
15
15
  static examples: string[];
16
16
  static flags: {
17
- excludes: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
18
- file: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
19
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
20
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
17
+ excludes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
20
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
21
  };
22
22
  echo: {};
23
23
  exclude: boolean;
@@ -10,9 +10,9 @@ export default class Clean extends Command {
10
10
  static description: string;
11
11
  static examples: string[];
12
12
  static flags: {
13
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
14
- nointeractive: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
15
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
13
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
14
+ nointeractive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
16
  };
17
17
  run(): Promise<void>;
18
18
  }
@@ -13,11 +13,11 @@ export default class Ppa extends Command {
13
13
  static description: string;
14
14
  static examples: string[];
15
15
  static flags: {
16
- add: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
17
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
18
- nointeractive: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
19
- remove: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
20
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
16
+ add: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
18
+ nointeractive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ remove: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
21
  };
22
22
  /**
23
23
  *
@@ -10,9 +10,9 @@ export default class Skel extends Command {
10
10
  static description: string;
11
11
  static examples: string[];
12
12
  static flags: {
13
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
14
- user: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
15
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
13
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
14
+ user: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
16
  };
17
17
  run(): Promise<void>;
18
18
  }
@@ -13,9 +13,9 @@ export default class ToolsStat extends Command {
13
13
  static description: string;
14
14
  static examples: string[];
15
15
  static flags: {
16
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
17
- month: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
18
- year: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
16
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
17
+ month: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ year: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
19
  };
20
20
  /**
21
21
  *
@@ -14,8 +14,8 @@ export default class ToolsYolk extends Command {
14
14
  static dir: string;
15
15
  static examples: string[];
16
16
  static flags: {
17
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
18
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
17
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
18
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
19
  };
20
20
  /**
21
21
  *
@@ -13,8 +13,8 @@ export default class Update extends Command {
13
13
  static description: string;
14
14
  static examples: string[];
15
15
  static flags: {
16
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
17
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
16
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
17
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
18
  };
19
19
  /**
20
20
  * Altrimenti, seleziona il tipo di
@@ -11,13 +11,13 @@ import { Command } from '@oclif/core';
11
11
  */
12
12
  export default class Get extends Command {
13
13
  static args: {
14
- repo: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
14
+ repo: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
15
15
  };
16
16
  static description: string;
17
17
  static examples: string[];
18
18
  static flags: {
19
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
20
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
19
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
20
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
21
  };
22
22
  run(): Promise<void>;
23
23
  }
@@ -11,14 +11,14 @@ import { Command } from '@oclif/core';
11
11
  */
12
12
  export default class List extends Command {
13
13
  static args: {
14
- repo: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
14
+ repo: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
15
15
  };
16
16
  static description: string;
17
17
  static examples: string[];
18
18
  static flags: {
19
- distro: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
20
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
21
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
19
+ distro: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
21
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
22
  };
23
23
  run(): Promise<void>;
24
24
  }
@@ -11,15 +11,15 @@ import { Command } from '@oclif/core';
11
11
  */
12
12
  export default class Show extends Command {
13
13
  static args: {
14
- repo: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
14
+ repo: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
15
15
  };
16
16
  static description: string;
17
17
  static example: string[];
18
18
  static flags: {
19
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
20
- json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
21
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
22
- wardrobe: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
19
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
20
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
+ wardrobe: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
23
  };
24
24
  run(): Promise<void>;
25
25
  }
@@ -11,16 +11,16 @@ import { Command } from '@oclif/core';
11
11
  */
12
12
  export default class Wear extends Command {
13
13
  static args: {
14
- repo: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
14
+ repo: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
15
15
  };
16
16
  static description: string;
17
17
  static examples: string[];
18
18
  static flags: {
19
- help: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<void>;
20
- no_accessories: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
21
- no_firmwares: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
22
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
23
- wardrobe: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
19
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
20
+ no_accessories: import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
+ no_firmwares: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
23
+ wardrobe: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
24
  };
25
25
  run(): Promise<void>;
26
26
  }
@@ -5,25 +5,12 @@
5
5
  * email: piero.proietti@gmail.com
6
6
  * license: MIT
7
7
  */
8
- interface operations {
9
- packages: string[];
8
+ interface IOperation {
9
+ try_remove?: string[];
10
+ try_install?: string[];
10
11
  }
11
12
  export interface IPackages {
12
13
  backend: string;
13
- operations: operations[];
14
+ operations: IOperation[];
14
15
  }
15
16
  export {};
16
- /**
17
- # Debian/Buster et others
18
- # packages
19
- ---
20
- backend: apt
21
-
22
- operations:
23
- - remove:
24
- - calamares
25
- - eggs
26
- - try_install:
27
- - firefox-esr-$LOCALE
28
-
29
- */
@@ -6,17 +6,3 @@
6
6
  * license: MIT
7
7
  */
8
8
  export {};
9
- /**
10
- # Debian/Buster et others
11
- # packages
12
- ---
13
- backend: apt
14
-
15
- operations:
16
- - remove:
17
- - calamares
18
- - eggs
19
- - try_install:
20
- - firefox-esr-$LOCALE
21
-
22
- */
@@ -21,50 +21,60 @@ export default async function packages() {
21
21
  if (Pacman.packageIsInstalled('calamares')) {
22
22
  modulePath = '/etc/calamares/';
23
23
  }
24
- const config_file = `${this.installTarget}${modulePath}modules/packages.conf`;
25
- let remove = [];
26
- let install = [];
24
+ const config_file = `${modulePath}modules/packages.conf`;
27
25
  if (fs.existsSync(config_file)) {
28
- const packages = yaml.load(fs.readFileSync(config_file, 'utf8'));
29
- const operations = JSON.parse(JSON.stringify(packages.operations));
30
- remove = operations[0].remove;
31
- if (operations.length > 1) {
32
- install = operations[1].install;
26
+ let packages = yaml.load(fs.readFileSync(config_file, 'utf8'));
27
+ let packagesToInstall = [];
28
+ let packagesToRemove = [];
29
+ for (let operation of packages.operations) {
30
+ if ('try_remove' in operation) {
31
+ packagesToRemove = operation.try_remove;
32
+ }
33
+ if ('try_install' in operation) {
34
+ packagesToInstall = operation.try_install;
35
+ }
33
36
  }
34
- if (operations !== undefined) {
35
- if (packages.backend === 'apt') {
36
- /**
37
- * apt: Debian/Devuan/Ubuntu
38
- */
39
- if (remove.length > 0) {
37
+ if (packages.backend === 'apt') {
38
+ // Debian/Devuan/Ubuntu
39
+ if (packagesToRemove != undefined) {
40
+ if (packagesToRemove.length > 0) {
40
41
  let cmd = `chroot ${this.installTarget} apt-get purge -y `;
41
- for (const elem of remove) {
42
- cmd += elem + ' ';
42
+ for (const elem of packagesToRemove) {
43
+ if (Pacman.packageIsInstalled(elem)) {
44
+ cmd += elem + ' ';
45
+ }
43
46
  }
44
47
  await exec(`${cmd} ${this.toNull}`, this.echo);
48
+ let autoremove = `chroot ${this.installTarget} apt-get autoremove -y ${this.toNull}`;
49
+ await exec(autoremove, this.echo);
45
50
  }
46
- if (install.length > 0) {
51
+ }
52
+ if (packagesToInstall != undefined) {
53
+ if (packagesToInstall.length > 0) {
47
54
  let cmd = `chroot ${this.installTarget} apt-get install -y `;
48
- for (const elem of install) {
55
+ for (const elem of packagesToInstall) {
49
56
  cmd += elem + ' ';
50
57
  }
51
- await exec(`chroot ${this.installTarget} apt-get update ${this.toNull}`, this.echo);
58
+ let update = `chroot ${this.installTarget} apt-get update ${this.toNull}`;
59
+ await exec(update, this.echo);
52
60
  await exec(`${cmd} ${this.toNull}`, this.echo);
53
61
  }
54
62
  }
55
- else if (packages.backend === 'pacman') {
56
- /**
57
- * pacman: arch/manjaro
58
- */
59
- if (remove.length > 0) {
63
+ }
64
+ else if (packages.backend === 'pacman') {
65
+ // arch/manjaro
66
+ if (packagesToRemove != undefined) {
67
+ if (packagesToRemove.length > 0) {
60
68
  let cmd = `chroot ${this.installTarget} pacman -R\n`;
61
- for (const elem of remove) {
69
+ for (const elem of packagesToRemove) {
62
70
  cmd += elem + ' ';
63
71
  }
64
72
  await exec(`${cmd} ${echoYes}`, this.echo);
65
73
  }
66
- if (install.length > 0) {
67
- for (const elem of install) {
74
+ }
75
+ if (packagesToInstall != undefined) {
76
+ if (packagesToInstall.length > 0) {
77
+ for (const elem of packagesToInstall) {
68
78
  await exec(`chroot ${this.installTarget} pacman -S ${elem}`, echoYes);
69
79
  }
70
80
  }
@@ -20,6 +20,7 @@ export default class Krill {
20
20
  keyboards: Keyboards;
21
21
  unattended: boolean;
22
22
  nointeractive: boolean;
23
+ chroot: boolean;
23
24
  halt: boolean;
24
25
  /**
25
26
  * constructor
@@ -27,7 +28,7 @@ export default class Krill {
27
28
  * @param nointeractive
28
29
  * @param halt
29
30
  */
30
- constructor(unattended?: boolean, nointeractive?: boolean, halt?: boolean);
31
+ constructor(unattended?: boolean, nointeractive?: boolean, halt?: boolean, chroot?: boolean);
31
32
  /**
32
33
  *
33
34
  * @param krillConfig
@@ -105,6 +105,7 @@ export default class Krill {
105
105
  keyboards = new Keyboards();
106
106
  unattended = false;
107
107
  nointeractive = false;
108
+ chroot = false;
108
109
  halt = false;
109
110
  /**
110
111
  * constructor
@@ -112,9 +113,10 @@ export default class Krill {
112
113
  * @param nointeractive
113
114
  * @param halt
114
115
  */
115
- constructor(unattended = false, nointeractive = false, halt = false) {
116
+ constructor(unattended = false, nointeractive = false, halt = false, chroot = false) {
116
117
  this.unattended = unattended;
117
118
  this.nointeractive = nointeractive;
119
+ this.chroot = chroot;
118
120
  this.halt = halt;
119
121
  }
120
122
  /**
@@ -266,7 +268,7 @@ export default class Krill {
266
268
  * INSTALL
267
269
  */
268
270
  const sequence = new Sequence(oLocation, oKeyboard, oPartitions, oUsers, oNetwork);
269
- await sequence.start(domain, this.unattended, this.nointeractive, this.halt, verbose);
271
+ await sequence.start(domain, this.unattended, this.nointeractive, this.chroot, this.halt, verbose);
270
272
  }
271
273
  /**
272
274
  * WELCOME
@@ -132,6 +132,7 @@ export default class Sequence {
132
132
  is_crypted_clone: boolean;
133
133
  unattended: boolean;
134
134
  nointeractive: boolean;
135
+ chroot: boolean;
135
136
  halt: boolean;
136
137
  cliAutologin: CliAutologin;
137
138
  /**
@@ -144,7 +145,7 @@ export default class Sequence {
144
145
  * @param umount
145
146
  * @returns
146
147
  */
147
- start(domain?: string, unattended?: boolean, nointeractive?: boolean, halt?: boolean, verbose?: boolean): Promise<void>;
148
+ start(domain?: string, unattended?: boolean, nointeractive?: boolean, chroot?: boolean, halt?: boolean, verbose?: boolean): Promise<void>;
148
149
  /**
149
150
  *
150
151
  */