Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jul 2013 10:30:59 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        Devin Teske <dteske@freebsd.org>
Cc:        Baptiste Daroussin <bapt@freebsd.org>, "Teske, Devin" <Devin.Teske@fisglobal.com>, Peter Wemm <peter@wemm.org>, "current@FreeBSD.org" <current@freebsd.org>
Subject:   Re: [HEADSUP] No more pkg_install on HEAD by default
Message-ID:  <51E26FD3.4020208@FreeBSD.org>
In-Reply-To: <13CA24D6AB415D428143D44749F57D7201FC4E0D@ltcfiswmsgmb21>
References:  <20130712231637.GS85556@ithaqua.etoilebsd.net> <13CA24D6AB415D428143D44749F57D7201FC2DBD@ltcfiswmsgmb21> <20130713080732.GV85556@ithaqua.etoilebsd.net> <13CA24D6AB415D428143D44749F57D7201FC3AA2@ltcfiswmsgmb21> <13CA24D6AB415D428143D44749F57D7201FC3C92@ltcfiswmsgmb21> <CA%2B7WWSe7C2UXAsEX3OZH7nPJJbxotpQ_iYBxgake4R68sbUtLA@mail.gmail.com> <13CA24D6AB415D428143D44749F57D7201FC3FAA@ltcfiswmsgmb21> <CAGE5yCoH2auer_kKpUT_caFUZPpVM5TdAFH5tJcGgF4Ji12f0g@mail.gmail.com> <13CA24D6AB415D428143D44749F57D7201FC4E0D@ltcfiswmsgmb21>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
------enig2UXUFXREROJBCALBTEAXG
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 14/07/2013 06:48, Teske, Devin wrote:
> Question: Where can I learn more about the actual format of what's in
> the new tarballs? This is going to be important not for bsdconfig,
> but $work (we have our own build platform; I'm going to have to
> rewrite it from mastering PLIST files to mastering YAML MANIFEST
> files and I want to know all the gritty details).

We do need a pkg-manifest(5) man page, which can double as a
pkg-tarball(5) page since the manifest file is where most of the
interesting bits are.

A pkg tarball is a compressed tar archive like so:

lucid-nonsense:...cache/pkg/All:% tar -tvf pkg-1.1.4.txz
-rw-r--r--  0 root   wheel     530 Jan  1  1970 +COMPACT_MANIFEST
-rw-r--r--  0 root   wheel    6385 Jan  1  1970 +MANIFEST
-rw-r--r--  0 root   wheel   17567 Jan  1  1970 +MTREE_DIRS
-r--r--r--  0 root   wheel   19453 Jul  7 12:26
/usr/local/etc/bash_completion.d/_pkg.bash
-r-xr-xr-x  0 root   wheel     629 Jul  7 12:26
/usr/local/etc/periodic/daily/400.status-pkg
-r-xr-xr-x  0 root   wheel     823 Jul  7 12:26
/usr/local/etc/periodic/daily/411.pkg-backup
-r-xr-xr-x  0 root   wheel     678 Jul  7 12:26
/usr/local/etc/periodic/daily/490.status-pkg-changes
-r-xr-xr-x  0 root   wheel    2558 Jul  7 12:26
/usr/local/etc/periodic/security/410.pkg-audit
-r-xr-xr-x  0 root   wheel     611 Jul  7 12:26
/usr/local/etc/periodic/security/460.pkg-checksum
-r--r--r--  0 root   wheel     839 Jul  7 12:26
/usr/local/etc/pkg.conf.sample
-r--r--r--  0 root   wheel   43432 Jul  7 12:26 /usr/local/include/pkg.h
-r--r--r--  0 root   wheel  727558 Jul  7 12:26 /usr/local/lib/libpkg.a
lrwxr-xr-x  0 root   wheel       0 Jul  7 12:26 /usr/local/lib/libpkg.so
-> libpkg.so.1
-r--r--r--  0 root   wheel 1227064 Jul  7 12:26 /usr/local/lib/libpkg.so.=
1
-rw-r--r--  0 root   wheel     187 Jul  7 12:26
/usr/local/libdata/pkgconfig/pkg.pc
[... etc ...]

There must at least be a +MANIFEST -- other meta data files are
optional.  +COMPACT_MANIFEST is a subset of the full +MANIFEST.  They're
both YAML documents.  +COMPACT_MANIFEST looks like this, for example:

---
name: pkg
version: 1.1.4
origin: ports-mgmt/pkg
comment: New generation package manager
arch: freebsd:9:x86:64
www: http://wiki.freebsd.org/pkgng
maintainer: portmgr@FreeBSD.org
prefix: /usr/local
licenselogic: single
licenses:
- BSD
flatsize: 6311507
desc: |
  New Generation package management tool for FreeBSD

  WWW: http://wiki.freebsd.org/pkgng
categories:
- ports-mgmt
shlibs_required:
- libpkg.so.1
shlibs_provided:
- libpkg.so.1
message: |
  If you are upgrading from the old package format, first run:

    # pkg2ng

+MTREE_DIRS is a compatibility thing with the old pkg_tools.  It's not
needed in general as +MANIFEST can provide all that meta data itself.
It isn't going to be deprecated for at least as long as the ports tree
continues to support pkg_tools though.

Beyond that, the rest of the pkg tarball just contains a tar archive of
all the files, directories, sym-links etc to be installed by the
package.  Note that pkg(8) has no problem with creating an empty
directory for a package, unlike pkg_tools.

Now, while you can grovel through the details of pkg tarballs and
internal data formats like this, be aware: the format of the manifest
and the details of the meta-data included in the pkg-tarballs is subject
to change without warning as we develop pkg(8) further.  We only promise
API stability through the pkg(8) commands or for the libpkg.so library
functions; reports of breakage from usage outside those APIs will
receive little sympathy.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey



------enig2UXUFXREROJBCALBTEAXG
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlHib9MACgkQ8Mjk52CukIyf4ACdGb7Oik3jYlO2kx0prlCpHx2T
twIAnjhOaHxL6G1se3F9ilhUTALQftXE
=qweq
-----END PGP SIGNATURE-----

------enig2UXUFXREROJBCALBTEAXG--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51E26FD3.4020208>