Subject: Proposal: new binary package format
To: None <>
From: Matthias Scheler <>
List: tech-pkg
Date: 05/31/1999 00:22:48

with our current format a binary package is an ".tar.gz" archive which
looks like this:

-rw-r--r-- root/wheel      350 May  7 09:45 1999 +CONTENTS
-rw-r--r-- root/wheel       44 May  7 09:45 1999 +COMMENT
-rw-r--r-- root/wheel      364 May  7 09:45 1999 +DESC
-rw-r--r-- tron/krull     3256 Dec 12 18:42 1998 +MTREE_DIRS
-rw-r--r-- root/krull      386 May  7 09:45 1999 +BUILD_VERSION
-rw-r--r-- root/krull      245 May  7 09:45 1999 +BUILD_INFO
-r-xr-xr-x root/wheel    20480 May  7 09:45 1999 bin/ttcp
-r--r--r-- root/wheel     1998 May  7 09:45 1999 man/cat1/ttcp.0.gz
-r--r--r-- root/wheel     1675 May  7 09:45 1999 man/man1/ttcp.1.gz

The first six files are package related private files, the rest is the
plain contents of the package.

The fact that a simple ".tar.gz" is used makes it easy to handle binary
packages without package tools. The disadvantage is a lack of performance
while examing or extracting and additional use of disk space. Many root
disks got filled up by "pkg_add" in the past.

As you can see the files are stored without a prefix like "/usr/pkg" to
allow installation at a different location via pkg_add's "-p" option.
That's the theory because many packages won't work with a different
prefix because there some absolute pathnames compiled into the binaries.
And of course this wahy it is impossible to track files in several
directories (see PR pkg/7649, "postfix" or "wwwoffl" package) e.g. in
"${LOCALBASE}" *and* "${X11BASE}".

Because of the problem above I would like to design a new binary package
format with these features:
- fast access to the private files
  This could be done with two stage archive like e.g. the ".deb" format.
  Such a file can still be extracted with standard tools.
- support for multiple directories
  Simply store files with absolute filenames.

Because we need a redesign of the package tools anyway I would also
like to invent a bunch of new commands for package lists:
- @tree <dirname>
  Track all files, directories and links in the specified directory.
  This could e.g. be used for "share/doc/pkgname".
- @symlink <from> <to>
  To get rid of all those "@exec ln -fs ... ..." lines.
- @config <filename>
  Files with this tag should
  - only be deinstalled if a "complete" package removal is requested
    via a special "make" target or option to "pkg_delete".
  - not be monitored for checksum changes.
  - Not be overwritten during "make install" or "pkg_add".
- @treerm <dirname>
  To get rid of all those "@rm -rf  ..." lines.
Bugs that should be fixed in the package tools:
- Listing symbolic links to directories in a package list doesn't work


Matthias Scheler