Re: plist-check not reporting orphaned files present in a @comment

From: Felix Palmen <zirias_at_freebsd.org>
Date: Thu, 17 Aug 2023 18:00:00 UTC
* Tatsuki Makino <tatsuki_makino@hotmail.com> [20230817 17:14]:
> Felix Palmen wrote on 2023/08/17 15:03:
> > It is, when some file doesn't exist for all architectures, but for more
> > than one of them.
> > 
> > You first test the port on ARCH=foo. Then you test on ARCH=bar and find
> > that it builds/installs an additional tmp/something, so you prefix it
> > with %%BAR%% which expands to "@comment " unless building on ARCH=bar.
> > 
> > Then you test on ARCH=baz which happens to build/install the same
> > tmp/something. plist-check will still be happy because the file is there
> > in pkg-plist (ignoring the @comment). Still, the file will be missing
> > from the package.
> > 
> > I might try another workaround, e.g. expand to "@comment dummy/"
> > instead, so the name won't match and plist-check will complain ...
> 
> epson-inkjet-printer-escpr2 is easy because it is restricted to 2 architectures, but in general it seems difficult.
> How about also making a combined PLIST_SUB in Makefile?

JFTR, this wasn't my problem here. In my concrete scenario, there are
only 3 supported archs anyways (I'm building a Linux-native toolchain
from source for the Linuxulator, will present it on this list once it
works on all 3 archs), and I already define NO_* subs, so it's straight
forward to set anything that might be required in pkg-plist.

The issue really was just about plist-check, which will *not* report
"orphaned" files when they are present in some @comment...

I now got around the issue using *this* block in my ports:

#v+
.include <bsd.port.options.mk>

.if ${ARCH} == amd64
PLIST_SUB+=     AMD64="" NO_AMD64="@comment _nonexisting/"
.else
PLIST_SUB+=     AMD64="@comment _nonexisting/" NO_AMD64=""
.endif
.if ${ARCH} == aarch64
PLIST_SUB+=     AARCH64="" NO_AARCH64="@comment _nonexisting/"
.else
PLIST_SUB+=     AARCH64="@comment _nonexisting/" NO_AARCH64=""
.endif
.if ${ARCH} == i386
PLIST_SUB+=     I386="" NO_I386="@comment _nonexisting/"
.else
PLIST_SUB+=     I386="@comment _nonexisting/" NO_I386=""
.endif
#v-

Sure, it's somewhat dirty workaround, but adding some "dummy" prefix to
the files makes sure plist-check will complain about them ;)

-- 
 Felix Palmen <zirias@FreeBSD.org>     {private}   felix@palmen-it.de
 -- ports committer --                     {web}  http://palmen-it.de
 {pgp public key}  http://palmen-it.de/pub.txt
 {pgp fingerprint} 6936 13D5 5BBF 4837 B212  3ACC 54AD E006 9879 F231