pacman-debian 7.3.10 → 7.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +52 -463
  2. package/README_zh-CN.md +50 -492
  3. package/dist/ar.d.ts +8 -0
  4. package/dist/cli/archlinux-java.d.ts +3 -0
  5. package/dist/cli/fix_default.d.ts +3 -0
  6. package/dist/cli/paclink.d.ts +3 -0
  7. package/dist/cli/pacman.d.ts +2 -0
  8. package/dist/cli/update-ca-trust.d.ts +3 -0
  9. package/dist/compress.d.ts +2 -0
  10. package/dist/config.d.ts +3 -0
  11. package/dist/control.d.ts +2 -0
  12. package/dist/core/ar.d.ts +7 -0
  13. package/dist/core/compress.d.ts +4 -0
  14. package/dist/core/control.d.ts +2 -0
  15. package/dist/core/deb.d.ts +4 -0
  16. package/dist/core/deps.d.ts +28 -0
  17. package/dist/core/options.d.ts +19 -0
  18. package/dist/core/pkgfile.d.ts +35 -0
  19. package/dist/core/tar.d.ts +13 -0
  20. package/dist/core/types.d.ts +83 -0
  21. package/dist/database.d.ts +20 -0
  22. package/dist/db/database.d.ts +17 -0
  23. package/dist/db/dpkg-compat.d.ts +19 -0
  24. package/dist/db/dpkg-compat.d.ts.map +1 -1
  25. package/dist/db/dpkg-compat.js +16 -1
  26. package/dist/db/dpkg-compat.js.map +1 -1
  27. package/dist/db/localdb.d.ts +9 -0
  28. package/dist/db/sqlite.d.ts +20 -0
  29. package/dist/deb.d.ts +5 -0
  30. package/dist/dpkg-compat.d.ts +18 -0
  31. package/dist/i18n/index.d.ts +4 -0
  32. package/dist/i18n/paclink/en.d.ts +3 -0
  33. package/dist/i18n/paclink/zh-CN.d.ts +3 -0
  34. package/dist/i18n/setup/en.d.ts +3 -0
  35. package/dist/i18n/setup/zh-CN.d.ts +3 -0
  36. package/dist/index.d.ts +3 -0
  37. package/dist/install.d.ts +2 -0
  38. package/dist/makepkg/build.d.ts +19 -0
  39. package/dist/makepkg/index.d.ts +3 -0
  40. package/dist/makepkg/pkgbuild.d.ts +36 -0
  41. package/dist/ops/install.d.ts +5 -0
  42. package/dist/ops/query.d.ts +9 -0
  43. package/dist/ops/remove.d.ts +4 -0
  44. package/dist/ops/upgrade.d.ts +4 -0
  45. package/dist/pacman.d.ts +2 -0
  46. package/dist/query.d.ts +5 -0
  47. package/dist/remove.d.ts +2 -0
  48. package/dist/repo/config.d.ts +3 -0
  49. package/dist/repo/repository.d.ts +20 -0
  50. package/dist/repository.d.ts +10 -0
  51. package/dist/scripts/pacman-conf.d.ts +3 -0
  52. package/dist/scripts/setup.d.ts +3 -0
  53. package/dist/tar.d.ts +17 -0
  54. package/dist/types.d.ts +80 -0
  55. package/dist/ui/colors.d.ts +13 -0
  56. package/dist/ui/format.d.ts +3 -0
  57. package/dist/ui/progress.d.ts +8 -0
  58. package/dist/ui/prompt.d.ts +4 -0
  59. package/docs/en/architecture.md +188 -0
  60. package/docs/en/configuration.md +84 -0
  61. package/docs/en/installation.md +67 -0
  62. package/docs/en/makepkg.md +38 -0
  63. package/docs/en/paclink.md +73 -0
  64. package/docs/en/usage.md +91 -0
  65. package/docs/en/yay-aur.md +65 -0
  66. package/docs/zh-CN/architecture.md +171 -0
  67. package/docs/zh-CN/configuration.md +80 -0
  68. package/docs/zh-CN/installation.md +65 -0
  69. package/docs/zh-CN/makepkg.md +32 -0
  70. package/docs/zh-CN/paclink.md +70 -0
  71. package/docs/zh-CN/usage.md +90 -0
  72. package/docs/zh-CN/yay-aur.md +44 -0
  73. package/lib/pac4deb/Makefile +26 -0
  74. package/lib/pac4deb/README.md +47 -0
  75. package/lib/pac4deb/include/alpm.h +166 -0
  76. package/lib/pac4deb/include/alpm_list.h +43 -0
  77. package/lib/pac4deb/src/alpm_list.c +120 -0
  78. package/lib/pac4deb/src/genstubs.sh +51 -0
  79. package/lib/pac4deb/src/genstubs2.sh +72 -0
  80. package/lib/pac4deb/src/genstubs3.sh +43 -0
  81. package/lib/pac4deb/src/libalpm.c +964 -0
  82. package/lib/pac4deb/src/stubs_manual.c +452 -0
  83. package/package.json +19 -1
@@ -0,0 +1,80 @@
1
+ export interface DebControl {
2
+ package: string;
3
+ version: string;
4
+ architecture: string;
5
+ maintainer?: string;
6
+ description?: string;
7
+ depends?: string;
8
+ 'pre-depends'?: string;
9
+ 'recommends'?: string;
10
+ 'suggests'?: string;
11
+ conflicts?: string;
12
+ breaks?: string;
13
+ provides?: string;
14
+ 'installed-size'?: string;
15
+ section?: string;
16
+ priority?: string;
17
+ homepage?: string;
18
+ [key: string]: string | undefined;
19
+ }
20
+ export interface DebPackage {
21
+ path: string;
22
+ control: DebControl;
23
+ controlTar: Buffer;
24
+ dataTar: Buffer;
25
+ }
26
+ export interface InstalledPackage {
27
+ name: string;
28
+ version: string;
29
+ architecture: string;
30
+ description: string;
31
+ depends?: string;
32
+ 'pre-depends'?: string;
33
+ conflicts?: string;
34
+ provides?: string;
35
+ maintainer?: string;
36
+ homepage?: string;
37
+ controlSection?: string;
38
+ controlPriority?: string;
39
+ installedSize?: number;
40
+ installTime: number;
41
+ reason: 'explicit' | 'dependency';
42
+ files: string[];
43
+ }
44
+ export interface RepoPkg {
45
+ package: string;
46
+ version: string;
47
+ architecture: string;
48
+ description?: string;
49
+ depends?: string;
50
+ 'pre-depends'?: string;
51
+ conflicts?: string;
52
+ provides?: string;
53
+ filename: string;
54
+ size?: number;
55
+ sha256?: string;
56
+ repo: string;
57
+ }
58
+ export interface RepoConfig {
59
+ name: string;
60
+ server: string;
61
+ dist: string;
62
+ components: string[];
63
+ }
64
+ export interface Config {
65
+ architecture: string;
66
+ repos: RepoConfig[];
67
+ }
68
+ export interface Database {
69
+ packages: Map<string, InstalledPackage>;
70
+ fileIndex: Map<string, string>;
71
+ }
72
+ export interface Transaction {
73
+ id: string;
74
+ timestamp: number;
75
+ action: 'install' | 'remove';
76
+ package: string;
77
+ version: string;
78
+ completed: boolean;
79
+ }
80
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,13 @@
1
+ export declare const color: {
2
+ repo: (s: string) => string;
3
+ pkg: (s: string) => string;
4
+ local: (s: string) => string;
5
+ error: (s: string) => string;
6
+ warn: (s: string) => string;
7
+ ok: (s: string) => string;
8
+ muted: (s: string) => string;
9
+ title: (s: string) => string;
10
+ size: (s: string) => string;
11
+ rate: (s: string) => string;
12
+ };
13
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare function formatBytes(n: number): string;
2
+ export declare function pkgLabel(name: string, version: string): string;
3
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1,8 @@
1
+ export declare function humanSize(n: number, dec: number): {
2
+ val: string;
3
+ unit: string;
4
+ };
5
+ export declare function drawProgressBar(pct: number, cols: number): string;
6
+ export declare function formatRate(rate: number): string;
7
+ export declare function formatETA(eta: number): string;
8
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1,4 @@
1
+ export declare let noconfirm: boolean;
2
+ export declare function setNoConfirm(val: boolean): void;
3
+ export declare function confirm(prompt: string, defaultYes?: boolean): Promise<boolean>;
4
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1,188 @@
1
+ # Architecture
2
+
3
+ ## Source Tree
4
+
5
+ ```
6
+ src/
7
+ ├── cli/
8
+ │ ├── pacman.ts # CLI argument parsing and dispatch
9
+ │ ├── paclink.ts # Virtual package link management
10
+ │ ├── update-ca-trust.ts # Arch-compat CA certificate updater
11
+ │ ├── archlinux-java.ts # Arch-compat Java alternatives manager
12
+ │ └── fix_default.ts # Arch-compat default JDK helper
13
+ ├── core/ # Package format parsers, dependency engine
14
+ │ ├── ar.ts # ar archive parser
15
+ │ ├── tar.ts # tar extractor
16
+ │ ├── deb.ts # .deb package parser
17
+ │ ├── pkgfile.ts # .pkg.tar.zst parser
18
+ │ ├── compress.ts # gz/xz decompression
19
+ │ ├── control.ts # debian control file parser
20
+ │ └── deps.ts # Dependency resolution engine
21
+ ├── db/
22
+ │ ├── localdb.ts # Directory-based local package DB
23
+ │ ├── database.ts # DB wrapper with transactions
24
+ │ └── dpkg-compat.ts # dpkg status file read/write
25
+ ├── ops/
26
+ │ ├── install.ts # Package installation
27
+ │ ├── remove.ts # Package removal
28
+ │ ├── query.ts # All -Q queries
29
+ │ └── upgrade.ts # Sync + upgrade flow
30
+ ├── repo/
31
+ │ ├── repository.ts # Repo sync, download, JSONL cache
32
+ │ └── config.ts # pacman.conf parser with Include support
33
+ ├── scripts/
34
+ │ └── setup.ts # Interactive setup script
35
+ ├── makepkg/
36
+ │ ├── index.ts # Main makepkg entry
37
+ │ ├── pkgbuild.ts # PKGBUILD parser
38
+ │ ├── source.ts # Source download/extraction
39
+ │ ├── build.ts # build()/package() execution
40
+ │ └── printsrcinfo.ts # .SRCINFO generation
41
+ ├── ui/ # User interface (prompt, formatting)
42
+ └── index.ts # Entry point
43
+ ```
44
+
45
+ ```
46
+ lib/pac4deb/ # libalpm C library
47
+ ├── Makefile # Build with gcc, target libalpm.so
48
+ ├── include/
49
+ │ ├── alpm.h # Public libalpm API header
50
+ │ └── alpm_list.h # Linked list header
51
+ └── src/
52
+ ├── libalpm.c # Core implementation (handle, db, pkg, JSON parser)
53
+ ├── stubs_manual.c # ~200 stubs for rarely-used libalpm functions
54
+ └── alpm_list.c # Linked list implementation
55
+ ```
56
+
57
+ ## Database
58
+
59
+ ### Local database: `/var/lib/pacman-debian/local/`
60
+
61
+ Directory-per-package format matching Arch Linux's local DB:
62
+
63
+ ```
64
+ /var/lib/pacman-debian/local/
65
+ ├── index.json # name → dir mapping (base64 encoded paths)
66
+ ├── by-name/
67
+ │ ├── fastfetch -> ../fastfetch-2.64.2-2/
68
+ │ └── ...
69
+ ├── fastfetch-2.64.2-2/
70
+ │ ├── desc # JSON metadata (name, version, deps, size, etc.)
71
+ │ └── files # File manifest
72
+ └── ...
73
+ ```
74
+
75
+ ### dpkg compatibility
76
+
77
+ Packages installed via `dpkg` or `apt` are read directly from
78
+ `/var/lib/dpkg/status` at query time (mtime-cached). When `pacman-debian`
79
+ installs a package, it writes a dpkg-compatible entry ensuring `apt` and `dpkg`
80
+ still see the package.
81
+
82
+ ### Repository cache: `/var/cache/pacman-debian/packages/`
83
+
84
+ Each repository is cached in JSON Lines chunks (5000 packages per `.jsonl`
85
+ file). During sync, a `packages.idx` index is also built — one line per
86
+ package, sorted globally, with format `pkgname description\tprovides\tchunk\toffset`.
87
+
88
+ ```
89
+ /var/cache/pacman-debian/packages/
90
+ ├── bookworm/
91
+ │ ├── 00000.jsonl # JSON Lines, ~5000 pkg per chunk
92
+ │ ├── ...
93
+ │ └── packages.idx # Global sorted index (tabs, ~200KB)
94
+ └── ...
95
+ ```
96
+
97
+ #### Memory Index Cache
98
+
99
+ `packages.idx` is cached in memory after first read, keyed by repo name + mtime:
100
+
101
+ ```
102
+ _idxCache = new Map<string, IdxEntry>();
103
+ IdxEntry { lines: string[], mtime: number, providesIndex: Map<string, Array<{chunkFile, offset}>> }
104
+ ```
105
+
106
+ - Subsequent `-S`/`-Ss`/`-Sl` operations read from memory, no disk I/O
107
+ - `providesIndex` is an inverted index: `provides name → [{ chunkFile, offset }]`
108
+ - `findProvider()` does O(1) `Map.get()` for provides lookups
109
+ - `pacman -Syy` clears the cache (`invalidateIdxCache()`)
110
+ - After incremental sync, idx file mtime changes → auto reload
111
+
112
+ ### Lookup Paths
113
+
114
+ | Operation | Method | Why |
115
+ |-----------|--------|-----|
116
+ | `-S <pkg>` / `-Qo` | Binary search `packages.idx` → seek JSONL | O(log N), single line read |
117
+ | `-Ss` | Line-scan `packages.idx` (name + desc) → seek JSONL | ~1.4MB scan, no JSON parse |
118
+ | `-Sl` | Read `packages.idx` → seek each pkg | Lazy-load via index |
119
+ | Dependency provides | Scan `packages.idx` provides field | Index-only, no JSON parse |
120
+ | `-Qi` / `-Ql` | dpkg status or localdb | No cache involved |
121
+
122
+ ## Dependency Engine
123
+
124
+ The dependency resolver (`src/core/deps.ts`) handles:
125
+
126
+ - Package name parsing with version constraints (`>=`, `<=`, `=`)
127
+ - OR dependencies (`|`)
128
+ - Architecture qualifiers (e.g. `:arm64`, `:amd64`)
129
+ - Both Debian (comma-separated) and Arch (space-separated) formats
130
+ - BFS resolution with pre-loaded DB state
131
+ - Conflict detection across installed and to-be-installed packages
132
+ - System package protection (glibc, libc6, etc.)
133
+
134
+ - File validation: installed packages with no real files on disk are
135
+ considered NOT installed, forcing re-download.
136
+ - Explicit targets always have their dependencies processed even if the
137
+ target itself is already installed.
138
+ - Queue uses `shift()` to pop processed items, preventing memory accumulation.
139
+
140
+ ### Performance Optimizations
141
+
142
+ | Technique | Description |
143
+ |-----------|-------------|
144
+ | **idx memory cache** | `findInRepo()` binary search on `_idxCache.lines[]` in memory |
145
+ | **provides inverted index** | `findProvider()` does `Map.get()` O(1) |
146
+ | **BFS + cursor** | Dependency queue uses index pointer instead of `shift()` |
147
+ | **batch head-tail scan** | Binary searches sorted idx from both ends simultaneously |
148
+ | **keep-alive HTTP** | Shared `https.Agent({ keepAlive: true, maxSockets: 8 })` |
149
+ | **async .gz decompress** | Non-blocking zlib with callback |
150
+ | **304 conditional requests** | Sync sends `If-Modified-Since`, skip unchanged repos |
151
+
152
+ ### Delete Dependency Handling
153
+
154
+ | Operation | Logic |
155
+ |-----------|-------|
156
+ | `-R` | Remove specified package only |
157
+ | `-Rs` | Remove package + recursive orphan find, reverse-topological order |
158
+ | `-Rc` | Cascade: find all packages requiring the target |
159
+ | `-Rsc` | Recursive + cascade combination |
160
+ | `-Rn` | Backup conffiles as `.dpkg-old`, then remove |
161
+
162
+ Removal auto-sorts dependents first (leaves before roots).
163
+
164
+ ## Repository Support
165
+
166
+ - **Debian/Ubuntu**: Reads `Packages.gz` / `Packages.xz` from standard
167
+ repository indices. Supports `$repo`/`$arch` variable substitution.
168
+ - **Arch Linux**: Reads `db.tar.gz` from Arch-compatible repositories.
169
+ Downloaded `.pkg.tar.zst` files are extracted and installed.
170
+ - **Arch ARM**: Binary packages require glibc 2.38+ — Debian 12 ships 2.36.
171
+ Use `makepkg` for local builds instead.
172
+
173
+ ## Project Status
174
+
175
+ Key features:
176
+
177
+ - **Performance**: `packages.idx` index enables sub-second single-package lookup.
178
+ - **Parallel sync**: Repos sync concurrently with per-repo progress display.
179
+ - **i18n**: Full Chinese and English localization via `$LANG` detection.
180
+ - **Color**: Matching official pacman color scheme.
181
+ - **Root check**: Query commands work without root; write operations require `sudo`.
182
+ - **Link system** (`paclink`): Debian→Arch virtual package name mappings.
183
+
184
+ Key limitations:
185
+
186
+ - **Arch ARM binary repos require glibc 2.38+** — Debian 12 ships 2.36.
187
+ - **yay/AUR**: libalpm stub library works for search and dep resolution, but
188
+ complex AUR dependency chains may fail due to Debian/Arch naming differences.
@@ -0,0 +1,84 @@
1
+ # Configuration
2
+
3
+ Configuration file: `/etc/pacman-debian/pacman.conf`
4
+
5
+ The configuration uses pure Arch Linux pacman syntax with `Include` directives.
6
+ Repo-specific keys (`Type`, `Dist`, `Components` for Debian repos) go in
7
+ included files under `/etc/pacman.d/`.
8
+
9
+ ## Example
10
+
11
+ ```ini
12
+ [options]
13
+ Architecture = auto
14
+
15
+ [bookworm]
16
+ Include = /etc/pacman.d/debian-bookworm
17
+
18
+ [extra]
19
+ Include = /etc/pacman.d/arch-extra
20
+ ```
21
+
22
+ Include file `/etc/pacman.d/debian-bookworm`:
23
+
24
+ ```
25
+ Server = https://mirrors.tuna.tsinghua.edu.cn/debian
26
+ Type = debian
27
+ Dist = bookworm
28
+ Components = main contrib non-free non-free-firmware
29
+ ```
30
+
31
+ Include file for Arch repos `/etc/pacman.d/arch-extra`:
32
+
33
+ ```
34
+ Server = http://mirror.archlinuxarm.org/$arch/$repo
35
+ Type = arch
36
+ Architecture = auto
37
+ ```
38
+
39
+ ## Repo Types
40
+
41
+ ### Debian
42
+
43
+ | Key | Required | Description |
44
+ |-----|----------|-------------|
45
+ | `Server` | Yes | Mirror URL (supports `$repo`, `$arch` substitution) |
46
+ | `Type` | Yes | Must be `debian` |
47
+ | `Dist` | Yes | Distribution codename (e.g., `bookworm`, `trixie`) |
48
+ | `Components` | Yes | Space-separated component list (`main contrib non-free`) |
49
+
50
+ ### Arch
51
+
52
+ | Key | Required | Description |
53
+ |-----|----------|-------------|
54
+ | `Server` | Yes | Mirror URL (supports `$repo`, `$arch` substitution) |
55
+ | `Type` | Yes | Must be `arch` |
56
+ | `Architecture` | No | Set to `auto` to match system arch |
57
+
58
+ ## Symlink
59
+
60
+ A symlink at `/etc/pacman.conf` → `/etc/pacman-debian/pacman.conf` is created
61
+ during setup for compatibility with tools that hardcode this path (e.g., yay).
62
+
63
+ ## Viewing Parsed Config
64
+
65
+ Use `pacman-conf` to view the configuration with all `Include` files resolved
66
+ and `$repo`/`$arch` variables substituted:
67
+
68
+ ```bash
69
+ $ pacman-conf
70
+ # pacman-debian configuration
71
+ [options]
72
+ Architecture = auto
73
+
74
+ [bookworm]
75
+ Server = https://mirrors.tuna.tsinghua.edu.cn/debian
76
+ Type = debian
77
+ Dist = bookworm
78
+ Components = main contrib non-free non-free-firmware
79
+
80
+ [extra]
81
+ Server = http://mirror.archlinuxarm.org/$arch/$repo
82
+ Type = arch
83
+ Architecture = auto
84
+ ```
@@ -0,0 +1,67 @@
1
+ # Installation
2
+
3
+ ## Requirements
4
+
5
+ - Node.js 18+
6
+ - Debian-based distribution (Debian, Ubuntu, Armbian, Linux Mint, etc.)
7
+ - Root privileges for install, remove, and upgrade operations
8
+ - Build essentials: `gcc`, `make`, `ldconfig` (for libalpm C library, optional)
9
+
10
+ ## npm Install (Recommended)
11
+
12
+ ```bash
13
+ npm install -g pacman-debian@latest
14
+ sudo $(which pacman-debian-setup)
15
+ ```
16
+
17
+ > [!WARNING]
18
+ > `npm install -g` **must** be run under `sudo` or as the `root` user.
19
+ > If you install as a regular user, Node.js will place `pacman-debian` into
20
+ > your home directory (`~/.npm-global/` or similar), making it susceptible to
21
+ > tampering, malicious modification, or breakage by other users or scripts on
22
+ > the system. Always use `sudo npm install -g`.
23
+
24
+ ### What setup does
25
+
26
+ 1. Creates default config `/etc/pacman-debian/pacman.conf`
27
+ 2. Creates `/etc/pacman.conf` → `/etc/pacman-debian/pacman.conf` symlink
28
+ 3. Creates CLI symlinks (`/usr/local/bin/pacman`, `makepkg`, `pacman-conf`, `paclink`, `update-ca-trust`, `archlinux-java`, `fix_default`)
29
+ 4. Creates `/var/lib/pacman` → `/var/lib/pacman-debian` symlink for fastfetch detection
30
+ 5. Installs Arch-compat helper tools (`update-ca-trust`, `archlinux-java`, `fix_default`)
31
+ 6. Installs Arch-compat shell functions (`/etc/profile.d/append_path.sh`)
32
+ 7. Registers a virtual `pacman` package in dpkg status
33
+ 8. Creates default paclink mappings (sh → bash, python → python3, etc.)
34
+
35
+ ## Development Install
36
+
37
+ ```bash
38
+ git clone https://github.com/xbodwf/pacman-debian.git
39
+ cd pacman-debian
40
+ pnpm install
41
+ pnpm build # tsc + C library
42
+ sudo node dist/scripts/setup.js
43
+ ```
44
+
45
+ Or set up manually:
46
+
47
+ ```bash
48
+ sudo ln -sf "$PWD/dist/cli/pacman.js" /usr/local/bin/pacman
49
+ sudo ln -sf "$PWD/dist/cli/paclink.js" /usr/local/bin/paclink
50
+ sudo ln -sf "$PWD/dist/scripts/pacman-conf.js" /usr/local/bin/pacman-conf
51
+ sudo ln -sf "$PWD/dist/makepkg/index.js" /usr/local/bin/makepkg
52
+ ```
53
+
54
+ ## First Use
55
+
56
+ ```bash
57
+ # Sync repositories
58
+ sudo pacman -Sy
59
+
60
+ # Search
61
+ pacman -Ss neofetch
62
+
63
+ # Install
64
+ sudo pacman -S neofetch
65
+ ```
66
+
67
+ See [Usage](usage.md) for full command reference.
@@ -0,0 +1,38 @@
1
+ # makepkg
2
+
3
+ A standalone `makepkg` implementation that builds Arch Linux packages from
4
+ PKGBUILDs without requiring `base-devel` or any Arch tools.
5
+
6
+ ```bash
7
+ # Build a package from a PKGBUILD
8
+ cd /path/to/PKGBUILD/dir
9
+ makepkg --syncdeps --install
10
+ ```
11
+
12
+ ## Features
13
+
14
+ - Parses PKGBUILD via bash sourcing (`source PKGBUILD`) — supports all
15
+ standard variables (`pkgname`, `pkgver`, `source`, `depends`, `makedepends`,
16
+ `sha256sums`, etc.)
17
+ - Downloads and verifies source files (supports http/https URLs with checksum
18
+ verification)
19
+ - Extracts archives: `.tar.gz`, `.tar.xz`, `.tar.bz2`, `.tar.zst`, `.zip`
20
+ - Runs `prepare()`, `build()`, `check()`, and `package()` functions in a clean
21
+ environment
22
+ - Creates `.pkg.tar.zst` archives with valid `.PKGINFO` metadata
23
+ - Dependency resolution via `--syncdeps` — installs missing dependencies
24
+ through pacman-debian's sync databases (Debian and Arch repos)
25
+ - Supports `--install` (`-i`), `--clean` (`-c`), `--rmdeps`
26
+
27
+ ## Flags
28
+
29
+ | Flag | Description |
30
+ |------|-------------|
31
+ | `-s, --syncdeps` | Install missing dependencies via pacman |
32
+ | `-i, --install` | Install the built package |
33
+ | `-c, --clean` | Clean up build files after packaging |
34
+ | `-r, --rmdeps` | Remove installed dependencies after build |
35
+ | `-f, --force` | Overwrite existing package file |
36
+ | `-o, --nobuild` | Download and extract sources only (no build) |
37
+ | `--nocolor` | Disable colored output |
38
+ | `--printsrcinfo` | Print `.SRCINFO` and exit |
@@ -0,0 +1,73 @@
1
+ # paclink (Package Link Management)
2
+
3
+ Paclink manages persistent Debian→Arch virtual package name mappings.
4
+ Links are stored in the local DB and visible only to pacman/libalpm tools,
5
+ not dpkg.
6
+
7
+ ## Commands
8
+
9
+ | Command | Description |
10
+ |---------|-------------|
11
+ | `paclink -Ln <deb> <virt>` | Create a link: Debian package `<deb>` provides Arch virtual name `<virt>` |
12
+ | `paclink -L` | List all links |
13
+ | `paclink -Ls <keyword>` | Search links by name or target |
14
+ | `paclink -Li <virt>` | Show link details |
15
+ | `paclink -R <virt>` | Remove a link (Debian package unaffected) |
16
+
17
+ ## Examples
18
+
19
+ ```bash
20
+ # Map dash to provide sh
21
+ sudo paclink -Ln dash sh
22
+
23
+ # Map python3 to provide python
24
+ sudo paclink -Ln python3 python
25
+
26
+ # List all mappings
27
+ paclink -L
28
+
29
+ # Search for links matching 'python'
30
+ paclink -Ls python
31
+ ```
32
+
33
+ ## Behavior
34
+
35
+ - Links are created as local DB entries with `repoType: link`.
36
+ - When a real package from any repo shares the same name as a link, the real
37
+ package takes precedence and the link is automatically removed during
38
+ installation.
39
+ - Links are only visible to pacman and libalpm — dpkg never sees them.
40
+
41
+ ## Default Links
42
+
43
+ Setup creates the following default mappings:
44
+
45
+ | Virtual Name | Debian Package |
46
+ |-------------|----------------|
47
+ | sh | bash (or dash) |
48
+ | python | python3 |
49
+ | zlib | zlib1g |
50
+ | bzip2 | libbz2-1.0 |
51
+ | xz | liblzma5 |
52
+ | zstd | libzstd1 |
53
+ | openssl | libssl-dev |
54
+ | libssl | libssl3t64 |
55
+ | libcrypt | libcrypt1 |
56
+ | libffi | libffi8 |
57
+ | libpcre | libpcre3 |
58
+ | libpcre2 | libpcre2-8-0 |
59
+ | libpng | libpng16-16t64 |
60
+ | libjpeg-turbo | libjpeg62-turbo |
61
+ | freetype2 | libfreetype6 |
62
+ | ncurses | libncursesw6 |
63
+ | readline | libreadline8t64 |
64
+ | sqlite | libsqlite3-0 |
65
+ | expat | libexpat1 |
66
+ | libxml2 | libxml2 |
67
+ | glibc | libc6 |
68
+ | gcc-libs | libgcc-s1 |
69
+ | libstdc++ | libstdc++6 |
70
+ | systemd-libs | libsystemd0 |
71
+ | gnutls | libgnutls30t64 |
72
+ | libcurl | libcurl4t64 |
73
+ | ca-certificates-utils | ca-certificates |
@@ -0,0 +1,91 @@
1
+ # Usage
2
+
3
+ ## Sync (-S)
4
+
5
+ | Command | Description |
6
+ |---------|-------------|
7
+ | `pacman -S <pkg>` | Install package(s) from repositories |
8
+ | `pacman -Sy` | Refresh package databases (mtime check, 24h) |
9
+ | `pacman -Syy` | Force refresh package databases (clear memory idx cache) |
10
+ | `pacman -Su` | Upgrade all installed packages |
11
+ | `pacman -Syu` | Refresh databases and upgrade |
12
+ | `pacman -Ss <keyword>` | Search repositories |
13
+ | `pacman -Si <pkg>` | Show remote package information |
14
+ | `pacman -Sl` | List all packages in repositories |
15
+ | `pacman -Sw <pkg>` | Download packages to cache without installing |
16
+ | `pacman -Sc` | Remove unused cached package files |
17
+ | `pacman -Scc` | Clear entire cache (including repo jsonl/idx) |
18
+ | `pacman -Sp <pkg>` | Print download URL without installing |
19
+
20
+ ## Remove (-R)
21
+
22
+ | Command | Description |
23
+ |---------|-------------|
24
+ | `pacman -R <pkg>` | Remove a package |
25
+ | `pacman -Rs <pkg>` | Remove package and unused dependencies |
26
+ | `pacman -Rn <pkg>` | Remove package and its config files (nosave) |
27
+ | `pacman -Rns <pkg>` | Remove package, dependencies, config files |
28
+ | `pacman -Rc <pkg>` | Cascade: remove packages that depend on the target |
29
+ | `pacman -Rdd <pkg>` | Skip dependency checks during removal |
30
+ | `pacman -Rp <pkg>` | Print what would be removed (dry-run) |
31
+
32
+ Multiple targets (`pacman -R a b`): all targets are merged and displayed
33
+ together with a single confirmation prompt.
34
+
35
+ ## Query (-Q)
36
+
37
+ | Command | Description |
38
+ |---------|-------------|
39
+ | `pacman -Q` | List all installed packages |
40
+ | `pacman -Qe` | List explicitly installed packages |
41
+ | `pacman -Qd` | List packages installed as dependencies |
42
+ | `pacman -Qdt` | List orphan packages (unused dependencies) |
43
+ | `pacman -Qi <pkg>` | Show detailed package information |
44
+ | `pacman -Ql <pkg>` | List files owned by a package |
45
+ | `pacman -Qo <file>` | Query which package owns a file |
46
+ | `pacman -Qs <keyword>` | Search installed packages |
47
+ | `pacman -Qk [pkg]` | Verify installed package file integrity |
48
+ | `pacman -Qq` | Quiet mode: package names only, no versions |
49
+
50
+ ## Other
51
+
52
+ | Command | Description |
53
+ |---------|-------------|
54
+ | `pacman -U <file>` | Install a local package file (.deb/.pkg.tar.zst) |
55
+ | `pacman -D --asdeps <pkg>` | Mark package as dependency |
56
+ | `pacman -D --asexplicit <pkg>` | Mark package as explicitly installed |
57
+ | `pacman -T <pkg>` | Check if dependencies are satisfied |
58
+ | `pacman -F <file>` | Search which package provides a file |
59
+ | `pacman -V` | Show version |
60
+
61
+ ## Bundled Tools
62
+
63
+ | Command | Description |
64
+ |---------|-------------|
65
+ | `pacman-conf` | Print parsed configuration |
66
+ | `makepkg` | Build Arch Linux packages from PKGBUILD (see [makepkg](makepkg.md)) |
67
+ | `pacman-debian-setup` | Interactive setup script |
68
+ | `paclink` | Manage Debian→Arch virtual package name mappings (see [paclink](paclink.md)) |
69
+ | `update-ca-trust` | CA certificate updater (Arch-compat, wraps `update-ca-certificates`) |
70
+ | `archlinux-java` | Java environment manager: `status`, `get`, `set`, `unset`, `fix` |
71
+ | `fix_default` | Print current default JDK short name (used by Arch Java install scripts) |
72
+
73
+ ## Global Flags
74
+
75
+ | Flag | Description |
76
+ |------|-------------|
77
+ | `--noconfirm` | Skip confirmation prompts |
78
+ | `--confirm` | Always ask for confirmation (default) |
79
+ | `--needed` | Do not reinstall up-to-date packages |
80
+ | `--noscriptlet` | Do not execute install scripts |
81
+ | `--print` | Dry-run: show what would be done without executing |
82
+
83
+ ## Config Options (in `pacman.conf [options]`)
84
+
85
+ | Option | Description |
86
+ |--------|-------------|
87
+ | `Color` | Enable colored output |
88
+ | `Architecture` | Set target architecture (default: `auto`) |
89
+ | `IgnorePkg` | Skip upgrade for specified packages |
90
+
91
+ See [Configuration](configuration.md) for detailed config reference.