From 72c8828acbc86224c7cef8944ff424c3dc24f1dc Mon Sep 17 00:00:00 2001 From: sthen Date: Sun, 10 Nov 2019 15:28:19 +0000 Subject: [PATCH] warn if patches contain ${WRKOBJDIR}, includes fixes from espie@ --- infrastructure/bin/update-patches | 12 ++++++++---- infrastructure/mk/bsd.port.mk | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/infrastructure/bin/update-patches b/infrastructure/bin/update-patches index ea0ecf08349..bee42fb1a74 100755 --- a/infrastructure/bin/update-patches +++ b/infrastructure/bin/update-patches @@ -1,6 +1,6 @@ #! /usr/bin/perl -# $OpenBSD: update-patches,v 1.19 2019/05/13 20:39:07 espie Exp $ +# $OpenBSD: update-patches,v 1.20 2019/11/10 15:28:19 sthen Exp $ # Copyright (c) 2017 # Marc Espie. All rights reserved. # Redistribution and use in source and binary forms, with or without @@ -34,9 +34,9 @@ open my $oldout, '>&STDOUT'; open STDOUT, '>&STDERR'; # grab env stuff -my ($distorig, $patchorig, $wrkdist, $patchdir, $patch_list) = +my ($distorig, $patchorig, $wrkdist, $patchdir, $patch_list, $wrkobj) = ($ENV{DISTORIG}, $ENV{PATCHORIG}, $ENV{WRKDIST}, $ENV{PATCHDIR}, - $ENV{PATCH_LIST}); + $ENV{PATCH_LIST}, $ENV{WRKOBJDIR}); if ($patchorig ne '.orig') { say "PATCHORIG=$patchorig"; @@ -407,7 +407,7 @@ for my $k (sort keys %$saved) { } say "*** Patch ", description($p), " not accounted for"; } - my ($warned_newline, $warned_keyword) = (0, 0); + my ($warned_newline, $warned_keyword, $warned_pobj) = (0, 0, 0); for my $l (@{$p->{patch}}) { if ($l =~ m/^\\ No newline at end of file/) { say "*** Patch ", description($p), " misses newline at end of file" @@ -417,6 +417,10 @@ for my $k (sort keys %$saved) { say "*** Patch ", description($p), " contains CVS keyword" unless $warned_keyword; $warned_keyword = 1; + } elsif ($l =~ m/\Q$wrkobj\E/) { + say "*** Patch ", description($p), " contains $wrkobj (WRKOBJDIR)" + unless $warned_pobj; + $warned_pobj = 1; } } } diff --git a/infrastructure/mk/bsd.port.mk b/infrastructure/mk/bsd.port.mk index f84f9dabfdf..858153771ae 100644 --- a/infrastructure/mk/bsd.port.mk +++ b/infrastructure/mk/bsd.port.mk @@ -1,6 +1,6 @@ #-*- mode: Makefile; tab-width: 4; -*- # ex:ts=4 sw=4 filetype=make: -# $OpenBSD: bsd.port.mk,v 1.1484 2019/11/10 11:10:37 sthen Exp $ +# $OpenBSD: bsd.port.mk,v 1.1485 2019/11/10 15:28:19 sthen Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -2479,6 +2479,7 @@ update-patches: @toedit=`WRKDIST=${WRKDIST} PATCHDIR=${PATCHDIR} \ PATCH_LIST='${PATCH_LIST}' DIFF_ARGS='${DIFF_ARGS}' \ DISTORIG=${DISTORIG} PATCHORIG=${PATCHORIG} \ + WRKOBJDIR=${WRKOBJDIR} \ ${_PERLSCRIPT}/update-patches`; \ if [ -n "$$toedit" ] && [ "${EDIT_PATCHES:L}" != no ]; then \ cd ${PATCHDIR} && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit; \