From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 28 May 2024 08:11:09 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sBq3B-000qjd-1c for lore@lore.pengutronix.de; Tue, 28 May 2024 08:11:09 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1sBq3B-0000wT-5u; Tue, 28 May 2024 08:11:09 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sBq2p-0000wJ-Tb; Tue, 28 May 2024 08:10:47 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sBq2p-003Hyh-HD; Tue, 28 May 2024 08:10:47 +0200 Received: from mol by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sBq2p-001GRP-1S; Tue, 28 May 2024 08:10:47 +0200 Date: Tue, 28 May 2024 08:10:47 +0200 From: Michael Olbrich To: Lucas Stach Message-ID: Mail-Followup-To: Lucas Stach , ptxdist@pengutronix.de References: <20240527201347.673604-1-l.stach@pengutronix.de> <20240527201347.673604-6-l.stach@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240527201347.673604-6-l.stach@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [ptxdist] [PATCH 6/6] ptxd_make_world_lint: check for usage of deprecated FTP protocol X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Mon, May 27, 2024 at 10:13:47PM +0200, Lucas Stach wrote: > FTP is on its way out, so it should not be used in package URLs > anymore. Add a lint check to ensure that. > > Signed-off-by: Lucas Stach > --- > scripts/lib/ptxd_make_world_lint.sh | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/scripts/lib/ptxd_make_world_lint.sh b/scripts/lib/ptxd_make_world_lint.sh > index 01a35d4801b8..94d43d6bee4f 100644 > --- a/scripts/lib/ptxd_make_world_lint.sh > +++ b/scripts/lib/ptxd_make_world_lint.sh > @@ -281,6 +281,23 @@ ptxd_make_world_lint_credits() { > export -f ptxd_make_world_lint_credits > PTXDIST_LINT_COMMANDS="${PTXDIST_LINT_COMMANDS} credits" > > +ptxd_make_world_lint_ftp() { > + local filefd file > + > + echo "Checking for deprecated FTP protocol use in package URL ..." > + > + exec {filefd}< <(ptxd_make_world_lint_makefiles) > + while read file <&${filefd}; do > + if grep -q "URL.*ftp://" "${file}"; then This will not detect multiline URL patterns. How about this: if grep -qzP '_URL\b.*=(.*\\\n)*.*\bftp://' "${file}"; then Michael > + ptxd_lint_error "'$(ptxd_print_path "${file}")' contains deprecated FTP URL." > + fi > + done > + exec {filefd}<&- > + echo > +} > +export -f ptxd_make_world_lint_ftp > +PTXDIST_LINT_COMMANDS="${PTXDIST_LINT_COMMANDS} ftp" > + > unset ptxd_make_world_lint_cross_whitelist > # we don't care about the initmethod > ptxd_make_world_lint_cross_whitelist+="INITMETHOD_BBINIT INITMETHOD_SYSTEMD " > -- > 2.39.2 > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |