forked from aurutils/aurutils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaur.1
495 lines (491 loc) · 9.43 KB
/
aur.1
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
.TH AUR 1 2021-12-06 AURUTILS
.SH NAME
aur \- helper tool for the arch user repository
.
.SH DESCRIPTION
.BR aur (1)
is the command wrapper for
.BR aurutils ,
a collection of scripts to automate usage of the Arch User
Repository. Different tasks such as update checks, package searching,
and computing dependencies are split to separate commands.
.PP
The chosen approach for managing packages is local pacman
repositories, instead of foreign (installed by
.BR "pacman \-U" )
packages.
.PP
A brief overview of local repositories is given in the
.B "CREATING A LOCAL REPOSITORY"
section.
.
.SH AUR COMMANDS
The below gives a short overview; see the respective documentation for
details.
.PP
.BR aur (1)
searches for commands in
.BR /usr/lib/aurutils/
by default, followed by
.B $PATH
as set in the environment. A different path may be set at run-time
through the
.B AUR_EXEC_PATH
environment variable, for example
.IR /usr/local/lib/aurutils:/usr/lib/aurutils .
.
.P
.BR aur\-build (1)
.RS 4
Build packages to a local repository.
.RE
.
.P
.BR aur\-chroot (1)
.RS 4
Build pacman packages with systemd-nspawn.
.RE
.
.P
.BR aur\-depends (1)
.RS 4
Retrieve dependencies using aurweb.
.RE
.
.P
.BR aur\-fetch (1)
.RS 4
Fetch packages from a location.
.RE
.
.P
.BR aur\-graph (1)
.RS 4
Print package/dependency directed graph.
.RE
.
.P
.BR aur\-pkglist (1)
.RS 4
Print the AUR package list.
.RE
.
.P
.BR aur\-query (1)
.RS 4
Send GET requests to the aurweb RPC interface.
.RE
.
.P
.BR aur\-repo (1)
.RS 4
Manage local repositories.
.RE
.
.P
.BR aur\-repo\-filter (1)
.RS 4
Filter packages in the Arch Linux repositories.
.RE
.
.P
.BR aur\-search (1)
.RS 4
Search for AUR packages.
.RE
.
.P
.BR aur\-srcver (1)
.RS 4
List version of VCS packages.
.RE
.
.P
.BR aur\-sync (1)
.RS 4
Download and build AUR packages automatically.
.RE
.
.P
.BR aur\-vercmp (1)
.RS 4
Check packages for AUR updates.
.RE
.
.P
.BR aur\-view (1)
.RS 4
Inspect
.BR git (1)
repositories.
.RE
.
.SH EXIT STATUS
Programs follow a subset of errno(3), or preserve command status where
applicable.
.
.SH ENVIRONMENT
Environment variables for
.B aur
programs are prefixed with
.BR AUR .
Where applicable, standard variables such as
.B XDG_CONFIG_HOME
are respected. Variables supported by specific programs are listed
in their respective man pages (see
.BR "AUR COMMANDS" ).
.PP
Variables can be set in the user environment or in
.IR $XDG_CONFIG_HOME/aurutils/env ,
using a key/value format separated by newlines. For example:
.PP
.RS
.EX
AURDEST=/home/custompkgs
AUR_PACMAN_AUTH=sudo --askpass
AUR_PAGER=ranger
AUR_REPO=custom
.EE
.RE
.
.TP
.B AUR_DEBUG
Setting this variable enables debug mode (typically
.B xtrace
for
.BR bash (1)
scripts) in
.B aur
programs.
.
.TP
.B AUR_EXEC_PATH
The path in which
.B aur
searches for commands, prepended to
.BR $PATH .
Defaults to
.BR /usr/lib/aurutils .
.
.TP
.B NO_COLOR
Output colorization can be disabled by setting this environment
variable.
.
.SH CREATING A LOCAL REPOSITORY
A local repository may be configured directly in
.BR /etc/pacman.conf ,
or in a separate file specified with the
.B Include
directive. This section documents an example configuration; for
details, consult the
.BR pacman.conf (5)
man page.
.
.TP
.B Note:
Avoid naming the repository
.IR local ,
as this name is reserved by
.BR pacman (8).
.
.TP
.B Tip:
Consider separate repositories for different purposes, such as
version control packages.
.
.SS Pacman configuration
For the purposes of this example, we assume the local repository
.I custom
is located in
.IR /home/custompkgs .
.PP
Append a section for the local repository to
.IR /etc/pacman.conf
.PP
.EX
[custom]
SigLevel = Optional TrustAll
Server = file:///home/custompkgs
.EE
.PP
Create the repository root and database:
.PP
.EX
$ sudo install \-d /home/custompkgs \-o $USER
$ repo\-add /home/custompkgs/custom.db.tar.gz
.EE
.PP
If built packages are available, add them to the database:
.PP
.EX
$ cd /home/custompkgs
$ repo\-add \-n custom.db.tar.gz *.pkg.tar*
.EE
.PP
Synchronize pacman:
.PP
.EX
$ sudo pacman \-Syu
.EE
.
.SS CacheDir (optional)
When packages from a local repository are installed through
.BR "pacman \-S" ,
they are copied to a cache directory (usually
.IR /var/cache/pacman/pkg )
by
.BR pacman .
Besides using additional space, this may result in checksum mismatches
when rebuilding packages without increasing
.BR pkgrel .
(See GitHub issue #85)
.PP
To avoid this, set the repository path as a
.B pacman
.IR CacheDir ,
together with the
.B "CleanMethod = KeepCurrent"
setting to avoid unexpected deletion of built packages with
.BR "pacman \-Sc" .
.PP
This can be done by editing
.IR /etc/pacman.conf
as follows:
.PP
.EX
[options]
CacheDir = /var/cache/pacman/pkg /home/custompkgs
CleanMethod = KeepCurrent
.EE
.PP
In addition,
.B SigLevel
should be set to
.B Never
or
.BR Always ,
if package signing is disabled or enabled, respectively. This avoids
.B pacman
copying over packages to the main
.BR CacheDir ,
if signature files are missing and
.B SigLevel = Optional
is set. (FS#71109)
.PP
Note that
.BR "pacman \-Scc"
will remove packages regardless of the
.B CleanMethod
setting.
.
.SH EXAMPLES
In this section, we assume that
.BR bash (1)
is the interactive shell.
.
.SS Arch User Repository
Run actions on the dependency tree of an AUR package:
.PP
.EX
$ aur depends foo | while read \-r pkg; do ... done
.EE
.PP
Retrieve AUR packages and their dependencies recursively:
.PP
.EX
$ aur depends --pkgbase foo | aur fetch -
.EE
.PP
Retrieve all AUR packages from a given maintainer:
.PP
.EX
$ aur search -m mcaur --table | cut -f2 | uniq -u | aur fetch -
.EE
.PP
Build
.I plasma\-desktop\-git
and its dependencies with
.BR systemd\-nspawn (1):
.PP
.EX
$ aur sync \-c plasma\-desktop\-git
.EE
.PP
Update all AUR packages in a single local repository:
.PP
.EX
$ aur sync \-u
.EE
.PP
Check foreign packages for AUR updates:
.PP
.EX
$ pacman \-Qm | aur vercmp
.EE
.PP
Check the
.I custom
repository for AUR updates:
.PP
.EX
$ aur repo \-d custom \-\-list | aur vercmp
.EE
.PP
If
.B pacman.conf
only contains one local repository, the above may be shortened to:
.PP
.EX
$ aur repo \-\-upgrades
.EE
.
.
.SS Arch User Repository - advanced usage
Print packages from the
.I custom
repository that are unavailable in the AUR:
.PP
.EX
$ grep \-Fxvf <(aur pkglist) <(pacman \-Slq custom)
.EE
.PP
As above, but for orphaned packages:
.PP
.EX
$ pacman \-Slq custom | aur query \-t info - | \e
jq \-r \(aq.[].results[] | select(.Maintainer == null)\(aq
.EE
.PP
Update packages in the
.I custom
repository which are installed on the host:
.PP
.EX
$ grep \-Fxf <(pacman \-Qq) <(pacman \-Slq custom) > installed.txt
$ xargs \-a installed.txt aur sync \-d custom
.EE
.PP
Search for AUR packages with both
.I wm
and
.I git
in the name:
.PP
.EX
$ aur pkglist \-P \(aq(?=.*wm)(?=.*git)\(aq | aur search \-i \-
.EE
.PP
Select an AUR package with name matching
.IR pony ,
and build the result:
.PP
.EX
$ select a in $(aur pkglist \-F pony); do aur sync "$a"; break; done
.EE
.
.SS Official repositories
Print Perl modules that are both in the AUR and official repositories:
.PP
.EX
$ aur pkglist \-P \(aq^perl\-.+\(aq > perl.txt
$ grep \-Fxf <(aur repo\-filter < perl.txt) perl.txt
.EE
.PP
Print packages both in AUR and
.I [community]
and compare their versions:
.PP
.EX
$ aur repo \-d community \-\-all
.EE
.
.SS Using PKGBUILDs
Build packages in the
.I pkgbuilds
github repository (generating required
.B .SRCINFO
files):
.PP
.EX
$ git clone https://www.github.com/Earnestly/pkgbuilds
$ cd pkgbuilds
$ find \-name PKGBUILD \-execdir sh \-c \(aqmakepkg \-\-printsrcinfo > .SRCINFO\(aq \e;
$ aur graph */.SRCINFO | tsort | tac > queue # Remove unwanted targets
$ aur build \-a queue
.EE
.PP
Build a package for a different architecture, here \fIi686\fR:
.PP
.EX
$ setarch i686 aur sync \-c \-\-repo=custom_i686 tclkit
.EE
.
.
.SS Custom commands
The following scripts are examples of custom commands added anywhere
in $PATH, for example
.IR /usr/local/bin .
.PP
.BR aur\-gc
.PP
.EX
#!/bin/bash
# Remove unused build files in aur\-sync cache
XDG_CACHE_HOME=${XDG_CACHE_HOME:\-$HOME/.cache}
AURDEST=${AURDEST:\-$XDG_CACHE_HOME/aurutils/sync}
# Assumes build files were retrieved through git(1)
find "$AURDEST" \-name .git \-execdir git clean \-xf \e;
# Print directories which do not contain a PKGBUILD file
for d in "$AURDEST"/*; do
[[ \-f $d/PKGBUILD ]] || printf \(aq%s\en\(aq "$d"
done
.EE
.
.PP
.BR aur\-remove
.PP
.EX
#!/bin/sh \-\-
# aur\-remove \- remove listed packages from all local repositories
if [ "$#" \-eq 0 ]; then
printf \(aqusage: aur remove package [package ...]\en\(aq >&2
exit 1
fi
aur repo \-\-list\-path | while read \-r repo_path; do
repo\-remove "$repo_path" "$@"
paccache \-c "${repo_path%/*}" \-rvk0 "$@"
done
.EE
.
.SS Using third-party helpers
Repository packages can be "made foreign" by temporarily removing the
repository from the pacman configuration. This can be used with programs
that support the
.B PACMAN
environment variable and check foreign packages for AUR updates.
.PP
For example, create the
.I mypacman
script in
.IR /usr/local/bin/mypacman :
.PP
.EX
#!/bin/sh
pacman \-\-config=/usr/share/devtools/pacman\-extra.conf "$@"
.EE
.PP
and point the
.B PACMAN
variable towards it:
.PP
.EX
$ export PACMAN=/usr/local/bin/mypacman
.EE
.
.SH AUTHORS
.MT https://github.com/AladW
Alad Wenter
.ME
.
.\" vim: set textwidth=72