mirror of
https://gitlab.archlinux.org/pacman/pacman.git
synced 2025-11-03 17:04:40 +01:00
Compare commits
890 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ded60326a | ||
|
|
420c8846b9 | ||
|
|
7879e4bef7 | ||
|
|
6f3949e3da | ||
|
|
2b3a85dc4a | ||
|
|
fc9d12bef0 | ||
|
|
5676dbae4d | ||
|
|
81db1847c9 | ||
|
|
848edb2f38 | ||
|
|
b091ccc400 | ||
|
|
4ac9b2eb06 | ||
|
|
3559306546 | ||
|
|
2374c81e55 | ||
|
|
42f5579fd7 | ||
|
|
3078494767 | ||
|
|
273950473e | ||
|
|
be95e4d8a0 | ||
|
|
fe4e07bd2f | ||
|
|
59a6b519da | ||
|
|
2b0c89b06a | ||
|
|
0f74ae0885 | ||
|
|
b206aaee88 | ||
|
|
141e569840 | ||
|
|
706c690b64 | ||
|
|
ccc57de6b6 | ||
|
|
279fbc44b1 | ||
|
|
69188d75fb | ||
|
|
e8d665fbf7 | ||
|
|
f4ac63ab43 | ||
|
|
8068a14c52 | ||
|
|
9bf487b2ff | ||
|
|
fbf3beb8d2 | ||
|
|
7586072beb | ||
|
|
17180890a5 | ||
|
|
14ee1be1ef | ||
|
|
11fe18479e | ||
|
|
0c2206f542 | ||
|
|
b29838c825 | ||
|
|
7d7a337912 | ||
|
|
a7a9f37561 | ||
|
|
7069b96173 | ||
|
|
69bc5ea5e2 | ||
|
|
96ee1bca24 | ||
|
|
37bb99abfa | ||
|
|
7786bf6024 | ||
|
|
7cfb343b0f | ||
|
|
b1103a3eaf | ||
|
|
c028014f96 | ||
|
|
0775c38e72 | ||
|
|
f950c26307 | ||
|
|
11692e0eef | ||
|
|
bba62655fe | ||
|
|
73ee64d49f | ||
|
|
ba7687f58e | ||
|
|
003adb7646 | ||
|
|
3b464dc897 | ||
|
|
cee314fc5e | ||
|
|
8ec9a67aee | ||
|
|
57ec111a4e | ||
|
|
f374ead66a | ||
|
|
84084aa44c | ||
|
|
8343121f87 | ||
|
|
6f181c22d2 | ||
|
|
de5e49f4be | ||
|
|
601f6a8a29 | ||
|
|
d9a9ffd77d | ||
|
|
06dd617b59 | ||
|
|
1379f4e9ac | ||
|
|
12417e91ad | ||
|
|
eb77f0dbd2 | ||
|
|
6b242b3725 | ||
|
|
eccda0dfad | ||
|
|
db557e0563 | ||
|
|
a0ac72b422 | ||
|
|
9a18e0dbef | ||
|
|
0c5b68877b | ||
|
|
6eee9e987a | ||
|
|
1dca8b6309 | ||
|
|
223a0ce89d | ||
|
|
307f4d7301 | ||
|
|
fd86c62db8 | ||
|
|
ffff094126 | ||
|
|
6ee95afe7e | ||
|
|
e93b0a2f37 | ||
|
|
916e226b78 | ||
|
|
801a268056 | ||
|
|
549c2878f9 | ||
|
|
8186dc11a9 | ||
|
|
bbe02ec57f | ||
|
|
47e8dd0670 | ||
|
|
78e7342c16 | ||
|
|
ab506f77c0 | ||
|
|
3de2147376 | ||
|
|
633dbeac88 | ||
|
|
e654236db6 | ||
|
|
8ffa6fa7ad | ||
|
|
8372a9e8c7 | ||
|
|
318d5c4ba8 | ||
|
|
f9a7d8cba4 | ||
|
|
0a65de10b1 | ||
|
|
887ad59eb6 | ||
|
|
71ca587f2a | ||
|
|
aec7c13648 | ||
|
|
abd14fdac0 | ||
|
|
b1a231427b | ||
|
|
47761d5aec | ||
|
|
33f6fda8b6 | ||
|
|
079f5a8346 | ||
|
|
3ddbdc4c1d | ||
|
|
504e6ebb87 | ||
|
|
9dd016001e | ||
|
|
a24c323aba | ||
|
|
9a6361d31f | ||
|
|
dd5bc808ea | ||
|
|
aa48be7223 | ||
|
|
f438f7a8ff | ||
|
|
6025df6594 | ||
|
|
6f86f46c96 | ||
|
|
00c57ddae7 | ||
|
|
d53388fb90 | ||
|
|
e0e33c329f | ||
|
|
a71f4c4c6a | ||
|
|
a27d7f6071 | ||
|
|
1a0aaa20df | ||
|
|
5aa873edb6 | ||
|
|
85a8b150ed | ||
|
|
14e4366c78 | ||
|
|
728b601f7b | ||
|
|
f35a5cf174 | ||
|
|
7417d9d81c | ||
|
|
c26039240d | ||
|
|
601a85082d | ||
|
|
04472f925a | ||
|
|
c18191ba5b | ||
|
|
4abd710ec9 | ||
|
|
860465b34b | ||
|
|
553ce8323c | ||
|
|
d18686a563 | ||
|
|
ac0605b9c2 | ||
|
|
dffa0654f2 | ||
|
|
fbd88a8212 | ||
|
|
01930400a5 | ||
|
|
b3c6bdda38 | ||
|
|
26c05b1c8c | ||
|
|
fdab7207e2 | ||
|
|
c913c53322 | ||
|
|
73aa6b610e | ||
|
|
630541a72e | ||
|
|
457692b928 | ||
|
|
c84feb92db | ||
|
|
14d6832ef2 | ||
|
|
cca4ec647e | ||
|
|
d8a10a8e72 | ||
|
|
9addd88a7d | ||
|
|
7fdb2ee48a | ||
|
|
b43301428e | ||
|
|
9a6582a8fd | ||
|
|
020629a371 | ||
|
|
3128535d1b | ||
|
|
b4a84e4f1d | ||
|
|
741fa31603 | ||
|
|
c0845db8f7 | ||
|
|
8e53cea8f8 | ||
|
|
25072219b5 | ||
|
|
6058a225b6 | ||
|
|
d4f170623b | ||
|
|
ebae8bd009 | ||
|
|
b06ce1e8ad | ||
|
|
13dd2864ca | ||
|
|
47f4c5a480 | ||
|
|
a2cf4701ea | ||
|
|
64fd3fd324 | ||
|
|
16ed9ad19b | ||
|
|
a4b8138797 | ||
|
|
e5cdac7d48 | ||
|
|
a11b2065af | ||
|
|
ce424a356f | ||
|
|
20bad3b839 | ||
|
|
f5478d68a6 | ||
|
|
685a659656 | ||
|
|
9558639d80 | ||
|
|
f8b113ed97 | ||
|
|
565d2eeed5 | ||
|
|
9781d0d637 | ||
|
|
572bdb5c99 | ||
|
|
bd83a1fd85 | ||
|
|
90d72bd24f | ||
|
|
7249c08bdf | ||
|
|
815a2ead3e | ||
|
|
b6acb30aae | ||
|
|
4437033d2a | ||
|
|
2ef78355fc | ||
|
|
97fe3d3f5a | ||
|
|
f0664fbd93 | ||
|
|
c49b2a00d6 | ||
|
|
43eacf2852 | ||
|
|
145c8eb52d | ||
|
|
9615d82343 | ||
|
|
87d95f14f7 | ||
|
|
afdf3724d9 | ||
|
|
874f3379ff | ||
|
|
665b61082e | ||
|
|
f42e223386 | ||
|
|
d6354ff248 | ||
|
|
72dae72691 | ||
|
|
0d1cb03756 | ||
|
|
f07a800fab | ||
|
|
4ce004a846 | ||
|
|
3170106149 | ||
|
|
594f1fbbb1 | ||
|
|
94aa8b1f16 | ||
|
|
e8eff3ef97 | ||
|
|
0b6d73a5b4 | ||
|
|
7341d09541 | ||
|
|
32e625db14 | ||
|
|
3017b71cb5 | ||
|
|
aa2d0d7114 | ||
|
|
8a474e8735 | ||
|
|
4845207fd4 | ||
|
|
250331a636 | ||
|
|
c15f7710de | ||
|
|
f19820cba8 | ||
|
|
22c2043160 | ||
|
|
5f811dc020 | ||
|
|
cff1e2a58f | ||
|
|
e95e346ac7 | ||
|
|
2ed6b482d2 | ||
|
|
5c21f0f152 | ||
|
|
72f40b3876 | ||
|
|
d683033d3e | ||
|
|
11133da587 | ||
|
|
7d37d9278d | ||
|
|
1e9a1a0292 | ||
|
|
c36b0f32c6 | ||
|
|
6e8daa553b | ||
|
|
c7879e77a7 | ||
|
|
7af1f66441 | ||
|
|
8d9ee923ec | ||
|
|
8bee526d28 | ||
|
|
f5d2150e9d | ||
|
|
0144b2ed29 | ||
|
|
7cf28a7595 | ||
|
|
83fa6aa289 | ||
|
|
3e9c590480 | ||
|
|
5f28996220 | ||
|
|
4696ad6cad | ||
|
|
967a78f5e4 | ||
|
|
aa942a126b | ||
|
|
4576000c39 | ||
|
|
84ebf82319 | ||
|
|
23b4e0270b | ||
|
|
2aa7e69da9 | ||
|
|
65fb99133d | ||
|
|
829a7b904d | ||
|
|
5f0c241987 | ||
|
|
b118ce55bd | ||
|
|
55a7455135 | ||
|
|
8f824e70bb | ||
|
|
e174865bdc | ||
|
|
e28973169d | ||
|
|
c8be7540a5 | ||
|
|
d311ad067f | ||
|
|
04b7d2ad14 | ||
|
|
3d10786394 | ||
|
|
cfcc550e2a | ||
|
|
2322909703 | ||
|
|
3cd684b41d | ||
|
|
6f2b436249 | ||
|
|
4ce13e2398 | ||
|
|
2f55733be3 | ||
|
|
c8243bb8ed | ||
|
|
f75ee71762 | ||
|
|
c244cfecf6 | ||
|
|
8757398a7e | ||
|
|
ceb870655e | ||
|
|
7219326dd4 | ||
|
|
f5fcaf0b3c | ||
|
|
1d57a3e801 | ||
|
|
85b06f1276 | ||
|
|
46ec9e3548 | ||
|
|
70a91cbb22 | ||
|
|
dbc2f902db | ||
|
|
c29209e7b6 | ||
|
|
103c3ac5a7 | ||
|
|
1b2817f539 | ||
|
|
ec6a7d689b | ||
|
|
ca262623fc | ||
|
|
07243f74d1 | ||
|
|
5e12d3dec9 | ||
|
|
a0c908dd0d | ||
|
|
53fdae9a19 | ||
|
|
8236be9fd8 | ||
|
|
96f8faa666 | ||
|
|
4a835f5f53 | ||
|
|
b6b3b0135e | ||
|
|
434ea5bf61 | ||
|
|
cc15d29db2 | ||
|
|
2898ccb609 | ||
|
|
7b4573d851 | ||
|
|
dd0275b759 | ||
|
|
a55a07f5dd | ||
|
|
84433c8800 | ||
|
|
ed37d78664 | ||
|
|
6b98599953 | ||
|
|
8ec27835f4 | ||
|
|
b206af78e0 | ||
|
|
3312de65e6 | ||
|
|
5c58b3d500 | ||
|
|
5cd6ffda72 | ||
|
|
6f5ee2432c | ||
|
|
7d51882dd0 | ||
|
|
4e45e1187d | ||
|
|
889fccd55f | ||
|
|
e6673544b2 | ||
|
|
5b4b4df4c9 | ||
|
|
9407baaaa6 | ||
|
|
c00f46b653 | ||
|
|
f3e8343c7e | ||
|
|
9fdb15b4b5 | ||
|
|
dd2d6f980b | ||
|
|
23745a7bf2 | ||
|
|
0e83f12f4a | ||
|
|
4bbb055cd9 | ||
|
|
d0d58489ff | ||
|
|
2ee90ddae2 | ||
|
|
bdab234d97 | ||
|
|
52b7fd81f5 | ||
|
|
cb04b3a5f3 | ||
|
|
11f99e0685 | ||
|
|
0686fec839 | ||
|
|
b55abdce7a | ||
|
|
99f42d6bd2 | ||
|
|
86ca39d15e | ||
|
|
006387828c | ||
|
|
2e51e28442 | ||
|
|
8dc8434444 | ||
|
|
6d42439a3e | ||
|
|
c32f00f77c | ||
|
|
e5be26fb23 | ||
|
|
c26fe63ee5 | ||
|
|
8feccaed78 | ||
|
|
288dd54982 | ||
|
|
7ee62ca216 | ||
|
|
381690f9b3 | ||
|
|
ab91cef655 | ||
|
|
dea9b3bc0f | ||
|
|
4a5e7b6bd1 | ||
|
|
0ea43089e1 | ||
|
|
bcb5465b21 | ||
|
|
ccdf29ffa8 | ||
|
|
ac79135b94 | ||
|
|
6aeda5fbff | ||
|
|
be387148c9 | ||
|
|
6af7dbcf72 | ||
|
|
aea45a8b20 | ||
|
|
dede5371e7 | ||
|
|
74aa54a1f6 | ||
|
|
014306eb99 | ||
|
|
c50a7c6026 | ||
|
|
6cf8a5137e | ||
|
|
cc754bc6e3 | ||
|
|
fe3a461703 | ||
|
|
671224b64c | ||
|
|
0dc34f496d | ||
|
|
3e3e7a97a6 | ||
|
|
8a9c83dd4b | ||
|
|
3e1b72f4f2 | ||
|
|
a8731ff2f7 | ||
|
|
b38e046621 | ||
|
|
17f99a0f00 | ||
|
|
d903fc607e | ||
|
|
b609cb0a5d | ||
|
|
09253b48d6 | ||
|
|
0cff7c6bdf | ||
|
|
89ac8aa9c4 | ||
|
|
581769b72d | ||
|
|
aa545f6798 | ||
|
|
616668fb71 | ||
|
|
bd15c23e16 | ||
|
|
8b1fb61df2 | ||
|
|
0c4f7d821c | ||
|
|
46eaa5c542 | ||
|
|
f5b77eb989 | ||
|
|
e472e80c08 | ||
|
|
520db578da | ||
|
|
0c2cc108d3 | ||
|
|
1118e00fe9 | ||
|
|
b8dba7a6fa | ||
|
|
12e1346252 | ||
|
|
0ff02995f1 | ||
|
|
619bf56e66 | ||
|
|
128b288ca7 | ||
|
|
3d7e06f204 | ||
|
|
4e6a03c4f6 | ||
|
|
5d30c5c0b7 | ||
|
|
abce73de4c | ||
|
|
0adedc536f | ||
|
|
5adb8d4b5a | ||
|
|
3c4e98f7b5 | ||
|
|
7f3adc3936 | ||
|
|
5e3a1bdec6 | ||
|
|
6db0562b8d | ||
|
|
087b8df781 | ||
|
|
e03a1f0044 | ||
|
|
920b0d2049 | ||
|
|
b1613c2651 | ||
|
|
3d8408759d | ||
|
|
1ff8e7f364 | ||
|
|
60dc4b43fd | ||
|
|
6aac221879 | ||
|
|
f5f4650de7 | ||
|
|
4853a4aad9 | ||
|
|
98bcd1f5b1 | ||
|
|
02ec82b8c6 | ||
|
|
52e7e6d747 | ||
|
|
4453ce155c | ||
|
|
01e92e9ded | ||
|
|
7d5dca4043 | ||
|
|
d5fa2da171 | ||
|
|
5977a6ec9e | ||
|
|
69d68ef0b5 | ||
|
|
48bf088e65 | ||
|
|
b86479cf9b | ||
|
|
4942d21632 | ||
|
|
50bb16e015 | ||
|
|
cb3c3a920d | ||
|
|
f2f4ada1d6 | ||
|
|
47622eef4d | ||
|
|
219808714f | ||
|
|
d2edcb58e2 | ||
|
|
16cb8e6e61 | ||
|
|
f7bbfe4052 | ||
|
|
0758012b66 | ||
|
|
679eff90cc | ||
|
|
a6b58638d1 | ||
|
|
fc0e83f05b | ||
|
|
012f793978 | ||
|
|
843d368ef6 | ||
|
|
105fd40a4a | ||
|
|
6898bb0f97 | ||
|
|
8acb6d24af | ||
|
|
d3c8003020 | ||
|
|
443950b7e9 | ||
|
|
f9b7c67d24 | ||
|
|
1860ab8980 | ||
|
|
7325ebbc22 | ||
|
|
d34b2c4ed8 | ||
|
|
d50390c089 | ||
|
|
82a1129539 | ||
|
|
afdcf7552c | ||
|
|
acfdad6db3 | ||
|
|
3955858a2d | ||
|
|
708488f6fe | ||
|
|
b0aa510592 | ||
|
|
046c8a6819 | ||
|
|
7daf5a038d | ||
|
|
a06d91f7f9 | ||
|
|
3166257396 | ||
|
|
892faa3e5c | ||
|
|
4d51a2b357 | ||
|
|
05346af459 | ||
|
|
71a4511d0f | ||
|
|
27acdc2c94 | ||
|
|
f21c45c0dd | ||
|
|
be32aa3004 | ||
|
|
2f0de317b8 | ||
|
|
b2501950c7 | ||
|
|
b15a5194d1 | ||
|
|
53fc745aed | ||
|
|
678983d262 | ||
|
|
9cceb3d9c4 | ||
|
|
3987137505 | ||
|
|
461bc9e6ce | ||
|
|
824b7fd27b | ||
|
|
b3a1619457 | ||
|
|
d34db57b6b | ||
|
|
aef1c88f3b | ||
|
|
788fcee0dc | ||
|
|
b6f89f03af | ||
|
|
26441cf65c | ||
|
|
c8011954a5 | ||
|
|
3e418a1534 | ||
|
|
5c9eec5570 | ||
|
|
2798ebbb62 | ||
|
|
656c895ca4 | ||
|
|
10c3f335d0 | ||
|
|
e24bcc395e | ||
|
|
515754faac | ||
|
|
d09d114e99 | ||
|
|
c22e381a8b | ||
|
|
13525255dc | ||
|
|
b1808930ce | ||
|
|
17d9122e01 | ||
|
|
942175feaa | ||
|
|
3acbf56bba | ||
|
|
9ea7c5c402 | ||
|
|
f81e619974 | ||
|
|
fc65a9bcb1 | ||
|
|
16c91bedf8 | ||
|
|
1cb6d80631 | ||
|
|
ba67fdae63 | ||
|
|
ee977019e3 | ||
|
|
f131ee9c56 | ||
|
|
47cada81a0 | ||
|
|
8038190c7c | ||
|
|
0f539832f4 | ||
|
|
064de149b7 | ||
|
|
f4dbb204f1 | ||
|
|
a65ad4efc1 | ||
|
|
49c29e16b3 | ||
|
|
47ee89ada9 | ||
|
|
f2c7187e43 | ||
|
|
3a0a4db129 | ||
|
|
ab06221521 | ||
|
|
b96922679e | ||
|
|
dc5e6d5d87 | ||
|
|
e0ffc60c53 | ||
|
|
e4f56298be | ||
|
|
ce10b5f1e2 | ||
|
|
178c1d228d | ||
|
|
ea9a756eea | ||
|
|
72c15482dc | ||
|
|
0d00f7095f | ||
|
|
b0c064d59b | ||
|
|
5991e85abb | ||
|
|
df2447cd23 | ||
|
|
23a4d51b7a | ||
|
|
88077889a4 | ||
|
|
240bdf5971 | ||
|
|
c68d3cc38a | ||
|
|
466d289e6a | ||
|
|
fa2164a59e | ||
|
|
c9189f54cd | ||
|
|
99572ed8f6 | ||
|
|
ab2354e762 | ||
|
|
1d97da9450 | ||
|
|
591bfabbd3 | ||
|
|
aaf291c11c | ||
|
|
a909fe6018 | ||
|
|
a1e57cbec8 | ||
|
|
c2920033d0 | ||
|
|
66b09410b4 | ||
|
|
f0ea21cffc | ||
|
|
ce1fb07436 | ||
|
|
edcefb1d58 | ||
|
|
b5ab4bffb7 | ||
|
|
9f9086573a | ||
|
|
1c9f30b9fa | ||
|
|
8d62835ba1 | ||
|
|
5ed501565e | ||
|
|
7234785601 | ||
|
|
c0a7d9d82d | ||
|
|
d402583c43 | ||
|
|
fd3a1a92c8 | ||
|
|
20f73d6299 | ||
|
|
653fb8fe03 | ||
|
|
147a32b32d | ||
|
|
cb164c3130 | ||
|
|
37736a56f9 | ||
|
|
39b6549655 | ||
|
|
1646fcc5bd | ||
|
|
64e45a36f8 | ||
|
|
d12c4f4b29 | ||
|
|
ea1fef69ad | ||
|
|
9a9928f1b8 | ||
|
|
142225fd7d | ||
|
|
862ea62761 | ||
|
|
c4e712c0ef | ||
|
|
d8b57fcb76 | ||
|
|
573b80405c | ||
|
|
5e68e9d451 | ||
|
|
7ec2e088ec | ||
|
|
57d77eab32 | ||
|
|
8f2575b26e | ||
|
|
7d74572887 | ||
|
|
1480ac29e4 | ||
|
|
d2613b97fa | ||
|
|
cd5b38a4b0 | ||
|
|
e412ac19f5 | ||
|
|
f1fac6abfb | ||
|
|
ab87657b93 | ||
|
|
499b750c2f | ||
|
|
fe9a0de32e | ||
|
|
be0a472cb7 | ||
|
|
493e5fb782 | ||
|
|
2f7d2485f5 | ||
|
|
168b795f9e | ||
|
|
91f1752701 | ||
|
|
4906e15d0d | ||
|
|
a2186a43a8 | ||
|
|
a501b72e40 | ||
|
|
b5f8a44beb | ||
|
|
49f447d02c | ||
|
|
15e1ce2e70 | ||
|
|
6b7b974318 | ||
|
|
59d9ccf48d | ||
|
|
4d9b5d4a2a | ||
|
|
4d286e567b | ||
|
|
89ed15c9c2 | ||
|
|
7a42e24400 | ||
|
|
f55f7f100f | ||
|
|
cd3a636813 | ||
|
|
19f66083f0 | ||
|
|
d70116bfbc | ||
|
|
2657a2bfb7 | ||
|
|
1a3b3bc130 | ||
|
|
78bac81a58 | ||
|
|
7daa6708d2 | ||
|
|
7bdb904af5 | ||
|
|
ad691001e2 | ||
|
|
1e56e41d63 | ||
|
|
269022ccae | ||
|
|
24c41f5190 | ||
|
|
5a3b595837 | ||
|
|
77bbe58197 | ||
|
|
3a27fbaae4 | ||
|
|
d821d75e25 | ||
|
|
51aeac33e9 | ||
|
|
31cbbbf953 | ||
|
|
0e4c1e86ed | ||
|
|
7653bb9399 | ||
|
|
da66bedf4f | ||
|
|
2ae0438660 | ||
|
|
f401e52398 | ||
|
|
0de5c97193 | ||
|
|
4b00fdeef0 | ||
|
|
f372a542b9 | ||
|
|
0cfb412220 | ||
|
|
cacf968970 | ||
|
|
2ab320a388 | ||
|
|
520841ee8a | ||
|
|
a486fec3c4 | ||
|
|
7bd4486ebd | ||
|
|
af813a8bad | ||
|
|
620a811f91 | ||
|
|
5e774d72b0 | ||
|
|
caf6c326ec | ||
|
|
83245aa58e | ||
|
|
54b71f0427 | ||
|
|
e2a75a8257 | ||
|
|
892e6a7fe9 | ||
|
|
c1b6a6d616 | ||
|
|
2746a6319a | ||
|
|
dde7b6f87a | ||
|
|
544bcbe664 | ||
|
|
8588b4823b | ||
|
|
07069cd502 | ||
|
|
796cc4e6ed | ||
|
|
1da78a7d25 | ||
|
|
ece1ee7ef2 | ||
|
|
0436601224 | ||
|
|
97ba9c9227 | ||
|
|
970f15d832 | ||
|
|
da6b175d01 | ||
|
|
cadd28072a | ||
|
|
35a794c2ed | ||
|
|
b6f3fe6957 | ||
|
|
dfc85cb5f5 | ||
|
|
25c5b39d05 | ||
|
|
a32ca90192 | ||
|
|
fc93601b98 | ||
|
|
a7f417f35c | ||
|
|
d317acaee8 | ||
|
|
430a19c604 | ||
|
|
564d779c2c | ||
|
|
f7912e9dc6 | ||
|
|
4906b76c85 | ||
|
|
d8e88aa017 | ||
|
|
26e3db423a | ||
|
|
466b79bf8f | ||
|
|
358cc5804a | ||
|
|
6949ab9761 | ||
|
|
65662315b6 | ||
|
|
64d36db5f4 | ||
|
|
e0afe6e94a | ||
|
|
f32292367a | ||
|
|
a78ad0d38d | ||
|
|
b757cc9414 | ||
|
|
241832853c | ||
|
|
a63d58daec | ||
|
|
1698022bea | ||
|
|
d9ff7bbcd2 | ||
|
|
a094deacf4 | ||
|
|
029a8a9d44 | ||
|
|
ecb594107e | ||
|
|
d0679da4f3 | ||
|
|
c6c60bcc80 | ||
|
|
b69edc1c35 | ||
|
|
76fd85450e | ||
|
|
2fb2613ec1 | ||
|
|
3b1e67628e | ||
|
|
508d5cb3a3 | ||
|
|
214f264bd0 | ||
|
|
111c0f71c3 | ||
|
|
40af40da4c | ||
|
|
9883c157f9 | ||
|
|
e19d7da4f9 | ||
|
|
afd2adf1f3 | ||
|
|
ed13ac2cc8 | ||
|
|
fe2c58fc92 | ||
|
|
fb10e0c797 | ||
|
|
6f183cb984 | ||
|
|
7f153b729f | ||
|
|
85fbf528bb | ||
|
|
80237630af | ||
|
|
cb9f046945 | ||
|
|
6d6910388e | ||
|
|
6d649473fa | ||
|
|
af888c534b | ||
|
|
e422b71a48 | ||
|
|
139d3c5e99 | ||
|
|
7bd2ff6851 | ||
|
|
722db4535a | ||
|
|
cad44221c8 | ||
|
|
a8c552d477 | ||
|
|
2ef1c8416f | ||
|
|
90a307bfa3 | ||
|
|
92a14eab59 | ||
|
|
6b776c82e7 | ||
|
|
ca05e942f2 | ||
|
|
3e05e18707 | ||
|
|
b3535db2aa | ||
|
|
f4d6efeee0 | ||
|
|
a6129bb789 | ||
|
|
b6387b954f | ||
|
|
dd926c7a1c | ||
|
|
5c41d0eb4c | ||
|
|
d255d511aa | ||
|
|
f3836ff8e8 | ||
|
|
103c7243a2 | ||
|
|
2760828e9d | ||
|
|
124693af37 | ||
|
|
7e98eac309 | ||
|
|
26c32b017e | ||
|
|
94aa9aff13 | ||
|
|
71026af678 | ||
|
|
e9e19b7cc6 | ||
|
|
48946b624b | ||
|
|
49eddd3feb | ||
|
|
f6b0869ee5 | ||
|
|
a73e9a24af | ||
|
|
95720106bb | ||
|
|
ab53ee1e7c | ||
|
|
a2d018a954 | ||
|
|
2b6bc5bcda | ||
|
|
c3876845b2 | ||
|
|
aedff1c117 | ||
|
|
bc6ce2a190 | ||
|
|
9ff52db3db | ||
|
|
4e15b54926 | ||
|
|
51225b3263 | ||
|
|
ebad199614 | ||
|
|
1381b58ceb | ||
|
|
1ef27e97a1 | ||
|
|
9d9ac66bb2 | ||
|
|
9abe99f236 | ||
|
|
4e6b7c1cde | ||
|
|
5786c6e4a3 | ||
|
|
c88037203b | ||
|
|
6a0059ddd5 | ||
|
|
53f2dcaa3a | ||
|
|
93b6e35bcb | ||
|
|
eda7e5fcdf | ||
|
|
9b85864e37 | ||
|
|
e2f42947e3 | ||
|
|
7fb1dc3f20 | ||
|
|
5b4a4af94d | ||
|
|
a1adddddfe | ||
|
|
a3994f975b | ||
|
|
2bcecbd62c | ||
|
|
5c930c318e | ||
|
|
14c768365c | ||
|
|
2c74e0ad8a | ||
|
|
a01b2ad8e6 | ||
|
|
558e045f63 | ||
|
|
449ea6e259 | ||
|
|
5fc170ff05 | ||
|
|
1213212c31 | ||
|
|
8be3f1f62f | ||
|
|
48c840fb76 | ||
|
|
337046ab75 | ||
|
|
34ee32d373 | ||
|
|
53bc96106d | ||
|
|
01bc7d7749 | ||
|
|
96f35d219c | ||
|
|
8bbb5dd078 | ||
|
|
a58e17a1d7 | ||
|
|
ea327cab84 | ||
|
|
eeb38ef677 | ||
|
|
a71b943a09 | ||
|
|
afec5e46a4 | ||
|
|
a57b2f233f | ||
|
|
a8b683d8e2 | ||
|
|
a3491224df | ||
|
|
0984dab1f2 | ||
|
|
69bc2e62fe | ||
|
|
3cf8a333d0 | ||
|
|
ec7d6955b8 | ||
|
|
db9e10f142 | ||
|
|
75efcbbff6 | ||
|
|
63588aff19 | ||
|
|
b39aba99f9 | ||
|
|
6a1dfdf292 | ||
|
|
7bbcaaaae9 | ||
|
|
8d46cf6651 | ||
|
|
f2dabeb19f | ||
|
|
961be77c93 | ||
|
|
f0304168ee | ||
|
|
dc05cd107c | ||
|
|
97313ba316 | ||
|
|
da3286a80d | ||
|
|
085e5898ae | ||
|
|
c03277f83d | ||
|
|
7760f5fe60 | ||
|
|
828f1f53ef | ||
|
|
34aefc62e4 | ||
|
|
5e1419c0b5 | ||
|
|
339caa61ef | ||
|
|
4a6d963ae1 | ||
|
|
27f99b3854 | ||
|
|
e0e793b912 | ||
|
|
234581ae6f | ||
|
|
a7e80fba9e | ||
|
|
ffef4d0507 | ||
|
|
c60c1b5ccc | ||
|
|
3236e9320f | ||
|
|
75b20014c1 | ||
|
|
fa542515e6 | ||
|
|
3e42d00c99 | ||
|
|
318d2b511b | ||
|
|
d1c3bd62de | ||
|
|
4f2ecfdee3 | ||
|
|
5299115020 | ||
|
|
c6a335501c | ||
|
|
38e3b7c4fa | ||
|
|
8e694dc40f | ||
|
|
8af5c8d421 | ||
|
|
c523d78358 | ||
|
|
5de03497c3 | ||
|
|
37211020ec | ||
|
|
1a42b23187 | ||
|
|
a34dc1d4ef | ||
|
|
7f183d29ac | ||
|
|
eb448f222a | ||
|
|
7adf07bcc7 | ||
|
|
75844d0063 | ||
|
|
756ec7e69f | ||
|
|
38ff2153c6 | ||
|
|
e0f5d4efbe | ||
|
|
ec83c93ea4 | ||
|
|
3929bbfb7b | ||
|
|
721ceee1e2 | ||
|
|
8bd0f3921f | ||
|
|
14606c301c | ||
|
|
dde2f3eefa | ||
|
|
562887ba5c | ||
|
|
14d74623b0 | ||
|
|
1c2358532f | ||
|
|
37eafc3d31 | ||
|
|
d4f78116e0 | ||
|
|
4dc5dfc72a | ||
|
|
b65a81b8af | ||
|
|
cbabfa8cff | ||
|
|
df290b499a | ||
|
|
4db7948d1a | ||
|
|
15a1b06d36 | ||
|
|
76f816b9f7 | ||
|
|
9c9e18ef32 | ||
|
|
ea3a182dbf | ||
|
|
32924c9bdb | ||
|
|
d32ef4329c | ||
|
|
dea03d715b | ||
|
|
f044e23a60 | ||
|
|
583b4b10a3 | ||
|
|
8fd16d0dcb | ||
|
|
b8602adee9 | ||
|
|
c3ad8bd75f | ||
|
|
e9ee9045ff | ||
|
|
5bc43df6f3 | ||
|
|
f72db27c5c | ||
|
|
1d35c4dcc6 | ||
|
|
970d2e942e | ||
|
|
9a9f1e00da | ||
|
|
d6d7435a6c | ||
|
|
bbe55b5ce9 | ||
|
|
462ad153e7 | ||
|
|
3ef1aeb8bd | ||
|
|
4a0aac3862 | ||
|
|
8cacc46f8b | ||
|
|
5ec3ed4674 |
6
.cvsignore → .gitignore
vendored
6
.cvsignore → .gitignore
vendored
@@ -8,9 +8,11 @@ config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
config.status.lineno
|
||||
config.rpath
|
||||
config.sub
|
||||
configure
|
||||
configure.lineno
|
||||
depcomp
|
||||
install-sh
|
||||
libtool
|
||||
@@ -18,7 +20,11 @@ ltmain.sh
|
||||
missing
|
||||
stamp-h1
|
||||
|
||||
*.o
|
||||
*~
|
||||
root
|
||||
tags
|
||||
cscope.out
|
||||
cscope.in.out
|
||||
cscope.po.out
|
||||
pacman-*.tar.gz
|
||||
9
AUTHORS
9
AUTHORS
@@ -3,11 +3,14 @@ Aurelien Foret <aurelien@archlinux.org>
|
||||
Aaron Griffin <aaron@archlinux.org>
|
||||
Dan McGee <dan@archlinux.org>
|
||||
|
||||
Mikl<EFBFBD>s Vajna <vmiklos@frugalware.org>
|
||||
Miklós Vajna <vmiklos@frugalware.org>
|
||||
Christian Hamar <krics@linuxforum.hu>
|
||||
|
||||
Josh Wheeler <deltalima@gmail.com>
|
||||
David Kimpe <DNAku@frugalware.org>
|
||||
|
||||
James Rosten <seinfeld90@gmail.com>
|
||||
Roman Kyrylych <Roman.Kyrylych@gmail.com>
|
||||
Andrew Fyfe <andrew@neptune-one.net>
|
||||
Chantry Xavier <shiningxc@gmail.com>
|
||||
Nagy Gabor <ngaba@petra.hos.u-szeged.hu>
|
||||
Nathan Jones <nathanj@insightbb.com>
|
||||
Allan McRae <mcrae_allan@hotmail.com>
|
||||
|
||||
31
COPYING
31
COPYING
@@ -1,9 +1,8 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@@ -16,7 +15,7 @@ software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
@@ -56,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
@@ -111,7 +110,7 @@ above, provided that you also meet all of these conditions:
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
@@ -169,7 +168,7 @@ access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
@@ -226,7 +225,7 @@ impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
@@ -279,8 +278,8 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
@@ -292,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -304,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
16
ChangeLog.proto
Normal file
16
ChangeLog.proto
Normal file
@@ -0,0 +1,16 @@
|
||||
2007-12-01 Your Name <youremail@domain.com>
|
||||
|
||||
* pkgver-pkgrel :
|
||||
new upstream release.
|
||||
Reason we changed stuff.
|
||||
Another reason we changed stuff.
|
||||
|
||||
* gcc-4.1.patch :
|
||||
Removed, no longer needed.
|
||||
|
||||
2007-11-01 Your Name <youremail@domain.com>
|
||||
|
||||
* 1.0-5 :
|
||||
added ChangeLog.
|
||||
the last line should end with just one newline.
|
||||
you can cat the file to check it displays fine.
|
||||
105
HACKING
105
HACKING
@@ -1,52 +1,71 @@
|
||||
Contributing to pacman
|
||||
======================
|
||||
Pacman - Contributing
|
||||
=====================
|
||||
|
||||
Please read 'submitting-patches' and 'translation-help' in the same directory
|
||||
as this file.
|
||||
This file is meant to give you a brief overview of coding style and other
|
||||
concerns when hacking on pacman. If you are interested in contributing, please
|
||||
read link:submitting-patches.html[submitting-patches] and
|
||||
link:translation-help.html[translation-help] as well.
|
||||
|
||||
Coding style
|
||||
------------
|
||||
|
||||
1. All code should be indented with tabs. (Ignore the use of only spaces in
|
||||
this file) By default, source files contain the following VIM modeline:
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
+
|
||||
[C]
|
||||
code~~~~~~~~~~
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
code~~~~~~~~~~
|
||||
|
||||
2. When opening new blocks such as 'while', 'if', or 'for', leave the opening
|
||||
brace on the same line as the beginning of the codeblock. The closing brace
|
||||
gets its own line (the only exception being 'else'). Do not use extra
|
||||
spaces around the parentheses of the block. ALWAYS use opening/closing
|
||||
braces, even if it's just a one-line block.
|
||||
spaces around the parentheses of the block. ALWAYS use opening and closing
|
||||
braces, even if it's just a one-line block. This reduces future error when
|
||||
blocks are expanded beyond one line.
|
||||
+
|
||||
[C]
|
||||
code~~~~~~~~~~
|
||||
for(lp = list; lp; lp = lp->next) {
|
||||
newlist = _alpm_list_add(newlist, strdup(lp->data));
|
||||
}
|
||||
|
||||
for(lp = list; lp; lp = lp->next) {
|
||||
newlist = _alpm_list_add(newlist, strdup(lp->data));
|
||||
}
|
||||
|
||||
while(it) {
|
||||
ptr = it->next;
|
||||
if(fn) {
|
||||
fn(it->data);
|
||||
} else {
|
||||
return(1);
|
||||
}
|
||||
free(it);
|
||||
it = ptr;
|
||||
}
|
||||
while(it) {
|
||||
ptr = it->next;
|
||||
if(fn) {
|
||||
fn(it->data);
|
||||
} else {
|
||||
return(1);
|
||||
}
|
||||
free(it);
|
||||
it = ptr;
|
||||
}
|
||||
code~~~~~~~~~~
|
||||
|
||||
3. When declaring a new function, put the opening and closing braces on their
|
||||
own line. Also, when declaring a pointer, do not put a space between the
|
||||
asterisk and the variable name.
|
||||
+
|
||||
[C]
|
||||
code~~~~~~~~~~
|
||||
alpm_list_t *alpm_list_add(alpm_list_t *list, void *data)
|
||||
{
|
||||
alpm_list_t *ptr, *lp;
|
||||
|
||||
pmlist_t *_alpm_list_add(pmlist_t *list, void *data)
|
||||
{
|
||||
pmlist_t *ptr, *lp;
|
||||
ptr = list;
|
||||
if(ptr == NULL) {
|
||||
...
|
||||
}
|
||||
...
|
||||
}
|
||||
code~~~~~~~~~~
|
||||
|
||||
ptr = list;
|
||||
if(ptr == NULL) {
|
||||
...
|
||||
}
|
||||
4. Comments should be ANSI-C89 compliant. That means no `// Comment` style;
|
||||
use only `/* Comment */` style.
|
||||
|
||||
4. Comments should be ANSI-C89 compliant. That means no "// Comment" style;
|
||||
use only "/* Comment */" style.
|
||||
/* This is a comment */
|
||||
NOT
|
||||
// This is a comment
|
||||
|
||||
5. Return statements should be written like a function call.
|
||||
|
||||
@@ -62,34 +81,58 @@ Coding style
|
||||
NOT
|
||||
sizeof(*mylist);
|
||||
|
||||
7. When using strcmp() (or any function that returns 0 on success) in a
|
||||
conditional statement, use != 0 or == 0 and not the negation (!) operator.
|
||||
It reads much cleaner for humans (using a negative to check for success is
|
||||
confusing) and the compiler will treat it correctly anyway.
|
||||
|
||||
if(strcmp(a, b) == 0)
|
||||
NOT
|
||||
if(!strcmp(a, b))
|
||||
|
||||
|
||||
Other Concerns
|
||||
--------------
|
||||
|
||||
Header Includes
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Currently our #include usage is in messy shape, but this is no reason to
|
||||
continue down this messy path. When adding an include to a file, follow this
|
||||
general pattern, including blank lines:
|
||||
|
||||
[C]
|
||||
code~~~~~~~~~~
|
||||
#include "config.h"
|
||||
|
||||
#include <standardheader.h>
|
||||
#include <another.h>
|
||||
#include <...>
|
||||
code~~~~~~~~~~
|
||||
|
||||
Follow this with some more headers, depending on whether the file is in libalpm
|
||||
or pacman proper. For libalpm:
|
||||
|
||||
[C]
|
||||
code~~~~~~~~~~
|
||||
/* libalpm */
|
||||
#include "yourfile.h"
|
||||
#include "alpm_list.h"
|
||||
#include "anythingelse.h"
|
||||
code~~~~~~~~~~
|
||||
|
||||
For pacman:
|
||||
|
||||
[C]
|
||||
code~~~~~~~~~~
|
||||
#include <alpm.h>
|
||||
#include <alpm_list.h>
|
||||
|
||||
/* pacman */
|
||||
#include "yourfile.h"
|
||||
#include "anythingelse.h"
|
||||
code~~~~~~~~~~
|
||||
|
||||
vim: set ts=2 sw=2 et:
|
||||
/////
|
||||
vim: set ts=2 sw=2 syntax=asciidoc et:
|
||||
/////
|
||||
|
||||
21
Makefile.am
21
Makefile.am
@@ -1,14 +1,27 @@
|
||||
SUBDIRS = lib/libalpm src/util src/pacman scripts doc etc pactest contrib
|
||||
|
||||
#DISTCHECK_CONFIGURE_FLAGS = --disable-fakeroot
|
||||
SUBDIRS = lib/libalpm src/util src/pacman scripts etc po pactest contrib
|
||||
if WANT_DOC
|
||||
SUBDIRS += doc
|
||||
endif
|
||||
|
||||
# Some files automatically included, so they aren't specified below:
|
||||
# AUTHORS, COPYING, NEWS, README
|
||||
EXTRA_DIST = HACKING
|
||||
|
||||
# Sample makepkg prototype files
|
||||
pkgdatadir = ${datadir}/${PACKAGE}
|
||||
dist_pkgdata_DATA = PKGBUILD.proto proto.install ChangeLog.proto
|
||||
|
||||
# run the pactest test suite
|
||||
check-local: src/pacman
|
||||
python $(top_srcdir)/pactest/pactest.py --debug=1 \
|
||||
$(PYTHON) $(top_srcdir)/pactest/pactest.py --debug=1 \
|
||||
--test $(top_srcdir)/pactest/tests/*.py \
|
||||
-p $(top_builddir)/src/pacman/pacman
|
||||
rm -rf $(top_builddir)/root
|
||||
|
||||
# create the pacman DB and cache directories upon install
|
||||
install-data-local:
|
||||
for dir in "$(DESTDIR)$(localstatedir)/lib/pacman" "$(DESTDIR)$(localstatedir)/cache/pacman/pkg"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
|
||||
# vim:set ts=2 sw=2 noet:
|
||||
|
||||
169
NEWS
169
NEWS
@@ -1,5 +1,142 @@
|
||||
VERSION DESCRIPTION
|
||||
-----------------------------------------------------------------------------
|
||||
3.1.2 - updates to proto.install, add ChangeLog.proto (FS#7231)
|
||||
- add 'force' option to packages, and have repo-add respect it
|
||||
- mark gensync and updatesync as deprecated
|
||||
- fix pacman -Qo behavior on symlinks (FS#9473)
|
||||
- fix segfault on a broken symlinks in backup code (FS#9235)
|
||||
- ensure filename is determined correctly for a pkg (FS#9547)
|
||||
- fix conflict progress bar with UTF-8 chars (FS#6437)
|
||||
- fix chk_fileconflicts brokenness, ensure it reads entire list
|
||||
- ensure -Sc operation locks DB, only checks DBs (FS#9609)
|
||||
- minor documentation and message updates
|
||||
- moved some translations to their more generic lang codes
|
||||
- allow scripts to be run without gettext installed
|
||||
- makepkg:
|
||||
- check to ensure we have non-URL sources (FS#9208)
|
||||
- ensure we strip binaries in /opt/ dirs (FS#9342)
|
||||
- check for VCS executable before using (FS#9230)
|
||||
- set sane umask before source extraction (FS#9242, FS#9362)
|
||||
3.1.1 - fix versioned provisions handling- use '=' instead of ' ' which
|
||||
differs from original spec but better in long run (FS#9171)
|
||||
- rename query --orphans to --unrequired (FS#9144)
|
||||
- fix segfault when cachedir is unusable (FS#9186)
|
||||
- missing SYMEXPORT on libalpm functions (FS#9155)
|
||||
- notify of package replacements when using --noconfirm (FS#5179)
|
||||
- fix usage of PKGEXT by gensync/updatesync (FS#9190)
|
||||
- ensure correct dir permissions in database (FS#9176)
|
||||
- ensure /tmp is created with correct permissions (FS#9183)
|
||||
- disallow NULL section in parseconfig (reported on forums)
|
||||
- remove Arch-specific pacman.conf and mirrorlist from source
|
||||
- makepkg: --holdver option for devel PKGBUILDs (FS#9194)
|
||||
- documentation updates (FS# 9142, 9146, 9175, 9192, 9204)
|
||||
- many translation updates
|
||||
3.1.0 - paths are now specified as absolute paths (or defaulting to
|
||||
under the specified root directory)
|
||||
- all paths can be specified in pacman.conf or on command line
|
||||
- updates to pacman clean operation- now cleans uninstalled
|
||||
packages and old sync DBs (FS#8061)
|
||||
- remove all hardcoded paths and allow them to be set at
|
||||
configure/build time
|
||||
- single mirrorfile- pacman substitutes the repository name in
|
||||
mirror file when $repo is found (FS#6389)
|
||||
- New config file options: ShowSize, TotalDownload, IgnoreGroup,
|
||||
UseDelta
|
||||
- all scripts have been gettext-ized and can be translated
|
||||
- added testdb utility to check pacman DBs for common problems
|
||||
- huge additions to pactest suite
|
||||
- remove -F/--freshen operation
|
||||
- add --ignoregroup option (FS#1592)
|
||||
- --ignore and --ignoregroup accept comma separated lists
|
||||
- add --needed option for --sync
|
||||
- massive optimization and speedup for --owns
|
||||
- add -q/--quiet option for -Ss/-Sl and -Q? output (FS#8470)
|
||||
- add --asdeps option (install reason: dependency) (FS#7193)
|
||||
- replace "Total Package Size" with "Total Download Size"
|
||||
(FS#4182)
|
||||
- fix -Q options to work on installed packages AND package files
|
||||
- change -Q/--query options to act as filters and increase their
|
||||
flexibility
|
||||
- -U/-A <url> now downloads to cachedir (FS#6404)
|
||||
- install and build dates are localized
|
||||
- optdepends support
|
||||
- delta support
|
||||
- versioned provisions support
|
||||
- versioned conflicts support
|
||||
- add < and > operators for versioned dependencies and conflicts
|
||||
- bash completion updates
|
||||
- mirrorlist updates
|
||||
- removed ABS script from codebase (now a separate project)
|
||||
- allow multiple pacman cache directories
|
||||
- all manpages are now generated using Asciidoc (FS#7312)
|
||||
- moved parseconfig from backend library to frontend
|
||||
- clean up and refactoring of the ENTIRE codebase
|
||||
- remove many useless #ifdefs
|
||||
- split many too-long functions
|
||||
- portability updates: compiles and passes tests on BSD and
|
||||
Darwin (switching libdownload->libfetch)
|
||||
- clean up build process
|
||||
- use of static code analysis
|
||||
- memory leak fixes all over the place
|
||||
- fix overzealous use of macros
|
||||
- entire codebase builds with -pedantic GCC option
|
||||
- libalpm-specific changes:
|
||||
- moved location of sync DBs into their own folder to thwart
|
||||
deletion and remove naming limitations
|
||||
- REQUIREDBY entries are no longer used in local DB but are
|
||||
computed on the fly when needed, which should resolve
|
||||
phantom dependency issues (FS#7639)
|
||||
- ensure we export everything that should be public
|
||||
- fix some const correctness issues
|
||||
- add list tail ptr shortcut to make last element lookups O(1)
|
||||
- database dates are stored as seconds from epoch
|
||||
- removed SHA1 support
|
||||
- drop in new MD5 library
|
||||
- implement topological sorting for dependencies
|
||||
- do case sensitive compare in parse_descfile (FS#8081)
|
||||
- remove hardcoded architectures
|
||||
- conflicts checking speedups and fixes
|
||||
- move lockfile location to inside the DB
|
||||
- remove gettext calls from DEBUG messages
|
||||
- remove faulty diskspace checking
|
||||
- move functions out of alpm.c to where they belong
|
||||
- rewrite of file extraction code (FS#7484)
|
||||
- makepkg-specific changes:
|
||||
- entire script has been functionalized
|
||||
- only runs in fakeroot when necessary
|
||||
- hard linked manpages are now compressed (FS#5392)
|
||||
- built-in versionpkg support
|
||||
- arch=('any') support (FS#8153)
|
||||
- clean up and prettify the output
|
||||
- replace tar/cpio/unzip with bsdtar (FS#7485)
|
||||
- add --ignorearch option (FS#7355)
|
||||
- improved error handling
|
||||
- downloads straight to $SRCDEST to avoid copies (FS#7271)
|
||||
- support for multiple download protocols (FS#4404)
|
||||
- remove --usesudo option, use it by default
|
||||
- add --asroot option to discourage building as root
|
||||
- add $srcdir and $pkgdir variables (FS#7278)
|
||||
- add source package creation option
|
||||
- rankmirrors- allow reading from stdin (FS#8043)
|
||||
- and many other updates: 198 bugs/FRs closed since 3.0.0 release
|
||||
- switch to GIT for source code management
|
||||
3.0.6 - config files updated to reflect current -> core change
|
||||
- fix symlink overwriting issue (FS#7484)
|
||||
- fix config parsing with tr_TR locale (FS#7235)
|
||||
- use AC_SYS_LARGEFILE if available (FS#7578)
|
||||
3.0.5 - add -mtune=generic to default CFLAGS in makepkg.conf
|
||||
- small updates to translations
|
||||
- repo-add: fix conflicts issue for real this time
|
||||
- fix issue with libarchive incorrectly setting permissions
|
||||
3.0.4 - updated translations
|
||||
- repo-add: fix issue where conflicts were not put in database
|
||||
3.0.3 - updated translations
|
||||
- repo-add: fixed a desc file clobbering issue
|
||||
3.0.2 - fix a bug where pre/post_remove scriptlets were not ran
|
||||
- ensure ldconfig is ran in all operations
|
||||
- added a few new translations, updated existing ones
|
||||
- updated mirror lists
|
||||
- makepkg: ensure CFLAGS are exported to build function
|
||||
3.0.1 - fix a locale issue with tr_TR upper/lower-case conversion
|
||||
- allow removal when listing the same package multiple times
|
||||
- fix a repo-add bug that left a .PKGINFO file in the current
|
||||
@@ -156,15 +293,15 @@ VERSION DESCRIPTION
|
||||
- Smarter file-conflict checking with symlinked paths and
|
||||
with files that move from one package to another
|
||||
2.8 - Bugfixes:
|
||||
- #861: file:/// urls not handled properly with XferCommand
|
||||
- #1003: set umask before scriptlet calls
|
||||
- #1027: download problems with http urls using -U/-A
|
||||
- #1044: segfaults when using -Rs
|
||||
- #863: "missing post_remove" errors with some packages
|
||||
- #875: detect low disk space properly
|
||||
- #986: makepkg -e doesn't validate files
|
||||
- #1010: add -j option to makepkg
|
||||
- #1028: make pacman -Sp runnable as non-root
|
||||
- FS#861: file:/// urls not handled properly with XferCommand
|
||||
- FS#1003: set umask before scriptlet calls
|
||||
- FS#1027: download problems with http urls using -U/-A
|
||||
- FS#1044: segfaults when using -Rs
|
||||
- FS#863: "missing post_remove" errors with some packages
|
||||
- FS#875: detect low disk space properly
|
||||
- FS#986: makepkg -e doesn't validate files
|
||||
- FS#1010: add -j option to makepkg
|
||||
- FS#1028: make pacman -Sp runnable as non-root
|
||||
- added pre_install and pre_upgrade scriptlet support
|
||||
- added an "Architecture" field in the package meta-data
|
||||
- added patch from Aurelien Foret which improves performance
|
||||
@@ -177,7 +314,7 @@ VERSION DESCRIPTION
|
||||
2.7.9 - added the "force" option to packages, so --sysupgrade can
|
||||
downgrade packages when it needs to
|
||||
2.7.8 - added post_remove scriptlet support
|
||||
- added -Qs option (bug #854)
|
||||
- added -Qs option (FS#854)
|
||||
- a provisio does not imply conflict, to make a provisio target
|
||||
conflict with anything else that provides the same thing, you
|
||||
can now do this by specifying the provisio target as both a
|
||||
@@ -186,10 +323,10 @@ VERSION DESCRIPTION
|
||||
provides=('x-server')
|
||||
- cleaned up the download progress bar a bit
|
||||
- added %o parameter to XferCommand so wget can resume properly
|
||||
- fixed a segfault in downloadfiles() (bug #787)
|
||||
- fixed a segfault in downloadfiles() (FS#787)
|
||||
- patches from Oliver Burnett-Hall
|
||||
- gensync uses a better temp dir (bug #774)
|
||||
- PKGDEST can be set in makepkg.conf (bug #783)
|
||||
- gensync uses a better temp dir (FS#774)
|
||||
- PKGDEST can be set in makepkg.conf (FS#783)
|
||||
- patches from Aurelien Foret
|
||||
- segfault fix, couple memory leaks
|
||||
- more sanity checks in "provides" searches
|
||||
@@ -203,7 +340,7 @@ VERSION DESCRIPTION
|
||||
- -Ss now searches thru provides fields
|
||||
- added --dbonly option to -R
|
||||
2.7.6 - added --print-uris option
|
||||
- fixed an http download bug (bug #667)
|
||||
- fixed an http download bug (FS#667)
|
||||
- fixed a segfault related to replaces/conflicts handling
|
||||
2.7.5 - "replaces" packages were ignoring IgnorePkg in pacman.conf
|
||||
- fixed another bug in conflict handling
|
||||
@@ -219,7 +356,7 @@ VERSION DESCRIPTION
|
||||
- You can now use the --info option with --sync to display an
|
||||
uninstalled package's dependency info.
|
||||
- Added a sane umask before db writes
|
||||
- buffer overflow fix (bug #442)
|
||||
- buffer overflow fix (FS#442)
|
||||
2.7.3 - makepkg not longer strips files with .exe or .dll extensions
|
||||
- Added Aurelien's patch:
|
||||
- proxy support (no authentication yet)
|
||||
@@ -248,7 +385,7 @@ VERSION DESCRIPTION
|
||||
2.6.3 - A couple memory fixes in the new replaces code
|
||||
2.6.2 - Fixed a memory cleanup bug
|
||||
- Aurelien's patch:
|
||||
- bug #159 implemented (for -S and -R)
|
||||
- FS#159 implemented (for -S and -R)
|
||||
- fixed a bug with pacman -Sg (pacman was browsing only one
|
||||
db to get groups)
|
||||
- fixed a bug with list_merge()
|
||||
|
||||
35
PKGBUILD.proto
Normal file
35
PKGBUILD.proto
Normal file
@@ -0,0 +1,35 @@
|
||||
# This is an example PKGBUILD file. Use this as a start to creating your own,
|
||||
# and remove these comments. For more information, see 'man PKGBUILD'.
|
||||
# NOTE: Please fill out the license field for your package! If it is unknown,
|
||||
# then please put 'unknown'.
|
||||
|
||||
# Contributor: Your Name <youremail@domain.com>
|
||||
pkgname=NAME
|
||||
pkgver=VERSION
|
||||
pkgrel=1
|
||||
pkgdesc=""
|
||||
arch=()
|
||||
url=""
|
||||
license=('GPL')
|
||||
groups=()
|
||||
depends=()
|
||||
makedepends=()
|
||||
provides=()
|
||||
conflicts=()
|
||||
replaces=()
|
||||
backup=()
|
||||
options=()
|
||||
install=
|
||||
source=($pkgname-$pkgver.tar.gz)
|
||||
noextract=()
|
||||
md5sums=() #generate with 'makepkg -g'
|
||||
|
||||
build() {
|
||||
cd "$srcdir/$pkgname-$pkgver"
|
||||
|
||||
./configure --prefix=/usr
|
||||
make || return 1
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
||||
# vim:set ts=2 sw=2 et:
|
||||
1
README
1
README
@@ -59,7 +59,6 @@ library is initialized.
|
||||
* cachedir: The base path to pacman's download cache (Default: var/cache/pacman)
|
||||
* logfile: The base path to pacman's log file (Default: var/log/pacman.log)
|
||||
* usesyslog: Log to syslog instead of `logfile` for file-base logging.
|
||||
* upgradedelay: The time span to wait before listing a package as an upgrade (Default: 0)
|
||||
* xfercommand: The command to use for downloading instead of pacman's internal
|
||||
downloading functionality.
|
||||
* nopassiveftp: Do not use passive FTP commands for ftp connections.
|
||||
|
||||
14
TODO.aaron
14
TODO.aaron
@@ -6,16 +6,6 @@
|
||||
"replaces" packages to the front end, so the frontend can handle the QUESTION()
|
||||
stuff in that case
|
||||
|
||||
* Look into other VCSs to use. The main CVS repo will remain, but having a
|
||||
distributed system to allow for easy patching/pushing/pulling would be nice
|
||||
- monotone and mercurial look like the top contenders in my book, but I need
|
||||
to evaluate both a bit more.
|
||||
|
||||
* src/pacman:
|
||||
There's quite a few single function headers which contain the pacman_*
|
||||
functions. We should move these to a single header (pacman.h) to clean up
|
||||
the source a bit.
|
||||
|
||||
* libalpm -> front end communication needs a work-up. Both progress functions
|
||||
can be combined into one callback, IFF we adjust it to accept a prefix string
|
||||
for the progress bars, and format it at the lib side. Question functions
|
||||
@@ -45,10 +35,6 @@
|
||||
|
||||
* pacman: fixup doxygen documentation for public interface
|
||||
|
||||
* libalpm: just because a function is in alpm.h doesn't mean it needs to be in
|
||||
alpm.c - we should move functions around where they should be. In fact,
|
||||
alpm.c might not be needed at all, if things were organized properly.
|
||||
|
||||
* feature for 3.1: package file hooks *
|
||||
I've been planning on this one for some time. Here's a simple rundown:
|
||||
in /etc/pacman.d/hooks:
|
||||
|
||||
49
TODO.dan
49
TODO.dan
@@ -4,23 +4,9 @@ TODO.dan
|
||||
This is my personal TODO list. No guarantees if it is out of date and things no
|
||||
longer apply. If you want to help out with any of it, send me an email.
|
||||
|
||||
Only vaguely related to pacman:
|
||||
-------------------------------
|
||||
|
||||
Port the libdownload (libfetch) manpage from BSD style to Linux style, or at
|
||||
very least change references to BSD.
|
||||
|
||||
|
||||
Pacman 3.1:
|
||||
-----------
|
||||
|
||||
Documentation- look into moving man page format to a more portable source
|
||||
format to make translation easier to keep up-to-date (something like txt2tags,
|
||||
docbook, asciidoc) This will need some research.
|
||||
|
||||
Update cache cleaning functionality - keep installed version, choose number to
|
||||
keep, etc. Good python script in the forums that we should try to emulate.
|
||||
|
||||
Downgrade feature - allow users to see cached packages and downgrade to
|
||||
(previous or any?) available options.
|
||||
|
||||
@@ -46,12 +32,6 @@ another FS bug), etc. Remove the -A flag and possibly -D, -T, and -Y (-Y is
|
||||
killed now in favor of vercmp binary) if they can be done by other actions.
|
||||
Possible switch of -U --> -I (#5571).
|
||||
|
||||
Rewrite _alpm_sortbydeps to use Topological Sort. Should work using a standard
|
||||
topo sort algorithm, once the crazy types can be fixed up a bit. Include a
|
||||
cycle check - print a big error message if this happens.
|
||||
-- http://en.wikipedia.org/wiki/Topological_sort
|
||||
-- http://everything2.com/?node_id=556079
|
||||
|
||||
Review display and logging functions. There seems to be an abundance of them.
|
||||
Make it extensible to use color, review what verbose/debug means. Perhaps
|
||||
separate logging functionality- Pacman has its normal log, and alpm backend
|
||||
@@ -59,12 +39,6 @@ keeps a very simple log file - listing only adds (including syncs) and removes.
|
||||
This way a consistency list can be kept of what is currently installed and what
|
||||
isn't, without all the logging junk from the front end.
|
||||
|
||||
If we stick with autotools, add more defines to configure.in, including
|
||||
CACHEDIR, PKGEXT, so these can be specified at configure time for ease of use
|
||||
by other distributions which may want to change the defaults. Also, review what
|
||||
needs to be in config.h and what does not. There may be excess #depends which
|
||||
are hard coded into the sources. (from TODO.autoconf)
|
||||
|
||||
Profile the code. Find the functions that are being called a lot, and see what
|
||||
can be done about it. Find out if all these calls are necessary (e.g. excessive
|
||||
alpm_list_count calls), and maybe think about changing data structures to speed
|
||||
@@ -72,12 +46,10 @@ operations up (e.g. a 'count' field). NOTE: already found two huge issues with
|
||||
quick profiling- excessive setlocale calls, and extremely excessive strcmp
|
||||
calls.
|
||||
|
||||
Localize the date display done in --info output. Also, fix other localized
|
||||
issues- use non-printf when necessary, make sure all two line printed messages
|
||||
(especially usage instructions) are printed using one print statement. We
|
||||
may need to use some wchar_t output on the progress bar as char/byte counts
|
||||
differ here. Sizes of packages (e.g. 10,400.23 MB) should all be localized with
|
||||
correct seperators.
|
||||
Fix other localized issues- use non-printf when necessary. We may need to use
|
||||
some wchar_t output on the progress bar as char/byte counts differ here. Sizes
|
||||
of packages (e.g. 10,400.23 MB) should all be localized with correct
|
||||
seperators.
|
||||
|
||||
Rewrite makepkg to use terminal-safe coloring/bolding. tput utility should
|
||||
allow us to do this. Make universal message functions for systemwide use,
|
||||
@@ -86,11 +58,6 @@ including all pacman utilites- abs, pacman-optimize, etc.
|
||||
Bugs/FRs to smash: 6468, 6437, 6430?, 6420, 6404, 6389, 6312?, 6284, 6273?,
|
||||
6255?, 6208, 5987, 5885, 5571, 4182, 3492, 2810?, 1769, 1588, 1571
|
||||
|
||||
Remove _alpm from function names now that we have SYMHIDDEN and static
|
||||
declarations.
|
||||
|
||||
Remove alpm.c, put functions where they should be.
|
||||
|
||||
Update doxygen comments, they may need some work. Try to document all of the
|
||||
private internal functions too- it helps a ton for people just getting a
|
||||
start on pacman hacking.
|
||||
@@ -106,8 +73,6 @@ Update copyrights (2007)
|
||||
|
||||
Update pacman website, and add/finish pacman coding style page
|
||||
|
||||
autogen.sh / autoclean.sh - these seem messy. Can we clean this up?
|
||||
|
||||
Refine makepkg error codes. Each kind of failure could have its own code:
|
||||
--package already built
|
||||
--failed integ checks
|
||||
@@ -119,14 +84,8 @@ to KB, MB, GB.
|
||||
|
||||
Revamp the downloadprog function a bit. Seems kind of messy.
|
||||
|
||||
Add localized pkgdesc variables to makepkg.
|
||||
|
||||
--print-uri option to sync should not require saying yes or no to up to date
|
||||
|
||||
Add testing scripts to pactest for issues we have been working on (especially
|
||||
files moving between packages). Also, take a look at cleaning up the output and
|
||||
structure of the pactest.py program itself.
|
||||
|
||||
Build a replacement for this, or at least standardize its use. We shouldn't
|
||||
always need to pass handle->root around, it is constant. Something like char*
|
||||
buildpath(file).
|
||||
|
||||
43
TRANSLATORS
Normal file
43
TRANSLATORS
Normal file
@@ -0,0 +1,43 @@
|
||||
Thanks to all of those who have helped translate pacman, both in the past
|
||||
and currently. Here are some of the current translators (past translators
|
||||
can be found by looking in the GIT history).
|
||||
|
||||
If your language is listed here and you are interested in helping translate,
|
||||
contact either the pacman mailing list at pacman-dev@archlinux.org, or one
|
||||
of the translators listed above.
|
||||
|
||||
If your language is not listed here and you wish it was, let the pacman mailing
|
||||
list know you are interested in making a translation. We will be happy to add
|
||||
your language to the mix.
|
||||
|
||||
* indicates the last active translator.
|
||||
|
||||
Czech (cs):
|
||||
* Vojtěch Gondžala <vogo@seznam.cz>
|
||||
German (de):
|
||||
* Matthias Gorissen <matthias@archlinux.de>
|
||||
Pierre Schmitz <pierre@archlinux.de>
|
||||
British English (en_GB):
|
||||
* Jeff Bailes <thepizzaking@gmail.com>
|
||||
Spanish (es):
|
||||
* Juan Pablo González Tognarelli <lord_jotape@yahoo.com.ar>
|
||||
French (fr):
|
||||
* Chantry Xavier <shiningxc@gmail.com>
|
||||
solsTiCe d'Hiver <solstice.dhiver@laposte.net>
|
||||
Hungarian (hu):
|
||||
* Nagy Gabor <ngaba@bibl.u-szeged.hu>
|
||||
Italian (it):
|
||||
* Giovanni 'voidnull' Scafora <linuxmania@gmail.com>
|
||||
Alessio 'mOLOk' Bolognino <themolok@gmail.com>
|
||||
Lorenzo '^zanDarK' Masini <lorenxo86@gmail.com>
|
||||
Polish (pl):
|
||||
* Mateusz Jędrasik <m.jedrasik@gmail.com>
|
||||
Brazilian Portuguese (pt_BR):
|
||||
* João Felipe Santos <joao.eel@gmail.com>
|
||||
Douglas Soares de Andrade <douglas@archlinux-br.org>
|
||||
Hugo Doria <hugodoria@archlinux-br.org>
|
||||
Lincoln de Sousa <lincoln@archlinux-br.org>
|
||||
Leandro Inácio <leandro@archlinux-br.org>
|
||||
Russian (ru):
|
||||
Vladimir Bayrakovskiy <4rayven@gmail.com>
|
||||
|
||||
2123
acinclude.m4
2123
acinclude.m4
File diff suppressed because it is too large
Load Diff
4
config.guess
vendored
4
config.guess
vendored
@@ -4,7 +4,7 @@
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
timestamp='2007-03-06'
|
||||
timestamp='2007-05-17'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -330,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
|
||||
6
config.sub
vendored
6
config.sub
vendored
@@ -4,7 +4,7 @@
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
timestamp='2007-01-18'
|
||||
timestamp='2007-04-29'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@@ -683,6 +683,10 @@ case $basic_machine in
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
basic_machine=arm-unknown
|
||||
os=-mingw32ce
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
|
||||
411
configure.ac
411
configure.ac
@@ -1,225 +1,362 @@
|
||||
ENV_CFLAGS=$CFLAGS
|
||||
CFLAGS=""
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
# Minimum version of autoconf required
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
# UPDATING VERSION NUMBERS FOR RELEASES
|
||||
#
|
||||
# libalpm:
|
||||
# current
|
||||
# The most recent interface number that this library implements.
|
||||
# revision
|
||||
# The implementation number of the current interface.
|
||||
# age
|
||||
# The difference between the newest and oldest interfaces that this library
|
||||
# implements. In other words, the library implements all the interface
|
||||
# numbers in the range from number current - age to current.
|
||||
#
|
||||
# 1. Start with version information of `0:0:0' for each libtool library.
|
||||
# 2. Update the version information only immediately before a public release of
|
||||
# your software. More frequent updates are unnecessary, and only guarantee
|
||||
# that the current interface number gets larger faster.
|
||||
# 3. If the library source code has changed at all since the last update, then
|
||||
# increment revision (`c:r:a' becomes `c:r+1:a').
|
||||
# 4. If any interfaces have been added, removed, or changed since the last
|
||||
# update, increment current, and set revision to 0.
|
||||
# 5. If any interfaces have been added since the last public release, then
|
||||
# increment age.
|
||||
# 6. If any interfaces have been removed since the last public release, then
|
||||
# set age to 0.
|
||||
#
|
||||
# pacman:
|
||||
# Extreme huge major changes:
|
||||
# pacman_version_major += 1
|
||||
# pacman_version_minor = 0
|
||||
# pacman_version_micro = 0
|
||||
#
|
||||
# Real releases:
|
||||
# pacman_version_minor += 1
|
||||
# pacman_version_micro = 0
|
||||
#
|
||||
# Bugfix releases:
|
||||
# pacman_version_micro += 1
|
||||
#
|
||||
# pacman_version_suffix should be similar to one of the following:
|
||||
# For beta releases: [beta2]
|
||||
# For code under development: [devel]
|
||||
# For production releases: []
|
||||
|
||||
m4_define([lib_current], [4])
|
||||
m4_define([lib_revision], [0])
|
||||
m4_define([lib_age], [2])
|
||||
|
||||
m4_define([pacman_version_major], [3])
|
||||
m4_define([pacman_version_minor], [1])
|
||||
m4_define([pacman_version_micro], [2])
|
||||
m4_define([pacman_version_suffix], [])
|
||||
m4_define([pacman_version],
|
||||
[pacman_version_major.pacman_version_minor.pacman_version_micro])
|
||||
m4_define([pacman_display_version],
|
||||
pacman_version[]m4_ifdef([pacman_version_suffix],[pacman_version_suffix]))
|
||||
|
||||
# Autoconf initialization
|
||||
# AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
|
||||
AC_INIT([Pacman Package Manager], [pacman_display_version],
|
||||
[pacman-dev@archlinux.org], [pacman])
|
||||
AC_CONFIG_SRCDIR([config.h.in])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
dnl Update it right before the release since $pkgver_foo are all _post_ release snapshots
|
||||
AC_INIT([Pacman package manager], 3.0.1, [pacman-dev@archlinux.org], [pacman])
|
||||
AC_LANG([C])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
AC_CANONICAL_HOST
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
LIB_VERSION=`expr lib_current - lib_age`.lib_age.lib_revision
|
||||
LIB_VERSION_INFO="lib_current:lib_revision:lib_age"
|
||||
|
||||
# Set subsitution values for version stuff in Makefiles and anywhere else,
|
||||
# and put LIB_VERSION in config.h
|
||||
AC_SUBST(LIB_VERSION)
|
||||
AC_SUBST(LIB_VERSION_INFO)
|
||||
AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number])
|
||||
|
||||
# Help line for root directory
|
||||
AC_ARG_WITH(root-dir,
|
||||
AC_HELP_STRING([--with-root-dir=path], [set the location of pacman's root operating directory]),
|
||||
[ROOTDIR=$withval], [ROOTDIR=/])
|
||||
|
||||
# Help line for package extension
|
||||
AC_ARG_WITH(pkg-ext,
|
||||
AC_HELP_STRING([--with-pkg-ext=ext], [set the file extension used by packages]),
|
||||
[PKGEXT=$withval], [PKGEXT=.pkg.tar.gz])
|
||||
|
||||
# Help line for source package directory
|
||||
AC_ARG_WITH(src-ext,
|
||||
AC_HELP_STRING([--with-src-ext=ext], [set the file extension used by source packages]),
|
||||
[SRCEXT=$withval], [SRCEXT=.src.tar.gz])
|
||||
|
||||
# Help line for database extension
|
||||
AC_ARG_WITH(db-ext,
|
||||
AC_HELP_STRING([--with-db-ext=ext], [set the file extension used by the database]),
|
||||
[DBEXT=$withval], [DBEXT=.db.tar.gz])
|
||||
|
||||
# Help line for documentation
|
||||
AC_ARG_ENABLE(doc,
|
||||
AC_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]),
|
||||
[wantdoc=$enableval], [wantdoc=yes])
|
||||
|
||||
# Help line for doxygen
|
||||
AC_ARG_ENABLE(doxygen,
|
||||
AC_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
|
||||
[wantdoxygen=$enableval], [wantdoxygen=no])
|
||||
|
||||
# Help line for asciidoc
|
||||
AC_ARG_ENABLE(asciidoc,
|
||||
AC_HELP_STRING([--enable-asciidoc], [build your own manpages with Asciidoc]),
|
||||
[wantasciidoc=$enableval], [wantasciidoc=no])
|
||||
|
||||
# Help line for debug
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug], [enable debugging support]),
|
||||
[debug=$enableval], [debug=no])
|
||||
|
||||
# Help line for pacman.static
|
||||
AC_ARG_ENABLE(pacman-static,
|
||||
AC_HELP_STRING([--disable-pacman-static], [do not build static version of pacman]),
|
||||
[pacmanstatic=$enableval], [pacmanstatic=yes])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_AWK
|
||||
AC_PROG_CC_C99
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_LIBTOOL
|
||||
AC_CHECK_PROGS([PYTHON], [python2.5 python2.4 python], [false])
|
||||
|
||||
# find installed gettext
|
||||
AM_GNU_GETTEXT([external])
|
||||
AM_GNU_GETTEXT_VERSION(0.13.1)
|
||||
|
||||
dnl Define the libalpm version number here
|
||||
LIB_MAJOR_VERSION=1
|
||||
LIB_MINOR_VERSION=0
|
||||
LIB_MICRO_VERSION=0
|
||||
LIB_VERSION=$LIB_MAJOR_VERSION.$LIB_MINOR_VERSION.$LIB_MICRO_VERSION
|
||||
dnl Needed for libtool to create proper shared lib version.
|
||||
dnl This is not completely correct- see
|
||||
dnl http://sourceware.org/autobook/autobook/autobook_91.html for details.
|
||||
LIB_VERSION_INFO=`expr $LIB_MAJOR_VERSION + $LIB_MINOR_VERSION`:$LIB_MICRO_VERSION:$LIB_MINOR_VERSION
|
||||
# Check for libarchive
|
||||
AC_CHECK_LIB([archive], [archive_read_data], , AC_MSG_ERROR([libarchive is needed to compile pacman!]))
|
||||
|
||||
dnl Set subsitution values for version stuff in Makefiles and anywhere else
|
||||
AC_SUBST(LIB_VERSION)
|
||||
AC_SUBST(LIB_VERSION_INFO)
|
||||
# Check for libdownload
|
||||
AC_CHECK_LIB([download], [downloadParseURL], , AC_MSG_ERROR([libdownload is needed to compile pacman!]))
|
||||
|
||||
dnl Put version number in config.h
|
||||
AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number])
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/statvfs.h sys/time.h syslog.h wchar.h])
|
||||
|
||||
dnl Configuration files
|
||||
dnl AC_CONFIG_FILES([etc/makepkg.conf] [etc/pacman.conf])
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_INLINE
|
||||
AC_TYPE_MODE_T
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_STRUCT_TM
|
||||
AC_TYPE_UID_T
|
||||
|
||||
AC_PROG_CC
|
||||
AC_HEADER_STDC
|
||||
AC_PROG_INSTALL
|
||||
AC_CHECK_FUNCS([strverscmp])
|
||||
AM_PROG_LIBTOOL
|
||||
AM_CONDITIONAL(LINKSTATIC, test "$enable_static" = "yes")
|
||||
# Checks for library functions.
|
||||
AC_FUNC_CLOSEDIR_VOID
|
||||
AC_FUNC_FORK
|
||||
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
|
||||
AC_FUNC_MKTIME
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS([realpath regcomp strcasecmp strdup strerror strnlen \
|
||||
strndup strrchr strsep strstr strverscmp uname geteuid])
|
||||
|
||||
dnl Help line for doxygen
|
||||
AC_ARG_ENABLE(doxygen,
|
||||
AC_HELP_STRING([--disable-doxygen], [Build API docs via Doxygen]),
|
||||
[wantdoxygen=$enableval], [wantdoxygen=yes])
|
||||
# Enable large file support if available
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
dnl Help line for config file
|
||||
AC_ARG_WITH(config-file,
|
||||
AC_HELP_STRING([--with-config-file=path], [Set the location of pacman's config file]),
|
||||
[configfile=$withval], [configfile=/etc/pacman.conf])
|
||||
# Check if we can use symbol visibility support in GCC
|
||||
GCC_VISIBILITY_CC
|
||||
# Check if we have -fgnu89-inline flag
|
||||
GCC_GNU89_INLINE_CC
|
||||
|
||||
dnl Help line for debug
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug], [Enable debugging support]),
|
||||
[debug=$enableval], [debug=no])
|
||||
|
||||
dnl Help line for fakeroot
|
||||
AC_ARG_ENABLE(fakeroot,
|
||||
AC_HELP_STRING([--disable-fakeroot], [Disable fakeroot proof support]),
|
||||
[fakeroot=$enableval], [fakeroot=yes])
|
||||
|
||||
dnl Host-dependant flags
|
||||
# Host-dependant flags
|
||||
case "${host}" in
|
||||
*-*-cygwin*)
|
||||
ENV_CFLAGS="$ENV_CFLAGS -DCYGWIN"
|
||||
CFLAGS="$CFLAGS -DCYGWIN"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Check for architecture
|
||||
# Check for architecture, used in default makepkg.conf
|
||||
# (Note single space left after CARCHFLAGS)
|
||||
case "${host}" in
|
||||
i686-*)
|
||||
i686-*)
|
||||
CARCH="i686"
|
||||
CARCHFLAGS="i686"
|
||||
ARCHSWITCH="march"
|
||||
CARCHFLAGS="-march=i686 "
|
||||
;;
|
||||
x86_64-*)
|
||||
x86_64-*)
|
||||
CARCH="x86_64"
|
||||
CARCHFLAGS="x86-64"
|
||||
ARCHSWITCH="march"
|
||||
CARCHFLAGS="-march=x86-64 "
|
||||
;;
|
||||
ia64-*)
|
||||
ia64-*)
|
||||
CARCH="ia64"
|
||||
CARCHFLAGS="ia64"
|
||||
ARCHSWITCH="march"
|
||||
CARCHFLAGS="-march=ia64 "
|
||||
;;
|
||||
sparc-*)
|
||||
sparc-*)
|
||||
CARCH="sparc"
|
||||
CARCHFLAGS="v9"
|
||||
ARCHSWITCH="mcpu"
|
||||
CARCHFLAGS="-mcpu=v9 "
|
||||
;;
|
||||
ppc-* | powerpc-*)
|
||||
CARCH="ppc"
|
||||
CARCHFLAGS="750"
|
||||
ARCHSWITCH="mcpu"
|
||||
CARCHFLAGS="-mcpu=750 "
|
||||
;;
|
||||
i386-*)
|
||||
i386-*)
|
||||
CARCH="i386"
|
||||
CARCHFLAGS="i386"
|
||||
ARCHSWITCH="march"
|
||||
CARCHFLAGS="-march=i386 "
|
||||
;;
|
||||
arm-*)
|
||||
CARCH="arm"
|
||||
CARCHFLAGS="-march=armv4 "
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Your architecture is not supported])
|
||||
AC_MSG_WARN([[Your architecture is unknown for makepkg.conf, consider adding it to configure.ac]])
|
||||
CARCH="unknown"
|
||||
CARCHFLAGS=""
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Now do some things common to all architectures
|
||||
# Now do some things common to all architectures
|
||||
CHOST="${host}"
|
||||
AC_SUBST(CARCH)
|
||||
AC_SUBST(CARCHFLAGS)
|
||||
AC_SUBST(ARCHSWITCH)
|
||||
AC_SUBST(CHOST)
|
||||
|
||||
dnl Humor lowers blood pressure
|
||||
AC_MSG_CHECKING(your blood pressure)
|
||||
AC_MSG_RESULT([a bit high, but we can proceed])
|
||||
|
||||
dnl Check for doxygen support
|
||||
AC_MSG_CHECKING(for doxygen)
|
||||
if test "x$wantdoxygen" = "xyes" ; then
|
||||
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
||||
if test $DOXYGEN ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
usedoxygen=yes
|
||||
else
|
||||
AC_MSG_RESULT(no, doxygen missing)
|
||||
usedoxygen=no
|
||||
fi
|
||||
# Check for documentation support and status
|
||||
AC_MSG_CHECKING([for building documentation])
|
||||
if test "x$wantdoc" = "xyes" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
wantdoc=yes
|
||||
else
|
||||
AC_MSG_RESULT(no, disabled by configure)
|
||||
AC_MSG_RESULT([no, disabled by configure])
|
||||
wantdoc=no
|
||||
fi
|
||||
AM_CONDITIONAL(WANT_DOC, test "x$wantdoc" = "xyes")
|
||||
|
||||
# Check for doxygen support and status
|
||||
AC_MSG_CHECKING([for doxygen])
|
||||
if test "x$wantdoxygen" = "xyes" ; then
|
||||
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
||||
if test $DOXYGEN ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
usedoxygen=yes
|
||||
else
|
||||
AC_MSG_RESULT([no, doxygen missing])
|
||||
usedoxygen=no
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([no, disabled by configure])
|
||||
usedoxygen=no
|
||||
fi
|
||||
AM_CONDITIONAL(HAS_DOXYGEN, test "x$usedoxygen" = "xyes")
|
||||
AM_CONDITIONAL(USE_DOXYGEN, test "x$usedoxygen" = "xyes")
|
||||
|
||||
dnl Check for math
|
||||
AC_CHECK_LIB([m], [sqrt], [AC_CHECK_HEADER([math.h], [LIBM='-lm'])])
|
||||
if test -z "$LIBM"; then
|
||||
AC_MSG_ERROR("math library needed to compile pacman!");
|
||||
fi
|
||||
|
||||
dnl Check for libarchive
|
||||
AC_CHECK_LIB([archive], [archive_read_data], [AC_CHECK_HEADER([archive.h], [LIBARCHIVE='-larchive'])])
|
||||
if test -z "$LIBARCHIVE"; then
|
||||
AC_MSG_ERROR("libarchive is needed to compile pacman!");
|
||||
fi
|
||||
|
||||
dnl Check for libdownload
|
||||
AC_CHECK_LIB([download], [downloadParseURL], [AC_CHECK_HEADER([download.h], [LIBDOWNLOAD='-ldownload'])])
|
||||
if test -z "$LIBDOWNLOAD"; then
|
||||
AC_MSG_ERROR("libdownload is needed to compile pacman!");
|
||||
fi
|
||||
|
||||
dnl Set config location
|
||||
AC_MSG_CHECKING(for configuration file name)
|
||||
if test -n "$configfile"; then
|
||||
AC_DEFINE_UNQUOTED([PACCONF], "$configfile", [Location of pacman conf file])
|
||||
AC_MSG_RESULT(["$configfile"])
|
||||
# Check for asciidoc support and status
|
||||
AC_MSG_CHECKING([for asciidoc])
|
||||
if test "x$wantasciidoc" = "xyes" ; then
|
||||
AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
|
||||
if test $ASCIIDOC ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
useasciidoc=yes
|
||||
else
|
||||
AC_MSG_RESULT([no, asciidoc missing])
|
||||
useasciidoc=no
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR(["pacman config file (--with-config-file is not set"])
|
||||
AC_MSG_RESULT([no, disabled by configure])
|
||||
useasciidoc=no
|
||||
fi
|
||||
AM_CONDITIONAL(USE_ASCIIDOC, test "x$useasciidoc" = "xyes")
|
||||
|
||||
dnl Enable or disable debug code
|
||||
# Enable or disable debug code
|
||||
AC_MSG_CHECKING(for debug mode request)
|
||||
if test "x$debug" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([PACMAN_DEBUG], , [Enable debug code])
|
||||
CFLAGS="$CFLAGS -g -Wall -Werror -fstack-protector -std=c99"
|
||||
LDFLAGS="$LDFLAGS -lmcheck"
|
||||
AC_MSG_RESULT(yes)
|
||||
# Check for mcheck
|
||||
AC_CHECK_HEADERS([mcheck.h])
|
||||
# Check for -fstack-protector availability
|
||||
GCC_STACK_PROTECT_LIB
|
||||
GCC_STACK_PROTECT_CC
|
||||
CFLAGS="$CFLAGS -Wall -Werror"
|
||||
else
|
||||
CFLAGS="$CFLAGS -Wall -std=c99"
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_RESULT(no)
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
fi
|
||||
|
||||
dnl Enable or disable fakeroot code
|
||||
AC_MSG_CHECKING(for fakeroot proof support)
|
||||
if test "x$fakeroot" = "xyes" ; then
|
||||
# Enable or disable inclusion of pacman.static
|
||||
AC_MSG_CHECKING(whether to build pacman.static)
|
||||
if test "x$pacmanstatic" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([INCLUDE_PACMAN_STATIC], , [Build pacman.static])
|
||||
else
|
||||
AC_DEFINE([FAKEROOT], , [Disable fakeroot-proof code])
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL(INCLUDE_PACMAN_STATIC, test "x$pacmanstatic" = "xyes")
|
||||
|
||||
dnl Set CFLAGS to both $CFLAGS and ones from env ($ENV_CFLAGS)
|
||||
CFLAGS="$CFLAGS $ENV_CFLAGS"
|
||||
# Set root directory
|
||||
AC_SUBST(ROOTDIR)
|
||||
# Set package file extension
|
||||
AC_SUBST(PKGEXT)
|
||||
AC_DEFINE_UNQUOTED([PKGEXT], "$PKGEXT", [The file extension used by pacman packages])
|
||||
# Set source package file extension
|
||||
AC_SUBST(SRCEXT)
|
||||
AC_DEFINE_UNQUOTED([SRCEXT], "$SRCEXT", [The file extension used by pacman source packages])
|
||||
# Set database file extension
|
||||
AC_SUBST(DBEXT)
|
||||
AC_DEFINE_UNQUOTED([DBEXT], "$DBEXT", [The file extension used by pacman databases])
|
||||
|
||||
dnl ==========================================================================
|
||||
|
||||
AC_OUTPUT([
|
||||
# Configuration files
|
||||
AC_CONFIG_FILES([
|
||||
lib/libalpm/Makefile
|
||||
lib/libalpm/po/Makefile.in
|
||||
src/pacman/Makefile
|
||||
src/pacman/po/Makefile.in
|
||||
src/util/Makefile
|
||||
scripts/Makefile
|
||||
doc/Makefile
|
||||
etc/Makefile
|
||||
etc/makepkg.conf
|
||||
etc/pacman.conf
|
||||
etc/pacman.d/Makefile
|
||||
etc/pacman.d/mirrorlist
|
||||
etc/abs/Makefile
|
||||
po/Makefile.in
|
||||
pactest/Makefile
|
||||
contrib/Makefile
|
||||
Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
echo "
|
||||
pacman-$VERSION:
|
||||
pacman_display_version:
|
||||
|
||||
prefix : ${prefix}
|
||||
Build information:
|
||||
source code location : ${srcdir}
|
||||
prefix : ${prefix}
|
||||
sysconfdir : $(eval echo ${sysconfdir})
|
||||
conf file : $(eval echo ${sysconfdir})/pacman.conf
|
||||
localstatedir : $(eval echo ${localstatedir})
|
||||
database dir : $(eval echo ${localstatedir})/lib/pacman/
|
||||
cache dir : $(eval echo ${localstatedir})/cache/pacman/pkg/
|
||||
compiler : ${CC}
|
||||
compiler flags : ${CFLAGS}
|
||||
defines : ${DEFS}
|
||||
|
||||
Architecture : ${CARCH}
|
||||
Architecture flags : -${ARCHSWITCH}=${CARCHFLAGS}
|
||||
Architecture flags : ${CARCHFLAGS}
|
||||
Host Type : ${CHOST}
|
||||
|
||||
libalpm version : ${LIB_VERSION}
|
||||
libalpm version info : ${LIB_VERSION_INFO}
|
||||
pacman version : ${PACKAGE_VERSION}
|
||||
pacman.conf location : ${configfile}
|
||||
|
||||
Directory and file information:
|
||||
root working directory : ${ROOTDIR}
|
||||
package extension : ${PKGEXT}
|
||||
source pkg extension : ${SRCEXT}
|
||||
database extension : ${DBEXT}
|
||||
|
||||
Compilation options:
|
||||
Run make in doc/ dir : ${wantdoc}
|
||||
Doxygen support : ${usedoxygen}
|
||||
Asciidoc support : ${useasciidoc}
|
||||
debug support : ${debug}
|
||||
fakeroot-proof support : ${fakeroot}
|
||||
build pacman.static : ${pacmanstatic}
|
||||
"
|
||||
|
||||
# vim:set ts=2 sw=2 noet:
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
0
contrib/.gitignore
vendored
Normal file
0
contrib/.gitignore
vendored
Normal file
@@ -1,8 +1,12 @@
|
||||
EXTRA_DIST = \
|
||||
PKGBUILD.vim \
|
||||
bash_completion \
|
||||
pacsearch \
|
||||
pacdiff \
|
||||
pacsearch \
|
||||
re-pacman \
|
||||
vimproject \
|
||||
wget-xdelta.sh \
|
||||
zsh_completion \
|
||||
README
|
||||
|
||||
# vim:set ts=2 sw=2 noet:
|
||||
|
||||
233
contrib/PKGBUILD.vim
Normal file
233
contrib/PKGBUILD.vim
Normal file
@@ -0,0 +1,233 @@
|
||||
" Vim syntax file
|
||||
" Language: PKGBUILD
|
||||
" Maintainer: Alessio 'mOLOk' Bolognino <themolok at gmail.com>
|
||||
" Last Change: 2007/05/08
|
||||
" Version Info: PKGBUILD-0.2 (colorphobic)
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:main_syntax = "sh"
|
||||
runtime! syntax/sh.vim
|
||||
|
||||
" case on
|
||||
syn case match
|
||||
|
||||
" pkgname
|
||||
" FIXME if '=' is in pkgname/pkgver, it highlights whole string, not just '='
|
||||
syn keyword pb_k_pkgname pkgname contained
|
||||
syn match pbValidPkgname /\([[:alnum:]]\|+\|-\|_\){,32}/ contained contains=pbIllegalPkgname
|
||||
syn match pbIllegalPkgname /[[:upper:]]\|[^[:alnum:]-+_=]\|=.*=\|=['"]\?.\{33,\}['"]\?/ contained
|
||||
syn match pbPkgnameGroup /^pkgname=.*/ contains=pbIllegalPkgname,pb_k_pkgname,shDoubleQuote,shSingleQuote
|
||||
|
||||
" pkgver
|
||||
syn keyword pb_k_pkgver pkgver contained
|
||||
syn match pbValidPkgver /\([[:alnum:]]\|\.\|+\|_\)/ contained contains=pbIllegalPkgver
|
||||
syn match pbIllegalPkgver /[^[:alnum:]+=\.\_]\|=.*=/ contained
|
||||
syn match pbPkgverGroup /^pkgver=.*/ contains=pbIllegalPkgver,pbValidPkgver,pb_k_pkgver,shDoubleQuote,shSingleQuote
|
||||
|
||||
" pkgrel
|
||||
syn keyword pb_k_pkgrel pkgrel contained
|
||||
syn match pbValidPkgrel /[[:digit:]]*/ contained contains=pbIllegalPkgver
|
||||
syn match pbIllegalPkgrel /[^[:digit:]=]\|=.*=/ contained
|
||||
syn match pbPkgrelGroup /^pkgrel=.*/ contains=pbIllegalPkgrel,pbValidPkgrel,pb_k_pkgrel,shDoubleQuote,shSingleQuote
|
||||
|
||||
" pkgdesc
|
||||
syn keyword pb_k_desc pkgdesc contained
|
||||
" 90 chars: 80 for description, 8 for pkgdesc and 2 for ''
|
||||
syn match pbIllegalPkgdesc /.\{90,}\|=['"]\?.*['" ]\+[iI][sS] [aA]/ contained contains=pbPkgdescSign
|
||||
syn match pbValidPkgdesc /[^='"]\.\{,80}/ contained contains=pbIllegalPkgdesc
|
||||
syn match pbPkgdescGroup /^pkgdesc=.*/ contains=pbIllegalPkgdesc,pb_k_desc,pbValidPkgdesc,shDoubleQuote,shSingleQuote
|
||||
syn match pbPkgdescSign /[='"]/ contained
|
||||
|
||||
" url
|
||||
syn keyword pb_k_url url contained
|
||||
syn match pbValidUrl /['"]*\(https\|http\|ftp\)\:\/.*\.\+.*/ contained
|
||||
|
||||
syn match pbIllegalUrl /[^=]/ contained contains=pbValidUrl
|
||||
syn match pbUrlGroup /^url=.*/ contains=pbValidUrl,pb_k_url,pbIllegalUrl,shDoubleQuote,shSingleQuote
|
||||
|
||||
" license
|
||||
syn keyword pb_k_license license contained
|
||||
syn keyword pbLicense APACHE CDDL EPL FDL GPL LGPL MPL PHP RUBY ZLIB ISC MIT BSD contained
|
||||
syn match pbLicenseCustom /custom\(:[[:alnum:]]*\)*/ contained
|
||||
syn match pbIllegalLicense /[^='"() ]/ contained contains=pbLicenseCustom,pbLicense
|
||||
syn match pbLicenseGroup /^license=.*/ contains=pb_k_license,pbLicenseCustom,pbLicense,pbIllegalLicense,shDoubleQuote,shSingleQuote
|
||||
|
||||
" backup
|
||||
syn keyword pb_k_backup backup contained
|
||||
syn match pbValidBackup /\.\?[[:alpha:]]*\/[[:alnum:]\{\}+._$-]*]*/ contained
|
||||
syn match pbBackupGroup /^backup=.*/ contains=pb_k_backup,pbValidBackup,shDoubleQuote,shSingleQuote
|
||||
|
||||
" arch
|
||||
syn keyword pb_k_arch arch contained
|
||||
syn keyword pbArch i686 x86_64 ppc contained
|
||||
syn match pbIllegalArch /[^='() ]/ contained contains=pbArch
|
||||
syn match pbArchGroup /^arch=.*/ contains=pb_k_arch,pbArch,pbIllegalArch,shDoubleQuote,shSingleQuote
|
||||
|
||||
" makedepends
|
||||
syn keyword pb_k_makedepends makedepends contained
|
||||
syn match pbValidMakedepends /\([[:alnum:]]\|+\|-\|_\)*/ contained
|
||||
syn region pbMakedependsGroup start=/^makedepends=(/ end=/)/ contains=pb_k_makedepends,pbValidMakedepends,shDoubleQuote,shSingleQuote
|
||||
|
||||
" depends
|
||||
syn keyword pb_k_depends depends contained
|
||||
syn match pbValidDepends /\([[:alnum:]]\|+\|-\|_\)*/ contained
|
||||
syn region pbDependsGroup start=/^depends=(/ end=/)/ contains=pb_k_depends,pbValidDepends,shDoubleQuote,shSingleQuote
|
||||
|
||||
" XXX little hack to color conflicts/provides/replaces keyword even without =()
|
||||
syn match pbkw /^\(conflicts\|provides\|replaces\)/ contains=pb_k_conflicts,pb_k_provides,pb_k_replaces
|
||||
hi def link pbkw keyword
|
||||
|
||||
" conflicts
|
||||
syn keyword pb_k_conflicts conflicts contained
|
||||
syn match pbValidConflicts /\([[:alnum:]]\|+\|-\|_\)*/ contained
|
||||
syn region pbConflictsGroup start=/^conflicts=(/ end=/)/ contains=pb_k_conflicts,pbValidConflicts,shDoubleQuote,shSingleQuote
|
||||
|
||||
" provides
|
||||
syn keyword pb_k_provides provides contained
|
||||
syn match pbValidProvides /\([[:alnum:]]\|+\|-\|_\)*/ contained
|
||||
syn region pbProvidesGroup start=/^provides=(/ end=/)/ contains=pb_k_provides,pbValidProvides,shDoubleQuote,shSingleQuote
|
||||
|
||||
" replaces
|
||||
syn keyword pb_k_replaces replaces contained
|
||||
syn match pbValidReplaces /\([[:alnum:]]\|+\|-\|_\)*/ contained
|
||||
syn region pbReplacesGroup start=/^replaces=(/ end=/)/ contains=pb_k_replaces,pbValidReplaces,shDoubleQuote,shSingleQuote
|
||||
|
||||
" install
|
||||
" XXX remove install from bashStatement, fix strage bug
|
||||
syn clear bashStatement
|
||||
syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep less ls mkdir mv rm rmdir rpm sed sleep sort strip tail touch
|
||||
|
||||
syn keyword pb_k_install install contained
|
||||
syn match pbValidInstall /\([[:alnum:]]\|\$\|+\|-\|_\)*\.install/ contained
|
||||
syn match pbIllegalInstall /[^=]/ contained contains=pbValidInstall
|
||||
syn match pbInstallGroup /^install=.*/ contains=pb_k_install,pbValidInstall,pbIllegalInstall,shDeref,shDoubleQuote,shSingleQuote
|
||||
|
||||
" source:
|
||||
" XXX remove source from shStatement, fixstrange bug
|
||||
syn clear shStatement
|
||||
syn keyword shStatement xxx wait getopts return autoload whence printf true popd nohup enable r trap readonly fc fg kill ulimit umask disown stop pushd read history logout times local exit test pwd time eval integer suspend dirs shopt hash false newgrp bg print jobs continue functions exec help cd break unalias chdir type shift builtin let bind
|
||||
|
||||
syn keyword pb_k_source source contained
|
||||
syn match pbIllegalSource /\(http\|ftp\|https\).*\.\+\(dl\|download.\?\)\.\(sourceforge\|sf\).net/
|
||||
syn region pbSourceGroup start=/^source=(/ end=/)/ contains=pb_k_source,pbIllegalSource,shNumber,shDoubleQuote,shSingleQuote,pbDerefEmulation
|
||||
syn match pbDerefEmulation /\$[{]\?[[:alnum:]_]*[}]\?/ contained
|
||||
hi def link pbDerefEmulation PreProc
|
||||
|
||||
" md5sums
|
||||
|
||||
syn keyword pb_k_md5sums md5sums contained
|
||||
syn match pbIllegalMd5sums /[^='"()\/ ]/ contained contains=pbValidMd5sums
|
||||
syn match pbValidMd5sums /[[:alnum:]]\{32\}/ contained
|
||||
syn region pbMd5sumsGroup start=/^md5sums/ end=/)/ contains=pb_k_md5sums,pbMd5Quotes,pbMd5Hash,pbIllegalMd5sums
|
||||
syn match pbMd5Quotes /'.*'\|".*"/ contained contains=pbMd5Hash,pbIllegalMd5sums
|
||||
syn match pbMd5Hash /[[:alnum:]]\+/ contained contains=pbValidMd5sums
|
||||
hi def link pbMd5Quotes Keyword
|
||||
hi def link pbMd5Hash Error
|
||||
hi def link pbValidMd5sums Number
|
||||
|
||||
" sha1sums
|
||||
syn keyword pb_k_sha1sums sha1sums contained
|
||||
syn match pbIllegalSha1sums /[^='"()\/ ]/ contained contains=pbValidSha1sums
|
||||
syn match pbValidSha1sums /[[:alnum:]]\{40\}/ contained
|
||||
syn region pbSha1sumsGroup start=/^sha1sums/ end=/)/ contains=pb_k_sha1sums,pbSha1Quotes,pbSha1Hash,pbIllegalSha1sums
|
||||
syn match pbSha1Quotes /'.*'\|".*"/ contained contains=pbSha1Hash,pbIllegalSha1sums
|
||||
syn match pbSha1Hash /[[:alnum:]]\+/ contained contains=pbValidSha1sums
|
||||
hi def link pbSha1Quotes Keyword
|
||||
hi def link pbSha1Hash Error
|
||||
hi def link pbValidSha1sums Number
|
||||
|
||||
" options
|
||||
syn keyword pb_k_options options contained
|
||||
syn match pbOptions /\(no\)\?\(strip\|docs\|libtool\|emptydirs\|ccache\|distcc\|makeflags\|force\)/ contained
|
||||
syn match pbOptionsNeg /\!/ contained
|
||||
syn match pbOptionsDeprec /no/ contained
|
||||
syn region pbOptionsGroup start=/^options=(/ end=/)/ contains=pb_k_options,pbOptions,pbOptionsNeg,pbOptionsDeprec,pbIllegalOption,shDoubleQuote,shSingleQuote
|
||||
syn match pbIllegalOption /[^!"'()= ]/ contained contains=pbOptionsDeprec,pbOptions
|
||||
|
||||
" noextract
|
||||
syn match pbNoextract /[[:alnum:]+._${}-]\+/ contained
|
||||
syn keyword pb_k_noextract noextract contained
|
||||
syn region pbNoextractGroup start=/^noextract=(/ end=/)/ contains=pb_k_noextract,pbNoextract,shDoubleQuote,shSingleQuote
|
||||
|
||||
" comments
|
||||
syn keyword pb_k_maintainer Maintainer Contributor contained
|
||||
syn match pbMaintainerGroup /Maintainer.*/ contains=pbMaintainer contained
|
||||
|
||||
syn match pbDate /[0-9]\{4}\/[0-9]\{2}\/[0-9]\{2}/ contained
|
||||
|
||||
syn cluster pbCommentGroup contains=pbTodo,pb_k_maintainer,pbMaintainerGroup,pbDate
|
||||
syn keyword pbTodo contained COMBAK FIXME TODO XXX
|
||||
syn match pbComment "^#.*$" contains=@pbCommentGroup
|
||||
syn match pbComment "[^0-9]#.*$" contains=@pbCommentGroup
|
||||
|
||||
" quotes are handled by sh.vim
|
||||
|
||||
hi def link pbComment Comment
|
||||
hi def link pbTodo Todo
|
||||
|
||||
hi def link pbIllegalPkgname Error
|
||||
hi def link pb_k_pkgname pbKeywords
|
||||
|
||||
hi def link pbIllegalPkgver Error
|
||||
hi def link pb_k_pkgver pbKeywords
|
||||
|
||||
hi def link pbIllegalPkgrel Error
|
||||
hi def link pb_k_pkgrel pbKeywords
|
||||
|
||||
hi def link pbIllegalPkgdesc Error
|
||||
hi def link pb_k_desc pbKeywords
|
||||
|
||||
hi def link pbIllegalUrl Error
|
||||
hi def link pb_k_url pbKeywords
|
||||
|
||||
hi def link pb_k_license pbKeywords
|
||||
hi def link pbIllegalLicense Error
|
||||
|
||||
hi def link pb_k_backup pbKeywords
|
||||
|
||||
hi def link pb_k_arch pbKeywords
|
||||
hi def link pbIllegalArch Error
|
||||
|
||||
hi def link pb_k_makedepends pbKeywords
|
||||
hi def link pb_k_depends pbKeywords
|
||||
hi def link pb_k_replaces pbKeywords
|
||||
hi def link pb_k_conflicts pbKeywords
|
||||
hi def link pb_k_provides pbKeywords
|
||||
|
||||
hi def link pbIllegalInstall Error
|
||||
hi def link pb_k_install pbKeywords
|
||||
|
||||
hi def link pb_k_source pbKeywords
|
||||
hi def link pbIllegalSource Error
|
||||
|
||||
hi def link pb_k_md5sums pbKeywords
|
||||
hi def link pbIllegalMd5sums Error
|
||||
|
||||
hi def link pb_k_sha1sums pbKeywords
|
||||
hi def link pbIllegalSha1sums Error
|
||||
|
||||
hi def link pb_k_options pbKeywords
|
||||
hi def link pbOptionsDeprec Todo
|
||||
hi def link pbIllegalOption Error
|
||||
|
||||
hi def link pb_k_noextract pbKeywords
|
||||
hi def link pbNoextract Normal
|
||||
|
||||
hi def link pb_k_maintainer pbKeywords
|
||||
|
||||
hi def link pbKeywords Keyword
|
||||
|
||||
hi def link pbDate Special
|
||||
|
||||
"syntax include @SHELL syntax/sh.vim
|
||||
"syntax region BUILD start=/^build()/ end=/^}/ contains=@SHELL
|
||||
"let b:current_syntax = "PKGBUILD"
|
||||
|
||||
" vim: ft=vim
|
||||
@@ -1,16 +1,27 @@
|
||||
Here is a brief description of the files included in this directory:
|
||||
|
||||
PKGBUILD.vim - a vim/gvim syntax file for PKGBUILDs. Colors known variable
|
||||
names, highlights common errors such as invalid characters in pkgname or
|
||||
pkgver, etc.
|
||||
|
||||
bash_completion - a bash completion script for pacman, install in
|
||||
/etc/bash_completion.d/ for use (but rename to something descriptive!).
|
||||
|
||||
zsh_completion - a zsh completion script, install (with a rename) to
|
||||
/usr/share/zsh/site-functions/.
|
||||
|
||||
pacdiff - a simple pacnew/pacorig/pacsave updater for /etc/.
|
||||
|
||||
pacsearch - a colorized search combining both -Ss and -Qs output. Installed
|
||||
packages are easily identified with a *** and local-only packages are also
|
||||
listed.
|
||||
|
||||
pacdiff - a simple pacnew/pacorig/pacsave updater for /etc/.
|
||||
|
||||
re-pacman - regenerate a pacman package based on installed files and the pacman
|
||||
database entries. Useful for reuse, or possible config file extension.
|
||||
|
||||
vimproject - a project file for the vim project plugin (some files listed
|
||||
may need to be updated).
|
||||
|
||||
wget-xdelta.sh - A download script for pacman which allows binary deltas
|
||||
generated with makepkg to be used instead of downloading full binary packages.
|
||||
This should cut download sizes for some package upgrades significantly.
|
||||
|
||||
@@ -7,18 +7,6 @@
|
||||
# Distributed under the terms of the GNU General Public License, v2 or later.
|
||||
#
|
||||
|
||||
## ChangeLog ##
|
||||
#
|
||||
# * 3.0 (2007-02-18)
|
||||
# - Updated to pacman 3.0.0 options
|
||||
# * 1.1 (2004-01-17)
|
||||
# - Code cleanup
|
||||
# - Updated to pacman 2.7.2-2
|
||||
# * 2004-02-16 (orelien)
|
||||
# - Improved available_{pkgs,groups) functions
|
||||
# - Added support for querying groups
|
||||
#
|
||||
|
||||
## initial functions
|
||||
|
||||
rem_selected ()
|
||||
@@ -60,7 +48,7 @@ _available_pkgs ()
|
||||
local available_pkgs
|
||||
local enabled_repos
|
||||
enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
|
||||
available_pkgs=$( for r in $enabled_repos; do echo /var/lib/pacman/$r/*; done )
|
||||
available_pkgs=$( for r in $enabled_repos; do echo /var/lib/pacman/sync/$r/*; done )
|
||||
COMPREPLY=( $( compgen -W "$( for i in $available_pkgs; do j=${i##*/}; echo ${j%-*-*}; done )" -- $cur ) )
|
||||
}
|
||||
|
||||
@@ -79,7 +67,7 @@ _available_groups ()
|
||||
local available_groups
|
||||
local enabled_repos
|
||||
enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
|
||||
available_groups=$( for r in $enabled_repos; do sed '/%GROUPS%/,/^$/{//d; p}' /var/lib/pacman/$r/*/desc | sort -u; done )
|
||||
available_groups=$( for r in $enabled_repos; do sed '/%GROUPS%/,/^$/{//d; p}' /var/lib/pacman/sync/$r/*/desc | sort -u; done )
|
||||
COMPREPLY=( $( compgen -W "$( for i in $available_groups; do echo ${i%-*-*}; done )" -- $cur ) )
|
||||
}
|
||||
|
||||
@@ -105,8 +93,8 @@ _makepkg ()
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '\
|
||||
-A --ignorearch \
|
||||
-b --builddeps \
|
||||
-B --noccache \
|
||||
-c --clean \
|
||||
-C --cleancache \
|
||||
-d --nodeps \
|
||||
@@ -115,14 +103,14 @@ _makepkg ()
|
||||
-g --geninteg \
|
||||
-h --help \
|
||||
-i --install \
|
||||
-j \
|
||||
-L --log \
|
||||
-m --nocolor \
|
||||
-o --nobuild \
|
||||
-p \
|
||||
-r --rmdeps \
|
||||
-s --syncdeps \
|
||||
-S --usesudo \
|
||||
--asroot \
|
||||
--source \
|
||||
--noconfirm \
|
||||
--noprogressbar' -- $cur ) )
|
||||
fi
|
||||
@@ -158,7 +146,7 @@ _pacman ()
|
||||
toparse="${a:2}"
|
||||
|
||||
case "${arg}" in
|
||||
-@(A|U|F|R|S|Q|h|V))
|
||||
-@(A|U|R|S|Q|h|V))
|
||||
op="${arg/-}"
|
||||
mod="${mod}${a:2}"
|
||||
;;
|
||||
@@ -168,7 +156,6 @@ _pacman ()
|
||||
add) op="A" ;;
|
||||
remove) op="R" ;;
|
||||
upgrade) op="U" ;;
|
||||
freshen) op="F" ;;
|
||||
query) op="Q" ;;
|
||||
sync) op="S" ;;
|
||||
help) op="h" ;;
|
||||
@@ -184,15 +171,19 @@ _pacman ()
|
||||
print-uris) mod="${mod}p" ;;
|
||||
search) mod="${mod}s" ;;
|
||||
sysupgrade) mod="${mod}u" ;;
|
||||
upgrades) mod="${mod}u" ;;
|
||||
downloadonly) mod="${mod}w" ;;
|
||||
refresh) mod="${mod}y" ;;
|
||||
orphans) mod="${mod}e" ;;
|
||||
changelog) mod="${mod}c" ;;
|
||||
deps) mod="${mod}d" ;;
|
||||
explicit) mod="${mod}e" ;;
|
||||
unrequired) mod="${mod}t" ;;
|
||||
foreign) mod="${mod}m" ;;
|
||||
owns) mod="${mod}o" ;;
|
||||
file) mod="${mod}p" ;;
|
||||
search) mod="${mod}s" ;;
|
||||
upgrades) mod="${mod}u" ;;
|
||||
cascade) mod="${mod}c" ;;
|
||||
nodeps) mod="${mod}d" ;;
|
||||
dbonly) mod="${mod}k" ;;
|
||||
nosave) mod="${mod}n" ;;
|
||||
recursive) mod="${mod}s" ;;
|
||||
@@ -212,7 +203,6 @@ _pacman ()
|
||||
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '\
|
||||
-A --add \
|
||||
-F --freshen \
|
||||
-h --help \
|
||||
-Q --query \
|
||||
-R --remove \
|
||||
@@ -226,14 +216,15 @@ _pacman ()
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
case "${op}" in
|
||||
A|U|F)
|
||||
A|U)
|
||||
COMPREPLY=( $( compgen -W '\
|
||||
--asdeps \
|
||||
-d --nodeps \
|
||||
-f --force \
|
||||
-h --help \
|
||||
--config \
|
||||
--logfile \
|
||||
--noconfirm \
|
||||
--ask \
|
||||
--noprogressbar \
|
||||
--noscriptlet \
|
||||
-v --verbose \
|
||||
@@ -247,14 +238,13 @@ _pacman ()
|
||||
COMPREPLY=( $( compgen -W '\
|
||||
-c --cascade \
|
||||
-d --nodeps \
|
||||
-f --force \
|
||||
-h --help \
|
||||
-k --dbonly \
|
||||
-n --nosave \
|
||||
-s --recursive \
|
||||
--config \
|
||||
--logfile \
|
||||
--noconfirm \
|
||||
--ask \
|
||||
--noprogressbar \
|
||||
--noscriptlet \
|
||||
-v --verbose \
|
||||
@@ -266,6 +256,7 @@ _pacman ()
|
||||
;;
|
||||
S)
|
||||
COMPREPLY=( $( compgen -W '\
|
||||
--asdeps \
|
||||
-c --clean \
|
||||
-d --nodeps \
|
||||
-e --dependsonly \
|
||||
@@ -279,10 +270,12 @@ _pacman ()
|
||||
-u --sysupgrade \
|
||||
-w --downloadonly \
|
||||
-y --refresh \
|
||||
--needed \
|
||||
--ignore \
|
||||
--ignoregroup \
|
||||
--config \
|
||||
--logfile \
|
||||
--noconfirm \
|
||||
--ask \
|
||||
--noprogressbar \
|
||||
--noscriptlet \
|
||||
-v --verbose \
|
||||
@@ -295,7 +288,8 @@ _pacman ()
|
||||
Q)
|
||||
COMPREPLY=( $( compgen -W '\
|
||||
-c --changelog \
|
||||
-e --orphans \
|
||||
-d --deps \
|
||||
-e --explicit \
|
||||
-g --groups \
|
||||
-h --help \
|
||||
-i --info \
|
||||
@@ -304,9 +298,11 @@ _pacman ()
|
||||
-o --owns \
|
||||
-p --file \
|
||||
-s --search \
|
||||
-t --unrequired \
|
||||
-u --upgrades \
|
||||
--config \
|
||||
--logfile \
|
||||
--noconfirm \
|
||||
--ask \
|
||||
--noprogressbar \
|
||||
--noscriptlet \
|
||||
-v --verbose \
|
||||
@@ -338,6 +334,9 @@ _pacman ()
|
||||
elif _instring $mod p; then
|
||||
COMPREPLY=( $( compgen -d -- "$cur" ) \
|
||||
$( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
|
||||
elif _instring $mod u; then
|
||||
COMPREPLY=''
|
||||
return 0
|
||||
else
|
||||
_installed_pkgs
|
||||
fi
|
||||
|
||||
4
contrib/pacdiff
Normal file → Executable file
4
contrib/pacdiff
Normal file → Executable file
@@ -14,9 +14,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
# USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# Original http://phraktured.net/config/bin/pacdiff
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#TODO: colors flag on commandline
|
||||
|
||||
@@ -72,7 +71,7 @@ done
|
||||
|
||||
# Print colorized package list and descriptions to screen
|
||||
echo -e "$(sed -r \
|
||||
-e "s@current/.*@$CLR1&$BASE@" \
|
||||
-e "s@core/.*@$CLR1&$BASE@" \
|
||||
-e "s@extra/.*@$CLR2&$BASE@" \
|
||||
-e "s@community/.*@$CLR3&$BASE@" \
|
||||
-e "s@testing/.*@$CLR4&$BASE@" \
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
# USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
#TODO
|
||||
@@ -48,6 +46,8 @@ make_pkginfo () {
|
||||
done
|
||||
}
|
||||
|
||||
LANG="POSIX"
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "usage: re-pacman <installed package name>"
|
||||
exit 1
|
||||
@@ -60,20 +60,18 @@ if [ "x${ver}" = "x" ]; then
|
||||
fi
|
||||
|
||||
echo ":: Cleaning up old files"
|
||||
rm -f .PKGINFO .FILELIST "${1}-${ver}.pkg.tar.gz"
|
||||
rm -f .PKGINFO "${1}-${ver}.pkg.tar.gz"
|
||||
|
||||
echo ":: Building PKGINFO"
|
||||
make_pkginfo ${1} > .PKGINFO
|
||||
echo ":: Building FILELIST"
|
||||
pacman -Ql ${1} | cut -d' ' -f2- > .FILELIST
|
||||
|
||||
flist=".PKGINFO .FILELIST"
|
||||
flist=".PKGINFO"
|
||||
flist="${flist} $(pacman -Ql ${1} | sed 's|\w* \(.*\)|/\1|g' | grep -v '/$')"
|
||||
|
||||
echo ":: Building final package tarball"
|
||||
echo ${flist} | tr ' ' '\n' | tar czf "${1}-${ver}.pkg.tar.gz" -T - 2>/dev/null
|
||||
|
||||
rm -f .PKGINFO .FILELIST
|
||||
rm -f .PKGINFO
|
||||
echo ":: Package '${1}-${ver}.pkg.tar.gz' is now ready for installation"
|
||||
|
||||
# vim: set ts=2 sw=2 noet:
|
||||
|
||||
@@ -24,16 +24,13 @@ pacman=~/devel/pacman-lib CD=. flags=S {
|
||||
handle.c
|
||||
log.c
|
||||
md5.c
|
||||
md5driver.c
|
||||
package.c
|
||||
provide.c
|
||||
remove.c
|
||||
server.c
|
||||
sha1.c
|
||||
sync.c
|
||||
trans.c
|
||||
util.c
|
||||
versioncmp.c
|
||||
add.h
|
||||
alpm.h
|
||||
alpm_list.h
|
||||
@@ -51,11 +48,9 @@ pacman=~/devel/pacman-lib CD=. flags=S {
|
||||
provide.h
|
||||
remove.h
|
||||
server.h
|
||||
sha1.h
|
||||
sync.h
|
||||
trans.h
|
||||
util.h
|
||||
versioncmp.h
|
||||
Makefile.am
|
||||
Makefile.in
|
||||
}
|
||||
|
||||
70
contrib/wget-xdelta.sh
Executable file
70
contrib/wget-xdelta.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -r "/etc/makepkg.conf" ]; then
|
||||
source /etc/makepkg.conf
|
||||
else
|
||||
echo "wget-xdelta: Unable to find makepkg.conf"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -r ~/.makepkg.conf ]; then
|
||||
source ~/.makepkg.conf
|
||||
fi
|
||||
|
||||
out_file=$(basename $1)
|
||||
file_url=$2
|
||||
|
||||
if ! [[ "$out_file" =~ "pkg.tar.gz" ]]; then
|
||||
# If it's not a package file download as normal and exit.
|
||||
#wget --passive-ftp -c -O "$out_file" "$file_url"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
|
||||
# Get the package name and version
|
||||
[[ "$out_file" =~ "$CARCH" ]] && arch="-$CARCH" || arch=""
|
||||
pkg_data=$(echo $out_file | \
|
||||
sed "s|^\(.*\)-\([[:alnum:]_\.]*-[[:alnum:]_\.]*\)${arch}${PKGEXT}.part|\1 \2|")
|
||||
pkgname=$(echo $pkg_data | cut -d ' ' -f 1)
|
||||
new_version=$(echo $pkg_data | cut -d ' ' -f 2)
|
||||
base_url=${file_url%/*}
|
||||
|
||||
# Look for the last version
|
||||
for file in $(ls -r /var/cache/pacman/pkg/${pkgname}-*-*{,-$CARCH}$PKGEXT 2>/dev/null); do
|
||||
[[ "$file" =~ "$CARCH" ]] && arch="-$CARCH" || arch=""
|
||||
check_version=$(echo $file | \
|
||||
sed "s|^.*/${pkgname}-\([[:alnum:]_\.]*-[[:alnum:]_\.]*\)${arch}$PKGEXT$|\1|" | \
|
||||
grep -v "^/var/cache/pacman/pkg")
|
||||
|
||||
[ "$check_version" = "" ] && continue
|
||||
|
||||
vercmp=$(vercmp "$check_version" "$old_version")
|
||||
if [ "$check_version" != "$new_version" -a $vercmp -gt 0 ]; then
|
||||
old_version=$check_version
|
||||
old_file=$file
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$old_version" != "" -a "$old_version" != "$new_version" ]; then
|
||||
# Great, we have a cached file, now calculate a patch name from it
|
||||
delta_name="$pkgname-${old_version}_to_${new_version}-${CARCH}.delta"
|
||||
|
||||
echo "wget-xdelta: Attempting to download delta $delta_name..." >&2
|
||||
if wget --passive-ftp -c "$base_url/$delta_name"; then
|
||||
echo "wget-xdelta: Applying delta..."
|
||||
if xdelta patch "$delta_name" "$old_file" "$out_file"; then
|
||||
echo "wget-xdelta: Delta applied successfully!"
|
||||
rm "$delta_name"
|
||||
exit 0
|
||||
else
|
||||
echo "wget-xdelta: Failed to apply delta!"
|
||||
rm $delta_name
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "wget-xdelta: Downloading new package..."
|
||||
wget --passive-ftp -c -O "$out_file" "$file_url"
|
||||
exit $?
|
||||
|
||||
# vim:set ts=4 sw=4 noet:
|
||||
@@ -1,13 +1,12 @@
|
||||
# file: /usr/share/zsh/site-functions/_pacman
|
||||
# use the following in your zsh config:
|
||||
# compdef pacman pacman.static=pacman
|
||||
#compdef pacman pacman.static=pacman
|
||||
|
||||
# copy this file to /usr/share/zsh/site-functions/_pacman
|
||||
|
||||
typeset -A opt_args
|
||||
|
||||
# options for passing to _arguments: main pacman commands
|
||||
_pacman_opts_commands=(
|
||||
'-A[Add a package to the system]'
|
||||
'-F[Upgrade an installed package]'
|
||||
'-Q[Query the package database]'
|
||||
'-R[Remove a package from the system]'
|
||||
'-S[Synchronize packages]'
|
||||
@@ -22,11 +21,15 @@ _pacman_opts_common=(
|
||||
'-h[Display syntax for the given operation]'
|
||||
'-r[Set alternate installation root]:installation root:_files -/'
|
||||
'-v[Be more verbose]'
|
||||
'--cachedir[Alternate package cache location]:cache_location:_files -/'
|
||||
'--config[An alternate configuration file]:config file:_files'
|
||||
'--logfile[An alternate log file]:config file:_files'
|
||||
'--noconfirm[Do not ask for confirmation]'
|
||||
'--noprogressbar[Do not show a progress bar when downloading files]'
|
||||
'--noscriptlet[Do not execute the install scriptlet if one exists]'
|
||||
)
|
||||
|
||||
# options for passing to _arguments: options for --add, --freshen and --update commands
|
||||
# options for passing to _arguments: options for --add and --update commands
|
||||
_pacman_opts_pkgfile=(
|
||||
'-d[Skip dependency checks]'
|
||||
'-f[Overwrite conflicting files]'
|
||||
@@ -35,7 +38,6 @@ _pacman_opts_pkgfile=(
|
||||
|
||||
# options for passing to _arguments: subactions for --query command
|
||||
_pacman_opts_query_actions=(
|
||||
'-e[List orphaned packages]:*:orphans:->query_orphans'
|
||||
'-g[View all members of a package group]:*:package groups:->query_group'
|
||||
'-o[Query the package that owns a file]:file:_files'
|
||||
'-p[Package file to query]:*:package file:->query_file'
|
||||
@@ -44,8 +46,15 @@ _pacman_opts_query_actions=(
|
||||
|
||||
# options for passing to _arguments: options for --query and subcommands
|
||||
_pacman_opts_query_modifiers=(
|
||||
'-c[List package changelog]'
|
||||
'-d[List packages installed as dependencies]'
|
||||
'-e[List packages explicitly installed]'
|
||||
'-i[View package information]'
|
||||
'-ii[View package information including backup files]'
|
||||
'-l[List package contents]'
|
||||
'-m[List installed packages not found in sync db(s)]'
|
||||
'-t[List packages not required by any package]'
|
||||
'-u[List packages that can be upgraded]'
|
||||
)
|
||||
|
||||
# options for passing to _arguments: options for --remove command
|
||||
@@ -61,6 +70,7 @@ _pacman_opts_remove=(
|
||||
# options for passing to _arguments: options for --sync command
|
||||
_pacman_opts_sync_actions=(
|
||||
'*-c[Remove old packages from cache]:*:clean:->sync_clean'
|
||||
'*-cc[Remove all packages from cache]:*:clean:->sync_clean'
|
||||
'-g[View all members of a package group]:*:package groups:->sync_group'
|
||||
'-s[Search package names and descriptions]:*:search text:->sync_search'
|
||||
)
|
||||
@@ -68,6 +78,7 @@ _pacman_opts_sync_actions=(
|
||||
# options for passing to _arguments: options for --sync command
|
||||
_pacman_opts_sync_modifiers=(
|
||||
'-d[Skip dependency checks]'
|
||||
'-e[Install dependencies only]'
|
||||
'-f[Overwrite conflicting files]'
|
||||
'-i[View package information]'
|
||||
'-l[List all packages in a repository]'
|
||||
@@ -75,7 +86,11 @@ _pacman_opts_sync_modifiers=(
|
||||
'-u[Upgrade all out-of-date packages]'
|
||||
'-w[Download packages only]'
|
||||
'-y[Download fresh package databases]'
|
||||
'*--ignore[Ignore a package upgrade]:package:_pacman_completions_installed_packages'
|
||||
'*--ignore[Ignore a package upgrade]:package:
|
||||
_pacman_completions_all_packages'
|
||||
'*--ignoregroup[Ignore a group upgrade]:package group:
|
||||
_pacman_completions_all_groups'
|
||||
'--asdeps[Install packages as non-explicitly installed]'
|
||||
)
|
||||
|
||||
# handles --action subcommand
|
||||
@@ -85,13 +100,6 @@ _pacman_action_add() {
|
||||
"$_pacman_opts_pkgfile[@]"
|
||||
}
|
||||
|
||||
# handles --freshen subcommand
|
||||
_pacman_action_freshen() {
|
||||
_arguments -s : \
|
||||
"$_pacman_opts_common[@]" \
|
||||
"$_pacman_opts_pkgfile[@]"
|
||||
}
|
||||
|
||||
# handles --help subcommand
|
||||
_pacman_action_help() {
|
||||
_arguments -s : \
|
||||
@@ -127,11 +135,6 @@ _pacman_action_query() {
|
||||
"$_pacman_opts_query_modifiers[@]" \
|
||||
'*:groups:_pacman_completions_installed_groups'
|
||||
;;
|
||||
query_orphans)
|
||||
_arguments -s : \
|
||||
"$_pacman_opts_common[@]" \
|
||||
"$_pacman_opts_query_modifiers[@]"
|
||||
;;
|
||||
query_owner)
|
||||
_arguments -s : \
|
||||
"$_pacman_opts_common[@]" \
|
||||
@@ -216,43 +219,57 @@ _pacman_action_version() {
|
||||
_pacman_completions_all_groups() {
|
||||
local -a cmd groups
|
||||
_pacman_get_command
|
||||
groups=( $(_call_program groups $cmd[@] -Sg | grep -e \^$PREFIX) )
|
||||
groups=( $(_call_program groups $cmd[@] -Sg) )
|
||||
compadd "$@" -a groups
|
||||
}
|
||||
|
||||
# provides completions for packages available from repositories
|
||||
# these can be specified as either 'package' or 'repository/package'
|
||||
_pacman_completions_all_packages() {
|
||||
local -a cmd packages repositories
|
||||
local -a cmd packages repositories packages_long
|
||||
|
||||
repositories=( $(_call_program repositories cat /etc/pacman.conf | grep "^\[" | sed "s,\(\[\|\]\),,g" | grep -v "^options" | sort -u) )
|
||||
# these can be specified as either 'package' or 'repository/package'
|
||||
if [[ "$PREFIX" == "" ]] ; then
|
||||
packages=( $(_call_program packages ls /var/lib/pacman/${^repositories} | grep -v "^/" | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
|
||||
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
|
||||
typeset -U repositories
|
||||
packages_long=(/var/lib/pacman/sync/${^repositories}/*(/))
|
||||
packages=(${(o)${${packages_long/\/var\/lib\/pacman\/sync\//}#*/}%-*-*} )
|
||||
typeset -U packages
|
||||
_wanted packages expl "packages" compadd - "${(@)packages}"
|
||||
if [[ $PREFIX != */* ]] ; then
|
||||
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
|
||||
typeset -U repositories
|
||||
_wanted repo_packages expl "repository/package" compadd -S "/" $repositories
|
||||
else
|
||||
packages=( $(_call_program packages ls /var/lib/pacman/${^repositories} | grep -v "^/" | grep -e \^$PREFIX | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
|
||||
compset -P '*/'
|
||||
packages_long=(/var/lib/pacman/sync/$IPREFIX*(/))
|
||||
packages=(${(o)${${packages_long/\/var\/lib\/pacman\/sync\//}#*/}%-*-*} )
|
||||
typeset -U packages
|
||||
_wanted repo_packages expl "repository/package" compadd ${(@)packages}
|
||||
fi
|
||||
compadd "$@" -a packages
|
||||
}
|
||||
|
||||
# provides completions for package groups
|
||||
_pacman_completions_installed_groups() {
|
||||
local -a cmd groups
|
||||
_pacman_get_command
|
||||
groups=( $(_call_program installed_groups $cmd[@] -Qg | cut -d' ' -f1 | grep -e \^$PREFIX | sort -u) )
|
||||
groups=(${(o)${(f)"$(pacman -Qg)"}% *})
|
||||
typeset -U groups
|
||||
compadd "$@" -a groups
|
||||
}
|
||||
|
||||
# provides completions for installed packages
|
||||
_pacman_completions_installed_packages() {
|
||||
local -a cmd packages
|
||||
packages=( $(_call_program installed_packages ls /var/lib/pacman/local | grep "^$PREFIX" | sed "s,\-[^-]*\-[^-]*$,,") )
|
||||
local -a cmd packages packages_long
|
||||
packages_long=(/var/lib/pacman/local/*(/))
|
||||
packages=( ${${packages_long/\/var\/lib\/pacman\/local\//}%-*-*} )
|
||||
compadd "$@" -a packages
|
||||
}
|
||||
|
||||
# provides completions for repository names
|
||||
_pacman_completions_repositories() {
|
||||
local -a cmd repositories
|
||||
repositories=( $(_call_program repositories cat /etc/pacman.conf | grep "^\[" | sed "s,\(\[\|\]\),,g" | grep -v "^options" | grep "^$PREFIX" | sort -u) )
|
||||
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
|
||||
# Uniq the array
|
||||
typeset -U repositories
|
||||
compadd "$@" -a repositories
|
||||
}
|
||||
|
||||
@@ -274,20 +291,19 @@ _pacman_get_command() {
|
||||
_pacman() {
|
||||
case $words[2] in
|
||||
-A*) _pacman_action_add ;;
|
||||
-F*) _pacman_action_freshen ;;
|
||||
-Qg) # ipkg groups
|
||||
-Q*g*) # ipkg groups
|
||||
_arguments -s : \
|
||||
"$_pacman_opts_common[@]" \
|
||||
"$_pacman_opts_query_modifiers[@]" \
|
||||
'*:groups:_pacman_completions_installed_groups'
|
||||
;;
|
||||
-Qo) # file *.pkg.tar.gz
|
||||
-Q*o*) # file
|
||||
_arguments -s : \
|
||||
"$_pacman_opts_common[@]" \
|
||||
"$_pacman_opts_query_modifiers[@]" \
|
||||
'*:package file:_files'
|
||||
;;
|
||||
-Qp) # file *.pkg.tar.gz
|
||||
-Q*p*) # file *.pkg.tar.gz
|
||||
_arguments -s : \
|
||||
"$_pacman_opts_common[@]" \
|
||||
"$_pacman_opts_query_modifiers[@]" \
|
||||
@@ -295,13 +311,16 @@ _pacman() {
|
||||
;;
|
||||
-Q*) _pacman_action_query ;;
|
||||
-R*) _pacman_action_remove ;;
|
||||
-Sl) # repos
|
||||
-S*c*) # no completion
|
||||
return 0
|
||||
;;
|
||||
-S*l*) # repos
|
||||
_arguments -s : \
|
||||
"$_pacman_opts_common[@]" \
|
||||
"$_pacman_opts_sync_modifiers[@]" \
|
||||
'*:package repo:_pacman_completions_repositories' \
|
||||
;;
|
||||
-Sg) # pkg groups
|
||||
-S*g*) # pkg groups
|
||||
_arguments -s : \
|
||||
"$_pacman_opts_common[@]" \
|
||||
"$_pacman_opts_sync_modifiers[@]" \
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.html
|
||||
man3
|
||||
10
doc/.gitignore
vendored
Normal file
10
doc/.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
PKGBUILD.5
|
||||
libalpm.3
|
||||
makepkg.8
|
||||
makepkg.conf.5
|
||||
pacman.8
|
||||
pacman.conf.5
|
||||
repo-add.8
|
||||
repo-remove.8
|
||||
*.xml
|
||||
man3
|
||||
@@ -1,14 +1,14 @@
|
||||
# Doxyfile 1.4.5
|
||||
# Doxyfile 1.5.2
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = libalpm
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY =
|
||||
OUTPUT_DIRECTORY = ./
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
@@ -22,9 +22,9 @@ ABBREVIATE_BRIEF = "The $name class" \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
ALWAYS_DETAILED_SEC = YES
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
FULL_PATH_NAMES = NO
|
||||
STRIP_FROM_PATH =
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
@@ -33,11 +33,12 @@ MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 8
|
||||
TAB_SIZE = 4
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
CPP_CLI_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -48,10 +49,10 @@ EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
HIDE_IN_BODY_DOCS = YES
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
@@ -67,7 +68,7 @@ GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
SHOW_DIRECTORIES = NO
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
@@ -82,12 +83,14 @@ WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT =
|
||||
FILE_PATTERNS = *.c
|
||||
INPUT = ../lib/libalpm/
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS =
|
||||
RECURSIVE = NO
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXCLUDE_SYMBOLS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
@@ -99,50 +102,136 @@ FILTER_SOURCE_FILES = NO
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = NO
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
REFERENCES_LINK_SOURCE = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = NO
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = YES
|
||||
MAN_OUTPUT = ../../doc
|
||||
MAN_OUTPUT = .
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = YES
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
INCLUDE_PATH = ../..
|
||||
INCLUDE_FILE_PATTERNS = *.h
|
||||
PREDEFINED = HAVE_CONFIG_H= SYMHIDDEN= SYMEXPORT=
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
MSCGEN_PATH =
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = YES
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
CALLER_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
DOT_GRAPH_MAX_NODES = 50
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
||||
@@ -1,17 +1,76 @@
|
||||
man_MANS = \
|
||||
# We have to do some funny stuff here with the manpages. In order to ensure
|
||||
# a dist tarball doesn't get put out there without manpages, we keep those
|
||||
# files listed in EXTRA_DIST no matter what. However, we only add them to
|
||||
# man_MANS if --enable-asciidoc and/or --enable-doxygen are used.
|
||||
|
||||
ASCIIDOC_MANS = \
|
||||
pacman.8 \
|
||||
makepkg.8 \
|
||||
repo-add.8 \
|
||||
PKGBUILD.5 \
|
||||
makepkg.conf.5 \
|
||||
pacman.conf.5 \
|
||||
libalpm.3
|
||||
|
||||
if HAS_DOXYGEN
|
||||
man_MANS += $(wildcard man3/*.3)
|
||||
DOXYGEN_MANS = $(wildcard man3/*.3)
|
||||
|
||||
EXTRA_DIST = \
|
||||
pacman.8.txt \
|
||||
makepkg.8.txt \
|
||||
repo-add.8.txt \
|
||||
PKGBUILD.5.txt \
|
||||
PKGBUILD-example.txt \
|
||||
makepkg.conf.5.txt \
|
||||
pacman.conf.5.txt \
|
||||
libalpm.3.txt \
|
||||
footer.txt \
|
||||
Doxyfile \
|
||||
$(ASCIIDOC_MANS) \
|
||||
$(DOXYGEN_MANS)
|
||||
|
||||
# Files that should be removed, but which Automake does not know.
|
||||
MOSTLYCLEANFILES = *.xml
|
||||
MAINTAINERCLEANFILES = $(ASCIIDOC_MANS)
|
||||
|
||||
man_MANS =
|
||||
dist_man_MANS = $(ASCIIDOC_MANS) repo-remove.8
|
||||
|
||||
if USE_DOXYGEN
|
||||
man_MANS += $(DOXYGEN_MANS)
|
||||
|
||||
all: doxygen.in
|
||||
|
||||
doxygen.in:
|
||||
$(DOXYGEN) $(srcdir)/Doxyfile
|
||||
endif
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
if USE_ASCIIDOC
|
||||
ASCIIDOC_OPTS = \
|
||||
-f asciidoc.conf \
|
||||
-a pacman_version="$(PACKAGE_VERSION)" \
|
||||
-a pacman_date="`date +%Y-%m-%d`" \
|
||||
-a sysconfdir=$(sysconfdir)
|
||||
A2X_OPTS = \
|
||||
-d manpage \
|
||||
-f manpage \
|
||||
--xsltproc-opts='-param man.endnotes.list.enabled 0' \
|
||||
--xsltproc-opts='-param man.endnotes.are.numbered 0'
|
||||
|
||||
clean-local:
|
||||
$(RM) man3/*.3
|
||||
$(ASCIIDOC_MANS):
|
||||
a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS)" $@.txt
|
||||
|
||||
# These rules are due to the includes and files of the asciidoc text
|
||||
$(ASCIIDOC_MANS): asciidoc.conf footer.txt
|
||||
pacman.8: pacman.8.txt
|
||||
makepkg.8: makepkg.8.txt
|
||||
repo-add.8: repo-add.8.txt
|
||||
PKGBUILD.5: PKGBUILD.5.txt PKGBUILD-example.txt
|
||||
makepkg.conf.5: makepkg.conf.5.txt
|
||||
pacman.conf.5: pacman.conf.5.txt
|
||||
libalpm.3: libalpm.3.txt
|
||||
# this one is just a symlink
|
||||
repo-remove.8: repo-add.8
|
||||
ln -s repo-add.8 repo-remove.8
|
||||
endif
|
||||
|
||||
# vim:set ts=2 sw=2 noet:
|
||||
|
||||
20
doc/PKGBUILD-example.txt
Normal file
20
doc/PKGBUILD-example.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
# Maintainer: judd <jvinet@zeroflux.org>
|
||||
|
||||
pkgname=patch
|
||||
pkgver=2.5.4
|
||||
pkgrel=3
|
||||
pkgdesc="A utility to apply patch files to original sources"
|
||||
arch=(i686 x86_64)
|
||||
url="http://www.gnu.org/software/patch/patch.html"
|
||||
license=('GPL')
|
||||
groups=('base-devel')
|
||||
depends=('glibc' 'ed')
|
||||
source=(ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz)
|
||||
md5sums=('ee5ae84d115f051d87fcaaef3b4ae782')
|
||||
|
||||
build() {
|
||||
cd $startdir/src/$pkgname-$pkgver
|
||||
./configure --prefix=/usr
|
||||
make || return 1
|
||||
make prefix=$startdir/pkg/usr install
|
||||
}
|
||||
288
doc/PKGBUILD.5
288
doc/PKGBUILD.5
@@ -1,288 +0,0 @@
|
||||
." the string declarations are a start to try and make distro independent
|
||||
.ds DS Arch Linux
|
||||
.ds PB PKGBUILD
|
||||
.ds VR 3.0.0
|
||||
.TH \*(PB 5 "Feb 07, 2007" "\*(PB version \*(VR" "\*(DS Files"
|
||||
.SH NAME
|
||||
\*(PB \- \*(DS package build description file
|
||||
|
||||
.SH DESCRIPTION
|
||||
This manual page is meant to describe general rules about \fB\*(PB\fPs. Once
|
||||
a \fB\*(PB\fP is written, the actual package is built using \fBmakepkg\fP and
|
||||
installed with \fBpacman\fP.
|
||||
|
||||
\fBNOTE:\fP If you have a local copy of the Arch Build System (ABS) tree
|
||||
on your computer, you can copy the \*(PB.proto file to your new package
|
||||
build directory and edit it from there. To acquire/sync the ABS tree, use
|
||||
the \fBabs\fP script included with \fBpacman\fP.
|
||||
|
||||
.SH OPTIONS AND DIRECTIVES
|
||||
.TP
|
||||
.B pkgname
|
||||
The name of the package. This has be a unix-friendly name as it will be
|
||||
used in the package filename.
|
||||
|
||||
.TP
|
||||
.B pkgver
|
||||
The version of the software as released from the author (e.g. 2.7.1).
|
||||
|
||||
.TP
|
||||
.B pkgrel
|
||||
This is the release number specific to the \*(DSs release. This allows package
|
||||
maintainers to make updates to the package's configure flags, for example.
|
||||
|
||||
.TP
|
||||
.B pkgdesc
|
||||
This should be a brief description of the package and its functionality. Try to
|
||||
keep the description to one line of text.
|
||||
|
||||
.TP
|
||||
.B url
|
||||
This field contains a URL that is associated with the software being packaged.
|
||||
This is typically the project's website.
|
||||
|
||||
.TP
|
||||
.B license (array)
|
||||
This field specifies the license(s) that apply to the package. Commonly-used
|
||||
licenses are found in \fI/usr/share/licenses/common\fP. If you see the
|
||||
package's license there, simply reference it in the license field (e.g.
|
||||
\fBlicense=("GPL")\fP). If the package provides a license not found in
|
||||
\fI/usr/share/licenses/common\fP, then you should include the license in the
|
||||
package itself and set \fBlicense=("custom")\fP or
|
||||
\fBlicense=("custom:LicenseName")\fP. The license should be placed in
|
||||
\fI$startdir/pkg/usr/share/licenses/$pkgname\fP when building the package. If
|
||||
multiple licenses are applicable for a package, list all of them:
|
||||
\fBlicenses=('GPL' 'FDL')\fP.
|
||||
|
||||
.TP
|
||||
.B install
|
||||
Specifies a special install script that is to be included in the package. This
|
||||
file should reside in the same directory as the \fB\*(PB\fP, and will be copied
|
||||
into the package by \fBmakepkg\fP. It does not need to be included in the
|
||||
\fIsource\fP array (e.g. \fBinstall=pkgname.install\fP).
|
||||
|
||||
.TP
|
||||
.B source \fI(array)\fP
|
||||
An array of source files required to build the package. Source files must
|
||||
either reside in the same directory as the \fB\*(PB file\fP, or be a
|
||||
fully-qualified URL that makepkg will use to download the file. In order to
|
||||
make the PKGBUILD as useful as possible, use the \fB$pkgname\fP and
|
||||
\fB$pkgver\fP variables if possible when specifying the download location.
|
||||
|
||||
.TP
|
||||
.B noextract \fI(array)\fP
|
||||
An array of filenames corresponding to those from the \fBsource\fP array. Files
|
||||
listed here will not be extracted with the rest of the source files. This is
|
||||
useful for packages which use compressed data which is downloaded but not
|
||||
necessary to uncompress.
|
||||
|
||||
.TP
|
||||
.B md5sums \fI(array)\fP
|
||||
This array contains an MD5 hash for every source file specified in the
|
||||
\fBsource\fP array (in the same order). \fBmakepkg\fP will use this to verify
|
||||
source file integrity during subsequent builds. To easily generate md5sums, run
|
||||
"makepkg -g >> \*(PB". If desired, move the \fBmd5sums\fP line to an
|
||||
appropriate location. NOTE: \fBmakepkg\fP supports multiple integrity
|
||||
algorithms and their corresponding arrays (i.e. sha1sums for the SHA1
|
||||
algorithm); however, official packages use only md5sums for the time being.
|
||||
|
||||
.TP
|
||||
.B sha1sums, etc.
|
||||
Alternative integrity checks that \fBmakepkg\fP supports, as noted in
|
||||
\fBmd5sums\fP above.
|
||||
|
||||
.TP
|
||||
.B groups \fI(array)\fP
|
||||
An array of symbolic names that represent groups of packages, allowing
|
||||
you to install multiple packages by requesting a single target. For example,
|
||||
one could install all KDE packages by installing the 'kde' group.
|
||||
|
||||
.TP
|
||||
.B arch \fI(array)\fP
|
||||
Defines on which architectures the given package is available (e.g.
|
||||
\fBarch=('i686' 'x86_64')\fP).
|
||||
|
||||
.TP
|
||||
.B backup \fI(array)\fP
|
||||
A space-delimited array of filenames, \fIwithout\fP preceding slashes, that
|
||||
should be backed up if the package is removed or upgraded. This is commonly
|
||||
used for packages placing configuration files in /etc. See \fBHANDLING CONFIG
|
||||
FILES\fP in the \fBpacman\fP manpage for more information.
|
||||
|
||||
.TP
|
||||
.B depends \fI(array)\fP
|
||||
An array of packages that this package depends on to run. Packages in this list
|
||||
should be surrounded with single quotes and contain at least the package name.
|
||||
Entries can also include a version requirement of the form
|
||||
\fB'name<>version'\fP, where <> is one of three comparisons: \fI>=\fP (greater
|
||||
than or equal to), \fI<=\fP (less than or equal to), or \fI=\fP (equal to).
|
||||
|
||||
.TP
|
||||
.B makedepends \fI(array)\fP
|
||||
An array of packages that this package depends on to build, but are not needed
|
||||
at runtime. Packages in this list follow the same format as \fBdepends\fP.
|
||||
|
||||
.TP
|
||||
.B conflicts \fI(array)\fP
|
||||
An array of packages that will conflict with this package (i.e. they cannot
|
||||
both be installed at the same time). This directive follows the same format as
|
||||
\fIdepends\fP, except you cannot specify versions.
|
||||
|
||||
.TP
|
||||
.B provides \fI(array)\fP
|
||||
An array of "virtual provisions" that this package provides. This allows a
|
||||
package to provide dependencies other than its own package name. For example,
|
||||
the dcron package can provide 'cron', which allows packages to depend on 'cron'
|
||||
rather than 'dcron OR fcron'.
|
||||
|
||||
.TP
|
||||
.B replaces \fI(array)\fP
|
||||
An array of packages that this package should replace, and can be used to
|
||||
handle renamed/combined packages. For example, if the 'j2re' package is renamed
|
||||
to 'jre', this directive allows future upgrades to continue as expected even
|
||||
though the package has moved.
|
||||
|
||||
.TP
|
||||
.B options \fI(array)\fP
|
||||
This array allows you to override some of \fBmakepkg\fP's default behavior when
|
||||
building packages. To set an option, just include the option name in the
|
||||
\fBoptions\fP array. To reverse the default behavior, place an "!" at the front
|
||||
of the option. Only specify the options you specifically want to override, the
|
||||
rest will be taken from \fBmakepkg.conf\fP. NOTE: 'force' is a special option
|
||||
only used in \fB\*(PB\fPs, do not use it unless you know what you are doing.
|
||||
.RS
|
||||
.TP
|
||||
.B strip
|
||||
Strip symbols from binaries and libraries. If you frequently use a debugger on
|
||||
programs or libraries, it may be helpful to disable this option.
|
||||
.TP
|
||||
.B docs
|
||||
Save doc and info directories. If you wish to delete doc and info directories,
|
||||
specify "!docs" in the array.
|
||||
.TP
|
||||
.B libtool
|
||||
Leave libtool (.la) files in packages. Specify "!libtool" to remove them.
|
||||
.TP
|
||||
.B emptydirs
|
||||
Leave empty directories in packages.
|
||||
.TP
|
||||
.B ccache
|
||||
Allow the use of \fBccache\fP during build. More useful in its negative form
|
||||
"!ccache" with select packages that have problems building with \fBccache\fP.
|
||||
.TP
|
||||
.B distcc
|
||||
Allow the use of \fBdistcc\fP during build. More useful in its negative form
|
||||
"!distcc" with select packages that have problems building with \fBdistcc\fP.
|
||||
.TP
|
||||
.B makeflags
|
||||
Allow the use of user-specific makeflags during build as specified in
|
||||
\fBmakepkg.conf\fP. More useful in its negative form "!makeflags" with select
|
||||
packages that have problems building with custom makeflags such as "-j2" (or
|
||||
higher).
|
||||
.TP
|
||||
.B force
|
||||
Force the package to be upgraded by a \fBpacman\fP system upgrade operation,
|
||||
even if the version number would normally not trigger such an upgrade. This is
|
||||
useful when the version numbering scheme of a package changes (or is
|
||||
alphanumeric).
|
||||
.RE
|
||||
|
||||
.SH INSTALL/UPGRADE/REMOVE SCRIPTING
|
||||
\fBPacman\fP has the ability to store and execute a package-specific script
|
||||
when it installs, removes, or upgrades a package. This allows a package to
|
||||
configure itself after installation and do the opposite right before it is
|
||||
removed.
|
||||
|
||||
The exact time the script is run varies with each operation:
|
||||
|
||||
.TP
|
||||
.B pre_install
|
||||
script is run right before files are extracted.
|
||||
|
||||
.TP
|
||||
.B post_install
|
||||
script is run right after files are extracted.
|
||||
|
||||
.TP
|
||||
.B pre_upgrade
|
||||
script is run right before files are extracted.
|
||||
|
||||
.TP
|
||||
.B post_upgrade
|
||||
script is run after files are extracted.
|
||||
|
||||
.TP
|
||||
.B pre_remove
|
||||
script is run right before files are removed.
|
||||
|
||||
.TP
|
||||
.B post_remove
|
||||
script is run right after files are removed.
|
||||
|
||||
.P
|
||||
To use this feature, create a file such as 'pkgname.install' and put it in
|
||||
the same directory as the \fB\*(PB\fP script. Then use the \fBinstall\fP
|
||||
directive:
|
||||
|
||||
.RS
|
||||
.nf
|
||||
install=pkgname.install
|
||||
.fi
|
||||
.RE
|
||||
|
||||
The install script does not need to be specified in the \fBsource\fP array.
|
||||
A template install file is available in the ABS tree (/var/abs/install.proto).
|
||||
|
||||
.SH EXAMPLE
|
||||
The following is an example \fB\*(PB\fP for the 'modutils' package. For more
|
||||
examples, look through the ABS tree.
|
||||
|
||||
.nf
|
||||
# Maintainer: John Doe <johndoe@archlinux.org>
|
||||
# Contributor: Bill Smith <billsmith@archlinux.org>
|
||||
pkgname=modutils
|
||||
pkgver=2.4.25
|
||||
pkgrel=1
|
||||
pkgdesc="Utilities for inserting modules in the linux kernel"
|
||||
url="http://www.kernel.org"
|
||||
makedepends=('bash' 'mawk')
|
||||
depends=('glibc' 'zlib')
|
||||
backup=(etc/modules.conf)
|
||||
source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/v2.4/$pkgname-$pkgver.tar.bz2
|
||||
modules.conf)
|
||||
arch=('i686')
|
||||
license=('GPL' 'custom') # dual licensed
|
||||
md5sums=('2c0cca3ef6330a187c6ef4fe41ecaa4d'
|
||||
'35175bee593a7cc7d6205584a94d8625')
|
||||
options=(!libtool)
|
||||
|
||||
build() {
|
||||
cd $startdir/src/$pkgname-$pkgver
|
||||
./configure --prefix=/usr --enable-insmod-static
|
||||
make || return 1
|
||||
make prefix=$startdir/pkg/usr install
|
||||
mv $startdir/pkg/usr/sbin $startdir/pkg
|
||||
mkdir -p $startdir/pkg/etc
|
||||
cp ../modules.conf $startdir/pkg/etc
|
||||
}
|
||||
.fi
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR makepkg (8),
|
||||
.BR pacman (8),
|
||||
.BR makepkg.conf (5)
|
||||
|
||||
See the Arch Linux website at <http://www.archlinux.org> for more current
|
||||
information on the distribution and the \fBpacman\fP family of tools, and
|
||||
<http://wiki.archlinux.org/index.php/Arch_Packaging_Standards> for
|
||||
recommendations on packaging standards.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Judd Vinet <jvinet@zeroflux.org>
|
||||
Aurelien Foret <aurelien@archlinux.org>
|
||||
Aaron Griffin <aaron@archlinux.org>
|
||||
Dan McGee <dan@archlinux.org>
|
||||
.fi
|
||||
|
||||
See the 'AUTHORS' file for additional contributors.
|
||||
331
doc/PKGBUILD.5.txt
Normal file
331
doc/PKGBUILD.5.txt
Normal file
@@ -0,0 +1,331 @@
|
||||
/////
|
||||
vim:set ts=4 sw=4 syntax=asciidoc noet:
|
||||
/////
|
||||
PKGBUILD(5)
|
||||
===========
|
||||
|
||||
Name
|
||||
----
|
||||
PKGBUILD - Arch Linux package build description file
|
||||
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
PKGBUILD
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
This manual page is meant to describe general rules about PKGBUILDs. Once a
|
||||
PKGBUILD is written, the actual package is built using makepkg and installed
|
||||
with pacman.
|
||||
|
||||
NOTE: If you are using Arch Linux and have a local copy of the Arch Build
|
||||
System (ABS) tree on your computer, or are using another distribution that
|
||||
provides a similar tree of build files, you can copy the provided
|
||||
PKGBUILD.proto file to a new package build directory and make customizations to
|
||||
suit your needs. An up to date prototype file can also be found in the source
|
||||
distribution of this package.
|
||||
|
||||
|
||||
Options and Directives
|
||||
----------------------
|
||||
*pkgname*::
|
||||
The name of the package. This has be a unix-friendly name as it will be
|
||||
used in the package filename.
|
||||
|
||||
*pkgver*::
|
||||
The version of the software as released from the author (e.g. \'2.7.1').
|
||||
|
||||
*pkgrel*::
|
||||
This is the release number specific to the Arch Linux release. This
|
||||
allows package maintainers to make updates to the package's configure
|
||||
flags, for example. A pkgrel of 1 is typically used for each upstream
|
||||
software release and is incremented for intermediate PKGBUILD updates.
|
||||
|
||||
*pkgdesc*::
|
||||
This should be a brief description of the package and its functionality.
|
||||
Try to keep the description to one line of text.
|
||||
|
||||
*url*::
|
||||
This field contains a URL that is associated with the software being
|
||||
packaged. This is typically the project's website.
|
||||
|
||||
*license (array)*::
|
||||
This field specifies the license(s) that apply to the package.
|
||||
Commonly-used licenses are found in '/usr/share/licenses/common'. If you
|
||||
see the package's license there, simply reference it in the license
|
||||
field (e.g. `$$license=('GPL')$$`). If the package provides a license not
|
||||
found in '/usr/share/licenses/common', then you should include the license
|
||||
in the package itself and set `$$license=('custom')$$` or
|
||||
`$$license=('custom:LicenseName')$$`. The license should be placed in
|
||||
'$pkgdir/usr/share/licenses/$pkgname' when building the package. If
|
||||
multiple licenses are applicable for a package, list all of them:
|
||||
`$$license=('GPL' 'FDL')$$`.
|
||||
|
||||
*install*::
|
||||
Specifies a special install script that is to be included in the package.
|
||||
This file should reside in the same directory as the PKGBUILD, and will
|
||||
be copied into the package by makepkg. It does not need to be included
|
||||
in the source array (e.g. `$$install=pkgname.install$$`).
|
||||
|
||||
*source (array)*::
|
||||
An array of source files required to build the package. Source files
|
||||
must either reside in the same directory as the PKGBUILD file, or be a
|
||||
fully-qualified URL that makepkg will use to download the file. In order
|
||||
to make the PKGBUILD as useful as possible, use the $pkgname and $pkgver
|
||||
variables if possible when specifying the download location. Any files
|
||||
that are compressed will automatically be extracted, unless found in
|
||||
the noextract array listed below.
|
||||
|
||||
*noextract (array)*::
|
||||
An array of filenames corresponding to those from the source array. Files
|
||||
listed here will not be extracted with the rest of the source files. This
|
||||
is useful for packages which use compressed data which is downloaded but
|
||||
not necessary to uncompress.
|
||||
|
||||
*md5sums (array)*::
|
||||
This array contains an MD5 hash for every source file specified in the
|
||||
source array (in the same order). makepkg will use this to verify source
|
||||
file integrity during subsequent builds. To easily generate md5sums, run
|
||||
``makepkg -g >> PKGBUILD''. If desired, move the md5sums line to an
|
||||
appropriate location. *NOTE:* makepkg supports multiple integrity
|
||||
algorithms and their corresponding arrays (i.e. sha1sums for the SHA1
|
||||
algorithm); however, official packages use only md5sums for the time
|
||||
being.
|
||||
|
||||
*sha1sums, etc.*::
|
||||
Alternative integrity checks that makepkg supports, as noted in md5sums
|
||||
above.
|
||||
|
||||
*groups (array)*::
|
||||
An array of symbolic names that represent groups of packages, allowing
|
||||
you to install multiple packages by requesting a single target. For
|
||||
example, one could install all KDE packages by installing the 'kde' group.
|
||||
|
||||
*arch (array)*::
|
||||
Defines on which architectures the given package is available (e.g.
|
||||
`$$arch=('i686' 'x86_64')$$`).
|
||||
|
||||
*backup (array)*::
|
||||
A space-delimited array of filenames, without preceding slashes, that
|
||||
should be backed up if the package is removed or upgraded. This is
|
||||
commonly used for packages placing configuration files in /etc. See
|
||||
Handling Config Files in linkman:pacman[8] for more information.
|
||||
|
||||
*depends (array)*::
|
||||
An array of packages that this package depends on to run. Packages in
|
||||
this list should be surrounded with single quotes and contain at least
|
||||
the package name. Entries can also include a version requirement of the
|
||||
form 'name<>version', where <> is one of five comparisons: >= (greater
|
||||
than or equal to), <= (less than or equal to), = (equal to), > (greater
|
||||
than), or < (less than).
|
||||
|
||||
*makedepends (array)*::
|
||||
An array of packages that this package depends on to build, but are not
|
||||
needed at runtime. Packages in this list follow the same format as
|
||||
depends.
|
||||
|
||||
*optdepends (array)*::
|
||||
An array of optional packages (and accompanying reasons) that are not
|
||||
essential to the package, but would offer increased functionality or other
|
||||
features when installed. optdepends are currently for informational
|
||||
purposes only and are not utilized by pacman during dependency resolution.
|
||||
The format should be similar to the following:
|
||||
|
||||
optdepends=('fakeroot: for makepkg usage as normal user')
|
||||
|
||||
*conflicts (array)*::
|
||||
An array of packages that will conflict with this package (i.e. they
|
||||
cannot both be installed at the same time). This directive follows the
|
||||
same format as depends. Versioned conflicts are also supported.
|
||||
|
||||
*provides (array)*::
|
||||
An array of ``virtual provisions'' that this package provides. This allows
|
||||
a package to provide dependencies other than its own package name. For
|
||||
example, the dcron package can provide 'cron', which allows packages to
|
||||
depend on 'cron' rather than 'dcron OR fcron'.
|
||||
Versioned provisions are also possible, in the 'name=version' format.
|
||||
For example, dcron can provide 'cron=2.0' to satisfy the 'cron>=2.0'
|
||||
dependency of other packages.
|
||||
|
||||
*replaces (array)*::
|
||||
An array of packages that this package should replace, and can be used
|
||||
to handle renamed/combined packages. For example, if the 'j2re' package
|
||||
is renamed to 'jre', this directive allows future upgrades to continue
|
||||
as expected even though the package has moved. Sysupgrade is currently
|
||||
the only pacman operation that utilizes this field, a normal sync will
|
||||
not use its value.
|
||||
|
||||
*options (array)*::
|
||||
This array allows you to override some of makepkg's default behavior
|
||||
when building packages. To set an option, just include the option name
|
||||
in the options array. To reverse the default behavior, place an ``!'' at
|
||||
the front of the option. Only specify the options you specifically want
|
||||
to override, the rest will be taken from linkman:makepkg.conf[5].
|
||||
*NOTE:* 'force' is a special option only used in a linkman:PKGBUILD[5],
|
||||
do not use it unless you know what you are doing.
|
||||
|
||||
*strip*;;
|
||||
Strip symbols from binaries and libraries. If you frequently
|
||||
use a debugger on programs or libraries, it may be helpful to
|
||||
disable this option.
|
||||
|
||||
*docs*;;
|
||||
Save doc and info directories. If you wish to delete doc and
|
||||
info directories, specify `!docs` in the array.
|
||||
|
||||
*libtool*;;
|
||||
Leave libtool (.la) files in packages. Specify `!libtool` to
|
||||
remove them.
|
||||
|
||||
*emptydirs*;;
|
||||
Leave empty directories in packages.
|
||||
|
||||
*ccache*;;
|
||||
Allow the use of ccache during build. More useful in its negative
|
||||
form `!ccache` with select packages that have problems building
|
||||
with ccache.
|
||||
|
||||
*distcc*;;
|
||||
Allow the use of distcc during build. More useful in its negative
|
||||
form `!distcc` with select packages that have problems building
|
||||
with distcc.
|
||||
|
||||
*makeflags*;;
|
||||
Allow the use of user-specific makeflags during build as specified
|
||||
in linkman:makepkg.conf[5]. More useful in its negative form
|
||||
`!makeflags` with select packages that have problems building with
|
||||
custom makeflags such as `-j2` (or higher).
|
||||
|
||||
*force*;;
|
||||
Force the package to be upgraded by a pacman system upgrade
|
||||
operation, even if the version number would normally not trigger
|
||||
such an upgrade. This is useful when the version numbering scheme
|
||||
of a package changes (or is alphanumeric).
|
||||
|
||||
|
||||
Install/Upgrade/Remove Scripting
|
||||
--------------------------------
|
||||
Pacman has the ability to store and execute a package-specific script when it
|
||||
installs, removes, or upgrades a package. This allows a package to configure
|
||||
itself after installation and perform an opposite action upon removal.
|
||||
|
||||
The exact time the script is run varies with each operation:
|
||||
|
||||
*pre_install*::
|
||||
script is run right before files are extracted. One argument is passed:
|
||||
new package version.
|
||||
|
||||
*post_install*::
|
||||
script is run right after files are extracted. One argument is passed:
|
||||
new package version.
|
||||
|
||||
*pre_upgrade*::
|
||||
script is run right before files are extracted. Two arguments are passed
|
||||
in the following order: new package version, old package version.
|
||||
|
||||
*post_upgrade*::
|
||||
script is run after files are extracted. Two arguments are passed
|
||||
in the following order: new package version, old package version.
|
||||
|
||||
*pre_remove*::
|
||||
script is run right before files are removed. One argument is passed:
|
||||
old package version.
|
||||
|
||||
*post_remove*::
|
||||
script is run right after files are removed. One argument is passed:
|
||||
old package version.
|
||||
|
||||
To use this feature, create a file such as 'pkgname.install' and put it in the
|
||||
same directory as the PKGBUILD script. Then use the install directive:
|
||||
|
||||
install=pkgname.install
|
||||
|
||||
The install script does not need to be specified in the source array. A
|
||||
template install file is available with the source distribution of this
|
||||
program, or one may be provided by your distribution. For example, Arch Linux
|
||||
provides prototype install files in the ABS tree.
|
||||
|
||||
|
||||
Development Directives
|
||||
----------------------
|
||||
makepkg supports building development versions of packages without having to
|
||||
manually update the pkgver in the PKGBUILD. This was formerly done using the
|
||||
separate utility 'versionpkg'. In order to utilize this functionality, your
|
||||
PKGBUILD must use correct variable names depending on the SCM being fetched
|
||||
from.
|
||||
|
||||
*CVS*::
|
||||
The generated pkgver will be the date the package is built.
|
||||
|
||||
*_cvsroot*;;
|
||||
The root of the CVS repository.
|
||||
|
||||
*_cvsmod*;;
|
||||
The CVS module to fetch.
|
||||
|
||||
*SVN*::
|
||||
The generated pkgver will be the latest SVN revision number.
|
||||
|
||||
*_svntrunk*;;
|
||||
The trunk of the SVN repository.
|
||||
|
||||
*_svnmod*;;
|
||||
The SVN module to fetch.
|
||||
|
||||
*Git*::
|
||||
The generated pkgver will be one formatted by the 'git-describe'
|
||||
command, with '-' characters converted to '_' characters.
|
||||
|
||||
*_gitroot*;;
|
||||
The URL (all protocols supported) to the GIT repository.
|
||||
|
||||
*_gitname*;;
|
||||
GIT tag or branch to use.
|
||||
|
||||
*Mercurial*::
|
||||
The generated pkgver will be the hg tip revision number.
|
||||
|
||||
*_hgroot*;;
|
||||
The URL of the mercurial repository.
|
||||
|
||||
*_hgrepo*;;
|
||||
The repository to follow.
|
||||
|
||||
*Darcs*::
|
||||
The generated pkgver will be the date the package is built.
|
||||
|
||||
*_darcstrunk*;;
|
||||
URL to the repository trunk.
|
||||
|
||||
*_darcsmod*;;
|
||||
Darcs module to use.
|
||||
|
||||
*Bazaar*::
|
||||
The generated pkgver will be the latest Bazaar revision number (revno).
|
||||
|
||||
*_bzrtrunk*;;
|
||||
URL to the bazaar repository.
|
||||
|
||||
*_bzrmod*;;
|
||||
Bazaar module to use.
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
The following is an example PKGBUILD for the 'patch' package. For more
|
||||
examples, look through the build files of your distribution's packages. For
|
||||
those using Arch Linux, consult the ABS tree.
|
||||
|
||||
[sh]
|
||||
source~~~~~
|
||||
include::PKGBUILD-example.txt[]
|
||||
source~~~~~
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
linkman:makepkg[8], linkman:pacman[8], linkman:makepkg.conf[5]
|
||||
|
||||
include::footer.txt[]
|
||||
70
doc/asciidoc.conf
Normal file
70
doc/asciidoc.conf
Normal file
@@ -0,0 +1,70 @@
|
||||
## linkman: macro
|
||||
# Inspired by/borrowed from the GIT source tree at Documentation/asciidoc.conf
|
||||
#
|
||||
# Usage: linkman:command[manpage-section]
|
||||
#
|
||||
# Note, {0} is the manpage section, while {target} is the command.
|
||||
#
|
||||
# Show man link as: <command>(<section>); if section is defined, else just show
|
||||
# the command.
|
||||
|
||||
[attributes]
|
||||
plus=+
|
||||
caret=^
|
||||
startsb=[
|
||||
endsb=]
|
||||
tilde=~
|
||||
|
||||
ifdef::backend-docbook[]
|
||||
[linkman-inlinemacro]
|
||||
{0%{target}}
|
||||
{0#<citerefentry>}
|
||||
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
|
||||
{0#</citerefentry>}
|
||||
endif::backend-docbook[]
|
||||
|
||||
ifdef::backend-docbook[]
|
||||
ifndef::docbook-xsl-172[]
|
||||
# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
|
||||
# v1.72 breaks with this because it replaces dots not in roff requests.
|
||||
[listingblock]
|
||||
<example><title>{title}</title>
|
||||
<literallayout>
|
||||
ifdef::doctype-manpage[]
|
||||
.ft C
|
||||
endif::doctype-manpage[]
|
||||
|
|
||||
ifdef::doctype-manpage[]
|
||||
.ft
|
||||
endif::doctype-manpage[]
|
||||
</literallayout>
|
||||
{title#}</example>
|
||||
endif::docbook-xsl-172[]
|
||||
endif::backend-docbook[]
|
||||
|
||||
ifdef::doctype-manpage[]
|
||||
ifdef::backend-docbook[]
|
||||
[header]
|
||||
template::[header-declarations]
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
<date>{pacman_date}</date>
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>{mantitle}</refentrytitle>
|
||||
<manvolnum>{manvolnum}</manvolnum>
|
||||
<refmiscinfo class="source">Pacman</refmiscinfo>
|
||||
<refmiscinfo class="version">{pacman_version}</refmiscinfo>
|
||||
<refmiscinfo class="manual">Pacman Manual</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>{manname}</refname>
|
||||
<refpurpose>{manpurpose}</refpurpose>
|
||||
</refnamediv>
|
||||
endif::backend-docbook[]
|
||||
endif::doctype-manpage[]
|
||||
|
||||
ifdef::backend-xhtml11[]
|
||||
[linkman-inlinemacro]
|
||||
<a href="{target}.{0}.html">{target}{0?({0})}</a>
|
||||
endif::backend-xhtml11[]
|
||||
23
doc/footer.txt
Normal file
23
doc/footer.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
/////
|
||||
vim:set ts=4 sw=4 syntax=asciidoc noet:
|
||||
/////
|
||||
|
||||
See the pacman website at http://www.archlinux.org/pacman/[] for current
|
||||
information on pacman and its related tools.
|
||||
|
||||
|
||||
Bugs
|
||||
----
|
||||
Bugs? You must be kidding, there are no bugs in this software. But if we
|
||||
happen to be wrong, send us an email with as much detail as possible to
|
||||
mailto:pacman-dev@archlinux.org[].
|
||||
|
||||
|
||||
Authors
|
||||
-------
|
||||
* Judd Vinet <jvinet@zeroflux.org>
|
||||
* Aurelien Foret <aurelien@archlinux.org>
|
||||
* Aaron Griffin <aaron@archlinux.org>
|
||||
* Dan McGee <dan@archlinux.org>
|
||||
|
||||
See the 'AUTHORS' file for additional contributors.
|
||||
@@ -1,53 +0,0 @@
|
||||
." the string declarations are a start to try and make distro independent
|
||||
.ds DS Arch Linux
|
||||
.ds PB PKGBUILD
|
||||
.ds VR 3.0.0
|
||||
.ds LV 1.0.0
|
||||
.TH libalpm 3 "Feb 08, 2007" "libalpm version \*(LV" "\*(DS Utilities"
|
||||
.SH NAME
|
||||
libalpm \- Arch Linux Package Management (ALPM) library
|
||||
|
||||
.SH SYNOPSIS
|
||||
For ease of access, the libalpm manual has been split up into several sections.
|
||||
|
||||
(TODO) Yes, this man page needs a lot of work. Once we get around to doing good
|
||||
Doxygen documentation, it will improve. We promise.
|
||||
|
||||
.nf
|
||||
alpm_databases Database Functions
|
||||
alpm_interface Interface Functions
|
||||
alpm_list List Functions
|
||||
alpm_log Logging Functions
|
||||
alpm_misc Miscellaneous Functions
|
||||
alpm_packages Package Functions
|
||||
alpm_sync Sync Functions
|
||||
alpm_trans Transaction Functions
|
||||
.fi
|
||||
|
||||
.SH CONFIGURATION
|
||||
See
|
||||
.BR pacman.conf (5)
|
||||
for more details on configuring \fBlibalpm\fP using the \fBpacman.conf\fP file.
|
||||
|
||||
.SH BUGS
|
||||
Bugs? You must be kidding, there are no bugs in this software. But if we happen
|
||||
to be wrong, send us an email with as much detail as possible to
|
||||
<pacman-dev@archlinux.org>.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR pacman (8),
|
||||
.BR makepkg (8),
|
||||
.BR pacman.conf (5)
|
||||
|
||||
See the Arch Linux website at <http://www.archlinux.org> for more current
|
||||
information on the distribution and the \fBpacman\fP family of tools.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Judd Vinet <jvinet@zeroflux.org>
|
||||
Aurelien Foret <aurelien@archlinux.org>
|
||||
Aaron Griffin <aaron@archlinux.org>
|
||||
Dan McGee <dan@archlinux.org>
|
||||
.fi
|
||||
|
||||
See the 'AUTHORS' file for additional contributors.
|
||||
39
doc/libalpm.3.txt
Normal file
39
doc/libalpm.3.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
/////
|
||||
vim:set ts=4 sw=4 syntax=asciidoc noet:
|
||||
/////
|
||||
libalpm(3)
|
||||
==========
|
||||
|
||||
Name
|
||||
----
|
||||
libalpm - Arch Linux Package Management (ALPM) library
|
||||
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
For ease of access, the libalpm manual has been split up into several sections.
|
||||
|
||||
*TODO:* Yes, this man page needs a lot of work. Once we get around to doing
|
||||
good Doxygen documentation, it will improve. We promise.
|
||||
|
||||
*alpm_databases*:: Database Functions
|
||||
*alpm_interface*:: Interface Functions
|
||||
*alpm_list*:: List Functions
|
||||
*alpm_log*:: Logging Functions
|
||||
*alpm_misc*:: Miscellaneous Functions
|
||||
*alpm_packages*:: Package Functions
|
||||
*alpm_sync*:: Sync Functions
|
||||
*alpm_trans*:: Transaction Functions
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
See linkman:pacman.conf[5] for more details on configuring libalpm using the
|
||||
'pacman.conf' file.
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
linkman:pacman[8], linkman:makepkg[8], linkman:pacman.conf[5]
|
||||
|
||||
include::footer.txt[]
|
||||
142
doc/makepkg.8
142
doc/makepkg.8
@@ -1,142 +0,0 @@
|
||||
." the string declarations are a start to try and make distro independent
|
||||
.ds DS Arch Linux
|
||||
.ds PB PKGBUILD
|
||||
.ds VR 3.0.0
|
||||
.TH makepkg 8 "Feb 07, 2007" "makepkg version \*(VR" "\*(DS Utilities"
|
||||
.SH NAME
|
||||
makepkg \- package build utility
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B makepkg
|
||||
[\fIoptions\fR]
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBmakepkg\fP is a script to automate the building of packages. All it needs is
|
||||
a build-capable Linux platform and a custom build script for each package you
|
||||
wish to build (known as a \fB\*(PB\fP). See
|
||||
.BR \*(PB (5)
|
||||
for details on creating your own build scripts.
|
||||
|
||||
The advantage to a script-based build is that the work is only done once. Once
|
||||
you have the build script for a package, makepkg will do the rest: download and
|
||||
validate source files, check dependencies, configure the build-time settings,
|
||||
build the package, install the package into a temporary root, make
|
||||
customizations, generate meta-info, and package the whole thing up for
|
||||
\fBpacman\fP to use.
|
||||
|
||||
\fBmakeworld\fP can be used to rebuild an entire package group or the entire
|
||||
build tree. See \fBmakeworld --help\fP for syntax.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-b, --builddeps
|
||||
Build missing dependencies from source. When \fBmakepkg\fP finds missing
|
||||
build-time or run-time dependencies, it will look for the dependencies'
|
||||
\fB\*(PB\fP files under \fIABSROOT\fP (set in \fBmakepkg.conf\fP). If it finds
|
||||
them it will call \fBmakepkg\fP to build and install the missing dependencies.
|
||||
The child calls will be made with the \fB-b\fP and \fB-i\fP options.
|
||||
.TP
|
||||
.B \-c, --clean
|
||||
Clean up leftover work files and directories after a successful build.
|
||||
.TP
|
||||
.B \-C, --cleancache
|
||||
Removes all cached source files from the directory specified in \fISRCDEST\fP
|
||||
in \fBmakepkg.conf\fP.
|
||||
.TP
|
||||
.B \-d, --nodeps
|
||||
Do not perform any dependency checks. This will let you override and ignore any
|
||||
dependencies required. There is a good chance this option will break the build
|
||||
process if all of the dependencies are not installed.
|
||||
.TP
|
||||
.B \-e, --noextract
|
||||
Do not extract source files; use whatever source already exists in the src/
|
||||
directory. This is handy if you want to go into src and manually patch or tweak
|
||||
code, then make a package out of the result. Keep in mind that creating a patch
|
||||
may be a better solution to allow others to use your \fB\*(PB\fP.
|
||||
.TP
|
||||
.B \-f, --force
|
||||
\fBmakepkg\fP will not build a package if a built package already exists in the
|
||||
\fIPKGDEST\fP (set in \fBmakepkg.conf\fP) directory, which may default to the
|
||||
current directory. This allows the built package to be overwritten.
|
||||
.TP
|
||||
.B \-g, --geninteg
|
||||
For each source file in the source array of \fB\*(PB\fP, download the file if
|
||||
required and generate integrity checks. The integrity checks generated are
|
||||
determined by the value of the \fIINTEGRITY_CHECK\fP array in makepkg.conf.
|
||||
This output can be redirected into your \fB\*(PB\fP for source validation
|
||||
(makepkg -g >> \*(PB).
|
||||
.TP
|
||||
.B \-h, --help
|
||||
Output syntax and command line options.
|
||||
.TP
|
||||
.B \-i, --install
|
||||
Install or upgrade the package after a successful build using \fBpacman\fP.
|
||||
.TP
|
||||
.B \-m, --nocolor
|
||||
Disable color in output messages.
|
||||
.TP
|
||||
.B \-o, --nobuild
|
||||
Download and extract files only, but do not build them. Useful with the
|
||||
\fB--noextract\fP option if you wish to tweak the files in src/ before
|
||||
building.
|
||||
.TP
|
||||
.B \-p \fIbuildscript\fP
|
||||
Read the package script \fIbuildscript\fP instead of the default, \fI\*(PB\fP.
|
||||
.TP
|
||||
.B \-r, --rmdeps
|
||||
Upon successful build, remove any dependencies installed by \fBmakepkg\fP
|
||||
during dependency auto-resolution (using \fB-b\fP or \fB-s\fP).
|
||||
.TP
|
||||
.B \-R, --repackage
|
||||
Repackage contents of pkg/ without rebuilding the package. This is useful if
|
||||
you forgot a depend or install file in your \fB\*(PB\fP and the build itself
|
||||
will not change.
|
||||
.TP
|
||||
.B \-s, --syncdeps
|
||||
Install missing dependencies using \fBpacman\fP. When missing build-time or
|
||||
run-time dependencies are found, \fBpacman\fP will try to resolve them. If
|
||||
successful, the missing packages will be downloaded and installed.
|
||||
.TP
|
||||
.B \-S, --usesudo
|
||||
Use \fBsudo\fP to perform all operations that require \fBpacman\fP. This is
|
||||
useful for \fB--install\fP, \fB--rmdeps\fP, and \fB--syncdeps\fP. If you are
|
||||
building packages as a non-root user as recommended, this option should be used
|
||||
if using any option that calls \fBpacman\fP.
|
||||
.TP
|
||||
.B \--noconfirm
|
||||
(Passed to \fBpacman\fP) Prevent \fBpacman\fP from waiting for user input
|
||||
before proceeding with operations.
|
||||
.TP
|
||||
.B \--noprogressbar
|
||||
(Passed to \fBpacman\fP) Prevent \fBpacman\fP from displaying a progress bar;
|
||||
useful if you are redirecting makepkg output to file.
|
||||
|
||||
.SH CONFIGURATION
|
||||
See
|
||||
.BR makepkg.conf (5)
|
||||
for more details on configuring \fBmakepkg\fP using the \fBmakepkg.conf\fP file.
|
||||
|
||||
.SH BUGS
|
||||
Bugs? You must be kidding, there are no bugs in this software. But if we happen
|
||||
to be wrong, send us an email with as much detail as possible to
|
||||
<pacman-dev@archlinux.org>.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR makepkg.conf (5),
|
||||
.BR \*(PB (5),
|
||||
.BR pacman (8)
|
||||
|
||||
See the Arch Linux website at <http://www.archlinux.org> for more current
|
||||
information on the distribution and the \fBpacman\fP family of tools, and
|
||||
<http://wiki.archlinux.org/index.php/Arch_Packaging_Standards> for
|
||||
recommendations on packaging standards.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Judd Vinet <jvinet@zeroflux.org>
|
||||
Aurelien Foret <aurelien@archlinux.org>
|
||||
Aaron Griffin <aaron@archlinux.org>
|
||||
Dan McGee <dan@archlinux.org>
|
||||
.fi
|
||||
|
||||
See the 'AUTHORS' file for additional contributors.
|
||||
170
doc/makepkg.8.txt
Normal file
170
doc/makepkg.8.txt
Normal file
@@ -0,0 +1,170 @@
|
||||
/////
|
||||
vim:set ts=4 sw=4 syntax=asciidoc noet:
|
||||
/////
|
||||
makepkg(8)
|
||||
==========
|
||||
|
||||
Name
|
||||
----
|
||||
makepkg - package build utility
|
||||
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
makepkg [options]
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
makepkg is a script to automate the building of packages. The requirements for
|
||||
using the script are a build-capable \*nix platform and a custom build script
|
||||
for each package you wish to build (known as a PKGBUILD). See
|
||||
linkman:PKGBUILD[5] for details on creating your own build scripts.
|
||||
|
||||
The advantage to a script-based build is that the work is only done once. Once
|
||||
you have the build script for a package, makepkg will do the rest: download and
|
||||
validate source files, check dependencies, configure the build-time settings,
|
||||
build the package, install the package into a temporary root, make
|
||||
customizations, generate meta-info, and package the whole thing up for pacman
|
||||
to use.
|
||||
|
||||
NOTE: makepkg uses your current locale by default and does not unset it when
|
||||
building packages. If you wish to share your build output with others when
|
||||
seeking help or for other purposes, you may wish to run "`LC_ALL=C makepkg`" so
|
||||
your logs and output are not localized.
|
||||
|
||||
Options
|
||||
-------
|
||||
*\--asroot*::
|
||||
Allow makepkg to run as root. This is for security purposes as it is
|
||||
normally dangerous to do so. This will also disable use of fakeroot and
|
||||
sudo.
|
||||
|
||||
*-A, \--ignorearch*::
|
||||
Ignore a missing or incomplete arch field in the build script. This is
|
||||
for rebuilding packages from source when the PKGBUILD may be slightly
|
||||
outdated and not updated with an `$$arch=('yourarch')$$` field.
|
||||
|
||||
*-b, \--builddeps*::
|
||||
Build missing dependencies from source. When makepkg finds missing
|
||||
build-time or run-time dependencies, it will look for the dependencies'
|
||||
PKGBUILD files under `SRCROOT` (set in linkman:makepkg.conf[5]). If it
|
||||
finds them it will call makepkg to build and install the missing
|
||||
dependencies. The child calls will be made with the `-b` and `-i` options.
|
||||
|
||||
*-c, \--clean*::
|
||||
Clean up leftover work files and directories after a successful build.
|
||||
|
||||
*-C, \--cleancache*::
|
||||
Removes all cached source files from the directory specified in `SRCDEST`
|
||||
in linkman:makepkg.conf[5].
|
||||
|
||||
*-d, \--nodeps*::
|
||||
Do not perform any dependency checks. This will let you override and
|
||||
ignore any dependencies required. There is a good chance this option
|
||||
will break the build process if all of the dependencies are not
|
||||
installed.
|
||||
|
||||
*-e, \--noextract*::
|
||||
Do not extract source files; use whatever source already exists in the
|
||||
src/ directory. This is handy if you want to go into src/ and manually
|
||||
patch or tweak code, then make a package out of the result. Keep in mind
|
||||
that creating a patch may be a better solution to allow others to use
|
||||
your PKGBUILD.
|
||||
|
||||
*-f, \--force*::
|
||||
makepkg will not build a package if a built package already exists in
|
||||
the `PKGDEST` (set in linkman:makepkg.conf[5]) directory, which may
|
||||
default to the current directory. This allows the built package to be
|
||||
overwritten.
|
||||
|
||||
*--forcever*::
|
||||
This is a hidden option that should *not* be used unless you really know
|
||||
what you are doing. makepkg uses this internally when calling itself to
|
||||
set the new development pkgver of the package.
|
||||
|
||||
*-g, \--geninteg*::
|
||||
For each source file in the source array of PKGBUILD, download the file
|
||||
if required and generate integrity checks. The integrity checks
|
||||
generated are determined by the value of the INTEGRITY_CHECK array in
|
||||
linkman:makepkg.conf[5]. This output can be redirected into your
|
||||
PKGBUILD for source validation using "`makepkg -g >> PKGBUILD`".
|
||||
|
||||
*-h, \--help*::
|
||||
Output syntax and command line options.
|
||||
|
||||
*\--holdver*::
|
||||
Useful when building development versions of packages. Prevents makepkg
|
||||
from automatically bumping the pkgver to the latest revision number in
|
||||
the package's development tree.
|
||||
|
||||
*-i, \--install*::
|
||||
Install or upgrade the package after a successful build using
|
||||
linkman:pacman[8].
|
||||
|
||||
*-L, \--log*::
|
||||
Enable makepkg build logging. This will use the *tee* program to send
|
||||
output of the `build()` function to both the console and to a text file in
|
||||
the build directory named `pkgname-pkgver-pkgrel-arch.log`. As mentioned
|
||||
above, the build log will be localized so you may want to set your locale
|
||||
accordingly if sharing the log output with others.
|
||||
|
||||
*-m, \--nocolor*::
|
||||
Disable color in output messages.
|
||||
|
||||
*-o, \--nobuild*::
|
||||
Download and extract files only, but do not build them. Useful with the
|
||||
`\--noextract` option if you wish to tweak the files in src/ before
|
||||
building.
|
||||
|
||||
*-p* <`buildscript`>::
|
||||
Read the package script `buildscript` instead of the `PKGBUILD` default;
|
||||
see linkman:PKGBUILD[5].
|
||||
|
||||
*-r, \--rmdeps*::
|
||||
Upon successful build, remove any dependencies installed by makepkg
|
||||
during dependency auto-resolution (using `-b` or `-s`).
|
||||
|
||||
*-R, \--repackage*::
|
||||
Repackage contents of pkg/ without rebuilding the package. This is
|
||||
useful if you forgot a depend or install file in your PKGBUILD and the
|
||||
build itself will not change.
|
||||
|
||||
*-s, \--syncdeps*::
|
||||
Install missing dependencies using pacman. When build-time or run-time
|
||||
dependencies are not found, pacman will try to resolve them. If
|
||||
successful, the missing packages will be downloaded and installed.
|
||||
|
||||
*\--source*::
|
||||
Do not actually build the package, but build a source-only tarball. This
|
||||
is useful for passing a single tarball to another program such as a
|
||||
chroot, remote builder, or an AUR upload.
|
||||
|
||||
*\--noconfirm*::
|
||||
(Passed to pacman) Prevent pacman from waiting for user input before
|
||||
proceeding with operations.
|
||||
|
||||
*\--noprogressbar*::
|
||||
(Passed to pacman) Prevent pacman from displaying a progress bar;
|
||||
useful if you are redirecting makepkg output to file.
|
||||
|
||||
|
||||
Additional Features
|
||||
-------------------
|
||||
makepkg supports building development versions of packages without having to
|
||||
manually update the pkgver in the PKGBUILD. This was formerly done using the
|
||||
separate utility 'versionpkg'. See linkman:PKGBUILD[5] for details on how to
|
||||
set up a development PKGBUILD.
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
See linkman:makepkg.conf[5] for more details on configuring makepkg using the
|
||||
'makepkg.conf' file.
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
linkman:makepkg.conf[5], linkman:PKGBUILD[5], linkman:pacman[8]
|
||||
|
||||
include::footer.txt[]
|
||||
@@ -1,146 +0,0 @@
|
||||
." the string declarations are a start to try and make distro independent
|
||||
.ds DS Arch Linux
|
||||
.ds PB PKGBUILD
|
||||
.ds VR 3.0.0
|
||||
.TH \*(PB 5 "Feb 08, 2007" "makepkg.conf version \*(VR" "\*(DS Files"
|
||||
.SH NAME
|
||||
makepkg.conf \- makepkg configuration file
|
||||
|
||||
.SH DESCRIPTION
|
||||
Configuration options for \fBmakekpg\fP are stored in \fBmakepkg.conf\fP. This
|
||||
file is sourced, so you can include any special compiler flags you wish to use.
|
||||
This is helpful for building for different architectures, or with different
|
||||
optimizations.
|
||||
|
||||
\fBNOTE:\fP This does not guarantee that all package Makefiles will use your
|
||||
exported variables. Some of them are non-standard...
|
||||
|
||||
The default file is fairly well commented, so it may be easiest to simply
|
||||
follow directions given there for customization.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B FTPAGENT="\fI/path/to/command\fP [\fIoptions\fP]"
|
||||
Sets the download agent used to fetch source files specified with a URL in the
|
||||
\fB\*(PB\fP file. Flags can be specified as well; the download URL is then
|
||||
placed on the end of the command.
|
||||
.TP
|
||||
.B CARCH="\fIcarch\fP"
|
||||
Specifies your computer architecture; possible values include such things as
|
||||
"i686", "x86_64", "ppc", etc. This should be automatically set on installation.
|
||||
.TP
|
||||
.B CHOST="\fIchost\fP"
|
||||
A string such as "i686-pc-linux-gnu", do not touch unless you know what you are
|
||||
doing.
|
||||
.TP
|
||||
.B CFLAGS="\fIcflags\fP"
|
||||
Flags used for the C compiler. This is a key part to the use of makepkg.
|
||||
Usually several options are specified, and the most common string resembles
|
||||
something like this: "-march=i686 -O2 -pipe". Another useful option may be
|
||||
-mcpu in place of -march. Read
|
||||
.BR gcc (1)
|
||||
for more details on the wide variety of compiler flags available.
|
||||
.TP
|
||||
.B CXXFLAGS="\fIcxxflags\fP"
|
||||
Flags used for the C++ compiler; see \fBCFLAGS\fP for more info.
|
||||
.TP
|
||||
.B MAKEFLAGS="\fImakeflags\fP"
|
||||
This is often used to set the number of jobs used, for example, "-j2". Other
|
||||
flags that make accepts can also be passed.
|
||||
.TP
|
||||
.B BUILDENV=(fakeroot !distcc color !ccache)
|
||||
This array contains four options that affect the build environment, the
|
||||
defaults are shown here. All options should always be left in the array; to
|
||||
enable or disable an option simply remove or place an "!" at the front of the
|
||||
option. Each works as follows:
|
||||
.RS
|
||||
.TP
|
||||
.B fakeroot
|
||||
Allow building packages as a non-root user. This is \fIhighly\fP recommended.
|
||||
.TP
|
||||
.B distcc
|
||||
Use the distributed C/C++/ObjC compiler to spread compilation among multiple
|
||||
machines. If this is enabled, \fBDISTCC_HOSTS\fP must be specified as well.
|
||||
.TP
|
||||
.B color
|
||||
Colorize output messages, making output easier to read.
|
||||
.TP
|
||||
.B ccache
|
||||
Use ccache to cache compilation by default. This allows for faster compiles if
|
||||
you are continuously recompiling the same packages. It can be disabled for
|
||||
individual packages by placing \fB!ccache\fP in the \fB\*(PB\fP options array.
|
||||
.RE
|
||||
.TP
|
||||
.B DISTCC_HOSTS="\fIhost1 ...\fP"
|
||||
If using DistCC, this is used to specify a space-delimited list of hosts
|
||||
running in the DistCC cluster. In addition, you will want to modify your
|
||||
\fBMAKEFLAGS\fP.
|
||||
.TP
|
||||
.B OPTIONS=(strip !docs libtool emptydirs)
|
||||
This array contains four options that affect the default packaging. All four
|
||||
are equivalent to options that can be placed in the PKGBUILD; the defaults are
|
||||
shown here. All options should always be left in the array; to enable or
|
||||
disable an option simply remove or place an "!" at the front of the option.
|
||||
Each works as follows:
|
||||
.RS
|
||||
.TP
|
||||
.B strip
|
||||
Strip symbols from binaries and libraries. If you frequently use a debugger on
|
||||
programs or libraries, it may be helpful to disable this option.
|
||||
.TP
|
||||
.B docs
|
||||
Save doc and info directories. If you wish to delete doc and info directories,
|
||||
specify "!docs" in the array.
|
||||
.TP
|
||||
.B libtool
|
||||
Leave libtool (.la) files in packages. Specify "!libtool" to remove them.
|
||||
.TP
|
||||
.B emptydirs
|
||||
Leave empty directories in packages.
|
||||
.RE
|
||||
.TP
|
||||
.B INTEGRITY_CHECK=(\fIcheck1 ...\fP)
|
||||
File integrity checks to use. Multiple checks may be specified; this affects
|
||||
both generation and checking. The current valid options are: md5, sha1, sha256,
|
||||
sha384, and sha512.
|
||||
.TP
|
||||
.B DOC_DIRS=(usr/{,share/}{info,doc} ...)
|
||||
If "!docs" is specified in the \fBOPTIONS\fP array, this variable will instruct
|
||||
makepkg where to look to remove docs. If you build packages that are located in
|
||||
opt/, you may need to add the directory to this array. NOTE: do not add the
|
||||
leading slash to the directory name.
|
||||
.TP
|
||||
.B PKGDEST=\fI/path/to/folder\fP
|
||||
If this value is not set, packages will by default be placed in the current
|
||||
directory (location of the \fB\*(PB\fP). Many people like to keep all their
|
||||
packages in one place so this option allows this behavior. A common location is
|
||||
"/home/packages".
|
||||
.TP
|
||||
.B SRCDEST=\fI/path/to/folder\fP
|
||||
If this value is not set, downloaded source files will only be stored in the
|
||||
current directory. Many people like to keep all source files in a central
|
||||
location for easy cleanup, so this path can be set here.
|
||||
.TP
|
||||
.B PACKAGER="\fIJohn Doe <john@doe.com>\fP"
|
||||
This value is used when querying a package to see who was the builder. It is
|
||||
recommended you change this to your name and email address.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR makepkg (8),
|
||||
.BR pacman (8),
|
||||
.BR \*(PB (5)
|
||||
|
||||
See the Arch Linux website at <http://www.archlinux.org> for more current
|
||||
information on the distribution and the \fBpacman\fP family of tools, and
|
||||
<http://wiki.archlinux.org/index.php/Arch_Packaging_Standards> for
|
||||
recommendations on packaging standards.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Judd Vinet <jvinet@zeroflux.org>
|
||||
Aurelien Foret <aurelien@archlinux.org>
|
||||
Aaron Griffin <aaron@archlinux.org>
|
||||
Dan McGee <dan@archlinux.org>
|
||||
.fi
|
||||
|
||||
See the 'AUTHORS' file for additional contributors.
|
||||
154
doc/makepkg.conf.5.txt
Normal file
154
doc/makepkg.conf.5.txt
Normal file
@@ -0,0 +1,154 @@
|
||||
/////
|
||||
vim:set ts=4 sw=4 syntax=asciidoc noet:
|
||||
/////
|
||||
makepkg.conf(5)
|
||||
===============
|
||||
|
||||
Name
|
||||
----
|
||||
makepkg.conf - makepkg configuration file
|
||||
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
{sysconfdir}/makepkg.conf, ~/.makepkg.conf
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
Configuration options for makekpg are stored in makepkg.conf. This file is
|
||||
sourced, so you can include any special compiler flags you wish to use. This is
|
||||
helpful for building for different architectures, or with different
|
||||
optimizations. However, only the variables described below are exported to the
|
||||
build environment.
|
||||
|
||||
NOTE: This does not guarantee that all package Makefiles will use your exported
|
||||
variables. Some of them are non-standard.
|
||||
|
||||
The default file is fairly well commented, so it may be easiest to simply
|
||||
follow directions given there for customization.
|
||||
|
||||
|
||||
Options
|
||||
-------
|
||||
**DLAGENTS=(**\'protocol::/path/to/command [options]' ...**)**::
|
||||
Sets the download agents used to fetch source files specified with a URL in
|
||||
the linkman:PKGBUILD[5] file. Options can be specified for each command as
|
||||
well; the download URL is placed on the end of the command. This is more
|
||||
flexible than the former `FTPAGENT` variable, as any protocol can have a
|
||||
download agent. Several examples are provided in the default makepkg.conf.
|
||||
|
||||
**CARCH=**"carch"::
|
||||
Specifies your computer architecture; possible values include such things
|
||||
as ``i686'', ``x86_64'', ``ppc'', etc. This should be automatically set on
|
||||
installation.
|
||||
|
||||
**CHOST=**"chost"::
|
||||
A string such as ``i686-pc-linux-gnu'', do not touch unless you know what
|
||||
you are doing. This can be commented out by most users if desired.
|
||||
|
||||
**CFLAGS=**"cflags"::
|
||||
Flags used for the C compiler. This is a key part to the use of makepkg.
|
||||
Usually several options are specified, and the most common string resembles
|
||||
something like this: ``-march=i686 -O2 -pipe''. Another useful option may
|
||||
be `-mcpu` in place of `-march`. Read gcc(1) for more details on the wide
|
||||
variety of compiler flags available.
|
||||
|
||||
**CXXFLAGS=**"cxxflags"::
|
||||
Flags used for the C++ compiler; see CFLAGS for more info.
|
||||
|
||||
**MAKEFLAGS=**"makeflags"::
|
||||
This is often used to set the number of jobs used, for example, `-j2`.
|
||||
Other flags that make accepts can also be passed.
|
||||
|
||||
**BUILDENV=(**fakeroot !distcc color !ccache !xdelta**)**::
|
||||
This array contains options that affect the build environment, the defaults
|
||||
are shown here. All options should always be left in the array; to enable
|
||||
or disable an option simply remove or place an ``!'' at the front of the
|
||||
option. Each works as follows:
|
||||
|
||||
*fakeroot*;;
|
||||
Allow building packages as a non-root user. This is highly recommended.
|
||||
|
||||
*distcc*;;
|
||||
Use the distributed C/C++/ObjC compiler to spread compilation among
|
||||
multiple machines. If this is enabled, `DISTCC_HOSTS` must be specified
|
||||
as well.
|
||||
|
||||
*color*;;
|
||||
Colorize output messages, making output easier to read.
|
||||
|
||||
*ccache*;;
|
||||
Use ccache to cache compilation by default. This allows for faster
|
||||
compiles if you are continuously recompiling the same packages. It can
|
||||
be disabled for individual packages by placing `!ccache` in the
|
||||
PKGBUILD options array.
|
||||
|
||||
*xdelta*;;
|
||||
Generate an xdelta binary patch from previous to current package. The
|
||||
previous package must be available in the makepkg cache directory for
|
||||
this to occur.
|
||||
|
||||
**DISTCC_HOSTS=**"host1 ..."::
|
||||
If using DistCC, this is used to specify a space-delimited list of hosts
|
||||
running in the DistCC cluster. In addition, you will want to modify your
|
||||
`MAKEFLAGS`.
|
||||
|
||||
**OPTIONS=(**strip !docs libtool emptydirs**)**::
|
||||
This array contains options that affect the default packaging. All four are
|
||||
equivalent to options that can be placed in the PKGBUILD; the defaults are
|
||||
shown here. All options should always be left in the array; to enable or
|
||||
disable an option simply remove or place an ``!'' at the front of the
|
||||
option. Each works as follows:
|
||||
|
||||
*strip*;;
|
||||
Strip symbols from binaries and libraries. If you frequently use a
|
||||
debugger on programs or libraries, it may be helpful to disable this
|
||||
option.
|
||||
|
||||
*docs*;;
|
||||
Save doc and info directories. If you wish to delete doc and info
|
||||
directories, specify `!docs' in the array.
|
||||
|
||||
*libtool*;;
|
||||
Leave libtool (.la) files in packages. Specify `!libtool' to remove
|
||||
them.
|
||||
|
||||
*emptydirs*;;
|
||||
Leave empty directories in packages.
|
||||
|
||||
**INTEGRITY_CHECK=(**check1 ...**)**::
|
||||
File integrity checks to use. Multiple checks may be specified; this
|
||||
affects both generation and checking. The current valid options are:
|
||||
`md5`, `sha1`, `sha256`, `sha384`, and `sha512`.
|
||||
|
||||
**DOC_DIRS=(**usr/{,share/}{info,doc} ...**)**::
|
||||
If "!docs" is specified in the OPTIONS array, this variable will
|
||||
instruct makepkg where to look to remove docs. If you build packages
|
||||
that are located in opt/, you may need to add the directory to this
|
||||
array. *NOTE:* Do not add the leading slash to the directory name.
|
||||
|
||||
**PKGDEST=**"/path/to/folder"::
|
||||
If this value is not set, packages will by default be placed in the
|
||||
current directory (location of the linkman:PKGBUILD[5]). Many people
|
||||
like to keep all their packages in one place so this option allows
|
||||
this behavior. A common location is ``/home/packages''.
|
||||
|
||||
**SRCDEST=**"/path/to/folder"::
|
||||
If this value is not set, downloaded source files will only be stored
|
||||
in the current directory. Many people like to keep all source files in
|
||||
a central location for easy cleanup, so this path can be set here.
|
||||
|
||||
**PACKAGER=**"John Doe <john@doe.com>"::
|
||||
This value is used when querying a package to see who was the builder.
|
||||
It is recommended you change this to your name and email address.
|
||||
|
||||
*BUILDSCRIPT*, *PKGEXT*, *SRCEXT*, *DB_COMPRESSION*, *DB_CHECKSUMS*::
|
||||
Do not touch these unless you know what you are doing.
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
linkman:makepkg[8], linkman:pacman[8], linkman:PKGBUILD[5]
|
||||
|
||||
include::footer.txt[]
|
||||
293
doc/pacman.8
293
doc/pacman.8
@@ -1,293 +0,0 @@
|
||||
." the string declarations are a start to try and make distro independent
|
||||
.ds DS Arch Linux
|
||||
.ds PB PKGBUILD
|
||||
.ds VR 3.0.0
|
||||
.ds LV 1.0.0
|
||||
.TH pacman 8 "Feb 07, 2007" "pacman version \*(VR" "\*(DS Utilities"
|
||||
.SH NAME
|
||||
pacman \- package manager utility
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B pacman
|
||||
<\fIoperation\fR> [\fIoptions\fR] [\fIpackages\fR]
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBpacman\fP is a \fIpackage management\fP utility that tracks installed
|
||||
packages on a Linux system. It features dependency support, package groups,
|
||||
install and uninstall hooks, and the ability to sync your local machine with a
|
||||
remote ftp server to automatically upgrade packages. \fBpacman\fP packages are
|
||||
a zipped tar format.
|
||||
|
||||
Since version 3.0.0, \fBpacman\fP has been the frontend to \fBlibalpm\fP, the
|
||||
"Arch Linux Package Management" library. This library allows alternative front
|
||||
ends to be written (for instance, a GUI front end).
|
||||
|
||||
.SH OPERATIONS
|
||||
.TP
|
||||
.B \-A, --add (deprecated)
|
||||
Add a package to the system. Either a URL or file path can be specified. The
|
||||
package will be uncompressed into the installation root and the database will
|
||||
be updated. The package will not be installed if another version is already
|
||||
installed. NOTE: please use \fB--upgrade\fP in place of this option.
|
||||
.TP
|
||||
.B \-F, --freshen
|
||||
This is like \fB--upgrade\fP except it will only upgrade packages already
|
||||
installed on the system.
|
||||
.TP
|
||||
.B \-Q, --query
|
||||
Query the package database. This operation allows you to view installed
|
||||
packages and their files, as well as meta-information about individual packages
|
||||
(dependencies, conflicts, install date, build date, size). This can be run
|
||||
against the local package database or can be used on individual .tar.gz
|
||||
packages. See \fBQUERY OPTIONS\fP below.
|
||||
.TP
|
||||
.B \-R, --remove
|
||||
Remove a package from the system. Files belonging to the specified package
|
||||
will be deleted, and the database will be updated. Most configuration files
|
||||
will be saved with a \fI.pacsave\fP extension unless the \fB--nosave\fP option
|
||||
is used. See \fBREMOVE OPTIONS\fP below.
|
||||
.TP
|
||||
.B \-S, --sync
|
||||
Synchronize packages. Packages are installed directly from the ftp servers,
|
||||
including all dependencies required to run the packages. For example,
|
||||
\fBpacman -S qt\fP will download and install \fBqt\fP and all the packages it
|
||||
depends on. You can also use \fBpacman -Su\fP to upgrade all packages that are
|
||||
out of date. See \fBSYNC OPTIONS\fP below.
|
||||
.TP
|
||||
.B \-U, --upgrade
|
||||
Upgrade or add a package to the system. Either a URL or file path can be
|
||||
specified. This is a "remove-then-add" process. See \fBHANDLING CONFIG
|
||||
FILES\fP for an explanation on how pacman takes care of config files.
|
||||
.TP
|
||||
.B \-V, --version
|
||||
Display version and exit.
|
||||
.TP
|
||||
.B \-h, --help
|
||||
Display syntax for the given operation. If no operation was supplied then the
|
||||
general syntax is shown.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \--ask \fInumber\fP
|
||||
Pre-specify answers to questions. It is doubtful whether this option even
|
||||
works, so I would not recommend using it. TODO: document this more, as I have
|
||||
no idea how it works or when you would use it, or if we should just dump it.
|
||||
.TP
|
||||
.B \-b, --dbpath \fIpath\fP
|
||||
Specify an alternative database location (default is "/var/lib/pacman/"). This
|
||||
should not be used unless you know what you are doing.
|
||||
.TP
|
||||
.B \-d, --nodeps
|
||||
Skips all dependency checks. Normally, pacman will always check a package's
|
||||
dependency fields to ensure that all dependencies are installed and there are
|
||||
no package conflicts in the system.
|
||||
.TP
|
||||
.B \-f, --force
|
||||
Bypass file conflict checks and overwrite conflicting files. If the package
|
||||
that is about to be installed contains files that are already installed, this
|
||||
option will cause all those files to be overwritten. This option should be
|
||||
used with care, ideally not at all.
|
||||
.TP
|
||||
.B \-r, --root \fIpath\fP
|
||||
Specify an alternative installation root (default is "/"). This should
|
||||
\fInot\fP be used as a way to install software into /usr/local instead of /usr.
|
||||
This option is used if you want to install a package on a temporary mounted
|
||||
partition which is "owned" by another system. By using this option you not only
|
||||
specify where the software should be installed, but you also specify which
|
||||
package database and cache location to use.
|
||||
.TP
|
||||
.B \-v, --verbose
|
||||
Output more status messages, such as the Root and DBPath.
|
||||
.TP
|
||||
.B \--cachedir \fIdir\fP
|
||||
Specify an alternative package cache location (default is
|
||||
"/var/cache/pacman/pkg/"). This should not be used unless you know what you are
|
||||
doing.
|
||||
.TP
|
||||
.B \--config \fIfilepath\fP
|
||||
Specify an alternate configuration file.
|
||||
.TP
|
||||
.B \--noconfirm
|
||||
Bypass any and all "Are you sure?" messages. It's not a good idea to do this
|
||||
unless you want to run pacman from a script.
|
||||
.TP
|
||||
.B \--noprogressbar
|
||||
Do not show a progress bar when downloading files. This can be useful for
|
||||
scripts that call pacman and capture the output.
|
||||
.TP
|
||||
.B \--noscriptlet
|
||||
If an install scriptlet exists, do not execute it. Do not use this unless you
|
||||
know what you are doing.
|
||||
|
||||
.SH QUERY OPTIONS
|
||||
.TP
|
||||
.B \-c, --changelog
|
||||
View the ChangeLog of a package. Not every package will provide one but it
|
||||
will be shown if available.
|
||||
.TP
|
||||
.B \-e, --orphans
|
||||
List all packages that were pulled in by a previously installed package but no
|
||||
longer required by any installed package.
|
||||
.TP
|
||||
.B \-g, --groups
|
||||
Display all packages that are members of a named group. If not name is
|
||||
specified, list all grouped packages.
|
||||
.TP
|
||||
.B \-i, --info
|
||||
Display information on a given package. The \fB-p\fP option can be used if
|
||||
querying a package file instead of the local database.
|
||||
.TP
|
||||
.B \-l, --list
|
||||
List all files owned by a given package. Multiple packages can be specified on
|
||||
the command line.
|
||||
.TP
|
||||
.B \-m, --foreign
|
||||
List all packages that were not found in the sync database(s). Typically these
|
||||
are packages that were downloaded manually and installed with \fB--upgrade\fP.
|
||||
.TP
|
||||
.B \-o, --owns \fIfile\fP
|
||||
Search for the package that owns \fIfile\fP.
|
||||
.TP
|
||||
.B \-p, --file
|
||||
Signifies that the package supplied on the command line is a file and not an
|
||||
entry in the database. The file will be decompressed and queried. This is
|
||||
useful in combination with \fB--info\fP and \fB--list\fP.
|
||||
.TP
|
||||
.B \-s, --search \fIregexp\fP
|
||||
This will search each locally-installed package for names or descriptions that
|
||||
matche \fIregexp\fP.
|
||||
.TP
|
||||
.B \-u, --upgrades
|
||||
Lists all packages that are out of date on the local system. This option works
|
||||
best if the sync database is refreshed using \fB-Sy\fP.
|
||||
|
||||
.SH REMOVE OPTIONS
|
||||
.TP
|
||||
.B \-c, --cascade
|
||||
Remove all target packages, as well as all packages that depend on one or more
|
||||
target packages. This operation is recursive.
|
||||
.TP
|
||||
.B \-k, --keep
|
||||
Removes the database entry only. Leaves all files in place.
|
||||
.TP
|
||||
.B \-n, --nosave
|
||||
Instructs pacman to ignore file backup designations. Normally, when a file is
|
||||
removed from the system the database is checked to see if the file should be
|
||||
renamed with a .pacsave extension.
|
||||
.TP
|
||||
.B \-s, --recursive
|
||||
Remove each target specified including all dependencies, provided that (A) they
|
||||
are not required by other packages; and (B) they were not explicitly installed
|
||||
by the user. This option is analogous to a backwards \fB--sync\fP operation.
|
||||
|
||||
.SH SYNC OPTIONS
|
||||
.TP
|
||||
.B \-c, --clean
|
||||
Remove old packages from the cache to free up disk space. When \fBpacman\fP
|
||||
downloads packages, it saves them in \fI/var/cache/pacman/pkg\fP. Use one
|
||||
\fB--clean\fP switch to remove \fIold\fP packages; use two to remove \fIall\fP
|
||||
packages from the cache.
|
||||
.TP
|
||||
.B \-e, --dependsonly
|
||||
Install all dependencies of a package, but not the specified package itself.
|
||||
This is pretty useless and we're not sure why it even exists.
|
||||
.TP
|
||||
.B \-g, --groups
|
||||
Display all the members for each package group specified. If no group names
|
||||
are provided, all groups will be listed; pass the flag twice to view all
|
||||
groups and their members.
|
||||
.TP
|
||||
.B \-i, --info
|
||||
Display dependency and other information for a given package. This will search
|
||||
through all repositories for a matching package.
|
||||
.TP
|
||||
.B \-l, --list
|
||||
List all packages in the specified repositories. Multiple repositories can be
|
||||
specified on the command line.
|
||||
.TP
|
||||
.B \-p, --print-uris
|
||||
Print out URIs for each package that will be installed, including any
|
||||
dependencies yet to be installed. These can be piped to a file and downloaded
|
||||
at a later time, using a program like wget.
|
||||
.TP
|
||||
.B \-s, --search \fIregexp\fP
|
||||
This will search each package in the sync databases for names or descriptions
|
||||
that match \fIregexp\fP.
|
||||
.TP
|
||||
.B \-u, --sysupgrade
|
||||
Upgrades all packages that are out of date. Each currently-installed package
|
||||
will be examined and upgraded if a newer package exists. A report of all
|
||||
packages to upgrade will be presented and the operation will not proceed
|
||||
without user confirmation. Dependencies are automatically resolved at this
|
||||
level and will be installed/upgraded if necessary.
|
||||
.TP
|
||||
.B \-w, --downloadonly
|
||||
Retrieve all packages from the server, but do not install/upgrade anything.
|
||||
.TP
|
||||
.B \-y, --refresh
|
||||
Download a fresh copy of the master package list from the server(s) defined in
|
||||
\fBpacman.conf\fP. This should typically be used each time you use
|
||||
\fB--sysupgrade\fP or \fB-u\fP. Passing two \fB--refresh\fP or \fB-y\fP flags
|
||||
will force a refresh of all package lists even if they are thought to be
|
||||
up to date.
|
||||
.TP
|
||||
.B \--ignore \fIpackage\fP
|
||||
Directs \fBpacman\fP to ignore upgrades of \fIpackage\fP even if there is one
|
||||
available.
|
||||
|
||||
.SH HANDLING CONFIG FILES
|
||||
pacman uses the same logic as rpm to determine action against files that are
|
||||
designated to be backed up. During an upgrade, 3 md5 hashes are used for each
|
||||
backup file to determine the required action: one for the original file
|
||||
installed, one for the new file that's about to be installed, and one for the
|
||||
actual file existing on the filesystem. After comparing these 3 hashes, the
|
||||
follow scenarios can result:
|
||||
.TP
|
||||
original=\fBX\fP, current=\fBX\fP, new=\fBX\fP
|
||||
All three files are the same, so overwrites are not an issue Install the new
|
||||
file.
|
||||
.TP
|
||||
original=\fBX\fP, current=\fBX\fP, new=\fBY\fP
|
||||
The current file is the same as the original but the new one differs. Since
|
||||
the user did not ever modify the file, and the new one may contain improvements
|
||||
or bugfixes, install the new file.
|
||||
.TP
|
||||
original=\fBX\fP, current=\fBY\fP, new=\fBX\fP
|
||||
Both package versions contain the exact same file, but the one on the
|
||||
filesystem has been modified. Leave the current file in place.
|
||||
.TP
|
||||
original=\fBX\fP, current=\fBY\fP, new=\fBY\fP
|
||||
The new file is identical to the current file. Install the new file.
|
||||
.TP
|
||||
original=\fBX\fP, current=\fBY\fP, new=\fBZ\fP
|
||||
All three files are different, so install the new file with a .pacnew extension
|
||||
and warn the user. The user must then manually merge any necessary changes into
|
||||
the original file.
|
||||
|
||||
.SH CONFIGURATION
|
||||
See
|
||||
.BR pacman.conf (5)
|
||||
for more details on configuring \fBpacman\fP using the \fBpacman.conf\fP file.
|
||||
|
||||
.SH BUGS
|
||||
Bugs? You must be kidding, there are no bugs in this software. But if we happen
|
||||
to be wrong, send us an email with as much detail as possible to
|
||||
<pacman-dev@archlinux.org>.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR pacman.conf (5),
|
||||
.BR makepkg (8),
|
||||
.BR libalpm (3)
|
||||
|
||||
See the Arch Linux website at <http://www.archlinux.org> for more current
|
||||
information on the distribution and the \fBpacman\fP family of tools.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Judd Vinet <jvinet@zeroflux.org>
|
||||
Aurelien Foret <aurelien@archlinux.org>
|
||||
Aaron Griffin <aaron@archlinux.org>
|
||||
Dan McGee <dan@archlinux.org>
|
||||
.fi
|
||||
|
||||
See the 'AUTHORS' file for additional contributors.
|
||||
345
doc/pacman.8.txt
Normal file
345
doc/pacman.8.txt
Normal file
@@ -0,0 +1,345 @@
|
||||
/////
|
||||
vim:set ts=4 sw=4 syntax=asciidoc noet:
|
||||
/////
|
||||
pacman(8)
|
||||
=========
|
||||
|
||||
Name
|
||||
----
|
||||
pacman - package manager utility
|
||||
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
'pacman' <operation> [options] [packages]
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
Pacman is a package management utility that tracks installed packages on a Linux
|
||||
system. It features dependency support, package groups, install and uninstall
|
||||
hooks, and the ability to sync your local machine with a remote ftp server to
|
||||
automatically upgrade packages. Pacman packages are a zipped tar format.
|
||||
|
||||
Since version 3.0.0, pacman has been the frontend to linkman:libalpm[3], the
|
||||
"Arch Linux Package Management" library. This library allows alternative front
|
||||
ends to be written (for instance, a GUI front end).
|
||||
|
||||
|
||||
Operations
|
||||
----------
|
||||
*-A, \--add* (deprecated)::
|
||||
Add a package to the system. Either a URL or file path can be specified.
|
||||
The package will be uncompressed into the installation root and the
|
||||
database will be updated. The package will not be installed if another
|
||||
version is already installed. *NOTE*: please use '\--upgrade' in place of
|
||||
this option.
|
||||
|
||||
*-Q, \--query*::
|
||||
Query the package database. This operation allows you to view installed
|
||||
packages and their files, as well as meta-information about individual
|
||||
packages (dependencies, conflicts, install date, build date, size). This
|
||||
can be run against the local package database or can be used on
|
||||
individual '.tar.gz' packages. See <<QO,Query Options>> below.
|
||||
|
||||
*-R, \--remove*::
|
||||
Remove a package from the system. Groups can also be specified to be
|
||||
removed, in which case every package in that group will be removed.
|
||||
Files belonging to the specified package will be deleted, and the
|
||||
database will be updated. Most configuration files will be saved
|
||||
with a `.pacsave` extension unless the '\--nosave' option is used.
|
||||
See <<RO,Remove Options>> below.
|
||||
|
||||
*-S, \--sync*::
|
||||
Synchronize packages. Packages are installed directly from the ftp
|
||||
servers, including all dependencies required to run the packages. For
|
||||
example, `pacman -S qt` will download and install qt and all the
|
||||
packages it depends on. If a package name exists in more than one repo, the
|
||||
repo can be explicitly specified to clarify the package to install:
|
||||
`pacman -S testing/qt`.
|
||||
+
|
||||
In addition to packages, groups can be specified as well. For example, if
|
||||
gnome is a defined package group, then `pacman -S gnome` will install every
|
||||
package in the gnome group, as well as the dependencies of those packages.
|
||||
+
|
||||
Packages which provide other packages are also handled. For example, `pacman -S
|
||||
foo` will first look for a foo package. If foo is not found, packages which
|
||||
provide the same functionality as foo will be searched for. If any package is
|
||||
found, it will be installed.
|
||||
+
|
||||
You can also use `pacman -Su` to upgrade all packages that are out of date. See
|
||||
<<SO,Sync Options>> below.
|
||||
|
||||
*-U, \--upgrade*::
|
||||
Upgrade or add a package to the system. Either a URL or file path can be
|
||||
specified. This is a "remove-then-add" process. See <<HCF,Handling Config
|
||||
Files>> for an explanation on how pacman takes care of config files.
|
||||
|
||||
*-V, \--version*::
|
||||
Display version and exit.
|
||||
|
||||
*-h, \--help*::
|
||||
Display syntax for the given operation. If no operation was supplied
|
||||
then the general syntax is shown.
|
||||
|
||||
|
||||
Options
|
||||
-------
|
||||
*\--asdeps*::
|
||||
Install packages non-explicitly; in other works, fake their install reason
|
||||
to be installed as a dependency. This is useful for makepkg and other
|
||||
build from source tools that need to install dependencies before building
|
||||
the package.
|
||||
|
||||
*-b, \--dbpath* <'path'>::
|
||||
Specify an alternative database location (a typical default is
|
||||
``/var/lib/pacman''). This should not be used unless you know what you are
|
||||
doing. *NOTE*: if specified, this is an absolute path and the root path is
|
||||
not automatically prepended. This behavior changed in pacman 3.1.0.
|
||||
|
||||
*-d, \--nodeps*::
|
||||
Skips all dependency checks. Normally, pacman will always check a
|
||||
package's dependency fields to ensure that all dependencies are
|
||||
installed and there are no package conflicts in the system.
|
||||
|
||||
*-f, \--force*::
|
||||
Bypass file conflict checks and overwrite conflicting files. If the
|
||||
package that is about to be installed contains files that are already
|
||||
installed, this option will cause all those files to be overwritten.
|
||||
This option should be used with care, ideally not at all.
|
||||
|
||||
*-r, \--root* <'path'>::
|
||||
Specify an alternative installation root (default is ``/''). This should
|
||||
not be used as a way to install software into ``/usr/local'' instead of
|
||||
``/usr''. This option is used if you want to install a package on a
|
||||
temporary mounted partition which is "owned" by another system.
|
||||
*NOTE*: If database path or logfile are not specified on either the
|
||||
command line or in linkman:pacman.conf[5], their default location will
|
||||
be inside this root path.
|
||||
|
||||
*-v, --verbose*::
|
||||
Output paths such as as the Root, Conf File, DB Path, Cache Dirs, etc.
|
||||
|
||||
*\--cachedir* <'dir'>::
|
||||
Specify an alternative package cache location (a typical default is
|
||||
``/var/cache/pacman/pkg''). Multiple cache directories can be specified,
|
||||
and they are tried in the order they are passed to pacman. *NOTE*: this
|
||||
is an absolute path, the root path is not automatically prepended. This
|
||||
behavior changed in pacman 3.1.0.
|
||||
|
||||
*\--config* <'file'>::
|
||||
Specify an alternate configuration file.
|
||||
|
||||
*\--logfile* <'file'>::
|
||||
Specify an alternate log file. This is an absolute path, regardless of
|
||||
the installation root setting.
|
||||
|
||||
*\--noconfirm*::
|
||||
Bypass any and all "Are you sure?" messages. It's not a good idea to do
|
||||
this unless you want to run pacman from a script.
|
||||
|
||||
*\--noprogressbar*::
|
||||
Do not show a progress bar when downloading files. This can be useful
|
||||
for scripts that call pacman and capture the output.
|
||||
|
||||
*\--noscriptlet*::
|
||||
If an install scriptlet exists, do not execute it. Do not use this
|
||||
unless you know what you are doing.
|
||||
|
||||
|
||||
Query Options[[QO]]
|
||||
-------------------
|
||||
*-c, \--changelog*::
|
||||
View the ChangeLog of a package. Not every package will provide one but
|
||||
it will be shown if available.
|
||||
|
||||
*-d, \--deps*::
|
||||
List all packages installed as dependencies. This option can be combined
|
||||
with '-t' for listing real orphans- packages that were installed as
|
||||
dependencies but are no longer required by any installed package. ('-Qdt'
|
||||
is equivalent to the pacman 3.0.X '-Qe' option.)
|
||||
|
||||
*-e, \--explicit*::
|
||||
List all packages explicitly installed. This option can be combined with
|
||||
'-t' to list top-level packages- those packages that were explicitly
|
||||
installed but are not required by any other package. ('-Qet' is equivalent
|
||||
to the pacman 2.9.X '-Qe' option.)
|
||||
|
||||
*-g, \--groups*::
|
||||
Display all packages that are members of a named group. If a name is not
|
||||
specified, list all grouped packages.
|
||||
|
||||
*-i, \--info*::
|
||||
Display information on a given package. The '-p' option can be used if
|
||||
querying a package file instead of the local database. Passing two
|
||||
'\--info' or '-i' flags will also display the list of backup files and
|
||||
their modification states.
|
||||
|
||||
*-l, \--list*::
|
||||
List all files owned by a given package. Multiple packages can be
|
||||
specified on the command line.
|
||||
|
||||
*-m, \--foreign*::
|
||||
Restrict or filter output to packages that were not found in the sync
|
||||
database(s). Typically these are packages that were downloaded manually
|
||||
and installed with '\--upgrade'.
|
||||
|
||||
*-o, \--owns* <'file'>::
|
||||
Search for the package that owns file. The path can be relative or
|
||||
absolute.
|
||||
|
||||
*-p, \--file*::
|
||||
Signifies that the package supplied on the command line is a file and
|
||||
not an entry in the database. The file will be decompressed and queried.
|
||||
This is useful in combination with '\--info' and '\--list'.
|
||||
|
||||
*-s, \--search* <'regexp'>::
|
||||
This will search each locally-installed package for names or
|
||||
descriptions that match `regexp`.
|
||||
|
||||
*-t, \--unrequired*::
|
||||
Restrict or filter output to packages not required by any currently
|
||||
installed package.
|
||||
|
||||
*-u, \--upgrades*::
|
||||
Lists all packages that are out of date on the local system. This option
|
||||
works best if the sync database is refreshed using '-Sy'.
|
||||
|
||||
|
||||
Remove Options[[RO]]
|
||||
--------------------
|
||||
*-c, \--cascade*::
|
||||
Remove all target packages, as well as all packages that depend on one
|
||||
or more target packages. This operation is recursive, and must be used
|
||||
with care since it can remove many potentially needed packages.
|
||||
|
||||
*-k, \--keep*::
|
||||
Removes the database entry only. Leaves all files in place.
|
||||
|
||||
*-n, \--nosave*::
|
||||
Instructs pacman to ignore file backup designations. Normally, when a
|
||||
file is removed from the system the database is checked to see if the
|
||||
file should be renamed with a ``.pacsave'' extension.
|
||||
|
||||
*-s, \--recursive*::
|
||||
Remove each target specified including all of their dependencies, provided
|
||||
that (A) they are not required by other packages; and (B) they were not
|
||||
explicitly installed by the user. This operation is recursive and analogous
|
||||
to a backwards '\--sync' operation, and helps keep a clean system without
|
||||
orphans.
|
||||
|
||||
|
||||
Sync Options[[SO]]
|
||||
------------------
|
||||
*-c, \--clean*::
|
||||
Remove packages that are no longer installed from the cache as well as
|
||||
currently unused sync databases to free up disk space. When pacman
|
||||
downloads packages, it saves them in a cache directory. In addition,
|
||||
databases are saved for every sync DB you download from, and are not
|
||||
deleted even if they are removed from the configuration file
|
||||
linkman:pacman.conf[5]. Use one '\--clean' switch to only remove
|
||||
packages that are no longer installed; use two to remove all packages
|
||||
from the cache. In both cases, you will have a yes or no option to
|
||||
remove packages and/or unused downloaded databases.
|
||||
|
||||
*-e, \--dependsonly*::
|
||||
Install all dependencies of a package, but not the specified package
|
||||
itself. This is pretty useless and we're not sure why it even exists.
|
||||
|
||||
*-g, \--groups*::
|
||||
Display all the members for each package group specified. If no group
|
||||
names are provided, all groups will be listed; pass the flag twice to
|
||||
view all groups and their members.
|
||||
|
||||
*-i, \--info*::
|
||||
Display dependency and other information for a given package. This will
|
||||
search through all repositories for a matching package.
|
||||
|
||||
*-l, \--list*::
|
||||
List all packages in the specified repositories. Multiple repositories
|
||||
can be specified on the command line.
|
||||
|
||||
*-p, \--print-uris*::
|
||||
Print out URIs for each package that will be installed, including any
|
||||
dependencies yet to be installed. These can be piped to a file and
|
||||
downloaded at a later time, using a program like wget.
|
||||
|
||||
*-s, \--search* <'regexp'>::
|
||||
This will search each package in the sync databases for names or
|
||||
descriptions that match `regexp`.
|
||||
|
||||
*-u, \--sysupgrade*::
|
||||
Upgrades all packages that are out of date. Each currently-installed
|
||||
package will be examined and upgraded if a newer package exists. A
|
||||
report of all packages to upgrade will be presented and the operation
|
||||
will not proceed without user confirmation. Dependencies are
|
||||
automatically resolved at this level and will be installed/upgraded if
|
||||
necessary.
|
||||
|
||||
*-w, \--downloadonly*::
|
||||
Retrieve all packages from the server, but do not install/upgrade
|
||||
anything.
|
||||
|
||||
*-y, \--refresh*::
|
||||
Download a fresh copy of the master package list from the server(s)
|
||||
defined in linkman:pacman.conf[5]. This should typically be used each time
|
||||
you use '\--sysupgrade' or '-u'. Passing two '\--refresh' or '-y' flags
|
||||
will force a refresh of all package lists even if they are thought to be up
|
||||
to date.
|
||||
|
||||
*\--needed*::
|
||||
Only install the targets that are not already installed and up-to-date.
|
||||
|
||||
*\--ignore* <'package'>::
|
||||
Directs pacman to ignore upgrades of package even if there is one
|
||||
available. Multiple packages can be specified by separating them
|
||||
with a comma.
|
||||
|
||||
*\--ignoregroup* <'group'>::
|
||||
Directs pacman to ignore upgrades of all packages in 'group' even if
|
||||
there is one available. Multiple groups can be specified by
|
||||
separating them with a comma.
|
||||
|
||||
|
||||
Handling Config Files[[HCF]]
|
||||
----------------------------
|
||||
Pacman uses the same logic as rpm to determine action against files that are
|
||||
designated to be backed up. During an upgrade, 3 md5 hashes are used for each
|
||||
backup file to determine the required action: one for the original file
|
||||
installed, one for the new file that's about to be installed, and one for the
|
||||
actual file existing on the filesystem. After comparing these 3 hashes, the
|
||||
follow scenarios can result:
|
||||
|
||||
original=X, current=X, new=X::
|
||||
All three files are the same, so overwrites are not an issue Install the
|
||||
new file.
|
||||
|
||||
original=X, current=X, new=Y::
|
||||
The current file is the same as the original but the new one differs.
|
||||
Since the user did not ever modify the file, and the new one may contain
|
||||
improvements or bugfixes, install the new file.
|
||||
|
||||
original=X, current=Y, new=X::
|
||||
Both package versions contain the exact same file, but the one on the
|
||||
filesystem has been modified. Leave the current file in place.
|
||||
|
||||
original=X, current=Y, new=Y::
|
||||
The new file is identical to the current file. Install the new file.
|
||||
|
||||
original=X, current=Y, new=Z::
|
||||
All three files are different, so install the new file with a '.pacnew'
|
||||
extension and warn the user. The user must then manually merge any
|
||||
necessary changes into the original file.
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
See linkman:pacman.conf[5] for more details on configuring pacman using the
|
||||
'pacman.conf' file.
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
linkman:pacman.conf[5], linkman:makepkg[8], linkman:libalpm[3]
|
||||
|
||||
include::footer.txt[]
|
||||
@@ -1,139 +0,0 @@
|
||||
." the string declarations are a start to try and make distro independent
|
||||
.ds DS Arch Linux
|
||||
.ds PB PKGBUILD
|
||||
.ds VR 3.0.0
|
||||
.ds LV 1.0.0
|
||||
.TH \*(PB 5 "Feb 07, 2007" "pacman.conf version \*(VR" "\*(DS Files"
|
||||
.SH NAME
|
||||
pacman.conf \- pacman package manager configuration file
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBpacman\fP, using \fBlibalpm\fP, will attempt to read \fBpacman.conf\fP each
|
||||
time it is invoked. This configuration file is divided into sections or
|
||||
\fIrepositories\fP. Each section defines a package repository that \fBpacman\fP
|
||||
can use when searching for packages in \fB--sync\fP mode. The exception to this
|
||||
is the \fIoptions\fP section, which defines global options.
|
||||
|
||||
.SH EXAMPLE
|
||||
.RS
|
||||
.nf
|
||||
#
|
||||
# pacman.conf
|
||||
#
|
||||
[options]
|
||||
NoUpgrade = etc/passwd etc/group etc/shadow
|
||||
NoUpgrade = etc/fstab
|
||||
|
||||
[current]
|
||||
Include = /etc/pacman.d/current
|
||||
|
||||
[custom]
|
||||
Server = file:///home/pkgs
|
||||
.fi
|
||||
.RE
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B DBPath = \fIpath/to/db/dir\fP
|
||||
Overrides the default location of the toplevel database directory. The default
|
||||
is \fIvar/lib/pacman\fP.
|
||||
.TP
|
||||
.B CacheDir = \fIpath/to/cache/dir\fP
|
||||
Overrides the default location of the package cache directory. The default is
|
||||
\fIvar/cache/pacman\fP.
|
||||
.TP
|
||||
.B HoldPkg = \fIpackage\fP ...
|
||||
If a user tries to \fB--remove\fP a package that's listed in \fBHoldPkg\fI,
|
||||
\fBpacman\fP will ask for confirmation before proceeding.
|
||||
.TP
|
||||
.B IgnorePkg = \fIpackage\fP ...
|
||||
Instructs \fBpacman\fP to ignore any upgrades for this package when performing a
|
||||
\fB--sysupgrade\fP.
|
||||
.TP
|
||||
.B Include = \fIpath\fP
|
||||
Include another config file. This file can include repositories or general
|
||||
configuration options.
|
||||
.TP
|
||||
.B XferCommand = \fI/path/to/command %u\fP
|
||||
If set, an external program will be used to download all remote files. All
|
||||
instances of \fB%u\fP will be replaced with the download URL. If present,
|
||||
instances of \fB%o\fP will be replaced with the local filename, plus a ".part"
|
||||
extension, which allows programs like wget to do file resumes properly.
|
||||
|
||||
This option is useful for users who experience problems with built-in
|
||||
http/ftp support, or need the more advanced proxy support that comes with
|
||||
utilities like wget.
|
||||
.TP
|
||||
.B NoPassiveFtp
|
||||
Disables passive ftp connections when downloading packages. (aka Active Mode)
|
||||
.TP
|
||||
.B NoUpgrade = \fIfile\fP ...
|
||||
All files listed with a \fBNoUpgrade\fP directive will never be touched during
|
||||
a package install/upgrade. Do \fInot\fP include the leading slash when
|
||||
specifying files.
|
||||
.TP
|
||||
.B NoExtract = \fIfile\fP ...
|
||||
All files listed with a \fBNoExtract\fP directive will never be extracted from
|
||||
a package into the filesystem. This can be useful when you don't want part of a
|
||||
package to be installed. For example, if your httpd root uses an index.php,
|
||||
then you would not want the index.html file to be extracted from the
|
||||
\fBapache\fP package.
|
||||
.TP
|
||||
.B UseSyslog
|
||||
Log action messages through \fBsyslog()\fP. This will insert log entries into
|
||||
\fI/var/log/messages\fP or equivalent.
|
||||
.TP
|
||||
.B LogFile = \fI/path/to/file\fP
|
||||
Log actions directly to a file. Default is \fI/var/log/pacman.log\fP.
|
||||
|
||||
.SH REPOSITORY SECTIONS
|
||||
Each repository section defines a section name and at least one location where
|
||||
the packages can be found. The section name is defined by the string within
|
||||
square brackets (the two above are 'current' and 'custom'). Locations are
|
||||
defined with the \fBServer\fP directive and follow a URL naming structure. If
|
||||
you want to use a local directory, you can specify the full path with
|
||||
a 'file://' prefix, as shown above.
|
||||
|
||||
The order of repositories in the file matters; repositories listed first will
|
||||
take precedence over those listed later in the file when packages in two
|
||||
repositories have identical names, regardless of version number.
|
||||
|
||||
.SH USING YOUR OWN REPOSITORY
|
||||
If you have numerous custom packages of your own, it is often easier to
|
||||
generate your own custom local repository than install them all with the
|
||||
\fB--upgrade\fP option. All you need to do is generate a compressed package
|
||||
database in the directory with these packages so \fBpacman\fP can find it when
|
||||
run with \fB--refresh\fP.
|
||||
|
||||
.RS
|
||||
.nf
|
||||
repo-add /home/pkgs/custom.db.tar.gz /home/pkgs/*.pkg.tar.gz
|
||||
.fi
|
||||
.RE
|
||||
|
||||
The above command will generate a compressed database named
|
||||
\fI/home/pkgs/custom.db.tar.gz\fP. Note that the database must be of the form
|
||||
\fI{treename}.db.tar.gz\fP, where {treename} is the name of the section defined
|
||||
in the configuration file. That's it! Now configure your \fIcustom\fP section
|
||||
in the configuration file as shown in the config example above. Pacman will
|
||||
now use your package repository. If you add new packages to the repository,
|
||||
remember to re-generate the database and use \fBpacman\fP's --refresh option.
|
||||
|
||||
For more information on the \fBrepo-add\fP command, use \fB repo-add --help\fP.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR pacman (8),
|
||||
.BR libalpm (3)
|
||||
|
||||
See the Arch Linux website at <http://www.archlinux.org> for more current
|
||||
information on the distribution and the \fBpacman\fP family of tools.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Judd Vinet <jvinet@zeroflux.org>
|
||||
Aurelien Foret <aurelien@archlinux.org>
|
||||
Aaron Griffin <aaron@archlinux.org>
|
||||
Dan McGee <dan@archlinux.org>
|
||||
.fi
|
||||
|
||||
See the 'AUTHORS' file for additional contributors.
|
||||
193
doc/pacman.conf.5.txt
Normal file
193
doc/pacman.conf.5.txt
Normal file
@@ -0,0 +1,193 @@
|
||||
/////
|
||||
vim:set ts=4 sw=4 syntax=asciidoc noet:
|
||||
/////
|
||||
pacman.conf(5)
|
||||
==============
|
||||
|
||||
Name
|
||||
----
|
||||
pacman.conf - pacman package manager configuration file
|
||||
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
{sysconfdir}/pacman.conf
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
Pacman, using linkman:libalpm[3], will attempt to read pacman.conf each time it
|
||||
is invoked. This configuration file is divided into sections or repositories.
|
||||
Each section defines a package repository that pacman can use when searching
|
||||
for packages in '\--sync' mode. The exception to this is the options section,
|
||||
which defines global options.
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
--------
|
||||
#
|
||||
# pacman.conf
|
||||
#
|
||||
[options]
|
||||
NoUpgrade = etc/passwd etc/group etc/shadow
|
||||
NoUpgrade = etc/fstab
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/core
|
||||
|
||||
[custom]
|
||||
Server = file:///home/pkgs
|
||||
--------
|
||||
|
||||
|
||||
Options
|
||||
-------
|
||||
*RootDir =* path/to/root::
|
||||
Set the default root directory for pacman to install to. This option is
|
||||
used if you want to install a package on a temporary mounted partition
|
||||
which is "owned" by another system, or for a chroot install.
|
||||
*NOTE*: If database path or logfile are not specified on either the
|
||||
command line or in linkman:pacman.conf[5], their default location will
|
||||
be inside this root path.
|
||||
|
||||
*DBPath =* path/to/db/dir::
|
||||
Overrides the default location of the toplevel database directory. A
|
||||
typical default is ``/var/lib/pacman/''. Most users will not need to set
|
||||
this option. *NOTE*: if specified, this is an absolute path and the root
|
||||
path is not automatically prepended. This behavior changed in pacman 3.1.0.
|
||||
|
||||
*CacheDir =* path/to/cache/dir::
|
||||
Overrides the default location of the package cache directory. A typical
|
||||
default is ``/var/cache/pacman/pkg/''. Multiple cache directories can be
|
||||
specified, and they are tried in the order they are listed in the config
|
||||
file. If a file is not found in any cache directory, it will be downloaded
|
||||
to the first cache directory with write access. *NOTE*: this is an absolute
|
||||
path, the root path is not automatically prepended. This behavior changed
|
||||
in pacman 3.1.0.
|
||||
|
||||
|
||||
*LogFile =* '/path/to/file'::
|
||||
Log actions directly to a file. A typical default is
|
||||
``/var/log/pacman.log''. As of pacman 3.1.0, this does not need to be
|
||||
specified by default. This is an absolute path and root is not prepended.
|
||||
|
||||
*HoldPkg =* package ...::
|
||||
If a user tries to '\--remove' a package that's listed in `HoldPkg`,
|
||||
pacman will ask for confirmation before proceeding.
|
||||
|
||||
*IgnorePkg =* package ...::
|
||||
Instructs pacman to ignore any upgrades for this package when performing
|
||||
a '\--sysupgrade'.
|
||||
|
||||
*IgnoreGroup =* group ...::
|
||||
Instructs pacman to ignore any upgrades for all packages in this
|
||||
group when performing a '\--sysupgrade'.
|
||||
|
||||
*Include =* path::
|
||||
Include another config file. This file can include repositories or
|
||||
general configuration options.
|
||||
|
||||
*XferCommand =* /path/to/command %u::
|
||||
If set, an external program will be used to download all remote files.
|
||||
All instances of `%u` will be replaced with the download URL. If present,
|
||||
instances of `%o` will be replaced with the local filename, plus a
|
||||
``.part'' extension, which allows programs like wget to do file resumes
|
||||
properly.
|
||||
+
|
||||
This option is useful for users who experience problems with built-in
|
||||
http/ftp support, or need the more advanced proxy support that comes with
|
||||
utilities like wget.
|
||||
|
||||
*NoPassiveFtp*::
|
||||
Disables passive ftp connections when downloading packages. (aka Active Mode)
|
||||
|
||||
*NoUpgrade =* file ...::
|
||||
All files listed with a `NoUpgrade` directive will never be touched during
|
||||
a package install/upgrade. Do not include the leading slash when specifying
|
||||
files.
|
||||
|
||||
*NoExtract =* file ...::
|
||||
All files listed with a `NoExtract` directive will never be extracted from
|
||||
a package into the filesystem. This can be useful when you don't want part
|
||||
of a package to be installed. For example, if your httpd root uses an
|
||||
'index.php', then you would not want the 'index.html' file to be extracted
|
||||
from the 'apache' package.
|
||||
|
||||
*UseSyslog*::
|
||||
Log action messages through syslog(). This will insert log entries into
|
||||
``/var/log/messages'' or equivalent.
|
||||
|
||||
*ShowSize*::
|
||||
Display the size of individual packages for '\--sync' and '\--query' modes.
|
||||
|
||||
*UseDelta*::
|
||||
Download delta files instead of complete packages if possible. Requires
|
||||
the xdelta program to be installed.
|
||||
|
||||
*TotalDownload*::
|
||||
When downloading, display the amount downloaded, download rate, ETA,
|
||||
and completed percentage of the entire download list list rather
|
||||
than the percent of each individual download target. The progress
|
||||
bar is still based solely on the current file download.
|
||||
|
||||
Repository Sections
|
||||
-------------------
|
||||
Each repository section defines a section name and at least one location where
|
||||
the packages can be found. The section name is defined by the string within
|
||||
square brackets (the two above are 'current' and 'custom'). Locations are
|
||||
defined with the 'Server' directive and follow a URL naming structure. If you
|
||||
want to use a local directory, you can specify the full path with a ``file://''
|
||||
prefix, as shown above.
|
||||
|
||||
A common way to define DB locations utilizes the 'Include' directive. For each
|
||||
repository defined in the configuration file, a single 'Include' directive can
|
||||
contain a file that lists the servers for that repository.
|
||||
|
||||
--------
|
||||
[core]
|
||||
# use this repository first
|
||||
Server = ftp://ftp.archlinux.org/core/os/arch
|
||||
# next use servers as defined in the mirrorlist below
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
--------
|
||||
|
||||
During parsing, pacman will define the `$repo` variable to the name of the
|
||||
current section. This is often utilized in files specified using the 'Include'
|
||||
directive so all repositories can use the same mirrorfile.
|
||||
|
||||
--------
|
||||
Server = ftp://ftp.archlinux.org/$repo/os/arch
|
||||
--------
|
||||
|
||||
The order of repositories in the configuration files matters; repositories
|
||||
listed first will take precedence over those listed later in the file when
|
||||
packages in two repositories have identical names, regardless of version
|
||||
number.
|
||||
|
||||
Using Your Own Repository
|
||||
-------------------------
|
||||
If you have numerous custom packages of your own, it is often easier to generate
|
||||
your own custom local repository than install them all with the '\--upgrade'
|
||||
option. All you need to do is generate a compressed package database in the
|
||||
directory with these packages so pacman can find it when run with '\--refresh'.
|
||||
|
||||
repo-add /home/pkgs/custom.db.tar.gz /home/pkgs/*.pkg.tar.gz
|
||||
|
||||
The above command will generate a compressed database named
|
||||
'/home/pkgs/custom.db.tar.gz'. Note that the database must be of the form
|
||||
'{treename}.db.tar.gz', where '{treename}' is the name of the section defined in
|
||||
the configuration file. That's it! Now configure your custom section in the
|
||||
configuration file as shown in the config example above. Pacman will now use your
|
||||
package repository. If you add new packages to the repository, remember to
|
||||
re-generate the database and use pacman's '\--refresh' option.
|
||||
|
||||
For more information on the repo-add command, see ``repo-add \--help'' or
|
||||
linkman:repo-add[8].
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
linkman:pacman[8], linkman:libalpm[3]
|
||||
|
||||
include::footer.txt[]
|
||||
51
doc/repo-add.8.txt
Normal file
51
doc/repo-add.8.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
/////
|
||||
vim:set ts=4 sw=4 syntax=asciidoc noet:
|
||||
/////
|
||||
repo-add(8)
|
||||
==========
|
||||
|
||||
Name
|
||||
----
|
||||
////
|
||||
* If we use this below line, the manpage name comes out all weird. We also
|
||||
* can't use two separate lines, which is quite annoying. *
|
||||
repo-add, repo-remove - package database maintenance utilities
|
||||
////
|
||||
repo-add - package database maintenance utility
|
||||
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
repo-add <path-to-db> [--force] <package> ...
|
||||
|
||||
repo-remove <path-to-db> <packagename> ...
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
repo-add and repo-remove are two scripts to help build a package database for
|
||||
packages built with linkman:makepkg[8] and installed with linkman:pacman[8].
|
||||
|
||||
repo-add will update a package database by reading a built package file.
|
||||
Multiple packages to add can be specified on the command line.
|
||||
|
||||
repo-remove will update a package database by removing the package name
|
||||
specified on the command line. Multiple packages to remove can be specified
|
||||
on the command line.
|
||||
|
||||
|
||||
Options
|
||||
-------
|
||||
*--force* (repo-add only)::
|
||||
Add a force entry to the sync database, which tells pacman to skip version
|
||||
number comparison and update the package regardless. This flag can be
|
||||
specified in the middle of the command line, with any packages listed
|
||||
before the flag being added as normal entries, and any specified after
|
||||
being marked as force upgrades.
|
||||
|
||||
|
||||
See Also
|
||||
--------
|
||||
linkman:makepkg[8], linkman:pacman[8]
|
||||
|
||||
include::footer.txt[]
|
||||
2
etc/.cvsignore → etc/.gitignore
vendored
2
etc/.cvsignore → etc/.gitignore
vendored
@@ -1,4 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
makepkg.conf
|
||||
pacman.conf
|
||||
@@ -1,4 +1,30 @@
|
||||
SUBDIRS = pacman.d abs
|
||||
|
||||
EXTRA_DIST = makepkg.conf pacman.conf
|
||||
dist_sysconf_DATA = makepkg.conf pacman.conf
|
||||
EXTRA_DIST = makepkg.conf.in pacman.conf.in
|
||||
|
||||
# Files that should be removed, but which Automake does not know.
|
||||
MOSTLYCLEANFILES = $(dist_sysconf_DATA)
|
||||
|
||||
#### Taken from the autoconf scripts Makefile.am ####
|
||||
edit = sed \
|
||||
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
|
||||
-e 's|@localstatedir[@]|$(localstatedir)|g' \
|
||||
-e 's|@prefix[@]|$(prefix)|g' \
|
||||
-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
|
||||
-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
|
||||
-e 's|@PKGEXT[@]|$(PKGEXT)|g' \
|
||||
-e 's|@SRCEXT[@]|$(SRCEXT)|g' \
|
||||
-e 's|@CARCH[@]|$(CARCH)|g' \
|
||||
-e 's|@CHOST[@]|$(CHOST)|g' \
|
||||
-e 's|@ARCHSWITCH[@]|$(ARCHSWITCH)|g' \
|
||||
-e 's|@CARCHFLAGS[@]|$(CARCHFLAGS)|g' \
|
||||
-e 's|@ROOTDIR[@]|$(ROOTDIR)|g'
|
||||
|
||||
$(dist_sysconf_DATA): Makefile
|
||||
rm -f $@ $@.tmp
|
||||
$(edit) `test -f ./$@.in || echo $(srcdir)/`$@.in >$@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
makepkg.conf: $(srcdir)/makepkg.conf.in
|
||||
pacman.conf: $(srcdir)/pacman.conf.in
|
||||
|
||||
# vim:set ts=2 sw=2 noet:
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,17 +0,0 @@
|
||||
EXTRA_DIST = abs.conf \
|
||||
supfile.arch \
|
||||
supfile.community \
|
||||
supfile.extra \
|
||||
supfile.testing \
|
||||
supfile.unstable
|
||||
|
||||
install-data-hook:
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/abs ; \
|
||||
for j in $(EXTRA_DIST); do \
|
||||
$(INSTALL) -c -m 644 $(srcdir)/$$j $(DESTDIR)$(sysconfdir)/abs/$$j ; \
|
||||
done
|
||||
|
||||
uninstall-hook:
|
||||
for j in $(EXTRA_DIST); do \
|
||||
rm -f $(DESTDIR)$(sysconfdir)/abs/$$j ; \
|
||||
done
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# /etc/abs/abs.conf
|
||||
#
|
||||
|
||||
# the top-level directory of all your PKGBUILDs
|
||||
[ "$ABSROOT" = "" ] && ABSROOT="/var/abs/"
|
||||
|
||||
#
|
||||
# Supfiles to be parsed by abs (in this order)
|
||||
# (prefix a module with a ! to disable it)
|
||||
#
|
||||
SUPFILES=(arch extra !unstable !community !testing)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# /etc/abs/supfile.arch
|
||||
#
|
||||
|
||||
# this is the host containing the current PKGBUILD files
|
||||
*default host=cvs.archlinux.org
|
||||
|
||||
*default release=cvs
|
||||
*default delete
|
||||
*default use-rel-suffix
|
||||
*default compress
|
||||
#*default umask=002
|
||||
|
||||
*default tag=CURRENT
|
||||
arch
|
||||
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# /etc/abs/supfile.community
|
||||
#
|
||||
|
||||
# this is the host containing the community PKGBUILD files
|
||||
*default host=cvs.archlinux.org
|
||||
|
||||
*default release=cvs
|
||||
*default delete
|
||||
*default use-rel-suffix
|
||||
*default compress
|
||||
#*default umask=002
|
||||
|
||||
*default tag=CURRENT
|
||||
community
|
||||
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# /etc/abs/supfile.extra
|
||||
#
|
||||
|
||||
# this is the host containing the extra PKGBUILD files
|
||||
*default host=cvs.archlinux.org
|
||||
|
||||
*default release=cvs
|
||||
*default delete
|
||||
*default use-rel-suffix
|
||||
*default compress
|
||||
#*default umask=002
|
||||
|
||||
*default tag=CURRENT
|
||||
extra
|
||||
@@ -1,16 +0,0 @@
|
||||
#
|
||||
# /etc/abs/supfile.testing
|
||||
#
|
||||
|
||||
# this is the host containing the testing PKGBUILD files
|
||||
*default host=cvs.archlinux.org
|
||||
|
||||
*default release=cvs
|
||||
*default delete
|
||||
*default use-rel-suffix
|
||||
*default compress
|
||||
#*default umask=002
|
||||
|
||||
*default tag=TESTING
|
||||
arch
|
||||
extra
|
||||
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# /etc/abs/supfile.unstable
|
||||
#
|
||||
|
||||
# this is the host containing the unstable PKGBUILD files
|
||||
*default host=cvs.archlinux.org
|
||||
|
||||
*default release=cvs
|
||||
*default delete
|
||||
*default use-rel-suffix
|
||||
*default compress
|
||||
#*default umask=002
|
||||
|
||||
*default tag=CURRENT
|
||||
unstable
|
||||
@@ -1,15 +1,23 @@
|
||||
#
|
||||
# /etc/makepkg.conf
|
||||
# @sysconfdir@/makepkg.conf
|
||||
#
|
||||
|
||||
#########################################################################
|
||||
# SOURCE ACQUISITION
|
||||
#########################################################################
|
||||
#
|
||||
#-- The FTP/HTTP download utility that makepkg should use to acquire sources
|
||||
FTPAGENT="/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3 --no-check-certificate"
|
||||
#FTPAGENT="/usr/bin/snarf"
|
||||
#FTPAGENT="/usr/bin/lftpget -c"
|
||||
#-- The download utilities that makepkg should use to acquire sources
|
||||
# Format: 'protocol::agent'
|
||||
DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3'
|
||||
'http::/usr/bin/wget -c -t 3 --waitretry=3'
|
||||
'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate'
|
||||
'rsync::/usr/bin/rsync -z'
|
||||
'scp::/usr/bin/scp -C')
|
||||
|
||||
# Other common tools:
|
||||
# /usr/bin/snarf
|
||||
# /usr/bin/lftpget -c
|
||||
# /usr/bin/curl
|
||||
|
||||
#########################################################################
|
||||
# ARCHITECTURE, COMPILE FLAGS
|
||||
@@ -19,10 +27,10 @@ CARCH="@CARCH@"
|
||||
CHOST="@CHOST@"
|
||||
|
||||
#-- Exclusive: will only run on @CARCHFLAGS@
|
||||
# -mtune builds exclusively for an architecture
|
||||
# -mcpu optimizes for an architecture, but builds for the whole processor family
|
||||
CFLAGS="-@ARCHSWITCH@=@CARCHFLAGS@ -O2 -pipe"
|
||||
CXXFLAGS="-@ARCHSWITCH@=@CARCHFLAGS@ -O2 -pipe"
|
||||
# -march (or -mcpu) builds exclusively for an architecture
|
||||
# -mtune optimizes for an architecture, but builds for whole processor family
|
||||
CFLAGS="@CARCHFLAGS@-mtune=generic -O2 -pipe"
|
||||
CXXFLAGS="@CARCHFLAGS@-mtune=generic -O2 -pipe"
|
||||
#-- Make Flags: change this for DistCC/SMP systems
|
||||
#MAKEFLAGS="-j2"
|
||||
|
||||
@@ -30,14 +38,16 @@ CXXFLAGS="-@ARCHSWITCH@=@CARCHFLAGS@ -O2 -pipe"
|
||||
# BUILD ENVIRONMENT
|
||||
#########################################################################
|
||||
#
|
||||
# Defaults: BUILDENV=(!fakeroot !distcc color !ccache)
|
||||
# Defaults: BUILDENV=(fakeroot !distcc color !ccache !xdelta)
|
||||
# A negated environment option will do the opposite of the comments below.
|
||||
#
|
||||
#-- fakeroot: Allow building packages as a non-root user
|
||||
#-- distcc: Use the Distributed C/C++/ObjC compiler
|
||||
#-- color: Colorize output messages
|
||||
#-- ccache: Use ccache to cache compilation
|
||||
#-- xdelta: Generate delta patch from previous to current package
|
||||
#
|
||||
BUILDENV=(fakeroot !distcc color !ccache)
|
||||
BUILDENV=(fakeroot !distcc color !ccache !xdelta)
|
||||
#
|
||||
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
|
||||
#-- specify a space-delimited list of hosts running in the DistCC cluster.
|
||||
@@ -48,7 +58,8 @@ BUILDENV=(fakeroot !distcc color !ccache)
|
||||
# These are default values for the options=() settings
|
||||
#########################################################################
|
||||
#
|
||||
# Default: OPTIONS=(strip !docs !libtool emptydirs)
|
||||
# Default: OPTIONS=(strip !docs libtool emptydirs)
|
||||
# A negated option will do the opposite of the comments below.
|
||||
#
|
||||
#-- strip: Strip symbols from binaries/libraries
|
||||
#-- docs: Save doc and info directories
|
||||
@@ -60,7 +71,7 @@ OPTIONS=(strip !docs libtool emptydirs)
|
||||
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
|
||||
INTEGRITY_CHECK=(md5)
|
||||
#-- Info and doc directories to remove (if option set correctly above)
|
||||
DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/gnome/{,share/}{info,doc,gtk-doc})
|
||||
DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc})
|
||||
|
||||
#########################################################################
|
||||
# PACKAGE OUTPUT
|
||||
@@ -72,7 +83,22 @@ DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/gnome/{,share/}{info,doc,gtk-doc})
|
||||
#PKGDEST=/home/packages
|
||||
#-- Source cache: specify a fixed directory where source files will be cached
|
||||
#SRCDEST=/home/sources
|
||||
#-- Source root: specify location where PKGBUILDs are located for '--builddeps'
|
||||
#SRCROOT=/home/pkgbuilds
|
||||
#-- Packager: name/email of the person or organization building packages
|
||||
#PACKAGER="John Doe <john@doe.com>"
|
||||
|
||||
#########################################################################
|
||||
# BUILDSCRIPT/EXTENSION DEFAULTS
|
||||
#########################################################################
|
||||
#
|
||||
# WARNING: Do NOT modify these variables unless you know what you are
|
||||
# doing.
|
||||
#
|
||||
BUILDSCRIPT='PKGBUILD'
|
||||
PKGEXT='@PKGEXT@'
|
||||
SRCEXT='@SRCEXT@'
|
||||
DB_COMPRESSION='gz'
|
||||
DB_CHECKSUMS=(md5)
|
||||
|
||||
# vim: set ft=sh ts=2 sw=2 et:
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
# @sysconfdir@/pacman.conf
|
||||
#
|
||||
# See the pacman manpage for option directives
|
||||
# See the pacman.conf(5) manpage for option and repository directives
|
||||
|
||||
#
|
||||
# GENERAL OPTIONS
|
||||
#
|
||||
[options]
|
||||
LogFile = /var/log/pacman.log
|
||||
# The following paths are commented out with their default values listed.
|
||||
# If you wish to use different paths, uncomment and update the paths.
|
||||
#RootDir = @ROOTDIR@
|
||||
#DBPath = @localstatedir@/lib/pacman/
|
||||
#CacheDir = @localstatedir@/cache/pacman/pkg/
|
||||
#LogFile = @localstatedir@/log/pacman.log
|
||||
HoldPkg = pacman glibc
|
||||
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
||||
|
||||
@@ -18,25 +23,25 @@ HoldPkg = pacman glibc
|
||||
# - local/custom mirrors can be added here or in separate files
|
||||
# - repositories listed first will take precedence when packages
|
||||
# have identical names, regardless of version number
|
||||
# - URLs will have $repo replaced by the name of the current repo
|
||||
#
|
||||
# Repository entries are of the format:
|
||||
# [repo-name]
|
||||
# Server = ServerName
|
||||
# Include = IncludePath
|
||||
#
|
||||
# The header [repo-name] is crucial - it must be present and
|
||||
# uncommented to enable the repo.
|
||||
#
|
||||
#[testing]
|
||||
#Include = /etc/pacman.d/testing
|
||||
|
||||
[current]
|
||||
# Add your preferred servers here, they will be used first
|
||||
Include = /etc/pacman.d/current
|
||||
|
||||
[extra]
|
||||
# Add your preferred servers here, they will be used first
|
||||
Include = /etc/pacman.d/extra
|
||||
|
||||
[community]
|
||||
# Add your preferred servers here, they will be used first
|
||||
Include = /etc/pacman.d/community
|
||||
|
||||
#[unstable]
|
||||
# Add your preferred servers here, they will be used first
|
||||
#Include = /etc/pacman.d/unstable
|
||||
# An example of a disabled remote package repository with multiple servers
|
||||
# available. To enable, uncomment the following lines. You can add preferred
|
||||
# servers immediately after the header and they will be used before the
|
||||
# default mirrors.
|
||||
#[core]
|
||||
#Server = ftp://ftp.example.com/foobar/$repo/os/i686/
|
||||
# The file referenced here should contain a list of 'Server = ' lines.
|
||||
#Include = @sysconfdir@/pacman.d/mirrorlist
|
||||
|
||||
# An example of a custom package repository. See the pacman manpage for
|
||||
# tips on creating your own repositories.
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
community
|
||||
current
|
||||
extra
|
||||
mirrorlist
|
||||
release
|
||||
unstable
|
||||
testing
|
||||
@@ -1,9 +0,0 @@
|
||||
pkgsysconfdir = ${sysconfdir}/pacman.d
|
||||
dist_pkgsysconf_DATA = community current extra release testing unstable
|
||||
|
||||
$(dist_pkgsysconf_DATA): mirrorlist
|
||||
sed "s|@@REPO@@|$@|g" <$< >$@
|
||||
|
||||
clean-local:
|
||||
rm -f $(dist_pkgsysconf_DATA)
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
#
|
||||
# @@REPO@@: Arch Linux @@REPO@@ repository
|
||||
#
|
||||
|
||||
# United States
|
||||
Server = ftp://ftp.archlinux.org/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://ftp.nethat.com/pub/linux/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://ftp-linux.cc.gatech.edu/pub/linux/distributions/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://mirror.cs.vt.edu/pub/ArchLinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/@@REPO@@/os/@CARCH@
|
||||
|
||||
# Europe
|
||||
# - Austria
|
||||
Server = ftp://gd.tuwien.ac.at/opsys/linux/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Belgium
|
||||
Server = ftp://ftp.belnet.be/packages/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Czech Republic
|
||||
Server = ftp://ftp.sh.cvut.cz/MIRRORS/arch/@@REPO@@/os/@CARCH@
|
||||
# - Estonia
|
||||
Server = ftp://ftp.estpak.ee/pub/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Finland
|
||||
Server = ftp://ftp.sixnix.net/pub/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - France
|
||||
Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://mir1.archlinuxfr.org/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://mir2.archlinuxfr.org/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Germany
|
||||
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/@@REPO@@/os/@CARCH@
|
||||
# - Great Britain
|
||||
Server = http://ftp.parrswood.manchester.sch.uk/Mirrors/ftp.archlinux.org/@@REPO@@/os/@CARCH@
|
||||
# - Greece
|
||||
Server = ftp://ftp.ntua.gr/pub/linux/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Ireland
|
||||
Server = ftp://ftp.heanet.ie/mirrors/ftp.archlinux.org/@@REPO@@/os/@CARCH@
|
||||
# - Italy
|
||||
Server = ftp://mi.mirror.garr.it/mirrors/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Lithuania
|
||||
Server = ftp://saule.mintis.lt/pub/linux/@@REPO@@/os/@CARCH@
|
||||
# - Netherlands
|
||||
Server = ftp://ftp.nluug.nl/pub/metalab/distributions/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://ftp.surfnet.nl/pub/os/Linux/distr/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Norway
|
||||
Server = ftp://mirror.djzradio.net/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Poland
|
||||
Server = ftp://sunsite.icm.edu.pl/site/linux-sunsite/distributions/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://mirror.icis.pcz.pl/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Portugal
|
||||
Server = ftp://gul.est.ips.pt/repos/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://cesium.di.uminho.pt/pub/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://darkstar.ist.utl.pt/pub/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Romania
|
||||
Server = ftp://ftp.iasi.roedu.net/mirrors/archlinux.org/@@REPO@@/os/@CARCH@
|
||||
# - Russia
|
||||
Server = http://archlinux.freeside.ru/@@REPO@@/os/@CARCH@
|
||||
# - Sweden
|
||||
Server = ftp://ftp.ds.hj.se/pub/os/linux/archlinux/@@REPO@@/os/@CARCH@
|
||||
Server = ftp://ftp.gigabit.nu/@@REPO@@/os/@CARCH@
|
||||
# - Switzerland
|
||||
Server = ftp://archlinux.puzzle.ch/@@REPO@@/os/@CARCH@
|
||||
# - Turkey
|
||||
Server = ftp://ftp.linux.org.tr/pub/archlinux/@@REPO@@/os/@CARCH@
|
||||
# - Ukraine
|
||||
Server = ftp://ftp.linux.kiev.ua/pub/Linux/ArchLinux/@@REPO@@/os/@CARCH@
|
||||
|
||||
# Australia
|
||||
Server = ftp://mirror.pacific.net.au/linux/archlinux/@@REPO@@/os/@CARCH@
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.lo
|
||||
*.la
|
||||
@@ -5,12 +5,16 @@ SUBDIRS = po
|
||||
lib_LTLIBRARIES = libalpm.la
|
||||
include_HEADERS = alpm_list.h alpm.h
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
||||
DEFS = -DLOCALEDIR=\"@localedir@\" @DEFS@
|
||||
|
||||
AM_CFLAGS = -fvisibility=hidden -pedantic -D_GNU_SOURCE
|
||||
AM_CFLAGS = -pedantic -D_GNU_SOURCE
|
||||
|
||||
EXTRA_DIST = Doxyfile
|
||||
if ENABLE_VISIBILITY_CC
|
||||
AM_CFLAGS += -fvisibility=internal
|
||||
endif
|
||||
if ENABLE_GNU89_INLINE_CC
|
||||
AM_CFLAGS += -fgnu89-inline
|
||||
endif
|
||||
|
||||
libalpm_la_SOURCES = \
|
||||
add.h add.c \
|
||||
@@ -21,30 +25,20 @@ libalpm_la_SOURCES = \
|
||||
cache.h cache.c \
|
||||
conflict.h conflict.c \
|
||||
db.h db.c \
|
||||
delta.h delta.c \
|
||||
deps.h deps.c \
|
||||
error.h error.c \
|
||||
group.h group.c \
|
||||
handle.h handle.c \
|
||||
log.h log.c \
|
||||
md5.h md5.c \
|
||||
md5driver.c \
|
||||
package.h package.c \
|
||||
provide.h provide.c \
|
||||
remove.h remove.c \
|
||||
server.h server.c \
|
||||
sha1.h sha1.c \
|
||||
sync.h sync.c \
|
||||
trans.h trans.c \
|
||||
util.h util.c \
|
||||
versioncmp.h versioncmp.c
|
||||
util.h util.c
|
||||
|
||||
libalpm_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_INFO)
|
||||
libalpm_la_LIBADD = -larchive -ldownload -lm
|
||||
|
||||
if HAS_DOXYGEN
|
||||
all: doxygen.in
|
||||
|
||||
doxygen.in:
|
||||
doxygen $(srcdir)/Doxyfile
|
||||
|
||||
endif
|
||||
# vim:set ts=2 sw=2 noet:
|
||||
|
||||
1351
lib/libalpm/add.c
1351
lib/libalpm/add.c
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* add.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,9 +14,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_ADD_H
|
||||
#define _ALPM_ADD_H
|
||||
|
||||
1154
lib/libalpm/alpm.c
1154
lib/libalpm/alpm.c
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* alpm.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -17,9 +17,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_H
|
||||
#define _ALPM_H
|
||||
@@ -29,28 +27,23 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <time.h> /* for time_t */
|
||||
#include <stdarg.h> /* for va_list */
|
||||
|
||||
#include <alpm_list.h>
|
||||
|
||||
#define DEPRECATED __attribute__((deprecated))
|
||||
|
||||
/*
|
||||
* Arch Linux Package Management library
|
||||
*/
|
||||
|
||||
#define PM_ROOT "/"
|
||||
#define PM_DBPATH "var/lib/pacman/"
|
||||
#define PM_CACHEDIR "var/cache/pacman/pkg/"
|
||||
#define PM_LOCK "tmp/pacman.lck"
|
||||
|
||||
|
||||
#define PM_EXT_PKG ".pkg.tar.gz"
|
||||
#define PM_EXT_DB ".db.tar.gz"
|
||||
|
||||
/*
|
||||
/*
|
||||
* Structures
|
||||
*/
|
||||
|
||||
typedef struct __alpm_list_t alpm_list_t;
|
||||
|
||||
typedef struct __pmdb_t pmdb_t;
|
||||
typedef struct __pmpkg_t pmpkg_t;
|
||||
typedef struct __pmdelta_t pmdelta_t;
|
||||
typedef struct __pmgrp_t pmgrp_t;
|
||||
typedef struct __pmserver_t pmserver_t;
|
||||
typedef struct __pmtrans_t pmtrans_t;
|
||||
@@ -58,12 +51,14 @@ typedef struct __pmsyncpkg_t pmsyncpkg_t;
|
||||
typedef struct __pmdepend_t pmdepend_t;
|
||||
typedef struct __pmdepmissing_t pmdepmissing_t;
|
||||
typedef struct __pmconflict_t pmconflict_t;
|
||||
typedef struct __pmfileconflict_t pmfileconflict_t;
|
||||
typedef struct __pmgraph_t pmgraph_t;
|
||||
|
||||
/*
|
||||
* Library
|
||||
*/
|
||||
|
||||
int alpm_initialize();
|
||||
int alpm_initialize(void);
|
||||
int alpm_release(void);
|
||||
|
||||
/*
|
||||
@@ -75,18 +70,18 @@ typedef enum _pmloglevel_t {
|
||||
PM_LOG_ERROR = 0x01,
|
||||
PM_LOG_WARNING = 0x02,
|
||||
PM_LOG_DEBUG = 0x04,
|
||||
PM_LOG_DOWNLOAD = 0x08,
|
||||
PM_LOG_FUNCTION = 0x10
|
||||
PM_LOG_FUNCTION = 0x08
|
||||
} pmloglevel_t;
|
||||
|
||||
typedef void (*alpm_cb_log)(unsigned short, char *);
|
||||
typedef void (*alpm_cb_log)(pmloglevel_t, char *, va_list);
|
||||
int alpm_logaction(char *fmt, ...);
|
||||
|
||||
/*
|
||||
* Downloading
|
||||
*/
|
||||
|
||||
typedef void (*alpm_cb_download)(const char *filename, int xfered, int total);
|
||||
typedef void (*alpm_cb_download)(const char *filename, int file_xfered,
|
||||
int file_total, int list_xfered, int list_total);
|
||||
|
||||
/*
|
||||
* Options
|
||||
@@ -100,58 +95,57 @@ void alpm_option_set_logcb(alpm_cb_log cb);
|
||||
alpm_cb_download alpm_option_get_dlcb();
|
||||
void alpm_option_set_dlcb(alpm_cb_download cb);
|
||||
|
||||
unsigned short alpm_option_get_logmask();
|
||||
void alpm_option_set_logmask(unsigned short mask);
|
||||
|
||||
const char *alpm_option_get_root();
|
||||
void alpm_option_set_root(const char *root);
|
||||
int alpm_option_set_root(const char *root);
|
||||
|
||||
const char *alpm_option_get_dbpath();
|
||||
void alpm_option_set_dbpath(const char *dbpath);
|
||||
int alpm_option_set_dbpath(const char *dbpath);
|
||||
|
||||
const char *alpm_option_get_cachedir();
|
||||
void alpm_option_set_cachedir(const char *cachedir);
|
||||
alpm_list_t *alpm_option_get_cachedirs();
|
||||
int alpm_option_add_cachedir(const char *cachedir);
|
||||
void alpm_option_set_cachedirs(alpm_list_t *cachedirs);
|
||||
int alpm_option_remove_cachedir(const char *cachedir);
|
||||
|
||||
const char *alpm_option_get_logfile();
|
||||
void alpm_option_set_logfile(const char *logfile);
|
||||
int alpm_option_set_logfile(const char *logfile);
|
||||
|
||||
const char *alpm_option_get_lockfile();
|
||||
/* no set_lockfile, path is determined from dbpath */
|
||||
|
||||
unsigned short alpm_option_get_usesyslog();
|
||||
void alpm_option_set_usesyslog(unsigned short usesyslog);
|
||||
|
||||
alpm_list_t *alpm_option_get_noupgrades();
|
||||
void alpm_option_add_noupgrade(char *pkg);
|
||||
void alpm_option_add_noupgrade(const char *pkg);
|
||||
void alpm_option_set_noupgrades(alpm_list_t *noupgrade);
|
||||
int alpm_option_remove_noupgrade(const char *pkg);
|
||||
|
||||
alpm_list_t *alpm_option_get_noextracts();
|
||||
void alpm_option_add_noextract(char *pkg);
|
||||
void alpm_option_add_noextract(const char *pkg);
|
||||
void alpm_option_set_noextracts(alpm_list_t *noextract);
|
||||
int alpm_option_remove_noextract(const char *pkg);
|
||||
|
||||
alpm_list_t *alpm_option_get_ignorepkgs();
|
||||
void alpm_option_add_ignorepkg(char *pkg);
|
||||
void alpm_option_add_ignorepkg(const char *pkg);
|
||||
void alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs);
|
||||
int alpm_option_remove_ignorepkg(const char *pkg);
|
||||
|
||||
alpm_list_t *alpm_option_get_holdpkgs();
|
||||
void alpm_option_add_holdpkg(char *pkg);
|
||||
void alpm_option_add_holdpkg(const char *pkg);
|
||||
void alpm_option_set_holdpkgs(alpm_list_t *holdpkgs);
|
||||
int alpm_option_remove_holdpkg(const char *pkg);
|
||||
|
||||
time_t alpm_option_get_upgradedelay();
|
||||
void alpm_option_set_upgradedelay(time_t delay);
|
||||
alpm_list_t *alpm_option_get_ignoregrps();
|
||||
void alpm_option_add_ignoregrp(const char *grp);
|
||||
void alpm_option_set_ignoregrps(alpm_list_t *ignoregrps);
|
||||
int alpm_option_remove_ignoregrp(const char *grp);
|
||||
|
||||
const char *alpm_option_get_xfercommand();
|
||||
void alpm_option_set_xfercommand(const char *cmd);
|
||||
|
||||
unsigned short alpm_option_get_nopassiveftp();
|
||||
void alpm_option_set_nopassiveftp(unsigned short nopasv);
|
||||
|
||||
unsigned short alpm_option_get_chomp();
|
||||
void alpm_option_set_chomp(unsigned short chomp);
|
||||
|
||||
alpm_list_t *alpm_option_get_needles();
|
||||
void alpm_option_add_needle(char *needle);
|
||||
void alpm_option_set_needles(alpm_list_t *needles);
|
||||
|
||||
unsigned short alpm_option_get_usecolor();
|
||||
void alpm_option_set_usecolor(unsigned short usecolor);
|
||||
void alpm_option_set_usedelta(unsigned short usedelta);
|
||||
|
||||
pmdb_t *alpm_option_get_localdb();
|
||||
alpm_list_t *alpm_option_get_syncdbs();
|
||||
@@ -160,14 +154,14 @@ alpm_list_t *alpm_option_get_syncdbs();
|
||||
* Databases
|
||||
*/
|
||||
|
||||
/* Database registration callback */
|
||||
typedef void (*alpm_cb_db_register)(const char *, pmdb_t *);
|
||||
|
||||
pmdb_t *alpm_db_register(char *treename);
|
||||
/* Preferred interfaces db_register_local and db_register_sync */
|
||||
pmdb_t *alpm_db_register_local(void);
|
||||
pmdb_t *alpm_db_register_sync(const char *treename);
|
||||
int alpm_db_unregister(pmdb_t *db);
|
||||
int alpm_db_unregister_all(void);
|
||||
|
||||
const char *alpm_db_get_name(pmdb_t *db);
|
||||
const char *alpm_db_get_url(pmdb_t *db);
|
||||
const char *alpm_db_get_name(const pmdb_t *db);
|
||||
const char *alpm_db_get_url(const pmdb_t *db);
|
||||
|
||||
int alpm_db_setserver(pmdb_t *db, const char *url);
|
||||
|
||||
@@ -179,7 +173,7 @@ alpm_list_t *alpm_db_whatprovides(pmdb_t *db, const char *name);
|
||||
|
||||
pmgrp_t *alpm_db_readgrp(pmdb_t *db, const char *name);
|
||||
alpm_list_t *alpm_db_getgrpcache(pmdb_t *db);
|
||||
alpm_list_t *alpm_db_search(pmdb_t *db, alpm_list_t* needles);
|
||||
alpm_list_t *alpm_db_search(pmdb_t *db, const alpm_list_t* needles);
|
||||
|
||||
/*
|
||||
* Packages
|
||||
@@ -193,35 +187,22 @@ typedef enum _pmpkgreason_t {
|
||||
PM_PKG_REASON_DEPEND = 1 /* installed as a dependency for another package */
|
||||
} pmpkgreason_t;
|
||||
|
||||
/* package name formats */
|
||||
/*
|
||||
typedef enum _pmpkghasarch_t {
|
||||
PM_PKG_WITHOUT_ARCH = 0, / pkgname-pkgver-pkgrel, used under PM_DBPATH /
|
||||
PM_PKG_WITH_ARCH = 1 / pkgname-pkgver-pkgrel-arch, used under PM_CACHEDIR /
|
||||
} pmpkghasarch_t;
|
||||
*/
|
||||
|
||||
int alpm_pkg_load(char *filename, pmpkg_t **pkg);
|
||||
int alpm_pkg_load(const char *filename, unsigned short full, pmpkg_t **pkg);
|
||||
int alpm_pkg_free(pmpkg_t *pkg);
|
||||
int alpm_pkg_checkmd5sum(pmpkg_t *pkg);
|
||||
int alpm_pkg_checksha1sum(pmpkg_t *pkg);
|
||||
char *alpm_fetch_pkgurl(char *url);
|
||||
int alpm_parse_config(char *file, alpm_cb_db_register callback,
|
||||
const char *this_section);
|
||||
char *alpm_fetch_pkgurl(const char *url);
|
||||
int alpm_pkg_vercmp(const char *ver1, const char *ver2);
|
||||
char *alpm_pkg_name_hasarch(char *pkgname);
|
||||
alpm_list_t *alpm_pkg_compute_requiredby(pmpkg_t *pkg);
|
||||
|
||||
const char *alpm_pkg_get_filename(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_name(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_version(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_desc(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_url(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_builddate(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_buildtype(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_installdate(pmpkg_t *pkg);
|
||||
time_t alpm_pkg_get_builddate(pmpkg_t *pkg);
|
||||
time_t alpm_pkg_get_installdate(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_packager(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_md5sum(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_sha1sum(pmpkg_t *pkg);
|
||||
const char *alpm_pkg_get_arch(pmpkg_t *pkg);
|
||||
unsigned long alpm_pkg_get_size(pmpkg_t *pkg);
|
||||
unsigned long alpm_pkg_get_isize(pmpkg_t *pkg);
|
||||
@@ -229,20 +210,37 @@ pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_removes(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_requiredby(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_optdepends(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_conflicts(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_provides(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_deltas(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg);
|
||||
alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg);
|
||||
void *alpm_pkg_changelog_open(pmpkg_t *pkg);
|
||||
size_t alpm_pkg_changelog_read(void *ptr, size_t size,
|
||||
const pmpkg_t *pkg, const void *fp);
|
||||
/*int alpm_pkg_changelog_feof(const pmpkg_t *pkg, void *fp);*/
|
||||
int alpm_pkg_changelog_close(const pmpkg_t *pkg, void *fp);
|
||||
unsigned short alpm_pkg_has_scriptlet(pmpkg_t *pkg);
|
||||
|
||||
unsigned long alpm_pkg_download_size(pmpkg_t *newpkg, pmdb_t *db_local);
|
||||
|
||||
/*
|
||||
* Deltas
|
||||
*/
|
||||
|
||||
const char *alpm_delta_get_from(pmdelta_t *delta);
|
||||
const char *alpm_delta_get_to(pmdelta_t *delta);
|
||||
unsigned long alpm_delta_get_size(pmdelta_t *delta);
|
||||
const char *alpm_delta_get_filename(pmdelta_t *delta);
|
||||
const char *alpm_delta_get_md5sum(pmdelta_t *delta);
|
||||
|
||||
/*
|
||||
* Groups
|
||||
*/
|
||||
const char *alpm_grp_get_name(pmgrp_t *grp);
|
||||
alpm_list_t *alpm_grp_get_pkgs(pmgrp_t *grp);
|
||||
const char *alpm_grp_get_name(const pmgrp_t *grp);
|
||||
const alpm_list_t *alpm_grp_get_pkgs(const pmgrp_t *grp);
|
||||
|
||||
/*
|
||||
* Sync
|
||||
@@ -255,9 +253,11 @@ typedef enum _pmsynctype_t {
|
||||
PM_SYNC_TYPE_DEPEND
|
||||
} pmsynctype_t;
|
||||
|
||||
pmsynctype_t alpm_sync_get_type(pmsyncpkg_t *sync);
|
||||
pmpkg_t *alpm_sync_get_pkg(pmsyncpkg_t *sync);
|
||||
void *alpm_sync_get_data(pmsyncpkg_t *sync);
|
||||
pmsynctype_t alpm_sync_get_type(const pmsyncpkg_t *sync);
|
||||
pmpkg_t *alpm_sync_get_pkg(const pmsyncpkg_t *sync);
|
||||
void *alpm_sync_get_data(const pmsyncpkg_t *sync);
|
||||
int alpm_sync_sysupgrade(pmdb_t *db_local,
|
||||
alpm_list_t *dbs_sync, alpm_list_t **syncpkgs);
|
||||
|
||||
/*
|
||||
* Transactions
|
||||
@@ -267,6 +267,7 @@ void *alpm_sync_get_data(pmsyncpkg_t *sync);
|
||||
typedef enum _pmtranstype_t {
|
||||
PM_TRANS_TYPE_ADD = 1,
|
||||
PM_TRANS_TYPE_REMOVE,
|
||||
PM_TRANS_TYPE_REMOVEUPGRADE,
|
||||
PM_TRANS_TYPE_UPGRADE,
|
||||
PM_TRANS_TYPE_SYNC
|
||||
} pmtranstype_t;
|
||||
@@ -276,7 +277,7 @@ typedef enum _pmtransflag_t {
|
||||
PM_TRANS_FLAG_NODEPS = 0x01,
|
||||
PM_TRANS_FLAG_FORCE = 0x02,
|
||||
PM_TRANS_FLAG_NOSAVE = 0x04,
|
||||
PM_TRANS_FLAG_FRESHEN = 0x08,
|
||||
/* 0x08 flag can go here */
|
||||
PM_TRANS_FLAG_CASCADE = 0x10,
|
||||
PM_TRANS_FLAG_RECURSE = 0x20,
|
||||
PM_TRANS_FLAG_DBONLY = 0x40,
|
||||
@@ -285,7 +286,8 @@ typedef enum _pmtransflag_t {
|
||||
PM_TRANS_FLAG_DOWNLOADONLY = 0x200,
|
||||
PM_TRANS_FLAG_NOSCRIPTLET = 0x400,
|
||||
PM_TRANS_FLAG_NOCONFLICTS = 0x800,
|
||||
PM_TRANS_FLAG_PRINTURIS = 0x1000
|
||||
PM_TRANS_FLAG_PRINTURIS = 0x1000,
|
||||
PM_TRANS_FLAG_NEEDED = 0x2000
|
||||
} pmtransflag_t;
|
||||
|
||||
/* Transaction Events */
|
||||
@@ -294,8 +296,6 @@ typedef enum _pmtransevt_t {
|
||||
PM_TRANS_EVT_CHECKDEPS_DONE,
|
||||
PM_TRANS_EVT_FILECONFLICTS_START,
|
||||
PM_TRANS_EVT_FILECONFLICTS_DONE,
|
||||
PM_TRANS_EVT_CLEANUP_START,
|
||||
PM_TRANS_EVT_CLEANUP_DONE,
|
||||
PM_TRANS_EVT_RESOLVEDEPS_START,
|
||||
PM_TRANS_EVT_RESOLVEDEPS_DONE,
|
||||
PM_TRANS_EVT_INTERCONFLICTS_START,
|
||||
@@ -309,9 +309,14 @@ typedef enum _pmtransevt_t {
|
||||
PM_TRANS_EVT_EXTRACT_DONE,
|
||||
PM_TRANS_EVT_INTEGRITY_START,
|
||||
PM_TRANS_EVT_INTEGRITY_DONE,
|
||||
PM_TRANS_EVT_DELTA_INTEGRITY_START,
|
||||
PM_TRANS_EVT_DELTA_INTEGRITY_DONE,
|
||||
PM_TRANS_EVT_DELTA_PATCHES_START,
|
||||
PM_TRANS_EVT_DELTA_PATCHES_DONE,
|
||||
PM_TRANS_EVT_DELTA_PATCH_START,
|
||||
PM_TRANS_EVT_DELTA_PATCH_DONE,
|
||||
PM_TRANS_EVT_DELTA_PATCH_FAILED,
|
||||
PM_TRANS_EVT_SCRIPTLET_INFO,
|
||||
PM_TRANS_EVT_SCRIPTLET_START,
|
||||
PM_TRANS_EVT_SCRIPTLET_DONE,
|
||||
PM_TRANS_EVT_PRINTURI,
|
||||
PM_TRANS_EVT_RETRIEVE_START,
|
||||
} pmtransevt_t;
|
||||
@@ -323,7 +328,7 @@ typedef enum _pmtransconv_t {
|
||||
PM_TRANS_CONV_CONFLICT_PKG = 0x04,
|
||||
PM_TRANS_CONV_CORRUPTED_PKG = 0x08,
|
||||
PM_TRANS_CONV_LOCAL_NEWER = 0x10,
|
||||
PM_TRANS_CONV_LOCAL_UPTODATE = 0x20,
|
||||
/* 0x20 flag can go here */
|
||||
PM_TRANS_CONV_REMOVE_HOLDPKG = 0x40
|
||||
} pmtransconv_t;
|
||||
|
||||
@@ -356,6 +361,7 @@ int alpm_trans_sysupgrade(void);
|
||||
int alpm_trans_addtarget(char *target);
|
||||
int alpm_trans_prepare(alpm_list_t **data);
|
||||
int alpm_trans_commit(alpm_list_t **data);
|
||||
int alpm_trans_interrupt(void);
|
||||
int alpm_trans_release(void);
|
||||
|
||||
/*
|
||||
@@ -366,44 +372,47 @@ typedef enum _pmdepmod_t {
|
||||
PM_DEP_MOD_ANY = 1,
|
||||
PM_DEP_MOD_EQ,
|
||||
PM_DEP_MOD_GE,
|
||||
PM_DEP_MOD_LE
|
||||
PM_DEP_MOD_LE,
|
||||
PM_DEP_MOD_GT,
|
||||
PM_DEP_MOD_LT
|
||||
} pmdepmod_t;
|
||||
|
||||
typedef enum _pmdeptype_t {
|
||||
PM_DEP_TYPE_DEPEND = 1,
|
||||
PM_DEP_TYPE_CONFLICT
|
||||
} pmdeptype_t;
|
||||
|
||||
pmdepend_t *alpm_splitdep(const char *depstring);
|
||||
int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
|
||||
alpm_list_t *alpm_checkdeps(pmdb_t *db, int reversedeps,
|
||||
alpm_list_t *remove, alpm_list_t *upgrade);
|
||||
|
||||
const char *alpm_dep_get_target(pmdepmissing_t *miss);
|
||||
pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss);
|
||||
pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss);
|
||||
const char *alpm_dep_get_name(pmdepmissing_t *miss);
|
||||
const char *alpm_dep_get_version(pmdepmissing_t *miss);
|
||||
const char *alpm_miss_get_target(const pmdepmissing_t *miss);
|
||||
pmdepend_t *alpm_miss_get_dep(pmdepmissing_t *miss);
|
||||
|
||||
const char *alpm_conflict_get_package1(pmconflict_t *conflict);
|
||||
const char *alpm_conflict_get_package2(pmconflict_t *conflict);
|
||||
|
||||
pmdepmod_t alpm_dep_get_mod(const pmdepend_t *dep);
|
||||
const char *alpm_dep_get_name(const pmdepend_t *dep);
|
||||
const char *alpm_dep_get_version(const pmdepend_t *dep);
|
||||
char *alpm_dep_get_string(const pmdepend_t *dep);
|
||||
|
||||
/*
|
||||
* File conflicts
|
||||
*/
|
||||
|
||||
typedef enum _pmconflicttype_t {
|
||||
PM_CONFLICT_TYPE_TARGET = 1,
|
||||
PM_CONFLICT_TYPE_FILE
|
||||
} pmconflicttype_t;
|
||||
typedef enum _pmfileconflicttype_t {
|
||||
PM_FILECONFLICT_TARGET = 1,
|
||||
PM_FILECONFLICT_FILESYSTEM
|
||||
} pmfileconflicttype_t;
|
||||
|
||||
const char *alpm_conflict_get_target(pmconflict_t *conflict);
|
||||
pmconflicttype_t alpm_conflict_get_type(pmconflict_t *conflict);
|
||||
const char *alpm_conflict_get_file(pmconflict_t *conflict);
|
||||
const char *alpm_conflict_get_ctarget(pmconflict_t *conflict);
|
||||
const char *alpm_fileconflict_get_target(pmfileconflict_t *conflict);
|
||||
pmfileconflicttype_t alpm_fileconflict_get_type(pmfileconflict_t *conflict);
|
||||
const char *alpm_fileconflict_get_file(pmfileconflict_t *conflict);
|
||||
const char *alpm_fileconflict_get_ctarget(pmfileconflict_t *conflict);
|
||||
|
||||
/*
|
||||
* Helpers
|
||||
*/
|
||||
|
||||
/* md5sums */
|
||||
char *alpm_get_md5sum(char *name);
|
||||
char *alpm_get_sha1sum(char *name);
|
||||
/* checksums */
|
||||
char *alpm_get_md5sum(const char *name);
|
||||
|
||||
/*
|
||||
* Errors
|
||||
@@ -413,6 +422,7 @@ enum _pmerrno_t {
|
||||
PM_ERR_SYSTEM,
|
||||
PM_ERR_BADPERMS,
|
||||
PM_ERR_NOT_A_FILE,
|
||||
PM_ERR_NOT_A_DIR,
|
||||
PM_ERR_WRONG_ARGS,
|
||||
/* Interface */
|
||||
PM_ERR_HANDLE_NULL,
|
||||
@@ -455,6 +465,9 @@ enum _pmerrno_t {
|
||||
PM_ERR_PKG_INVALID_NAME,
|
||||
PM_ERR_PKG_CORRUPTED,
|
||||
PM_ERR_PKG_REPO_NOT_FOUND,
|
||||
/* Deltas */
|
||||
PM_ERR_DLT_CORRUPTED,
|
||||
PM_ERR_DLT_PATCHFAILED,
|
||||
/* Groups */
|
||||
PM_ERR_GRP_NOT_FOUND,
|
||||
/* Dependencies */
|
||||
@@ -465,15 +478,9 @@ enum _pmerrno_t {
|
||||
PM_ERR_USER_ABORT,
|
||||
PM_ERR_INTERNAL_ERROR,
|
||||
PM_ERR_LIBARCHIVE_ERROR,
|
||||
PM_ERR_DISK_FULL,
|
||||
PM_ERR_DB_SYNC,
|
||||
PM_ERR_RETRIEVE,
|
||||
PM_ERR_PKG_HOLD,
|
||||
/* Configuration file */
|
||||
PM_ERR_CONF_BAD_SECTION,
|
||||
PM_ERR_CONF_LOCAL,
|
||||
PM_ERR_CONF_BAD_SYNTAX,
|
||||
PM_ERR_CONF_DIRECTIVE_OUTSIDE_SECTION,
|
||||
PM_ERR_INVALID_REGEX,
|
||||
/* Downloading */
|
||||
PM_ERR_CONNECT_FAILED,
|
||||
@@ -482,9 +489,8 @@ enum _pmerrno_t {
|
||||
|
||||
extern enum _pmerrno_t pm_errno;
|
||||
|
||||
char *alpm_strerror(int err);
|
||||
|
||||
alpm_list_t *alpm_get_upgrades();
|
||||
const char *alpm_strerror(int err);
|
||||
const char *alpm_strerrorlast(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* alpm_list.c
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,9 +14,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -29,29 +27,41 @@
|
||||
#include "alpm_list.h"
|
||||
#include "util.h"
|
||||
|
||||
/** \defgroup alpm_list functions */
|
||||
/*\@{*/
|
||||
/**
|
||||
* @addtogroup alpm_list List Functions
|
||||
* @brief Functions to manipulate alpm_list_t lists.
|
||||
*
|
||||
* These functions are designed to create, destroy, and modify lists of
|
||||
* type alpm_list_t. This is an internal list type used by libalpm that is
|
||||
* publicly exposed for use by frontends if desired.
|
||||
*
|
||||
* @{ */
|
||||
|
||||
/* Allocation */
|
||||
|
||||
/** Allocate a new alpm_list_t
|
||||
* @return a new alpm_list_t item, or NULL on failure
|
||||
/**
|
||||
* @brief Allocate a new alpm_list_t.
|
||||
*
|
||||
* @return a new alpm_list_t item, or NULL on failure
|
||||
*/
|
||||
alpm_list_t *alpm_list_new()
|
||||
alpm_list_t SYMEXPORT *alpm_list_new()
|
||||
{
|
||||
alpm_list_t *list = NULL;
|
||||
|
||||
list = (alpm_list_t *)malloc(sizeof(alpm_list_t));
|
||||
list = malloc(sizeof(alpm_list_t));
|
||||
if(list) {
|
||||
list->data = NULL;
|
||||
list->prev = NULL;
|
||||
list->prev = list; /* maintain a back reference to the tail pointer */
|
||||
list->next = NULL;
|
||||
}
|
||||
|
||||
return(list);
|
||||
}
|
||||
|
||||
/** Free a list, but not the contained data
|
||||
* @param list the list to free
|
||||
/**
|
||||
* @brief Free a list, but not the contained data.
|
||||
*
|
||||
* @param list the list to free
|
||||
*/
|
||||
void SYMEXPORT alpm_list_free(alpm_list_t *list)
|
||||
{
|
||||
@@ -64,9 +74,11 @@ void SYMEXPORT alpm_list_free(alpm_list_t *list)
|
||||
}
|
||||
}
|
||||
|
||||
/** Free the internal data of a list structure
|
||||
* @param list the list to free
|
||||
* @param fn a free function for the internal data
|
||||
/**
|
||||
* @brief Free the internal data of a list structure.
|
||||
*
|
||||
* @param list the list to free
|
||||
* @param fn a free function for the internal data
|
||||
*/
|
||||
void SYMEXPORT alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
|
||||
{
|
||||
@@ -83,10 +95,13 @@ void SYMEXPORT alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
|
||||
|
||||
/* Mutators */
|
||||
|
||||
/** Add a new item to the list
|
||||
* @param list the list to add to
|
||||
* @param data the new item to be added to the list
|
||||
* @return the resultant list, or NULL on failure
|
||||
/**
|
||||
* @brief Add a new item to the end of the list.
|
||||
*
|
||||
* @param list the list to add to
|
||||
* @param data the new item to be added to the list
|
||||
*
|
||||
* @return the resultant list
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
|
||||
{
|
||||
@@ -110,6 +125,7 @@ alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
|
||||
}
|
||||
lp->next->prev = lp;
|
||||
lp = lp->next;
|
||||
list->prev = lp;
|
||||
}
|
||||
|
||||
lp->data = data;
|
||||
@@ -117,13 +133,16 @@ alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
/** Add items to a list in sorted order.
|
||||
* @param list the list to add to
|
||||
* @param data the new item to be added to the list
|
||||
* @param fn the comparison function to use to determine order
|
||||
* @return the resultant list, or NULL on failure
|
||||
/**
|
||||
* @brief Add items to a list in sorted order.
|
||||
*
|
||||
* @param list the list to add to
|
||||
* @param data the new item to be added to the list
|
||||
* @param fn the comparison function to use to determine order
|
||||
*
|
||||
* @return the resultant list
|
||||
*/
|
||||
alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn)
|
||||
alpm_list_t SYMEXPORT *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn)
|
||||
{
|
||||
if(!fn) {
|
||||
return alpm_list_add(list, data);
|
||||
@@ -153,21 +172,63 @@ alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cm
|
||||
} else {
|
||||
list = add; /* At beginning, or new list */
|
||||
}
|
||||
|
||||
|
||||
if(next == NULL) {
|
||||
/* At end, adjust tail pointer on head node */
|
||||
list->prev = add;
|
||||
}
|
||||
|
||||
return(list);
|
||||
}
|
||||
}
|
||||
|
||||
/** Merge the two sorted sublists into one sorted list
|
||||
* @param left the first list
|
||||
* @param right the second list
|
||||
* @param fn comparison function for determining merge order
|
||||
/**
|
||||
* @brief Join two lists.
|
||||
* The two lists must be independent. Do not free the original lists after
|
||||
* calling this function, as this is not a copy operation. The list pointers
|
||||
* passed in should be considered invalid after calling this function.
|
||||
*
|
||||
* @param first the first list
|
||||
* @param second the second list
|
||||
*
|
||||
* @return the resultant joined list
|
||||
*/
|
||||
alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn)
|
||||
alpm_list_t SYMEXPORT *alpm_list_join(alpm_list_t *first, alpm_list_t *second)
|
||||
{
|
||||
alpm_list_t *tmp;
|
||||
|
||||
if (first == NULL) {
|
||||
return second;
|
||||
}
|
||||
if (second == NULL) {
|
||||
return first;
|
||||
}
|
||||
/* tmp is the last element of the first list */
|
||||
tmp = first->prev;
|
||||
/* link the first list to the second */
|
||||
tmp->next = second;
|
||||
/* link the second list to the first */
|
||||
first->prev = second->prev;
|
||||
/* set the back reference to the tail */
|
||||
second->prev = tmp;
|
||||
|
||||
return(first);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Merge the two sorted sublists into one sorted list.
|
||||
*
|
||||
* @param left the first list
|
||||
* @param right the second list
|
||||
* @param fn comparison function for determining merge order
|
||||
*
|
||||
* @return the resultant list
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn)
|
||||
{
|
||||
alpm_list_t *newlist, *lp;
|
||||
|
||||
if (left == NULL)
|
||||
if (left == NULL)
|
||||
return right;
|
||||
if (right == NULL)
|
||||
return left;
|
||||
@@ -189,7 +250,7 @@ alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_f
|
||||
lp->next = left;
|
||||
left->prev = lp;
|
||||
left = left->next;
|
||||
}
|
||||
}
|
||||
else {
|
||||
lp->next = right;
|
||||
right->prev = lp;
|
||||
@@ -206,22 +267,35 @@ alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_f
|
||||
lp->next = right;
|
||||
right->prev = lp;
|
||||
}
|
||||
|
||||
/* Find our tail pointer
|
||||
* TODO maintain this in the algorithm itself */
|
||||
lp = newlist;
|
||||
while(lp && lp->next) {
|
||||
lp = lp->next;
|
||||
}
|
||||
newlist->prev = lp;
|
||||
|
||||
return(newlist);
|
||||
}
|
||||
|
||||
/** Sort a list of size `n` using mergesort algorithm
|
||||
* @param list the list to sort
|
||||
* @param n the size of the list
|
||||
* @param fn the comparison function for determining order
|
||||
/**
|
||||
* @brief Sort a list of size `n` using mergesort algorithm.
|
||||
*
|
||||
* @param list the list to sort
|
||||
* @param n the size of the list
|
||||
* @param fn the comparison function for determining order
|
||||
*
|
||||
* @return the resultant list
|
||||
*/
|
||||
alpm_list_t* alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn)
|
||||
alpm_list_t SYMEXPORT *alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn)
|
||||
{
|
||||
if (n > 1) {
|
||||
alpm_list_t *left = list;
|
||||
alpm_list_t *lastleft = alpm_list_nth(list, n/2 - 1);
|
||||
alpm_list_t *right = lastleft->next;
|
||||
/* terminate first list */
|
||||
lastleft->next = NULL;
|
||||
lastleft->next = NULL;
|
||||
|
||||
left = alpm_list_msort(left, n/2, fn);
|
||||
right = alpm_list_msort(right, n - (n/2), fn);
|
||||
@@ -230,15 +304,18 @@ alpm_list_t* alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn)
|
||||
return(list);
|
||||
}
|
||||
|
||||
/** Remove an item from the list
|
||||
* @param haystack the list to remove the item from
|
||||
* @param needle the data member of the item we're removing
|
||||
* @param fn the comparison function for searching
|
||||
* @param data output parameter containing the data member of the item removed
|
||||
* @return the resultant list, or NULL on failure
|
||||
/**
|
||||
* @brief Remove an item from the list.
|
||||
*
|
||||
* @param haystack the list to remove the item from
|
||||
* @param needle the data member of the item we're removing
|
||||
* @param fn the comparison function for searching
|
||||
* @param data output parameter containing data of the removed item
|
||||
*
|
||||
* @return the resultant list
|
||||
*/
|
||||
alpm_list_t *alpm_list_remove(alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn, void **data)
|
||||
{ /* TODO I modified this to remove ALL matching items. Do we need a remove_first? */
|
||||
alpm_list_t SYMEXPORT *alpm_list_remove(alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn, void **data)
|
||||
{
|
||||
alpm_list_t *i = haystack, *tmp = NULL;
|
||||
|
||||
if(data) {
|
||||
@@ -252,16 +329,31 @@ alpm_list_t *alpm_list_remove(alpm_list_t *haystack, const void *needle, alpm_li
|
||||
tmp = i->next;
|
||||
if(fn(needle, i->data) == 0) {
|
||||
/* we found a matching item */
|
||||
if(i->next) {
|
||||
i->next->prev = i->prev;
|
||||
}
|
||||
if(i->prev) {
|
||||
i->prev->next = i->next;
|
||||
}
|
||||
|
||||
if(i == haystack) {
|
||||
/* The item found is the first in the chain */
|
||||
haystack = haystack->next;
|
||||
/* Special case: removing the head node which has a back reference to
|
||||
* the tail node */
|
||||
haystack = i->next;
|
||||
if(haystack) {
|
||||
haystack->prev = i->prev;
|
||||
}
|
||||
i->prev = NULL;
|
||||
} else if(i == haystack->prev) {
|
||||
/* Special case: removing the tail node, so we need to fix the back
|
||||
* reference on the head node. We also know tail != head. */
|
||||
if(i->prev) {
|
||||
/* i->next should always be null */
|
||||
i->prev->next = i->next;
|
||||
haystack->prev = i->prev;
|
||||
i->prev = NULL;
|
||||
}
|
||||
} else {
|
||||
/* Normal case, non-head and non-tail node */
|
||||
if(i->next) {
|
||||
i->next->prev = i->prev;
|
||||
}
|
||||
if(i->prev) {
|
||||
i->prev->next = i->next;
|
||||
}
|
||||
}
|
||||
|
||||
if(data) {
|
||||
@@ -269,48 +361,30 @@ alpm_list_t *alpm_list_remove(alpm_list_t *haystack, const void *needle, alpm_li
|
||||
}
|
||||
i->data = NULL;
|
||||
free(i);
|
||||
i = NULL;
|
||||
} else {
|
||||
i = tmp;
|
||||
}
|
||||
i = tmp;
|
||||
}
|
||||
|
||||
return(haystack);
|
||||
}
|
||||
|
||||
/** Remove the passed in node from the list that it is a part of
|
||||
* @note this DOES NOT free the node
|
||||
* @param node the list node we're removing
|
||||
* @return the node which took the place of this one
|
||||
/**
|
||||
* @brief Create a new list without any duplicates.
|
||||
*
|
||||
* This does NOT copy data members.
|
||||
*
|
||||
* @param list the list to copy
|
||||
*
|
||||
* @return a new list containing non-duplicate items
|
||||
*/
|
||||
alpm_list_t *alpm_list_remove_node(alpm_list_t *node)
|
||||
alpm_list_t SYMEXPORT *alpm_list_remove_dupes(const alpm_list_t *list)
|
||||
{
|
||||
if(!node) return(NULL);
|
||||
|
||||
alpm_list_t *ret = NULL;
|
||||
|
||||
if(node->prev) {
|
||||
node->prev->next = node->next;
|
||||
ret = node->prev;
|
||||
node->prev = NULL;
|
||||
}
|
||||
if(node->next) {
|
||||
node->next->prev = node->prev;
|
||||
ret = node->next;
|
||||
node->next = NULL;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/** Create a new list without any duplicates
|
||||
* @note DOES NOT copy data members
|
||||
* @param list the list to copy
|
||||
* @return a NEW list containing non-duplicated items
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_list_remove_dupes(alpm_list_t *list)
|
||||
{ /* TODO does removing the strdup here cause invalid free's anywhere? */
|
||||
alpm_list_t *lp = list, *newlist = NULL;
|
||||
const alpm_list_t *lp = list;
|
||||
alpm_list_t *newlist = NULL;
|
||||
while(lp) {
|
||||
if(!alpm_list_find(newlist, lp->data)) {
|
||||
if(!alpm_list_find_ptr(newlist, lp->data)) {
|
||||
newlist = alpm_list_add(newlist, lp->data);
|
||||
}
|
||||
lp = lp->next;
|
||||
@@ -318,14 +392,17 @@ alpm_list_t SYMEXPORT *alpm_list_remove_dupes(alpm_list_t *list)
|
||||
return(newlist);
|
||||
}
|
||||
|
||||
/** Copy a string list, including data
|
||||
* @note this is gross, assumes string data members
|
||||
* @param list the list to copy
|
||||
* @return a copy of the original list
|
||||
/**
|
||||
* @brief Copy a string list, including data.
|
||||
*
|
||||
* @param list the list to copy
|
||||
*
|
||||
* @return a copy of the original list
|
||||
*/
|
||||
alpm_list_t *alpm_list_strdup(alpm_list_t *list)
|
||||
alpm_list_t SYMEXPORT *alpm_list_strdup(const alpm_list_t *list)
|
||||
{
|
||||
alpm_list_t *lp = list, *newlist = NULL;
|
||||
const alpm_list_t *lp = list;
|
||||
alpm_list_t *newlist = NULL;
|
||||
while(lp) {
|
||||
newlist = alpm_list_add(newlist, strdup(lp->data));
|
||||
lp = lp->next;
|
||||
@@ -333,15 +410,68 @@ alpm_list_t *alpm_list_strdup(alpm_list_t *list)
|
||||
return(newlist);
|
||||
}
|
||||
|
||||
/** Create a new list in reverse order
|
||||
* @param list the list to copy
|
||||
* @return a NEW list in reverse order of the first
|
||||
/**
|
||||
* @brief Copy a list, without copying data.
|
||||
*
|
||||
* @param list the list to copy
|
||||
*
|
||||
* @return a copy of the original list
|
||||
*/
|
||||
alpm_list_t *alpm_list_reverse(alpm_list_t *list)
|
||||
{ /* TODO any invalid free's from NOT duplicating data here? */
|
||||
alpm_list_t *lp, *newlist = NULL;
|
||||
alpm_list_t SYMEXPORT *alpm_list_copy(const alpm_list_t *list)
|
||||
{
|
||||
const alpm_list_t *lp = list;
|
||||
alpm_list_t *newlist = NULL;
|
||||
while(lp) {
|
||||
newlist = alpm_list_add(newlist, lp->data);
|
||||
lp = lp->next;
|
||||
}
|
||||
return(newlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Copy a list and copy the data.
|
||||
* Note that the data elements to be copied should not contain pointers
|
||||
* and should also be of constant size.
|
||||
*
|
||||
* @param list the list to copy
|
||||
* @param size the size of each data element
|
||||
*
|
||||
* @return a copy of the original list, data copied as well
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_list_copy_data(const alpm_list_t *list,
|
||||
size_t size)
|
||||
{
|
||||
const alpm_list_t *lp = list;
|
||||
alpm_list_t *newlist = NULL;
|
||||
while(lp) {
|
||||
void *newdata = calloc(1, size);
|
||||
if(newdata) {
|
||||
memcpy(newdata, lp->data, size);
|
||||
newlist = alpm_list_add(newlist, newdata);
|
||||
lp = lp->next;
|
||||
}
|
||||
}
|
||||
return(newlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create a new list in reverse order.
|
||||
*
|
||||
* @param list the list to copy
|
||||
*
|
||||
* @return a new list in reverse order
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_list_reverse(alpm_list_t *list)
|
||||
{
|
||||
const alpm_list_t *lp;
|
||||
alpm_list_t *newlist = NULL;
|
||||
|
||||
lp = alpm_list_last(list);
|
||||
if(list) {
|
||||
/* break our reverse circular list */
|
||||
list->prev = NULL;
|
||||
}
|
||||
|
||||
while(lp) {
|
||||
newlist = alpm_list_add(newlist, lp->data);
|
||||
lp = lp->prev;
|
||||
@@ -351,65 +481,84 @@ alpm_list_t *alpm_list_reverse(alpm_list_t *list)
|
||||
|
||||
/* Accessors */
|
||||
|
||||
/** Get the first element of a list.
|
||||
/**
|
||||
* @brief Get the first element of a list.
|
||||
*
|
||||
* @param list the list
|
||||
*
|
||||
* @return the first element in the list
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_list_first(alpm_list_t *list)
|
||||
inline alpm_list_t SYMEXPORT *alpm_list_first(const alpm_list_t *list)
|
||||
{
|
||||
return(list);
|
||||
return((alpm_list_t*)list);
|
||||
}
|
||||
|
||||
/** Return nth element from list (starting with 0)
|
||||
* @param list the list to access
|
||||
* @param n the index of the item to find
|
||||
* @return an alpm_list_t node for index `n`
|
||||
/**
|
||||
* @brief Return nth element from list (starting from 0).
|
||||
*
|
||||
* @param list the list
|
||||
* @param n the index of the item to find
|
||||
*
|
||||
* @return an alpm_list_t node for index `n`
|
||||
*/
|
||||
alpm_list_t *alpm_list_nth(alpm_list_t *list, int n)
|
||||
alpm_list_t SYMEXPORT *alpm_list_nth(const alpm_list_t *list, int n)
|
||||
{
|
||||
alpm_list_t *i = list;
|
||||
const alpm_list_t *i = list;
|
||||
while(n--) {
|
||||
i = i->next;
|
||||
}
|
||||
return(i);
|
||||
return((alpm_list_t*)i);
|
||||
}
|
||||
|
||||
/** Get the next element of a list.
|
||||
* @param entry the list entry
|
||||
/**
|
||||
* @brief Get the next element of a list.
|
||||
*
|
||||
* @param node the list node
|
||||
*
|
||||
* @return the next element, or NULL when no more elements exist
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_list_next(alpm_list_t *entry)
|
||||
inline alpm_list_t SYMEXPORT *alpm_list_next(const alpm_list_t *node)
|
||||
{
|
||||
return(entry->next);
|
||||
}
|
||||
/** Get the last item in the list.
|
||||
* @param list the list to operate on
|
||||
* @return the last element in the list
|
||||
*/
|
||||
alpm_list_t *alpm_list_last(alpm_list_t *list)
|
||||
{
|
||||
alpm_list_t *i = list;
|
||||
while(i && i->next) {
|
||||
i = i->next;
|
||||
}
|
||||
return(i);
|
||||
return(node->next);
|
||||
}
|
||||
|
||||
/** Get the data member of a list entry.
|
||||
* @param entry the list entry
|
||||
/**
|
||||
* @brief Get the last item in the list.
|
||||
*
|
||||
* @param list the list
|
||||
*
|
||||
* @return the last element in the list
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_list_last(const alpm_list_t *list)
|
||||
{
|
||||
if(list) {
|
||||
return(list->prev);
|
||||
} else {
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the data member of a list node.
|
||||
*
|
||||
* @param node the list node
|
||||
*
|
||||
* @return the contained data, or NULL if none
|
||||
*/
|
||||
void SYMEXPORT *alpm_list_getdata(const alpm_list_t *entry)
|
||||
void SYMEXPORT *alpm_list_getdata(const alpm_list_t *node)
|
||||
{
|
||||
if(entry == NULL) return(NULL);
|
||||
return(entry->data);
|
||||
if(node == NULL) return(NULL);
|
||||
return(node->data);
|
||||
}
|
||||
|
||||
/* Misc */
|
||||
|
||||
/** Count the list items
|
||||
* @param list the list to operate on
|
||||
* @return the number of list items
|
||||
/**
|
||||
* @brief Get the number of items in a list.
|
||||
*
|
||||
* @param list the list
|
||||
*
|
||||
* @return the number of list items
|
||||
*/
|
||||
int SYMEXPORT alpm_list_count(const alpm_list_t *list)
|
||||
{
|
||||
@@ -422,53 +571,80 @@ int SYMEXPORT alpm_list_count(const alpm_list_t *list)
|
||||
return(i);
|
||||
}
|
||||
|
||||
/** Is an item in the list
|
||||
* @param needle the data to compare to (== comparison)
|
||||
* @param haystack the list to search
|
||||
* @return 1 if `needle` is found, 0 otherwise
|
||||
/**
|
||||
* @brief Find an item in a list.
|
||||
*
|
||||
* @param needle the item to search
|
||||
* @param haystack the list
|
||||
* @param fn the comparison function for searching (!= NULL)
|
||||
*
|
||||
* @return `needle` if found, NULL otherwise
|
||||
*/
|
||||
int SYMEXPORT alpm_list_find(alpm_list_t *haystack, const void *needle)
|
||||
void SYMEXPORT *alpm_list_find(const alpm_list_t *haystack, const void *needle,
|
||||
alpm_list_fn_cmp fn)
|
||||
{
|
||||
alpm_list_t *lp = haystack;
|
||||
const alpm_list_t *lp = haystack;
|
||||
while(lp) {
|
||||
if(lp->data == needle) {
|
||||
return(1);
|
||||
if(lp->data && fn(lp->data, needle) == 0) {
|
||||
return(lp->data);
|
||||
}
|
||||
lp = lp->next;
|
||||
}
|
||||
return(0);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* Test for existence of a string in a alpm_list_t
|
||||
*/
|
||||
/** Is a _string_ in the list (optimization of alpm_list_find for strings)
|
||||
* @param needle the string to compare
|
||||
* @param haystack the list to search
|
||||
* @return 1 if `needle` is found, 0 otherwise
|
||||
*/
|
||||
int SYMEXPORT alpm_list_find_str(alpm_list_t *haystack, const char *needle)
|
||||
/* trivial helper function for alpm_list_find_ptr */
|
||||
static int ptrcmp(const void *p, const void *q)
|
||||
{
|
||||
alpm_list_t *lp = haystack;
|
||||
while(lp) {
|
||||
if(lp->data && strcmp((const char *)lp->data, needle) == 0) {
|
||||
return(1);
|
||||
}
|
||||
lp = lp->next;
|
||||
}
|
||||
return(0);
|
||||
return(p != q);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the items in list `lhs` that are not present in list `rhs`
|
||||
* @note Entries are not duplicated
|
||||
/**
|
||||
* @brief Find an item in a list.
|
||||
*
|
||||
* Search for the item whos data matches that of the `needle`.
|
||||
*
|
||||
* @param needle the data to search for (== comparison)
|
||||
* @param haystack the list
|
||||
*
|
||||
* @return `needle` if found, NULL otherwise
|
||||
*/
|
||||
void SYMEXPORT *alpm_list_find_ptr(const alpm_list_t *haystack, const void *needle)
|
||||
{
|
||||
return(alpm_list_find(haystack, needle, ptrcmp));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Find a string in a list.
|
||||
*
|
||||
* @param needle the string to search for
|
||||
* @param haystack the list
|
||||
*
|
||||
* @return `needle` if found, NULL otherwise
|
||||
*/
|
||||
char SYMEXPORT *alpm_list_find_str(const alpm_list_t *haystack, const char *needle)
|
||||
{
|
||||
return((char *)alpm_list_find(haystack, (const void*)needle, (alpm_list_fn_cmp)strcmp));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Find the items in list `lhs` that are not present in list `rhs`.
|
||||
*
|
||||
* Entries are not duplicated. Operation is O(m*n). The first list is stepped
|
||||
* through one node at a time, and for each node in the first list, each node
|
||||
* in the second list is compared to it.
|
||||
*
|
||||
* @param lhs the first list
|
||||
* @param rhs the second list
|
||||
* @param fn the comparison function
|
||||
* @return a list containing all items in lhs not present in rhs
|
||||
* @param fn the comparison function
|
||||
*
|
||||
* @return a list containing all items in `lhs` not present in `rhs`
|
||||
*/
|
||||
alpm_list_t *alpm_list_diff(alpm_list_t *lhs, alpm_list_t *rhs, alpm_list_fn_cmp fn)
|
||||
alpm_list_t SYMEXPORT *alpm_list_diff(const alpm_list_t *lhs,
|
||||
const alpm_list_t *rhs, alpm_list_fn_cmp fn)
|
||||
{
|
||||
alpm_list_t *i, *j, *ret = NULL;
|
||||
const alpm_list_t *i, *j;
|
||||
alpm_list_t *ret = NULL;
|
||||
for(i = lhs; i; i = i->next) {
|
||||
int found = 0;
|
||||
for(j = rhs; j; j = j->next) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* alpm_alpm_list.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* alpm_list.h
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,26 +14,32 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_LIST_H
|
||||
#define _ALPM_LIST_H
|
||||
|
||||
#include "alpm.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Chained list struct */
|
||||
struct __alpm_list_t {
|
||||
/**
|
||||
* @brief Linked list type used by libalpm.
|
||||
*
|
||||
* It is exposed so front ends can use it to prevent the need to reimplement
|
||||
* lists of their own; however, it is not required that the front end uses
|
||||
* it.
|
||||
*/
|
||||
typedef struct __alpm_list_t {
|
||||
/** data held by the list node */
|
||||
void *data;
|
||||
/** pointer to the previous node */
|
||||
struct __alpm_list_t *prev;
|
||||
/** pointer to the next node */
|
||||
struct __alpm_list_t *next;
|
||||
};
|
||||
} alpm_list_t;
|
||||
|
||||
/* TODO we should do away with these... they're messy*/
|
||||
#define _FREELIST(p, f) do { alpm_list_free_inner(p, f); alpm_list_free(p); p = NULL; } while(0)
|
||||
#define FREELIST(p) _FREELIST(p, free)
|
||||
#define FREELISTPTR(p) do { alpm_list_free(p); p = NULL; } while(0)
|
||||
#define FREELIST(p) do { alpm_list_free_inner(p, free); alpm_list_free(p); p = NULL; } while(0)
|
||||
|
||||
typedef void (*alpm_list_fn_free)(void *); /* item deallocation callback */
|
||||
typedef int (*alpm_list_fn_cmp)(const void *, const void *); /* item comparison callback */
|
||||
@@ -46,27 +52,33 @@ void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn);
|
||||
/* item mutators */
|
||||
alpm_list_t *alpm_list_add(alpm_list_t *list, void *data);
|
||||
alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn);
|
||||
alpm_list_t *alpm_list_join(alpm_list_t *first, alpm_list_t *second);
|
||||
alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn);
|
||||
alpm_list_t *alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn);
|
||||
alpm_list_t *alpm_list_remove(alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn, void **data);
|
||||
alpm_list_t *alpm_list_remove_node(alpm_list_t *node);
|
||||
alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_strdup(alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_remove_dupes(const alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_strdup(const alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_copy(const alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_copy_data(const alpm_list_t *list, size_t size);
|
||||
alpm_list_t *alpm_list_reverse(alpm_list_t *list);
|
||||
|
||||
/* item accessors */
|
||||
alpm_list_t *alpm_list_first(alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_nth(alpm_list_t *list, int n);
|
||||
alpm_list_t *alpm_list_next(alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_last(alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_first(const alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_nth(const alpm_list_t *list, int n);
|
||||
alpm_list_t *alpm_list_next(const alpm_list_t *list);
|
||||
alpm_list_t *alpm_list_last(const alpm_list_t *list);
|
||||
void *alpm_list_getdata(const alpm_list_t *entry);
|
||||
|
||||
/* misc */
|
||||
int alpm_list_count(const alpm_list_t *list);
|
||||
int alpm_list_find(alpm_list_t *haystack, const void *needle);
|
||||
int alpm_list_find_str(alpm_list_t *haystack,const char *needle);
|
||||
alpm_list_t *alpm_list_diff(alpm_list_t *lhs, alpm_list_t *rhs, alpm_list_fn_cmp fn);
|
||||
void *alpm_list_find(const alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn);
|
||||
void *alpm_list_find_ptr(const alpm_list_t *haystack, const void *needle);
|
||||
char *alpm_list_find_str(const alpm_list_t *haystack, const char *needle);
|
||||
alpm_list_t *alpm_list_diff(const alpm_list_t *lhs, const alpm_list_t *rhs, alpm_list_fn_cmp fn);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _ALPM_LIST_H */
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* backup.c
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2005 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -17,9 +17,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -33,12 +31,53 @@
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
/* Look for a filename in a pmpkg_t.backup list. If we find it,
|
||||
* then we return the md5 or sha1 hash (parsed from the same line)
|
||||
*/
|
||||
char *_alpm_needbackup(const char *file, alpm_list_t *backup)
|
||||
/* split a backup string "file\thash" into two strings : file and hash */
|
||||
int _alpm_backup_split(const char *string, char **file, char **hash)
|
||||
{
|
||||
alpm_list_t *lp;
|
||||
char *str = strdup(string);
|
||||
char *ptr;
|
||||
|
||||
/* tab delimiter */
|
||||
ptr = strchr(str, '\t');
|
||||
if(ptr == NULL) {
|
||||
if(file) {
|
||||
*file = str;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
*ptr = '\0';
|
||||
ptr++;
|
||||
/* now str points to the filename and ptr points to the hash */
|
||||
if(file) {
|
||||
*file = strdup(str);
|
||||
}
|
||||
if(hash) {
|
||||
*hash = strdup(ptr);
|
||||
}
|
||||
FREE(str);
|
||||
return(1);
|
||||
}
|
||||
|
||||
char *_alpm_backup_file(const char *string)
|
||||
{
|
||||
char *file = NULL;
|
||||
_alpm_backup_split(string, &file, NULL);
|
||||
return(file);
|
||||
}
|
||||
|
||||
char *_alpm_backup_hash(const char *string)
|
||||
{
|
||||
char *hash = NULL;
|
||||
_alpm_backup_split(string, NULL, &hash);
|
||||
return(hash);
|
||||
}
|
||||
|
||||
/* Look for a filename in a pmpkg_t.backup list. If we find it,
|
||||
* then we return the md5 hash (parsed from the same line)
|
||||
*/
|
||||
char *_alpm_needbackup(const char *file, const alpm_list_t *backup)
|
||||
{
|
||||
const alpm_list_t *lp;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
@@ -46,26 +85,22 @@ char *_alpm_needbackup(const char *file, alpm_list_t *backup)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* run through the backup list and parse out the md5 or sha1 hash for our file */
|
||||
/* run through the backup list and parse out the hash for our file */
|
||||
for(lp = backup; lp; lp = lp->next) {
|
||||
char *str = strdup(lp->data);
|
||||
char *ptr;
|
||||
|
||||
/* tab delimiter */
|
||||
ptr = strchr(str, '\t');
|
||||
if(ptr == NULL) {
|
||||
FREE(str);
|
||||
char *filename = NULL;
|
||||
char *hash = NULL;
|
||||
|
||||
/* no hash found */
|
||||
if(!_alpm_backup_split((char *)lp->data, &filename, &hash)) {
|
||||
FREE(filename);
|
||||
continue;
|
||||
}
|
||||
*ptr = '\0';
|
||||
ptr++;
|
||||
/* now str points to the filename and ptr points to the md5 or sha1 hash */
|
||||
if(strcmp(file, str) == 0) {
|
||||
char *hash = strdup(ptr);
|
||||
FREE(str);
|
||||
if(strcmp(file, filename) == 0) {
|
||||
FREE(filename);
|
||||
return(hash);
|
||||
}
|
||||
FREE(str);
|
||||
FREE(filename);
|
||||
FREE(hash);
|
||||
}
|
||||
|
||||
return(NULL);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* backup.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,16 +14,16 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_BACKUP_H
|
||||
#define _ALPM_BACKUP_H
|
||||
|
||||
#include "alpm_list.h"
|
||||
|
||||
char *_alpm_needbackup(const char *file, alpm_list_t *backup);
|
||||
char *_alpm_backup_file(const char *string);
|
||||
char *_alpm_backup_hash(const char *string);
|
||||
char *_alpm_needbackup(const char *file, const alpm_list_t *backup);
|
||||
|
||||
#endif /* _ALPM_BACKUP_H */
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* be_files.c
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2006 by Christian Hamar <krics@linuxforum.hu>
|
||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -15,9 +15,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -27,16 +25,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#ifdef __sun__
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#include <stdint.h> /* uintmax_t */
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <libintl.h>
|
||||
#include <locale.h>
|
||||
#ifdef CYGWIN
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <limits.h> /* PATH_MAX */
|
||||
#endif
|
||||
#include <locale.h> /* setlocale */
|
||||
|
||||
/* libalpm */
|
||||
#include "db.h"
|
||||
@@ -47,6 +42,8 @@
|
||||
#include "error.h"
|
||||
#include "handle.h"
|
||||
#include "package.h"
|
||||
#include "delta.h"
|
||||
#include "deps.h"
|
||||
|
||||
|
||||
/* This function is used to convert the downloaded db file to the proper backend
|
||||
@@ -56,9 +53,9 @@ int _alpm_db_install(pmdb_t *db, const char *dbfile)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* TODO we should not simply unpack the archive, but better parse it and
|
||||
/* TODO we should not simply unpack the archive, but better parse it and
|
||||
* db_write each entry (see sync_load_dbarchive to get archive content) */
|
||||
_alpm_log(PM_LOG_DEBUG, _("unpacking database '%s'"), dbfile);
|
||||
_alpm_log(PM_LOG_DEBUG, "unpacking database '%s'\n", dbfile);
|
||||
|
||||
if(_alpm_unpack(dbfile, db->path, NULL)) {
|
||||
RET_ERR(PM_ERR_SYSTEM, -1);
|
||||
@@ -75,7 +72,7 @@ int _alpm_db_open(pmdb_t *db)
|
||||
RET_ERR(PM_ERR_DB_NULL, -1);
|
||||
}
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, _("opening database from path '%s'"), db->path);
|
||||
_alpm_log(PM_LOG_DEBUG, "opening database from path '%s'\n", db->path);
|
||||
db->handle = opendir(db->path);
|
||||
if(db->handle == NULL) {
|
||||
RET_ERR(PM_ERR_DB_OPEN, -1);
|
||||
@@ -109,6 +106,43 @@ void _alpm_db_rewind(pmdb_t *db)
|
||||
rewinddir(db->handle);
|
||||
}
|
||||
|
||||
static int _alpm_db_splitname(const char *target, char *name, char *version)
|
||||
{
|
||||
/* the format of a db entry is as follows:
|
||||
* package-version-rel/
|
||||
* package name can contain hyphens, so parse from the back- go back
|
||||
* two hyphens and we have split the version from the name.
|
||||
*/
|
||||
char *tmp, *p, *q;
|
||||
|
||||
if(target == NULL) {
|
||||
return(-1);
|
||||
}
|
||||
tmp = strdup(target);
|
||||
p = tmp + strlen(tmp);
|
||||
|
||||
/* do the magic parsing- find the beginning of the version string
|
||||
* by doing two iterations of same loop to lop off two hyphens */
|
||||
for(q = --p; *q && *q != '-'; q--);
|
||||
for(p = --q; *p && *p != '-'; p--);
|
||||
if(*p != '-' || p == tmp) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* copy into fields and return */
|
||||
if(version) {
|
||||
strncpy(version, p+1, PKG_VERSION_LEN);
|
||||
}
|
||||
/* insert a terminator at the end of the name (on hyphen)- then copy it */
|
||||
*p = '\0';
|
||||
if(name) {
|
||||
strncpy(name, tmp, PKG_NAME_LEN);
|
||||
}
|
||||
|
||||
free(tmp);
|
||||
return(0);
|
||||
}
|
||||
|
||||
pmpkg_t *_alpm_db_scan(pmdb_t *db, const char *target)
|
||||
{
|
||||
struct dirent *ent = NULL;
|
||||
@@ -142,7 +176,7 @@ pmpkg_t *_alpm_db_scan(pmdb_t *db, const char *target)
|
||||
if(stat(path, &sbuf) || !S_ISDIR(sbuf.st_mode)) {
|
||||
continue;
|
||||
}
|
||||
STRNCPY(name, ent->d_name, PKG_FULLNAME_LEN);
|
||||
strncpy(name, ent->d_name, PKG_FULLNAME_LEN);
|
||||
/* truncate the string at the second-to-last hyphen, */
|
||||
/* which will give us the package name */
|
||||
if((ptr = rindex(name, '-'))) {
|
||||
@@ -179,21 +213,25 @@ pmpkg_t *_alpm_db_scan(pmdb_t *db, const char *target)
|
||||
|
||||
pkg = _alpm_pkg_new(NULL, NULL);
|
||||
if(pkg == NULL) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("db scan could not find package: %s"), target);
|
||||
_alpm_log(PM_LOG_DEBUG, "db scan could not find package: %s\n", target);
|
||||
return(NULL);
|
||||
}
|
||||
if(_alpm_pkg_splitname(ent->d_name, pkg->name, pkg->version, 0) == -1) {
|
||||
_alpm_log(PM_LOG_ERROR, _("invalid name for database entry '%s'"), ent->d_name);
|
||||
return(NULL);
|
||||
/* split the db entry name */
|
||||
if(_alpm_db_splitname(ent->d_name, pkg->name, pkg->version) != 0) {
|
||||
_alpm_log(PM_LOG_ERROR, _("invalid name for database entry '%s'\n"),
|
||||
ent->d_name);
|
||||
alpm_pkg_free(pkg);
|
||||
pkg = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* explicitly read with only 'BASE' data, accessors will handle the rest */
|
||||
if(_alpm_db_read(db, pkg, INFRQ_BASE) == -1) {
|
||||
/* TODO removed corrupt entry from the FS here */
|
||||
FREEPKG(pkg);
|
||||
_alpm_pkg_free(pkg);
|
||||
} else {
|
||||
pkg->data = db;
|
||||
pkg->origin = PKG_FROM_CACHE;
|
||||
pkg->origin_data.db = db;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,10 +244,6 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
struct stat buf;
|
||||
char path[PATH_MAX+1];
|
||||
char line[513];
|
||||
/*
|
||||
alpm_list_t *tmplist;
|
||||
char *locale;
|
||||
*/
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
@@ -218,12 +252,12 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
}
|
||||
|
||||
if(info == NULL || info->name[0] == 0 || info->version[0] == 0) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("invalid package entry provided to _alpm_db_read, skipping"));
|
||||
_alpm_log(PM_LOG_DEBUG, "invalid package entry provided to _alpm_db_read, skipping\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if(info->origin == PKG_FROM_FILE) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("request to read database info for a file-based package '%s', skipping..."), info->name);
|
||||
_alpm_log(PM_LOG_DEBUG, "request to read database info for a file-based package '%s', skipping...\n", info->name);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -236,7 +270,8 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
/* already loaded this info, do nothing */
|
||||
return(0);
|
||||
}
|
||||
_alpm_log(PM_LOG_FUNCTION, _("loading package data for %s : level=%d"), info->name, inforeq);
|
||||
_alpm_log(PM_LOG_FUNCTION, "loading package data for %s : level=0x%x\n",
|
||||
info->name, inforeq);
|
||||
|
||||
/* clear out 'line', to be certain - and to make valgrind happy */
|
||||
memset(line, 0, 513);
|
||||
@@ -244,7 +279,8 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
snprintf(path, PATH_MAX, "%s/%s-%s", db->path, info->name, info->version);
|
||||
if(stat(path, &buf)) {
|
||||
/* directory doesn't exist or can't be opened */
|
||||
_alpm_log(PM_LOG_DEBUG, _("cannot find '%s-%s' in db '%s'"), info->name, info->version, db->treename);
|
||||
_alpm_log(PM_LOG_DEBUG, "cannot find '%s-%s' in db '%s'\n",
|
||||
info->name, info->version, db->treename);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -252,7 +288,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
if(inforeq & INFRQ_DESC) {
|
||||
snprintf(path, PATH_MAX, "%s/%s-%s/desc", db->path, info->name, info->version);
|
||||
if((fp = fopen(path, "r")) == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
while(!feof(fp)) {
|
||||
@@ -261,10 +297,6 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
}
|
||||
_alpm_strtrim(line);
|
||||
if(!strcmp(line, "%FILENAME%")) {
|
||||
/* filename is _new_ - it provides the real name of the package, on the
|
||||
* server, to allow for us to not tie the name of the actual file to the
|
||||
* data of the package
|
||||
*/
|
||||
if(fgets(info->filename, sizeof(info->filename), fp) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
@@ -273,32 +305,6 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
if(fgets(info->desc, sizeof(info->desc), fp) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
/*
|
||||
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
|
||||
info->desc_localized = alpm_list_add(info->desc_localized, strdup(line));
|
||||
PKG_
|
||||
}
|
||||
|
||||
if((locale = setlocale(LC_ALL, "")) == NULL) { //To fix segfault when locale invalid
|
||||
setenv("LC_ALL", "C", 1);
|
||||
locale = setlocale(LC_ALL, "");
|
||||
}
|
||||
|
||||
if(info->desc_localized && !info->desc_localized->next) {
|
||||
snprintf(info->desc, 512, "%s", (char*)info->desc_localized->data);
|
||||
} else {
|
||||
for (tmplist = info->desc_localized; tmplist; tmplist = tmplist->next) {
|
||||
if (tmplist->data && strncmp(tmplist->data, locale, strlen(locale))) {
|
||||
strncpy(info->desc, (char *)info->desc_localized->data, sizeof(info->desc));
|
||||
} else {
|
||||
char *p = (char *)tmplist->data;
|
||||
p += strlen(locale) + 1;
|
||||
strncpy(info->desc, p, sizeof(info->desc));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
_alpm_strtrim(info->desc);
|
||||
} else if(!strcmp(line, "%GROUPS%")) {
|
||||
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
|
||||
@@ -319,20 +325,39 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
}
|
||||
_alpm_strtrim(info->arch);
|
||||
} else if(!strcmp(line, "%BUILDDATE%")) {
|
||||
if(fgets(info->builddate, sizeof(info->builddate), fp) == NULL) {
|
||||
char tmp[32];
|
||||
if(fgets(tmp, sizeof(tmp), fp) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
_alpm_strtrim(info->builddate);
|
||||
} else if(!strcmp(line, "%BUILDTYPE%")) {
|
||||
if(fgets(info->buildtype, sizeof(info->buildtype), fp) == NULL) {
|
||||
goto error;
|
||||
_alpm_strtrim(tmp);
|
||||
|
||||
char first = tolower(tmp[0]);
|
||||
if(first > 'a' && first < 'z') {
|
||||
struct tm tmp_tm = {0}; //initialize to null incase of failure
|
||||
setlocale(LC_TIME, "C");
|
||||
strptime(tmp, "%a %b %e %H:%M:%S %Y", &tmp_tm);
|
||||
info->builddate = mktime(&tmp_tm);
|
||||
setlocale(LC_TIME, "");
|
||||
} else {
|
||||
info->builddate = atol(tmp);
|
||||
}
|
||||
_alpm_strtrim(info->buildtype);
|
||||
} else if(!strcmp(line, "%INSTALLDATE%")) {
|
||||
if(fgets(info->installdate, sizeof(info->installdate), fp) == NULL) {
|
||||
char tmp[32];
|
||||
if(fgets(tmp, sizeof(tmp), fp) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
_alpm_strtrim(info->installdate);
|
||||
_alpm_strtrim(tmp);
|
||||
|
||||
char first = tolower(tmp[0]);
|
||||
if(first > 'a' && first < 'z') {
|
||||
struct tm tmp_tm = {0}; //initialize to null incase of failure
|
||||
setlocale(LC_TIME, "C");
|
||||
strptime(tmp, "%a %b %e %H:%M:%S %Y", &tmp_tm);
|
||||
info->installdate = mktime(&tmp_tm);
|
||||
setlocale(LC_TIME, "");
|
||||
} else {
|
||||
info->installdate = atol(tmp);
|
||||
}
|
||||
} else if(!strcmp(line, "%PACKAGER%")) {
|
||||
if(fgets(info->packager, sizeof(info->packager), fp) == NULL) {
|
||||
goto error;
|
||||
@@ -357,6 +382,10 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
}
|
||||
_alpm_strtrim(tmp);
|
||||
info->size = atol(tmp);
|
||||
/* also store this value to isize if isize is unset */
|
||||
if(info->isize == 0) {
|
||||
info->isize = atol(tmp);
|
||||
}
|
||||
} else if(!strcmp(line, "%ISIZE%")) {
|
||||
/* ISIZE (installed size) tag only appears in sync repositories,
|
||||
* not the local one. */
|
||||
@@ -366,12 +395,6 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
}
|
||||
_alpm_strtrim(tmp);
|
||||
info->isize = atol(tmp);
|
||||
} else if(!strcmp(line, "%SHA1SUM%")) {
|
||||
/* SHA1SUM tag only appears in sync repositories,
|
||||
* not the local one. */
|
||||
if(fgets(info->sha1sum, sizeof(info->sha1sum), fp) == NULL) {
|
||||
goto error;
|
||||
}
|
||||
} else if(!strcmp(line, "%MD5SUM%")) {
|
||||
/* MD5SUM tag only appears in sync repositories,
|
||||
* not the local one. */
|
||||
@@ -398,7 +421,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
if(inforeq & INFRQ_FILES) {
|
||||
snprintf(path, PATH_MAX, "%s/%s-%s/files", db->path, info->name, info->version);
|
||||
if((fp = fopen(path, "r")) == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
while(fgets(line, 256, fp)) {
|
||||
@@ -421,7 +444,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
if(inforeq & INFRQ_DEPENDS) {
|
||||
snprintf(path, PATH_MAX, "%s/%s-%s/depends", db->path, info->name, info->version);
|
||||
if((fp = fopen(path, "r")) == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
while(!feof(fp)) {
|
||||
@@ -429,11 +452,12 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
_alpm_strtrim(line);
|
||||
if(!strcmp(line, "%DEPENDS%")) {
|
||||
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
|
||||
info->depends = alpm_list_add(info->depends, strdup(line));
|
||||
pmdepend_t *dep = alpm_splitdep(line);
|
||||
info->depends = alpm_list_add(info->depends, dep);
|
||||
}
|
||||
} else if(!strcmp(line, "%REQUIREDBY%")) {
|
||||
} else if(!strcmp(line, "%OPTDEPENDS%")) {
|
||||
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
|
||||
info->requiredby = alpm_list_add(info->requiredby, strdup(line));
|
||||
info->optdepends = alpm_list_add(info->optdepends, strdup(line));
|
||||
}
|
||||
} else if(!strcmp(line, "%CONFLICTS%")) {
|
||||
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
|
||||
@@ -451,7 +475,7 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
* not the local one. *
|
||||
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
|
||||
info->replaces = alpm_list_add(info->replaces, strdup(line));
|
||||
}
|
||||
}
|
||||
} else if(!strcmp(line, "%FORCE%")) {
|
||||
* FORCE tag only appears in sync repositories,
|
||||
* not the local one. *
|
||||
@@ -462,6 +486,24 @@ int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
fp = NULL;
|
||||
}
|
||||
|
||||
/* DELTAS */
|
||||
if(inforeq & INFRQ_DELTAS) {
|
||||
snprintf(path, PATH_MAX, "%s/%s-%s/deltas", db->path, info->name, info->version);
|
||||
if((fp = fopen(path, "r"))) {
|
||||
while(!feof(fp)) {
|
||||
fgets(line, 255, fp);
|
||||
_alpm_strtrim(line);
|
||||
if(!strcmp(line, "%DELTAS%")) {
|
||||
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
|
||||
info->deltas = alpm_list_add(info->deltas, _alpm_delta_parse(line));
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* INSTALL */
|
||||
if(inforeq & INFRQ_SCRIPTLET) {
|
||||
snprintf(path, PATH_MAX, "%s/%s-%s/install", db->path, info->name, info->version);
|
||||
@@ -509,22 +551,17 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
|
||||
/* DESC */
|
||||
if(inforeq & INFRQ_DESC) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("writing %s-%s DESC information back to db"), info->name, info->version);
|
||||
_alpm_log(PM_LOG_DEBUG, "writing %s-%s DESC information back to db\n",
|
||||
info->name, info->version);
|
||||
snprintf(path, PATH_MAX, "%s/%s-%s/desc", db->path, info->name, info->version);
|
||||
if((fp = fopen(path, "w")) == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
|
||||
retval = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
fprintf(fp, "%%NAME%%\n%s\n\n"
|
||||
"%%VERSION%%\n%s\n\n", info->name, info->version);
|
||||
if(info->desc[0]) {
|
||||
/*fputs("%DESC%\n", fp);
|
||||
for(lp = info->desc_localized; lp; lp = lp->next) {
|
||||
fprintf(fp, "%s\n", (char *)lp->data);
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
*/
|
||||
fprintf(fp, "%%DESC%%\n"
|
||||
"%s\n\n", info->desc);
|
||||
}
|
||||
@@ -551,17 +588,13 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
fprintf(fp, "%%ARCH%%\n"
|
||||
"%s\n\n", info->arch);
|
||||
}
|
||||
if(info->builddate[0]) {
|
||||
if(info->builddate) {
|
||||
fprintf(fp, "%%BUILDDATE%%\n"
|
||||
"%s\n\n", info->builddate);
|
||||
"%ju\n\n", (uintmax_t)info->builddate);
|
||||
}
|
||||
if(info->buildtype[0]) {
|
||||
fprintf(fp, "%%BUILDTYPE%%\n"
|
||||
"%s\n\n", info->buildtype);
|
||||
}
|
||||
if(info->installdate[0]) {
|
||||
if(info->installdate) {
|
||||
fprintf(fp, "%%INSTALLDATE%%\n"
|
||||
"%s\n\n", info->installdate);
|
||||
"%ju\n\n", (uintmax_t)info->installdate);
|
||||
}
|
||||
if(info->packager[0]) {
|
||||
fprintf(fp, "%%PACKAGER%%\n"
|
||||
@@ -585,10 +618,7 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
fprintf(fp, "%%ISIZE%%\n"
|
||||
"%lu\n\n", info->isize);
|
||||
}
|
||||
if(info->sha1sum) {
|
||||
fprintf(fp, "%%SHA1SUM%%\n"
|
||||
"%s\n\n", info->sha1sum);
|
||||
} else if(info->md5sum) {
|
||||
if(info->md5sum) {
|
||||
fprintf(fp, "%%MD5SUM%%\n"
|
||||
"%s\n\n", info->md5sum);
|
||||
}
|
||||
@@ -599,10 +629,11 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
|
||||
/* FILES */
|
||||
if(local && (inforeq & INFRQ_FILES)) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("writing %s-%s FILES information back to db"), info->name, info->version);
|
||||
_alpm_log(PM_LOG_DEBUG, "writing %s-%s FILES information back to db\n",
|
||||
info->name, info->version);
|
||||
snprintf(path, PATH_MAX, "%s/%s-%s/files", db->path, info->name, info->version);
|
||||
if((fp = fopen(path, "w")) == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
|
||||
retval = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -626,23 +657,26 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
|
||||
|
||||
/* DEPENDS */
|
||||
if(inforeq & INFRQ_DEPENDS) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("writing %s-%s DEPENDS information back to db"), info->name, info->version);
|
||||
_alpm_log(PM_LOG_DEBUG, "writing %s-%s DEPENDS information back to db\n",
|
||||
info->name, info->version);
|
||||
snprintf(path, PATH_MAX, "%s/%s-%s/depends", db->path, info->name, info->version);
|
||||
if((fp = fopen(path, "w")) == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s"), path, strerror(errno));
|
||||
_alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
|
||||
retval = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
if(info->depends) {
|
||||
fputs("%DEPENDS%\n", fp);
|
||||
for(lp = info->depends; lp; lp = lp->next) {
|
||||
fprintf(fp, "%s\n", (char *)lp->data);
|
||||
char *depstring = alpm_dep_get_string(lp->data);
|
||||
fprintf(fp, "%s\n", depstring);
|
||||
free(depstring);
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
if(local && info->requiredby) {
|
||||
fputs("%REQUIREDBY%\n", fp);
|
||||
for(lp = info->requiredby; lp; lp = lp->next) {
|
||||
if(info->optdepends) {
|
||||
fputs("%OPTDEPENDS%\n", fp);
|
||||
for(lp = info->optdepends; lp; lp = lp->next) {
|
||||
fprintf(fp, "%s\n", (char *)lp->data);
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
@@ -709,67 +743,63 @@ int _alpm_db_remove(pmdb_t *db, pmpkg_t *info)
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* reads dbpath/.lastupdate and populates *ts with the contents.
|
||||
* *ts should be malloc'ed and should be at least 15 bytes.
|
||||
*
|
||||
* Returns 0 on success, 1 on error
|
||||
*
|
||||
/*
|
||||
* Return the last update time as number of seconds from the epoch.
|
||||
* Returns 0 if the value is unknown or can't be read.
|
||||
*/
|
||||
int _alpm_db_getlastupdate(pmdb_t *db, char *ts)
|
||||
time_t _alpm_db_getlastupdate(const pmdb_t *db)
|
||||
{
|
||||
FILE *fp;
|
||||
char file[PATH_MAX];
|
||||
time_t ret = 0;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
if(db == NULL || ts == NULL) {
|
||||
return(-1);
|
||||
if(db == NULL) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
snprintf(file, PATH_MAX, "%s%s.lastupdate", handle->root, db->path);
|
||||
snprintf(file, PATH_MAX, "%s.lastupdate", db->path);
|
||||
|
||||
/* get the last update time, if it's there */
|
||||
if((fp = fopen(file, "r")) == NULL) {
|
||||
return(-1);
|
||||
return(ret);
|
||||
} else {
|
||||
char line[256];
|
||||
char line[64];
|
||||
if(fgets(line, sizeof(line), fp)) {
|
||||
STRNCPY(ts, line, 15); /* YYYYMMDDHHMMSS */
|
||||
ts[14] = '\0';
|
||||
} else {
|
||||
fclose(fp);
|
||||
return(-1);
|
||||
ret = atol(line);
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
return(0);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* writes the dbpath/.lastupdate with the contents of *ts
|
||||
/*
|
||||
* writes the dbpath/.lastupdate file with the value in time
|
||||
*/
|
||||
int _alpm_db_setlastupdate(pmdb_t *db, char *ts)
|
||||
int _alpm_db_setlastupdate(const pmdb_t *db, time_t time)
|
||||
{
|
||||
FILE *fp;
|
||||
char file[PATH_MAX];
|
||||
int ret = 0;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
if(db == NULL || ts == NULL || strlen(ts) == 0) {
|
||||
if(db == NULL || time == 0) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
snprintf(file, PATH_MAX, "%s%s.lastupdate", handle->root, db->path);
|
||||
snprintf(file, PATH_MAX, "%s.lastupdate", db->path);
|
||||
|
||||
if((fp = fopen(file, "w")) == NULL) {
|
||||
return(-1);
|
||||
}
|
||||
if(fputs(ts, fp) <= 0) {
|
||||
fclose(fp);
|
||||
return(-1);
|
||||
if(fprintf(fp, "%ju", (uintmax_t)time) <= 0) {
|
||||
ret = -1;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
return(0);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* cache.c
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,9 +14,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -26,8 +24,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <libintl.h>
|
||||
|
||||
/* libalpm */
|
||||
#include "cache.h"
|
||||
@@ -56,15 +52,15 @@ int _alpm_db_load_pkgcache(pmdb_t *db)
|
||||
|
||||
_alpm_db_free_pkgcache(db);
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, _("loading package cache for repository '%s'"),
|
||||
_alpm_log(PM_LOG_DEBUG, "loading package cache for repository '%s'\n",
|
||||
db->treename);
|
||||
|
||||
_alpm_db_rewind(db);
|
||||
while((info = _alpm_db_scan(db, NULL)) != NULL) {
|
||||
_alpm_log(PM_LOG_FUNCTION, _("adding '%s' to package cache for db '%s'"),
|
||||
_alpm_log(PM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
|
||||
alpm_pkg_get_name(info), db->treename);
|
||||
info->origin = PKG_FROM_CACHE;
|
||||
info->data = db;
|
||||
info->origin_data.db = db;
|
||||
/* add to the collection */
|
||||
db->pkgcache = alpm_list_add(db->pkgcache, info);
|
||||
count++;
|
||||
@@ -82,10 +78,15 @@ void _alpm_db_free_pkgcache(pmdb_t *db)
|
||||
return;
|
||||
}
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, _("freeing package cache for repository '%s'"),
|
||||
_alpm_log(PM_LOG_DEBUG, "freeing package cache for repository '%s'\n",
|
||||
db->treename);
|
||||
|
||||
FREELISTPKGS(db->pkgcache);
|
||||
alpm_list_t *tmp;
|
||||
for(tmp = db->pkgcache; tmp; tmp = alpm_list_next(tmp)) {
|
||||
_alpm_pkg_free(tmp->data);
|
||||
}
|
||||
alpm_list_free(db->pkgcache);
|
||||
db->pkgcache = NULL;
|
||||
|
||||
if(db->grpcache) {
|
||||
_alpm_db_free_grpcache(db);
|
||||
@@ -106,7 +107,7 @@ alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db)
|
||||
|
||||
/* hmmm, still NULL ?*/
|
||||
if(!db->pkgcache) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("error: pkgcache is NULL for db '%s'"), db->treename);
|
||||
_alpm_log(PM_LOG_DEBUG, "error: pkgcache is NULL for db '%s'\n", db->treename);
|
||||
}
|
||||
|
||||
return(db->pkgcache);
|
||||
@@ -126,7 +127,7 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
|
||||
if(newpkg == NULL) {
|
||||
return(-1);
|
||||
}
|
||||
_alpm_log(PM_LOG_DEBUG, _("adding entry '%s' in '%s' cache"),
|
||||
_alpm_log(PM_LOG_DEBUG, "adding entry '%s' in '%s' cache\n",
|
||||
alpm_pkg_get_name(newpkg), db->treename);
|
||||
db->pkgcache = alpm_list_add_sorted(db->pkgcache, newpkg, _alpm_pkg_cmp);
|
||||
|
||||
@@ -146,19 +147,19 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg)
|
||||
return(-1);
|
||||
}
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, _("removing entry '%s' from '%s' cache"),
|
||||
_alpm_log(PM_LOG_DEBUG, "removing entry '%s' from '%s' cache\n",
|
||||
alpm_pkg_get_name(pkg), db->treename);
|
||||
|
||||
db->pkgcache = alpm_list_remove(db->pkgcache, pkg, _alpm_pkg_cmp, &vdata);
|
||||
data = vdata;
|
||||
if(data == NULL) {
|
||||
/* package not found */
|
||||
_alpm_log(PM_LOG_DEBUG, _("cannot remove entry '%s' from '%s' cache: not found"),
|
||||
_alpm_log(PM_LOG_DEBUG, "cannot remove entry '%s' from '%s' cache: not found\n",
|
||||
alpm_pkg_get_name(pkg), db->treename);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
FREEPKG(data);
|
||||
_alpm_pkg_free(data);
|
||||
|
||||
_alpm_db_free_grpcache(db);
|
||||
|
||||
@@ -175,7 +176,8 @@ pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target)
|
||||
|
||||
alpm_list_t *pkgcache = _alpm_db_get_pkgcache(db);
|
||||
if(!pkgcache) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("error: failed to get '%s' from NULL pkgcache"), target);
|
||||
_alpm_log(PM_LOG_DEBUG, "error: failed to get '%s' from NULL pkgcache\n",
|
||||
target);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -198,10 +200,11 @@ int _alpm_db_load_grpcache(pmdb_t *db)
|
||||
_alpm_db_load_pkgcache(db);
|
||||
}
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, _("loading group cache for repository '%s'"), db->treename);
|
||||
_alpm_log(PM_LOG_DEBUG, "loading group cache for repository '%s'\n",
|
||||
db->treename);
|
||||
|
||||
for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) {
|
||||
alpm_list_t *i;
|
||||
const alpm_list_t *i;
|
||||
pmpkg_t *pkg = lp->data;
|
||||
|
||||
for(i = alpm_pkg_get_groups(pkg); i; i = i->next) {
|
||||
@@ -251,8 +254,10 @@ void _alpm_db_free_grpcache(pmdb_t *db)
|
||||
for(lg = db->grpcache; lg; lg = lg->next) {
|
||||
pmgrp_t *grp = lg->data;
|
||||
|
||||
FREELISTPTR(grp->packages);
|
||||
FREEGRP(lg->data);
|
||||
alpm_list_free(grp->packages);
|
||||
grp->packages = NULL;
|
||||
_alpm_grp_free(lg->data);
|
||||
lg->data = NULL;
|
||||
}
|
||||
FREELIST(db->grpcache);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* cache.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,9 +14,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_CACHE_H
|
||||
#define _ALPM_CACHE_H
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* conflict.c
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
* Copyright (c) 2006 by Christian Hamar <krics@linuxforum.hu>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -18,9 +18,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -30,11 +28,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#if defined(__APPLE__) || defined(__OpenBSD__)
|
||||
#include <sys/syslimits.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <libintl.h>
|
||||
|
||||
/* libalpm */
|
||||
#include "conflict.h"
|
||||
@@ -47,191 +41,145 @@
|
||||
#include "cache.h"
|
||||
#include "deps.h"
|
||||
|
||||
pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2)
|
||||
{
|
||||
pmconflict_t *conflict;
|
||||
|
||||
/** See if potential conflict 'name' matches package 'pkg'.
|
||||
* @param target the name of the parent package we're checking
|
||||
* @param depname the name of the dependency we're checking
|
||||
* @param pkg the package to check
|
||||
* @param conflict the name of the possible conflict
|
||||
* @return A depmissing struct indicating the conflict
|
||||
* @note The first two paramters are here to simplify the addition
|
||||
* of new 'depmiss' objects.
|
||||
*
|
||||
* TODO WTF is a 'depmissing' doing indicating a conflict??
|
||||
*/
|
||||
static pmdepmissing_t *does_conflict(const char *target, const char *depname,
|
||||
pmpkg_t *pkg, const char *conflict)
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
MALLOC(conflict, sizeof(pmconflict_t), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||
|
||||
strncpy(conflict->package1, package1, PKG_NAME_LEN);
|
||||
strncpy(conflict->package2, package2, PKG_NAME_LEN);
|
||||
|
||||
return(conflict);
|
||||
}
|
||||
|
||||
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack)
|
||||
{
|
||||
alpm_list_t *i;
|
||||
|
||||
/* check the actual package name, easy */
|
||||
if(strcmp(alpm_pkg_get_name(pkg), conflict) == 0) {
|
||||
_alpm_log(PM_LOG_DEBUG, _(" found conflict '%s' : package '%s'"), conflict, target);
|
||||
return(_alpm_depmiss_new(target, PM_DEP_TYPE_CONFLICT,
|
||||
PM_DEP_MOD_ANY, depname, NULL));
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
for(i = haystack; i; i = i->next) {
|
||||
pmconflict_t *conflict = i->data;
|
||||
char *cpkg1 = conflict->package1;
|
||||
char *cpkg2 = conflict->package2;
|
||||
char *npkg1 = needle->package1;
|
||||
char *npkg2 = needle->package2;
|
||||
if((!strcmp(cpkg1, npkg1) && !strcmp(cpkg2, npkg2))
|
||||
|| (!strcmp(cpkg1, npkg2) && !strcmp(cpkg2, npkg1))) {
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/** Check if pkg1 conflicts with pkg2
|
||||
* @param pkg1 package we are looking at
|
||||
* @param conflict name of the possible conflict
|
||||
* @param pkg2 package to check
|
||||
* @return 0 for no conflict, non-zero otherwise
|
||||
*/
|
||||
static int does_conflict(pmpkg_t *pkg1, const char *conflict, pmpkg_t *pkg2)
|
||||
{
|
||||
const char *pkg1name = alpm_pkg_get_name(pkg1);
|
||||
const char *pkg2name = alpm_pkg_get_name(pkg2);
|
||||
pmdepend_t *conf = alpm_splitdep(conflict);
|
||||
int match = 0;
|
||||
|
||||
match = alpm_depcmp(pkg2, conf);
|
||||
if(match) {
|
||||
_alpm_log(PM_LOG_DEBUG, "package %s conflicts with %s (by %s)\n",
|
||||
pkg1name, pkg2name, conflict);
|
||||
}
|
||||
FREE(conf);
|
||||
return(match);
|
||||
}
|
||||
|
||||
/** Adds the pkg1/pkg2 conflict to the baddeps list
|
||||
* @param *baddeps list to add conflict to
|
||||
* @param pkg1 first package
|
||||
* @param pkg2 package causing conflict
|
||||
*/
|
||||
static void add_conflict(alpm_list_t **baddeps, const char *pkg1,
|
||||
const char *pkg2)
|
||||
{
|
||||
pmconflict_t *conflict = _alpm_conflict_new(pkg1, pkg2);
|
||||
if(conflict && !_alpm_conflict_isin(conflict, *baddeps)) {
|
||||
*baddeps = alpm_list_add(*baddeps, conflict);
|
||||
} else {
|
||||
/* check what this package provides, harder */
|
||||
for(i = alpm_pkg_get_provides(pkg); i; i = i->next) {
|
||||
const char *provision = i->data;
|
||||
|
||||
if(strcmp(provision, conflict) == 0) {
|
||||
_alpm_log(PM_LOG_DEBUG, _(" found conflict '%s' : package '%s' provides '%s'"),
|
||||
conflict, target, provision);
|
||||
return(_alpm_depmiss_new(target, PM_DEP_TYPE_CONFLICT,
|
||||
PM_DEP_MOD_ANY, depname, NULL));
|
||||
}
|
||||
}
|
||||
FREE(conflict);
|
||||
}
|
||||
return(NULL); /* not a conflict */
|
||||
}
|
||||
|
||||
static alpm_list_t *chk_pkg_vs_db(alpm_list_t *baddeps, pmpkg_t *pkg, pmdb_t *db)
|
||||
{
|
||||
pmdepmissing_t *miss = NULL;
|
||||
const char *pkgname;
|
||||
alpm_list_t *i, *j;
|
||||
/** Check if packages from list1 conflict with packages from list2.
|
||||
* This looks at the conflicts fields of all packages from list1, and sees
|
||||
* if they match packages from list2.
|
||||
* If a conflict (pkg1, pkg2) is found, it is added to the baddeps list
|
||||
* in this order if order >= 0, or reverse order (pkg2,pkg1) otherwise.
|
||||
*
|
||||
* @param list1 first list of packages
|
||||
* @param list2 second list of packages
|
||||
* @param *baddeps list to store conflicts
|
||||
* @param order if >= 0 the conflict order is preserved, if < 0 it's reversed
|
||||
*/
|
||||
static void check_conflict(alpm_list_t *list1, alpm_list_t *list2,
|
||||
alpm_list_t **baddeps, int order) {
|
||||
alpm_list_t *i, *j, *k;
|
||||
|
||||
pkgname = alpm_pkg_get_name(pkg);
|
||||
|
||||
for(i = alpm_pkg_get_conflicts(pkg); i; i = i->next) {
|
||||
const char *conflict = i->data;
|
||||
|
||||
if(strcmp(pkgname, conflict) == 0) {
|
||||
/* a package cannot conflict with itself -- that's just not nice */
|
||||
_alpm_log(PM_LOG_DEBUG, _("package '%s' conflicts with itself - packaging error"),
|
||||
pkgname);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* CHECK 1: check targets against database */
|
||||
_alpm_log(PM_LOG_DEBUG, _("checkconflicts: target '%s' vs db"), pkgname);
|
||||
|
||||
for(j = _alpm_db_get_pkgcache(db); j; j = j->next) {
|
||||
pmpkg_t *dbpkg = j->data;
|
||||
|
||||
if(strcmp(alpm_pkg_get_name(dbpkg), pkgname) == 0) {
|
||||
/* skip the package we're currently processing */
|
||||
continue;
|
||||
}
|
||||
|
||||
miss = does_conflict(pkgname, alpm_pkg_get_name(dbpkg), dbpkg, conflict);
|
||||
if(miss && !_alpm_depmiss_isin(miss, baddeps)) {
|
||||
baddeps = alpm_list_add(baddeps, miss);
|
||||
} else {
|
||||
FREE(miss);
|
||||
}
|
||||
}
|
||||
if(!baddeps) {
|
||||
return;
|
||||
}
|
||||
return(baddeps);
|
||||
}
|
||||
for(i = list1; i; i = i->next) {
|
||||
pmpkg_t *pkg1 = i->data;
|
||||
const char *pkg1name = alpm_pkg_get_name(pkg1);
|
||||
|
||||
static alpm_list_t *chk_pkg_vs_targets(alpm_list_t *baddeps,
|
||||
pmpkg_t *pkg, pmdb_t *db,
|
||||
alpm_list_t *targets)
|
||||
{
|
||||
pmdepmissing_t *miss = NULL;
|
||||
const char *pkgname;
|
||||
alpm_list_t *i, *j;
|
||||
|
||||
pkgname = alpm_pkg_get_name(pkg);
|
||||
|
||||
for(i = alpm_pkg_get_conflicts(pkg); i; i = i->next) {
|
||||
const char *conflict = i->data;
|
||||
|
||||
if(strcmp(pkgname, conflict) == 0) {
|
||||
/* a package cannot conflict with itself -- that's just not nice */
|
||||
_alpm_log(PM_LOG_DEBUG, _("package '%s' conflicts with itself - packaging error"),
|
||||
pkgname);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* CHECK 2: check targets against targets */
|
||||
_alpm_log(PM_LOG_DEBUG, _("checkconflicts: target '%s' vs all targets"), pkgname);
|
||||
|
||||
for(j = targets; j; j = j->next) {
|
||||
const char *targetname;
|
||||
pmpkg_t *target = j->data;
|
||||
targetname = alpm_pkg_get_name(target);
|
||||
|
||||
if(strcmp(targetname, pkgname) == 0) {
|
||||
/* skip the package we're currently processing */
|
||||
continue;
|
||||
}
|
||||
|
||||
miss = does_conflict(pkgname, targetname, target, conflict);
|
||||
if(miss && !_alpm_depmiss_isin(miss, baddeps)) {
|
||||
baddeps = alpm_list_add(baddeps, miss);
|
||||
} else {
|
||||
FREE(miss);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(baddeps);
|
||||
}
|
||||
|
||||
static alpm_list_t *chk_db_vs_targets(alpm_list_t *baddeps, pmpkg_t *pkg,
|
||||
pmdb_t *db, alpm_list_t *targets)
|
||||
{
|
||||
pmdepmissing_t *miss = NULL;
|
||||
const char *pkgname;
|
||||
alpm_list_t *i, *j;
|
||||
|
||||
pkgname = alpm_pkg_get_name(pkg);
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, _("checkconflicts: db vs target '%s'"), pkgname);
|
||||
|
||||
for(i = _alpm_db_get_pkgcache(db); i; i = i->next) {
|
||||
alpm_list_t *conflicts = NULL;
|
||||
const char *dbpkgname;
|
||||
|
||||
pmpkg_t *dbpkg = i->data;
|
||||
dbpkgname = alpm_pkg_get_name(dbpkg);
|
||||
|
||||
if(strcmp(dbpkgname, pkgname) == 0) {
|
||||
/* skip the package we're currently processing */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* is this db package in the targets? if so use the
|
||||
* new package's conflict list to pick up new changes */
|
||||
int use_newconflicts = 0;
|
||||
for(j = targets; j; j = j->next) {
|
||||
pmpkg_t *targ = j->data;
|
||||
if(strcmp(alpm_pkg_get_name(targ), dbpkgname) == 0) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("target '%s' is also in target list, using NEW conflicts"),
|
||||
dbpkgname);
|
||||
conflicts = alpm_pkg_get_conflicts(targ);
|
||||
use_newconflicts = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* if we didn't find newer conflicts, use the original list */
|
||||
if(!use_newconflicts) {
|
||||
conflicts = alpm_pkg_get_conflicts(dbpkg);
|
||||
}
|
||||
|
||||
for(j = conflicts; j; j = j->next) {
|
||||
for(j = alpm_pkg_get_conflicts(pkg1); j; j = j->next) {
|
||||
const char *conflict = j->data;
|
||||
|
||||
for(k = list2; k; k = k->next) {
|
||||
pmpkg_t *pkg2 = k->data;
|
||||
const char *pkg2name = alpm_pkg_get_name(pkg2);
|
||||
|
||||
miss = does_conflict(pkgname, dbpkgname, pkg, conflict);
|
||||
if(miss && !_alpm_depmiss_isin(miss, baddeps)) {
|
||||
baddeps = alpm_list_add(baddeps, miss);
|
||||
} else {
|
||||
FREE(miss);
|
||||
if(strcmp(pkg1name, pkg2name) == 0) {
|
||||
/* skip the package we're currently processing */
|
||||
continue;
|
||||
}
|
||||
|
||||
if(does_conflict(pkg1, conflict, pkg2)) {
|
||||
if(order >= 0) {
|
||||
add_conflict(baddeps, pkg1name, pkg2name);
|
||||
} else {
|
||||
add_conflict(baddeps, pkg2name, pkg1name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for inter-conflicts */
|
||||
alpm_list_t *_alpm_innerconflicts(alpm_list_t *packages)
|
||||
{
|
||||
alpm_list_t *baddeps = NULL;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, "check targets vs targets\n");
|
||||
check_conflict(packages, packages, &baddeps, 0);
|
||||
|
||||
return(baddeps);
|
||||
}
|
||||
|
||||
/* Returns a alpm_list_t* of pmdepmissing_t pointers.
|
||||
*
|
||||
* conflicts are always name only
|
||||
/* Check for target vs (db - target) conflicts
|
||||
* In case of conflict the package1 field of pmdepconflict_t contains
|
||||
* the target package, package2 field contains the local package
|
||||
*/
|
||||
alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages)
|
||||
alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages)
|
||||
{
|
||||
alpm_list_t *i, *baddeps = NULL;
|
||||
alpm_list_t *baddeps = NULL;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
@@ -239,27 +187,23 @@ alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
for(i = packages; i; i = i->next) {
|
||||
pmpkg_t *pkg = i->data;
|
||||
if(pkg == NULL) {
|
||||
continue;
|
||||
}
|
||||
alpm_list_t *dblist = alpm_list_diff(_alpm_db_get_pkgcache(db), packages,
|
||||
_alpm_pkg_cmp);
|
||||
|
||||
/* run three different conflict checks on each package */
|
||||
baddeps = chk_pkg_vs_db(baddeps, pkg, db);
|
||||
baddeps = chk_pkg_vs_targets(baddeps, pkg, db, packages);
|
||||
baddeps = chk_db_vs_targets(baddeps, pkg, db, packages);
|
||||
}
|
||||
|
||||
/* debug loop */
|
||||
for(i = baddeps; i; i = i->next) {
|
||||
pmdepmissing_t *miss = i->data;
|
||||
_alpm_log(PM_LOG_DEBUG, _("\tCONFLICTS:: %s conflicts with %s"), miss->target, miss->depend.name);
|
||||
}
|
||||
/* two checks to be done here for conflicts */
|
||||
_alpm_log(PM_LOG_DEBUG, "check targets vs db\n");
|
||||
check_conflict(packages, dblist, &baddeps, 1);
|
||||
_alpm_log(PM_LOG_DEBUG, "check db vs targets\n");
|
||||
check_conflict(dblist, packages, &baddeps, -1);
|
||||
|
||||
alpm_list_free(dblist);
|
||||
return(baddeps);
|
||||
}
|
||||
|
||||
/* Check for transaction conflicts */
|
||||
alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages) {
|
||||
return(alpm_list_join(_alpm_innerconflicts(packages), _alpm_outerconflicts(db, packages)));
|
||||
}
|
||||
|
||||
/* Returns a alpm_list_t* of file conflicts.
|
||||
* Hooray for set-intersects!
|
||||
@@ -307,6 +251,7 @@ static alpm_list_t *chk_filedifference(alpm_list_t *filesA, alpm_list_t *filesB)
|
||||
alpm_list_t *ret = NULL;
|
||||
alpm_list_t *pA = filesA, *pB = filesB;
|
||||
|
||||
/* if both filesA and filesB have entries, do this loop */
|
||||
while(pA && pB) {
|
||||
const char *strA = pA->data;
|
||||
const char *strB = pB->data;
|
||||
@@ -331,36 +276,42 @@ static alpm_list_t *chk_filedifference(alpm_list_t *filesA, alpm_list_t *filesB)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* ensure we have completely emptied pA */
|
||||
while(pA) {
|
||||
const char *strA = pA->data;
|
||||
/* skip directories */
|
||||
if(strA[strlen(strA)-1] != '/') {
|
||||
ret = alpm_list_add(ret, strdup(strA));
|
||||
}
|
||||
pA = pA->next;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* Adds pmconflict_t to a conflicts list. Pass the conflicts list, type (either
|
||||
* PM_CONFLICT_TYPE_TARGET or PM_CONFLICT_TYPE_FILE), a file string, and either
|
||||
/* Adds pmfileconflict_t to a conflicts list. Pass the conflicts list, type (either
|
||||
* PM_FILECONFLICT_TARGET or PM_FILECONFLICT_FILESYSTEM), a file string, and either
|
||||
* two package names or one package name and NULL. This is a wrapper for former
|
||||
* functionality that was done inline.
|
||||
*/
|
||||
static alpm_list_t *add_fileconflict(alpm_list_t *conflicts,
|
||||
pmconflicttype_t type, const char *filestr,
|
||||
pmfileconflicttype_t type, const char *filestr,
|
||||
const char* name1, const char* name2)
|
||||
{
|
||||
pmconflict_t *conflict = malloc(sizeof(pmconflict_t));
|
||||
if(conflict == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"),
|
||||
sizeof(pmconflict_t));
|
||||
return(conflicts);
|
||||
}
|
||||
pmfileconflict_t *conflict;
|
||||
MALLOC(conflict, sizeof(pmfileconflict_t), return(conflicts));
|
||||
|
||||
conflict->type = type;
|
||||
STRNCPY(conflict->target, name1, PKG_NAME_LEN);
|
||||
STRNCPY(conflict->file, filestr, CONFLICT_FILE_LEN);
|
||||
strncpy(conflict->target, name1, PKG_NAME_LEN);
|
||||
strncpy(conflict->file, filestr, CONFLICT_FILE_LEN);
|
||||
if(name2) {
|
||||
STRNCPY(conflict->ctarget, name2, PKG_NAME_LEN);
|
||||
strncpy(conflict->ctarget, name2, PKG_NAME_LEN);
|
||||
} else {
|
||||
conflict->ctarget[0] = '\0';
|
||||
}
|
||||
|
||||
conflicts = alpm_list_add(conflicts, conflict);
|
||||
_alpm_log(PM_LOG_DEBUG, "found file conflict %s, packages %s and %s",
|
||||
_alpm_log(PM_LOG_DEBUG, "found file conflict %s, packages %s and %s\n",
|
||||
filestr, name1, name2 ? name2 : "(filesystem)");
|
||||
|
||||
return(conflicts);
|
||||
@@ -369,11 +320,12 @@ static alpm_list_t *add_fileconflict(alpm_list_t *conflicts,
|
||||
/* Find file conflicts that may occur during the transaction with two checks:
|
||||
* 1: check every target against every target
|
||||
* 2: check every target against the filesystem */
|
||||
alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
||||
alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
||||
{
|
||||
alpm_list_t *i, *conflicts = NULL;
|
||||
alpm_list_t *targets = trans->packages;
|
||||
int numtargs = alpm_list_count(targets);
|
||||
int current;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
@@ -381,7 +333,11 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
for(i = targets; i; i = i->next) {
|
||||
/* TODO this whole function needs a huge change, which hopefully will
|
||||
* be possible with real transactions. Right now we only do half as much
|
||||
* here as we do when we actually extract files in add.c with our 12
|
||||
* different cases. */
|
||||
for(current = 1, i = targets; i; i = i->next, current++) {
|
||||
alpm_list_t *j, *k, *tmpfiles = NULL;
|
||||
pmpkg_t *p1, *p2, *dbpkg;
|
||||
char path[PATH_MAX+1];
|
||||
@@ -391,37 +347,35 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
||||
continue;
|
||||
}
|
||||
|
||||
double percent = (double)(alpm_list_count(targets) - alpm_list_count(i) + 1)
|
||||
/ alpm_list_count(targets);
|
||||
double percent = (double)current / numtargs;
|
||||
PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", (percent * 100),
|
||||
numtargs, (numtargs - alpm_list_count(i) +1));
|
||||
numtargs, current);
|
||||
/* CHECK 1: check every target against every target */
|
||||
for(j = i->next; j; j = j->next) {
|
||||
p2 = j->data;
|
||||
if(!p2) {
|
||||
continue;
|
||||
}
|
||||
_alpm_log(PM_LOG_DEBUG, "searching for file conflicts: %s and %s",
|
||||
_alpm_log(PM_LOG_DEBUG, "searching for file conflicts: %s and %s\n",
|
||||
alpm_pkg_get_name(p1), alpm_pkg_get_name(p2));
|
||||
tmpfiles = chk_fileconflicts(alpm_pkg_get_files(p1), alpm_pkg_get_files(p2));
|
||||
|
||||
if(tmpfiles) {
|
||||
for(k = tmpfiles; k; k = k->next) {
|
||||
snprintf(path, PATH_MAX, "%s%s", root, (char *)k->data);
|
||||
conflicts = add_fileconflict(conflicts, PM_CONFLICT_TYPE_TARGET, path,
|
||||
alpm_pkg_get_name(p1), alpm_pkg_get_name(p2));
|
||||
conflicts = add_fileconflict(conflicts, PM_FILECONFLICT_TARGET, path,
|
||||
alpm_pkg_get_name(p1), alpm_pkg_get_name(p2));
|
||||
}
|
||||
alpm_list_free_inner(tmpfiles, &free);
|
||||
alpm_list_free(tmpfiles);
|
||||
FREELIST(tmpfiles);
|
||||
}
|
||||
}
|
||||
|
||||
/* declarations for second check */
|
||||
struct stat buf;
|
||||
struct stat lsbuf, sbuf;
|
||||
char *filestr = NULL;
|
||||
|
||||
/* CHECK 2: check every target against the filesystem */
|
||||
_alpm_log(PM_LOG_DEBUG, "searching for filesystem conflicts: %s", p1->name);
|
||||
_alpm_log(PM_LOG_DEBUG, "searching for filesystem conflicts: %s\n", p1->name);
|
||||
dbpkg = _alpm_db_get_pkgfromcache(db, p1->name);
|
||||
|
||||
/* Do two different checks here. f the package is currently installed,
|
||||
@@ -429,7 +383,8 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
||||
* is not currently installed, then simply stat the whole filelist */
|
||||
if(dbpkg) {
|
||||
/* older ver of package currently installed */
|
||||
tmpfiles = chk_filedifference(alpm_pkg_get_files(p1), alpm_pkg_get_files(dbpkg));
|
||||
tmpfiles = chk_filedifference(alpm_pkg_get_files(p1),
|
||||
alpm_pkg_get_files(dbpkg));
|
||||
} else {
|
||||
/* no version of package currently installed */
|
||||
tmpfiles = alpm_list_strdup(alpm_pkg_get_files(p1));
|
||||
@@ -437,26 +392,42 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
||||
|
||||
/* loop over each file to be installed */
|
||||
for(j = tmpfiles; j; j = j->next) {
|
||||
int skip_conflict = 0;
|
||||
filestr = j->data;
|
||||
|
||||
snprintf(path, PATH_MAX, "%s%s", root, filestr);
|
||||
|
||||
/* stat the file - if it exists and is not a dir, do some checks */
|
||||
if(lstat(path, &buf) == 0 && !S_ISDIR(buf.st_mode)) {
|
||||
_alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s", path);
|
||||
/* stat the file - if it exists, do some checks */
|
||||
if(_alpm_lstat(path, &lsbuf) != 0) {
|
||||
continue;
|
||||
}
|
||||
stat(path, &sbuf);
|
||||
|
||||
if(path[strlen(path)-1] == '/') {
|
||||
if(S_ISDIR(lsbuf.st_mode)) {
|
||||
_alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict\n", path);
|
||||
skip_conflict = 1;
|
||||
} else if(S_ISLNK(lsbuf.st_mode) && S_ISDIR(sbuf.st_mode)) {
|
||||
_alpm_log(PM_LOG_DEBUG,
|
||||
"%s is a symlink to a dir, hopefully not a conflict\n", path);
|
||||
skip_conflict = 1;
|
||||
}
|
||||
}
|
||||
if(!skip_conflict) {
|
||||
_alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s\n", path);
|
||||
|
||||
/* Make sure the possible conflict is not a symlink that points to a
|
||||
* path in the old package. This is kind of dirty with inode usage */
|
||||
/* TODO this seems ripe for a cleanup */
|
||||
if(dbpkg) {
|
||||
struct stat buf2;
|
||||
struct stat pkgbuf;
|
||||
char str[PATH_MAX+1];
|
||||
unsigned ok = 0;
|
||||
for(k = dbpkg->files; k; k = k->next) {
|
||||
snprintf(str, PATH_MAX, "%s%s", root, (char*)k->data);
|
||||
lstat(str, &buf2);
|
||||
if(buf.st_ino == buf2.st_ino) {
|
||||
if(!_alpm_lstat(str, &pkgbuf) && lsbuf.st_ino == pkgbuf.st_ino) {
|
||||
ok = 1;
|
||||
_alpm_log(PM_LOG_DEBUG, "conflict was a symlink: %s", path);
|
||||
_alpm_log(PM_LOG_DEBUG, "conflict was a symlink: %s\n", path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -482,42 +453,51 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
||||
|
||||
if(localp2 && !alpm_list_find_str(pkgfiles, filestr)
|
||||
&& alpm_list_find_str(localfiles, filestr)) {
|
||||
/* check if the file is now in the backup array */
|
||||
if(alpm_list_find_str(alpm_pkg_get_backup(p1), filestr)) {
|
||||
/* keep file intact if it is in backup array */
|
||||
trans->skip_add = alpm_list_add(trans->skip_add, strdup(path));
|
||||
trans->skip_remove = alpm_list_add(trans->skip_remove, strdup(path));
|
||||
_alpm_log(PM_LOG_DEBUG, "file in backup array, adding to add and remove skiplist: %s", filestr);
|
||||
resolved_conflict = 1;
|
||||
break;
|
||||
} else {
|
||||
/* skip removal of file, but not add. this will prevent a second
|
||||
* package from removing the file when it was already installed
|
||||
* by its new owner */
|
||||
trans->skip_remove = alpm_list_add(trans->skip_remove, strdup(path));
|
||||
_alpm_log(PM_LOG_DEBUG, "file changed packages, adding to remove skiplist: %s", filestr);
|
||||
resolved_conflict = 1;
|
||||
break;
|
||||
}
|
||||
/* skip removal of file, but not add. this will prevent a second
|
||||
* package from removing the file when it was already installed
|
||||
* by its new owner (whether the file is in backup array or not */
|
||||
trans->skip_remove = alpm_list_add(trans->skip_remove, strdup(path));
|
||||
_alpm_log(PM_LOG_DEBUG, "file changed packages, adding to remove skiplist: %s\n", filestr);
|
||||
resolved_conflict = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!resolved_conflict) {
|
||||
_alpm_log(PM_LOG_DEBUG, "file found in conflict: %s", path);
|
||||
conflicts = add_fileconflict(conflicts, PM_CONFLICT_TYPE_FILE,
|
||||
path, p1->name, NULL);
|
||||
_alpm_log(PM_LOG_DEBUG, "file found in conflict: %s\n", path);
|
||||
conflicts = add_fileconflict(conflicts, PM_FILECONFLICT_FILESYSTEM,
|
||||
path, p1->name, NULL);
|
||||
}
|
||||
} else {
|
||||
_alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path);
|
||||
}
|
||||
}
|
||||
alpm_list_free_inner(tmpfiles, &free);
|
||||
alpm_list_free(tmpfiles);
|
||||
FREELIST(tmpfiles);
|
||||
}
|
||||
|
||||
return(conflicts);
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_conflict_get_target(pmconflict_t *conflict)
|
||||
const char SYMEXPORT *alpm_conflict_get_package1(pmconflict_t *conflict)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(conflict != NULL, return(NULL));
|
||||
|
||||
return conflict->package1;
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_conflict_get_package2(pmconflict_t *conflict)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(conflict != NULL, return(NULL));
|
||||
|
||||
return conflict->package2;
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_fileconflict_get_target(pmfileconflict_t *conflict)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
@@ -528,7 +508,7 @@ const char SYMEXPORT *alpm_conflict_get_target(pmconflict_t *conflict)
|
||||
return conflict->target;
|
||||
}
|
||||
|
||||
pmconflicttype_t SYMEXPORT alpm_conflict_get_type(pmconflict_t *conflict)
|
||||
pmfileconflicttype_t SYMEXPORT alpm_fileconflict_get_type(pmfileconflict_t *conflict)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
@@ -539,7 +519,7 @@ pmconflicttype_t SYMEXPORT alpm_conflict_get_type(pmconflict_t *conflict)
|
||||
return conflict->type;
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_conflict_get_file(pmconflict_t *conflict)
|
||||
const char SYMEXPORT *alpm_fileconflict_get_file(pmfileconflict_t *conflict)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
@@ -550,7 +530,7 @@ const char SYMEXPORT *alpm_conflict_get_file(pmconflict_t *conflict)
|
||||
return conflict->file;
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_conflict_get_ctarget(pmconflict_t *conflict)
|
||||
const char SYMEXPORT *alpm_fileconflict_get_ctarget(pmfileconflict_t *conflict)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* conflict.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,9 +14,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_CONFLICT_H
|
||||
#define _ALPM_CONFLICT_H
|
||||
@@ -28,14 +26,23 @@
|
||||
#define CONFLICT_FILE_LEN 512
|
||||
|
||||
struct __pmconflict_t {
|
||||
char package1[PKG_NAME_LEN];
|
||||
char package2[PKG_NAME_LEN];
|
||||
};
|
||||
|
||||
struct __pmfileconflict_t {
|
||||
char target[PKG_NAME_LEN];
|
||||
pmconflicttype_t type;
|
||||
pmfileconflicttype_t type;
|
||||
char file[CONFLICT_FILE_LEN];
|
||||
char ctarget[PKG_NAME_LEN];
|
||||
};
|
||||
|
||||
pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2);
|
||||
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack);
|
||||
alpm_list_t *_alpm_innerconflicts(alpm_list_t *packages);
|
||||
alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages);
|
||||
alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages);
|
||||
alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root);
|
||||
alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, char *root);
|
||||
|
||||
#endif /* _ALPM_CONFLICT_H */
|
||||
|
||||
|
||||
602
lib/libalpm/db.c
602
lib/libalpm/db.c
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* db.c
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
||||
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -18,9 +18,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -30,17 +28,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h> /* uintmax_t */
|
||||
#include <sys/stat.h>
|
||||
#if defined(__APPLE__) || defined(__OpenBSD__)
|
||||
#include <sys/syslimits.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#include <dirent.h>
|
||||
#include <libintl.h>
|
||||
#include <regex.h>
|
||||
#ifdef CYGWIN
|
||||
#include <limits.h> /* PATH_MAX */
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
/* libalpm */
|
||||
#include "db.h"
|
||||
@@ -53,38 +45,425 @@
|
||||
#include "cache.h"
|
||||
#include "alpm.h"
|
||||
|
||||
pmdb_t *_alpm_db_new(const char *root, const char *dbpath, const char *treename)
|
||||
/** \addtogroup alpm_databases Database Functions
|
||||
* @brief Functions to query and manipulate the database of libalpm
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Register a sync database of packages.
|
||||
* @param treename the name of the sync repository
|
||||
* @return a pmdb_t* on success (the value), NULL on error
|
||||
*/
|
||||
pmdb_t SYMEXPORT *alpm_db_register_sync(const char *treename)
|
||||
{
|
||||
pmdb_t *db;
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, NULL));
|
||||
ASSERT(treename != NULL && strlen(treename) != 0, RET_ERR(PM_ERR_WRONG_ARGS, NULL));
|
||||
/* Do not register a database if a transaction is on-going */
|
||||
ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, NULL));
|
||||
|
||||
return(_alpm_db_register_sync(treename));
|
||||
}
|
||||
|
||||
/** Register the local package database.
|
||||
* @return a pmdb_t* representing the local database, or NULL on error
|
||||
*/
|
||||
pmdb_t SYMEXPORT *alpm_db_register_local(void)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, NULL));
|
||||
/* Do not register a database if a transaction is on-going */
|
||||
ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, NULL));
|
||||
|
||||
return(_alpm_db_register_local());
|
||||
}
|
||||
|
||||
/* Helper function for alpm_db_unregister{_all} */
|
||||
static void _alpm_db_unregister(pmdb_t *db)
|
||||
{
|
||||
if(db == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, "closing database '%s'\n", db->treename);
|
||||
_alpm_db_close(db);
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, "unregistering database '%s'\n", db->treename);
|
||||
_alpm_db_free(db);
|
||||
}
|
||||
|
||||
/** Unregister all package databases
|
||||
* @return 0 on success, -1 on error (pm_errno is set accordingly)
|
||||
*/
|
||||
int SYMEXPORT alpm_db_unregister_all(void)
|
||||
{
|
||||
alpm_list_t *i;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
db = calloc(1, sizeof(pmdb_t));
|
||||
if(db == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("malloc failed: could not allocate %d bytes"),
|
||||
sizeof(pmdb_t));
|
||||
RET_ERR(PM_ERR_MEMORY, NULL);
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
/* Do not unregister a database if a transaction is on-going */
|
||||
ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, -1));
|
||||
|
||||
/* close local database */
|
||||
_alpm_db_unregister(handle->db_local);
|
||||
handle->db_local = NULL;
|
||||
|
||||
/* and also sync ones */
|
||||
for(i = handle->dbs_sync; i; i = i->next) {
|
||||
pmdb_t *db = i->data;
|
||||
_alpm_db_unregister(db);
|
||||
i->data = NULL;
|
||||
}
|
||||
FREELIST(handle->dbs_sync);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/** Unregister a package database
|
||||
* @param db pointer to the package database to unregister
|
||||
* @return 0 on success, -1 on error (pm_errno is set accordingly)
|
||||
*/
|
||||
int SYMEXPORT alpm_db_unregister(pmdb_t *db)
|
||||
{
|
||||
int found = 0;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
ASSERT(db != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
|
||||
/* Do not unregister a database if a transaction is on-going */
|
||||
ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, -1));
|
||||
|
||||
if(db == handle->db_local) {
|
||||
handle->db_local = NULL;
|
||||
found = 1;
|
||||
} else {
|
||||
/* Warning : this function shouldn't be used to unregister all sync
|
||||
* databases by walking through the list returned by
|
||||
* alpm_option_get_syncdbs, because the db is removed from that list here.
|
||||
*/
|
||||
void *data;
|
||||
handle->dbs_sync = alpm_list_remove(handle->dbs_sync,
|
||||
db, _alpm_db_cmp, &data);
|
||||
if(data) {
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
|
||||
db->path = calloc(1, strlen(root)+strlen(dbpath)+strlen(treename)+2);
|
||||
if(db->path == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("malloc failed: could not allocate %d bytes"),
|
||||
strlen(root)+strlen(dbpath)+strlen(treename)+2);
|
||||
FREE(db);
|
||||
RET_ERR(PM_ERR_MEMORY, NULL);
|
||||
if(!found) {
|
||||
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
|
||||
}
|
||||
sprintf(db->path, "%s%s%s/", root, dbpath, treename);
|
||||
|
||||
STRNCPY(db->treename, treename, PATH_MAX);
|
||||
_alpm_db_unregister(db);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/** Set the serverlist of a database.
|
||||
* @param db database pointer
|
||||
* @param url url of the server
|
||||
* @return 0 on success, -1 on error (pm_errno is set accordingly)
|
||||
*/
|
||||
int SYMEXPORT alpm_db_setserver(pmdb_t *db, const char *url)
|
||||
{
|
||||
alpm_list_t *i;
|
||||
int found = 0;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
|
||||
|
||||
for(i = handle->dbs_sync; i && !found; i = i->next) {
|
||||
pmdb_t *sdb = i->data;
|
||||
if(strcmp(db->treename, sdb->treename) == 0) {
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
if(!found) {
|
||||
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
|
||||
}
|
||||
|
||||
if(url && strlen(url)) {
|
||||
pmserver_t *server;
|
||||
if((server = _alpm_server_new(url)) == NULL) {
|
||||
/* pm_errno is set by _alpm_server_new */
|
||||
return(-1);
|
||||
}
|
||||
db->servers = alpm_list_add(db->servers, server);
|
||||
_alpm_log(PM_LOG_DEBUG, "adding new server to database '%s': protocol '%s', server '%s', path '%s'\n",
|
||||
db->treename, server->s_url->scheme, server->s_url->host, server->s_url->doc);
|
||||
} else {
|
||||
FREELIST(db->servers);
|
||||
_alpm_log(PM_LOG_DEBUG, "serverlist flushed for '%s'\n", db->treename);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/** Update a package database
|
||||
* @param force if true, then forces the update, otherwise update only in case
|
||||
* the database isn't up to date
|
||||
* @param db pointer to the package database to update
|
||||
* @return 0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up
|
||||
* to date
|
||||
*/
|
||||
int SYMEXPORT alpm_db_update(int force, pmdb_t *db)
|
||||
{
|
||||
alpm_list_t *lp;
|
||||
char path[PATH_MAX];
|
||||
alpm_list_t *files = NULL;
|
||||
time_t newmtime = 0, lastupdate = 0;
|
||||
const char *dbpath;
|
||||
int ret;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
ASSERT(db != NULL && db != handle->db_local, RET_ERR(PM_ERR_WRONG_ARGS, -1));
|
||||
/* Verify we are in a transaction. This is done _mainly_ because we need a DB
|
||||
* lock - if we update without a db lock, we may kludge some other pacman
|
||||
* process that _has_ a lock.
|
||||
*/
|
||||
ASSERT(handle->trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
|
||||
ASSERT(handle->trans->state == STATE_INITIALIZED, RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1));
|
||||
ASSERT(handle->trans->type == PM_TRANS_TYPE_SYNC, RET_ERR(PM_ERR_TRANS_TYPE, -1));
|
||||
|
||||
if(!alpm_list_find_ptr(handle->dbs_sync, db)) {
|
||||
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
|
||||
}
|
||||
|
||||
if(!force) {
|
||||
/* get the lastupdate time */
|
||||
lastupdate = _alpm_db_getlastupdate(db);
|
||||
if(lastupdate == 0) {
|
||||
_alpm_log(PM_LOG_DEBUG, "failed to get lastupdate time for %s\n",
|
||||
db->treename);
|
||||
}
|
||||
}
|
||||
|
||||
/* build a one-element list */
|
||||
snprintf(path, PATH_MAX, "%s" DBEXT, db->treename);
|
||||
files = alpm_list_add(files, strdup(path));
|
||||
|
||||
dbpath = alpm_option_get_dbpath();
|
||||
|
||||
ret = _alpm_downloadfiles_forreal(db->servers, dbpath, files, lastupdate,
|
||||
&newmtime, NULL, 0);
|
||||
FREELIST(files);
|
||||
if(ret == 1) {
|
||||
/* mtimes match, do nothing */
|
||||
pm_errno = 0;
|
||||
return(1);
|
||||
} else if(ret == -1) {
|
||||
/* we use downloadLastErrString and downloadLastErrCode here, error returns from
|
||||
* libdownload */
|
||||
_alpm_log(PM_LOG_DEBUG, "failed to sync db: %s [%d]\n",
|
||||
downloadLastErrString, downloadLastErrCode);
|
||||
RET_ERR(PM_ERR_DB_SYNC, -1);
|
||||
} else {
|
||||
if(newmtime != 0) {
|
||||
_alpm_log(PM_LOG_DEBUG, "sync: new mtime for %s: %ju\n",
|
||||
db->treename, (uintmax_t)newmtime);
|
||||
_alpm_db_setlastupdate(db, newmtime);
|
||||
}
|
||||
snprintf(path, PATH_MAX, "%s%s" DBEXT, dbpath, db->treename);
|
||||
|
||||
/* remove the old dir */
|
||||
_alpm_log(PM_LOG_DEBUG, "flushing database %s\n", db->path);
|
||||
for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) {
|
||||
pmpkg_t *pkg = lp->data;
|
||||
if(pkg && _alpm_db_remove(db, pkg) == -1) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not remove database entry %s%s\n"), db->treename,
|
||||
alpm_pkg_get_name(pkg));
|
||||
RET_ERR(PM_ERR_DB_REMOVE, -1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Cache needs to be rebuild */
|
||||
_alpm_db_free_pkgcache(db);
|
||||
|
||||
/* uncompress the sync database */
|
||||
if(_alpm_db_install(db, path) == -1) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/** Get the name of a package database
|
||||
* @param db pointer to the package database
|
||||
* @return the name of the package database, NULL on error
|
||||
*/
|
||||
const char SYMEXPORT *alpm_db_get_name(const pmdb_t *db)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
|
||||
return db->treename;
|
||||
}
|
||||
|
||||
/** Get a download URL for the package database
|
||||
* @param db pointer to the package database
|
||||
* @return a fully-specified download URL, NULL on error
|
||||
*/
|
||||
const char SYMEXPORT *alpm_db_get_url(const pmdb_t *db)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
pmserver_t *s;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
|
||||
s = (pmserver_t*)db->servers->data;
|
||||
|
||||
snprintf(path, PATH_MAX, "%s://%s%s", s->s_url->scheme, s->s_url->host, s->s_url->doc);
|
||||
return strdup(path);
|
||||
}
|
||||
|
||||
|
||||
/** Get a package entry from a package database
|
||||
* @param db pointer to the package database to get the package from
|
||||
* @param name of the package
|
||||
* @return the package entry on success, NULL on error
|
||||
*/
|
||||
pmpkg_t SYMEXPORT *alpm_db_get_pkg(pmdb_t *db, const char *name)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
ASSERT(name != NULL && strlen(name) != 0, return(NULL));
|
||||
|
||||
return(_alpm_db_get_pkgfromcache(db, name));
|
||||
}
|
||||
|
||||
/** Get the package cache of a package database
|
||||
* @param db pointer to the package database to get the package from
|
||||
* @return the list of packages on success, NULL on error
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_db_getpkgcache(pmdb_t *db)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
|
||||
return(_alpm_db_get_pkgcache(db));
|
||||
}
|
||||
|
||||
/** Get the list of packages that a package provides
|
||||
* @param db pointer to the package database to get the package from
|
||||
* @param name name of the package
|
||||
* @return the list of packages on success, NULL on error
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_db_whatprovides(pmdb_t *db, const char *name)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
ASSERT(name != NULL && strlen(name) != 0, return(NULL));
|
||||
|
||||
return(_alpm_db_whatprovides(db, name));
|
||||
}
|
||||
|
||||
/** Get a group entry from a package database
|
||||
* @param db pointer to the package database to get the group from
|
||||
* @param name of the group
|
||||
* @return the groups entry on success, NULL on error
|
||||
*/
|
||||
pmgrp_t SYMEXPORT *alpm_db_readgrp(pmdb_t *db, const char *name)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
ASSERT(name != NULL && strlen(name) != 0, return(NULL));
|
||||
|
||||
return(_alpm_db_get_grpfromcache(db, name));
|
||||
}
|
||||
|
||||
/** Get the group cache of a package database
|
||||
* @param db pointer to the package database to get the group from
|
||||
* @return the list of groups on success, NULL on error
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_db_getgrpcache(pmdb_t *db)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
|
||||
return(_alpm_db_get_grpcache(db));
|
||||
}
|
||||
|
||||
/** Searches a database
|
||||
* @param db pointer to the package database to search in
|
||||
* @param needles the list of strings to search for
|
||||
* @return the list of packages on success, NULL on error
|
||||
*/
|
||||
alpm_list_t SYMEXPORT *alpm_db_search(pmdb_t *db, const alpm_list_t* needles)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
|
||||
return(_alpm_db_search(db, needles));
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
pmdb_t *_alpm_db_new(const char *dbpath, const char *treename)
|
||||
{
|
||||
pmdb_t *db;
|
||||
const size_t pathsize = strlen(dbpath) + strlen(treename) + 2;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
CALLOC(db, 1, sizeof(pmdb_t), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||
CALLOC(db->path, 1, pathsize, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||
|
||||
sprintf(db->path, "%s%s/", dbpath, treename);
|
||||
|
||||
strncpy(db->treename, treename, PATH_MAX);
|
||||
|
||||
return(db);
|
||||
}
|
||||
|
||||
void _alpm_db_free(pmdb_t *db)
|
||||
{
|
||||
alpm_list_t *tmp;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
_FREELIST(db->servers, _alpm_server_free);
|
||||
/* cleanup pkgcache */
|
||||
_alpm_db_free_pkgcache(db);
|
||||
/* cleanup server list */
|
||||
for(tmp = db->servers; tmp; tmp = alpm_list_next(tmp)) {
|
||||
_alpm_server_free(tmp->data);
|
||||
}
|
||||
alpm_list_free(db->servers);
|
||||
FREE(db->path);
|
||||
FREE(db);
|
||||
|
||||
@@ -97,9 +476,10 @@ int _alpm_db_cmp(const void *db1, const void *db2)
|
||||
return(strcmp(((pmdb_t *)db1)->treename, ((pmdb_t *)db2)->treename));
|
||||
}
|
||||
|
||||
alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles)
|
||||
alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
|
||||
{
|
||||
alpm_list_t *i, *j, *k, *ret = NULL;
|
||||
const alpm_list_t *i, *j, *k;
|
||||
alpm_list_t *ret = NULL;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
@@ -111,8 +491,8 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles)
|
||||
continue;
|
||||
}
|
||||
targ = i->data;
|
||||
_alpm_log(PM_LOG_DEBUG, "searching for target '%s'", targ);
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, "searching for target '%s'\n", targ);
|
||||
|
||||
if(regcomp(®, targ, REG_EXTENDED | REG_NOSUB | REG_ICASE | REG_NEWLINE) != 0) {
|
||||
RET_ERR(PM_ERR_INVALID_REGEX, NULL);
|
||||
}
|
||||
@@ -125,6 +505,10 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles)
|
||||
if (regexec(®, alpm_pkg_get_name(pkg), 0, 0, 0) == 0) {
|
||||
matched = alpm_pkg_get_name(pkg);
|
||||
}
|
||||
/* check plain text name */
|
||||
else if (strstr(alpm_pkg_get_name(pkg), targ)) {
|
||||
matched = alpm_pkg_get_name(pkg);
|
||||
}
|
||||
/* check desc */
|
||||
else if (regexec(®, alpm_pkg_get_desc(pkg), 0, 0, 0) == 0) {
|
||||
matched = alpm_pkg_get_desc(pkg);
|
||||
@@ -142,7 +526,7 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles)
|
||||
}
|
||||
|
||||
if(matched != NULL) {
|
||||
_alpm_log(PM_LOG_DEBUG, " search target '%s' matched '%s'",
|
||||
_alpm_log(PM_LOG_DEBUG, " search target '%s' matched '%s'\n",
|
||||
targ, matched);
|
||||
ret = alpm_list_add(ret, pkg);
|
||||
}
|
||||
@@ -154,90 +538,150 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles)
|
||||
return(ret);
|
||||
}
|
||||
|
||||
pmdb_t *_alpm_db_register(const char *treename, alpm_cb_db_register callback)
|
||||
pmdb_t *_alpm_db_register_local(void)
|
||||
{
|
||||
struct stat buf;
|
||||
pmdb_t *db;
|
||||
const char *dbpath;
|
||||
char path[PATH_MAX];
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
if(strcmp(treename, "local") == 0) {
|
||||
if(handle->db_local != NULL) {
|
||||
_alpm_log(PM_LOG_WARNING, _("attempt to re-register the 'local' DB"));
|
||||
RET_ERR(PM_ERR_DB_NOT_NULL, NULL);
|
||||
}
|
||||
} else {
|
||||
alpm_list_t *i;
|
||||
for(i = handle->dbs_sync; i; i = i->next) {
|
||||
pmdb_t *sdb = i->data;
|
||||
if(strcmp(treename, sdb->treename) == 0) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("attempt to re-register the '%s' database, using existing"), sdb->treename);
|
||||
return sdb;
|
||||
}
|
||||
}
|
||||
if(handle->db_local != NULL) {
|
||||
_alpm_log(PM_LOG_WARNING, _("attempt to re-register the 'local' DB\n"));
|
||||
RET_ERR(PM_ERR_DB_NOT_NULL, NULL);
|
||||
}
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, _("registering database '%s'"), treename);
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, "registering local database\n");
|
||||
|
||||
/* make sure the database directory exists */
|
||||
snprintf(path, PATH_MAX, "%s%s/%s", handle->root, handle->dbpath, treename);
|
||||
dbpath = alpm_option_get_dbpath();
|
||||
if(!dbpath) {
|
||||
_alpm_log(PM_LOG_ERROR, _("database path is undefined\n"));
|
||||
RET_ERR(PM_ERR_DB_OPEN, NULL);
|
||||
}
|
||||
snprintf(path, PATH_MAX, "%slocal", dbpath);
|
||||
/* TODO this is rediculous, we try to do this even if we can't */
|
||||
if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
|
||||
_alpm_log(PM_LOG_DEBUG, _("database directory '%s' does not exist, creating it"), path);
|
||||
_alpm_log(PM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n",
|
||||
path);
|
||||
if(_alpm_makepath(path) != 0) {
|
||||
RET_ERR(PM_ERR_SYSTEM, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
db = _alpm_db_new(handle->root, handle->dbpath, treename);
|
||||
db = _alpm_db_new(dbpath, "local");
|
||||
if(db == NULL) {
|
||||
RET_ERR(PM_ERR_DB_CREATE, NULL);
|
||||
}
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, _("opening database '%s'"), db->treename);
|
||||
_alpm_log(PM_LOG_DEBUG, "opening database '%s'\n", db->treename);
|
||||
if(_alpm_db_open(db) == -1) {
|
||||
_alpm_db_free(db);
|
||||
RET_ERR(PM_ERR_DB_OPEN, NULL);
|
||||
}
|
||||
|
||||
/* Only call callback on NEW registration. */
|
||||
if(callback) callback(treename, db);
|
||||
|
||||
if(strcmp(treename, "local") == 0) {
|
||||
handle->db_local = db;
|
||||
} else {
|
||||
handle->dbs_sync = alpm_list_add(handle->dbs_sync, db);
|
||||
}
|
||||
|
||||
handle->db_local = db;
|
||||
return(db);
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_db_get_name(pmdb_t *db)
|
||||
pmdb_t *_alpm_db_register_sync(const char *treename)
|
||||
{
|
||||
struct stat buf;
|
||||
pmdb_t *db;
|
||||
const char *dbpath;
|
||||
char path[PATH_MAX];
|
||||
alpm_list_t *i;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
for(i = handle->dbs_sync; i; i = i->next) {
|
||||
pmdb_t *sdb = i->data;
|
||||
if(strcmp(treename, sdb->treename) == 0) {
|
||||
_alpm_log(PM_LOG_DEBUG, "attempt to re-register the '%s' database, using existing\n", sdb->treename);
|
||||
return sdb;
|
||||
}
|
||||
}
|
||||
|
||||
return db->treename;
|
||||
_alpm_log(PM_LOG_DEBUG, "registering sync database '%s'\n", treename);
|
||||
|
||||
/* make sure the database directory exists */
|
||||
dbpath = alpm_option_get_dbpath();
|
||||
if(!dbpath) {
|
||||
_alpm_log(PM_LOG_ERROR, _("database path is undefined\n"));
|
||||
RET_ERR(PM_ERR_DB_OPEN, NULL);
|
||||
}
|
||||
/* all sync DBs now reside in the sync/ subdir of the dbpath */
|
||||
snprintf(path, PATH_MAX, "%ssync/%s", dbpath, treename);
|
||||
/* TODO this is rediculous, we try to do this even if we can't */
|
||||
if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
|
||||
_alpm_log(PM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n",
|
||||
path);
|
||||
if(_alpm_makepath(path) != 0) {
|
||||
RET_ERR(PM_ERR_SYSTEM, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* Ensure the db gets the real path. */
|
||||
path[0] = '\0';
|
||||
snprintf(path, PATH_MAX, "%ssync/", dbpath);
|
||||
|
||||
db = _alpm_db_new(path, treename);
|
||||
if(db == NULL) {
|
||||
RET_ERR(PM_ERR_DB_CREATE, NULL);
|
||||
}
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, "opening database '%s'\n", db->treename);
|
||||
if(_alpm_db_open(db) == -1) {
|
||||
_alpm_db_free(db);
|
||||
RET_ERR(PM_ERR_DB_OPEN, NULL);
|
||||
}
|
||||
|
||||
handle->dbs_sync = alpm_list_add(handle->dbs_sync, db);
|
||||
return(db);
|
||||
}
|
||||
|
||||
const char *alpm_db_get_url(pmdb_t *db)
|
||||
/* helper function for alpm_list_find and _alpm_db_whatprovides
|
||||
*
|
||||
* @return "provision.name" == needle (as string)
|
||||
*/
|
||||
int _alpm_prov_cmp(const void *provision, const void *needle)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
pmserver_t *s;
|
||||
char *tmpptr;
|
||||
char *provname = strdup(provision);
|
||||
int retval = 0;
|
||||
tmpptr = strchr(provname, '=');
|
||||
|
||||
if(tmpptr != NULL) { /* provision-version */
|
||||
*tmpptr='\0';
|
||||
}
|
||||
retval = strcmp(provname, needle);
|
||||
free(provname);
|
||||
return(retval);
|
||||
}
|
||||
|
||||
/* return a alpm_list_t of packages in "db" that provide "package"
|
||||
*/
|
||||
alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package)
|
||||
{
|
||||
alpm_list_t *pkgs = NULL;
|
||||
alpm_list_t *lp;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, return(NULL));
|
||||
ASSERT(db != NULL, return(NULL));
|
||||
if(db == NULL || package == NULL || strlen(package) == 0) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
s = (pmserver_t*)db->servers->data;
|
||||
for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) {
|
||||
pmpkg_t *info = lp->data;
|
||||
|
||||
snprintf(path, PATH_MAX, "%s://%s%s", s->s_url->scheme, s->s_url->host, s->s_url->doc);
|
||||
return strdup(path);
|
||||
if(alpm_list_find(alpm_pkg_get_provides(info), (const void *)package, _alpm_prov_cmp)) {
|
||||
pkgs = alpm_list_add(pkgs, info);
|
||||
}
|
||||
}
|
||||
|
||||
return(pkgs);
|
||||
}
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* db.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -16,15 +16,14 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_DB_H
|
||||
#define _ALPM_DB_H
|
||||
|
||||
#include "alpm.h"
|
||||
#include <limits.h>
|
||||
#include <time.h>
|
||||
|
||||
/* Database entries */
|
||||
typedef enum _pmdbinfrq_t {
|
||||
@@ -33,8 +32,9 @@ typedef enum _pmdbinfrq_t {
|
||||
INFRQ_DEPENDS = 0x04,
|
||||
INFRQ_FILES = 0x08,
|
||||
INFRQ_SCRIPTLET = 0x10,
|
||||
INFRQ_DELTAS = 0x20,
|
||||
/* ALL should be sum of all above */
|
||||
INFRQ_ALL = 0x1F
|
||||
INFRQ_ALL = 0x3F
|
||||
} pmdbinfrq_t;
|
||||
|
||||
/* Database */
|
||||
@@ -48,11 +48,16 @@ struct __pmdb_t {
|
||||
};
|
||||
|
||||
/* db.c, database general calls */
|
||||
pmdb_t *_alpm_db_new(const char *root, const char *dbpath, const char *treename);
|
||||
pmdb_t *_alpm_db_new(const char *dbpath, const char *treename);
|
||||
void _alpm_db_free(pmdb_t *db);
|
||||
int _alpm_db_cmp(const void *db1, const void *db2);
|
||||
alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles);
|
||||
pmdb_t *_alpm_db_register(const char *treename, alpm_cb_db_register callback);
|
||||
alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles);
|
||||
pmdb_t *_alpm_db_register_local(void);
|
||||
pmdb_t *_alpm_db_register_sync(const char *treename);
|
||||
|
||||
/* Provision */
|
||||
int _alpm_prov_cmp(const void *provision, const void *needle);
|
||||
alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package);
|
||||
|
||||
/* be.c, backend specific calls */
|
||||
int _alpm_db_install(pmdb_t *db, const char *dbfile);
|
||||
@@ -63,8 +68,8 @@ pmpkg_t *_alpm_db_scan(pmdb_t *db, const char *target);
|
||||
int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
|
||||
int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
|
||||
int _alpm_db_remove(pmdb_t *db, pmpkg_t *info);
|
||||
int _alpm_db_getlastupdate(pmdb_t *db, char *ts);
|
||||
int _alpm_db_setlastupdate(pmdb_t *db, char *ts);
|
||||
time_t _alpm_db_getlastupdate(const pmdb_t *db);
|
||||
int _alpm_db_setlastupdate(const pmdb_t *db, time_t time);
|
||||
|
||||
#endif /* _ALPM_DB_H */
|
||||
|
||||
|
||||
266
lib/libalpm/delta.c
Normal file
266
lib/libalpm/delta.c
Normal file
@@ -0,0 +1,266 @@
|
||||
/*
|
||||
* delta.c
|
||||
*
|
||||
* Copyright (c) 2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* libalpm */
|
||||
#include "delta.h"
|
||||
#include "error.h"
|
||||
#include "util.h"
|
||||
#include "log.h"
|
||||
#include "alpm_list.h"
|
||||
#include "alpm.h"
|
||||
|
||||
/** \addtogroup alpm_deltas Delta Functions
|
||||
* @brief Functions to manipulate libalpm deltas
|
||||
* @{
|
||||
*/
|
||||
|
||||
const char SYMEXPORT *alpm_delta_get_from(pmdelta_t *delta)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(delta != NULL, return(NULL));
|
||||
|
||||
return(delta->from);
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_delta_get_to(pmdelta_t *delta)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(delta != NULL, return(NULL));
|
||||
|
||||
return(delta->to);
|
||||
}
|
||||
|
||||
unsigned long SYMEXPORT alpm_delta_get_size(pmdelta_t *delta)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(delta != NULL, return(-1));
|
||||
|
||||
return(delta->size);
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_delta_get_filename(pmdelta_t *delta)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(delta != NULL, return(NULL));
|
||||
|
||||
return(delta->filename);
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_delta_get_md5sum(pmdelta_t *delta)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(delta != NULL, return(NULL));
|
||||
|
||||
return(delta->md5sum);
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
/** Calculates the combined size of a list of delta files.
|
||||
*
|
||||
* @param deltas the list of pmdelta_t * objects
|
||||
*
|
||||
* @return the combined size
|
||||
*/
|
||||
unsigned long _alpm_delta_path_size(alpm_list_t *deltas)
|
||||
{
|
||||
unsigned long sum = 0;
|
||||
alpm_list_t *dlts = deltas;
|
||||
|
||||
while(dlts) {
|
||||
pmdelta_t *d = (pmdelta_t *)alpm_list_getdata(dlts);
|
||||
sum += d->size;
|
||||
|
||||
dlts = alpm_list_next(dlts);
|
||||
}
|
||||
|
||||
return(sum);
|
||||
}
|
||||
|
||||
/** Calculates the combined size of a list of delta files that are not
|
||||
* in the cache.
|
||||
*
|
||||
* @param deltas the list of pmdelta_t * objects
|
||||
*
|
||||
* @return the combined size
|
||||
*/
|
||||
unsigned long _alpm_delta_path_size_uncached(alpm_list_t *deltas)
|
||||
{
|
||||
unsigned long sum = 0;
|
||||
alpm_list_t *dlts = deltas;
|
||||
|
||||
while(dlts) {
|
||||
pmdelta_t *d = (pmdelta_t *)alpm_list_getdata(dlts);
|
||||
char *fname = _alpm_filecache_find(d->filename);
|
||||
|
||||
if(!fname) {
|
||||
sum += d->size;
|
||||
}
|
||||
|
||||
FREE(fname);
|
||||
|
||||
dlts = alpm_list_next(dlts);
|
||||
}
|
||||
|
||||
return(sum);
|
||||
}
|
||||
|
||||
/** Calculates the shortest path from one version to another.
|
||||
*
|
||||
* The shortest path is defined as the path with the smallest combined
|
||||
* size, not the length of the path.
|
||||
*
|
||||
* The algorithm is based on Dijkstra's shortest path algorithm.
|
||||
*
|
||||
* @param deltas the list of pmdelta_t * objects that a package has
|
||||
* @param from the version to start from
|
||||
* @param to the version to end at
|
||||
* @param path the current path
|
||||
*
|
||||
* @return the list of pmdelta_t * objects that has the smallest size.
|
||||
* NULL (the empty list) is returned if there is no path between the
|
||||
* versions.
|
||||
*/
|
||||
static alpm_list_t *shortest_delta_path(alpm_list_t *deltas,
|
||||
const char *from, const char *to, alpm_list_t *path)
|
||||
{
|
||||
alpm_list_t *d;
|
||||
alpm_list_t *shortest = NULL;
|
||||
|
||||
/* Found the 'to' version, this is a good path so return it. */
|
||||
if(strcmp(from, to) == 0) {
|
||||
return(path);
|
||||
}
|
||||
|
||||
for(d = deltas; d; d = alpm_list_next(d)) {
|
||||
pmdelta_t *v = alpm_list_getdata(d);
|
||||
|
||||
/* If this vertex has already been visited in the path, go to the
|
||||
* next vertex. */
|
||||
if(alpm_list_find_ptr(path, v)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Once we find a vertex that starts at the 'from' version,
|
||||
* recursively find the shortest path using the 'to' version of this
|
||||
* current vertex as the 'from' version in the function call. */
|
||||
if(strcmp(v->from, from) == 0) {
|
||||
alpm_list_t *newpath = alpm_list_copy(path);
|
||||
newpath = alpm_list_add(newpath, v);
|
||||
newpath = shortest_delta_path(deltas, v->to, to, newpath);
|
||||
|
||||
if(newpath != NULL) {
|
||||
/* The path returned works, now use it unless there is already a
|
||||
* shorter path found. */
|
||||
if(shortest == NULL) {
|
||||
shortest = newpath;
|
||||
} else if(_alpm_delta_path_size(shortest) > _alpm_delta_path_size(newpath)) {
|
||||
alpm_list_free(shortest);
|
||||
shortest = newpath;
|
||||
} else {
|
||||
alpm_list_free(newpath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
alpm_list_free(path);
|
||||
|
||||
return(shortest);
|
||||
}
|
||||
|
||||
/** Calculates the shortest path from one version to another.
|
||||
*
|
||||
* The shortest path is defined as the path with the smallest combined
|
||||
* size, not the length of the path.
|
||||
*
|
||||
* @param deltas the list of pmdelta_t * objects that a package has
|
||||
* @param from the version to start from
|
||||
* @param to the version to end at
|
||||
*
|
||||
* @return the list of pmdelta_t * objects that has the smallest size.
|
||||
* NULL (the empty list) is returned if there is no path between the
|
||||
* versions.
|
||||
*/
|
||||
alpm_list_t *_alpm_shortest_delta_path(alpm_list_t *deltas, const char *from,
|
||||
const char *to)
|
||||
{
|
||||
alpm_list_t *path = NULL;
|
||||
|
||||
path = shortest_delta_path(deltas, from, to, path);
|
||||
|
||||
return(path);
|
||||
}
|
||||
|
||||
/** Parses the string representation of a pmdelta_t object.
|
||||
*
|
||||
* This function assumes that the string is in the correct format.
|
||||
*
|
||||
* @param line the string to parse
|
||||
*
|
||||
* @return A pointer to the new pmdelta_t object
|
||||
*/
|
||||
pmdelta_t *_alpm_delta_parse(char *line)
|
||||
{
|
||||
pmdelta_t *delta;
|
||||
char *tmp = line, *tmp2;
|
||||
|
||||
CALLOC(delta, 1, sizeof(pmdelta_t), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||
|
||||
tmp2 = tmp;
|
||||
tmp = strchr(tmp, ' ');
|
||||
*(tmp++) = '\0';
|
||||
strncpy(delta->from, tmp2, DLT_VERSION_LEN);
|
||||
|
||||
tmp2 = tmp;
|
||||
tmp = strchr(tmp, ' ');
|
||||
*(tmp++) = '\0';
|
||||
strncpy(delta->to, tmp2, DLT_VERSION_LEN);
|
||||
|
||||
tmp2 = tmp;
|
||||
tmp = strchr(tmp, ' ');
|
||||
*(tmp++) = '\0';
|
||||
delta->size = atol(tmp2);
|
||||
|
||||
tmp2 = tmp;
|
||||
tmp = strchr(tmp, ' ');
|
||||
*(tmp++) = '\0';
|
||||
strncpy(delta->filename, tmp2, DLT_FILENAME_LEN);
|
||||
|
||||
strncpy(delta->md5sum, tmp, DLT_MD5SUM_LEN);
|
||||
|
||||
return(delta);
|
||||
}
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
43
lib/libalpm/delta.h
Normal file
43
lib/libalpm/delta.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* delta.h
|
||||
*
|
||||
* Copyright (c) 2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_DELTA_H
|
||||
#define _ALPM_DELTA_H
|
||||
|
||||
#include "alpm.h"
|
||||
|
||||
#define DLT_FILENAME_LEN 512
|
||||
#define DLT_VERSION_LEN 64
|
||||
#define DLT_MD5SUM_LEN 33
|
||||
|
||||
struct __pmdelta_t {
|
||||
char from[DLT_VERSION_LEN];
|
||||
char to[DLT_VERSION_LEN];
|
||||
unsigned long size;
|
||||
char filename[DLT_FILENAME_LEN];
|
||||
char md5sum[DLT_MD5SUM_LEN];
|
||||
};
|
||||
|
||||
unsigned long _alpm_delta_path_size(alpm_list_t *deltas);
|
||||
unsigned long _alpm_delta_path_size_uncached(alpm_list_t *deltas);
|
||||
pmdelta_t *_alpm_delta_parse(char *line);
|
||||
alpm_list_t *_alpm_shortest_delta_path(alpm_list_t *deltas, const char *from, const char *to);
|
||||
|
||||
#endif /* _ALPM_DELTA_H */
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* deps.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -16,9 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_DEPS_H
|
||||
#define _ALPM_DEPS_H
|
||||
@@ -38,21 +36,24 @@ struct __pmdepend_t {
|
||||
/* Missing dependency */
|
||||
struct __pmdepmissing_t {
|
||||
char target[PKG_NAME_LEN];
|
||||
pmdeptype_t type;
|
||||
pmdepend_t depend;
|
||||
};
|
||||
|
||||
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdeptype_t type,
|
||||
pmdepmod_t depmod, const char *depname,
|
||||
const char *depversion);
|
||||
int _alpm_depmiss_isin(pmdepmissing_t *needle, alpm_list_t *haystack);
|
||||
/* Graphs */
|
||||
struct __pmgraph_t {
|
||||
int state; /* 0: untouched, -1: entered, other: leaving time */
|
||||
void *data;
|
||||
struct __pmgraph_t *parent; /* where did we come from? */
|
||||
alpm_list_t *children;
|
||||
alpm_list_t *childptr; /* points to a child in children list */
|
||||
};
|
||||
|
||||
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdepmod_t depmod,
|
||||
const char *depname, const char *depversion);
|
||||
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode);
|
||||
alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
|
||||
alpm_list_t *packages);
|
||||
alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs);
|
||||
void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit);
|
||||
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
|
||||
alpm_list_t *list, alpm_list_t *trail, pmtrans_t *trans,
|
||||
alpm_list_t **data);
|
||||
alpm_list_t **list, alpm_list_t *remove, pmtrans_t *trans, alpm_list_t **data);
|
||||
|
||||
#endif /* _ALPM_DEPS_H */
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* error.c
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -17,22 +17,23 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <libintl.h>
|
||||
|
||||
/* libalpm */
|
||||
#include "error.h"
|
||||
#include "util.h"
|
||||
#include "alpm.h"
|
||||
|
||||
/* TODO does this really need a file all on its own? */
|
||||
char SYMEXPORT *alpm_strerror(int err)
|
||||
const char SYMEXPORT *alpm_strerrorlast(void)
|
||||
{
|
||||
return alpm_strerror(pm_errno);
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_strerror(int err)
|
||||
{
|
||||
switch(err) {
|
||||
/* System */
|
||||
@@ -44,6 +45,8 @@ char SYMEXPORT *alpm_strerror(int err)
|
||||
return _("insufficient privileges");
|
||||
case PM_ERR_NOT_A_FILE:
|
||||
return _("could not find or read file");
|
||||
case PM_ERR_NOT_A_DIR:
|
||||
return _("could not find or read directory");
|
||||
case PM_ERR_WRONG_ARGS:
|
||||
return _("wrong or NULL argument passed");
|
||||
/* Interface */
|
||||
@@ -118,6 +121,11 @@ char SYMEXPORT *alpm_strerror(int err)
|
||||
return _("corrupted package");
|
||||
case PM_ERR_PKG_REPO_NOT_FOUND:
|
||||
return _("no such repository");
|
||||
/* Deltas */
|
||||
case PM_ERR_DLT_CORRUPTED:
|
||||
return _("corrupted delta");
|
||||
case PM_ERR_DLT_PATCHFAILED:
|
||||
return _("delta patch failed");
|
||||
/* Groups */
|
||||
case PM_ERR_GRP_NOT_FOUND:
|
||||
return _("group not found");
|
||||
@@ -135,20 +143,9 @@ char SYMEXPORT *alpm_strerror(int err)
|
||||
return _("internal error");
|
||||
case PM_ERR_LIBARCHIVE_ERROR:
|
||||
return _("libarchive error");
|
||||
case PM_ERR_DISK_FULL:
|
||||
return _("not enough space on disk");
|
||||
case PM_ERR_PKG_HOLD:
|
||||
/* TODO wow this is not descriptive at all... what does this mean? */
|
||||
return _("not confirmed");
|
||||
/* Configuration file */
|
||||
case PM_ERR_CONF_BAD_SECTION:
|
||||
return _("bad configuration section name");
|
||||
case PM_ERR_CONF_LOCAL:
|
||||
return _("'local' is reserved and cannot be used as a repository name");
|
||||
case PM_ERR_CONF_BAD_SYNTAX:
|
||||
return _("syntax error in config file");
|
||||
case PM_ERR_CONF_DIRECTIVE_OUTSIDE_SECTION:
|
||||
return _("all directives must belong to a section");
|
||||
case PM_ERR_INVALID_REGEX:
|
||||
return _("invalid regular expression");
|
||||
/* Downloading */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* error.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,15 +14,13 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_ERROR_H
|
||||
#define _ALPM_ERROR_H
|
||||
|
||||
#define RET_ERR(err, ret) do { pm_errno = (err); \
|
||||
_alpm_log(PM_LOG_DEBUG, _("returning error %d from %s : %s\n"), err, __func__, alpm_strerror(err)); \
|
||||
_alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerrorlast()); \
|
||||
return(ret); } while(0)
|
||||
|
||||
#endif /* _ALPM_ERROR_H */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* group.c
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -14,9 +14,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -24,7 +22,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <libintl.h>
|
||||
|
||||
/* libalpm */
|
||||
#include "group.h"
|
||||
@@ -40,20 +37,13 @@ pmgrp_t *_alpm_grp_new()
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
grp = calloc(1, sizeof(pmgrp_t));
|
||||
if(grp == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"),
|
||||
sizeof(pmgrp_t));
|
||||
RET_ERR(PM_ERR_MEMORY, NULL);
|
||||
}
|
||||
CALLOC(grp, 1, sizeof(pmgrp_t), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||
|
||||
return(grp);
|
||||
}
|
||||
|
||||
void _alpm_grp_free(void *data)
|
||||
void _alpm_grp_free(pmgrp_t *grp)
|
||||
{
|
||||
pmgrp_t *grp = data;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
if(grp == NULL) {
|
||||
@@ -62,8 +52,6 @@ void _alpm_grp_free(void *data)
|
||||
|
||||
FREELIST(grp->packages);
|
||||
FREE(grp);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Helper function for sorting groups
|
||||
@@ -76,7 +64,7 @@ int _alpm_grp_cmp(const void *g1, const void *g2)
|
||||
return(strcmp(grp1->name, grp2->name));
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_grp_get_name(pmgrp_t *grp)
|
||||
const char SYMEXPORT *alpm_grp_get_name(const pmgrp_t *grp)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
@@ -86,7 +74,7 @@ const char SYMEXPORT *alpm_grp_get_name(pmgrp_t *grp)
|
||||
return grp->name;
|
||||
}
|
||||
|
||||
alpm_list_t SYMEXPORT *alpm_grp_get_pkgs(pmgrp_t *grp)
|
||||
const alpm_list_t SYMEXPORT *alpm_grp_get_pkgs(const pmgrp_t *grp)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* group.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,9 +14,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_GROUP_H
|
||||
#define _ALPM_GROUP_H
|
||||
@@ -31,11 +29,8 @@ struct __pmgrp_t {
|
||||
alpm_list_t *packages; /* List of strings */
|
||||
};
|
||||
|
||||
#define FREEGRP(p) do { if(p) { _alpm_grp_free(p); p = NULL; } } while(0)
|
||||
#define FREELISTGRPS(p) _FREELIST(p, _alpm_grp_free)
|
||||
|
||||
pmgrp_t *_alpm_grp_new(void);
|
||||
void _alpm_grp_free(void *data);
|
||||
void _alpm_grp_free(pmgrp_t *grp);
|
||||
int _alpm_grp_cmp(const void *g1, const void *g2);
|
||||
|
||||
#endif /* _ALPM_GROUP_H */
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* handle.c
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -16,9 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -29,8 +27,9 @@
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
#include <syslog.h>
|
||||
#include <libintl.h>
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* libalpm */
|
||||
#include "handle.h"
|
||||
@@ -42,62 +41,44 @@
|
||||
#include "alpm.h"
|
||||
#include "server.h"
|
||||
|
||||
/* global var for handle (private to libalpm) */
|
||||
pmhandle_t *handle = NULL;
|
||||
|
||||
pmhandle_t *_alpm_handle_new()
|
||||
{
|
||||
pmhandle_t *handle;
|
||||
|
||||
handle = (pmhandle_t *)malloc(sizeof(pmhandle_t));
|
||||
if(handle == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmhandle_t));
|
||||
RET_ERR(PM_ERR_MEMORY, NULL);
|
||||
}
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
CALLOC(handle, 1, sizeof(pmhandle_t), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||
|
||||
memset(handle, 0, sizeof(pmhandle_t));
|
||||
handle->lckfd = -1;
|
||||
handle->logstream = NULL;
|
||||
|
||||
#ifndef CYGWIN
|
||||
/* see if we're root or not */
|
||||
handle->uid = geteuid();
|
||||
//#ifndef FAKEROOT
|
||||
// if(!handle->uid && getenv("FAKEROOTKEY")) {
|
||||
// /* fakeroot doesn't count, we're non-root */
|
||||
// handle->uid = 99;
|
||||
// }
|
||||
//#endif
|
||||
//
|
||||
// /* see if we're root or not (fakeroot does not count) */
|
||||
//#ifndef FAKEROOT
|
||||
// if(handle->uid == 0 && !getenv("FAKEROOTKEY")) {
|
||||
// /* } make vim indent work - stupid ifdef's */
|
||||
//#else
|
||||
// if(handle->uid == 0) {
|
||||
//#endif
|
||||
// handle->access = PM_ACCESS_RW;
|
||||
// } else {
|
||||
// handle->access = PM_ACCESS_RO;
|
||||
// }
|
||||
//#else
|
||||
handle->access = PM_ACCESS_RW;
|
||||
#endif
|
||||
|
||||
handle->root = strdup(PM_ROOT);
|
||||
handle->dbpath = strdup(PM_DBPATH);
|
||||
handle->cachedir = strdup(PM_CACHEDIR);
|
||||
handle->logmask = PM_LOG_ERROR | PM_LOG_WARNING;
|
||||
handle->root = NULL;
|
||||
handle->dbpath = NULL;
|
||||
handle->cachedirs = NULL;
|
||||
handle->lockfile = NULL;
|
||||
handle->logfile = NULL;
|
||||
handle->usedelta = 0;
|
||||
|
||||
return(handle);
|
||||
}
|
||||
|
||||
int _alpm_handle_free(pmhandle_t *handle)
|
||||
void _alpm_handle_free(pmhandle_t *handle)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
if(handle == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* close logfiles */
|
||||
if(handle->logfd) {
|
||||
fclose(handle->logfd);
|
||||
handle->logfd = NULL;
|
||||
/* close logfile */
|
||||
if(handle->logstream) {
|
||||
fclose(handle->logstream);
|
||||
handle->logstream= NULL;
|
||||
}
|
||||
if(handle->usesyslog) {
|
||||
handle->usesyslog = 0;
|
||||
@@ -105,197 +86,486 @@ int _alpm_handle_free(pmhandle_t *handle)
|
||||
}
|
||||
|
||||
/* free memory */
|
||||
FREETRANS(handle->trans);
|
||||
_alpm_trans_free(handle->trans);
|
||||
FREE(handle->root);
|
||||
FREE(handle->dbpath);
|
||||
FREE(handle->cachedir);
|
||||
FREELIST(handle->cachedirs);
|
||||
FREE(handle->logfile);
|
||||
FREE(handle->lockfile);
|
||||
FREE(handle->xfercommand);
|
||||
FREELIST(handle->dbs_sync);
|
||||
FREELIST(handle->noupgrade);
|
||||
FREELIST(handle->noextract);
|
||||
FREELIST(handle->ignorepkg);
|
||||
FREELIST(handle->holdpkg);
|
||||
FREELIST(handle->ignoregrp);
|
||||
FREE(handle);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
alpm_cb_log alpm_option_get_logcb() { return (handle ? handle->logcb : NULL); }
|
||||
alpm_cb_download alpm_option_get_dlcb() { return (handle ? handle->dlcb : NULL); }
|
||||
unsigned short SYMEXPORT alpm_option_get_logmask() { return handle->logmask; }
|
||||
const char SYMEXPORT *alpm_option_get_root() { return handle->root; }
|
||||
const char SYMEXPORT *alpm_option_get_dbpath() { return handle->dbpath; }
|
||||
const char SYMEXPORT *alpm_option_get_cachedir() { return handle->cachedir; }
|
||||
const char *alpm_option_get_logfile() { return handle->logfile; }
|
||||
unsigned short alpm_option_get_usesyslog() { return handle->usesyslog; }
|
||||
alpm_list_t *alpm_option_get_noupgrades() { return handle->noupgrade; }
|
||||
alpm_list_t *alpm_option_get_noextracts() { return handle->noextract; }
|
||||
alpm_list_t *alpm_option_get_ignorepkgs() { return handle->ignorepkg; }
|
||||
alpm_list_t *alpm_option_get_holdpkgs() { return handle->holdpkg; }
|
||||
time_t alpm_option_get_upgradedelay() { return handle->upgradedelay; }
|
||||
const char *alpm_option_get_xfercommand() { return handle->xfercommand; }
|
||||
unsigned short alpm_option_get_nopassiveftp() { return handle->nopassiveftp; }
|
||||
unsigned short SYMEXPORT alpm_option_get_chomp() { return handle->chomp; }
|
||||
unsigned short alpm_option_get_usecolor() { return handle->use_color; }
|
||||
alpm_cb_log SYMEXPORT alpm_option_get_logcb()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->logcb;
|
||||
}
|
||||
|
||||
alpm_cb_download SYMEXPORT alpm_option_get_dlcb()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->dlcb;
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_option_get_root()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->root;
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_option_get_dbpath()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->dbpath;
|
||||
}
|
||||
|
||||
alpm_list_t SYMEXPORT *alpm_option_get_cachedirs()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->cachedirs;
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_option_get_logfile()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->logfile;
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_option_get_lockfile()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->lockfile;
|
||||
}
|
||||
|
||||
unsigned short SYMEXPORT alpm_option_get_usesyslog()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return -1;
|
||||
}
|
||||
return handle->usesyslog;
|
||||
}
|
||||
|
||||
alpm_list_t SYMEXPORT *alpm_option_get_noupgrades()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->noupgrade;
|
||||
}
|
||||
|
||||
alpm_list_t SYMEXPORT *alpm_option_get_noextracts()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->noextract;
|
||||
}
|
||||
|
||||
alpm_list_t SYMEXPORT *alpm_option_get_ignorepkgs()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->ignorepkg;
|
||||
}
|
||||
|
||||
alpm_list_t SYMEXPORT *alpm_option_get_holdpkgs()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->holdpkg;
|
||||
}
|
||||
|
||||
alpm_list_t SYMEXPORT *alpm_option_get_ignoregrps()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->ignoregrp;
|
||||
}
|
||||
|
||||
const char SYMEXPORT *alpm_option_get_xfercommand()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->xfercommand;
|
||||
}
|
||||
|
||||
unsigned short SYMEXPORT alpm_option_get_nopassiveftp()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return -1;
|
||||
}
|
||||
return handle->nopassiveftp;
|
||||
}
|
||||
|
||||
pmdb_t SYMEXPORT *alpm_option_get_localdb()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->db_local;
|
||||
}
|
||||
|
||||
pmdb_t SYMEXPORT *alpm_option_get_localdb() { return handle->db_local; }
|
||||
alpm_list_t SYMEXPORT *alpm_option_get_syncdbs()
|
||||
{
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return NULL;
|
||||
}
|
||||
return handle->dbs_sync;
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_set_logcb(alpm_cb_log cb) { handle->logcb = cb; }
|
||||
|
||||
void SYMEXPORT alpm_option_set_dlcb(alpm_cb_download cb) { handle->dlcb = cb; }
|
||||
|
||||
void SYMEXPORT alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; }
|
||||
|
||||
void SYMEXPORT alpm_option_set_root(const char *root)
|
||||
void SYMEXPORT alpm_option_set_logcb(alpm_cb_log cb)
|
||||
{
|
||||
if(handle->root) FREE(handle->root);
|
||||
/* According to the man page, realpath is safe to use IFF the second arg is
|
||||
* NULL. */
|
||||
char *realroot = realpath(root, NULL);
|
||||
if(realroot) {
|
||||
root = realroot;
|
||||
} else {
|
||||
_alpm_log(PM_LOG_ERROR, _("cannot canonicalize specified root path '%s'"), root);
|
||||
}
|
||||
|
||||
if(root) {
|
||||
/* verify root ends in a '/' */
|
||||
int rootlen = strlen(realroot);
|
||||
if(realroot[rootlen-1] != '/') {
|
||||
rootlen += 1;
|
||||
}
|
||||
handle->root = calloc(rootlen+1, sizeof(char));
|
||||
strncpy(handle->root, realroot, rootlen);
|
||||
handle->root[rootlen-1] = '/';
|
||||
_alpm_log(PM_LOG_DEBUG, _("option 'root' = %s"), handle->root);
|
||||
|
||||
}
|
||||
if(realroot) {
|
||||
free(realroot);
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return;
|
||||
}
|
||||
handle->logcb = cb;
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_set_dbpath(const char *dbpath)
|
||||
void SYMEXPORT alpm_option_set_dlcb(alpm_cb_download cb)
|
||||
{
|
||||
if(handle->dbpath) FREE(handle->dbpath);
|
||||
if(dbpath) {
|
||||
/* verify dbpath ends in a '/' */
|
||||
int dbpathlen = strlen(dbpath);
|
||||
if(dbpath[dbpathlen-1] != '/') {
|
||||
dbpathlen += 1;
|
||||
}
|
||||
handle->dbpath = calloc(dbpathlen+1, sizeof(char));
|
||||
strncpy(handle->dbpath, dbpath, dbpathlen);
|
||||
handle->dbpath[dbpathlen-1] = '/';
|
||||
_alpm_log(PM_LOG_DEBUG, _("option 'dbpath' = %s"), handle->dbpath);
|
||||
if (handle == NULL) {
|
||||
pm_errno = PM_ERR_HANDLE_NULL;
|
||||
return;
|
||||
}
|
||||
handle->dlcb = cb;
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_set_cachedir(const char *cachedir)
|
||||
int SYMEXPORT alpm_option_set_root(const char *root)
|
||||
{
|
||||
if(handle->cachedir) FREE(handle->cachedir);
|
||||
if(cachedir) {
|
||||
/* verify cachedir ends in a '/' */
|
||||
int cachedirlen = strlen(cachedir);
|
||||
if(cachedir[cachedirlen-1] != '/') {
|
||||
cachedirlen += 1;
|
||||
}
|
||||
handle->cachedir = calloc(cachedirlen+1, sizeof(char));
|
||||
strncpy(handle->cachedir, cachedir, cachedirlen);
|
||||
handle->cachedir[cachedirlen-1] = '/';
|
||||
_alpm_log(PM_LOG_DEBUG, _("option 'cachedir' = %s"), handle->cachedir);
|
||||
}
|
||||
}
|
||||
struct stat st;
|
||||
char *realroot;
|
||||
size_t rootlen;
|
||||
|
||||
void alpm_option_set_logfile(const char *logfile)
|
||||
{
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
if(handle->logfile) {
|
||||
FREE(handle->logfile);
|
||||
if(handle->logfd) {
|
||||
fclose(handle->logfd);
|
||||
handle->logfd = NULL;
|
||||
}
|
||||
if(!root) {
|
||||
pm_errno = PM_ERR_WRONG_ARGS;
|
||||
return(-1);
|
||||
}
|
||||
if(logfile) {
|
||||
handle->logfile = strdup(logfile);
|
||||
handle->logfd = fopen(logfile, "a");
|
||||
if(stat(root, &st) == -1 || !S_ISDIR(st.st_mode)) {
|
||||
pm_errno = PM_ERR_NOT_A_DIR;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
realroot = calloc(PATH_MAX+1, sizeof(char));
|
||||
if(!realpath(root, realroot)) {
|
||||
pm_errno = PM_ERR_NOT_A_DIR;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* verify root ends in a '/' */
|
||||
rootlen = strlen(realroot);
|
||||
if(realroot[rootlen-1] != '/') {
|
||||
rootlen += 1;
|
||||
}
|
||||
if(handle->root) {
|
||||
FREE(handle->root);
|
||||
}
|
||||
handle->root = calloc(rootlen + 1, sizeof(char));
|
||||
strncpy(handle->root, realroot, rootlen);
|
||||
handle->root[rootlen-1] = '/';
|
||||
FREE(realroot);
|
||||
_alpm_log(PM_LOG_DEBUG, "option 'root' = %s\n", handle->root);
|
||||
return(0);
|
||||
}
|
||||
|
||||
void alpm_option_set_usesyslog(unsigned short usesyslog)
|
||||
int SYMEXPORT alpm_option_set_dbpath(const char *dbpath)
|
||||
{
|
||||
struct stat st;
|
||||
size_t dbpathlen, lockfilelen;
|
||||
const char *lf = "db.lck";
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
if(!dbpath) {
|
||||
pm_errno = PM_ERR_WRONG_ARGS;
|
||||
return(-1);
|
||||
}
|
||||
if(stat(dbpath, &st) == -1 || !S_ISDIR(st.st_mode)) {
|
||||
pm_errno = PM_ERR_NOT_A_DIR;
|
||||
return(-1);
|
||||
}
|
||||
/* verify dbpath ends in a '/' */
|
||||
dbpathlen = strlen(dbpath);
|
||||
if(dbpath[dbpathlen-1] != '/') {
|
||||
dbpathlen += 1;
|
||||
}
|
||||
if(handle->dbpath) {
|
||||
FREE(handle->dbpath);
|
||||
}
|
||||
handle->dbpath = calloc(dbpathlen+1, sizeof(char));
|
||||
strncpy(handle->dbpath, dbpath, dbpathlen);
|
||||
handle->dbpath[dbpathlen-1] = '/';
|
||||
_alpm_log(PM_LOG_DEBUG, "option 'dbpath' = %s\n", handle->dbpath);
|
||||
|
||||
if(handle->lockfile) {
|
||||
FREE(handle->lockfile);
|
||||
}
|
||||
lockfilelen = strlen(handle->dbpath) + strlen(lf) + 1;
|
||||
handle->lockfile = calloc(lockfilelen, sizeof(char));
|
||||
snprintf(handle->lockfile, lockfilelen, "%s%s", handle->dbpath, lf);
|
||||
_alpm_log(PM_LOG_DEBUG, "option 'lockfile' = %s\n", handle->lockfile);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int SYMEXPORT alpm_option_add_cachedir(const char *cachedir)
|
||||
{
|
||||
char *newcachedir;
|
||||
size_t cachedirlen;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
if(!cachedir) {
|
||||
pm_errno = PM_ERR_WRONG_ARGS;
|
||||
return(-1);
|
||||
}
|
||||
/* don't stat the cachedir yet, as it may not even be needed. we can
|
||||
* fail later if it is needed and the path is invalid. */
|
||||
|
||||
/* verify cachedir ends in a '/' */
|
||||
cachedirlen = strlen(cachedir);
|
||||
if(cachedir[cachedirlen-1] != '/') {
|
||||
cachedirlen += 1;
|
||||
}
|
||||
newcachedir = calloc(cachedirlen + 1, sizeof(char));
|
||||
strncpy(newcachedir, cachedir, cachedirlen);
|
||||
newcachedir[cachedirlen-1] = '/';
|
||||
handle->cachedirs = alpm_list_add(handle->cachedirs, newcachedir);
|
||||
_alpm_log(PM_LOG_DEBUG, "option 'cachedir' = %s\n", newcachedir);
|
||||
return(0);
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_set_cachedirs(alpm_list_t *cachedirs)
|
||||
{
|
||||
if(handle->cachedirs) FREELIST(handle->cachedirs);
|
||||
if(cachedirs) handle->cachedirs = cachedirs;
|
||||
}
|
||||
|
||||
int SYMEXPORT alpm_option_remove_cachedir(const char *cachedir)
|
||||
{
|
||||
void *vdata = NULL;
|
||||
char *newcachedir;
|
||||
size_t cachedirlen;
|
||||
/* verify cachedir ends in a '/' */
|
||||
cachedirlen = strlen(cachedir);
|
||||
if(cachedir[cachedirlen-1] != '/') {
|
||||
cachedirlen += 1;
|
||||
}
|
||||
newcachedir = calloc(cachedirlen + 1, sizeof(char));
|
||||
strncpy(newcachedir, cachedir, cachedirlen);
|
||||
newcachedir[cachedirlen-1] = '/';
|
||||
handle->cachedirs = alpm_list_remove(handle->cachedirs, newcachedir,
|
||||
_alpm_str_cmp, &vdata);
|
||||
FREE(newcachedir);
|
||||
if(vdata != NULL) {
|
||||
FREE(vdata);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
int SYMEXPORT alpm_option_set_logfile(const char *logfile)
|
||||
{
|
||||
char *oldlogfile = handle->logfile;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
if(!logfile) {
|
||||
pm_errno = PM_ERR_WRONG_ARGS;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
handle->logfile = strdup(logfile);
|
||||
|
||||
/* free the old logfile path string, and close the stream so logaction
|
||||
* will reopen a new stream on the new logfile */
|
||||
if(oldlogfile) {
|
||||
FREE(oldlogfile);
|
||||
}
|
||||
if(handle->logstream) {
|
||||
fclose(handle->logstream);
|
||||
}
|
||||
_alpm_log(PM_LOG_DEBUG, "option 'logfile' = %s\n", handle->logfile);
|
||||
return(0);
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_set_usesyslog(unsigned short usesyslog)
|
||||
{
|
||||
handle->usesyslog = usesyslog;
|
||||
}
|
||||
|
||||
void alpm_option_add_noupgrade(char *pkg)
|
||||
void SYMEXPORT alpm_option_add_noupgrade(const char *pkg)
|
||||
{
|
||||
handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(pkg));
|
||||
}
|
||||
|
||||
void alpm_option_set_noupgrades(alpm_list_t *noupgrade)
|
||||
void SYMEXPORT alpm_option_set_noupgrades(alpm_list_t *noupgrade)
|
||||
{
|
||||
if(handle->noupgrade) FREELIST(handle->noupgrade);
|
||||
if(noupgrade) handle->noupgrade = noupgrade;
|
||||
}
|
||||
|
||||
void alpm_option_add_noextract(char *pkg)
|
||||
int SYMEXPORT alpm_option_remove_noupgrade(const char *pkg)
|
||||
{
|
||||
void *vdata = NULL;
|
||||
handle->noupgrade = alpm_list_remove(handle->noupgrade, pkg,
|
||||
_alpm_str_cmp, &vdata);
|
||||
if(vdata != NULL) {
|
||||
FREE(vdata);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_add_noextract(const char *pkg)
|
||||
{
|
||||
handle->noextract = alpm_list_add(handle->noextract, strdup(pkg));
|
||||
}
|
||||
void alpm_option_set_noextracts(alpm_list_t *noextract)
|
||||
|
||||
void SYMEXPORT alpm_option_set_noextracts(alpm_list_t *noextract)
|
||||
{
|
||||
if(handle->noextract) FREELIST(handle->noextract);
|
||||
if(noextract) handle->noextract = noextract;
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_add_ignorepkg(char *pkg)
|
||||
int SYMEXPORT alpm_option_remove_noextract(const char *pkg)
|
||||
{
|
||||
void *vdata = NULL;
|
||||
handle->noextract = alpm_list_remove(handle->noextract, pkg,
|
||||
_alpm_str_cmp, &vdata);
|
||||
if(vdata != NULL) {
|
||||
FREE(vdata);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_add_ignorepkg(const char *pkg)
|
||||
{
|
||||
handle->ignorepkg = alpm_list_add(handle->ignorepkg, strdup(pkg));
|
||||
}
|
||||
void alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs)
|
||||
|
||||
void SYMEXPORT alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs)
|
||||
{
|
||||
if(handle->ignorepkg) FREELIST(handle->ignorepkg);
|
||||
if(ignorepkgs) handle->ignorepkg = ignorepkgs;
|
||||
}
|
||||
|
||||
void alpm_option_add_holdpkg(char *pkg)
|
||||
int SYMEXPORT alpm_option_remove_ignorepkg(const char *pkg)
|
||||
{
|
||||
void *vdata = NULL;
|
||||
handle->ignorepkg = alpm_list_remove(handle->ignorepkg, pkg,
|
||||
_alpm_str_cmp, &vdata);
|
||||
if(vdata != NULL) {
|
||||
FREE(vdata);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_add_holdpkg(const char *pkg)
|
||||
{
|
||||
handle->holdpkg = alpm_list_add(handle->holdpkg, strdup(pkg));
|
||||
}
|
||||
void alpm_option_set_holdpkgs(alpm_list_t *holdpkgs)
|
||||
|
||||
void SYMEXPORT alpm_option_set_holdpkgs(alpm_list_t *holdpkgs)
|
||||
{
|
||||
if(handle->holdpkg) FREELIST(handle->holdpkg);
|
||||
if(holdpkgs) handle->holdpkg = holdpkgs;
|
||||
}
|
||||
|
||||
void alpm_option_set_upgradedelay(time_t delay)
|
||||
int SYMEXPORT alpm_option_remove_holdpkg(const char *pkg)
|
||||
{
|
||||
handle->upgradedelay = delay;
|
||||
void *vdata = NULL;
|
||||
handle->holdpkg = alpm_list_remove(handle->holdpkg, pkg,
|
||||
_alpm_str_cmp, &vdata);
|
||||
if(vdata != NULL) {
|
||||
FREE(vdata);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void alpm_option_set_xfercommand(const char *cmd)
|
||||
void SYMEXPORT alpm_option_add_ignoregrp(const char *grp)
|
||||
{
|
||||
handle->ignoregrp = alpm_list_add(handle->ignoregrp, strdup(grp));
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_set_ignoregrps(alpm_list_t *ignoregrps)
|
||||
{
|
||||
if(handle->ignoregrp) FREELIST(handle->ignoregrp);
|
||||
if(ignoregrps) handle->ignoregrp = ignoregrps;
|
||||
}
|
||||
|
||||
int SYMEXPORT alpm_option_remove_ignoregrp(const char *grp)
|
||||
{
|
||||
void *vdata = NULL;
|
||||
handle->ignoregrp = alpm_list_remove(handle->ignoregrp, grp,
|
||||
_alpm_str_cmp, &vdata);
|
||||
if(vdata != NULL) {
|
||||
FREE(vdata);
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
void SYMEXPORT alpm_option_set_xfercommand(const char *cmd)
|
||||
{
|
||||
if(handle->xfercommand) FREE(handle->xfercommand);
|
||||
if(cmd) handle->xfercommand = strdup(cmd);
|
||||
}
|
||||
|
||||
void alpm_option_set_nopassiveftp(unsigned short nopasv)
|
||||
void SYMEXPORT alpm_option_set_nopassiveftp(unsigned short nopasv)
|
||||
{
|
||||
handle->nopassiveftp = nopasv;
|
||||
}
|
||||
|
||||
void alpm_option_set_chomp(unsigned short chomp) { handle->chomp = chomp; }
|
||||
|
||||
void alpm_option_set_usecolor(unsigned short usecolor)
|
||||
void SYMEXPORT alpm_option_set_usedelta(unsigned short usedelta)
|
||||
{
|
||||
handle->use_color = usecolor;
|
||||
handle->usedelta = usedelta;
|
||||
}
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* handle.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,14 +14,13 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_HANDLE_H
|
||||
#define _ALPM_HANDLE_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "alpm_list.h"
|
||||
#include "db.h"
|
||||
@@ -29,50 +28,45 @@
|
||||
#include "alpm.h"
|
||||
#include "trans.h"
|
||||
|
||||
typedef enum _pmaccess_t {
|
||||
PM_ACCESS_RO,
|
||||
PM_ACCESS_RW
|
||||
} pmaccess_t;
|
||||
|
||||
typedef struct _pmhandle_t {
|
||||
/* Internal */
|
||||
pmaccess_t access;
|
||||
uid_t uid;
|
||||
pmdb_t *db_local;
|
||||
alpm_list_t *dbs_sync; /* List of (pmdb_t *) */
|
||||
FILE *logfd;
|
||||
int lckfd;
|
||||
/* internal usage */
|
||||
uid_t uid; /* current UID */ /* TODO is this used? */
|
||||
pmdb_t *db_local; /* local db pointer */
|
||||
alpm_list_t *dbs_sync; /* List of (pmdb_t *) */
|
||||
FILE *logstream; /* log file stream pointer */
|
||||
int lckfd; /* lock file descriptor if one exists */
|
||||
pmtrans_t *trans;
|
||||
|
||||
/* options */
|
||||
alpm_cb_log logcb; /* Log callback function */
|
||||
alpm_cb_download dlcb; /* Download callback function */
|
||||
unsigned short logmask; /* Output mask for logging functions */
|
||||
char *root; /* Root path, default '/' */
|
||||
char *dbpath; /* Base path to pacman's DBs */
|
||||
char *cachedir; /* Base path to pacman's cache */
|
||||
char *logfile; /* Name of the file to log to */ /*TODO is this used?*/
|
||||
unsigned short usesyslog; /* Use syslog instead of logfile? */
|
||||
|
||||
alpm_list_t *noupgrade; /* List of packages NOT to be upgraded */
|
||||
alpm_list_t *noextract; /* List of packages NOT to extrace */ /*TODO is this used?*/
|
||||
alpm_list_t *ignorepkg; /* List of packages to ignore */
|
||||
alpm_list_t *holdpkg; /* List of packages which 'hold' pacman */
|
||||
|
||||
time_t upgradedelay; /* Amount of time to wait before upgrading a package*/
|
||||
/* servers */
|
||||
char *xfercommand; /* External download command */
|
||||
/* callback functions */
|
||||
alpm_cb_log logcb; /* Log callback function */
|
||||
alpm_cb_download dlcb; /* Download callback function */
|
||||
|
||||
/* filesystem paths */
|
||||
char *root; /* Root path, default '/' */
|
||||
char *dbpath; /* Base path to pacman's DBs */
|
||||
char *logfile; /* Name of the log file */
|
||||
char *lockfile; /* Name of the lock file */
|
||||
alpm_list_t *cachedirs; /* Paths to pacman cache directories */
|
||||
|
||||
/* package lists */
|
||||
alpm_list_t *noupgrade; /* List of packages NOT to be upgraded */
|
||||
alpm_list_t *noextract; /* List of packages NOT to extract */ /*TODO is this used?*/
|
||||
alpm_list_t *ignorepkg; /* List of packages to ignore */
|
||||
alpm_list_t *holdpkg; /* List of packages which 'hold' pacman */
|
||||
alpm_list_t *ignoregrp; /* List of groups to ignore */
|
||||
|
||||
/* options */
|
||||
unsigned short usesyslog; /* Use syslog instead of logfile? */ /* TODO move to frontend */
|
||||
unsigned short nopassiveftp; /* Don't use PASV ftp connections */
|
||||
unsigned short chomp; /* I Love Candy! */
|
||||
unsigned short use_color; /* enable colorful output */
|
||||
char *xfercommand; /* External download command */
|
||||
unsigned short usedelta; /* Download deltas if possible */
|
||||
} pmhandle_t;
|
||||
|
||||
/* global handle variable */
|
||||
extern pmhandle_t *handle;
|
||||
|
||||
#define FREEHANDLE(p) do { if (p) { _alpm_handle_free(p); p = NULL; } } while (0)
|
||||
|
||||
pmhandle_t *_alpm_handle_new();
|
||||
int _alpm_handle_free(pmhandle_t *handle);
|
||||
void _alpm_handle_free(pmhandle_t *handle);
|
||||
|
||||
#endif /* _ALPM_HANDLE_H */
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* log.c
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,38 +14,92 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
|
||||
/* libalpm */
|
||||
#include "log.h"
|
||||
#include "handle.h"
|
||||
#include "util.h"
|
||||
#include "error.h"
|
||||
#include "alpm.h"
|
||||
|
||||
/** \addtogroup alpm_log Logging Functions
|
||||
* @brief Functions to log using libalpm
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** A printf-like function for logging.
|
||||
* @param fmt output format
|
||||
* @return 0 on success, -1 on error (pm_errno is set accordingly)
|
||||
*/
|
||||
int SYMEXPORT alpm_logaction(char *fmt, ...)
|
||||
{
|
||||
int ret;
|
||||
va_list args;
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
/* Sanity checks */
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
|
||||
/* check if the logstream is open already, opening it if needed */
|
||||
if(handle->logstream == NULL) {
|
||||
handle->logstream = fopen(handle->logfile, "a");
|
||||
/* if we couldn't open it, we have an issue */
|
||||
if(handle->logstream == NULL) {
|
||||
if(errno == EACCES) {
|
||||
pm_errno = PM_ERR_BADPERMS;
|
||||
} else if(errno == ENOENT) {
|
||||
pm_errno = PM_ERR_NOT_A_DIR;
|
||||
} else {
|
||||
pm_errno = PM_ERR_SYSTEM;
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
va_start(args, fmt);
|
||||
ret = _alpm_logaction(handle->usesyslog, handle->logstream, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
/* TODO We should add a prefix to log strings depending on who called us.
|
||||
* If logaction was called by the frontend:
|
||||
* USER: <the frontend log>
|
||||
* and if called internally:
|
||||
* ALPM: <the library log>
|
||||
* Moreover, the frontend should be able to choose its prefix
|
||||
* (USER by default?):
|
||||
* pacman: "PACMAN"
|
||||
* kpacman: "KPACMAN"
|
||||
* This would allow us to share the log file between several frontends
|
||||
* and know who does what */
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
void _alpm_log(pmloglevel_t flag, char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
alpm_cb_log logcb = alpm_option_get_logcb();
|
||||
|
||||
if(logcb == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(flag & alpm_option_get_logmask()) {
|
||||
char str[LOG_STR_LEN];
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
vsnprintf(str, LOG_STR_LEN, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
logcb(flag, str);
|
||||
}
|
||||
va_start(args, fmt);
|
||||
logcb(flag, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* log.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,25 +14,21 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_LOG_H
|
||||
#define _ALPM_LOG_H
|
||||
|
||||
#include "alpm.h"
|
||||
|
||||
#define LOG_STR_LEN 1024
|
||||
|
||||
#ifdef PACMAN_DEBUG
|
||||
/* Log funtion entry points if debugging is enabled */
|
||||
#define ALPM_LOG_FUNC _alpm_log(PM_LOG_FUNCTION, "Enter %s", __func__)
|
||||
#define ALPM_LOG_FUNC _alpm_log(PM_LOG_FUNCTION, "Enter %s\n", __func__)
|
||||
#else
|
||||
#define ALPM_LOG_FUNC
|
||||
#endif
|
||||
|
||||
void _alpm_log(pmloglevel_t flag, char *fmt, ...);
|
||||
void _alpm_log(pmloglevel_t flag, char *fmt, ...) __attribute__((format(printf,2,3)));
|
||||
|
||||
#endif /* _ALPM_LOG_H */
|
||||
|
||||
|
||||
@@ -1,307 +1,334 @@
|
||||
/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
|
||||
/*
|
||||
* RFC 1321 compliant MD5 implementation
|
||||
*
|
||||
* Copyright (C) 2006-2007 Christophe Devine
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License, version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* The MD5 algorithm was designed by Ron Rivest in 1991.
|
||||
*
|
||||
* http://www.ietf.org/rfc/rfc1321.txt
|
||||
*/
|
||||
/*
|
||||
* Pacman Notes:
|
||||
*
|
||||
* Taken from the XySSL project at www.xyssl.org under terms of the
|
||||
* LGPL. This is from version 0.7 of the library, and has been modified
|
||||
* as following, which may be helpful for future updates:
|
||||
* * change include from "xyssl/md5.h" to "md5.h"
|
||||
* * removal of HMAC code
|
||||
* * removal of SELF_TEST code
|
||||
* * removal of ipad and opad from the md5_context struct in md5.h
|
||||
* * change of md5_file prototype from
|
||||
* int md5_file( char *path, unsigned char *output )
|
||||
* to
|
||||
* int md5_file( const char *path, unsigned char *output )
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD5 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
#ifndef _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "md5.h"
|
||||
|
||||
/* Constants for MD5Transform routine.
|
||||
/*
|
||||
* 32-bit integer manipulation macros (little endian)
|
||||
*/
|
||||
#ifndef GET_UINT32_LE
|
||||
#define GET_UINT32_LE(n,b,i) \
|
||||
{ \
|
||||
(n) = ( (unsigned long) (b)[(i) ] ) \
|
||||
| ( (unsigned long) (b)[(i) + 1] << 8 ) \
|
||||
| ( (unsigned long) (b)[(i) + 2] << 16 ) \
|
||||
| ( (unsigned long) (b)[(i) + 3] << 24 ); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define S11 7
|
||||
#define S12 12
|
||||
#define S13 17
|
||||
#define S14 22
|
||||
#define S21 5
|
||||
#define S22 9
|
||||
#define S23 14
|
||||
#define S24 20
|
||||
#define S31 4
|
||||
#define S32 11
|
||||
#define S33 16
|
||||
#define S34 23
|
||||
#define S41 6
|
||||
#define S42 10
|
||||
#define S43 15
|
||||
#define S44 21
|
||||
#ifndef PUT_UINT32_LE
|
||||
#define PUT_UINT32_LE(n,b,i) \
|
||||
{ \
|
||||
(b)[(i) ] = (unsigned char) ( (n) ); \
|
||||
(b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \
|
||||
(b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \
|
||||
(b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \
|
||||
}
|
||||
#endif
|
||||
|
||||
static void MD5Transform(UINT4 [4], unsigned char [64]);
|
||||
static void Encode(unsigned char *, UINT4 *, unsigned int);
|
||||
static void Decode(UINT4 *, unsigned char *, unsigned int);
|
||||
/*
|
||||
* MD5 context setup
|
||||
*/
|
||||
static inline void md5_starts( md5_context *ctx )
|
||||
{
|
||||
ctx->total[0] = 0;
|
||||
ctx->total[1] = 0;
|
||||
|
||||
static unsigned char PADDING[64] = {
|
||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
ctx->state[0] = 0x67452301;
|
||||
ctx->state[1] = 0xEFCDAB89;
|
||||
ctx->state[2] = 0x98BADCFE;
|
||||
ctx->state[3] = 0x10325476;
|
||||
}
|
||||
|
||||
static inline void md5_process( md5_context *ctx, unsigned char data[64] )
|
||||
{
|
||||
unsigned long X[16], A, B, C, D;
|
||||
|
||||
GET_UINT32_LE( X[ 0], data, 0 );
|
||||
GET_UINT32_LE( X[ 1], data, 4 );
|
||||
GET_UINT32_LE( X[ 2], data, 8 );
|
||||
GET_UINT32_LE( X[ 3], data, 12 );
|
||||
GET_UINT32_LE( X[ 4], data, 16 );
|
||||
GET_UINT32_LE( X[ 5], data, 20 );
|
||||
GET_UINT32_LE( X[ 6], data, 24 );
|
||||
GET_UINT32_LE( X[ 7], data, 28 );
|
||||
GET_UINT32_LE( X[ 8], data, 32 );
|
||||
GET_UINT32_LE( X[ 9], data, 36 );
|
||||
GET_UINT32_LE( X[10], data, 40 );
|
||||
GET_UINT32_LE( X[11], data, 44 );
|
||||
GET_UINT32_LE( X[12], data, 48 );
|
||||
GET_UINT32_LE( X[13], data, 52 );
|
||||
GET_UINT32_LE( X[14], data, 56 );
|
||||
GET_UINT32_LE( X[15], data, 60 );
|
||||
|
||||
#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
|
||||
|
||||
#define P(a,b,c,d,k,s,t) \
|
||||
{ \
|
||||
a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \
|
||||
}
|
||||
|
||||
A = ctx->state[0];
|
||||
B = ctx->state[1];
|
||||
C = ctx->state[2];
|
||||
D = ctx->state[3];
|
||||
|
||||
#define F(x,y,z) (z ^ (x & (y ^ z)))
|
||||
|
||||
P( A, B, C, D, 0, 7, 0xD76AA478 );
|
||||
P( D, A, B, C, 1, 12, 0xE8C7B756 );
|
||||
P( C, D, A, B, 2, 17, 0x242070DB );
|
||||
P( B, C, D, A, 3, 22, 0xC1BDCEEE );
|
||||
P( A, B, C, D, 4, 7, 0xF57C0FAF );
|
||||
P( D, A, B, C, 5, 12, 0x4787C62A );
|
||||
P( C, D, A, B, 6, 17, 0xA8304613 );
|
||||
P( B, C, D, A, 7, 22, 0xFD469501 );
|
||||
P( A, B, C, D, 8, 7, 0x698098D8 );
|
||||
P( D, A, B, C, 9, 12, 0x8B44F7AF );
|
||||
P( C, D, A, B, 10, 17, 0xFFFF5BB1 );
|
||||
P( B, C, D, A, 11, 22, 0x895CD7BE );
|
||||
P( A, B, C, D, 12, 7, 0x6B901122 );
|
||||
P( D, A, B, C, 13, 12, 0xFD987193 );
|
||||
P( C, D, A, B, 14, 17, 0xA679438E );
|
||||
P( B, C, D, A, 15, 22, 0x49B40821 );
|
||||
|
||||
#undef F
|
||||
|
||||
#define F(x,y,z) (y ^ (z & (x ^ y)))
|
||||
|
||||
P( A, B, C, D, 1, 5, 0xF61E2562 );
|
||||
P( D, A, B, C, 6, 9, 0xC040B340 );
|
||||
P( C, D, A, B, 11, 14, 0x265E5A51 );
|
||||
P( B, C, D, A, 0, 20, 0xE9B6C7AA );
|
||||
P( A, B, C, D, 5, 5, 0xD62F105D );
|
||||
P( D, A, B, C, 10, 9, 0x02441453 );
|
||||
P( C, D, A, B, 15, 14, 0xD8A1E681 );
|
||||
P( B, C, D, A, 4, 20, 0xE7D3FBC8 );
|
||||
P( A, B, C, D, 9, 5, 0x21E1CDE6 );
|
||||
P( D, A, B, C, 14, 9, 0xC33707D6 );
|
||||
P( C, D, A, B, 3, 14, 0xF4D50D87 );
|
||||
P( B, C, D, A, 8, 20, 0x455A14ED );
|
||||
P( A, B, C, D, 13, 5, 0xA9E3E905 );
|
||||
P( D, A, B, C, 2, 9, 0xFCEFA3F8 );
|
||||
P( C, D, A, B, 7, 14, 0x676F02D9 );
|
||||
P( B, C, D, A, 12, 20, 0x8D2A4C8A );
|
||||
|
||||
#undef F
|
||||
|
||||
#define F(x,y,z) (x ^ y ^ z)
|
||||
|
||||
P( A, B, C, D, 5, 4, 0xFFFA3942 );
|
||||
P( D, A, B, C, 8, 11, 0x8771F681 );
|
||||
P( C, D, A, B, 11, 16, 0x6D9D6122 );
|
||||
P( B, C, D, A, 14, 23, 0xFDE5380C );
|
||||
P( A, B, C, D, 1, 4, 0xA4BEEA44 );
|
||||
P( D, A, B, C, 4, 11, 0x4BDECFA9 );
|
||||
P( C, D, A, B, 7, 16, 0xF6BB4B60 );
|
||||
P( B, C, D, A, 10, 23, 0xBEBFBC70 );
|
||||
P( A, B, C, D, 13, 4, 0x289B7EC6 );
|
||||
P( D, A, B, C, 0, 11, 0xEAA127FA );
|
||||
P( C, D, A, B, 3, 16, 0xD4EF3085 );
|
||||
P( B, C, D, A, 6, 23, 0x04881D05 );
|
||||
P( A, B, C, D, 9, 4, 0xD9D4D039 );
|
||||
P( D, A, B, C, 12, 11, 0xE6DB99E5 );
|
||||
P( C, D, A, B, 15, 16, 0x1FA27CF8 );
|
||||
P( B, C, D, A, 2, 23, 0xC4AC5665 );
|
||||
|
||||
#undef F
|
||||
|
||||
#define F(x,y,z) (y ^ (x | ~z))
|
||||
|
||||
P( A, B, C, D, 0, 6, 0xF4292244 );
|
||||
P( D, A, B, C, 7, 10, 0x432AFF97 );
|
||||
P( C, D, A, B, 14, 15, 0xAB9423A7 );
|
||||
P( B, C, D, A, 5, 21, 0xFC93A039 );
|
||||
P( A, B, C, D, 12, 6, 0x655B59C3 );
|
||||
P( D, A, B, C, 3, 10, 0x8F0CCC92 );
|
||||
P( C, D, A, B, 10, 15, 0xFFEFF47D );
|
||||
P( B, C, D, A, 1, 21, 0x85845DD1 );
|
||||
P( A, B, C, D, 8, 6, 0x6FA87E4F );
|
||||
P( D, A, B, C, 15, 10, 0xFE2CE6E0 );
|
||||
P( C, D, A, B, 6, 15, 0xA3014314 );
|
||||
P( B, C, D, A, 13, 21, 0x4E0811A1 );
|
||||
P( A, B, C, D, 4, 6, 0xF7537E82 );
|
||||
P( D, A, B, C, 11, 10, 0xBD3AF235 );
|
||||
P( C, D, A, B, 2, 15, 0x2AD7D2BB );
|
||||
P( B, C, D, A, 9, 21, 0xEB86D391 );
|
||||
|
||||
#undef F
|
||||
|
||||
ctx->state[0] += A;
|
||||
ctx->state[1] += B;
|
||||
ctx->state[2] += C;
|
||||
ctx->state[3] += D;
|
||||
}
|
||||
|
||||
/*
|
||||
* MD5 process buffer
|
||||
*/
|
||||
static inline void md5_update( md5_context *ctx, unsigned char *input, int ilen )
|
||||
{
|
||||
int fill;
|
||||
unsigned long left;
|
||||
|
||||
if( ilen <= 0 )
|
||||
return;
|
||||
|
||||
left = ctx->total[0] & 0x3F;
|
||||
fill = 64 - left;
|
||||
|
||||
ctx->total[0] += ilen;
|
||||
ctx->total[0] &= 0xFFFFFFFF;
|
||||
|
||||
if( ctx->total[0] < (unsigned long) ilen )
|
||||
ctx->total[1]++;
|
||||
|
||||
if( left && ilen >= fill )
|
||||
{
|
||||
memcpy( (void *) (ctx->buffer + left),
|
||||
(void *) input, fill );
|
||||
md5_process( ctx, ctx->buffer );
|
||||
input += fill;
|
||||
ilen -= fill;
|
||||
left = 0;
|
||||
}
|
||||
|
||||
while( ilen >= 64 )
|
||||
{
|
||||
md5_process( ctx, input );
|
||||
input += 64;
|
||||
ilen -= 64;
|
||||
}
|
||||
|
||||
if( ilen > 0 )
|
||||
{
|
||||
memcpy( (void *) (ctx->buffer + left),
|
||||
(void *) input, ilen );
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned char md5_padding[64] =
|
||||
{
|
||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
/* F, G, H and I are basic MD5 functions.
|
||||
/*
|
||||
* MD5 final digest
|
||||
*/
|
||||
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
|
||||
#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
|
||||
#define H(x, y, z) ((x) ^ (y) ^ (z))
|
||||
#define I(x, y, z) ((y) ^ ((x) | (~z)))
|
||||
|
||||
/* ROTATE_LEFT rotates x left n bits.
|
||||
*/
|
||||
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
|
||||
|
||||
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
|
||||
Rotation is separate from addition to prevent recomputation.
|
||||
*/
|
||||
#define FF(a, b, c, d, x, s, ac) { \
|
||||
(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define GG(a, b, c, d, x, s, ac) { \
|
||||
(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define HH(a, b, c, d, x, s, ac) { \
|
||||
(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define II(a, b, c, d, x, s, ac) { \
|
||||
(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
|
||||
/* MD5 initialization. Begins an MD5 operation, writing a new context.
|
||||
*/
|
||||
void _alpm_MD5Init (context)
|
||||
MD5_CTX *context; /* context */
|
||||
static inline void md5_finish( md5_context *ctx, unsigned char *output )
|
||||
{
|
||||
context->count[0] = context->count[1] = 0;
|
||||
/* Load magic initialization constants.
|
||||
*/
|
||||
context->state[0] = 0x67452301;
|
||||
context->state[1] = 0xefcdab89;
|
||||
context->state[2] = 0x98badcfe;
|
||||
context->state[3] = 0x10325476;
|
||||
unsigned long last, padn;
|
||||
unsigned long high, low;
|
||||
unsigned char msglen[8];
|
||||
|
||||
high = ( ctx->total[0] >> 29 )
|
||||
| ( ctx->total[1] << 3 );
|
||||
low = ( ctx->total[0] << 3 );
|
||||
|
||||
PUT_UINT32_LE( low, msglen, 0 );
|
||||
PUT_UINT32_LE( high, msglen, 4 );
|
||||
|
||||
last = ctx->total[0] & 0x3F;
|
||||
padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last );
|
||||
|
||||
md5_update( ctx, (unsigned char *) md5_padding, padn );
|
||||
md5_update( ctx, msglen, 8 );
|
||||
|
||||
PUT_UINT32_LE( ctx->state[0], output, 0 );
|
||||
PUT_UINT32_LE( ctx->state[1], output, 4 );
|
||||
PUT_UINT32_LE( ctx->state[2], output, 8 );
|
||||
PUT_UINT32_LE( ctx->state[3], output, 12 );
|
||||
}
|
||||
|
||||
/* MD5 block update operation. Continues an MD5 message-digest
|
||||
operation, processing another message block, and updating the
|
||||
context.
|
||||
/*
|
||||
* Output = MD5( input buffer )
|
||||
*/
|
||||
void _alpm_MD5Update (context, input, inputLen)
|
||||
MD5_CTX *context; /* context */
|
||||
unsigned char *input; /* input block */
|
||||
unsigned int inputLen; /* length of input block */
|
||||
void md5( unsigned char *input, int ilen,
|
||||
unsigned char *output )
|
||||
{
|
||||
unsigned int i, index, partLen;
|
||||
md5_context ctx;
|
||||
|
||||
/* Compute number of bytes mod 64 */
|
||||
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
|
||||
md5_starts( &ctx );
|
||||
md5_update( &ctx, input, ilen );
|
||||
md5_finish( &ctx, output );
|
||||
|
||||
/* Update number of bits */
|
||||
if ((context->count[0] += ((UINT4)inputLen << 3))
|
||||
|
||||
< ((UINT4)inputLen << 3))
|
||||
context->count[1]++;
|
||||
context->count[1] += ((UINT4)inputLen >> 29);
|
||||
|
||||
partLen = 64 - index;
|
||||
|
||||
/* Transform as many times as possible.
|
||||
*/
|
||||
if (inputLen >= partLen) {
|
||||
memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen);
|
||||
MD5Transform (context->state, context->buffer);
|
||||
|
||||
for (i = partLen; i + 63 < inputLen; i += 64)
|
||||
MD5Transform (context->state, &input[i]);
|
||||
|
||||
index = 0;
|
||||
}
|
||||
else
|
||||
i = 0;
|
||||
|
||||
/* Buffer remaining input */
|
||||
memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i);
|
||||
memset( &ctx, 0, sizeof( md5_context ) );
|
||||
}
|
||||
|
||||
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
|
||||
the message digest and zeroizing the context.
|
||||
/*
|
||||
* Output = MD5( file contents )
|
||||
*/
|
||||
void _alpm_MD5Final (digest, context)
|
||||
unsigned char digest[16]; /* message digest */
|
||||
MD5_CTX *context; /* context */
|
||||
int md5_file( const char *path, unsigned char *output )
|
||||
{
|
||||
unsigned char bits[8];
|
||||
unsigned int index, padLen;
|
||||
FILE *f;
|
||||
size_t n;
|
||||
md5_context ctx;
|
||||
unsigned char buf[1024];
|
||||
|
||||
/* Save number of bits */
|
||||
Encode (bits, context->count, 8);
|
||||
if( ( f = fopen( path, "rb" ) ) == NULL )
|
||||
return( 1 );
|
||||
|
||||
/* Pad out to 56 mod 64.
|
||||
*/
|
||||
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
|
||||
padLen = (index < 56) ? (56 - index) : (120 - index);
|
||||
_alpm_MD5Update (context, PADDING, padLen);
|
||||
md5_starts( &ctx );
|
||||
|
||||
/* Append length (before padding) */
|
||||
_alpm_MD5Update (context, bits, 8);
|
||||
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
|
||||
md5_update( &ctx, buf, (int) n );
|
||||
|
||||
/* Store state in digest */
|
||||
Encode (digest, context->state, 16);
|
||||
md5_finish( &ctx, output );
|
||||
|
||||
/* Zeroize sensitive information.
|
||||
*/
|
||||
memset ((POINTER)context, 0, sizeof (*context));
|
||||
memset( &ctx, 0, sizeof( md5_context ) );
|
||||
|
||||
if( ferror( f ) != 0 )
|
||||
{
|
||||
fclose( f );
|
||||
return( 2 );
|
||||
}
|
||||
|
||||
fclose( f );
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* MD5 basic transformation. Transforms state based on block.
|
||||
*/
|
||||
static void MD5Transform (state, block)
|
||||
UINT4 state[4];
|
||||
unsigned char block[64];
|
||||
{
|
||||
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
|
||||
|
||||
Decode (x, block, 64);
|
||||
|
||||
/* Round 1 */
|
||||
FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
|
||||
FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
|
||||
FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
|
||||
FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
|
||||
FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
|
||||
FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
|
||||
FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
|
||||
FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
|
||||
FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
|
||||
FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
|
||||
FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
|
||||
FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
|
||||
FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
|
||||
FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
|
||||
FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
|
||||
FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
|
||||
|
||||
/* Round 2 */
|
||||
GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
|
||||
GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
|
||||
GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
|
||||
GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
|
||||
GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
|
||||
GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
|
||||
GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
|
||||
GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
|
||||
GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
|
||||
GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
|
||||
GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
|
||||
|
||||
GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
|
||||
GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
|
||||
GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
|
||||
GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
|
||||
GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
|
||||
|
||||
/* Round 3 */
|
||||
HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
|
||||
HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
|
||||
HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
|
||||
HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
|
||||
HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
|
||||
HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
|
||||
HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
|
||||
HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
|
||||
HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
|
||||
HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
|
||||
HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
|
||||
HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
|
||||
HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
|
||||
HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
|
||||
HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
|
||||
HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
|
||||
|
||||
/* Round 4 */
|
||||
II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
|
||||
II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
|
||||
II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
|
||||
II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
|
||||
II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
|
||||
II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
|
||||
II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
|
||||
II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
|
||||
II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
|
||||
II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
|
||||
II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
|
||||
II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
|
||||
II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
|
||||
II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
|
||||
II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
|
||||
II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
|
||||
|
||||
state[0] += a;
|
||||
state[1] += b;
|
||||
state[2] += c;
|
||||
state[3] += d;
|
||||
|
||||
/* Zeroize sensitive information.
|
||||
|
||||
*/
|
||||
memset ((POINTER)x, 0, sizeof (x));
|
||||
}
|
||||
|
||||
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Encode (output, input, len)
|
||||
unsigned char *output;
|
||||
UINT4 *input;
|
||||
unsigned int len;
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0, j = 0; j < len; i++, j += 4) {
|
||||
output[j] = (unsigned char)(input[i] & 0xff);
|
||||
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
|
||||
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
|
||||
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Decode (output, input, len)
|
||||
UINT4 *output;
|
||||
unsigned char *input;
|
||||
unsigned int len;
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0, j = 0; j < len; i++, j += 4)
|
||||
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
|
||||
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
|
||||
}
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
|
||||
@@ -1,53 +1,66 @@
|
||||
/* MD5.H - header file for MD5C.C
|
||||
/*
|
||||
* RFC 1321 compliant MD5 implementation
|
||||
*
|
||||
* Copyright (C) 2006-2007 Christophe Devine
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License, version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
#ifndef _MD5_H
|
||||
#define _MD5_H
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD5 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
/**
|
||||
* \internal
|
||||
* \brief MD5 context structure
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned long total[2]; /*!< number of bytes processed */
|
||||
unsigned long state[4]; /*!< intermediate digest state */
|
||||
unsigned char buffer[64]; /*!< data block being processed */
|
||||
}
|
||||
md5_context;
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
/**
|
||||
* \internal
|
||||
* \brief Output = MD5( input buffer )
|
||||
*
|
||||
* \param input buffer holding the data
|
||||
* \param ilen length of the input data
|
||||
* \param output MD5 checksum result
|
||||
*/
|
||||
void md5( unsigned char *input, int ilen,
|
||||
unsigned char *output );
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software. */
|
||||
#ifndef _ALPM_MD5_H
|
||||
#define _ALPM_MD5_H
|
||||
/**
|
||||
* \internal
|
||||
* \brief Output = MD5( file contents )
|
||||
*
|
||||
* \param path input file name
|
||||
* \param output MD5 checksum result
|
||||
*
|
||||
* \return 0 if successful, 1 if fopen failed,
|
||||
* or 2 if fread failed
|
||||
*/
|
||||
int md5_file( const char *path, unsigned char *output );
|
||||
|
||||
/* POINTER defines a generic pointer type */
|
||||
typedef unsigned char *POINTER;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* UINT2 defines a two byte word */
|
||||
typedef unsigned short int UINT2;
|
||||
|
||||
/* UINT4 defines a four byte word */
|
||||
typedef unsigned int UINT4;
|
||||
|
||||
|
||||
/* MD5 context. */
|
||||
typedef struct {
|
||||
UINT4 state[4]; /* state (ABCD) */
|
||||
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
unsigned char buffer[64]; /* input buffer */
|
||||
} MD5_CTX;
|
||||
|
||||
void _alpm_MD5Init(MD5_CTX *);
|
||||
void _alpm_MD5Update(MD5_CTX *, unsigned char *, unsigned int);
|
||||
void _alpm_MD5Final(unsigned char [16], MD5_CTX *);
|
||||
|
||||
char* _alpm_MDFile(char *);
|
||||
void _alpm_MDPrint(unsigned char [16]);
|
||||
|
||||
#endif /* _ALPM_MD5_H */
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
#endif /* md5.h */
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/* MD5DRIVER.C - taken and modified from MDDRIVER.C (license below) */
|
||||
/* for use in pacman. */
|
||||
/*********************************************************************/
|
||||
|
||||
/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
|
||||
rights reserved.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
|
||||
/* The following makes MD default to MD5 if it has not already been
|
||||
defined with C compiler flags.
|
||||
*/
|
||||
#define MD MD5
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <libintl.h>
|
||||
|
||||
/* libalpm */
|
||||
#include "alpm.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
#include "md5.h"
|
||||
|
||||
/* Length of test block, number of test blocks.
|
||||
*/
|
||||
#define TEST_BLOCK_LEN 1000
|
||||
#define TEST_BLOCK_COUNT 1000
|
||||
|
||||
#define MD_CTX MD5_CTX
|
||||
#define MDInit _alpm_MD5Init
|
||||
#define MDUpdate _alpm_MD5Update
|
||||
#define MDFinal _alpm_MD5Final
|
||||
|
||||
char* _alpm_MDFile(char *filename)
|
||||
{
|
||||
FILE *file;
|
||||
MD_CTX context;
|
||||
int len;
|
||||
char hex[3];
|
||||
unsigned char buffer[1024], digest[16];
|
||||
|
||||
ALPM_LOG_FUNC;
|
||||
|
||||
if((file = fopen(filename, "rb")) == NULL) {
|
||||
_alpm_log(PM_LOG_ERROR, _("%s can't be opened\n"), filename);
|
||||
} else {
|
||||
char *ret;
|
||||
int i;
|
||||
|
||||
MDInit(&context);
|
||||
while((len = fread(buffer, 1, 1024, file))) {
|
||||
MDUpdate(&context, buffer, len);
|
||||
}
|
||||
MDFinal(digest, &context);
|
||||
fclose(file);
|
||||
|
||||
ret = calloc(33, sizeof(char));
|
||||
for(i = 0; i < 16; i++) {
|
||||
snprintf(hex, 3, "%02x", digest[i]);
|
||||
strncat(ret, hex, 2);
|
||||
}
|
||||
|
||||
_alpm_log(PM_LOG_DEBUG, _("md5(%s) = %s"), filename, ret);
|
||||
return(ret);
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/* vim: set ts=2 sw=2 noet: */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* package.h
|
||||
*
|
||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
||||
*
|
||||
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
||||
* Copyright (c) 2005, 2006 by Christian Hamar <krics@linuxforum.hu>
|
||||
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -18,16 +18,12 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef _ALPM_PACKAGE_H
|
||||
#define _ALPM_PACKAGE_H
|
||||
|
||||
#if defined(__APPLE__) || defined(__sun__)
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#include "alpm.h"
|
||||
#include "db.h"
|
||||
@@ -48,7 +44,6 @@ typedef enum _pmpkgfrom_t {
|
||||
#define PKG_TYPE_LEN 32
|
||||
#define PKG_PACKAGER_LEN 64
|
||||
#define PKG_MD5SUM_LEN 33
|
||||
#define PKG_SHA1SUM_LEN 41
|
||||
#define PKG_ARCH_LEN 32
|
||||
|
||||
struct __pmpkg_t {
|
||||
@@ -57,57 +52,48 @@ struct __pmpkg_t {
|
||||
char version[PKG_VERSION_LEN];
|
||||
char desc[PKG_DESC_LEN];
|
||||
char url[PKG_URL_LEN];
|
||||
char builddate[PKG_DATE_LEN];
|
||||
char buildtype[PKG_TYPE_LEN];
|
||||
char installdate[PKG_DATE_LEN];
|
||||
time_t builddate;
|
||||
time_t installdate;
|
||||
char packager[PKG_PACKAGER_LEN];
|
||||
char md5sum[PKG_MD5SUM_LEN];
|
||||
char sha1sum[PKG_SHA1SUM_LEN];
|
||||
char arch[PKG_ARCH_LEN];
|
||||
unsigned long size;
|
||||
unsigned long isize;
|
||||
unsigned short scriptlet;
|
||||
unsigned short force;
|
||||
time_t date;
|
||||
pmpkgreason_t reason;
|
||||
/* alpm_list_t *desc_localized;*/
|
||||
alpm_list_t *licenses;
|
||||
alpm_list_t *replaces;
|
||||
alpm_list_t *groups;
|
||||
alpm_list_t *files;
|
||||
alpm_list_t *backup;
|
||||
alpm_list_t *depends;
|
||||
alpm_list_t *removes;
|
||||
alpm_list_t *requiredby;
|
||||
alpm_list_t *optdepends;
|
||||
alpm_list_t *conflicts;
|
||||
alpm_list_t *provides;
|
||||
alpm_list_t *deltas;
|
||||
/* internal */
|
||||
pmpkgfrom_t origin;
|
||||
void *data;
|
||||
/* TODO replace 'data' with this:
|
||||
/* Replaced 'void *data' with this union as follows:
|
||||
origin == PKG_FROM_CACHE, use pkg->origin_data.db
|
||||
origin == PKG_FROM_FILE, use pkg->origin_data.fd
|
||||
union {
|
||||
int fd;
|
||||
pmdb_t *db;
|
||||
} origin_data;
|
||||
origin == PKG_FROM_FILE, use pkg->origin_data.file
|
||||
*/
|
||||
union {
|
||||
pmdb_t *db;
|
||||
char *file;
|
||||
} origin_data;
|
||||
pmdbinfrq_t infolevel;
|
||||
};
|
||||
|
||||
#define FREEPKG(p) do { if(p){_alpm_pkg_free(p); p = NULL;}} while(0)
|
||||
#define FREELISTPKGS(p) _FREELIST(p, _alpm_pkg_free)
|
||||
|
||||
int _alpm_versioncmp(const char *a, const char *b);
|
||||
pmpkg_t* _alpm_pkg_new(const char *name, const char *version);
|
||||
pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg);
|
||||
void _alpm_pkg_free(void *data);
|
||||
void _alpm_pkg_free(pmpkg_t *pkg);
|
||||
int _alpm_pkg_cmp(const void *p1, const void *p2);
|
||||
int alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg);
|
||||
pmpkg_t *_alpm_pkg_load(const char *pkgfile);
|
||||
int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg);
|
||||
pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full);
|
||||
pmpkg_t *_alpm_pkg_find(const char *needle, alpm_list_t *haystack);
|
||||
int _alpm_pkg_splitname(const char *target, char *name, char *version, int witharch);
|
||||
int _alpm_pkg_istoonew(pmpkg_t *pkg);
|
||||
void _alpm_pkg_update_requiredby(pmpkg_t *pkg);
|
||||
int _alpm_pkg_should_ignore(pmpkg_t *pkg);
|
||||
|
||||
#endif /* _ALPM_PACKAGE_H */
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.gmo
|
||||
POTFILES
|
||||
stamp-po
|
||||
@@ -1,8 +1,11 @@
|
||||
# Set of available languages.
|
||||
cs
|
||||
de
|
||||
en_GB
|
||||
es
|
||||
fr
|
||||
hu
|
||||
it
|
||||
pl
|
||||
pt_BR
|
||||
en_GB
|
||||
ru_RU
|
||||
ru
|
||||
|
||||
@@ -8,18 +8,16 @@ lib/libalpm/be_files.c
|
||||
lib/libalpm/cache.c
|
||||
lib/libalpm/conflict.c
|
||||
lib/libalpm/db.c
|
||||
lib/libalpm/delta.c
|
||||
lib/libalpm/deps.c
|
||||
lib/libalpm/error.c
|
||||
lib/libalpm/group.c
|
||||
lib/libalpm/handle.c
|
||||
lib/libalpm/log.c
|
||||
lib/libalpm/md5.c
|
||||
lib/libalpm/md5driver.c
|
||||
lib/libalpm/package.c
|
||||
lib/libalpm/provide.c
|
||||
lib/libalpm/remove.c
|
||||
lib/libalpm/sha1.c
|
||||
lib/libalpm/server.c
|
||||
lib/libalpm/sync.c
|
||||
lib/libalpm/trans.c
|
||||
lib/libalpm/util.c
|
||||
lib/libalpm/versioncmp.c
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user