One of the lesser known FreshPorts features is searching pkg-plist. You want nslookup and dig but you can’t find the package which installs that. The FreshPorts search can find it for you.
When a new commit occurs for a given port, FreshPorts extracts and store the pkg-plist information. This allows you to search.
How does FreshPorts get that data?
make generate-plist
This is the script which runs make generate-plist:
[dan@dev-ingress01:/var/db/freshports/ports-jail] $ cat make-generate-plist.sh #!/bin/sh # # This extracts the config options for a given port. # # sudo /usr/sbin/chroot -u USER JAIL /make-generate-plist.sh REPO_PATH PORT # # where USER - user as which to execute the commands. e.g. dan # JAIL - path to the jail created with the create-jail-directories.sh command. e.g. /usr/jail/FreshPorts # REPO_PATH - path to the SVN repository e.g. /usr/local/PORTS-RELENG_9_1_0 # PORT - sysutils/bacula-server # . ./vars.sh REPO_PATH=$1 PORT=$2 cd ${REPO_PATH}/${PORT} ${MAKE} generate-plist PORTSDIR=${REPO_PATH} OPTIONSFILE=${LOCALBASE} -f ${REPO_PATH}/${PORT}/Makefile > /dev/null if [ $? == 0 ] then cat work/.PLIST.mktmp ${MAKE} clean > /dev/null fi [dan@dev-ingress01:/var/db/freshports/ports-jail] $
Let’s try running that from the command line and see what is generated:
$ cd :/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools $ sudo make generate-plist -f ./Makefile PORTSDIR=../../ ===> Generating temporary packing list
Next, let’s look at the file we just created:
$ make -V WRKDIR /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work $ cat /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/.PLIST.mktmp /usr/local/share/licenses/p5-Mail-Tools-2.21/catalog.mk /usr/local/share/licenses/p5-Mail-Tools-2.21/LICENSE /usr/local/share/licenses/p5-Mail-Tools-2.21/ART10 /usr/local/share/licenses/p5-Mail-Tools-2.21/GPLv1+ lib/perl5/site_perl/Mail/Address.pm lib/perl5/site_perl/Mail/Address.pod lib/perl5/site_perl/Mail/Cap.pm lib/perl5/site_perl/Mail/Cap.pod lib/perl5/site_perl/Mail/Field.pm lib/perl5/site_perl/Mail/Field.pod lib/perl5/site_perl/Mail/Field/AddrList.pm lib/perl5/site_perl/Mail/Field/AddrList.pod lib/perl5/site_perl/Mail/Field/Date.pm lib/perl5/site_perl/Mail/Field/Date.pod lib/perl5/site_perl/Mail/Field/Generic.pm lib/perl5/site_perl/Mail/Field/Generic.pod lib/perl5/site_perl/Mail/Filter.pm lib/perl5/site_perl/Mail/Filter.pod lib/perl5/site_perl/Mail/Header.pm lib/perl5/site_perl/Mail/Header.pod lib/perl5/site_perl/Mail/Internet.pm lib/perl5/site_perl/Mail/Internet.pod lib/perl5/site_perl/Mail/Mailer.pm lib/perl5/site_perl/Mail/Mailer.pod lib/perl5/site_perl/Mail/Mailer/qmail.pm lib/perl5/site_perl/Mail/Mailer/rfc822.pm lib/perl5/site_perl/Mail/Mailer/sendmail.pm lib/perl5/site_perl/Mail/Mailer/smtp.pm lib/perl5/site_perl/Mail/Mailer/smtps.pm lib/perl5/site_perl/Mail/Mailer/testfile.pm lib/perl5/site_perl/Mail/Send.pm lib/perl5/site_perl/Mail/Send.pod lib/perl5/site_perl/Mail/Util.pm lib/perl5/site_perl/Mail/Util.pod lib/perl5/site_perl/MailTools.pm lib/perl5/site_perl/MailTools.pod lib/perl5/site_perl/man/man3/Mail::Address.3.gz lib/perl5/site_perl/man/man3/Mail::Cap.3.gz lib/perl5/site_perl/man/man3/Mail::Field.3.gz lib/perl5/site_perl/man/man3/Mail::Field::AddrList.3.gz lib/perl5/site_perl/man/man3/Mail::Field::Date.3.gz lib/perl5/site_perl/man/man3/Mail::Field::Generic.3.gz lib/perl5/site_perl/man/man3/Mail::Filter.3.gz lib/perl5/site_perl/man/man3/Mail::Header.3.gz lib/perl5/site_perl/man/man3/Mail::Internet.3.gz lib/perl5/site_perl/man/man3/Mail::Mailer.3.gz lib/perl5/site_perl/man/man3/Mail::Send.3.gz lib/perl5/site_perl/man/man3/Mail::Util.3.gz lib/perl5/site_perl/man/man3/MailTools.3.gz @owner @group @mode
That matches what I see (today) on the webpage for that port.
Clean up:
$ make clean ===> Cleaning for p5-Mail-Tools-2.21
make makeplist
Let’s try make makeplist:
[freshports@dev-ingress01 ~/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools]$ make makeplist -f ./Makefile PORTSDIR=../../ ===> License ART10 GPLv1+ accepted by the user ===> p5-Mail-Tools-2.21 depends on file: /usr/local/sbin/pkg - found => MailTools-2.21.tar.gz doesn't seem to exist in /var/ports/distfiles/. => /var/ports/distfiles/ is not writable by you; cannot fetch. *** Error code 1 Stop. make: stopped in /var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools
This required fetching the DISTFILES.
From another ssh session, as another user, I ran this:
$ ls -ld /var/ports/distfiles/ drwxr-xr-x 2 root wheel 4 Jun 10 2019 /var/ports/distfiles/ $ sudo chown -R freshports:freshports /var/ports/distfiles/
Let’s try that again:
$ make makeplist -f ./Makefile PORTSDIR=../../ ===> License ART10 GPLv1+ accepted by the user ===> p5-Mail-Tools-2.21 depends on file: /usr/local/sbin/pkg - found => MailTools-2.21.tar.gz doesn't seem to exist in /var/ports/distfiles/. => Attempting to fetch https://cpan.metacpan.org/modules/by-module/Mail/MailTools-2.21.tar.gz MailTools-2.21.tar.gz 56 kB 2943 kBps 00s ===> Fetching all distfiles required by p5-Mail-Tools-2.21 for building ===> Extracting for p5-Mail-Tools-2.21 => SHA256 Checksum OK for MailTools-2.21.tar.gz. ===> Patching for p5-Mail-Tools-2.21 ===> p5-Mail-Tools-2.21 depends on package: p5-TimeDate>=0 - found ===> p5-Mail-Tools-2.21 depends on package: perl5>=5.32.r0<5.33 - found ===> p5-Mail-Tools-2.21 depends on package: perl5>=5.32.r0<5.33 - found ===> Configuring for p5-Mail-Tools-2.21 Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for MailTools Writing MYMETA.yml and MYMETA.json ===> Building for p5-Mail-Tools-2.21 --- blib/lib/.exists --- --- blib/arch/.exists --- --- blib/lib/auto/MailTools/.exists --- --- blib/arch/auto/MailTools/.exists --- --- blib/bin/.exists --- --- blib/script/.exists --- --- blib/man1/.exists --- --- blib/man3/.exists --- --- config --- --- subdirs --- --- dynamic --- --- ppd --- --- pm_to_blib --- --- blibdirs --- --- config --- --- dynamic --- --- linkext --- --- pm_to_blib --- cp lib/Mail/Cap.pm blib/lib/Mail/Cap.pm cp lib/Mail/Send.pm blib/lib/Mail/Send.pm cp lib/Mail/Filter.pm blib/lib/Mail/Filter.pm cp lib/Mail/Field/AddrList.pod blib/lib/Mail/Field/AddrList.pod cp lib/Mail/Cap.pod blib/lib/Mail/Cap.pod cp lib/Mail/Field/Generic.pod blib/lib/Mail/Field/Generic.pod cp lib/MailTools.pm blib/lib/MailTools.pm cp lib/Mail/Mailer/qmail.pm blib/lib/Mail/Mailer/qmail.pm cp lib/Mail/Address.pod blib/lib/Mail/Address.pod cp lib/Mail/Util.pod blib/lib/Mail/Util.pod cp lib/Mail/Mailer/smtp.pm blib/lib/Mail/Mailer/smtp.pm cp lib/Mail/Header.pm blib/lib/Mail/Header.pm cp lib/Mail/Field.pm blib/lib/Mail/Field.pm cp lib/Mail/Filter.pod blib/lib/Mail/Filter.pod cp lib/Mail/Field.pod blib/lib/Mail/Field.pod cp lib/Mail/Mailer/sendmail.pm blib/lib/Mail/Mailer/sendmail.pm cp lib/Mail/Mailer/rfc822.pm blib/lib/Mail/Mailer/rfc822.pm cp lib/Mail/Field/Date.pm blib/lib/Mail/Field/Date.pm cp lib/Mail/Header.pod blib/lib/Mail/Header.pod cp lib/Mail/Field/Date.pod blib/lib/Mail/Field/Date.pod cp lib/Mail/Internet.pod blib/lib/Mail/Internet.pod cp lib/Mail/Mailer.pod blib/lib/Mail/Mailer.pod cp lib/Mail/Field/AddrList.pm blib/lib/Mail/Field/AddrList.pm cp lib/Mail/Mailer/smtps.pm blib/lib/Mail/Mailer/smtps.pm cp lib/Mail/Field/Generic.pm blib/lib/Mail/Field/Generic.pm cp lib/Mail/Internet.pm blib/lib/Mail/Internet.pm cp lib/Mail/Address.pm blib/lib/Mail/Address.pm cp lib/Mail/Mailer/testfile.pm blib/lib/Mail/Mailer/testfile.pm cp lib/Mail/Util.pm blib/lib/Mail/Util.pm cp lib/Mail/Mailer.pm blib/lib/Mail/Mailer.pm cp lib/Mail/Send.pod blib/lib/Mail/Send.pod cp lib/MailTools.pod blib/lib/MailTools.pod --- pure_all --- --- manifypods --- Manifying 13 pod documents --- all --- ===> Staging for p5-Mail-Tools-2.21 ===> p5-Mail-Tools-2.21 depends on package: p5-TimeDate>=0 - found ===> p5-Mail-Tools-2.21 depends on package: perl5>=5.32.r0<5.33 - found ===> Generating temporary packing list Manifying 13 pod documents Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/MailTools.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/MailTools.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Field.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Mailer.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Mailer.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Field.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Address.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Filter.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Cap.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Internet.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Util.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Internet.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Send.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Header.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Header.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Cap.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Send.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Address.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Filter.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Util.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Field/Date.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Field/Generic.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Field/Generic.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Field/AddrList.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Field/Date.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Field/AddrList.pod Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Mailer/qmail.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Mailer/smtps.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Mailer/sendmail.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Mailer/testfile.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Mailer/rfc822.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/Mail/Mailer/smtp.pm Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Send.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Field::Generic.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Util.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Field.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Address.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Field::Date.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Mailer.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Cap.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Internet.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Header.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/MailTools.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Filter.3 Installing /var/ports/var/db/freshports/ports-jail/var/db/repos/PORTS-head/mail/p5-Mail-Tools/work/stage/usr/local/lib/perl5/site_perl/man/man3/Mail::Field::AddrList.3 ====> Compressing man pages (compress-man) /you/have/to/check/what/makeplist/gives/you %%SITE_PERL%%/Mail/Address.pm %%SITE_PERL%%/Mail/Address.pod %%SITE_PERL%%/Mail/Cap.pm %%SITE_PERL%%/Mail/Cap.pod %%SITE_PERL%%/Mail/Field.pm %%SITE_PERL%%/Mail/Field.pod %%SITE_PERL%%/Mail/Field/AddrList.pm %%SITE_PERL%%/Mail/Field/AddrList.pod %%SITE_PERL%%/Mail/Field/Date.pm %%SITE_PERL%%/Mail/Field/Date.pod %%SITE_PERL%%/Mail/Field/Generic.pm %%SITE_PERL%%/Mail/Field/Generic.pod %%SITE_PERL%%/Mail/Filter.pm %%SITE_PERL%%/Mail/Filter.pod %%SITE_PERL%%/Mail/Header.pm %%SITE_PERL%%/Mail/Header.pod %%SITE_PERL%%/Mail/Internet.pm %%SITE_PERL%%/Mail/Internet.pod %%SITE_PERL%%/Mail/Mailer.pm %%SITE_PERL%%/Mail/Mailer.pod %%SITE_PERL%%/Mail/Mailer/qmail.pm %%SITE_PERL%%/Mail/Mailer/rfc822.pm %%SITE_PERL%%/Mail/Mailer/sendmail.pm %%SITE_PERL%%/Mail/Mailer/smtp.pm %%SITE_PERL%%/Mail/Mailer/smtps.pm %%SITE_PERL%%/Mail/Mailer/testfile.pm %%SITE_PERL%%/Mail/Send.pm %%SITE_PERL%%/Mail/Send.pod %%SITE_PERL%%/Mail/Util.pm %%SITE_PERL%%/Mail/Util.pod %%SITE_PERL%%/MailTools.pm %%SITE_PERL%%/MailTools.pod %%SITE_ARCH%%/auto/MailTools/.packlist %%PERL5_MAN3%%/Mail::Address.3.gz %%PERL5_MAN3%%/Mail::Cap.3.gz %%PERL5_MAN3%%/Mail::Field.3.gz %%PERL5_MAN3%%/Mail::Field::AddrList.3.gz %%PERL5_MAN3%%/Mail::Field::Date.3.gz %%PERL5_MAN3%%/Mail::Field::Generic.3.gz %%PERL5_MAN3%%/Mail::Filter.3.gz %%PERL5_MAN3%%/Mail::Header.3.gz %%PERL5_MAN3%%/Mail::Internet.3.gz %%PERL5_MAN3%%/Mail::Mailer.3.gz %%PERL5_MAN3%%/Mail::Send.3.gz %%PERL5_MAN3%%/Mail::Util.3.gz %%PERL5_MAN3%%/MailTools.3.gz $
That list is arguably better than the first list. Here are the issues I see:
- Variables (e.g. %%SITE_PERL%%) are better than actual pathnames because that shows you where things might go, as opposed to the current default configuration.
- Full pathnames are better than variables because you’re looking for an actual file – non developers will want this.
- It is easier to get the output from make generate-plist than make makeplist.
- The output of make generate-plist is more comprehensive (e.g. it includes catalog.mk
- make makeplist requires the DISTFILES
Hmm.