Tâche #29222
Scénario #18447: Hâpy doit permettre d’initialiser plusieurs images ISO et plusieurs tailles de disques vierges
Le script 99-init-hapy-master doit supporter « set -e »
100%
Description
Le script utilise abondamment la formulation [ ${?} -ne 0] && echo something
qui fait planter le script s’il est exécuter avec set -e
et que ${?}
n’est pas égal à 0
.
Il est préférable d’utiliser la formulation [ ${?} -eq 0 ] || echo something
, dans quel cas l’instruction renvoie toujours true
, soit parceque ${?}
vaut 0
, soit par l’exécution de echo
.
Associated revisions
Init: better support of shell “set -e”
Under shell “set -e” we must not use “[ ! command1 ] && command2” since
if the first command fails the instruction line fails and the script
exit.
It's more robust and simple to use “[ command ] || command2”.
- postservice/99-init-hapy-master: replace all “&&” linked instruction
by “||” equivalent.
Ref: #29222
Init: fix cosmetic alignment and syntax
- postservice/99-init-hapy-master (addISOImage): do not return 0 after
an “echo”.
Ref: #29222
History
#1 Updated by Daniel Dehennin almost 4 years ago
- Status changed from Nouveau to En cours
- Assigned To set to Daniel Dehennin
#2 Updated by Daniel Dehennin almost 4 years ago
- Status changed from En cours to Résolu
- % Done changed from 0 to 100
- Remaining (hours) changed from 1.0 to 0.0
#3 Updated by Daniel Dehennin almost 4 years ago
Pas d’erreur avec le paquet eole-one-master 2.7.2-19
:
run-parts: executing /usr/share/eole/postservice/99-init-hapy-master instance ***** Création de DSK-40-Go ***** ID: 0 ***** Création de DSK-50-Go ***** ID: 1 ***** Création de DSK-100-Go ***** ID: 2 ***** Création de l'image eole-2.7.2-a0-alternate-amd64.iso ***** ID: 3 Création terminée, l'image a le statut : rdy ***** Création de install-eole-2.7.2-a0-amd64 ***** ID: 0 ***** Création de l'image eole-2.7.1.1-alternate-amd64.iso ***** ID: 4 Création terminée, l'image a le statut : rdy ***** Création de install-eole-2.7.1.1-amd64 ***** ID: 1 ***** Création de l'image eole-2.6.2.2-alternate-amd64.iso ***** ID: 5 Création terminée, l'image a le statut : rdy ***** Création de install-eole-2.6.2.2-amd64 ***** ID: 2
#4 Updated by Daniel Dehennin almost 4 years ago
- Status changed from Résolu to Fermé