Date: Mon, 25 Nov 2013 19:04:45 +0100 (CET) From: Mathieu Arnold <mat@FreeBSD.org> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/184289: Enhance make makeplist Message-ID: <20131125180445.763B714269C@aragorn.in.absolight.net> Resent-Message-ID: <201311251810.rAPIA0cJ082950@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 184289 >Category: ports >Synopsis: Enhance make makeplist >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Nov 25 18:10:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Mathieu Arnold >Release: FreeBSD 9.2-RELEASE i386 >Organization: Absolight >Environment: System: FreeBSD aragorn.in.absolight.net 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Fri Sep 27 03:52:52 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386 >Description: make makeplist takes into account DATADIR, EXAMPLESDIR and DOCSDIR, let's add some other to the lot. I did not change the way DOCS and EXAMPLES are done because they add other stuffs. Also, I wasn't sure where to remove bits from PLIST_SUB, so I put it in bsd.stage.mk. >How-To-Repeat: Without: $ make makeplist lib/perl5/5.16/man/man3/DateTime.3.gz lib/perl5/5.16/man/man3/DateTime::Duration.3.gz lib/perl5/5.16/man/man3/DateTime::Infinite.3.gz lib/perl5/5.16/man/man3/DateTime::LeapSecond.3.gz lib/perl5/site_perl/5.16/mach/DateTime.pm lib/perl5/site_perl/5.16/mach/DateTime/Duration.pm lib/perl5/site_perl/5.16/mach/DateTime/Helpers.pm ... @dirrmtry lib/perl5/5.16/man/man3 @dirrmtry lib/perl5/5.16/man ... $ make makeplist etc/maradns/example_csv2 etc/mararc.sample ... @dirrmtry etc/maradns $ With: $ PORTSDIR=/home/mat/freebsd/ports/ make makeplist %%PERL5_MAN3%%/DateTime.3.gz %%PERL5_MAN3%%/DateTime::Duration.3.gz %%PERL5_MAN3%%/DateTime::Infinite.3.gz %%PERL5_MAN3%%/DateTime::LeapSecond.3.gz %%SITE_PERL%%/%%PERL_ARCH%%/DateTime.pm %%SITE_PERL%%/%%PERL_ARCH%%/DateTime/Duration.pm %%SITE_PERL%%/%%PERL_ARCH%%/DateTime/Helpers.pm ... @dirrmtry %%PERL5_MAN3%% @dirrmtry lib/perl5/%%PERL_VER%%/man $ PORTSDIR=/home/mat/work/freebsd/ports-full/ make makeplist %%ETCDIR%%/example_csv2 etc/mararc.sample ... @dirrmtry %%ETCDIR%% $ >Fix: --- stage_plist_sub.mk begins here --- Index: Mk/Scripts/check-stagedir.sh =================================================================== --- Mk/Scripts/check-stagedir.sh (revision 334863) +++ Mk/Scripts/check-stagedir.sh (working copy) @@ -24,7 +24,7 @@ # validate environment envfault= for i in STAGEDIR PREFIX LOCALBASE WRKDIR WRKSRC MTREE_FILE \ - TMPPLIST DATADIR DOCSDIR EXAMPLESDIR + TMPPLIST DOCSDIR EXAMPLESDIR PLIST_SUB do if ! ( eval ": \${${i}?}" ) 2>/dev/null ; then envfault="${envfault}${envfault:+" "}${i}" @@ -93,6 +93,19 @@ done } > ${WRKDIR}/.mtree +for i in $PLIST_SUB +do + echo $i +done | awk -F= '{print length($2), $1, $2 | "sort -nr" }' | while read l k v +do + if [ $l -ne 0 ] + then + echo "s,${v},%%${k}%%,g;" + fi +done > ${WRKDIR}/.plist_sub + +sed_plist_sub=`cat ${WRKDIR}/.plist_sub` + ### HANDLE FILES find ${STAGEDIR} -type f -o -type l | sort | sed -e "s,${STAGEDIR},," >${WRKDIR}/.staged-files comm -13 ${WRKDIR}/.plist-files ${WRKDIR}/.staged-files \ @@ -99,8 +112,8 @@ | sed \ -e "s,${DOCSDIR},%%PORTDOCS%%%%DOCSDIR%%,g" \ -e "s,${EXAMPLESDIR},%%PORTEXAMPLES%%%%EXAMPLESDIR%%,g" \ - -e "s,${DATADIR},%%DATADIR%%,g" \ - -e "s,${PREFIX}/,,g" | grep -v "^share/licenses" || [ $? = 1 ] + -e "s,${PREFIX}/,,g" \ + -e "${sed_plist_sub}" | grep -v "^share/licenses" || [ $? = 1 ] ### HANDLE DIRS cat ${WRKDIR}/.plist-dirs-unsorted ${WRKDIR}/.mtree | sort -u >${WRKDIR}/.traced-dirs @@ -109,7 +122,7 @@ | sort -r | sed \ -e "s,\(.*\)${DOCSDIR},%%PORTDOCS%%\1%%DOCSDIR%%,g" \ -e "s,\(.*\)${EXAMPLESDIR},%%PORTEXAMPLES%%\1%%EXAMPLESDIR%%,g" \ - -e "s,${DATADIR},%%DATADIR%%,g" \ -e "s,${PREFIX}/,,g" \ + -e "${sed_plist_sub}" \ -e 's,^,@dirrmtry ,' \ -e 's,@dirrmtry \(/.*\),@unexec rmdir >/dev/null 2>\&1 \1 || :,' | grep -v "^@dirrmtry share/licenses" || [ $? = 1 ] Index: Mk/bsd.stage.mk =================================================================== --- Mk/bsd.stage.mk (revision 334863) +++ Mk/bsd.stage.mk (working copy) @@ -19,9 +19,9 @@ WRKSRC=${WRKSRC} \ MTREE_FILE=${MTREE_FILE} \ TMPPLIST=${TMPPLIST} \ - DATADIR=${DATADIR} \ DOCSDIR=${DOCSDIR} \ - EXAMPLESDIR=${EXAMPLESDIR} + EXAMPLESDIR=${EXAMPLESDIR} \ + PLIST_SUB="${PLIST_SUB:NPREFIX=*:NLOCALBASE=*:NOSREL=*:NLIB32DIR=*:NDOCSDIR=*:NEXAMPLESDIR=*}" .if !target(stage-dir) stage-dir: --- stage_plist_sub.mk ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131125180445.763B714269C>