Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152929226
D50270.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50270.id.diff
View Options
diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in
--- a/usr.sbin/bsdinstall/scripts/pkgbase.in
+++ b/usr.sbin/bsdinstall/scripts/pkgbase.in
@@ -23,18 +23,6 @@
return output:match("(.-)\n$") or output
end
-local function prompt_yn(question)
- while true do
- io.write(question .. " (y/n) ")
- local input = io.read()
- if input == "y" or input == "Y" then
- return true
- elseif input == "n" or input == "N" then
- return false
- end
- end
-end
-
local function append_list(list, other)
for _, item in ipairs(other) do
table.insert(list, item)
@@ -73,6 +61,18 @@
return exit_code, output
end
+-- Prompts the user for a yes/no answer to the given question using bsddialog
+-- Returns true if the user answers yes and false if the user answers no.
+local function prompt_yn(question)
+ local exit_code = bsddialog({
+ "--yesno",
+ "--disable-esc",
+ question,
+ 0, 0, -- autosize
+ })
+ return exit_code == 0
+end
+
-- Creates a dialog for component selection mirroring the
-- traditional tarball component selection dialog.
local function select_components(components, options)
@@ -254,7 +254,6 @@
while not os.execute(pkg .. "update") do
if not prompt_yn("Updating repositories failed, try again?") then
- print("Canceled")
os.exit(1)
end
end
@@ -263,7 +262,6 @@
while not os.execute(pkg .. "install -U -F -y -r FreeBSD-base " .. packages) do
if not prompt_yn("Fetching packages failed, try again?") then
- print("Canceled")
os.exit(1)
end
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 19, 3:33 AM (13 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31744211
Default Alt Text
D50270.id.diff (1 KB)
Attached To
Mode
D50270: bsdinstall: improve pkgbase target retry prompts
Attached
Detach File
Event Timeline
Log In to Comment