]> pd.if.org Git - zpackage/blob - doc/zpm-script.8
expand docs
[zpackage] / doc / zpm-script.8
1 .TH zpm-script 8 2019-02-15 "ZPM 0.3"
2 .SH NAME
3 zpm-script \- run, set, or list package scripts
4 .SH SYNOPSIS
5 .B zpm script
6 [
7 .B -Fhq
8 ]
9 [
10 .BI -f " pkgfile"
11 ]
12 [
13 .BI -p " phase"
14 ]
15 [
16 .BI -R " rootdir"
17 ]
18 [
19 .BI -o " path"
20 ]
21 [
22 .BI -S " script"
23 ]
24 .I package
25 .SH DESCRIPTION
26 \fBzpm-script\fR
27 runs, sets, or lists package scripts for a package.  The package is a package
28 id, which may be abbreviated.  Despite the name, scripts can be any
29 arbitrary program, though they are usually posix shell scripts.
30 .PP
31 zpm-script runs in one of three modes, run, list, and set.
32 .SS Run Mode
33 In run mode, a script for a given phase is run if it exists.  It is not
34 an error if there is no script for the given package and phase unless
35 the \-F option is given.  Standard output from the script will be redirected
36 to /var/tmp/zpm-script.out, or as specified by the -o option.
37 .PP
38 The script itself will be extracted to /var/tmp/zpm-script, set as executable,
39 and then run.  The script is run with one or two arguments.  The
40 first argument is the package id being installed, removed, or configured.
41 For a package version update (or downgrade) the second argument is
42 the previous version of the package.
43 .TP
44 An example script
45 .EX
46 #!/bin/sh
47
48 echo example and test zpm stage script
49 echo args: "$*"
50 .EE
51 .SS Set Mode
52 Set mode will set the script for a given package and phase to the
53 path given as an additional argument.  If the -h is given, the script
54 is interpreted as a hash to be set directly, and nothing is taken
55 from the filesystem.
56 .SH OPTIONS
57 .TP
58 .BI \-p phase
59 Specify the script phase.  This defaults to all phases for list mode,
60 and configure for running or setting scripts.
61 .TP
62 .B \-f
63 specify the package file to find packages in
64 .TP
65 .B \-h
66 When setting a script, the script is taken as a hex encoded hash, rather
67 than a path to a script.
68 .TP
69 .B \-q
70 Run quietly.
71 .SH EXAMPLES
72 .TP
73 zpm script -f foo-1.0-1.zpm foo
74 Run the configure script for the foo package found in the foo-1.0-1.zpm
75 file.
76 .TP
77 zpm script foo
78 Run the configure script for the (most recent) foo package found
79 in the local database.
80 .SH EXIT STATUS
81 0 on success non zero on failure
82 .SH FILES
83 /var/lib/zpm/local.db
84 .SH ENVIRONMENT
85 ZPMDB
86 .SH AUTHOR
87 Nathan Wagner
88 .SH SEE ALSO
89 .BR zpm (8)