openSUSE / jeos-firstboot

Lightweight firstboot wizard systemd service for SLE and openSUSE JeOS Images
MIT License
14 stars 13 forks source link

don't exit when --yesno is used #110

Closed lnussel closed 7 months ago

lnussel commented 9 months ago

the d() abstraction exits on exit code 1 which is normally cancel. The yesno dialog is special though. The absolutely valid 'no' reply also maps to exit code 1. So the function should probably catch that special case to avoid having to call dialog manually all over the script.

Vogtinator commented 9 months ago

Or a new d_yesno function could be created.

lnussel commented 9 months ago

sure. or make it transparent to avoid surprises like me :)

Vogtinator commented 9 months ago

The d method is somewhat misleading anyway, as it does multiple things which are only needed in specific cases:

  1. Capture output in $result, only needed for input
  2. Prompt on exit and exit if acknowleged. Only needed for "steps", not most dialogs. The "confirm root password" dialog for instance shouldn't use this either, but actually go back. Error messages don't need that either...

And then it sets --backtitle which is actually useful everywhere.

This mess should be untangled in a bigger refactor IMO...

Vogtinator commented 8 months ago

https://github.com/openSUSE/jeos-firstboot/pull/113