From nobody Sat Jan 01 21:35:50 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A2DDF192774D for ; Sat, 1 Jan 2022 21:35:59 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JRFgM3fjzz3CH8 for ; Sat, 1 Jan 2022 21:35:59 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f54.google.com with SMTP id e5so18824470wmq.1 for ; Sat, 01 Jan 2022 13:35:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BlpNczbsz+vYG0N5DrOZIZV2z2zfeY2t0n7kkyItOrg=; b=WmYxYoqfQcqnSRtHcnCNYSrWheaP+6OPsi6KhnsNSKv6dJiCsGFLQq8puDzUPqiRey 1zVvnsJcQs6ZPSv7RhUgMbUzidXgmHw/dp5NQj3pjgIRmsYELL/t6R7iAXuCilT3z5+T tzt2Qp3gdpGntY0DKkIJAo3vqUSdZh2vxfmkMPzuOti96aO0KR6pC9QXqDSzoJDoazoc 1xfOMlqw7rT6CMWv986BHLV90bJXwZLuZn6LSwPnlgGCpYK/eFLuFjBA+vso5KlQayHx K3ONA3ADebVwjtWGBt6KHB9fwNFFwZ86yh6iDdh06i+dsbA8qE2lJae9pxFzBygtm3dQ l4WQ== X-Gm-Message-State: AOAM533udnDjzAkaYZ78ZdltuI7hCuIeCSzXzfeOXuXYz1HtJYR+dRT9 kxe+YgDM7/7VeOKYHynmJFl6rD0rwyZj7A== X-Google-Smtp-Source: ABdhPJzfFMXept2oqs64Ha8TtUhsIhVhznBDlFV/YEogjmFZnphO96bs4UAl/hHfIYIzTxhBXVhHVw== X-Received: by 2002:a05:600c:4e15:: with SMTP id b21mr34230286wmq.91.1641072951909; Sat, 01 Jan 2022 13:35:51 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id a3sm33986369wri.98.2022.01.01.13.35.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Jan 2022 13:35:51 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 18f20d5d967a - main - bsddialog: convert bsdinstall/distextract From: Jessica Clarke In-Reply-To: <202201012052.201KqrhV082129@gitrepo.freebsd.org> Date: Sat, 1 Jan 2022 21:35:50 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <41538126-67AC-4C19-9414-BD4E8B85D23B@freebsd.org> References: <202201012052.201KqrhV082129@gitrepo.freebsd.org> To: Baptiste Daroussin X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4JRFgM3fjzz3CH8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 1 Jan 2022, at 20:52, Baptiste Daroussin wrote: >=20 > The branch main has been updated by bapt: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D18f20d5d967ae790f121963e1fcee68d= 729a529e >=20 > commit 18f20d5d967ae790f121963e1fcee68d729a529e > Author: Alfonso Siciliano > AuthorDate: 2022-01-01 20:50:44 +0000 > Commit: Baptiste Daroussin > CommitDate: 2022-01-01 20:51:23 +0000 >=20 > bsddialog: convert bsdinstall/distextract >=20 > Differential Revision: https://reviews.freebsd.org/D33581 > --- > usr.sbin/bsdinstall/distextract/Makefile | 3 +- > usr.sbin/bsdinstall/distextract/distextract.c | 180 = +++++++++++++------------- > 2 files changed, 92 insertions(+), 91 deletions(-) >=20 > diff --git a/usr.sbin/bsdinstall/distextract/Makefile = b/usr.sbin/bsdinstall/distextract/Makefile > index 2b7180e28ea0..5e9f2b9e1473 100644 > --- a/usr.sbin/bsdinstall/distextract/Makefile > +++ b/usr.sbin/bsdinstall/distextract/Makefile > @@ -2,7 +2,8 @@ >=20 > BINDIR=3D ${LIBEXECDIR}/bsdinstall > PROG=3D distextract > -LIBADD=3D archive dpv dialog m > +CFLAGS+=3D -I${SRCTOP}/contrib/bsddialog/lib > +LIBADD=3D archive bsddialog m >=20 > MAN=3D >=20 > diff --git a/usr.sbin/bsdinstall/distextract/distextract.c = b/usr.sbin/bsdinstall/distextract/distextract.c > index 8ad6c7b2c64b..df10c299ab7f 100644 > --- a/usr.sbin/bsdinstall/distextract/distextract.c > +++ b/usr.sbin/bsdinstall/distextract/distextract.c > @@ -33,11 +33,12 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > -#include > +#include > +#include > #include > #include > #include > +#include > #include > #include > #include > @@ -46,30 +47,27 @@ __FBSDID("$FreeBSD$"); > /* Data to process */ > static char *distdir =3D NULL; > static struct archive *archive =3D NULL; > -static struct dpv_file_node *dists =3D NULL; >=20 > /* Function prototypes */ > static void sig_int(int sig); > static int count_files(const char *file); > -static int extract_files(struct dpv_file_node *file, int out); > +static int extract_files(struct bsddialog_fileminibar *file); >=20 > -#define _errx(...) (end_dialog(), errx(__VA_ARGS__)) > +#define _errx(...) (bsddialog_end(), errx(__VA_ARGS__)) >=20 > int > main(void) > { > char *chrootdir; > char *distributions; > + unsigned int i; > int retval; > - size_t config_size =3D sizeof(struct dpv_config); > - size_t file_node_size =3D sizeof(struct dpv_file_node); > + size_t minibar_size =3D sizeof(struct bsddialog_fileminibar); > size_t span; > - struct dpv_config *config; > - struct dpv_file_node *dist =3D dists; > - static char backtitle[] =3D "FreeBSD Installer"; > - static char title[] =3D "Archive Extraction"; > - static char aprompt[] =3D "\n Overall Progress:"; > - static char pprompt[] =3D "Extracting distribution files...\n"; > + unsigned int nminibars; > + struct bsddialog_fileminibar *dists; > + struct bsddialog_progviewconf pvconf; > + struct bsddialog_conf conf; > struct sigaction act; > char error[PATH_MAX + 512]; >=20 > @@ -78,17 +76,17 @@ main(void) > if ((distdir =3D getenv("BSDINSTALL_DISTDIR")) =3D=3D NULL) > distdir =3D __DECONST(char *, ""); >=20 > - /* Initialize dialog(3) */ > - init_dialog(stdin, stdout); > - dialog_vars.backtitle =3D backtitle; > - dlg_put_backtitle(); > - > - dialog_msgbox("", > - "Checking distribution archives.\nPlease wait...", 4, 35, = FALSE); > - > - /* > - * Parse $DISTRIBUTIONS into dpv(3) linked-list > - */ > + if (bsddialog_init() =3D=3D BSDDIALOG_ERROR) > + errx(EXIT_FAILURE, "Cannot init libbsdialog"); > + bsddialog_initconf(&conf); > + bsddialog_backtitle(&conf, __DECONST(char *, "FreeBSD = Installer")); Can all these interfaces really not just use a const char * rather than having to scatter __DECONST everywhere if you want to pass a string literal to functions like this? There are quite a few __DECONST=E2=80=99s = of string literals in this patch alone... Jess