summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/pkg_merge.1
blob: 6964cea6f3b1b9ea097b329c76676ba90c324480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.\"	$OpenBSD: pkg_merge.1,v 1.5 2007/05/31 19:20:26 jmc Exp $
.\" Copyright (c) 2005 Marc Espie <espie@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: May 31 2007 $
.Dt PKG_MERGE 1
.Os
.Sh NAME
.Nm pkg_merge
.Nd merge several packages into a fat package
.Sh SYNOPSIS
.Nm pkg_merge
.Op Fl v
.Fl o Ar filename
.Ar pkg1 pkg2 Op Ar ...
.Sh DESCRIPTION
The
.Nm
command is used to merge
independent packages
.Ar pkg1 ,
.Ar pkg2 ,
.Ar ... ,
into a fat package
.Ar filename
that contains all the information necessary
to install all the packages.
.Pp
The resulting fat package will often be smaller
than the sum of the individual packages, as
identical files will be shared.
For instance, emacs packages for individual
architectures share most of the contents besides
the emacs binary.
Starting with
.Ox 3.8 ,
.Xr pkg_add 1
handles fat packages transparently.
.Xr pkg_add 1
automatically selects the actual package contents to
install based on package name and architecture.
.Pp
The options are as follows:
.Bl -tag -width opt
.It Fl o Ar filename
Store the result in
.Ar filename .
.It Fl v
Process individual files verbosely, showing what files
get shared in the fat package.
.El
.Sh FILE FORMATS
An
.Ox
package is a tarball conforming to the ustar specification in
Single Unix.
Normal packages always start with a
.Pa +CONTENTS
file (packing-list).
.Pp
Fat packages start with a list of
.Pa a/+CONTENTS ,
.Pa b/+CONTENTS ,
.Pa ...
(packing-lists for the individual packages).
.Pp
.Xr pkg_add 1
performs some minimal parsing on these packing-lists
and selects the correct package based on the architecture
and package name.
.Pp
Once the correct package is found,
.Xr pkg_add 1
will only extract files matching the corresponding directory prefix.
.Pp
For instance, if
.Pa b/+CONTENTS
is selected,
.Xr pkg_add 1
will extract files like
.Pa b/foo ,
.Pa ab/foo2 ,
and
.Pa abc/foo3 ,
but not
.Pa a/foo4
(and it will strip the prefix in the process).
.Pp
.Nm
uses some heuristics to try and share as many files as possible.
.Sh SEE ALSO
.Xr pkg_add 1 ,
.Xr pkg_create 1 ,
.Xr package 5
.Sh AUTHORS
.An Marc Espie