Skip to content

Commit 3e8b344

Browse files
committed
docs(package): Add alpm-files specification
Fixes: https://gitlab.archlinux.org/archlinux/alpm/alpm/-/issues/53 Fixes: https://gitlab.archlinux.org/archlinux/alpm/alpm/-/issues/27 Signed-off-by: Orhun Parmaksız <[email protected]>
1 parent 20ffe69 commit 3e8b344

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# NAME
2+
3+
alpm-files - File format for listing files and directories contained in an **alpm-package**.
4+
5+
# DESCRIPTION
6+
7+
The **alpm-files** format is a textual format that lists the directories and files contained in a single **alpm-package**.
8+
9+
Such files are named **files** and are located in **alpm-repo-database** files as well as **libalpm** databases structures.
10+
They are created by package repository management software (such as **dbscripts** [1]).
11+
Package management software (e.g. **pacman**) uses them to list and query the paths of directories and files contained in a package file.
12+
13+
## General Format
14+
15+
An **alpm-files** file is a UTF-8 encoded, newline-delimited file.
16+
It contains a single section header and zero or more section entries.
17+
Empty lines are ignored.
18+
Comments are not supported.
19+
20+
The first line must be the string literal `%FILES%`, which represents the section header.
21+
22+
All subsequent lines are interpreted as section entries, one per line, sorted in lexical order.
23+
Each section entry represents either a single file or directory path.
24+
The following formatting rules apply to the paths:
25+
26+
- Directories are always listed with a trailing slash (`/`).
27+
- All paths are relative to the system root (i.e., `/usr/bin/foo` is represented as `usr/bin/foo`).
28+
29+
# EXAMPLES
30+
31+
The following is an example of a **alpm-files** file for a package named `foo`:
32+
33+
```text
34+
%FILES%
35+
usr/
36+
usr/bin/
37+
usr/bin/foo
38+
usr/share/
39+
usr/share/bash-completion/
40+
usr/share/bash-completion/completions/
41+
usr/share/bash-completion/completions/foo
42+
usr/share/doc/
43+
usr/share/doc/foo/
44+
usr/share/doc/foo/README.md
45+
usr/share/fish/
46+
usr/share/fish/vendor_completions.d/
47+
usr/share/fish/vendor_completions.d/foo.fish
48+
usr/share/licenses/
49+
usr/share/licenses/foo/
50+
usr/share/licenses/foo/LICENSE-MIT
51+
usr/share/zsh/
52+
usr/share/zsh/site-functions/
53+
usr/share/zsh/site-functions/_foo
54+
```
55+
56+
The installed package will contain a binary (`usr/bin/foo`), a README file (`usr/share/doc/foo/README.md`), and a license file (`usr/share/licenses/foo/LICENSE-MIT`), among other files such as completion scripts for various shells.
57+
58+
# SEE ALSO
59+
60+
**libalpm**(3), **alpm-package**(7), **alpm-repo-database**(7), **pacman**(8)
61+
62+
# NOTES
63+
64+
1. **dbscripts**
65+
66+
https://gitlab.archlinux.org/archlinux/dbscripts/

resources/docs/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
- [alpm-architecture](./specifications/alpm-architecture.7.md)
3737
- [alpm-comparison](./specifications/alpm-comparison.7.md)
3838
- [alpm-epoch](./specifications/alpm-epoch.7.md)
39+
- [alpm-files](./specifications/alpm-files.5.md)
3940
- [alpm-meta-package](./specifications/alpm-meta-package.7.md)
4041
- [alpm-package](./specifications/alpm-package.7.md)
4142
- [alpm-package-group](./specifications/alpm-package-group.7.md)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../alpm-types/resources/specification/alpm-files.5.md

0 commit comments

Comments
 (0)