Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Dec 2006 13:59:04 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        Wesley Shields <wxs@atarininja.org>
Cc:        ports@freebsd.org
Subject:   Re: distfile belongs to?
Message-ID:  <4575EBA8.3020601@FreeBSD.org>
In-Reply-To: <20061205203120.GA53894@atarininja.org>
References:  <17771.24717.95357.989644@jerusalem.litteratus.org> <456B70E9.4030408@FreeBSD.org> <20061204213106.GA42084@atarininja.org> <45749998.3070308@FreeBSD.org> <20061204232125.GA42307@atarininja.org> <790a9fff0612050838s66c655fapfde80d4038f64ca2@mail.gmail.com> <20061205172803.GA51892@atarininja.org> <4575C568.70905@FreeBSD.org> <20061205194146.GC52966@atarininja.org> <20061205203120.GA53894@atarininja.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig3CCD694892B05C6266C585D2
Content-Type: multipart/mixed; boundary="------------070102060103020608090808"

This is a multi-part message in MIME format.
--------------070102060103020608090808
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Wesley Shields wrote:

>> I'd like to finalize how it should look in +CONTENTS before I make thi=
s
>> change, but it will get done eventually.  :)
>>
>> One way I was exploring is adding
>>
>> @comment DISTFILE:$filename:$size:$md5:$sha256

I think that's good, the other information might come in handy down
the road. One thing you might want to consider is to put the md5 sum
at the end, since at some point down the road (maybe years from now,
but still ...) we're likely to drop md5 altogether.

>> into the generated plist.  This way we shouldn't have to change
>> pkg_create and only modify pkg_info and other tools.  I haven't tested=

>> this fully but it was just a fairly easy and concise way that I believ=
e
>> will work. By adding it to +CONTENTS using some type of @comment line =
we
>> can avoid changing pkg_create and make for easier adoption.  The only
>> changes that will need to be made will be to those programs which
>> process +CONTENTS directly, and even those modifications will be
>> minimal.

I think you're probably right about this, but I'd like to hear from
some people who are more knowledgeable about the port's internals than
I am first.

I should have spoken up earlier, but you have a couple of
inefficiencies and duplicated code that doesn't have to be there. Take
a look at the attached, which also implements the change I mentioned
above. Also, for something like this where you just need the Nth
element of a line that is in a standard format, cut(1) is a lot more
efficient than awk.

Doug

--=20

    This .signature sanitized for your protection


--------------070102060103020608090808
Content-Type: text/plain;
 name="package-distinfo.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
 filename="package-distinfo.diff"

Index: bsd.port.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /usr/local/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.544
diff -u -r1.544 bsd.port.mk
--- bsd.port.mk	30 Sep 2006 19:25:45 -0000	1.544
+++ bsd.port.mk	5 Dec 2006 21:39:26 -0000
@@ -5395,11 +5395,20 @@
 # files exist.
=20
 .if !target(generate-plist)
+.if defined(DIST_SUBDIR)
+PDS=3D	"${DIST_SUBDIR}/"
+.endif
 generate-plist:
 	@${ECHO_MSG} "=3D=3D=3D>   Generating temporary packing list"
 	@${MKDIR} `${DIRNAME} ${TMPPLIST}`
 	@if [ ! -f ${DESCR} ]; then ${ECHO_CMD} "** Missing pkg-descr for ${PKG=
NAME}."; exit 1; fi
 	@>${TMPPLIST}
+	@for file in ${DISTFILES} ${PATCHFILES}; do \
+		distsize=3D`${GREP} "^SIZE (${PDS}$$file)" ${MD5_FILE} | ${CUT} -f4 -d=
' '`; \
+		distsha256=3D`${GREP} "^SHA256 (${PDS}$$file)" ${MD5_FILE} | ${CUT} -f=
4 -d' '`; \
+		distmd5=3D`${GREP} "^MD5 (${PDS}$$file)" ${MD5_FILE} | ${CUT} -f4 -d' =
'`; \
+		${ECHO_CMD} "@comment DISTFILE:${PDS}$${file}:$${distsize}:$${distsha2=
56}:$${distmd5}" >> ${TMPPLIST}; \
+	done
 	@for file in ${PLIST_FILES}; do \
 		${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=3D/=
%%!/} >> ${TMPPLIST}; \
 	done

--------------070102060103020608090808--

--------------enig3CCD694892B05C6266C585D2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.1 (FreeBSD)

iD8DBQFFdeutyIakK9Wy8PsRAtdJAJwP3bc78wrh/lg8efsotxh69MNyDgCdFLWa
y2An0R7Pfecj9jzoCLWnuWA=
=MAvo
-----END PGP SIGNATURE-----

--------------enig3CCD694892B05C6266C585D2--



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