summaryrefslogtreecommitdiffstats
path: root/README.pod
blob: 2ac5b792febc10ea4bdcdbf28a8e5dc0271a5532 (plain)
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
=head1 NAME

expac - alpm data extraction utility

=head1 SYNOPSIS

Usage: I<expac> [options] E<lt>formatE<gt> targets...

=head1 DESCRIPTION

expac is a data extraction tool for alpm databases. It features printf-like
flexibility and aims to be used as a simple tool for other pacman based
utilities which don't link against the library. It uses pacman.conf as a config
file for locating and loading your local and sync databases.

Invoking expac consists of supplying a format string, which is generally
described by one to many of the formatting tokens (see the B<FORMATTING>
section), any relevant options and zero to many targets. The format string
B<must> be the first non-option argument. Targets can be a simple package name,
a query string (in the case of a search), or in repo/package syntax when the
-sync option is supplied.

=head1 OPTIONS

=over 4

=item B<-Q, --query>

Search the local database for provided targets. This is the default behavior.

=item B<-S, --sync>

Search the sync databases for provided targets.

=item B<-s, --search>

Search for packages matching the strings specified by targets. This is a
boolean AND query and regex is allowed.

=item B<-g, --group>

Return packages matching the specified targets as package groups.

=item B<--config> <file>

Read from I<file> for alpm initialization instead of I</etc/pacman.conf>.

=item B<-H, --humansize> <size>

Format package sizes in SI units according to I<size>. Valid options are:

  B, K, M, G, T, P, E, Z, Y

=item B<-1, --readone>

Stop searching after the first result. This only has an effect on -S operations
without -s.

=item B<-d, --delim> <string>

Separate each package with the specified I<string>. The default value is a
newline character.

=item B<-l, --listdelim> <string>

Separate each list item with the specified I<string>. Lists are any interpreted
sequence specified with a capital letter. The default value is two spaces.

=item B<-p, --file>

Interpret targets as paths to local files.

=item B<-t, --timefmt> <format>

Output time described by the specified I<format>. This string is passed directly
to strftime(3). The default format is %c.

=item B<-v, --verbose>

Output more. `Package not found' errors will be shown, and empty field values
will display as 'None'.

=item B<-h, --help>

Display the help message and quit.

=back

=head1 FORMATTING

The format argument allows the following interpreted sequences:

  %B    backup files

  %C    conflicts with

  %D    depends on

  %E    depends on (no version strings)

  %F    files (only with -Q)

  %G    groups

  %L    licenses

  %N    required by

  %O    optional deps

  %o    optional deps (no descriptions)

  %P    provides

  %R    replaces

  %S    provides (no version strings)

  %a    architecture

  %b    build date

  %d    description

  %f    filename (only with -S)

  %g    base64 encoded PGP signature (only with -S)

  %h    sha256sum

  %V    package validation method

  %i    has install scriptlet (only with -Q)

  %k    download size (only with -S)

  %l    install date (only with -Q)

  %m    install size

  %M    modified backup files (only with -Q)

  %n    package name

  %p    packager name

  %r    repo

  %s    md5sum

  %u    project URL

  %v    version

  %w    install reason (only with -Q)

  %!    result number (auto-incremented counter, starts at 0)

  %%    literal %

Note that for any lowercase tokens aside from %m and %k, full printf support is
allowed, e.g. %-20n. This does not apply to any list based, date, or numerical
output.

Standard backslash escape sequences are supported, as per printf(1).

=head1 EXAMPLES

Emulate pacman's search function:

=over 4

  $ expac -Ss '%r/%n %v\n    %d' <search terms>

=back

List the oldest 10 installed packages (by build date):

=over 4

  $ expac --timefmt=%s '%b\t%n' | sort -n | head -10

=back

=head1 AUTHOR

Dave Reisner E<lt>d@falconindy.comE<gt>