This introduces code which has long been maintained at:
https://github.com/falconindy/expac
>From the README:
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.
---
v2:
* use alpm_pkgfrom_t instead of homegrown enum
* silently skip output when strftime fails
* split input from stdin on newlines only
doc/Makefile.am| 7 +-
doc/expac.1.asciidoc | 179 +
src/pacman/.gitignore | 2 +
src/pacman/Makefile.am | 8 +-
src/pacman/expac.c | 858 +
5 files changed, 1051 insertions(+), 3 deletions(-)
create mode 100644 doc/expac.1.asciidoc
create mode 100644 src/pacman/expac.c
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 2ac38cba..38f7077b 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -16,7 +16,8 @@ MANPAGES = \
makepkg.conf.5 \
pacman.conf.5 \
libalpm.3 \
- BUILDINFO.5
+ BUILDINFO.5 \
+ expac.1
DOXYGEN_MANS = $(wildcard man3/*.3)
@@ -32,7 +33,8 @@ HTML_MANPAGES = \
PKGBUILD.5.html \
makepkg.conf.5.html \
pacman.conf.5.html \
- libalpm.3.html
+ libalpm.3.html \
+ expac.1.html
HTML_OTHER = \
index.html \
@@ -61,6 +63,7 @@ EXTRA_DIST = \
pacman.conf.5.asciidoc \
BUILDINFO.5.asciidoc \
libalpm.3.asciidoc \
+ expac.1.asciidoc \
footer.asciidoc \
index.asciidoc \
submitting-patches.asciidoc \
diff --git a/doc/expac.1.asciidoc b/doc/expac.1.asciidoc
new file mode 100644
index ..f5ec3adf
--- /dev/null
+++ b/doc/expac.1.asciidoc
@@ -0,0 +1,179 @@
+expac(1)
+=
+
+Name
+
+expac - alpm data extraction utility
+
+Synopsis
+
+'expac' [options]
+
+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 'FORMATTING'
+section), any relevant options and zero to many targets. The format string
+'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.
+
+
+Options
+---
+*-Q, \--query*::
+ Search the local database for provided targets. This is the default
behavior.
+
+*-S, \--sync*::
+ Search the sync databases for provided targets.
+
+*-s, --search*::
+ Search for packages matching the strings specified by targets. This is a
+ boolean AND query and regex is allowed.
+
+*-g, --group*::
+ Return packages matching the specified targets as package groups.
+
+*\--config* ::
+ Read from for alpm initialization instead of .
+
+*-H, \--humansize* ::
+ Format package sizes in SI units according to . Valid options are:
++
+B, K, M, G, T, P, E, Z, Y
+
+*-1, \--readone*::
+ Stop searching after the first result. This only has an effect on -S
operations
+ without -s.
+
+*-d, \--delim *::
+ Separate each package with the specified . The default value is
a
+ newline character.
+
+*-l, \--listdelim* ::
+ Separate each list item with the specified . Lists are any
interpreted
+ sequence specified with a capital letter. The default value is two
spaces.
+
+*-p, \--file*::
+ Interpret targets as paths to local files.
+
+*-t, \--timefmt* ::
+ Output time described by the specified . This string is passed
directly
+ to linkman:strftime[3]. The default format is %c.
+
+*-v, \--verbose*::
+ Output more. `Package not found' errors will be shown, and empty field
values
+ will display as 'None'.
+
+*-h, \--help*::
+
+Display the help message.
+
+*-V, \--version*::
+
+Display version information.
+
+Formatting
+--
+
+The format argument allows the following interpreted sequences:
+
+ %Bbackup files
+
+ %Cconflicts with (no version strings)
+
+ %Ddepends on
+
+ %Edepends on (no version strings)
+
+ %Ffiles (only with -Q)
+
+ %Ggroups
+
+ %Hconflicts with
+
+ %Llicenses
+
+ %Nrequired by
+
+ %Ooptional deps
+
+ %ooptional deps (no descriptions)
+
+ %Pprovides
+
+ %Rreplaces (no version strings)
+
+ %Treplaces
+
+ %Sprovides (no version strings)
+
+ %aarchitecture
+
+ %bbuild date
+
+ %ddescription
+
+ %epackage base
+
+ %ffilename (only with -S)
+
+ %gbase64 encoded PGP signature (only with -S)
+
+ %hsha256sum