Browse Source

sistemato info con il nuovo lool, testato produce senza prerequisites: woriking!

tags/7.5.100-1
Piero Proietti 8 months ago
parent
commit
64836a094f
4 changed files with 44 additions and 32 deletions
  1. +1
    -1
      eggs
  2. +5
    -2
      src/classes/ovary.ts
  3. +13
    -13
      src/classes/pacman.ts
  4. +25
    -16
      src/commands/info.ts

+ 1
- 1
eggs View File

@@ -1,4 +1,4 @@
./bin/run $1 $2 $3 $4 $5 $6 $7 $8
./bin/run $1 $2 $3 $4 $5 $6 $7 $8
#
# - script read from stdin (default if no file name is provided, interactive mode if a tty)
# -- indicate the end of node options


+ 5
- 2
src/classes/ovary.ts View File

@@ -144,9 +144,9 @@ export default class Ovary {

if (this.loadSettings()) {
if (this.listFreeSpace()) {
if(await Utils.customConfirm(`Select yes to continue...`))
if (await Utils.customConfirm(`Select yes to continue...`))
return true
}
}
}
return false
}
@@ -158,6 +158,9 @@ export default class Ovary {
public async loadSettings(verbose = false): Promise<boolean> {
let foundSettings: boolean

if (!fs.existsSync(this.config_file)) {
return false
}
const settings = ini.parse(fs.readFileSync(this.config_file, 'utf-8'))

if (settings.General.snapshot_dir === '') {


+ 13
- 13
src/classes/pacman.ts View File

@@ -35,14 +35,14 @@ export default class Pacman {
* @param debPackage
*/
static packageIsInstalled(debPackage: string): boolean {
let isInstalled = false
let installed:boolean = false
const cmd = `/usr/bin/dpkg -s ${debPackage} | grep Status`
const stdout = shx.exec(cmd, { silent: true }).stdout.trim()

if (stdout === 'Status: install ok installed') {
isInstalled = true
installed = true
}
return isInstalled
return installed
}

/**
@@ -78,15 +78,15 @@ export default class Pacman {
* Restituisce VERO se i prerequisiti sono installati
*/
static prerequisitesEggsCheck(): boolean {
let retVal = true
let installed: boolean = true

for (let i in this.debs4eggs) {
if (!Pacman.packageIsInstalled(this.debs4eggs[i])) {
retVal = false
installed = false
break
}
}
return retVal
return installed
}

/**
@@ -117,14 +117,14 @@ export default class Pacman {
*
*/
static async prerequisitesCalamaresCheck(): Promise<boolean> {
let retVal = true
let installed: boolean = true
for (let i in this.debs4calamares) {
if (!await Pacman.packageIsInstalled(this.debs4calamares[i])) {
retVal = false
if (!Pacman.packageIsInstalled(this.debs4calamares[i])) {
installed = false
break
}
}
return retVal
return installed
}

/**
@@ -160,11 +160,11 @@ export default class Pacman {
static configurationCheck(): boolean {
let conf = false
let list = false
let result = false
let configured = false
conf = fs.existsSync('/etc/penguins-eggs.conf')
list = fs.existsSync('/usr/local/share/excludes/penguins-eggs-exclude.list')
result = conf && list
return result
configured = conf && list
return configured
}

/**


+ 25
- 16
src/commands/info.ts View File

@@ -5,7 +5,7 @@
* license: MIT
*/

import {Command,flags} from '@oclif/command'
import { Command, flags } from '@oclif/command'
import shx = require('shelljs')
import Utils from '../classes/utils'
import Ovary from '../classes/ovary'
@@ -30,33 +30,42 @@ You will find here informations about penguin's eggs!

const ovary = new Ovary
ovary.loadSettings()

const line = '-----------------------------------------------------------------'
console.log(line)
ovary.showSettings()

console.log(line)
shx.exec('lsb_release -a')
console.log()
if (Pacman.prerequisitesEggsCheck()){
console.log('Prerequisites: ' + chalk.bgGreen('installed'))

console.log(line)
if (await Pacman.prerequisitesEggsCheck()) {
console.log('Eggs prerequisites: ' + chalk.bgGreen('ok'))
} else {
console.log('Prerequisites: ' + chalk.bgRed('NOT installed'))
console.log('Eggs prerequisites: ' + chalk.bgRed('ko'))
}

if (Pacman.configurationCheck()){
console.log('Configuration: ' + chalk.bgGreen('configured'))
if (await Pacman.configurationCheck()) {
console.log('Configuration file: ' + chalk.bgGreen('ok'))
} else {
console.log('Configuration: ' + chalk.bgRed('NOT configured'))
console.log('Configuration file: ' + chalk.bgRed('ko'))
}
if (Pacman.prerequisitesCalamaresCheck()){
console.log('Calamares: ' + chalk.bgGreen('installed'))
if (await Pacman.isXInstalled()) {
if (await Pacman.prerequisitesCalamaresCheck()) {
console.log('GUI Installer: ' + chalk.bgGreen('ok'))
} else {
console.log('GUI Installer: ' + chalk.bgBlue('ko'))
}
} else {
console.log('Calamares: ' + chalk.bgRed('NOT installed'))
console.log('GUI Installer: ' + chalk.bgGreen('cli installer'))
}

let message='You are on an INSTALLED system.'
if (Utils.isLive()){
console.log('System: This is a ' + chalk.bgGreen('LIVE') + ' system.')
console.log(line)
if (Utils.isLive()) {
console.log('System: ' + chalk.bgGreen('LIVE') + ' system')
} else {
console.log('System: This is an ' + chalk.bgRed('INSTALLED') + ' system.')
console.log('System: ' + chalk.bgCyan('INSTALLED') + ' systen')
}
console.log(line)
}
}

Loading…
Cancel
Save