Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 May 2019 19:45:42 +0200
From:      mj-mailinglist@gmx.de
To:        freebsd-pkgbase@freebsd.org
Subject:   How is the ${WSTAGEDIR}/METALOG file generated?
Message-ID:  <trinity-cc7a1aad-8f7e-48db-be8e-517979137dd9-1558806342225@3c-app-gmx-bs48>

next in thread | raw e-mail | index | archive | help
As far as i can see, the METALOG file plays an important role in pkgbase,
it is used by the mtree-to-plist.awk script, to generate the per package p=
list
file, e.g runtime.plist, runtime-debug.plist, runtime-manuals.plist, etc.

For the assignment of a file to a package the tag package=3D... seems rele=
vent.
e.g "./etc/mtree/BSD.root.dist type=3Dfile uname=3Droot gname=3Dwheel mode=
=3D0444 size=3D1613 tags=3Dpackage=3Druntime"

I found some places where these tags are defined (https://reviews.freebsd.=
org/D20173),
but how the entries end up in the METALOG file is hard to find. Can somebo=
dy point
me to the relevant places?



To the METALOG file itself, here are some stats from a just finished
"make packages" run (first line #mtree 2.0 removed):

METALOG
=2D------
lines total:         35293
with package tag:    33243
without package tag:  2051
type=3Ddir:             3370
type=3Dfile:           30484
type=3Dlink:            1440


there are a lot of duplicate entries in the file, e.g.
  10x ./usr/share/snmp/mibs type=3Ddir uname=3Droot gname=3Dwheel mode=3D0=
755 tags=3Dpackage=3Druntime
  13x ./usr/share/snmp/defs type=3Ddir uname=3Droot gname=3Dwheel mode=3D0=
755 tags=3Dpackage=3Druntime
  15x ./boot type=3Ddir uname=3Droot gname=3Dwheel mode=3D0755 tags=3Dpack=
age=3Druntime
  79x ./etc type=3Ddir uname=3Droot gname=3Dwheel mode=3D0755 tags=3Dpacka=
ge=3Druntime

This seems not to be a problem, but pkg complains about files/dirs already
added to the package.


The stats for a sort -u METALOG look like this:

METALOG.sortu
=2D------------
lines total:         34640
with package tag:    32598
without package tag:  2042
type=3Ddir:             2884
type=3Dfile:           30316
type=3Dlink:            1440

there are still some semi duplicate entries, they differ only on added tag=
s:
./etc type=3Ddir uname=3Droot gname=3Dwheel mode=3D0755
./etc type=3Ddir uname=3Droot gname=3Dwheel mode=3D0755 tags=3Dpackage=3Dr=
untime
...
./boot/lua type=3Ddir uname=3Droot gname=3Dwheel mode=3D0755
./boot/lua type=3Ddir uname=3Droot gname=3Dwheel mode=3D0755 tags=3Dpackag=
e=3Druntime
...
./etc/devd type=3Ddir uname=3Droot gname=3Dwheel mode=3D0755
./etc/devd type=3Ddir uname=3Droot gname=3Dwheel mode=3D0755 tags=3Dpackag=
e=3Druntime



And one final stat:

the sum of lines in all *.plist files:
cat *.plist | wc -l:             33243
cat *.plist | sort -u | wc -l    32598

Is it neccessary to add package=3D... tags to the above 2051/2042 lines ab=
ove?
Are these files/dirs missing from packages? Directories could be created b=
y
pkg during installation, but i only found the relevant directive in the
runtime.ucl file:
...
directories {
    /dev =3D "y";
    /tmp =3D "y";
...

=2D-
Martin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?trinity-cc7a1aad-8f7e-48db-be8e-517979137dd9-1558806342225>