pacman-debian 7.2.0 → 7.3.0

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 (148) hide show
  1. package/README.md +22 -2
  2. package/README_zh-CN.md +89 -19
  3. package/dist/cli/paclink.d.ts.map +1 -0
  4. package/dist/cli/paclink.js +261 -0
  5. package/dist/cli/paclink.js.map +1 -0
  6. package/dist/cli/pacman.d.ts.map +1 -1
  7. package/dist/cli/pacman.js +64 -38
  8. package/dist/cli/pacman.js.map +1 -1
  9. package/dist/core/compress.d.ts.map +1 -1
  10. package/dist/core/compress.js +29 -0
  11. package/dist/core/compress.js.map +1 -1
  12. package/dist/core/deps.d.ts.map +1 -1
  13. package/dist/core/deps.js +133 -68
  14. package/dist/core/deps.js.map +1 -1
  15. package/dist/core/types.d.ts.map +1 -1
  16. package/dist/db/database.d.ts.map +1 -1
  17. package/dist/db/database.js +3 -1
  18. package/dist/db/database.js.map +1 -1
  19. package/dist/db/localdb.d.ts.map +1 -1
  20. package/dist/db/localdb.js +73 -4
  21. package/dist/db/localdb.js.map +1 -1
  22. package/dist/i18n/en.json +6 -0
  23. package/dist/i18n/index.d.ts.map +1 -1
  24. package/dist/i18n/index.js +52 -6
  25. package/dist/i18n/index.js.map +1 -1
  26. package/dist/i18n/paclink/en.d.ts.map +1 -0
  27. package/dist/i18n/paclink/en.js +62 -0
  28. package/dist/i18n/paclink/en.js.map +1 -0
  29. package/dist/i18n/paclink/zh-CN.d.ts.map +1 -0
  30. package/dist/i18n/paclink/zh-CN.js +62 -0
  31. package/dist/i18n/paclink/zh-CN.js.map +1 -0
  32. package/dist/i18n/setup/en.d.ts.map +1 -0
  33. package/dist/i18n/setup/en.js +49 -0
  34. package/dist/i18n/setup/en.js.map +1 -0
  35. package/dist/i18n/setup/zh-CN.d.ts.map +1 -0
  36. package/dist/i18n/setup/zh-CN.js +49 -0
  37. package/dist/i18n/setup/zh-CN.js.map +1 -0
  38. package/dist/i18n/zh-CN.json +6 -0
  39. package/dist/ops/install.d.ts.map +1 -1
  40. package/dist/ops/install.js +238 -45
  41. package/dist/ops/install.js.map +1 -1
  42. package/dist/ops/query.d.ts.map +1 -1
  43. package/dist/ops/query.js +25 -9
  44. package/dist/ops/query.js.map +1 -1
  45. package/dist/ops/remove.d.ts.map +1 -1
  46. package/dist/ops/remove.js +213 -42
  47. package/dist/ops/remove.js.map +1 -1
  48. package/dist/ops/upgrade.d.ts.map +1 -1
  49. package/dist/ops/upgrade.js +13 -15
  50. package/dist/ops/upgrade.js.map +1 -1
  51. package/dist/repo/repository.d.ts.map +1 -1
  52. package/dist/repo/repository.js +246 -90
  53. package/dist/repo/repository.js.map +1 -1
  54. package/dist/scripts/setup.js +119 -116
  55. package/dist/scripts/setup.js.map +1 -1
  56. package/package.json +3 -2
  57. package/README.zh.md +0 -388
  58. package/dist/ar.d.ts +0 -8
  59. package/dist/cli/pacman.d.ts +0 -2
  60. package/dist/compress.d.ts +0 -2
  61. package/dist/config.d.ts +0 -3
  62. package/dist/control.d.ts +0 -2
  63. package/dist/core/ar.d.ts +0 -7
  64. package/dist/core/compress.d.ts +0 -2
  65. package/dist/core/control.d.ts +0 -2
  66. package/dist/core/deb.d.ts +0 -4
  67. package/dist/core/deps.d.ts +0 -25
  68. package/dist/core/options.d.ts +0 -19
  69. package/dist/core/pkgfile.d.ts +0 -35
  70. package/dist/core/tar.d.ts +0 -13
  71. package/dist/core/types.d.ts +0 -83
  72. package/dist/database.d.ts +0 -20
  73. package/dist/db/database.d.ts +0 -17
  74. package/dist/db/dpkg-compat.d.ts +0 -19
  75. package/dist/db/localdb.d.ts +0 -9
  76. package/dist/db/sqlite.d.ts +0 -20
  77. package/dist/deb.d.ts +0 -5
  78. package/dist/dpkg-compat.d.ts +0 -18
  79. package/dist/i18n/index.d.ts +0 -3
  80. package/dist/index.d.ts +0 -3
  81. package/dist/install.d.ts +0 -2
  82. package/dist/makepkg/build.d.ts +0 -19
  83. package/dist/makepkg/index.d.ts +0 -3
  84. package/dist/makepkg/pkgbuild.d.ts +0 -36
  85. package/dist/ops/install.d.ts +0 -5
  86. package/dist/ops/query.d.ts +0 -9
  87. package/dist/ops/remove.d.ts +0 -3
  88. package/dist/ops/upgrade.d.ts +0 -4
  89. package/dist/pacman.d.ts +0 -2
  90. package/dist/query.d.ts +0 -5
  91. package/dist/remove.d.ts +0 -2
  92. package/dist/repo/config.d.ts +0 -3
  93. package/dist/repo/repository.d.ts +0 -10
  94. package/dist/repository.d.ts +0 -10
  95. package/dist/scripts/pacman-conf.d.ts +0 -3
  96. package/dist/scripts/setup.d.ts +0 -3
  97. package/dist/tar.d.ts +0 -17
  98. package/dist/types.d.ts +0 -80
  99. package/dist/ui/colors.d.ts +0 -13
  100. package/dist/ui/format.d.ts +0 -3
  101. package/dist/ui/progress.d.ts +0 -8
  102. package/dist/ui/prompt.d.ts +0 -4
  103. package/lib/pac4deb/Makefile +0 -26
  104. package/lib/pac4deb/README.md +0 -47
  105. package/lib/pac4deb/include/alpm.h +0 -166
  106. package/lib/pac4deb/include/alpm_list.h +0 -42
  107. package/lib/pac4deb/libalpm.so +0 -0
  108. package/lib/pac4deb/src/alpm_list.c +0 -102
  109. package/lib/pac4deb/src/genstubs.sh +0 -51
  110. package/lib/pac4deb/src/genstubs2.sh +0 -72
  111. package/lib/pac4deb/src/genstubs3.sh +0 -43
  112. package/lib/pac4deb/src/libalpm.c +0 -537
  113. package/lib/pac4deb/src/stubs_manual.c +0 -198
  114. package/lib/pac4deb/stubs.c +0 -6
  115. package/lib/pac4deb/update_header.sh +0 -15
  116. package/src/cli/pacman.ts +0 -308
  117. package/src/core/ar.ts +0 -54
  118. package/src/core/compress.ts +0 -27
  119. package/src/core/control.ts +0 -22
  120. package/src/core/deb.ts +0 -47
  121. package/src/core/deps.ts +0 -260
  122. package/src/core/options.ts +0 -20
  123. package/src/core/pkgfile.ts +0 -146
  124. package/src/core/tar.ts +0 -101
  125. package/src/core/types.ts +0 -89
  126. package/src/db/database.ts +0 -102
  127. package/src/db/dpkg-compat.ts +0 -129
  128. package/src/db/localdb.ts +0 -181
  129. package/src/i18n/en.json +0 -114
  130. package/src/i18n/index.ts +0 -32
  131. package/src/i18n/zh-CN.json +0 -114
  132. package/src/index.ts +0 -7
  133. package/src/makepkg/build.ts +0 -351
  134. package/src/makepkg/index.ts +0 -87
  135. package/src/makepkg/pkgbuild.ts +0 -146
  136. package/src/ops/install.ts +0 -260
  137. package/src/ops/query.ts +0 -117
  138. package/src/ops/remove.ts +0 -77
  139. package/src/ops/upgrade.ts +0 -87
  140. package/src/repo/config.ts +0 -96
  141. package/src/repo/repository.ts +0 -520
  142. package/src/scripts/pacman-conf.ts +0 -68
  143. package/src/scripts/setup.ts +0 -261
  144. package/src/ui/colors.ts +0 -40
  145. package/src/ui/format.ts +0 -9
  146. package/src/ui/progress.ts +0 -26
  147. package/src/ui/prompt.ts +0 -21
  148. package/tsconfig.json +0 -19
@@ -1,20 +0,0 @@
1
- import type { InstalledPackage } from '../core/types';
2
- export declare function loadAllPackages(): InstalledPackage[];
3
- export declare function getFileOwner(filePath: string): string | undefined;
4
- export declare function getPackageFiles(name: string): string[];
5
- export declare function saveFileIndex(pkg: InstalledPackage): void;
6
- export declare function removeFileIndex(pkg: InstalledPackage): void;
7
- export declare function getPackage(name: string): InstalledPackage | undefined;
8
- export declare function searchPackages(query: string): InstalledPackage[];
9
- export declare function savePackage(pkg: InstalledPackage): void;
10
- export declare function removePackage(name: string): void;
11
- export declare function countPackages(): number;
12
- export declare function refreshDpkgCache(): void;
13
- export declare function dpkgHasPackage(name: string): boolean;
14
- export declare function upsertDpkgEntry(name: string, version: string, architecture: string, description: string, installedSize: number): void;
15
- export declare function removeDpkgCacheEntry(name: string): void;
16
- export declare function syncDpkgCache(): void;
17
- export declare function getDpkgPackage(name: string): Record<string, any> | undefined;
18
- export declare function getAllDpkgPackages(): Record<string, any>[];
19
- export declare function countDpkgPackages(): number;
20
- //# sourceMappingURL=sqlite.d.ts.map
package/dist/deb.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { DebPackage } from './types';
2
- export declare function parseDeb(filePath: string): DebPackage;
3
- export declare function listDebContents(filePath: string): string[];
4
- export declare function readScript(pkg: DebPackage, name: string): string | null;
5
- //# sourceMappingURL=deb.d.ts.map
@@ -1,18 +0,0 @@
1
- import type { InstalledPackage } from './types';
2
- export interface DpkgEntry {
3
- package: string;
4
- version: string;
5
- architecture: string;
6
- status: string;
7
- description?: string;
8
- maintainer?: string;
9
- depends?: string;
10
- installedSize?: number;
11
- section?: string;
12
- priority?: string;
13
- homepage?: string;
14
- }
15
- export declare function readDpkgStatus(): Map<string, DpkgEntry>;
16
- export declare function writeDpkgEntry(pkg: InstalledPackage): void;
17
- export declare function removeDpkgEntry(name: string): void;
18
- //# sourceMappingURL=dpkg-compat.d.ts.map
@@ -1,3 +0,0 @@
1
- export declare function t(key: string, ...args: (string | number)[]): string;
2
- export declare function getLocale(): string;
3
- //# sourceMappingURL=index.d.ts.map
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
package/dist/install.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function installPkg(target: string): Promise<boolean>;
2
- //# sourceMappingURL=install.d.ts.map
@@ -1,19 +0,0 @@
1
- export interface BuildOptions {
2
- install?: boolean;
3
- clean?: boolean;
4
- skipExtract?: boolean;
5
- skipBuild?: boolean;
6
- skipPackage?: boolean;
7
- skipChecksum?: boolean;
8
- nodeps?: boolean;
9
- syncdeps?: boolean;
10
- rmdeps?: boolean;
11
- force?: boolean;
12
- log?: boolean;
13
- ignoreArch?: boolean;
14
- pkgbuild?: string;
15
- printsrcinfo?: boolean;
16
- geninteg?: boolean;
17
- }
18
- export declare function buildPkgbuild(options: BuildOptions): Promise<string>;
19
- //# sourceMappingURL=build.d.ts.map
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,36 +0,0 @@
1
- export interface PkgbuildInfo {
2
- pkgbase?: string;
3
- pkgname: string;
4
- pkgver: string;
5
- pkgrel: string;
6
- epoch?: string;
7
- pkgdesc: string;
8
- arch: string[];
9
- url?: string;
10
- license: string[];
11
- groups: string[];
12
- depends: string[];
13
- makedepends: string[];
14
- optdepends: string[];
15
- checkdepends: string[];
16
- provides: string[];
17
- conflicts: string[];
18
- replaces: string[];
19
- source: string[];
20
- noextract: string[];
21
- sha256sums: string[];
22
- md5sums: string[];
23
- validpgpkeys: string[];
24
- install?: string;
25
- options: string[];
26
- backup: string[];
27
- buildFn: string;
28
- packageFn: string;
29
- prepareFn: string;
30
- checkFn: string;
31
- validArch: boolean;
32
- }
33
- export declare function parsePkgbuild(pkgbuildPath: string, ignoreArch?: boolean): PkgbuildInfo;
34
- export declare function pkgFilename(info: PkgbuildInfo, archOverride?: string): string;
35
- export declare function printSrcinfo(info: PkgbuildInfo): string;
36
- //# sourceMappingURL=pkgbuild.d.ts.map
@@ -1,5 +0,0 @@
1
- import type { InstallOptions } from '../core/options';
2
- export declare function installPkgFile(filePath: string, reason: 'explicit' | 'dependency', opts?: InstallOptions): Promise<boolean>;
3
- export declare function installPkg(target: string, opts?: InstallOptions): Promise<boolean>;
4
- export declare function installPackages(targets: string[], opts?: InstallOptions): Promise<number>;
5
- //# sourceMappingURL=install.d.ts.map
@@ -1,9 +0,0 @@
1
- export declare function listInstalled(filter?: string): void;
2
- export declare function listExplicit(): void;
3
- export declare function listDeps(): void;
4
- export declare function listOrphans(): void;
5
- export declare function checkIntegrity(name?: string): void;
6
- export declare function showInfo(name: string, fromRepo: boolean): void;
7
- export declare function queryFile(fp: string): void;
8
- export declare function listFiles(name: string): void;
9
- //# sourceMappingURL=query.d.ts.map
@@ -1,3 +0,0 @@
1
- import type { RemoveOptions } from '../core/options';
2
- export declare function removeByName(name: string, opts?: RemoveOptions): Promise<boolean>;
3
- //# sourceMappingURL=remove.d.ts.map
@@ -1,4 +0,0 @@
1
- import type { InstallOptions } from '../core/options';
2
- export declare function syncAndUpgrade(opts?: InstallOptions, force?: boolean): Promise<void>;
3
- export declare function upgradeOnly(opts?: InstallOptions): Promise<void>;
4
- //# sourceMappingURL=upgrade.d.ts.map
package/dist/pacman.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function parseArgs(args: string[]): Promise<void>;
2
- //# sourceMappingURL=pacman.d.ts.map
package/dist/query.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare function listInstalled(filter?: string): void;
2
- export declare function showPackageInfo(name: string, fromRepo: boolean): void;
3
- export declare function queryFile(filePath: string): void;
4
- export declare function listPackageFiles(name: string): void;
5
- //# sourceMappingURL=query.d.ts.map
package/dist/remove.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function removePackageByName(name: string, recursive?: boolean): boolean;
2
- //# sourceMappingURL=remove.d.ts.map
@@ -1,3 +0,0 @@
1
- import type { Config } from '../core/types';
2
- export declare function loadConfig(): Config;
3
- //# sourceMappingURL=config.d.ts.map
@@ -1,10 +0,0 @@
1
- import type { RepoPkg } from '../core/types';
2
- export declare function syncRepos(force?: boolean): Promise<void>;
3
- /** Read a pkg from JSONL by byte offset (shared helper) */
4
- export declare function readPkgAt(pkgDir: string, chunkFile: string, byteOff: number): RepoPkg | undefined;
5
- export declare function getRepoCache(): RepoPkg[];
6
- export declare function invalidateCache(): void;
7
- export declare function searchRepo(query: string): RepoPkg[];
8
- export declare function findInRepo(pkgName: string): RepoPkg | undefined;
9
- export declare function downloadPkg(rp: RepoPkg, dest?: string, onProgress?: (rec: number, tot: number) => void): Promise<string>;
10
- //# sourceMappingURL=repository.d.ts.map
@@ -1,10 +0,0 @@
1
- import type { RepoPkg } from './types';
2
- export declare function getRepoCache(): RepoPkg[];
3
- export declare function invalidateCache(): void;
4
- export declare function syncRepos(): Promise<void>;
5
- export declare function searchRepo(query: string): RepoPkg[];
6
- export declare function findInRepo(pkgName: string): RepoPkg | undefined;
7
- export declare function findProvides(pkgName: string): RepoPkg[];
8
- export declare function getDebDownloadUrl(pkg: RepoPkg): string;
9
- export declare function ensureDebDownloaded(pkg: RepoPkg): Promise<string>;
10
- //# sourceMappingURL=repository.d.ts.map
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=pacman-conf.d.ts.map
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=setup.d.ts.map
package/dist/tar.d.ts DELETED
@@ -1,17 +0,0 @@
1
- export interface TarEntry {
2
- name: string;
3
- type: string;
4
- size: number;
5
- data: Buffer | null;
6
- linkname: string;
7
- mode: number;
8
- }
9
- export declare function iterateTar(buf: Buffer): Generator<TarEntry>;
10
- export declare function listTarEntries(buf: Buffer): {
11
- name: string;
12
- type: string;
13
- size: number;
14
- }[];
15
- export declare function readFileFromTar(buf: Buffer, filePath: string): Buffer | null;
16
- export declare function extractTar(buf: Buffer, dest: string, filter?: (name: string) => boolean): string[];
17
- //# sourceMappingURL=tar.d.ts.map
package/dist/types.d.ts DELETED
@@ -1,80 +0,0 @@
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
@@ -1,13 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- export declare function formatBytes(n: number): string;
2
- export declare function pkgLabel(name: string, version: string): string;
3
- //# sourceMappingURL=format.d.ts.map
@@ -1,8 +0,0 @@
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
@@ -1,4 +0,0 @@
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
@@ -1,26 +0,0 @@
1
- CC ?= gcc
2
- CFLAGS ?= -O2 -fPIC
3
- CFLAGS += -Iinclude -Wno-unused-parameter
4
- LDFLAGS += -shared -ldl
5
-
6
- SRC = $(wildcard src/*.c)
7
- OBJ = $(SRC:.c=.o)
8
- TARGET = libalpm.so
9
-
10
- .PHONY: all clean install
11
-
12
- all: $(TARGET)
13
-
14
- $(TARGET): $(OBJ)
15
- $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
16
-
17
- %.o: %.c
18
- $(CC) $(CFLAGS) -c -o $@ $<
19
-
20
- clean:
21
- rm -f $(TARGET) src/*.o
22
-
23
- install: $(TARGET)
24
- install -Dm755 $(TARGET) /usr/local/lib/$(TARGET)
25
- ldconfig
26
- @echo "Installed to /usr/local/lib/$(TARGET)"
@@ -1,47 +0,0 @@
1
- # pac4deb-libalpm
2
-
3
- A drop-in replacement for Arch Linux's `libalpm.so`, reading from pacman-debian's database (`/var/lib/pacman-debian/`). Enables native AUR helpers like `yay`, `expac`, `pkgfile` to run on Debian without modification.
4
-
5
- ## What is libalpm?
6
-
7
- Arch Linux's package management core library (C). `pacman`, `yay`, `expac` and other Arch tools link against it to query databases, resolve dependencies, and manage transactions — all at the C API level rather than through the `pacman` CLI binary.
8
-
9
- ## How it works
10
-
11
- ```
12
- yay ──────┐
13
- expac ────┤
14
- pkgfile ──┼─ libalpm.so (this project)
15
- │ ├─ reads /var/lib/pacman-debian/status.json
16
- │ ├─ reads /var/cache/pacman-debian/packages/*.json
17
- │ └─ wraps pacman-debian for transactions
18
-
19
- └─ (real libalpm reads /var/lib/pacman/local/*/desc)
20
- ```
21
-
22
- Instead of reading Arch's file-based package database, this library reads pacman-debian's JSON database and exposes the same C API. AUR helpers and other libalpm-dependent tools become usable on Debian without porting.
23
-
24
- ## Build
25
-
26
- ```bash
27
- make
28
- sudo make install
29
- ```
30
-
31
- ## API Coverage
32
-
33
- Implements the most commonly used subset of libalpm's public API:
34
-
35
- | Group | Functions |
36
- |-------|-----------|
37
- | Handle | `alpm_initialize`, `alpm_release` |
38
- | Databases | `alpm_db_register_local`, `alpm_db_register_sync`, `alpm_db_unregister_all` |
39
- | Package access | `alpm_db_get_pkg`, `alpm_db_get_pkgcache` |
40
- | Package properties | `alpm_pkg_get_name`, `alpm_pkg_get_version`, `alpm_pkg_get_desc`, `alpm_pkg_get_url`, `alpm_pkg_get_arch`, `alpm_pkg_get_builddate`, `alpm_pkg_get_installdate`, `alpm_pkg_get_reason`, `alpm_pkg_get_base64_sig`, `alpm_pkg_free` |
41
- | Lists | `alpm_list_add`, `alpm_list_remove`, `alpm_list_free`, `alpm_list_count`, `alpm_list_nth`, etc. |
42
- | Options | `alpm_option_add_cachedir`, `alpm_option_set_dbpath`, `alpm_option_get_localdb`, `alpm_option_get_syncdbs` |
43
- | Logging | `alpm_logaction`, `alpm_option_set_logfile` |
44
-
45
- ## License
46
-
47
- GNU General Public License v3.0
@@ -1,166 +0,0 @@
1
- #ifndef ALPM_H
2
- #define ALPM_H
3
-
4
- #include <stdint.h>
5
- #include <stddef.h>
6
- #include <stdbool.h>
7
- #include <stdarg.h>
8
- #include <sys/types.h>
9
-
10
- #ifdef __cplusplus
11
- extern "C" {
12
- #endif
13
-
14
- /* Opaque types */
15
- typedef struct __alpm_handle_t alpm_handle_t;
16
- typedef struct __alpm_db_t alpm_db_t;
17
- typedef struct __alpm_pkg_t alpm_pkg_t;
18
- typedef struct __alpm_list_t alpm_list_t;
19
-
20
- /* Time type */
21
- typedef int64_t alpm_time_t;
22
-
23
- /* Package reason */
24
- typedef enum _alpm_pkgreason_t {
25
- ALPM_PKG_REASON_EXPLICIT = 0,
26
- ALPM_PKG_REASON_DEPEND = 1,
27
- } alpm_pkgreason_t;
28
-
29
- /* Package origin */
30
- typedef enum _alpm_pkgfrom_t {
31
- ALPM_PKG_FROM_FILE = 1,
32
- ALPM_PKG_FROM_LOCALDB,
33
- ALPM_PKG_FROM_SYNCDB,
34
- } alpm_pkgfrom_t;
35
-
36
- /* Package validation */
37
- typedef enum _alpm_pkgvalidation_t {
38
- ALPM_PKG_VALIDATION_UNKNOWN = 0,
39
- ALPM_PKG_VALIDATION_NONE,
40
- ALPM_PKG_VALIDATION_SIGNATURE,
41
- ALPM_PKG_VALIDATION_CHECKSUM,
42
- } alpm_pkgvalidation_t;
43
-
44
- /* Error codes */
45
- typedef enum _alpm_errno_t {
46
- ALPM_ERR_OK = 0,
47
- ALPM_ERR_MEMORY = 1,
48
- ALPM_ERR_SYSTEM = 2,
49
- ALPM_ERR_BADPERMS = 3,
50
- ALPM_ERR_NOT_A_FILE = 4,
51
- ALPM_ERR_NOT_A_DIR = 5,
52
- ALPM_ERR_WRONG_ARGS = 6,
53
- ALPM_ERR_DB_NOT_NULL = 7,
54
- ALPM_ERR_DB_NOT_FOUND = 8,
55
- ALPM_ERR_PKG_NOT_FOUND = 9,
56
- ALPM_ERR_LIBARCHIVE = 10,
57
- ALPM_ERR_LIBCURL = 11,
58
- ALPM_ERR_HANDLE_NULL = 12,
59
- ALPM_ERR_HANDLE_NOT_NULL = 13,
60
- ALPM_ERR_DB_VERSION = 14,
61
- ALPM_ERR_DB_WRITE = 15,
62
- ALPM_ERR_DB_REMOVE = 16,
63
- ALPM_ERR_SERVER_BAD_URL = 17,
64
- ALPM_ERR_TRANS_NOT_NULL = 18,
65
- ALPM_ERR_TRANS_NULL = 19,
66
- ALPM_ERR_PKG_INVALID = 20,
67
- } alpm_errno_t;
68
-
69
- /* Capabilities */
70
- typedef enum _alpm_caps_t {
71
- ALPM_CAPABILITY_NLS = 1,
72
- } alpm_caps_t;
73
-
74
- /* Log levels */
75
- typedef enum _alpm_loglevel_t {
76
- ALPM_LOG_DEBUG = 1,
77
- ALPM_LOG_ERROR = 2,
78
- ALPM_LOG_WARNING = 4,
79
- ALPM_LOG_FUNCTION = 8,
80
- } alpm_loglevel_t;
81
-
82
- typedef void (*alpm_cb_log)(alpm_loglevel_t, const char *, va_list);
83
-
84
- /* ---- Handle ---- */
85
- alpm_handle_t *alpm_initialize(const char *root, const char *dbpath, alpm_errno_t *err);
86
- int alpm_release(alpm_handle_t *handle);
87
-
88
- /* ---- Errors ---- */
89
- alpm_errno_t alpm_errno(alpm_handle_t *handle);
90
- const char *alpm_strerror(alpm_errno_t err);
91
-
92
- /* ---- Databases ---- */
93
- alpm_db_t *alpm_db_register_local(alpm_handle_t *handle);
94
- alpm_db_t *alpm_db_register_sync(alpm_handle_t *handle, const char *treename);
95
- int alpm_db_unregister_all(alpm_handle_t *handle);
96
- alpm_pkg_t *alpm_db_get_pkg(alpm_db_t *db, const char *name);
97
- alpm_list_t *alpm_db_get_pkgcache(alpm_db_t *db);
98
- int alpm_db_set_pkgreason(alpm_handle_t *handle, const char *name, alpm_pkgreason_t reason);
99
-
100
- /* ---- Packages ---- */
101
- const char *alpm_pkg_get_name(alpm_pkg_t *pkg);
102
- const char *alpm_pkg_get_version(alpm_pkg_t *pkg);
103
- const char *alpm_pkg_get_desc(alpm_pkg_t *pkg);
104
- const char *alpm_pkg_get_url(alpm_pkg_t *pkg);
105
- const char *alpm_pkg_get_arch(alpm_pkg_t *pkg);
106
- const char *alpm_pkg_get_base64_sig(alpm_pkg_t *pkg);
107
- alpm_pkgreason_t alpm_pkg_get_reason(alpm_pkg_t *pkg);
108
- alpm_pkgfrom_t alpm_pkg_get_origin(alpm_pkg_t *pkg);
109
- alpm_time_t alpm_pkg_get_builddate(alpm_pkg_t *pkg);
110
- alpm_time_t alpm_pkg_get_installdate(alpm_pkg_t *pkg);
111
- off_t alpm_pkg_get_size(alpm_pkg_t *pkg);
112
- off_t alpm_pkg_get_isize(alpm_pkg_t *pkg);
113
- alpm_pkgvalidation_t alpm_pkg_get_validation(alpm_pkg_t *pkg);
114
- int alpm_pkg_has_scriptlet(alpm_pkg_t *pkg);
115
- void alpm_pkg_free(alpm_pkg_t *pkg);
116
-
117
- /* ---- Options ---- */
118
- int alpm_option_add_cachedir(alpm_handle_t *handle, const char *cachedir);
119
- int alpm_option_set_cachedirs(alpm_handle_t *handle, alpm_list_t *cachedirs);
120
- int alpm_option_set_usesyslog(alpm_handle_t *handle, int use);
121
- int alpm_option_set_dbpath(alpm_handle_t *handle, const char *dbpath);
122
- int alpm_option_set_logfile(alpm_handle_t *handle, const char *logfile);
123
- const char *alpm_option_get_dbpath(alpm_handle_t *handle);
124
- alpm_db_t *alpm_option_get_localdb(alpm_handle_t *handle);
125
- alpm_list_t *alpm_option_get_syncdbs(alpm_handle_t *handle);
126
-
127
- /* ---- Logging ---- */
128
- int alpm_logaction(alpm_handle_t *handle, const char *fmt, ...);
129
-
130
- /* ---- Version comparison ---- */
131
- int alpm_pkg_vercmp(const char *a, const char *b);
132
-
133
- /* ---- Misc ---- */
134
- const char *alpm_version(void);
135
- int alpm_capabilities(void);
136
-
137
- /* Go/CGO binding aliases used by AUR helpers */
138
- alpm_db_t *alpm_get_localdb(alpm_handle_t *handle);
139
- alpm_list_t *alpm_get_syncdbs(alpm_handle_t *handle);
140
- int alpm_db_unregister(alpm_db_t *db);
141
- int alpm_option_set_gpgdir(alpm_handle_t *handle, const char *gpgdir);
142
- const char *alpm_option_get_gpgdir(alpm_handle_t *handle);
143
- const char *alpm_option_get_logfile(alpm_handle_t *handle);
144
- int alpm_option_set_local_file_siglevel(alpm_handle_t *handle, int level);
145
- int alpm_option_get_local_file_siglevel(alpm_handle_t *handle);
146
- int alpm_option_set_remote_file_siglevel(alpm_handle_t *handle, int level);
147
- int alpm_option_get_remote_file_siglevel(alpm_handle_t *handle);
148
- int alpm_option_set_dbext(alpm_handle_t *handle, const char *ext);
149
- const char *alpm_option_get_dbext(alpm_handle_t *handle);
150
- int alpm_option_set_disable_dl_timeout(alpm_handle_t *handle, int disable);
151
- int alpm_option_get_disable_dl_timeout(alpm_handle_t *handle);
152
- int alpm_option_set_disable_sandbox(alpm_handle_t *handle, int disable);
153
- int alpm_option_get_disable_sandbox(alpm_handle_t *handle);
154
- int alpm_trans_init(alpm_handle_t *handle, int flags);
155
- int alpm_trans_prepare(alpm_handle_t *handle);
156
- int alpm_trans_commit(alpm_handle_t *handle);
157
- int alpm_trans_release(alpm_handle_t *handle);
158
- int alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg);
159
- int alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg);
160
- int alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade);
161
-
162
- #ifdef __cplusplus
163
- }
164
- #endif
165
-
166
- #endif /* ALPM_H */
@@ -1,42 +0,0 @@
1
- #ifndef ALPM_LIST_H
2
- #define ALPM_LIST_H
3
-
4
- #include <stdlib.h>
5
-
6
- #ifdef __cplusplus
7
- extern "C" {
8
- #endif
9
-
10
- typedef struct __alpm_list_t {
11
- void *data;
12
- struct __alpm_list_t *prev;
13
- struct __alpm_list_t *next;
14
- } alpm_list_t;
15
-
16
- typedef int (*alpm_list_fn_cmp)(const void *, const void *);
17
- typedef void (*alpm_list_fn_free)(void *);
18
-
19
- alpm_list_t *alpm_list_add(alpm_list_t *list, void *data);
20
- alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn);
21
- void alpm_list_free(alpm_list_t *list);
22
- void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn);
23
- alpm_list_t *alpm_list_remove(alpm_list_t *list, const void *needle, alpm_list_fn_cmp fn, void **data);
24
- alpm_list_t *alpm_list_remove_str(alpm_list_t *list, const char *needle, char **data);
25
- alpm_list_t *alpm_list_strdup(alpm_list_t *list);
26
- int alpm_list_count(const alpm_list_t *list);
27
- alpm_list_t *alpm_list_nth(const alpm_list_t *list, int n);
28
- alpm_list_t *alpm_list_next(const alpm_list_t *list);
29
- alpm_list_t *alpm_list_previous(const alpm_list_t *list);
30
- alpm_list_t *alpm_list_last(const alpm_list_t *list);
31
- alpm_list_t *alpm_list_reverse(alpm_list_t *list);
32
- alpm_list_t *alpm_list_join(alpm_list_t *first, alpm_list_t *second);
33
- alpm_list_t *alpm_list_copy(const alpm_list_t *list);
34
- alpm_list_t *alpm_list_copy_data(const alpm_list_t *list, size_t size);
35
- void *alpm_list_find(const alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn);
36
- alpm_list_t *alpm_list_diff(const alpm_list_t *lhs, const alpm_list_t *rhs, alpm_list_fn_cmp fn);
37
-
38
- #ifdef __cplusplus
39
- }
40
- #endif
41
-
42
- #endif
Binary file