Subject: Re: [change request] pattern for patch filenames
To: grant beattie <grant@NetBSD.org>
From: Roland Illig <roland.illig@gmx.de>
List: tech-pkg
Date: 06/29/2004 01:54:11
This is a multi-part message in MIME format.
--------------080208060003070608030509
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
grant beattie wrote:
> On Mon, Jun 28, 2004 at 06:01:51PM +0200, Roland Illig wrote:
>>With this change we could name the patch files after the files they
>>patch ("patch-src_inode_c"), not with some arbitrarily chosen number
>>("patch-af").
>
> I actually find encoding the target filename in the patch filename a
> bit superfluous -- it's already at the top of the patch file.
Yes, but I often look for a patch knowing what file it is for. So I can
directly open that file in the editor and do not have to scan through
all the files to find the right one.
And -- my favourite argument: Creating patches can be automated.
> I would support naming patches after their purpose/function which is
> much more useful:
>
> patches/patch-statvfs_1
> patches/patch-statvfs_2 (if there are multiple files that need patching..)
Hmmm, yes, that's possible, too. But I just discovered a nice way to
automate creating patches, so I'm a little bit biased towards it.
But you also want to have the underscore, don't you? If so, you might
want to apply the appended patch to mk/bsd.pkg.mk. I don't have CVS
write access.
Roland
--------------080208060003070608030509
Content-Type: text/plain;
name="bsd.pkg.mk-patch-pattern.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="bsd.pkg.mk-patch-pattern.patch"
Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1470
diff -u -r1.1470 bsd.pkg.mk
--- bsd.pkg.mk 23 Jun 2004 11:42:18 -0000 1.1470
+++ bsd.pkg.mk 28 Jun 2004 23:51:45 -0000
@@ -3694,7 +3694,7 @@
${ECHO} "${DIGEST_ALGORITHM} ($$ignore) = IGNORE" >> $$newfile; \
done; \
if [ -f ${DISTINFO_FILE} ]; then \
- ${AWK} '$$2 ~ /\(patch-[a-z0-9]+\)/ { print $$0 }' < ${DISTINFO_FILE} >> $$newfile; \
+ ${AWK} '$$2 ~ /\(patch-[a-z0-9_]+\)/ { print $$0 }' < ${DISTINFO_FILE} >> $$newfile; \
fi; \
if ${CMP} -s $$newfile ${DISTINFO_FILE}; then \
${RM} -f $$newfile; \
@@ -3709,7 +3709,7 @@
${_PKG_SILENT}${_PKG_DEBUG} \
newfile=${DISTINFO_FILE}.$$$$; \
if [ -f ${DISTINFO_FILE} ]; then \
- ${AWK} '$$2 !~ /\(patch-[a-z0-9]+\)/ { print $$0 }' < ${DISTINFO_FILE} >> $$newfile; \
+ ${AWK} '$$2 !~ /\(patch-[a-z0-9_]+\)/ { print $$0 }' < ${DISTINFO_FILE} >> $$newfile; \
else \
${ECHO_N} "$$" > $$newfile; \
${ECHO_N} "NetBSD" >> $$newfile; \
--------------080208060003070608030509--