This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
package-manager.txt
245 lines (200 loc) · 14.9 KB
/
package-manager.txt
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
KISS Package Manager
________________________________________________________________________________
The KISS package manager is a small, self-contained POSIX shell script with an
emphasis on portability.
Source: $/kisslinux/kiss
[000] Index
________________________________________________________________________________
* Usage .................................................................. [001]
* Dependencies ........................................................... [002]
* Configuration .......................................................... [003]
* Package Manager Hooks .................................................. [004]
* Usage ................................................................ [005]
* List Of Hooks ........................................................ [006]
* Package Manager Extensions ............................................. [007]
[001] Usage
________________________________________________________________________________
+------------------------------------------------------------------------------+
| kiss |
+------------------------------------------------------------------------------+
| |
| -> kiss [a|b|c|d|i|l|r|s|u|v] [pkg]... |
| -> alternatives List and swap alternatives |
| -> build Build packages |
| -> checksum Generate checksums |
| -> download Download sources |
| -> install Install packages |
| -> list List installed packages |
| -> remove Remove packages |
| -> search Search for packages |
| -> update Update the system |
| -> version Package manager version |
| |
+------------------------------------------------------------------------------+
[002] Dependencies
________________________________________________________________________________
+-----------------------+-------------------------------------------+----------+
| Dependency | Reason for use | Required |
+-----------------------+-------------------------------------------+----------|
| | | |
| POSIX utilities | N/A | Yes |
| git | Remote repositories and git sources | Yes [1] |
| curl | Source downloads | Yes |
| gnupg1 or gnupg2 | Repository signing | No |
| openssl | Checksums | Yes [2] |
| tar | Sources, packages, etc | Yes [3] |
| gzip, bzip2, xz, zstd | Tarball compression | Yes [4] |
| su, sudo, doas, ssu | Privilege escalation | No [5] |
| ldd | Dependency Fixer | No [6] |
| readelf | Dependency Fixer (better edition) | No [6] |
| strip | Binary Stripping | No [6] |
| | | |
+-----------------------+-------------------------------------------+----------+
[1] Git is also required for contribution to the distribution itself. Strictly
speaking, nothing forces you to use git. Remote repositories and git based
sources will simply become unusable.
[2] There is no standard utility for the generation of sha256 checksums. While
openssl is listed above, the package manager also supports sha256sum,
sha256, shasum, and digest as fallbacks.
[3] The tar command has no standard! The POSIX equivalent is "pax" though this
has its own issues (-s is unclear about links). Our usage of tar is merely,
cf, xf and tf. Our usage of tar cannot become any more basic than it is now.
Portability should not be a concern.
Tested tar implementations include: busybox, toybox, sbase, OpenBSD, GNU
and libarchive (though all tar implementations should work in theory).
[4] The first three compression methods are required as 99% of package sources
use them as the tarball compression method. Nothing as of yet uses zstd in
the official repositories.
[5] A privilege escalation utility is only needed when installing packages to
a directory owned by another user (user -> root) or (root -> user).
[6] If missing, binary stripping and/or the dependency fixer will be disabled.
[003] Configuration
________________________________________________________________________________
The package manager has no configuration file and no changes need to be made to
the system prior to its use. While there is no configuration file, this does not
mean that there is no possibility for configuration.
The package manager can be configured via the use of environment variables.
+----------------+-------------------------------------------------------------+
| Variable | Description |
+----------------+-------------------------------------------------------------+
| | |
| KISS_CHK | Which utility to use when checksumming sources. |
| | Valid: openssl, sha256sum, sha256, shasum, digest. |
| | |
| KISS_CHOICE | Set to '0' to disable the alternatives system and error on |
| | any detected file conflicts. |
| | |
| KISS_COLOR | Enable/Disable colors. Set to '0' to disable colors. |
| | Color is otherwise disabled when output is not a terminal. |
| | |
| KISS_COMPRESS | Compression method to use for built package tarballs. |
| | Valid: gz (default), bz2, lzma, lz, xz, zst. |
| | |
| KISS_DEBUG | Keep temporary directories around for debugging purposes. |
| | Set to '1' to enable. |
| | |
| KISS_ELF | Which readelf command to use. |
| | Valid: readelf (default), readelf-*, ldd. |
| | |
| KISS_FORCE | Force installation/removal of packages by bypassing |
| | dependency checks, etc. Set to '1' to enable. |
| | |
| KISS_GET | Which utility to use when downloading sources. |
| | Valid: aria2c, axel, curl, wget, wget2. |
| | |
| KISS_HOOK | Hook into the package manager. A colon separated list of |
| | absolute paths to executable files. |
| | |
| KISS_KEEPLOG | Keep build logs around for successful builds and not just |
| | failing ones. Set to '1' to enable. |
| | |
| KISS_PATH | List of repositories. This works exactly like '$PATH' |
| | (a colon separated list of absolute paths). |
| | |
| KISS_PROMPT | Skip all prompts. Set to '0' to say 'yes' to all prompts |
| | from the package manager. |
| | |
| KISS_ROOT | Where installed packages will go. Can be used to install |
| | packages to somewhere other than '/'. |
| | |
| KISS_STRIP | Enable/Disable package stripping globally. |
| | Set to '0' to disable. |
| | |
| KISS_SU | Force usage of a different sudo tool. |
| | NOTE: Tool must support sudo-like arguments. |
| | |
| KISS_TMPDIR | Temporary directory for builds. Can be set to a tmpfs so |
| | builds happen in memory. |
| | |
+----------------+-------------------------------------------------------------+
[004] Package Manager Hooks
________________________________________________________________________________
KISS' package manager is extensible via hooks which fire at various different
places inside the utility. Hooks allow the user to modify behavior, add new
features or conditionally do things on a per-package basis.
--[005] Usage ------------------------------------------------------------------
This setting is controlled by the '$KISS_HOOK' environment variable which
takes a colon separated list of absolute file paths to executables.
+----------------------------------------------------------------------------+
| |
| export KISS_HOOK=$HOME/.local/bin/kiss-hook:/path/to/other/hook |
| |
+----------------------------------------------------------------------------+
--[006] List of hooks ----------------------------------------------------------
Each hook is executed in the order it appears in KISS_HOOK and is given its
own environment/arguments accordingly. The hooks are documented as follows.
+---------------+--------+----------+--------------------+-------------------+
| hook | arg1 | arg2 | arg3 | arg4 |
+---------------+--------+----------+--------------------+-------------------+
| | | | | |
| build-fail | Type | Package | Build directory | |
| post-build | Type | Package | DESTDIR | |
| post-install | Type | Package | Installed database | |
| post-package | Type | Package | Tarball | |
| post-source | Type | Package | Verbatim source | Resolved source |
| post-update | Type | [7] | | |
| pre-build | Type | Package | Build directory | |
| pre-extract | Type | Package | DESTDIR | |
| pre-install | Type | Package | Extracted package | |
| pre-remove | Type | Package | Installed database | |
| pre-source | Type | Package | Verbatim source | Resolved source |
| pre-update | Type | [7] [8] | | |
| queue-status | Type | Package | Number in queue | Total in queue |
| | | | | |
+---------------+--------+----------+--------------------+-------------------+
[7] The -update hooks start in the current repository. In other words, you can
operate on the repository directly or grab the value from '$PWD'.
[8] The second argument of pre-update is '0' if the current user owns the
repository and '1' if they do not. In the latter case, privilege
escalation is required to preserve ownership.
[007] Package Manager Extensions
________________________________________________________________________________
Anything in the user's '$PATH' which matches the glob 'kiss-*' will be directly
usable via the package manager. For example, 'kiss-size' is also usable as
'kiss size' (and even 'kiss si') (the shortest available alias).
The detected 'kiss-*' utilities will appear in the package manager's help-ext
output with the second line in the script acting as a doc-string.
Example help output:
+------------------------------------------------------------------------------+
| kiss help-ext |
+------------------------------------------------------------------------------+
| |
| -> Installed extensions (kiss-* in $PATH) |
| -> chroot Enter a kiss chroot |
| -> depends Display a package's dependencies |
| -> export Installed package to tarball |
| -> fork Fork a package into the current directory |
| -> help Read KISS documentation |
| -> link Link a repo file to another repo |
| -> maintainer Find the maintainer of a package |
| -> manifest Display all files owned by a package |
| -> new Create a boilerplate package |
| -> orphans List orphaned packages |
| -> outdated Check repository packages for updates |
| -> owns Check which package owns a file |
| -> preferred Lists the owners of all files with conflicts |
| -> revdepends Packages which depend on package |
| -> repo-orphans List packages which aren't present in any repository |
| -> size Show the size on disk for a package |
| |
+------------------------------------------------------------------------------+