warn if patches contain ${WRKOBJDIR}, includes fixes from espie@

This commit is contained in:
sthen 2019-11-10 15:28:19 +00:00
parent f86ba98d4b
commit 72c8828acb
2 changed files with 10 additions and 5 deletions

View File

@ -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;
}
}
}

View File

@ -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; \