Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Aug 2021 14:34:18 +0200
From:      Michael Gmelin <freebsd@grem.de>
To:        Markus Wipp <mw@wipp.bayern>
Cc:        Michael Gmelin <freebsd@grem.de>, freebsd-ports@freebsd.org, portmgr@freebsd.org
Subject:   Re: Issues with security/step-cli
Message-ID:  <20210803143418.23df9eca@bsd64.grem.de>
In-Reply-To: <B9D8B549-618A-453F-942E-C0AFB0317C39@wipp.bayern>
References:  <9F64FFEB-6525-49EA-9BDF-C60E64878261@wipp.bayern> <70C8D71B-880A-4D11-83CD-C680E7BF4898@grem.de> <B9D8B549-618A-453F-942E-C0AFB0317C39@wipp.bayern>

next in thread | previous in thread | raw e-mail | index | archive | help
--MP_/M6yUDfwVnceLz5bSO.jDT_j
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline



On Tue, 3 Aug 2021 13:41:42 +0200
Markus Wipp <mw@wipp.bayern> wrote:

> Sure. I attached you the diff.
>=20
>=20
> > On 3. Aug 2021, at 13:35, Michael Gmelin <freebsd@grem.de> wrote:
> >=20
> >=20
> >  =20
> >> On 3. Aug 2021, at 13:29, Markus Wipp <mw@wipp.bayern> wrote:
> >>=20
> >> =EF=BB=BFHi all,=20
> >>=20
> >> I=E2=80=99m the maintainer of the security/step-cli port and I=E2=80=
=99m currently
> >> facing some issues, I seem to be unable to fix.
> >>=20
> >> I currently try to create the patch for the latest version 0.16.1
> >>=20
> >> I did the following:
> >>=20
> >> 1) I removed all files in /usr/ports/distfiles
> >> 2) I did a make clean makesum stage (which ran fine)
> >> 3) I did a make clean package (which always runs into the
> >> following error: =3D> Attempting to fetch
> >> https://codeload.github.com/etcd-io/etcd/tar.gz/v3.5.0?dummy=3D/etcd-i=
o-etcd-v3.5.0_GH0.tar.gz
> >> fetch: 4020010: No such file or directory fetch: 4020010: No such
> >> file or directory fetch: 4020010: No such file or directory
> >> fetch: 4020010: No such file or directory
> >> fetch: 4020010: No such file or directory
> >> fetch: 4020010: No such file or directory
> >> fetch: 4020010: No such file or directory
> >> fetch: 4020010: No such file or directory
> >> fetch: 4020010: No such file or directory
> >> fetch:
> >> https://codeload.github.com/etcd-io/etcd/tar.gz/v3.5.0?dummy=3D/etcd-i=
o-etcd-v3.5.0_GH0.tar.gz:
> >> size unknown fetch:
> >> https://codeload.github.com/etcd-io/etcd/tar.gz/v3.5.0?dummy=3D/etcd-i=
o-etcd-v3.5.0_GH0.tar.gz:
> >> size of remote file is not known etcd-io-etcd-v3.5.0_GH0.tar.gz
> >>                     3925 kB   10 MBps    00s =3D> Attempting to
> >> fetch
> >> http://distcache.FreeBSD.org/ports-distfiles/etcd-io-etcd-v3.5.0_GH0.t=
ar.gz
> >> fetch: 4020010: No such file or directory fetch: 4020010: No such
> >> file or directory fetch: 4020010: No such file or directory fetch:
> >> 4020010: No such file or directory fetch: 4020010: No such file or
> >> directory fetch: 4020010: No such file or directory fetch:
> >> 4020010: No such file or directory fetch: 4020010: No such file or
> >> directory fetch: 4020010: No such file or directory fetch:
> >> http://distcache.FreeBSD.org/ports-distfiles/etcd-io-etcd-v3.5.0_GH0.t=
ar.gz:
> >> Not Found =3D> Couldn't fetch it - please try to retrieve this =3D>
> >> port manually into /usr/ports/distfiles/ and try again. *** Error
> >> code 1
> >>=20
> >> Is there anything I did wrong? Anything I can do to fix this issue?
> >>  =20
> >=20
> > Unless someone else knows what=E2=80=99s wrong anyway: Could you share =
your
> > port skeleton? (at least the files that changed or the output of
> > `git diff=E2=80=99)
> >=20
> >  =20
> >> Thanks in advance
> >> Markus =20
>=20

distinfo contains the entry for etcd-io-etcd-v3.5.0_GH0.tar.gz multiple
times (due to it being listed multiple times in GH_TUPLE).

It seems to build okay when getting rid of the duplicates in distinfo.
I don't know if what you're doing is officially supported, but if it
is, we should probably adapt tooling. Also, portlint didn't
complain and `make makesum' re-creates the duplicates.

@portmgr Please find attached an example of a patch that dedups distinfo
on `make makesum', it might more sense to fix this somewhere else in
the framework (so that e.g., checksums aren't validated multiple times
etc.), up to you.

Cheers,
Michael

--=20
Michael Gmelin

--MP_/M6yUDfwVnceLz5bSO.jDT_j
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=makesum_dedup.diff

diff --git a/Mk/Scripts/makesum.sh b/Mk/Scripts/makesum.sh
index 1d09b7ffb..69bb6012e 100644
--- a/Mk/Scripts/makesum.sh
+++ b/Mk/Scripts/makesum.sh
@@ -31,7 +31,8 @@ if [ -f "${dp_DISTINFO_FILE}" ] && grep -q "^TIMESTAMP " ${dp_DISTINFO_FILE}; th
 	grep -v "^TIMESTAMP " ${dp_DISTINFO_FILE} > ${DISTINFO_OLD}
 fi
 
-for file in ${dp_CKSUMFILES}; do
+for file in $(${dp_ECHO_CMD} ${dp_CKSUMFILES} |\
+	      ${dp_TR} " " "\n" | ${dp_SORT} -u); do
 	for alg in ${dp_CHECKSUM_ALGORITHMS}; do
 		eval "alg_executable=\$dp_$alg"
 
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 5bdaf10ce..68f1322af 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -3968,8 +3968,11 @@ makesum: check-sanity
 			dp_CKSUMFILES='${_CKSUMFILES}' \
 			dp_DISTDIR='${DISTDIR}' \
 			dp_DISTINFO_FILE='${DISTINFO_FILE}' \
+			dp_ECHO_CMD=${ECHO_CMD} \
 			dp_ECHO_MSG='${ECHO_MSG}' \
 			dp_SCRIPTSDIR='${SCRIPTSDIR}' \
+			dp_SORT="${SORT}" \
+			dp_TR="${TR}" \
 			${SH} ${SCRIPTSDIR}/makesum.sh ${DISTFILES:C/.*/'&'/}
 .endif
 

--MP_/M6yUDfwVnceLz5bSO.jDT_j--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210803143418.23df9eca>