]> pd.if.org Git - zpackage/blob - Commands
rework commands overview
[zpackage] / Commands
1 zpm: always a shell script, that way it can source config files and export environment
2 variables for sub-programs
3
4 Environment Variables
5 ---------------------
6
7 Always set by the zpm wrapper.
8
9 ZPMDB: path to local database
10 ZPMPACKAGE: package name
11 ZPMPKGVER: package version
12 ZPMPKGREL: package release
13
14 Package Selector
15 ----------------
16
17 -p <package name> -V <package version> -R <package release>
18
19 version and release are always the latest available if not specified
20 for new packages, version defaults to 1.0, release to 1, but
21 may also be taken from the environment
22
23 command line over-rides environment, which over-rides defaults
24
25 ZPM Wrapper Script
26 ------------------
27
28 The primary executable is zpm, which is a shell script.  This script
29 sources (if they exist) in order, /etc/zpm.conf ~/.zpmrc
30
31 The script then parses its command line options up until the first non-option,
32 export environment variables, and looks for a command of the form zpm-$1 which
33 it then executes.  If the ZPMPATH is not set, it looks in PATH and if that is
34 not set, in /sbin:/usr/libexec/zpm
35
36         -d <database file>
37         -f <database file> -- they're the same option, just different way of thinking about it
38
39 Low Level Commands
40 ------------------
41
42 Very low level commands to manipulate a database.  These can be used directly,
43 but are primarily intended to be wrapped up in shell scripts.  Each of these
44 should also have an equivalent in the C library API.  The zpm- prefix is omitted below.
45
46 newpackage: add package metadata to a zpm database, creating the target file if
47 needed.
48
49         -N require the target file to not exist (new)
50         -A require the target file to exist (add)
51         -P packager string, should be an email, use ZPMPACKAGER environment
52
53 addtopackage: add a file to a package
54         
55         -C <n> number of leading components to strip
56         -P <path prefix> prefix to strip
57         -H hard coded path, regardless of the source 
58         -T track only, don't import the contents
59         -c flag as configuration file
60         -t <tag list> comma or space separated tags on file
61
62         zpm -f foobar-1.0-1.zpm addtopackage /usr/bin/foo /usr/bin/bar
63         zpm addtopackage foobar-1.1-3.zpm /usr/bin/foo /usr/bin/bar
64         zpm add -f foobar-1.1-3.zpm -p bar /usr/bin/bar
65
66         need to think about the syntax here, but best to just write something,
67         then change it later
68         
69 extract: pull file content to disk
70         $1 is hash or hash prefix if unique, $2 is target path
71
72         As per install(8)
73         -m mode
74         -o owner
75         -g group
76
77         -D don't create leading directories
78
79 list: list package contents
80
81         -F <format> %p path %m mode %o owner %g group %h hash
82         -N don't append a newline to format
83         -0 append a null byte to the format
84
85         default format is '%h %m %o %g %p'
86
87 show: list packages
88         maybe reverse list and show
89
90 drop: delete a package
91
92 delete: remove a file from a package
93
94 adjust: adjust file metadata
95         
96 Higher Level Commands
97 ---------------------
98
99 install: install a package to the local system
100         search repositories known in the local db for a matching package
101 remove: remove a package
102 update: update a package
103
104         -D dry-run, just show what might be done
105
106 export: create a standalone package file from a repo/localdb
107
108 json: dump the metadata of a repo as json
109
110 Repositories
111 ------------
112
113 A repository is just a collection of packages.  All in one DB, or perhaps
114 mark an external file location for package contents.
115
116 Repository Definition is just a url.
117 Has a priority.  Can require trusted signer.  Can require confirmation.
118 Install/Search will ask on tied priorities.  Warn on lower priorities.
119
120 Fetch a repo by getting the json file, or by getting a stripped down DB file.
121
122 repo import: adds repository information from the json file
123 repo drop <url or name>
124 repo add <url> [name]
125 repo refresh: update repository info
126
127 repo command needs to know how to get metadata from local files
128 for http[s] urls, path given should return either json or sqlite db, responsibility
129 of repo to make this work
130
131 Building Packages
132 -----------------
133
134 build: builds a package file
135         -S read paths from stdin
136
137         Reads PKGBUILD in the current directory
138         -b build script path instead of PKGBUILD
139
140 Other Commands
141 --------------
142
143 absorb: pull in the content of a file.  note the mtime if it's a config file, possibly
144 keeping multiple versions
145
146 truncate: drop the content of a file
147
148 status:
149         investigate the status of a repo, reporting things like failed installs or removes,
150         file conflicts, anything else
151
152 integritycheck: compare the stored hashes with the hashes on disk
153
154 note:
155         add a note file, - from stdin, list if none
156
157 edit:
158         edit a note file
159
160 ack:
161         acknowledge a note file
162
163 diff:
164         compare two versions of a package, show what would be done
165         or different
166
167 info:
168         get information on a package
169
170 track:
171         add a package to config tracked packages
172
173 add: add to a repository/database
174
175 clean: clean a repository/database
176