sync: make `--clean` optional
[aurutils.git] / man1 / aur-sync.1
blob9767b22ad835e97943b98f0d71e21d016cc6920c
1 .TH AUR-SYNC 1 2022-03-03 AURUTILS
2 .SH NAME
3 aur\-sync \- download and build AUR packages automatically
5 .SH SYNOPSIS
6 .SY "aur sync"
7 .OP \-cfknorSu
8 .IR pkgname ...
9 .YS
11 .SH DESCRIPTION
12 .B aur\-sync
13 downloads and builds AUR packages automatically to a local
14 repository. It can be seen as a high level composition of
15 .B aurutils
16 programs.
17 .B aur\-sync
18 performs the following tasks:
19 .IP \(bu 4
20 Resolve AUR dependencies with
21 .BR aur-depends (1)
22 .IP \(bu 4
23 Retrieve build files with
24 .BR aur-fetch (1)
25 .IP \(bu 4
26 Present build files before their execution with
27 .BR aur\-view (1)
28 .IP \(bu 4
29 Build the packages with
30 .BR aur-build (1)
31 .PP
32 Package names serve as arguments.
33 .PP
34 .B Note:
35 .B aur\-sync
36 does not expose all available functionality from
37 .B aurutils
38 programs. It serves as an example how these programs can interoperate
39 for a fully automated AUR workflow.
41 .SH OPTIONS
42 .TP
43 .B \-\-continue
44 Do not download package files.
46 .TP
47 .BI \-\-ignore= PACKAGE
48 Ignore a package upgrade. Multiple packages can be specified by
49 separating them with a comma, or by repeating the \fB\-\-ignore\fR option.
51 .TP
52 .BI \-\-ignore\-file= FILE
53 Ignore package upgrades listed in
54 .IR FILE .
55 Defaults to
56 .BR $XDG_CONFIG_HOME/aurutils/sync/ignore .
57 Targets are placed on single lines and interpreted as
58 .IR <repository>/<package> .
59 For example:
60 .RS
61 .PP
62 .EX
63 custom/package-foo
64 custom/package-bar
65 custom-testing/package-baz
66 .EE
67 .PP
68 If the
69 .I <repository>
70 prefix is not specified, targets apply to all local repositories.
71 Comments can be specified after a number sign.
72 .RE
74 .TP
75 .BI \-k " NUM" "\fR,\fP \-\-keep\-going=" NUM
76 Keep going until
77 .I NUM
78 packages fail to build
79 .RB ( "ninja -k" ).
81 .I NUM
82 is set to
83 .BR 0 ,
84 continue indefinitely. On failure, a summary is printed of failed and
85 succeeded builds. Requires
86 .B AUR_SYNC_USE_NINJA
87 (see
88 .BR ENVIRONMENT ).
90 .TP
91 .BR \-\-noview ", " \-\-no\-view
92 Do not present build files for inspection.
94 .TP
95 .BR \-u ", " \-\-upgrades
96 Update all obsolete AUR packages in a local repository.
98 .SS Dependency options
99 Build dependencies are resolved with
100 .BR aur\-depends (1).
103 .BR \-\-optdepends
104 Take
105 .B optdepends
106 into account when resolving dependencies.
107 .RB ( "aur\-depends \-\-optdepends" )
110 .BR \-\-nocheck ", " \-\-no\-check
111 Do not handle
112 .BR checkdepends .
113 .RB ( "aur\-build \-\-no\-check" ", " "aur\-depends \-\-no\-checkdepends" )
116 .BR \-\-nograph ", " \-\-no\-graph
117 Do not verify the AUR dependency graph with
118 .BR aur\-graph (1).
121 .BR \-\-nover ", " \-\-no\-ver
122 Disable version checking for packages.
125 .BR \-\-nover\-argv ", " \-\-no\-ver\-argv
126 Disable version checking for packages specified on the command line or
127 upgrade candidates from
128 .BR \-\-upgrades .
129 Version checks for package dependencies remain enabled.
132 .BR \-\-noprovides ", " \-\-no\-provides
133 Do not take virtual dependencies
134 .RB ( provides )
135 in pacman
136 .I sync
137 repositories into account to resolve package dependencies.  Packages
138 specified on the command-line or available as an upgrade
139 .RB ( "aur\-sync \-u" ),
140 are taken as targets regardless of this setting.
143 .BI \-\-provides\-from= DIR1,...
144 Only take specified (comma-separated)
145 .BR pacman (8)
146 repositories into account when checking virtual dependencies. If the
147 same package is provided in multiple repositories, ordering is ignored
148 (for example,
149 .I \-\-provides\-from=a,b
150 is equivalent to
151 .IR \-\-provides\-from=b,a )
152 and dependencies are installed according to the order defined in
153 .BR pacman.conf (5).
154 Packages specified on the command-line or available as an upgrade
155 .RB ( "aur\-sync \-u" ),
156 are taken as targets regardless of this setting.
158 .SS Database options
159 Values for the following options are automatically selected, if a
160 single local repository is defined in
161 .BR pacman.conf (5).
163 .BR aur\-repo (1)
164 for details.
167 .BI \-d " NAME" "\fR,\fP \-\-database=" NAME
168 Use the
169 .I NAME
170 repository. If this option is not specified,
171 .B aur\-sync
172 defaults to the first
173 .I file://\fR
174 repository in
175 .BR pacman.conf (5),
176 or aborts if multiple are available.
179 .BI \-\-root= DIR
180 The location of the repository root. Defaults to the
181 .I Server
182 value of the configured repository.
184 .SS Fetch options
185 If new AUR commits are available,
186 .B aur\-sync
187 discards local (non-commited) changes and merges the new commits with
188 .BR "git\-merge \-\-ff\-only"
189 by default.
190 .RB ( "aur\-fetch \-\-discard" )
192 If a repository has the
193 .B aurutils.rebase
194 .BR git\-config (1)
195 set to
196 .IR true ,
197 discards local changes unconditionally and runs
198 .BR git\-rebase
199 in this specific repository.
200 .RB ( "aur\-fetch \-\-auto" )
202 The default behavior can be modified with the options below.
205 .B \-\-ff
206 Merge new AUR commits with
207 .BR "git\-merge \-\-ff"
208 for all repositories.
209 .RB ( "aur\-fetch \-\-ff" )
212 .B \-\-rebase
213 Merge new AUR commits with
214 .BR "git\-rebase"
215 for all repositories.
218 .B \-\-reset
219 Discard local changes and commits with
220 .BR "git\-reset"
221 for all repositories.
222 .RB ( "aur\-fetch \-\-reset" )
224 .SS Build options
225 The default build command is
226 .BR "aur-build \-\-syncdeps" .
227 Specifying
228 .BR aur\-build (1)
229 options such as
230 .B \-\-chroot
232 .B \-\-force
234 .B aur\-sync
235 will append these options to the build command. This section only lists
236 common options. See
237 .BR aur\-build (1)
238 for more information.
241 .BR \-c ", " \-\-chroot
242 Build packages in a systemd\-nspawn container.
243 .RB ( "aur build \-c" )
246 .BR \-f ", " \-\-force
247 Continue the build process if a package with the same name exists.
248 .RB ( "aur build \-f" )
250 .TP 
251 .BR \-n ", " \-\-noconfirm ", " \-\-no\-confirm
252 Do not wait for user input when installing or removing build dependencies.
253 .RB ( "aur build \-n" )
256 .BR \-o ", " \-\-nobuild ", " \-\-no\-build
257 Print target packages and their paths instead of building them.
260 .BR \-C ", " \-\-clean
261 Clean up leftover work files and directoreis after a successful build.
262 .RB ( "aur build \-C" )
265 .BR \-\-cleanbuild
266 Remove the source directory before building the package.
267 .RB ( "aur build \-\-cleanbuild" )
270 .BR \-\-pkgver
272 .B "makepkg \-od \-\-noprepare"
273 before the build process.
274 .RB ( "aur\-build \-\-pkgver" )
277 .BR \-r ", " \-\-rmdeps ", " \-\-rm\-deps
278 Remove dependencies installed by makepkg.
279 .RB ( "aur build \-r" )
282 .BR \-S ", " \-\-sign ", " \-\-gpg-sign
283 Sign built packages with
284 .BR gpg (1).
285 .RB ( "aur build \-S" )
288 .B \-\-makepkg\-conf
290 .BR makepkg.conf (5)
291 file for chroot and
292 .BR makepkg (8)
293 operations.
294 .RB ( "aur\-build \-\-makepkg\-conf" )
297 .B \-\-pacman\-conf
299 .BR pacman.conf (5)
300 file for chroot and local repository operations.
301 .RB ( "aur\-build \-\-pacman\-conf" ", " "aur-repo \-\-config" )
303 .SS View options
305 .BI \-\-format= TYPE
307 .I TYPE
309 .B diff
311 .BR log ,
312 generate diffs with
313 .BR git\-diff (1)
315 .BR git\-log (1),
316 respectively.
317 .RB ( "aur\-view \-\-format" )
320 .BI \-\-exclude= FILE
321 Do not include
322 .I FILE
323 in the diff output. Can be specified multiple times.
324 .RB ( "aur\-view \-\-exclude" )
327 .BI \-\-prefix
328 Prepend package names in the diff output instead of
329 .I a/
331 .IR b/ .
332 .RB ( "aur\-view \-\-prefix" )
334 .SH ENVIRONMENT
335 Environment variables for other
336 .B aur
337 programs are also supported in
338 .BR aur\-sync .
339 The below are specific to
340 .BR aur\-sync .
342 .B AURDEST
343 Determines where build files will be cloned. This must be an absolute path.
344 Defaults to
345 .IR $XDG_CACHE_HOME/aurutils/sync .
346 When persisting local modifications
347 with
348 .B \-\-rebase
350 .BR \-\-ff ,
351 it is advised to set a persistent path such as
352 .IR /home/aurpkgs .
355 .B AUR_SYNC_USE_NINJA
356 When set to a positive value, run
357 .B aur\-build
358 command-lines with
359 .BR ninja .
360 If a package fails to build, this allows
361 .B aur\-sync \-\-keep\-going
362 to continue with remaining, independent packages.
366 .IR $AURDEST/ninja-$USER-$$
367 directory contains the
368 .B build.ninja
369 file and timestamps
370 .IB \fR( \fIpkgbase \fR. stamp \fR)
371 for each job. It is removed on successful completion of
372 .BR ninja ,
373 or if
374 .B \-\-no\-build
375 is specified.
378 .SH NOTES
379 .SS Standard input
380 Targets may be taken from stdin using
381 .BR xargs (1).
382 For example, to sync all installed packages in a local repository named
383 .IR custom :
386     $ paclist custom | awk \(aq{print $1}\(aq | xargs \-r aur sync \-\-noconfirm
389 Note that command output interferes with input from the tty. The
390 .B \-\-noconfirm
391 option is used to disable interaction with
392 .B pacman
393 when installing dependencies. Alternatively, command or process substitution
394 can be used:
397     $ xargs \-a <(paclist custom | awk \(aq{print $1}\(aq) aur sync
398     $ aur sync $(paclist custom | awk \(aq{print $1}\(aq)
401 .SS File retrieval
402 When version checks are enabled (i.e. \fB\-\-no\-ver\fR is not specified),
403 build files are only retrieved if the remote (RPC) version is newer
404 than the version in a pacman database. Checks assume there are no
405 mismatches between
406 .B .SRCINFO
408 .B PKGBUILD
409 files.
411 .SS lib32
412 Architecture-specific depends (as introduced with pacman 4.2) are
413 merged with regular depends in RPC queries.
414 .B aur\-sync
415 works around this by stripping the
416 .I lib32\-
417 prefix from packages and removing
418 .I gcc\-multilib
419 if the i686 architecture is detected.
421 .SH SEE ALSO
422 .ad l
424 .BR aur (1),
425 .BR aur\-build (1),
426 .BR aur\-depends (1),
427 .BR aur\-fetch (1),
428 .BR aur\-graph (1),
429 .BR aur\-repo (1),
430 .BR aur\-repo\-filter (1),
431 .BR aur\-vercmp (1),
432 .BR aur\-view (1)
434 .SH AUTHORS
435 .MT https://github.com/AladW
436 Alad Wenter
439 .\" vim: set textwidth=72: