From nobody Tue Jan 25 20:04:07 2022 X-Original-To: freebsd-ports@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 9B1AD1982314 for ; Tue, 25 Jan 2022 20:04:12 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Received: from wilbur.contactoffice.com (wilbur.contactoffice.com [212.3.242.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4JjyVM1KsVz3NBG for ; Tue, 25 Jan 2022 20:04:10 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36]) by wilbur.contactoffice.com (Postfix) with ESMTP id 028D71704; Tue, 25 Jan 2022 21:04:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1643141049; s=20210208-e7xh; d=mailfence.com; i=sysadmin.lists@mailfence.com; h=Date:From:Cc:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding; l=2467; bh=Cheu29ew0J2DTKb9xLZkBgeaMYBLr/x3BE6e9VQ8Yfo=; b=Vvxp5caXymuYPTSJsd4EcCyeORVqJNgnDCNaVpE0M/MO8BqUDlwv55hGhoK+Wmty 8M59oAbGdUm8+ctubz9lXUn8vZs6apSVUc2/E9WnUA7nlPh92nKHFhUpJyCpbGl3/w+ gzdyKh2wVnYCnllD+Lw8TzRYZyxzm4JDVYkJQwC0yPc++MwHbETP7vbijaF4S1HD/Am nFKrhANW3rTP4NVxRoMH+j0f0l+IS9sJVEFWAkg0NUlbJylqou2uhZURy/J4Rf+k7nc Daqm+uQDGf2OKoFa8XB/Ub4nj1kUV9VX6+L+5pw9mcMo++63UPVKee6mCA66PTxCsfW 55M8EeTP6A== Date: Tue, 25 Jan 2022 21:04:07 +0100 (CET) From: Sysadmin Lists To: Dmitry Morozovsky Cc: freebsd-ports@FreeBSD.org Message-ID: <847219065.1111600.1643141047574@ichabod.co-bxl> In-Reply-To: References: <765383430.947805.1643068188075@ichabod.co-bxl> Subject: Re: sed trouble when UNAME_* is set in jail (fwd) List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: ContactOffice Mail X-ContactOffice-Account: com:312482426 X-Rspamd-Queue-Id: 4JjyVM1KsVz3NBG X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=fail ("body hash did not verify") header.d=mailfence.com header.s=20210208-e7xh header.b=Vvxp5caX; dmarc=pass (policy=quarantine) header.from=mailfence.com; spf=pass (mx1.freebsd.org: domain of sysadmin.lists@mailfence.com designates 212.3.242.68 as permitted sender) smtp.mailfrom=sysadmin.lists@mailfence.com X-Spamd-Result: default: False [-1.89 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.3.242.64/26:c]; R_DKIM_REJECT(0.00)[mailfence.com:s=20210208-e7xh]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_IN_DNSWL_LOW(-0.10)[212.3.242.68:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[mailfence.com:-]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(0.00)[mailfence.com,quarantine]; DMARC_POLICY_ALLOW_WITH_FAILURES(-0.50)[]; MLMMJ_DEST(0.00)[freebsd-ports]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:10753, ipnet:212.3.242.64/26, country:US]; RCVD_COUNT_TWO(0.00)[2]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.3.242.68:from] X-ThisMailContainsUnwantedMimeParts: N You should learn basic troubleshooting steps for shell scripts: Enable debugging by adding 'set -x' around a block of code, and disable it with 'set +x'. > > > ---------------------------------------- > > > From: Dmitry Morozovsky > > > Sent: Mon Jan 24 20:45:11 CET 2022 > > > To: > > > Subject: sed trouble when UNAME_* is set in jail (fwd) > > > > > > I have a jail on my build system, nested-built on a previous major; on the > > > case, it's stable/10; for a poudriere, it is defined as null-mounted from the > > > build jail: > > > > > > 10-amd64 stable/10 amd64 null 2022-01-20 13:10:41 /X/j10a > ^^^^^^^^^ > here is the problem, it should be version, not branch, "10.4-STABLE" > > (10-STABLE is not enough as OSVERSION check will fail) > > > > > > > for some other reasons, there're definition in login.conf like > > > > > > :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,UNAME_r=10.4-STABLE,UNAME_v=FreeBSD 10.4-STABLE #0:\ > > > > > > however, bulk.sh/common.sh are unhappy with this breaking with > > > > > > sed: 1: "s/,UNAME_r.*:/:/ ; s/:\ ...": bad flag in substitute command: ',' > > > > > > I tracked this down to update_version_env() in common.sh, but then stuck > > > did I miss something trivial? > > > > `sed' is complaining about a bad substitution flag. Here's the expected behavior: > > > > $ awk '/sed/ && /UNAME/ {print NR ": " $0}' /usr/local/share/poudriere/common.sh > > 2860: sed -i "" -e "s/,UNAME_r.*:/:/ ; s/:\(setenv.*\):/:\1${login_env}:/" \ > > > > $ cat testfile > > :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,UNAME_r=10.4-STABLE,UNAME_v=FreeBSD 10.4-STABLE #0:\ > > > > $ sed -e "s/,UNAME_r.*:/:/ ; s/:\(setenv.*\):/:\1${login_env}:/" testfile > > :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ > > > > Try running the sed command by hand one piece at a time to troubleshoot what's breaking. > > > > $ sed "s//,UNAME_r.*:/:/" ${mnt}/etc/login.conf > > $ sed "s/:\(setenv.*\):/:\1${login_env}:/" ${mnt}/etc/login.conf > > $ echo $login_env > > > > > > -- > Sincerely, > D.Marck [DM5020, MCK-RIPE, DM3-RIPN] > [ FreeBSD committer: marck@FreeBSD.org ] > --------------------------------------------------------------------------- > *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- woozle@woozle.net *** > --------------------------------------------------------------------------- -- Sent with https://mailfence.com Secure and private email