[go: up one dir, main page]

Menu

[r370]: / trunk / docs / apk_add.xml  Maximize  Restore  History

Download this file

572 lines (503 with data), 16.1 kB

  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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!--
Process this file with an XSLT processor: `xsltproc \
-''-nonet /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\
manpages/docbook.xsl manpage.dbk'. A manual page
<package>.<section> will be generated. You may view the
manual page with: nroff -man <package>.<section> | less'. A
typical entry in a Makefile or Makefile.am is:
DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\
manpages/docbook.xsl
XP=xsltproc -''-nonet
manpage.1: manpage.dbk
$(XP) $(DB2MAN) $<
The xsltproc binary is found in the xsltproc package. The
XSL files are in docbook-xsl. Please remember that if you
create the nroff version in one of the debian/rules file
targets (such as build), you will need to include xsltproc
and docbook-xsl in your Build-Depends control field.
-->
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
<!ENTITY dhfirstname "<firstname>Natanael</firstname>">
<!ENTITY dhsurname "<surname>Copa</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
<!ENTITY dhdate "<date>September 12, 2006</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>1</manvolnum>">
<!ENTITY dhemail "<email>ncopa@users.sourceforge.net</email>">
<!ENTITY dhusername "Natanael Copa">
<!ENTITY dhucpackage "<refentrytitle>APK_ADD</refentrytitle>">
<!ENTITY dhpackage "apk_add">
<!ENTITY apktools "<productname>apk-tools</productname>">
<!ENTITY gnu "<acronym>GNU</acronym>">
<!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
]>
<refentry>
<!--
<refentryinfo>
<address>&dhemail;</address>
<author>&dhfirstname; &dhsurname;</author>
<copyright><year>2005</year><holder>&dhusername;</holder></copyright>
&dhdate;
</refentryinfo>
-->
<refmeta>&dhucpackage; &dhsection;</refmeta>
<refnamediv id="name">
<refname>&dhpackage;</refname>
<refpurpose>a utility for installing software packages</refpurpose>
</refnamediv>
<refsynopsisdiv id="synopsis">
<cmdsynopsis>
<command>&dhpackage;</command>
<arg><option>-dfhInoqrsuv</option></arg>
<arg rep='repeat' choice='plain'>
<replaceable>apkname</replaceable>
</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="description"><title>DESCRIPTION</title>
<para>
The <command>&dhpackage;</command> command is used to install software
packages.
</para>
</refsect1>
<refsect1><title>WARNING</title>
<para>
Since the <command>&dhpackage;</command> command may execute scripts
or programs contained within a package file, your system may be
susceptible to <quote>trojan horses</quote> or other subtle attacks from
miscreants who create dangerous package files.
</para>
<para>
You are advised to verify the competence and identity of those who
provide installable package files.
</para>
</refsect1>
<refsect1 id="options"><title>OPTIONS</title>
<para>
The following command line arguments are supported:
</para>
<variablelist>
<varlistentry>
<term><replaceable>apkname</replaceable></term>
<listitem>
<para>
Specify a full package file, a package name with version, a package
name without version, or a
full <acronym>URI</acronym>. Packages (that
are not local pkgfiles) will be fetched
from <envar>APK_PATH</envar>. If a full <acronym>URI</acronym> is
supplied, dependencies are also fetched from
the same site.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-d</option></term>
<listitem>
<para>
Don't install any dependecies.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-f</option></term>
<listitem>
<para>
Force installation to proceed even if prerequisite packages
are not installed or the requirements script
fails. Although <command>&dhpackage;</command> will still try to
find and auto-install missing prerequisite packages, a failure to
find one will not be
fatal.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-h</option></term>
<listitem>
<para>Show help and exit.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-I</option></term>
<listitem>
<para>
Don't execute any installation
scripts (pre-update, pre-install, post-install or post-update).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option></term>
<listitem>
<para>
Don't actually install a package, just report the steps that
would be taken if it was.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-q</option></term>
<listitem>
<para>
Quiet mode. Supress non-error messages.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-r</option><replaceable>reqby</replaceable></term>
<listitem>
<para>
Register package as required by <replaceable>reqby</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-s</option></term>
<listitem>
<para>
Don't verify the checksum of the package against the index.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-u</option></term>
<listitem>
<para>
Update already installed packages.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option></term>
<listitem>
<para>
Turn on verbose output.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="techical_details"><title>TECHNICAL DETAILS</title>
<para>
If the <replaceable>apkname</replaceable> is not a file in the local file
system and the package is not already
installed, the <command>&dhpackage;</command> utility will fetch the package
to the <filename>$ROOT/var/cache/packages</filename> directory and verify the checksum.
The <command>&dhpackage;</command> utility then runs through the following
sequence to install a package:
</para>
<orderedlist>
<!-- >
<listitem>
<para>
A check is made to determine if the package is already recorded as
installed. If it is, installation is terminated
unless update mode (<option>-u</option>) is specified.
</para>
</listitem>
<listitem>
<para>
If package is not a local file then download the
file to the <filename>$PACKAGES</filename> directory. The
checksum of downloaded file will be checked against the
checksum recorded in the index; if the checksums does not
match, the installation is terminated.
</para>
</listitem>
-->
<listitem>
<para>
Create a unique temporary directory in /usr/tmp, unpack
the package and create
the <filename>$ROOT/var/db/apk/pkgname-ver/CONTENTS</filename> file
where <replaceable>pkgname-ver</replaceable> is the package
name (with version) in question.
</para>
</listitem>
<listitem>
<para>
Remove a downloaded package if <envar>$APK_KEEPCACHE</envar> is
not set.
</para>
</listitem>
<listitem>
<para>
Scan all the package dependencies. If any of these required packages
is not currently installed, an attempt is made to find and install
it; if the missing package cannot be found or installed, the
installation is terminated.
</para>
</listitem>
<listitem>
<para>
If the package is an update for an already installed
package and it contains a <filename>pre-update</filename> file, it
is then executed as
</para>
<para>
<command>sh</command> &nbsp;<filename>pre-update</filename>&nbsp;<replaceable>pkgname-ver</replaceable>&nbsp;<replaceable>pkgname-oldver</replaceable>
</para>
<para>
where <replaceable>pkgname-ver</replaceable> is the package
name (with version) in question
and <replaceable>pkgname-oldver</replaceable> is the currently
installed version of the package.
</para>
<para>
If the <filename>pre-update</filename> script fails, installation
terminates.
</para>
</listitem>
<listitem>
<para>
If the package contains a <filename>pre-install</filename> file, it
is then executed as
</para>
<para>
<command>sh</command>&nbsp;<filename>pre-install</filename>&nbsp;<replaceable>pkgname-ver</replaceable>
<!-- &nbsp;<replaceable>pkgname-oldver</replaceable> -->
</para>
<para>
where <replaceable>pkgname-ver</replaceable> is the package
name (with version) in question
and <replaceable>pkgname-oldver</replaceable> is the currently
installed version of the package.
</para>
<para>
If the <filename>pre-install</filename> script fails, installation
terminates.
</para>
</listitem>
<listitem>
<para>
Register or update all config files in
the <filename>$ROOT/var/lib/apk/default.tdb</filename> <command>sfic</command> database
of the package.
</para>
<para>
The config files are defined by the <envar>$APK_LBUDIRS</envar> envirnoment
variable or <filename>/etc/apk/apk.conf</filename> keyword.
</para>
</listitem>
<listitem>
<para>
Merge the files extracted to <filename>/usr/tmp</filename> into
<filename>$ROOT</filename>. This is done by parsing the temporary
directory and moving files and directories
to <filename>$ROOT</filename>.
</para>
</listitem>
<listitem>
<para>
Create
the <filename>$ROOT/var/db/apk/pkgname-ver/CONTENTS</filename> file
where <replaceable>pkgname-ver</replaceable> is the package
name (with version) in question.
</para>
</listitem>
<!--
<listitem>
<para>
create sha1sums?
</para>
</listitem>
-->
<listitem>
<para>
Any dependencies are recorded or updated in the other
packages' <filename>REQUIRED_BY</filename> list.
</para>
</listitem>
<listitem>
<para>
If the package contains a <filename>post-install</filename> file, it
is then executed as
</para>
<para>
<command>sh</command>&nbsp;<filename>var/db/apk/pkgname-ver/post-install</filename>&nbsp;<replaceable>pkgname-ver</replaceable>
<!-- &nbsp;<replaceable>pkgname-oldver</replaceable> -->
</para>
<para>
where <replaceable>pkgname-ver</replaceable> is the package
name (with version) in question.
</para>
</listitem>
<listitem>
<para>
If package is an update, then remove all files that exist in the old
packages' <filename>CONTENTS</filename> list but not in the
new <filename>CONTENTS</filename> list.
Remove also the old packages' meta
data, the <filename>$ROOT/var/db/apk/pkgname-ver.tar.gz</filename> file.
</para>
</listitem>
<listitem>
<para>
If package is an update and contains a <filename>post-update</filename> file, it
is then executed as
</para>
<para>
<command>sh</command>&nbsp;<filename>var/db/apk/pkgname-ver/post-update</filename>&nbsp;<replaceable>pkgname-ver</replaceable>&nbsp;<replaceable>pkgname-oldver</replaceable>
</para>
<para>
where <replaceable>pkgname-ver</replaceable> is the package
name (with version) in question
and <replaceable>pkgname-oldver</replaceable> is the old version of the package.
</para>
</listitem>
<listitem>
<para>
Finally the <filename>$ROOT/var/db/apk/<replaceable>pkgname-ver</replaceable></filename> directory
is compressed to <filename>$ROOT/var/db/apk/pkgname-ver.tar.gz</filename>
and the temporay directory and the <filename>$ROOT/var/db/apk/pkgname-ver</filename> directory are deleted.
</para>
</listitem>
</orderedlist>
</refsect1>
<refsect1 id="environment"><title>ENVIRONMENT</title>
<variablelist>
<varlistentry>
<term><envar>APK_ADD_TMP</envar></term>
<listitem>
<para>
Directory where <command>&dhpackage;</command> stores
temporary files. Default is <filename>/usr/tmp</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>APK_DATA</envar></term>
<listitem>
<para>
Alternative location for the cached index file.
Default is <filename>$ROOT/var/lib/apk</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>APK_DBDIR</envar></term>
<listitem>
<para>
Alternative location for the installed package database.
Default is <filename>$ROOT/var/db/apk</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>APK_KEEPCACHE</envar></term>
<listitem>
<para>
Downloaded files will not be deleted if this is set to "yes".
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>APK_PATH</envar></term>
<listitem>
<para>
List of <acronym>URI</acronym>'s to remote package repository
mirrors. The <acronym>URI</acronym>'s are separated by a
semicolon (;).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>APKTOOLS_CONF</envar></term>
<listitem>
<para>
Configuration file for the apk-tools suite.
Default is <filename>/etc/apk/apk.conf</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>PACKAGES</envar></term>
<listitem>
<para>
Base directory where <command>apk_add</command> saves downloaded
packages. Default is <filename>$ROOT/var/cache/packages</filename>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="files"><title>FILES</title>
<variablelist>
<varlistentry>
<term><filename>$ROOT/var/cache/packages</filename></term>
<listitem>
<para>
Default location to save downloaded files into.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>$ROOT/var/db/apk</filename></term>
<listitem>
<para>
Default location for the installed package database.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>$ROOT/var/lib/apk/INDEX.sha1.gz</filename></term>
<listitem>
<para>
The cached index file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>$ROOT/var/lib/apk/default.tdb</filename></term>
<listitem>
<para>
The <command>sfic</command> database that contains the default
config files' status.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>/etc/apk.conf</filename></term>
<listitem>
<para>
Default location of the apk-tools configuration file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>/usr/tmp</filename></term>
<listitem>
<para>
Default location for temporary files and directories.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="see_also"><title>SEE ALSO</title>
<para>apk_fetch (1), apk.conf (5)</para>
</refsect1>
</refentry>
<!--
SEE ALSO
pkg_create(1), pkg_delete(1), pkg_info(1), pkg_version(1), mktemp(3),
sysconf(3), mtree(8)
AUTHORS
Jordan Hubbard
CONTRIBUTORS
John Kohl <jtk@rational.com>
BUGS
Hard links between files in a distribution are only preserved if either
(1) the staging area is on the same file system as the target directory
of all the links to the file, or (2) all the links to the file are brack-
eted by @cwd directives in the contents file, and the link names are
extracted with a single tar command (not split between invocations due to
exec argument-space limitations - this depends on the value returned by
sysconf(_SC_ARG_MAX)).
Sure to be others.
-->