Date: Fri, 25 Nov 2016 10:02:30 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-sysinstall@FreeBSD.org Subject: [Bug 202058] bsdinstall - Disable dialog(3) for distfetch/checksum/distextract targets Message-ID: <bug-202058-2920-q53uXqFKRY@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-202058-2920@https.bugs.freebsd.org/bugzilla/> References: <bug-202058-2920@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D202058 --- Comment #6 from Ganael LAPLANCHE <ganael.laplanche@corp.ovh.com> --- Hi Devin, Thank you very much for your answer. There may be a misunderstanding (the title of my PR is propably inaccurate): the goal of my patch is not to disable the need for dialog(3) at build time= . My initial -exact- need is to be able to run the tools over a SSH session with= out a tty, but *without having to recompile the tools with a specific option*, = so we are mostly dealing with you suggestion 3 here. Making the tools build WITHOUT_DIALOG is (in my opinion) a step further that can be achieved later. Anyway, you're right, the 'nonInteractive' env variable is not appropriate everywhere in my patches: sometimes it is used to prevent dialog_msgbox(,,,,TRUE) from waiting for "OK" to be pressed after an error message and sometimes it is also used to disable infoboxes or general dialo= g(3) code. In the first case, I think it is OK, as pressing "OK" is an interacti= ve action. In the second case, we should probably introduce a way to disable dialog(3) and use printf() instead. So the patch should probably be re-written to split the modifications in two kinds: - the ones that really disable interactivity (dialog_msgbox(,,,,TRUE)) =3D>= can be left as is IMHO - the ones that really only deal with dialog(3) stuff =3D> to be reworked. = For that purpose, we could introduce a new env variable ($noDialog ?) to keep t= he global spirit of the tools. Finaly, there is probably a relationship between the two variables : /* ---- */ static uint8_t interactive =3D 1; static uint8_t dialog =3D 1; if (getenv("noDialog") !=3D NULL) { interactive =3D 0; dialog =3D 0; } if (getenv("nonInteractive") !=3D NULL) { interactive =3D 0; } /* ---- */ Does that seem reasonable to you ? For the 'checksum' script, we could do the same kinds of modifications. E.g= ., for the second chunk : + if f_dialog; then + dialog --backtitle "FreeBSD Installer" --title "Checksum Verificati= on" \ + --mixedgauge "Verifying checksums of selected distributions." \ + 0 0 $percentage $items + else + printf "Verifying checksum of %s\n" "$dist" + fi The third and last chunk should probably be rewritten that way : + if f_interactive; then + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 + else + if f_dialog; then + dialog --backtitle "FreeBSD Installer" --title "Error" \ + --infobox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 + else + f_err "The checksum for %s does not match. It may have beco= me corrupted, and should be redownloaded.\n" "$dist" + fi + fi Not sure if f_dialog is well-chosen but you get the idea... Regards, Ganael. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-202058-2920-q53uXqFKRY>