warn if patches contain ${WRKOBJDIR}, includes fixes from espie@
This commit is contained in:
parent
f86ba98d4b
commit
72c8828acb
@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/perl
|
#! /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
|
# Copyright (c) 2017
|
||||||
# Marc Espie. All rights reserved.
|
# Marc Espie. All rights reserved.
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -34,9 +34,9 @@ open my $oldout, '>&STDOUT';
|
|||||||
open STDOUT, '>&STDERR';
|
open STDOUT, '>&STDERR';
|
||||||
|
|
||||||
# grab env stuff
|
# 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{DISTORIG}, $ENV{PATCHORIG}, $ENV{WRKDIST}, $ENV{PATCHDIR},
|
||||||
$ENV{PATCH_LIST});
|
$ENV{PATCH_LIST}, $ENV{WRKOBJDIR});
|
||||||
|
|
||||||
if ($patchorig ne '.orig') {
|
if ($patchorig ne '.orig') {
|
||||||
say "PATCHORIG=$patchorig";
|
say "PATCHORIG=$patchorig";
|
||||||
@ -407,7 +407,7 @@ for my $k (sort keys %$saved) {
|
|||||||
}
|
}
|
||||||
say "*** Patch ", description($p), " not accounted for";
|
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}}) {
|
for my $l (@{$p->{patch}}) {
|
||||||
if ($l =~ m/^\\ No newline at end of file/) {
|
if ($l =~ m/^\\ No newline at end of file/) {
|
||||||
say "*** Patch ", description($p), " misses 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"
|
say "*** Patch ", description($p), " contains CVS keyword"
|
||||||
unless $warned_keyword;
|
unless $warned_keyword;
|
||||||
$warned_keyword = 1;
|
$warned_keyword = 1;
|
||||||
|
} elsif ($l =~ m/\Q$wrkobj\E/) {
|
||||||
|
say "*** Patch ", description($p), " contains $wrkobj (WRKOBJDIR)"
|
||||||
|
unless $warned_pobj;
|
||||||
|
$warned_pobj = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#-*- mode: Makefile; tab-width: 4; -*-
|
#-*- mode: Makefile; tab-width: 4; -*-
|
||||||
# ex:ts=4 sw=4 filetype=make:
|
# 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.
|
# bsd.port.mk - 940820 Jordan K. Hubbard.
|
||||||
# This file is in the public domain.
|
# This file is in the public domain.
|
||||||
@ -2479,6 +2479,7 @@ update-patches:
|
|||||||
@toedit=`WRKDIST=${WRKDIST} PATCHDIR=${PATCHDIR} \
|
@toedit=`WRKDIST=${WRKDIST} PATCHDIR=${PATCHDIR} \
|
||||||
PATCH_LIST='${PATCH_LIST}' DIFF_ARGS='${DIFF_ARGS}' \
|
PATCH_LIST='${PATCH_LIST}' DIFF_ARGS='${DIFF_ARGS}' \
|
||||||
DISTORIG=${DISTORIG} PATCHORIG=${PATCHORIG} \
|
DISTORIG=${DISTORIG} PATCHORIG=${PATCHORIG} \
|
||||||
|
WRKOBJDIR=${WRKOBJDIR} \
|
||||||
${_PERLSCRIPT}/update-patches`; \
|
${_PERLSCRIPT}/update-patches`; \
|
||||||
if [ -n "$$toedit" ] && [ "${EDIT_PATCHES:L}" != no ]; then \
|
if [ -n "$$toedit" ] && [ "${EDIT_PATCHES:L}" != no ]; then \
|
||||||
cd ${PATCHDIR} && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit; \
|
cd ${PATCHDIR} && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user