mirror of
https://gitlab.archlinux.org/pacman/pacman.git
synced 2025-11-06 10:34:40 +01:00
Compare commits
1330 Commits
v3.0.0-rc1
...
v3.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fabf7ad6c4 | ||
|
|
8485b7b3a4 | ||
|
|
115dcf0911 | ||
|
|
5949936777 | ||
|
|
a7244e6ab2 | ||
|
|
5d6788b36e | ||
|
|
6ede1a5af0 | ||
|
|
0e0a846135 | ||
|
|
428b2fd8cc | ||
|
|
9a6fd1b021 | ||
|
|
e4b1a97ff2 | ||
|
|
85f5279ec0 | ||
|
|
20a0b8e201 | ||
|
|
3bf9448943 | ||
|
|
cf25884e99 | ||
|
|
9f57921467 | ||
|
|
7bc34ccde3 | ||
|
|
b8e306b73e | ||
|
|
8877c88def | ||
|
|
dfae7bdd52 | ||
|
|
e6fb229534 | ||
|
|
5078ca580e | ||
|
|
310b13a4b7 | ||
|
|
c317222d71 | ||
|
|
67f388c3fc | ||
|
|
5e4882dfe8 | ||
|
|
075b244be2 | ||
|
|
69f00385a9 | ||
|
|
06a4a5bd68 | ||
|
|
22722261cc | ||
|
|
24783e6b6b | ||
|
|
c9550e9655 | ||
|
|
a7ee8f90f9 | ||
|
|
12e804511a | ||
|
|
6d4f235af9 | ||
|
|
441c2dd550 | ||
|
|
27f56304d6 | ||
|
|
501ce943e6 | ||
|
|
b169925c1e | ||
|
|
c1a648137e | ||
|
|
4ebad47ae7 | ||
|
|
ad697d2fd5 | ||
|
|
991dfca90e | ||
|
|
ae9e33ed88 | ||
|
|
b4f2cb53ef | ||
|
|
2b73d45127 | ||
|
|
a8405847e6 | ||
|
|
99be5ab8d1 | ||
|
|
471ed04790 | ||
|
|
5929508198 | ||
|
|
03021713e5 | ||
|
|
ffa3056010 | ||
|
|
37b5972212 | ||
|
|
17e9c9d9ff | ||
|
|
0bf66b097f | ||
|
|
95995ae93f | ||
|
|
8741908276 | ||
|
|
fd8969f678 | ||
|
|
f724fb2702 | ||
|
|
1d9d47d62c | ||
|
|
b196cc43a5 | ||
|
|
d92b0e674d | ||
|
|
30702350fa | ||
|
|
72c0ab5c51 | ||
|
|
8856146d71 | ||
|
|
616b5967b8 | ||
|
|
f7199f36ba | ||
|
|
2122eb1428 | ||
|
|
5f701005ed | ||
|
|
11695bd0d7 | ||
|
|
d534488f2d | ||
|
|
b15fb504a1 | ||
|
|
74eb2f5c61 | ||
|
|
7edb2e5b0d | ||
|
|
d594b6e797 | ||
|
|
5c6809987e | ||
|
|
deec3c8d00 | ||
|
|
d88524ea0e | ||
|
|
29bf6814f7 | ||
|
|
7ff5a917fd | ||
|
|
b9445c12cf | ||
|
|
b8a66d6859 | ||
|
|
2158b8e298 | ||
|
|
fff746052c | ||
|
|
a1dfa8e61f | ||
|
|
89819b3f92 | ||
|
|
c11bdf19b1 | ||
|
|
7313c8546a | ||
|
|
331891ceb1 | ||
|
|
6d737254fc | ||
|
|
0077bfa3a0 | ||
|
|
7fc306cd41 | ||
|
|
1824bc6ee6 | ||
|
|
f827c9572e | ||
|
|
4979157cba | ||
|
|
0fc538fcdb | ||
|
|
512282ca54 | ||
|
|
fcac23763b | ||
|
|
b04d6e751a | ||
|
|
5ae02e6ae7 | ||
|
|
d030d12542 | ||
|
|
0966c33a72 | ||
|
|
fe781e4ce4 | ||
|
|
0669c9bfac | ||
|
|
62b4195c76 | ||
|
|
4a802838cb | ||
|
|
5f0692def8 | ||
|
|
636610432a | ||
|
|
54e1e3e642 | ||
|
|
2cd0a87b3f | ||
|
|
b48f703aa6 | ||
|
|
009f89c4d2 | ||
|
|
b32aa81b5e | ||
|
|
62ee1bfff0 | ||
|
|
1cca4ef764 | ||
|
|
b262ddb2ed | ||
|
|
f30dab4b5a | ||
|
|
c1a5616c26 | ||
|
|
da1c11cc30 | ||
|
|
ad54b28680 | ||
|
|
ae40d1c05b | ||
|
|
9577c07d86 | ||
|
|
c33cabd675 | ||
|
|
20ae871940 | ||
|
|
b9369a747d | ||
|
|
149839c539 | ||
|
|
1d71079c5b | ||
|
|
398d4aff2d | ||
|
|
bf2964dc58 | ||
|
|
fb09d35e6a | ||
|
|
33e3182dbd | ||
|
|
a8ee185413 | ||
|
|
8428367285 | ||
|
|
dd98aa8564 | ||
|
|
a422f6e39c | ||
|
|
f671147282 | ||
|
|
ae5ef3b90f | ||
|
|
584ffa6aef | ||
|
|
d5278ebb3b | ||
|
|
f43805d875 | ||
|
|
8248b4bfb1 | ||
|
|
e80232f24c | ||
|
|
663408532a | ||
|
|
13f24a5bda | ||
|
|
0460038447 | ||
|
|
3c3cb001a4 | ||
|
|
3175faace4 | ||
|
|
e3d35b3274 | ||
|
|
0bfc8adf37 | ||
|
|
1ba0d84da2 | ||
|
|
b49fc504ac | ||
|
|
2edd01a973 | ||
|
|
502645c0e3 | ||
|
|
df5024fd64 | ||
|
|
081ba4816e | ||
|
|
7fccfc7819 | ||
|
|
a13bf74979 | ||
|
|
5389cdf654 | ||
|
|
6b31183576 | ||
|
|
8f902865d9 | ||
|
|
010279e449 | ||
|
|
4e6361642e | ||
|
|
1201c8ce3a | ||
|
|
245efca759 | ||
|
|
27943a04d6 | ||
|
|
6d79ba2db0 | ||
|
|
481c3edc89 | ||
|
|
8fdf08ef78 | ||
|
|
670fadf041 | ||
|
|
701a03dcdb | ||
|
|
30bdf94c2b | ||
|
|
ff9744aa1f | ||
|
|
1b5a851851 | ||
|
|
423820b34c | ||
|
|
7a873a8f12 | ||
|
|
64e1dd64a4 | ||
|
|
c465d9e848 | ||
|
|
5e375aa9d3 | ||
|
|
bf84c23266 | ||
|
|
0d8affeac0 | ||
|
|
c7a81c0b54 | ||
|
|
d685d0220f | ||
|
|
ba70c52945 | ||
|
|
2d991a25ae | ||
|
|
db4258c1fd | ||
|
|
9f56137034 | ||
|
|
ee2bbb39b5 | ||
|
|
4bd0a85095 | ||
|
|
e9a0d35d08 | ||
|
|
4b7f7e2a59 | ||
|
|
57acfced0d | ||
|
|
83c4b2aebb | ||
|
|
bec2ba5b40 | ||
|
|
9441fba124 | ||
|
|
a708c6eadc | ||
|
|
9c7ebe6872 | ||
|
|
4c872594da | ||
|
|
e4a4cf7ce5 | ||
|
|
4004bf9caf | ||
|
|
404e0a0e10 | ||
|
|
b3f4bd9750 | ||
|
|
073bac794d | ||
|
|
0b8abf376f | ||
|
|
ab9187d07d | ||
|
|
0bd6fb3bc2 | ||
|
|
5f17ac8150 | ||
|
|
4b8ada818e | ||
|
|
0d1263af26 | ||
|
|
41c1295559 | ||
|
|
d9b9e60d7d | ||
|
|
3fe43ffa04 | ||
|
|
562442633a | ||
|
|
d140b440a8 | ||
|
|
f8c737d3b6 | ||
|
|
1dfd841e40 | ||
|
|
5f1ccdbc27 | ||
|
|
d1ea16dfd0 | ||
|
|
6104f2e1fb | ||
|
|
1086950c82 | ||
|
|
7995a25d0e | ||
|
|
bf86700369 | ||
|
|
90a48c771d | ||
|
|
f7f43dbb48 | ||
|
|
3d10d460df | ||
|
|
5af076f09f | ||
|
|
2f8fb80ee6 | ||
|
|
7d451b6e6b | ||
|
|
d07001f3ab | ||
|
|
e7a2232934 | ||
|
|
73ab153c44 | ||
|
|
b3e6cf652c | ||
|
|
dae3f9deef | ||
|
|
1f30845e41 | ||
|
|
35135c0a0c | ||
|
|
6e4b020654 | ||
|
|
6820be9ba1 | ||
|
|
804ab37ea6 | ||
|
|
d060e31be3 | ||
|
|
f56f7ff391 | ||
|
|
91b7f288fe | ||
|
|
fc48dc3118 | ||
|
|
51e0303e84 | ||
|
|
2f9f48eddd | ||
|
|
1dfcf1495b | ||
|
|
724ed34ac5 | ||
|
|
74c5bd70cf | ||
|
|
797c190f93 | ||
|
|
3ec45486ff | ||
|
|
266f06866b | ||
|
|
69eb0c8014 | ||
|
|
5a48771126 | ||
|
|
54af52f87d | ||
|
|
7c3f6feb41 | ||
|
|
6ad4ba272d | ||
|
|
4a0498bd29 | ||
|
|
190d17c0e8 | ||
|
|
8725dce294 | ||
|
|
1bbc00cd9d | ||
|
|
8a24ad3754 | ||
|
|
816b080579 | ||
|
|
4c465ef0ad | ||
|
|
49197b7492 | ||
|
|
11bdab171e | ||
|
|
17eca54b32 | ||
|
|
73ac9f7b27 | ||
|
|
aecc2fd190 | ||
|
|
7613f2e21a | ||
|
|
d734ebdde2 | ||
|
|
c2dbbd60bc | ||
|
|
4fe7eb66eb | ||
|
|
79945ef7ff | ||
|
|
d49f42ba75 | ||
|
|
d75f693155 | ||
|
|
8efe0ecb25 | ||
|
|
7a9d444de8 | ||
|
|
66591e8284 | ||
|
|
7eaad2f2a9 | ||
|
|
c23ecc6160 | ||
|
|
f159203f6f | ||
|
|
81a2a06818 | ||
|
|
3e8ae774bd | ||
|
|
143135e666 | ||
|
|
ca1a187131 | ||
|
|
8cfccf68c1 | ||
|
|
d5857ee15b | ||
|
|
271ecb8bfc | ||
|
|
3ad3077d8d | ||
|
|
96f7613d15 | ||
|
|
3a6f62d4c7 | ||
|
|
105e01c8ef | ||
|
|
4c14dcc580 | ||
|
|
a6470956bc | ||
|
|
29f55fb7c9 | ||
|
|
731a774319 | ||
|
|
8ded60326a | ||
|
|
a3e6a6b822 | ||
|
|
4bd52f3fe4 | ||
|
|
420c8846b9 | ||
|
|
7879e4bef7 | ||
|
|
6f3949e3da | ||
|
|
2b3a85dc4a | ||
|
|
fc9d12bef0 | ||
|
|
5676dbae4d | ||
|
|
81db1847c9 | ||
|
|
848edb2f38 | ||
|
|
b091ccc400 | ||
|
|
4ac9b2eb06 | ||
|
|
3559306546 | ||
|
|
2374c81e55 | ||
|
|
42f5579fd7 | ||
|
|
3078494767 | ||
|
|
273950473e | ||
|
|
92ab7c33fb | ||
|
|
6b07b5d345 | ||
|
|
a16608c610 | ||
|
|
be95e4d8a0 | ||
|
|
fe4e07bd2f | ||
|
|
59a6b519da | ||
|
|
2b0c89b06a | ||
|
|
0f74ae0885 | ||
|
|
b206aaee88 | ||
|
|
141e569840 | ||
|
|
706c690b64 | ||
|
|
ccc57de6b6 | ||
|
|
279fbc44b1 | ||
|
|
69188d75fb | ||
|
|
e8d665fbf7 | ||
|
|
f4ac63ab43 | ||
|
|
8068a14c52 | ||
|
|
9bf487b2ff | ||
|
|
fbf3beb8d2 | ||
|
|
7586072beb | ||
|
|
17180890a5 | ||
|
|
bfc024eab3 | ||
|
|
77c3cf9790 | ||
|
|
7dc37109b0 | ||
|
|
14ee1be1ef | ||
|
|
11fe18479e | ||
|
|
0c2206f542 | ||
|
|
05d5634958 | ||
|
|
e63366ae5e | ||
|
|
e81dec9b8c | ||
|
|
eca30ed66a | ||
|
|
b29838c825 | ||
|
|
7d7a337912 | ||
|
|
93a3050ed9 | ||
|
|
a7a9f37561 | ||
|
|
7069b96173 | ||
|
|
69bc5ea5e2 | ||
|
|
96ee1bca24 | ||
|
|
37bb99abfa | ||
|
|
5d03a6fd94 | ||
|
|
4fad7855fa | ||
|
|
7786bf6024 | ||
|
|
c492ca840c | ||
|
|
7cfb343b0f | ||
|
|
b1103a3eaf | ||
|
|
5647f7f512 | ||
|
|
c028014f96 | ||
|
|
1fc83f4af6 | ||
|
|
9fbb77c91b | ||
|
|
9bfbd73917 | ||
|
|
ea828b5693 | ||
|
|
f432ce41e0 | ||
|
|
0775c38e72 | ||
|
|
f950c26307 | ||
|
|
11692e0eef | ||
|
|
88cbee3c24 | ||
|
|
69c6d59bb6 | ||
|
|
8240da6cb3 | ||
|
|
bd43a7f155 | ||
|
|
22c900e7d5 | ||
|
|
6b8f404a33 | ||
|
|
8ca6501ee1 | ||
|
|
9247ddbe8a | ||
|
|
36264a3ab9 | ||
|
|
cbcf542ad2 | ||
|
|
2a7101c049 | ||
|
|
b2914bf0af | ||
|
|
927af790ee | ||
|
|
bba62655fe | ||
|
|
73ee64d49f | ||
|
|
ba7687f58e | ||
|
|
003adb7646 | ||
|
|
3b464dc897 | ||
|
|
cee314fc5e | ||
|
|
f6785dcb89 | ||
|
|
8ec9a67aee | ||
|
|
57ec111a4e | ||
|
|
f374ead66a | ||
|
|
84084aa44c | ||
|
|
8343121f87 | ||
|
|
6f181c22d2 | ||
|
|
de5e49f4be | ||
|
|
601f6a8a29 | ||
|
|
d9a9ffd77d | ||
|
|
06dd617b59 | ||
|
|
1379f4e9ac | ||
|
|
12417e91ad | ||
|
|
eb77f0dbd2 | ||
|
|
6b242b3725 | ||
|
|
eccda0dfad | ||
|
|
db557e0563 | ||
|
|
38e981fab3 | ||
|
|
a0ac72b422 | ||
|
|
9a18e0dbef | ||
|
|
0c5b68877b | ||
|
|
6eee9e987a | ||
|
|
1dca8b6309 | ||
|
|
223a0ce89d | ||
|
|
307f4d7301 | ||
|
|
fd86c62db8 | ||
|
|
ffff094126 | ||
|
|
6ee95afe7e | ||
|
|
e93b0a2f37 | ||
|
|
916e226b78 | ||
|
|
801a268056 | ||
|
|
549c2878f9 | ||
|
|
8186dc11a9 | ||
|
|
521de7ceed | ||
|
|
bbe02ec57f | ||
|
|
47e8dd0670 | ||
|
|
78e7342c16 | ||
|
|
ab506f77c0 | ||
|
|
3de2147376 | ||
|
|
4f26701793 | ||
|
|
435ec29bc7 | ||
|
|
633dbeac88 | ||
|
|
e654236db6 | ||
|
|
26f4993e1d | ||
|
|
2630556bde | ||
|
|
112caad838 | ||
|
|
3e133524a5 | ||
|
|
8ffa6fa7ad | ||
|
|
8372a9e8c7 | ||
|
|
318d5c4ba8 | ||
|
|
f9a7d8cba4 | ||
|
|
ccc1c73152 | ||
|
|
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 | ||
|
|
ef578e77c8 | ||
|
|
cfbec7464f | ||
|
|
10ba636987 | ||
|
|
1cd7567ff8 | ||
|
|
8153e3851e | ||
|
|
c87745646c | ||
|
|
ec689b5978 | ||
|
|
9c9e18ef32 | ||
|
|
ea3a182dbf | ||
|
|
32924c9bdb | ||
|
|
d32ef4329c | ||
|
|
dea03d715b | ||
|
|
d2c6bcdbbd | ||
|
|
f044e23a60 | ||
|
|
583b4b10a3 | ||
|
|
8fd16d0dcb | ||
|
|
b8602adee9 | ||
|
|
c3ad8bd75f | ||
|
|
e9ee9045ff | ||
|
|
60a588261c | ||
|
|
5bc43df6f3 | ||
|
|
f72db27c5c | ||
|
|
3382a1416f | ||
|
|
19cec12f73 | ||
|
|
1d35c4dcc6 | ||
|
|
a0f8f03056 | ||
|
|
1e859c647f | ||
|
|
970d2e942e | ||
|
|
9a9f1e00da | ||
|
|
d6d7435a6c | ||
|
|
bbe55b5ce9 | ||
|
|
462ad153e7 | ||
|
|
3ef1aeb8bd | ||
|
|
4a0aac3862 | ||
|
|
ab8c825364 | ||
|
|
8cacc46f8b | ||
|
|
5ec3ed4674 | ||
|
|
a2a781f416 | ||
|
|
d47b8cdf48 | ||
|
|
58fe79eef6 | ||
|
|
a07b490344 | ||
|
|
f8d0601b8d | ||
|
|
d38b273f91 | ||
|
|
5702b943e8 | ||
|
|
9cf9606459 | ||
|
|
19faa24cf3 | ||
|
|
4a75cb7e52 | ||
|
|
df59a18460 | ||
|
|
b882353d48 | ||
|
|
bdfe232b8a | ||
|
|
118671eff4 | ||
|
|
d8ec08f578 | ||
|
|
3aa0c85716 | ||
|
|
d763017233 | ||
|
|
5a37682525 | ||
|
|
06d7e3d7c3 | ||
|
|
3a4030837e | ||
|
|
75d6149711 | ||
|
|
79ecbd82bd | ||
|
|
40855b48fe | ||
|
|
941c23025c | ||
|
|
8ded2051d2 | ||
|
|
b6018c436d | ||
|
|
9b08a5aa97 | ||
|
|
0fa7d47a4d | ||
|
|
b882f463df | ||
|
|
62d0a00511 | ||
|
|
eef6154620 | ||
|
|
22206d5bea | ||
|
|
bd55cf548c | ||
|
|
cf6f184243 | ||
|
|
bf1885b1e0 | ||
|
|
a755dacea2 | ||
|
|
bd7b7e5f0c | ||
|
|
ff76c8c552 | ||
|
|
4bfd0cb6cc | ||
|
|
1205e544d3 | ||
|
|
fa4a6eec4d | ||
|
|
0d38e4f977 | ||
|
|
fb938770c3 | ||
|
|
6e05ad1d24 | ||
|
|
2020e0ec73 | ||
|
|
74e8b28fc3 | ||
|
|
9e3a185345 | ||
|
|
38784a7eb5 | ||
|
|
5f15a80274 | ||
|
|
0203fabe54 | ||
|
|
ba1806f5ac | ||
|
|
9ba23c8248 | ||
|
|
39478292af | ||
|
|
0a1b2544cb | ||
|
|
7f7da2b5fc | ||
|
|
f94506396f | ||
|
|
2f4c1fe647 | ||
|
|
187eb7492d | ||
|
|
6f870968ed | ||
|
|
68876e4eb0 | ||
|
|
0a1ca73183 | ||
|
|
28aca444a2 | ||
|
|
3461786b19 | ||
|
|
abcb5494bc | ||
|
|
dddf759004 | ||
|
|
4268eda3a6 | ||
|
|
fd312c35eb | ||
|
|
166ffc4f9e | ||
|
|
1a9e6015c7 | ||
|
|
7e19b3238a | ||
|
|
9418333166 | ||
|
|
631a71f11a | ||
|
|
48181e9a84 | ||
|
|
e6d6ee2c5a | ||
|
|
aaa356999a | ||
|
|
45855badc1 | ||
|
|
e1704bfdd6 | ||
|
|
a50105bede | ||
|
|
294eff6021 | ||
|
|
90b75a0435 | ||
|
|
5baba84397 | ||
|
|
869e81e1cf | ||
|
|
facb99098d | ||
|
|
94b5e39407 | ||
|
|
2caadb33bf | ||
|
|
714a414e72 | ||
|
|
4770ac784e |
6
.cvsignore → .gitignore
vendored
6
.cvsignore → .gitignore
vendored
@@ -8,9 +8,11 @@ config.h
|
|||||||
config.h.in
|
config.h.in
|
||||||
config.log
|
config.log
|
||||||
config.status
|
config.status
|
||||||
|
config.status.lineno
|
||||||
config.rpath
|
config.rpath
|
||||||
config.sub
|
config.sub
|
||||||
configure
|
configure
|
||||||
|
configure.lineno
|
||||||
depcomp
|
depcomp
|
||||||
install-sh
|
install-sh
|
||||||
libtool
|
libtool
|
||||||
@@ -18,7 +20,11 @@ ltmain.sh
|
|||||||
missing
|
missing
|
||||||
stamp-h1
|
stamp-h1
|
||||||
|
|
||||||
|
*.o
|
||||||
|
*~
|
||||||
root
|
root
|
||||||
tags
|
tags
|
||||||
cscope.out
|
cscope.out
|
||||||
|
cscope.in.out
|
||||||
|
cscope.po.out
|
||||||
pacman-*.tar.gz
|
pacman-*.tar.gz
|
||||||
9
AUTHORS
9
AUTHORS
@@ -3,11 +3,14 @@ Aurelien Foret <aurelien@archlinux.org>
|
|||||||
Aaron Griffin <aaron@archlinux.org>
|
Aaron Griffin <aaron@archlinux.org>
|
||||||
Dan McGee <dan@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>
|
Christian Hamar <krics@linuxforum.hu>
|
||||||
|
|
||||||
Josh Wheeler <deltalima@gmail.com>
|
Josh Wheeler <deltalima@gmail.com>
|
||||||
David Kimpe <DNAku@frugalware.org>
|
David Kimpe <DNAku@frugalware.org>
|
||||||
|
|
||||||
James Rosten <seinfeld90@gmail.com>
|
James Rosten <seinfeld90@gmail.com>
|
||||||
Roman Kyrylych <Roman.Kyrylych@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
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
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
|
General Public License applies to most of the Free Software
|
||||||
Foundation's software and to any other program whose authors commit to
|
Foundation's software and to any other program whose authors commit to
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
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.
|
your programs, too.
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
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
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
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
|
License. (Exception: if the Program itself is interactive but
|
||||||
does not normally print such an announcement, your work based on
|
does not normally print such an announcement, your work based on
|
||||||
the Program is not required to print an announcement.)
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
These requirements apply to the modified work as a whole. If
|
||||||
identifiable sections of that work are not derived from the Program,
|
identifiable sections of that work are not derived from the Program,
|
||||||
and can be reasonably considered independent and separate works in
|
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
|
access to copy the source code from the same place counts as
|
||||||
distribution of the source code, even though third parties are not
|
distribution of the source code, even though third parties are not
|
||||||
compelled to copy the source along with the object code.
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
except as expressly provided under this License. Any attempt
|
except as expressly provided under this License. Any attempt
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
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
|
This section is intended to make thoroughly clear what is believed to
|
||||||
be a consequence of the rest of this License.
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
original copyright holder who places the Program under this License
|
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.
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
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
|
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
|
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.
|
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.>
|
<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
|
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
|
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
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License along
|
||||||
along with this program; if not, write to the Free Software
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
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
|
If the program is interactive, make it output a short notice like this
|
||||||
when it starts in an interactive mode:
|
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'.
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
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
|
This General Public License does not permit incorporating your program into
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
consider it more useful to permit linking proprietary applications with the
|
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.
|
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.
|
||||||
135
HACKING
135
HACKING
@@ -1,52 +1,71 @@
|
|||||||
Contributing to pacman
|
Pacman - Contributing
|
||||||
======================
|
=====================
|
||||||
|
|
||||||
Please read 'submitting-patches' and 'translation-help' in the same directory as
|
This file is meant to give you a brief overview of coding style and other
|
||||||
this file.
|
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
|
Coding style
|
||||||
------------
|
------------
|
||||||
|
|
||||||
1. All code should be indented with tabs. (Ignore the use of only spaces in
|
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:
|
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
|
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
|
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
|
gets its own line (the only exception being 'else'). Do not use extra
|
||||||
spaces around the parentheses of the block. ALWAYS use opening/closing
|
spaces around the parentheses of the block. ALWAYS use opening and closing
|
||||||
braces, even if it's just a one-line block.
|
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) {
|
while(it) {
|
||||||
newlist = _alpm_list_add(newlist, strdup(lp->data));
|
ptr = it->next;
|
||||||
}
|
if(fn) {
|
||||||
|
fn(it->data);
|
||||||
while(it) {
|
} else {
|
||||||
ptr = it->next;
|
return(1);
|
||||||
if(fn) {
|
}
|
||||||
fn(it->data);
|
free(it);
|
||||||
} else {
|
it = ptr;
|
||||||
return(1);
|
}
|
||||||
}
|
code~~~~~~~~~~
|
||||||
free(it);
|
|
||||||
it = ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
3. When declaring a new function, put the opening and closing braces on their
|
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
|
own line. Also, when declaring a pointer, do not put a space between the
|
||||||
asterisk and the variable name.
|
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)
|
ptr = list;
|
||||||
{
|
if(ptr == NULL) {
|
||||||
pmlist_t *ptr, *lp;
|
...
|
||||||
|
}
|
||||||
|
...
|
||||||
|
}
|
||||||
|
code~~~~~~~~~~
|
||||||
|
|
||||||
ptr = list;
|
4. Comments should be ANSI-C89 compliant. That means no `// Comment` style;
|
||||||
if(ptr == NULL) {
|
use only `/* Comment */` style.
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
4. Comments should be ANSI-C89 compliant. That means no "// Comment" style;
|
/* This is a comment */
|
||||||
use only "/* Comment */" style.
|
NOT
|
||||||
|
// This is a comment
|
||||||
|
|
||||||
5. Return statements should be written like a function call.
|
5. Return statements should be written like a function call.
|
||||||
|
|
||||||
@@ -62,4 +81,58 @@ Coding style
|
|||||||
NOT
|
NOT
|
||||||
sizeof(*mylist);
|
sizeof(*mylist);
|
||||||
|
|
||||||
vim: set ts=2 sw=2 et:
|
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 syntax=asciidoc et:
|
||||||
|
/////
|
||||||
|
|||||||
234
INSTALL
Normal file
234
INSTALL
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
Installation Instructions
|
||||||
|
*************************
|
||||||
|
|
||||||
|
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||||
|
2006 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is free documentation; the Free Software Foundation gives
|
||||||
|
unlimited permission to copy, distribute and modify it.
|
||||||
|
|
||||||
|
Basic Installation
|
||||||
|
==================
|
||||||
|
|
||||||
|
Briefly, the shell commands `./configure; make; make install' should
|
||||||
|
configure, build, and install this package. The following
|
||||||
|
more-detailed instructions are generic; see the `README' file for
|
||||||
|
instructions specific to this package.
|
||||||
|
|
||||||
|
The `configure' shell script attempts to guess correct values for
|
||||||
|
various system-dependent variables used during compilation. It uses
|
||||||
|
those values to create a `Makefile' in each directory of the package.
|
||||||
|
It may also create one or more `.h' files containing system-dependent
|
||||||
|
definitions. Finally, it creates a shell script `config.status' that
|
||||||
|
you can run in the future to recreate the current configuration, and a
|
||||||
|
file `config.log' containing compiler output (useful mainly for
|
||||||
|
debugging `configure').
|
||||||
|
|
||||||
|
It can also use an optional file (typically called `config.cache'
|
||||||
|
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||||
|
the results of its tests to speed up reconfiguring. Caching is
|
||||||
|
disabled by default to prevent problems with accidental use of stale
|
||||||
|
cache files.
|
||||||
|
|
||||||
|
If you need to do unusual things to compile the package, please try
|
||||||
|
to figure out how `configure' could check whether to do them, and mail
|
||||||
|
diffs or instructions to the address given in the `README' so they can
|
||||||
|
be considered for the next release. If you are using the cache, and at
|
||||||
|
some point `config.cache' contains results you don't want to keep, you
|
||||||
|
may remove or edit it.
|
||||||
|
|
||||||
|
The file `configure.ac' (or `configure.in') is used to create
|
||||||
|
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||||
|
you want to change it or regenerate `configure' using a newer version
|
||||||
|
of `autoconf'.
|
||||||
|
|
||||||
|
The simplest way to compile this package is:
|
||||||
|
|
||||||
|
1. `cd' to the directory containing the package's source code and type
|
||||||
|
`./configure' to configure the package for your system.
|
||||||
|
|
||||||
|
Running `configure' might take a while. While running, it prints
|
||||||
|
some messages telling which features it is checking for.
|
||||||
|
|
||||||
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
|
3. Optionally, type `make check' to run any self-tests that come with
|
||||||
|
the package.
|
||||||
|
|
||||||
|
4. Type `make install' to install the programs and any data files and
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
5. You can remove the program binaries and object files from the
|
||||||
|
source code directory by typing `make clean'. To also remove the
|
||||||
|
files that `configure' created (so you can compile the package for
|
||||||
|
a different kind of computer), type `make distclean'. There is
|
||||||
|
also a `make maintainer-clean' target, but that is intended mainly
|
||||||
|
for the package's developers. If you use it, you may have to get
|
||||||
|
all sorts of other programs in order to regenerate files that came
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
Compilers and Options
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Some systems require unusual options for compilation or linking that the
|
||||||
|
`configure' script does not know about. Run `./configure --help' for
|
||||||
|
details on some of the pertinent environment variables.
|
||||||
|
|
||||||
|
You can give `configure' initial values for configuration parameters
|
||||||
|
by setting variables in the command line or in the environment. Here
|
||||||
|
is an example:
|
||||||
|
|
||||||
|
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||||
|
|
||||||
|
*Note Defining Variables::, for more details.
|
||||||
|
|
||||||
|
Compiling For Multiple Architectures
|
||||||
|
====================================
|
||||||
|
|
||||||
|
You can compile the package for more than one kind of computer at the
|
||||||
|
same time, by placing the object files for each architecture in their
|
||||||
|
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||||
|
directory where you want the object files and executables to go and run
|
||||||
|
the `configure' script. `configure' automatically checks for the
|
||||||
|
source code in the directory that `configure' is in and in `..'.
|
||||||
|
|
||||||
|
With a non-GNU `make', it is safer to compile the package for one
|
||||||
|
architecture at a time in the source code directory. After you have
|
||||||
|
installed the package for one architecture, use `make distclean' before
|
||||||
|
reconfiguring for another architecture.
|
||||||
|
|
||||||
|
Installation Names
|
||||||
|
==================
|
||||||
|
|
||||||
|
By default, `make install' installs the package's commands under
|
||||||
|
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||||
|
can specify an installation prefix other than `/usr/local' by giving
|
||||||
|
`configure' the option `--prefix=PREFIX'.
|
||||||
|
|
||||||
|
You can specify separate installation prefixes for
|
||||||
|
architecture-specific files and architecture-independent files. If you
|
||||||
|
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||||
|
PREFIX as the prefix for installing programs and libraries.
|
||||||
|
Documentation and other data files still use the regular prefix.
|
||||||
|
|
||||||
|
In addition, if you use an unusual directory layout you can give
|
||||||
|
options like `--bindir=DIR' to specify different values for particular
|
||||||
|
kinds of files. Run `configure --help' for a list of the directories
|
||||||
|
you can set and what kinds of files go in them.
|
||||||
|
|
||||||
|
If the package supports it, you can cause programs to be installed
|
||||||
|
with an extra prefix or suffix on their names by giving `configure' the
|
||||||
|
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||||
|
|
||||||
|
Optional Features
|
||||||
|
=================
|
||||||
|
|
||||||
|
Some packages pay attention to `--enable-FEATURE' options to
|
||||||
|
`configure', where FEATURE indicates an optional part of the package.
|
||||||
|
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||||
|
is something like `gnu-as' or `x' (for the X Window System). The
|
||||||
|
`README' should mention any `--enable-' and `--with-' options that the
|
||||||
|
package recognizes.
|
||||||
|
|
||||||
|
For packages that use the X Window System, `configure' can usually
|
||||||
|
find the X include and library files automatically, but if it doesn't,
|
||||||
|
you can use the `configure' options `--x-includes=DIR' and
|
||||||
|
`--x-libraries=DIR' to specify their locations.
|
||||||
|
|
||||||
|
Specifying the System Type
|
||||||
|
==========================
|
||||||
|
|
||||||
|
There may be some features `configure' cannot figure out automatically,
|
||||||
|
but needs to determine by the type of machine the package will run on.
|
||||||
|
Usually, assuming the package is built to be run on the _same_
|
||||||
|
architectures, `configure' can figure that out, but if it prints a
|
||||||
|
message saying it cannot guess the machine type, give it the
|
||||||
|
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||||
|
type, such as `sun4', or a canonical name which has the form:
|
||||||
|
|
||||||
|
CPU-COMPANY-SYSTEM
|
||||||
|
|
||||||
|
where SYSTEM can have one of these forms:
|
||||||
|
|
||||||
|
OS KERNEL-OS
|
||||||
|
|
||||||
|
See the file `config.sub' for the possible values of each field. If
|
||||||
|
`config.sub' isn't included in this package, then this package doesn't
|
||||||
|
need to know the machine type.
|
||||||
|
|
||||||
|
If you are _building_ compiler tools for cross-compiling, you should
|
||||||
|
use the option `--target=TYPE' to select the type of system they will
|
||||||
|
produce code for.
|
||||||
|
|
||||||
|
If you want to _use_ a cross compiler, that generates code for a
|
||||||
|
platform different from the build platform, you should specify the
|
||||||
|
"host" platform (i.e., that on which the generated programs will
|
||||||
|
eventually be run) with `--host=TYPE'.
|
||||||
|
|
||||||
|
Sharing Defaults
|
||||||
|
================
|
||||||
|
|
||||||
|
If you want to set default values for `configure' scripts to share, you
|
||||||
|
can create a site shell script called `config.site' that gives default
|
||||||
|
values for variables like `CC', `cache_file', and `prefix'.
|
||||||
|
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||||
|
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||||
|
`CONFIG_SITE' environment variable to the location of the site script.
|
||||||
|
A warning: not all `configure' scripts look for a site script.
|
||||||
|
|
||||||
|
Defining Variables
|
||||||
|
==================
|
||||||
|
|
||||||
|
Variables not defined in a site shell script can be set in the
|
||||||
|
environment passed to `configure'. However, some packages may run
|
||||||
|
configure again during the build, and the customized values of these
|
||||||
|
variables may be lost. In order to avoid this problem, you should set
|
||||||
|
them in the `configure' command line, using `VAR=value'. For example:
|
||||||
|
|
||||||
|
./configure CC=/usr/local2/bin/gcc
|
||||||
|
|
||||||
|
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||||
|
overridden in the site shell script).
|
||||||
|
|
||||||
|
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||||
|
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||||
|
|
||||||
|
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||||
|
|
||||||
|
`configure' Invocation
|
||||||
|
======================
|
||||||
|
|
||||||
|
`configure' recognizes the following options to control how it operates.
|
||||||
|
|
||||||
|
`--help'
|
||||||
|
`-h'
|
||||||
|
Print a summary of the options to `configure', and exit.
|
||||||
|
|
||||||
|
`--version'
|
||||||
|
`-V'
|
||||||
|
Print the version of Autoconf used to generate the `configure'
|
||||||
|
script, and exit.
|
||||||
|
|
||||||
|
`--cache-file=FILE'
|
||||||
|
Enable the cache: use and save the results of the tests in FILE,
|
||||||
|
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||||
|
disable caching.
|
||||||
|
|
||||||
|
`--config-cache'
|
||||||
|
`-C'
|
||||||
|
Alias for `--cache-file=config.cache'.
|
||||||
|
|
||||||
|
`--quiet'
|
||||||
|
`--silent'
|
||||||
|
`-q'
|
||||||
|
Do not print messages saying which checks are being made. To
|
||||||
|
suppress all normal output, redirect it to `/dev/null' (any error
|
||||||
|
messages will still be shown).
|
||||||
|
|
||||||
|
`--srcdir=DIR'
|
||||||
|
Look for the package's source code in directory DIR. Usually
|
||||||
|
`configure' can determine that directory automatically.
|
||||||
|
|
||||||
|
`configure' also accepts some other, not widely useful, options. Run
|
||||||
|
`configure --help' for more details.
|
||||||
|
|
||||||
29
Makefile.am
29
Makefile.am
@@ -1,12 +1,29 @@
|
|||||||
SUBDIRS = lib/libalpm src/util src/pacman scripts doc etc pactest contrib
|
SUBDIRS = lib/libalpm src/util src/pacman scripts etc po pactest contrib
|
||||||
|
if WANT_DOC
|
||||||
#DISTCHECK_CONFIGURE_FLAGS = --disable-fakeroot
|
SUBDIRS += doc
|
||||||
|
endif
|
||||||
|
|
||||||
# Some files automatically included, so they aren't specified below:
|
# Some files automatically included, so they aren't specified below:
|
||||||
# AUTHORS, COPYING, NEWS, README
|
# AUTHORS, COPYING, NEWS, README
|
||||||
EXTRA_DIST = HACKING
|
EXTRA_DIST = HACKING
|
||||||
|
|
||||||
check-local: src/pacman
|
# Sample makepkg prototype files
|
||||||
python $(top_srcdir)/pactest/pactest.py --test $(top_srcdir)/pactest/tests/*.py -p $(top_builddir)/src/pacman/pacman
|
pkgdatadir = ${datadir}/${PACKAGE}
|
||||||
rm -rf $(top_builddir)/root
|
dist_pkgdata_DATA = PKGBUILD.proto proto.install ChangeLog.proto
|
||||||
|
|
||||||
|
# run the pactest test suite and vercmp tests
|
||||||
|
check-local: pactest src/pacman src/util
|
||||||
|
$(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
|
||||||
|
$(SH) $(top_srcdir)/pactest/vercmptest.sh \
|
||||||
|
$(top_builddir)/src/util/vercmp
|
||||||
|
|
||||||
|
# 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:
|
||||||
|
|||||||
306
NEWS
306
NEWS
@@ -1,38 +1,278 @@
|
|||||||
VERSION DESCRIPTION
|
VERSION DESCRIPTION
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
3.2.0
|
||||||
|
- removed -A/--add option from pacman frontend
|
||||||
|
- added --asexplicit option
|
||||||
|
- new remove option --unneeded
|
||||||
|
- add -Rss option to remove all dependencies
|
||||||
|
- removed useless -e/--dependsonly option
|
||||||
|
- config options are now case sensitive
|
||||||
|
- added CleanMethod option for variety in cache cleaning
|
||||||
|
- new Turkish translation, all others updated and revised
|
||||||
|
- handle multiple groups in -Ss and -Qs operations
|
||||||
|
- allow -q/--quiet option with -o/--own and -g/--groups options
|
||||||
|
- removed hack for packages with unknown installed size
|
||||||
|
- add SyncFirst option to pacman.conf
|
||||||
|
- support installation of versioned deps : pacman -S "dep>=2.0"
|
||||||
|
- add --enable-git-version configure flag to identify
|
||||||
|
developmental build version
|
||||||
|
- do not duplicate packages in required by list
|
||||||
|
- pacman.static is no longer built
|
||||||
|
- all error messages use pm_fprintf
|
||||||
|
- disable geteuid in cygwin
|
||||||
|
- use off_t type for large file support
|
||||||
|
- add vercmp test script
|
||||||
|
- moved gensync and updatesync to contrib/
|
||||||
|
- rewrote pacsearch script in perl
|
||||||
|
- paclist script to list installed packages from a repo
|
||||||
|
- bacman script to make backup of package from filesystem
|
||||||
|
- combined repo-add and repo-remove into one script
|
||||||
|
- removed --force option from repo-add
|
||||||
|
- add --quiet option to repo-add/repo-remove
|
||||||
|
- update libtool version to 1.5.26
|
||||||
|
- allow disabling of internal download with new configure
|
||||||
|
flag --disable-internal-download
|
||||||
|
- pactest can now check file permissions
|
||||||
|
- add the possibility to mark the pactests known to fail,
|
||||||
|
which allows more informative results of make check
|
||||||
|
- libalpm-specific changes:
|
||||||
|
- use dynamic string allocation in package structure
|
||||||
|
- new functions for manipulating pmdepend_t objects
|
||||||
|
- store replaces and force in local database
|
||||||
|
- moved deptest functionality to backend
|
||||||
|
- add alpm_checkdbconflicts function
|
||||||
|
- fix PM_ERR_CONFLICTING_DEPS handling
|
||||||
|
- cleanup of pmsyncpkg_t
|
||||||
|
- add alpm_sync_newversion function
|
||||||
|
- cleanup of alpm_list code
|
||||||
|
- refactor of download code
|
||||||
|
- download callback API changes
|
||||||
|
- removed test_delta_md5sum and test_pkg_md5sum functions
|
||||||
|
- add _alpm_archive_fgets function to read line-by-line from
|
||||||
|
an archive
|
||||||
|
- read .PKGINFO directly from package file with no temp file
|
||||||
|
- native support for both libdownload and libfetch
|
||||||
|
- rework delta algorithm (we still need script updates)
|
||||||
|
- swap parameters of alpm_pkg_find for consistency with
|
||||||
|
other find functions
|
||||||
|
- swap parameters of PM_TRANS_CONV_INSTALL_IGNOREPKG to make
|
||||||
|
more sense
|
||||||
|
- fix -Rs when removing multiple items in dependency chain
|
||||||
|
- makepkg-specific changes:
|
||||||
|
- support for resuming source downloads
|
||||||
|
- added zipman option
|
||||||
|
- removed -b/--builddeps
|
||||||
|
- various portability fixes for BSD and Mac OS X
|
||||||
|
- check for valid options in PKGBUILD
|
||||||
|
- add --allsource option
|
||||||
|
- remove deprecated --usesudo option
|
||||||
|
- handle spaces in build directory
|
||||||
|
- made keeping docs the default option
|
||||||
|
- use pacman version dep resolving
|
||||||
|
- fix regression in library stripping
|
||||||
|
- make strip paths configurable
|
||||||
|
- MANY other bug fixes and small improvements
|
||||||
|
3.1.4 - various small code cleanups and fixes
|
||||||
|
- small documentation updates
|
||||||
|
- improvements to PKGBUILD.vim
|
||||||
|
- translation updates - ru, zh_CN
|
||||||
|
3.1.3 - major updates to i18n output in frontend (all UTF-8 characters
|
||||||
|
should now work with varying byte and char widths)
|
||||||
|
- new Simplified Chinese translation
|
||||||
|
- updates to testpkg utility
|
||||||
|
- updates to PKGBUILD.vim
|
||||||
|
- internal updates for translations - use c-format on all
|
||||||
|
strings, get rid of needless line numbers
|
||||||
|
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
|
||||||
|
directory
|
||||||
|
- proper error messages when we cannot read mtab for freespace
|
||||||
3.0.0 - first release based on libalpm backend
|
3.0.0 - first release based on libalpm backend
|
||||||
- added internationalization (gettext) support
|
- added internationalization (gettext) support:
|
||||||
- prompt to delete corrupted packages
|
- de, fr, hu, it, pt_BR, en_GB, ru_RU translations
|
||||||
- **TODO** documentation - multiple man pages updated
|
- switch to usage of libdownload and libarchive
|
||||||
|
- improved proxy support using libdownload
|
||||||
|
- documentation - man pages updated, new conf manpages added
|
||||||
|
- repository mirror list updates
|
||||||
- added support for package changelogs
|
- added support for package changelogs
|
||||||
- logging of all install scriptlet messages to pacman.log
|
- logging of all install scriptlet messages to pacman.log
|
||||||
- repository mirror list updates
|
|
||||||
- orphans search (-Qe) now shows true orphans
|
- orphans search (-Qe) now shows true orphans
|
||||||
|
- new -Qu option - show all packages that can be upgraded
|
||||||
|
- new -Se option - install only dependencies
|
||||||
- dependency sorting on install and removal
|
- dependency sorting on install and removal
|
||||||
- new uncompressed size field, shown on sync upgrade
|
|
||||||
- check for free space before installing packages
|
- check for free space before installing packages
|
||||||
|
- prompt to delete corrupted packages
|
||||||
|
- improved backup handling - backup array proactive on upgrade
|
||||||
|
- removed NoUpgrade lines from default pacman.conf
|
||||||
|
- new uncompressed size field, shown on sync upgrade
|
||||||
- improved progress and progressbar output
|
- improved progress and progressbar output
|
||||||
- reduced unnecessary calling of ldconfig
|
- reduced unnecessary calling of ldconfig
|
||||||
- selective loading of database to speed up certain operations
|
- selective loading of database to speed up certain operations
|
||||||
- switch to usage of libdownload and libarchive
|
|
||||||
- improved proxy support as a result of switch to libdownload
|
|
||||||
- debugging output improved with --debug flag
|
- debugging output improved with --debug flag
|
||||||
- added 'rankmirrors' - script to show best available mirrors
|
- pacman-optimize - now supports DBs on separate filesystem
|
||||||
- added 'repo-add' - the backbone script for building repos
|
- makepkg and abs now support conf files in home directory
|
||||||
- added pactest testing suite
|
- makepkg changes:
|
||||||
- abs - supports cvsup/csup, expanded configuration
|
- arch field is required
|
||||||
- abs - supports fetching of testing repository
|
- added -arch suffix to generated package filenames
|
||||||
- makepkg fixes:
|
|
||||||
- new configuration file options format
|
- new configuration file options format
|
||||||
|
- changed default configuration
|
||||||
- support alternate integrity checks
|
- support alternate integrity checks
|
||||||
- extract files using filetype, not extension
|
- extract files using filetype, not extension
|
||||||
- added noextract array
|
- added noextract array
|
||||||
|
- new options array format
|
||||||
- new option to log build process
|
- new option to log build process
|
||||||
- new repackage option - repackage pkg/ w/o building
|
- new --repackage option - repackage pkg/ without building
|
||||||
- user-selectable paths for doc stripping
|
- user-selectable paths for doc stripping
|
||||||
- configurable source cache location
|
- configurable source cache location
|
||||||
- dependencies now removed on a build success or failure
|
- dependencies now removed on a build success or failure
|
||||||
- pacman-optimize - support DB's on separate filesystem
|
- abs changes:
|
||||||
|
- supports both cvsup and csup
|
||||||
|
- expanded configuration
|
||||||
|
- added support for testing repository
|
||||||
|
- new helper scripts:
|
||||||
|
- rankmirrors - shows best available mirrors
|
||||||
|
- repo-add - adds a package to a repo database file
|
||||||
|
- repo-remove - removes a package from a repo database file
|
||||||
|
- added pactest testing suite
|
||||||
|
- MANY fixes and small improvements everywhere
|
||||||
2.9.8 - Changed behaviour with original=X,current=Y,new=Z scenario
|
2.9.8 - Changed behaviour with original=X,current=Y,new=Z scenario
|
||||||
- keep old in place, install new as .pacnew
|
- keep old in place, install new as .pacnew
|
||||||
- Search package provides when finding matching targets with -S
|
- Search package provides when finding matching targets with -S
|
||||||
@@ -136,15 +376,15 @@ VERSION DESCRIPTION
|
|||||||
- Smarter file-conflict checking with symlinked paths and
|
- Smarter file-conflict checking with symlinked paths and
|
||||||
with files that move from one package to another
|
with files that move from one package to another
|
||||||
2.8 - Bugfixes:
|
2.8 - Bugfixes:
|
||||||
- #861: file:/// urls not handled properly with XferCommand
|
- FS#861: file:/// urls not handled properly with XferCommand
|
||||||
- #1003: set umask before scriptlet calls
|
- FS#1003: set umask before scriptlet calls
|
||||||
- #1027: download problems with http urls using -U/-A
|
- FS#1027: download problems with http urls using -U/-A
|
||||||
- #1044: segfaults when using -Rs
|
- FS#1044: segfaults when using -Rs
|
||||||
- #863: "missing post_remove" errors with some packages
|
- FS#863: "missing post_remove" errors with some packages
|
||||||
- #875: detect low disk space properly
|
- FS#875: detect low disk space properly
|
||||||
- #986: makepkg -e doesn't validate files
|
- FS#986: makepkg -e doesn't validate files
|
||||||
- #1010: add -j option to makepkg
|
- FS#1010: add -j option to makepkg
|
||||||
- #1028: make pacman -Sp runnable as non-root
|
- FS#1028: make pacman -Sp runnable as non-root
|
||||||
- added pre_install and pre_upgrade scriptlet support
|
- added pre_install and pre_upgrade scriptlet support
|
||||||
- added an "Architecture" field in the package meta-data
|
- added an "Architecture" field in the package meta-data
|
||||||
- added patch from Aurelien Foret which improves performance
|
- added patch from Aurelien Foret which improves performance
|
||||||
@@ -157,7 +397,7 @@ VERSION DESCRIPTION
|
|||||||
2.7.9 - added the "force" option to packages, so --sysupgrade can
|
2.7.9 - added the "force" option to packages, so --sysupgrade can
|
||||||
downgrade packages when it needs to
|
downgrade packages when it needs to
|
||||||
2.7.8 - added post_remove scriptlet support
|
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
|
- a provisio does not imply conflict, to make a provisio target
|
||||||
conflict with anything else that provides the same thing, you
|
conflict with anything else that provides the same thing, you
|
||||||
can now do this by specifying the provisio target as both a
|
can now do this by specifying the provisio target as both a
|
||||||
@@ -166,10 +406,10 @@ VERSION DESCRIPTION
|
|||||||
provides=('x-server')
|
provides=('x-server')
|
||||||
- cleaned up the download progress bar a bit
|
- cleaned up the download progress bar a bit
|
||||||
- added %o parameter to XferCommand so wget can resume properly
|
- 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
|
- patches from Oliver Burnett-Hall
|
||||||
- gensync uses a better temp dir (bug #774)
|
- gensync uses a better temp dir (FS#774)
|
||||||
- PKGDEST can be set in makepkg.conf (bug #783)
|
- PKGDEST can be set in makepkg.conf (FS#783)
|
||||||
- patches from Aurelien Foret
|
- patches from Aurelien Foret
|
||||||
- segfault fix, couple memory leaks
|
- segfault fix, couple memory leaks
|
||||||
- more sanity checks in "provides" searches
|
- more sanity checks in "provides" searches
|
||||||
@@ -183,7 +423,7 @@ VERSION DESCRIPTION
|
|||||||
- -Ss now searches thru provides fields
|
- -Ss now searches thru provides fields
|
||||||
- added --dbonly option to -R
|
- added --dbonly option to -R
|
||||||
2.7.6 - added --print-uris option
|
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
|
- fixed a segfault related to replaces/conflicts handling
|
||||||
2.7.5 - "replaces" packages were ignoring IgnorePkg in pacman.conf
|
2.7.5 - "replaces" packages were ignoring IgnorePkg in pacman.conf
|
||||||
- fixed another bug in conflict handling
|
- fixed another bug in conflict handling
|
||||||
@@ -199,7 +439,7 @@ VERSION DESCRIPTION
|
|||||||
- You can now use the --info option with --sync to display an
|
- You can now use the --info option with --sync to display an
|
||||||
uninstalled package's dependency info.
|
uninstalled package's dependency info.
|
||||||
- Added a sane umask before db writes
|
- 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
|
2.7.3 - makepkg not longer strips files with .exe or .dll extensions
|
||||||
- Added Aurelien's patch:
|
- Added Aurelien's patch:
|
||||||
- proxy support (no authentication yet)
|
- proxy support (no authentication yet)
|
||||||
@@ -228,7 +468,7 @@ VERSION DESCRIPTION
|
|||||||
2.6.3 - A couple memory fixes in the new replaces code
|
2.6.3 - A couple memory fixes in the new replaces code
|
||||||
2.6.2 - Fixed a memory cleanup bug
|
2.6.2 - Fixed a memory cleanup bug
|
||||||
- Aurelien's patch:
|
- 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
|
- fixed a bug with pacman -Sg (pacman was browsing only one
|
||||||
db to get groups)
|
db to get groups)
|
||||||
- fixed a bug with list_merge()
|
- fixed a bug with list_merge()
|
||||||
@@ -311,7 +551,7 @@ VERSION DESCRIPTION
|
|||||||
2.2 - More bugfixes
|
2.2 - More bugfixes
|
||||||
- Added --downloadonly switch to --sync
|
- Added --downloadonly switch to --sync
|
||||||
2.1 - Lots of bugfixes
|
2.1 - Lots of bugfixes
|
||||||
- Added support for multiple respositories
|
- Added support for multiple repositories
|
||||||
- Improved the config file layout
|
- Improved the config file layout
|
||||||
- Improved dependency resolution and sorting
|
- Improved dependency resolution and sorting
|
||||||
2.0 - Added dependency functionality
|
2.0 - Added dependency functionality
|
||||||
@@ -339,4 +579,4 @@ VERSION DESCRIPTION
|
|||||||
- Changed db_find_conflicts() to ignore directories
|
- Changed db_find_conflicts() to ignore directories
|
||||||
1.0 - Initial Release
|
1.0 - Initial Release
|
||||||
|
|
||||||
vim: set et:
|
vim: set et spell spelllang=en_us:
|
||||||
|
|||||||
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:
|
||||||
166
README
166
README
@@ -2,7 +2,7 @@ ALPM library overview & internals
|
|||||||
=================================
|
=================================
|
||||||
|
|
||||||
Here is a list of the main objects and files from the ALPM (i.e. Arch Linux
|
Here is a list of the main objects and files from the ALPM (i.e. Arch Linux
|
||||||
Package Management) library. This document, whilst not exhaustive, also
|
Package Management) library. This document, while not exhaustive, also
|
||||||
indicates some limitations (on purpose, or sometimes due to its poor design) of
|
indicates some limitations (on purpose, or sometimes due to its poor design) of
|
||||||
the library at the present time.
|
the library at the present time.
|
||||||
|
|
||||||
@@ -13,9 +13,8 @@ the frontend. Lots of structures are of an opaque type and their fields are
|
|||||||
only accessible in read-only mode, through some clearly defined functions.
|
only accessible in read-only mode, through some clearly defined functions.
|
||||||
|
|
||||||
In addition to "alpm.h", the interfaces of "alpm_list.h" have also been made
|
In addition to "alpm.h", the interfaces of "alpm_list.h" have also been made
|
||||||
available to the frontend. It is not a requirement for the frontend to use
|
available to the frontend, for allowing it to manipulate the lists returned by
|
||||||
these list functions; however, it prevents frontends from having to reimplement
|
the backend.
|
||||||
a list data structure.
|
|
||||||
|
|
||||||
Several structures and functions have been renamed compared to pacman 2.9 code.
|
Several structures and functions have been renamed compared to pacman 2.9 code.
|
||||||
This was done at first for the sake of naming scheme consistency, and then
|
This was done at first for the sake of naming scheme consistency, and then
|
||||||
@@ -25,7 +24,7 @@ same name declared in both spaces. To avoid such conflicts, internal function
|
|||||||
names have been prepended with "_alpm_".
|
names have been prepended with "_alpm_".
|
||||||
|
|
||||||
In a general manner, public library functions are named "alpm_<type>_<action>"
|
In a general manner, public library functions are named "alpm_<type>_<action>"
|
||||||
(examples: alpm_trans_commit(), alpm_release(), alpm_pkg_getinfo(), ...).
|
(examples: alpm_trans_commit(), alpm_release(), alpm_pkg_get_name(), ...).
|
||||||
Internal (and thus private) functions should be named "_alpm_XXX" for instance
|
Internal (and thus private) functions should be named "_alpm_XXX" for instance
|
||||||
(examples: _alpm_needbackup(), _alpm_runscriplet(), ...). Functions defined and
|
(examples: _alpm_needbackup(), _alpm_runscriplet(), ...). Functions defined and
|
||||||
used inside a single file should be defined as "static".
|
used inside a single file should be defined as "static".
|
||||||
@@ -33,60 +32,63 @@ used inside a single file should be defined as "static".
|
|||||||
|
|
||||||
[Initialization]
|
[Initialization]
|
||||||
|
|
||||||
alpm_init() is used to initialize library internals and to create
|
alpm_initialize() is used to initialize library internals and to create
|
||||||
a transparent handle object. Before its call, the library can't be used.
|
a transparent handle object. Before its call, the library can't be used.
|
||||||
|
|
||||||
alpm_lib_release() just does the opposite (memory used by the library, and the
|
alpm_release() just does the opposite (memory used by the library, and the
|
||||||
handle is freed). After its call, the library is no longer available.
|
handle is freed). After its call, the library is no longer available.
|
||||||
|
|
||||||
|
|
||||||
[Options]
|
[Options]
|
||||||
|
|
||||||
In the future, the library will not use any configuration file. It will be up
|
The library does not use any configuration file. It is up to the front end to
|
||||||
to the front end to The handle holds a
|
configure the library as needed; the handle holds a number of configuration
|
||||||
number of configuration options instead (IGNOREPKG, SYSLOG usage,
|
options instead.
|
||||||
log file name, registered databases, ...).
|
|
||||||
|
|
||||||
All of the following options have a alpm_option_get_* and alpm_option_set_*
|
All of the following options have a alpm_option_get_* and alpm_option_set_*
|
||||||
function for getting and setting the value. The cannot be set before the
|
function for getting and setting the value. They cannot be set before the
|
||||||
library is initialized.
|
library is initialized.
|
||||||
|
|
||||||
* logcb: The callback function for "log" operations.
|
* logcb: The callback function for "log" operations.
|
||||||
* dlcb: The callback function for download progress.
|
* dlcb: The callback function for download progress of each package.
|
||||||
* logmask: The logging mask for which level of output is sent to the logcb.
|
* totaldlcb: The callback function for overall download progress.
|
||||||
* root: The root directory on which pacman operates (Default: /)
|
* root: The root directory for pacman to install to (Default: /)
|
||||||
* dbpath: The base path to pacman's databases (Default: var/lib/pacman)
|
* dbpath: The toplevel database directory (Default: /var/lib/pacman)
|
||||||
* 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)
|
||||||
* 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.
|
* 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
|
* xfercommand: The command to use for downloading instead of pacman's internal
|
||||||
downloading functionality.
|
downloading functionality.
|
||||||
* nopassiveftp: Do not use passive FTP commands for ftp connections.
|
* nopassiveftp: Do not use passive FTP commands for ftp connections.
|
||||||
* chomp: No way, easter eggs are secret!
|
|
||||||
* usecolor: Unimplemented, but for the future. You can assume what it means.
|
|
||||||
|
|
||||||
The following options also have a `alpm_option_add_*` function, as the values
|
The following options also have `alpm_option_{add,remove}_*` functions, as the
|
||||||
are list structures (NOTE: The add functions are NOT plural, as they're in
|
values are list structures.
|
||||||
english: alpm_option_get_noupgrades -> alpm_option_add_noupgrade).
|
NOTE: The add and remove functions are NOT plural, as they are in English:
|
||||||
|
alpm_option_{get,set}_noupgrades -> alpm_option_{add,remove}_noupgrade.
|
||||||
|
|
||||||
|
* cachedirs: Paths to pacman's download caches (Default: /var/cache/pacman/pkg)
|
||||||
* noupgrades: Files which will never be touched by pacman (extracted as .pacnew)
|
* noupgrades: Files which will never be touched by pacman (extracted as .pacnew)
|
||||||
* noextracts: Files which will never be extracted at all (no .pacnew file)
|
* noextracts: Files which will never be extracted at all (no .pacnew file)
|
||||||
* ignorepkgs: Packages to ignore when upgrading.
|
* ignorepkgs: Packages to ignore when upgrading.
|
||||||
* holdpkgs: Packages which must be upgraded before continuing.
|
* ignoregrps: Groups to ignore when upgrading.
|
||||||
|
* holdpkgs: Important packages which need a confirmation before being removed.
|
||||||
|
|
||||||
The following options are read-only, having ONLY alpm_option_get_* functions:
|
The following options are read-only, having ONLY alpm_option_get_* functions:
|
||||||
|
|
||||||
|
* lockfile: The file used for locking the database
|
||||||
|
(Default: <dbpath>/db.lck)
|
||||||
* localdb: A pmdb_t structure for the local (installed) database
|
* localdb: A pmdb_t structure for the local (installed) database
|
||||||
* syncdbs: A list of pmdb_t structures to which pacman can sync from.
|
* syncdbs: A list of pmdb_t structures to which pacman can sync from.
|
||||||
|
|
||||||
|
The following options are write-only, having ONLY alpm_option_set_* functions:
|
||||||
|
|
||||||
|
* usedelta: Download delta files instead of complete packages if possible.
|
||||||
|
|
||||||
[Transactions]
|
[Transactions]
|
||||||
|
|
||||||
The transaction sturcture permits easy manipulations of several packages
|
The transaction structure permits easy manipulations of several packages
|
||||||
at a time (i.e. adding, upgrade and removal operations).
|
at a time (i.e. adding, upgrade and removal operations).
|
||||||
|
|
||||||
A transaction can be initiated with a type (ADD, UPGRADE or REMOVE),
|
A transaction can be initiated with a type (SYNC, UPGRADE or REMOVE),
|
||||||
and some flags (NODEPS, FORCE, CASCADE, ...).
|
and some flags (NODEPS, FORCE, CASCADE, ...).
|
||||||
|
|
||||||
Note: there can only be one type at a time: a transaction is either
|
Note: there can only be one type at a time: a transaction is either
|
||||||
@@ -106,7 +108,7 @@ These targets represent the list of packages to be handled.
|
|||||||
|
|
||||||
Then, a transaction needs to be prepared (alpm_trans_prepare()). It
|
Then, a transaction needs to be prepared (alpm_trans_prepare()). It
|
||||||
means that the various targets added, will be inspected and challenged
|
means that the various targets added, will be inspected and challenged
|
||||||
against the set of already installed packages (dependency checkings,
|
against the set of already installed packages (dependency checking, etc...)
|
||||||
|
|
||||||
Last, a callback is associated with each transaction. During the
|
Last, a callback is associated with each transaction. During the
|
||||||
transaction resolution, each time a new step is started or done (i.e
|
transaction resolution, each time a new step is started or done (i.e
|
||||||
@@ -117,27 +119,27 @@ the resolution. Can be useful to implement a progress bar.
|
|||||||
|
|
||||||
[Package Cache]
|
[Package Cache]
|
||||||
|
|
||||||
libalpm maintains two caches for each DB. One is a general package cache, the
|
libalpm maintains two caches for each DB. One is a general package cache, the
|
||||||
other is a group cache (for package groups). These caches are loaded on demand,
|
other is a group cache (for package groups). These caches are loaded on demand,
|
||||||
and freed when the libary is.
|
and freed when the library is.
|
||||||
It is important to note tha, as a general rule, package structures should NOT be
|
|
||||||
freed manually, as they SHOULD be part of the cache.
|
It is important to note that, as a general rule, package structures should NOT
|
||||||
The cache of a database is always updated by the library after
|
be freed manually, as they SHOULD be part of the cache. The cache of a
|
||||||
an operation changing the database content (adding and/or removal of
|
database is always updated by the library after an operation changing the
|
||||||
packages). Beware frontends ;)
|
database content (adding and/or removal of packages). Beware frontends ;)
|
||||||
|
|
||||||
|
|
||||||
[Package]
|
[Package]
|
||||||
|
|
||||||
The package structure maintains all information for a package. In general,
|
The package structure maintains all information for a package. In general,
|
||||||
packages should never be freed from front-ends, as they should always be part of
|
packages should never be freed from front-ends, as they should always be part
|
||||||
the package cache.
|
of the package cache.
|
||||||
|
|
||||||
The 'origin' data member indicates whether the package is from a file
|
The 'origin' data member indicates whether the package is from a file (i.e. -U
|
||||||
(i.e. -U operations) or from the package cache. In the case of a file, all data
|
operations) or from the package cache. In the case of a file, all data members
|
||||||
members available are present in the structure. Packages indicated as being
|
available are present in the structure. Packages indicated as being from the
|
||||||
from the cache have data members filled on demand. For this reason, the
|
cache have data members filled on demand. For this reason, the alpm_pkg_get_*
|
||||||
alpm_pkg_get_* functions will load the data from the DB as needed.
|
functions will load the data from the DB as needed.
|
||||||
|
|
||||||
|
|
||||||
[Errors]
|
[Errors]
|
||||||
@@ -150,13 +152,15 @@ indicating success, -1 indicating a failure.
|
|||||||
If -1 is returned, the variable pm_errno is set to a meaningful value
|
If -1 is returned, the variable pm_errno is set to a meaningful value
|
||||||
Wise frontends should always care for these returned values.
|
Wise frontends should always care for these returned values.
|
||||||
|
|
||||||
Note: the helper function alpm_strerror() can also be used to translate
|
Note: the helper function alpm_strerror() can also be used to translate one
|
||||||
the error code into a more friendly sentence.
|
specified error code into a more friendly sentence, and alpm_strerrorlast()
|
||||||
|
does the same for the last error encountered (represented by pm_errno).
|
||||||
|
|
||||||
|
|
||||||
[List - alpm_list_t]
|
[List - alpm_list_t]
|
||||||
|
|
||||||
The alpm_list_t structure is a doubly-linked list for use with the libalpm
|
The alpm_list_t structure is a doubly-linked list for use with the libalpm
|
||||||
routines. This type is provided publicly so that frontends are free to use it
|
routines. This type is provided publicly so that frontends are free to use it
|
||||||
if they have no native list type (C++, glib, python, etc all have list types).
|
if they have no native list type (C++, glib, python, etc all have list types).
|
||||||
See the proper man pages for alpm_list_t references.
|
See the proper man pages for alpm_list_t references.
|
||||||
|
|
||||||
@@ -180,41 +184,65 @@ perform a special action.
|
|||||||
|
|
||||||
[MAIN] (see pacman.c)
|
[MAIN] (see pacman.c)
|
||||||
|
|
||||||
Calls for alpm_lib_init(), and alpm_lib_release().
|
Calls for alpm_initialize(), and alpm_release().
|
||||||
Read the configuration file, and parse command line arguments.
|
Read the configuration file, and parse command line arguments.
|
||||||
Based on the action requested, it initiates the appropriate transactions
|
Based on the action requested, it initiates the appropriate transactions
|
||||||
(see pacman_add(), pacman_remove(), pacman_sync() in files add.c,
|
(see pacman_upgrade(), pacman_remove(), pacman_sync() in files upgrade.c,
|
||||||
remove.c and sync.c).
|
remove.c and sync.c).
|
||||||
|
|
||||||
|
|
||||||
[CONFIGURATION] (see conf.c)
|
[CONFIGURATION] (see conf.h)
|
||||||
|
|
||||||
The frontend is using a configuration file, usually "/etc/pacman.conf".
|
The frontend is using a configuration file, usually "/etc/pacman.conf". Some
|
||||||
Part of these options are only useful for the frontend only (mainly,
|
of these options are only useful for the frontend only (mainly the ones used to
|
||||||
the download stuffs, and some options like HOLDPKG).
|
control the output like showsize or totaldownload, or the behavior with
|
||||||
The rest is used to configure the library.
|
cleanmethod and syncfirst). The rest is used to configure the library.
|
||||||
|
|
||||||
|
|
||||||
[ADD/UPGRADE/REMOVE/SYNC]
|
[UPGRADE/REMOVE/SYNC]
|
||||||
|
|
||||||
Nothing new here, excepted some reorganization.
|
|
||||||
|
|
||||||
The file pacman.c has been divided into several smaller files, namely
|
The file pacman.c has been divided into several smaller files, namely
|
||||||
add.c, remove.c, sync.c and query.c, to hold the big parts: pacman_add,
|
upgrade.c, remove.c, sync.c and query.c, to hold the big parts: pacman_upgrade,
|
||||||
pacman_remove, pacman_sync.
|
pacman_remove, pacman_sync.
|
||||||
|
|
||||||
These 3 functions have been split to ease the code reading.
|
These 3 functions have been split to ease the code reading.
|
||||||
|
|
||||||
|
|
||||||
LIMITATIONS/BEHAVIOR CHANGES COMPARED TO PACMAN 2.9
|
|
||||||
===================================================
|
|
||||||
|
|
||||||
Excepted missing features still needing to be implemented, one can
|
API CHANGES BETWEEN 3.1 AND 3.2
|
||||||
notice the following limitations:
|
===============================
|
||||||
|
|
||||||
- If pacman is out of date, the frontend displays a warning and recommends
|
[REMOVED]
|
||||||
to give up the on-going transanction. The frontend does not allow to
|
- alpm_db_whatprovides()
|
||||||
upgrade pacman itself on-the-fly, and thus it should be restarted with
|
- alpm_splitdep (no longer public)
|
||||||
only "pacman" as a target.
|
- trans->targets was removed, so alpm_trans_get_targets() as well
|
||||||
|
- error codes:
|
||||||
|
PM_ERR_OPT_*, PM_ERR_PKG_INSTALLED, PM_ERR_DLT_CORRUPTED,
|
||||||
|
PM_ERR_LIBARCHIVE_ERROR
|
||||||
|
- event: PM_TRANS_EVT_EXTRACT_DONE
|
||||||
|
- PM_TRANS_TYPE_ADD pmtranstype_t (add transaction)
|
||||||
|
- PM_TRANS_FLAG_DEPENDSONLY pmtransflag_t
|
||||||
|
|
||||||
- ...
|
[CHANGED]
|
||||||
|
- alpm_grp_get_pkgs returns with pmpkg_t list, not package-name list
|
||||||
|
- Swap parameters on PM_TRANS_CONV_INSTALL_IGNOREPKG callback function
|
||||||
|
- download callback API changed: alpm_cb_download, alpm_cb_totaldl split
|
||||||
|
(+ new alpm_option_get_totaldlcb(), alpm_option_set_totaldlcb() functions)
|
||||||
|
- unsigned long->off_t changes where size is used
|
||||||
|
- pmsyncpkg_t struct changes:
|
||||||
|
- pmsynctype_t and alpm_sync_get_type() were removed
|
||||||
|
- alpm_sync_get_data() was removed
|
||||||
|
- alpm_sync_get_removes() was added
|
||||||
|
|
||||||
|
[ADDED]
|
||||||
|
- alpm_delta_get_from_md5sum(), alpm_delta_get_to_md5sum()
|
||||||
|
- alpm_miss_get_causingpkg() (new causingpkg field in pmdepmissing_t)
|
||||||
|
- alpm_checkdbconflicts()
|
||||||
|
- alpm_sync_newversion()
|
||||||
|
- alpm_deptest()
|
||||||
|
- error codes :
|
||||||
|
PM_ERR_DLT_INVALID, PM_ERR_LIBARCHIVE, PM_ERR_LIBDOWNLOAD and
|
||||||
|
PM_ERR_EXTERNAL_DOWNLOAD
|
||||||
|
- flags:
|
||||||
|
PM_TRANS_FLAG_ALLEXPLICIT, PM_TRANS_FLAG_UNNEEDED and
|
||||||
|
PM_TRANS_FLAG_RECURSEALL
|
||||||
|
|||||||
14
TODO.aaron
14
TODO.aaron
@@ -6,16 +6,6 @@
|
|||||||
"replaces" packages to the front end, so the frontend can handle the QUESTION()
|
"replaces" packages to the front end, so the frontend can handle the QUESTION()
|
||||||
stuff in that case
|
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
|
* 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
|
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
|
for the progress bars, and format it at the lib side. Question functions
|
||||||
@@ -45,10 +35,6 @@
|
|||||||
|
|
||||||
* pacman: fixup doxygen documentation for public interface
|
* 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 *
|
* feature for 3.1: package file hooks *
|
||||||
I've been planning on this one for some time. Here's a simple rundown:
|
I've been planning on this one for some time. Here's a simple rundown:
|
||||||
in /etc/pacman.d/hooks:
|
in /etc/pacman.d/hooks:
|
||||||
|
|||||||
59
TODO.dan
59
TODO.dan
@@ -4,34 +4,15 @@ TODO.dan
|
|||||||
This is my personal TODO list. No guarantees if it is out of date and things no
|
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.
|
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.0:
|
|
||||||
-----------
|
|
||||||
|
|
||||||
ideas mentioned here- http://bbs.archlinux.org/viewtopic.php?id=29450- add a
|
|
||||||
.install message about mirrors, maybe comment whole file, encourage rankmirrors
|
|
||||||
usage
|
|
||||||
|
|
||||||
|
|
||||||
Pacman 3.1:
|
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
|
Downgrade feature - allow users to see cached packages and downgrade to
|
||||||
(previous or any?) available options.
|
(previous or any?) available options.
|
||||||
|
|
||||||
|
Installed size and download size in -Si/Qi output should scale with package
|
||||||
|
size- KB to MB to GB. We should also get consistancy of K/KB, M/MB, etc.
|
||||||
|
|
||||||
Extreme similarity between some of the sync and add code...we have to be able
|
Extreme similarity between some of the sync and add code...we have to be able
|
||||||
to abstract more away from sync actions and add actions to just 'actions'
|
to abstract more away from sync actions and add actions to just 'actions'
|
||||||
(example: sync,c, add.c, and deptest.c all contain a switch on PM_DEP_MOD_*).
|
(example: sync,c, add.c, and deptest.c all contain a switch on PM_DEP_MOD_*).
|
||||||
@@ -51,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.
|
killed now in favor of vercmp binary) if they can be done by other actions.
|
||||||
Possible switch of -U --> -I (#5571).
|
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.
|
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
|
Make it extensible to use color, review what verbose/debug means. Perhaps
|
||||||
separate logging functionality- Pacman has its normal log, and alpm backend
|
separate logging functionality- Pacman has its normal log, and alpm backend
|
||||||
@@ -64,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
|
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.
|
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
|
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
|
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
|
alpm_list_count calls), and maybe think about changing data structures to speed
|
||||||
@@ -77,11 +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
|
quick profiling- excessive setlocale calls, and extremely excessive strcmp
|
||||||
calls.
|
calls.
|
||||||
|
|
||||||
Localize the date display done in --info output. Also, fix other localized
|
Fix other localized issues- use non-printf when necessary. We may need to use
|
||||||
issues- use non-printf when necessary, make sure all two line printed messages
|
some wchar_t output on the progress bar as char/byte counts differ here. Sizes
|
||||||
(especially usage instructions) are printed using one print statement. We
|
of packages (e.g. 10,400.23 MB) should all be localized with correct
|
||||||
may need to use some wchar_t output on the progress bar as char/byte counts
|
seperators.
|
||||||
differ here.
|
|
||||||
|
|
||||||
Rewrite makepkg to use terminal-safe coloring/bolding. tput utility should
|
Rewrite makepkg to use terminal-safe coloring/bolding. tput utility should
|
||||||
allow us to do this. Make universal message functions for systemwide use,
|
allow us to do this. Make universal message functions for systemwide use,
|
||||||
@@ -90,11 +58,6 @@ including all pacman utilites- abs, pacman-optimize, etc.
|
|||||||
Bugs/FRs to smash: 6468, 6437, 6430?, 6420, 6404, 6389, 6312?, 6284, 6273?,
|
Bugs/FRs to smash: 6468, 6437, 6430?, 6420, 6404, 6389, 6312?, 6284, 6273?,
|
||||||
6255?, 6208, 5987, 5885, 5571, 4182, 3492, 2810?, 1769, 1588, 1571
|
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
|
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
|
private internal functions too- it helps a ton for people just getting a
|
||||||
start on pacman hacking.
|
start on pacman hacking.
|
||||||
@@ -110,8 +73,6 @@ Update copyrights (2007)
|
|||||||
|
|
||||||
Update pacman website, and add/finish pacman coding style page
|
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:
|
Refine makepkg error codes. Each kind of failure could have its own code:
|
||||||
--package already built
|
--package already built
|
||||||
--failed integ checks
|
--failed integ checks
|
||||||
@@ -123,14 +84,8 @@ to KB, MB, GB.
|
|||||||
|
|
||||||
Revamp the downloadprog function a bit. Seems kind of messy.
|
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
|
--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
|
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*
|
always need to pass handle->root around, it is constant. Something like char*
|
||||||
buildpath(file).
|
buildpath(file).
|
||||||
|
|||||||
46
TRANSLATORS
Normal file
46
TRANSLATORS
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
|
Czech (cs):
|
||||||
|
Vojtěch Gondžala <vojtech.gondzala@gmail.com>
|
||||||
|
German (de):
|
||||||
|
Matthias Gorissen <matthias@archlinux.de>
|
||||||
|
Benjamin Andresen <benny@in-ulm.de>
|
||||||
|
British English (en_GB):
|
||||||
|
Jeff Bailes <thepizzaking@gmail.com>
|
||||||
|
Spanish (es):
|
||||||
|
Fernando Lagos <fernando@zerial.org>
|
||||||
|
Juan Pablo Gonzalez <jotapesan@gmail.com>
|
||||||
|
French (fr):
|
||||||
|
Chantry Xavier <shiningxc@gmail.com>
|
||||||
|
Hungarian (hu):
|
||||||
|
Nagy Gabor <ngaba@bibl.u-szeged.hu>
|
||||||
|
Italian (it):
|
||||||
|
Giovanni 'voidnull' Scafora <linuxmania@gmail.com>
|
||||||
|
Polish (pl):
|
||||||
|
Mateusz Herych <heniekk@gmail.com>
|
||||||
|
Jaroslaw Swierczynski <swiergot@gmail.com>
|
||||||
|
Mateusz Jędrasik <m.jedrasik@gmail.com>
|
||||||
|
Brazilian Portuguese (pt_BR):
|
||||||
|
Armando M. Baratti <ambaratti@archlinux-br.org>
|
||||||
|
Hugo Doria <hugo@archlinux.org>
|
||||||
|
Leandro Inacio <leandro@archlinux-br.org>
|
||||||
|
Russian (ru):
|
||||||
|
Sergey Tereschenko <serg.partizan@gmail.com>
|
||||||
|
Vitaly Dolgov <ferhiord@gmail.com>
|
||||||
|
Oleg Finkelshteyn <olegfink@gmail.com>
|
||||||
|
Vladimir Bayrakovskiy <4rayven@gmail.com>
|
||||||
|
Turkish (tr):
|
||||||
|
Samed Beyribey <ras0ir@eventualis.org>
|
||||||
|
Alper KANAT <alperkanat@gmail.com>
|
||||||
|
Simplified Chinese (zh_CN):
|
||||||
|
甘露(Lu.Gan) <rhythm.gan@gmail.com>
|
||||||
4952
acinclude.m4
Normal file
4952
acinclude.m4
Normal file
File diff suppressed because it is too large
Load Diff
60
autoclean.sh
60
autoclean.sh
@@ -2,53 +2,33 @@
|
|||||||
|
|
||||||
[ -f Makefile ] && make distclean
|
[ -f Makefile ] && make distclean
|
||||||
rm -rf autom4te.cache
|
rm -rf autom4te.cache
|
||||||
rm -rf Makefile
|
rm -rf {Makefile.in,Makefile}
|
||||||
rm -rf Makefile.in
|
rm -rf {config.h.in,config.h}
|
||||||
|
rm -rf config.status
|
||||||
rm -rf configure
|
rm -rf configure
|
||||||
rm -rf config.*
|
|
||||||
rm -rf stamp*
|
rm -rf stamp*
|
||||||
rm -rf depcomp
|
|
||||||
rm -rf install-sh
|
|
||||||
rm -rf missing
|
|
||||||
rm -rf src/pacman/Makefile
|
|
||||||
rm -rf src/pacman/Makefile.in
|
|
||||||
rm -rf src/util/Makefile
|
|
||||||
rm -rf src/util/Makefile.in
|
|
||||||
rm -rf lib/libftp/Makefile
|
|
||||||
rm -rf lib/libftp/Makefile.in
|
|
||||||
rm -rf lib/libalpm/Makefile.in
|
|
||||||
rm -rf lib/libalpm/Makefile
|
|
||||||
rm -rf aclocal.m4
|
rm -rf aclocal.m4
|
||||||
rm -rf ltmain.sh
|
|
||||||
rm -rf doc/Makefile
|
|
||||||
rm -rf doc/Makefile.in
|
|
||||||
rm -rf doc/hu/Makefile
|
|
||||||
rm -rf doc/hu/Makefile.in
|
|
||||||
rm -rf doc/html/*.html
|
|
||||||
rm -rf doc/man3/*.3
|
|
||||||
rm -rf compile
|
rm -rf compile
|
||||||
rm -rf libtool
|
rm -rf libtool
|
||||||
rm -rf mkinstalldirs
|
|
||||||
rm -rf config.rpath
|
|
||||||
rm -rf scripts/.deps/
|
|
||||||
rm -rf scripts/Makefile.in
|
|
||||||
rm -rf etc/Makefile.in
|
|
||||||
rm -rf etc/Makefile
|
|
||||||
rm -rf etc/pacman.d/Makefile.in
|
|
||||||
rm -rf etc/pacman.d/Makefile
|
|
||||||
rm -rf etc/abs/Makefile.in
|
|
||||||
rm -rf etc/abs/Makefile
|
|
||||||
rm -rf pactest/Makefile.in
|
|
||||||
rm -rf pactest/Makefile
|
|
||||||
|
|
||||||
rm -rf src/pacman/po/Makefile
|
rm -rf lib/libalpm/{Makefile.in,Makefile}
|
||||||
rm -rf src/pacman/po/Makefile.in
|
rm -rf src/util/{Makefile.in,Makefile}
|
||||||
rm -rf src/pacman/po/POTFILES
|
rm -rf src/pacman/{Makefile.in,Makefile}
|
||||||
rm -rf src/pacman/po/stamp-po
|
rm -rf scripts/{Makefile.in,Makefile}
|
||||||
rm -rf src/pacman/po/*.gmo
|
rm -rf etc/{Makefile.in,Makefile}
|
||||||
|
rm -rf etc/pacman.d/{Makefile.in,Makefile}
|
||||||
|
rm -rf etc/abs/{Makefile.in,Makefile}
|
||||||
|
rm -rf pactest/{Makefile.in,Makefile}
|
||||||
|
rm -rf doc/{Makefile.in,Makefile}
|
||||||
|
rm -rf doc/html/*.html
|
||||||
|
rm -rf doc/man3/*.3
|
||||||
|
|
||||||
rm -rf lib/libalpm/po/Makefile
|
rm -rf po/{Makefile.in,Makefile}
|
||||||
rm -rf lib/libalpm/po/Makefile.in
|
rm -rf po/POTFILES
|
||||||
|
rm -rf po/stamp-po
|
||||||
|
rm -rf po/*.gmo
|
||||||
|
|
||||||
|
rm -rf lib/libalpm/po/{Makefile.in,Makefile}
|
||||||
rm -rf lib/libalpm/po/POTFILES
|
rm -rf lib/libalpm/po/POTFILES
|
||||||
rm -rf lib/libalpm/po/stamp-po
|
rm -rf lib/libalpm/po/stamp-po
|
||||||
rm -rf lib/libalpm/po/*.gmo
|
rm -rf lib/libalpm/po/*.gmo
|
||||||
|
|||||||
55
autogen.sh
55
autogen.sh
@@ -1,51 +1,6 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/sh -xu
|
||||||
|
|
||||||
if [ "$1" == "--gettext-only" ]; then
|
aclocal
|
||||||
sh autoclean.sh
|
autoheader
|
||||||
for i in lib/libalpm/po src/pacman/po
|
automake --foreign
|
||||||
do
|
autoconf
|
||||||
cd $i
|
|
||||||
mv Makevars Makevars.tmp
|
|
||||||
package=`pwd|sed 's|.*/\(.*\)/.*|\1|'`
|
|
||||||
intltool-update --pot --gettext-package=$package
|
|
||||||
for j in *.po
|
|
||||||
do
|
|
||||||
if msgmerge $j $package.pot -o $j.new; then
|
|
||||||
mv -f $j.new $j
|
|
||||||
echo -n "$i/$j: "
|
|
||||||
msgfmt -c --statistics -o $j.gmo $j
|
|
||||||
rm -f $j.gmo
|
|
||||||
else
|
|
||||||
echo "msgmerge for $j failed!"
|
|
||||||
rm -f $j.new
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
mv Makevars.tmp Makevars
|
|
||||||
cd - >/dev/null
|
|
||||||
done
|
|
||||||
cd doc
|
|
||||||
po4a -k 0 po4a.cfg
|
|
||||||
cd po
|
|
||||||
for i in *po
|
|
||||||
do
|
|
||||||
if msgmerge $i $package.pot -o $i.new; then
|
|
||||||
mv -f $i.new $i
|
|
||||||
echo -n "man/$i: "
|
|
||||||
msgfmt -c --statistics -o $i.gmo $i
|
|
||||||
rm -f $i.gmo
|
|
||||||
else
|
|
||||||
echo "msgmerge for $i failed!"
|
|
||||||
rm -f $i.new
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp -f $(dirname $(which automake))/../share/automake-*/mkinstalldirs ./
|
|
||||||
cp -f $(dirname $(which automake))/../share/gettext/config.rpath ./
|
|
||||||
|
|
||||||
libtoolize -f -c
|
|
||||||
aclocal --force
|
|
||||||
autoheader -f
|
|
||||||
autoconf -f
|
|
||||||
automake -a -c --gnu --foreign
|
|
||||||
|
|||||||
1526
config.guess
vendored
Executable file
1526
config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
614
config.rpath
Executable file
614
config.rpath
Executable file
@@ -0,0 +1,614 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Output a system dependent set of variables, describing how to set the
|
||||||
|
# run time search path of shared libraries in an executable.
|
||||||
|
#
|
||||||
|
# Copyright 1996-2006 Free Software Foundation, Inc.
|
||||||
|
# Taken from GNU libtool, 2001
|
||||||
|
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||||
|
#
|
||||||
|
# This file is free software; the Free Software Foundation gives
|
||||||
|
# unlimited permission to copy and/or distribute it, with or without
|
||||||
|
# modifications, as long as this notice is preserved.
|
||||||
|
#
|
||||||
|
# The first argument passed to this file is the canonical host specification,
|
||||||
|
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||||
|
# or
|
||||||
|
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||||
|
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
|
||||||
|
# should be set by the caller.
|
||||||
|
#
|
||||||
|
# The set of defined variables is at the end of this script.
|
||||||
|
|
||||||
|
# Known limitations:
|
||||||
|
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
|
||||||
|
# than 256 bytes, otherwise the compiler driver will dump core. The only
|
||||||
|
# known workaround is to choose shorter directory names for the build
|
||||||
|
# directory and/or the installation directory.
|
||||||
|
|
||||||
|
# All known linkers require a `.a' archive for static linking (except MSVC,
|
||||||
|
# which needs '.lib').
|
||||||
|
libext=a
|
||||||
|
shrext=.so
|
||||||
|
|
||||||
|
host="$1"
|
||||||
|
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||||
|
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||||
|
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||||
|
|
||||||
|
# Code taken from libtool.m4's _LT_CC_BASENAME.
|
||||||
|
|
||||||
|
for cc_temp in $CC""; do
|
||||||
|
case $cc_temp in
|
||||||
|
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
|
||||||
|
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
|
||||||
|
\-*) ;;
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
|
||||||
|
|
||||||
|
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
|
||||||
|
|
||||||
|
wl=
|
||||||
|
if test "$GCC" = yes; then
|
||||||
|
wl='-Wl,'
|
||||||
|
else
|
||||||
|
case "$host_os" in
|
||||||
|
aix*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
darwin*)
|
||||||
|
case $cc_basename in
|
||||||
|
xlc*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
mingw* | pw32* | os2*)
|
||||||
|
;;
|
||||||
|
hpux9* | hpux10* | hpux11*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
irix5* | irix6* | nonstopux*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
newsos6)
|
||||||
|
;;
|
||||||
|
linux*)
|
||||||
|
case $cc_basename in
|
||||||
|
icc* | ecc*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
pgcc | pgf77 | pgf90)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
ccc*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
como)
|
||||||
|
wl='-lopt='
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
case `$CC -V 2>&1 | sed 5q` in
|
||||||
|
*Sun\ C*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
osf3* | osf4* | osf5*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
sco3.2v5*)
|
||||||
|
;;
|
||||||
|
solaris*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
sunos4*)
|
||||||
|
wl='-Qoption ld '
|
||||||
|
;;
|
||||||
|
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
sysv4*MP*)
|
||||||
|
;;
|
||||||
|
unicos*)
|
||||||
|
wl='-Wl,'
|
||||||
|
;;
|
||||||
|
uts4*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
|
||||||
|
|
||||||
|
hardcode_libdir_flag_spec=
|
||||||
|
hardcode_libdir_separator=
|
||||||
|
hardcode_direct=no
|
||||||
|
hardcode_minus_L=no
|
||||||
|
|
||||||
|
case "$host_os" in
|
||||||
|
cygwin* | mingw* | pw32*)
|
||||||
|
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||||
|
# When not using gcc, we currently assume that we are using
|
||||||
|
# Microsoft Visual C++.
|
||||||
|
if test "$GCC" != yes; then
|
||||||
|
with_gnu_ld=no
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
interix*)
|
||||||
|
# we just hope/assume this is gcc and not c89 (= MSVC++)
|
||||||
|
with_gnu_ld=yes
|
||||||
|
;;
|
||||||
|
openbsd*)
|
||||||
|
with_gnu_ld=no
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
ld_shlibs=yes
|
||||||
|
if test "$with_gnu_ld" = yes; then
|
||||||
|
# Set some defaults for GNU ld with shared library support. These
|
||||||
|
# are reset later if shared libraries are not supported. Putting them
|
||||||
|
# here allows them to be overridden if necessary.
|
||||||
|
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||||
|
# option of GNU ld is called -rpath, not --rpath.
|
||||||
|
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||||
|
case "$host_os" in
|
||||||
|
aix3* | aix4* | aix5*)
|
||||||
|
# On AIX/PPC, the GNU linker is very broken
|
||||||
|
if test "$host_cpu" != ia64; then
|
||||||
|
ld_shlibs=no
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
amigaos*)
|
||||||
|
hardcode_libdir_flag_spec='-L$libdir'
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||||
|
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||||
|
# to version 4, is to share data among multiple programs linked
|
||||||
|
# with the same dynamic library. Since this doesn't match the
|
||||||
|
# behavior of shared libraries on other platforms, we cannot use
|
||||||
|
# them.
|
||||||
|
ld_shlibs=no
|
||||||
|
;;
|
||||||
|
beos*)
|
||||||
|
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
ld_shlibs=no
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
cygwin* | mingw* | pw32*)
|
||||||
|
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||||
|
# no search path for DLLs.
|
||||||
|
hardcode_libdir_flag_spec='-L$libdir'
|
||||||
|
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
ld_shlibs=no
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
interix3*)
|
||||||
|
hardcode_direct=no
|
||||||
|
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||||
|
;;
|
||||||
|
linux*)
|
||||||
|
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
ld_shlibs=no
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
netbsd*)
|
||||||
|
;;
|
||||||
|
solaris*)
|
||||||
|
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
|
||||||
|
ld_shlibs=no
|
||||||
|
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
ld_shlibs=no
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
|
||||||
|
case `$LD -v 2>&1` in
|
||||||
|
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
|
||||||
|
ld_shlibs=no
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||||
|
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
|
||||||
|
else
|
||||||
|
ld_shlibs=no
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
sunos4*)
|
||||||
|
hardcode_direct=yes
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
ld_shlibs=no
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if test "$ld_shlibs" = no; then
|
||||||
|
hardcode_libdir_flag_spec=
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
case "$host_os" in
|
||||||
|
aix3*)
|
||||||
|
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||||
|
# are no directories specified by -L.
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
if test "$GCC" = yes; then
|
||||||
|
# Neither direct hardcoding nor static linking is supported with a
|
||||||
|
# broken collect2.
|
||||||
|
hardcode_direct=unsupported
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
aix4* | aix5*)
|
||||||
|
if test "$host_cpu" = ia64; then
|
||||||
|
# On IA64, the linker does run time linking by default, so we don't
|
||||||
|
# have to do anything special.
|
||||||
|
aix_use_runtimelinking=no
|
||||||
|
else
|
||||||
|
aix_use_runtimelinking=no
|
||||||
|
# Test if we are trying to use run time linking or normal
|
||||||
|
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||||
|
# need to do runtime linking.
|
||||||
|
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
|
||||||
|
for ld_flag in $LDFLAGS; do
|
||||||
|
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||||
|
aix_use_runtimelinking=yes
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
hardcode_direct=yes
|
||||||
|
hardcode_libdir_separator=':'
|
||||||
|
if test "$GCC" = yes; then
|
||||||
|
case $host_os in aix4.[012]|aix4.[012].*)
|
||||||
|
collect2name=`${CC} -print-prog-name=collect2`
|
||||||
|
if test -f "$collect2name" && \
|
||||||
|
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||||
|
then
|
||||||
|
# We have reworked collect2
|
||||||
|
hardcode_direct=yes
|
||||||
|
else
|
||||||
|
# We have old collect2
|
||||||
|
hardcode_direct=unsupported
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
hardcode_libdir_flag_spec='-L$libdir'
|
||||||
|
hardcode_libdir_separator=
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||||
|
echo 'int main () { return 0; }' > conftest.c
|
||||||
|
${CC} ${LDFLAGS} conftest.c -o conftest
|
||||||
|
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||||
|
}'`
|
||||||
|
if test -z "$aix_libpath"; then
|
||||||
|
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||||
|
}'`
|
||||||
|
fi
|
||||||
|
if test -z "$aix_libpath"; then
|
||||||
|
aix_libpath="/usr/lib:/lib"
|
||||||
|
fi
|
||||||
|
rm -f conftest.c conftest
|
||||||
|
# End _LT_AC_SYS_LIBPATH_AIX.
|
||||||
|
if test "$aix_use_runtimelinking" = yes; then
|
||||||
|
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||||
|
else
|
||||||
|
if test "$host_cpu" = ia64; then
|
||||||
|
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||||
|
else
|
||||||
|
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
amigaos*)
|
||||||
|
hardcode_libdir_flag_spec='-L$libdir'
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
# see comment about different semantics on the GNU ld section
|
||||||
|
ld_shlibs=no
|
||||||
|
;;
|
||||||
|
bsdi[45]*)
|
||||||
|
;;
|
||||||
|
cygwin* | mingw* | pw32*)
|
||||||
|
# When not using gcc, we currently assume that we are using
|
||||||
|
# Microsoft Visual C++.
|
||||||
|
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||||
|
# no search path for DLLs.
|
||||||
|
hardcode_libdir_flag_spec=' '
|
||||||
|
libext=lib
|
||||||
|
;;
|
||||||
|
darwin* | rhapsody*)
|
||||||
|
hardcode_direct=no
|
||||||
|
if test "$GCC" = yes ; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
case $cc_basename in
|
||||||
|
xlc*)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
ld_shlibs=no
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
dgux*)
|
||||||
|
hardcode_libdir_flag_spec='-L$libdir'
|
||||||
|
;;
|
||||||
|
freebsd1*)
|
||||||
|
ld_shlibs=no
|
||||||
|
;;
|
||||||
|
freebsd2.2*)
|
||||||
|
hardcode_libdir_flag_spec='-R$libdir'
|
||||||
|
hardcode_direct=yes
|
||||||
|
;;
|
||||||
|
freebsd2*)
|
||||||
|
hardcode_direct=yes
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
;;
|
||||||
|
freebsd* | kfreebsd*-gnu | dragonfly*)
|
||||||
|
hardcode_libdir_flag_spec='-R$libdir'
|
||||||
|
hardcode_direct=yes
|
||||||
|
;;
|
||||||
|
hpux9*)
|
||||||
|
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||||
|
hardcode_libdir_separator=:
|
||||||
|
hardcode_direct=yes
|
||||||
|
# hardcode_minus_L: Not really in the search PATH,
|
||||||
|
# but as the default location of the library.
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
;;
|
||||||
|
hpux10*)
|
||||||
|
if test "$with_gnu_ld" = no; then
|
||||||
|
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||||
|
hardcode_libdir_separator=:
|
||||||
|
hardcode_direct=yes
|
||||||
|
# hardcode_minus_L: Not really in the search PATH,
|
||||||
|
# but as the default location of the library.
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
hpux11*)
|
||||||
|
if test "$with_gnu_ld" = no; then
|
||||||
|
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||||
|
hardcode_libdir_separator=:
|
||||||
|
case $host_cpu in
|
||||||
|
hppa*64*|ia64*)
|
||||||
|
hardcode_direct=no
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
hardcode_direct=yes
|
||||||
|
# hardcode_minus_L: Not really in the search PATH,
|
||||||
|
# but as the default location of the library.
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
irix5* | irix6* | nonstopux*)
|
||||||
|
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||||
|
hardcode_libdir_separator=:
|
||||||
|
;;
|
||||||
|
netbsd*)
|
||||||
|
hardcode_libdir_flag_spec='-R$libdir'
|
||||||
|
hardcode_direct=yes
|
||||||
|
;;
|
||||||
|
newsos6)
|
||||||
|
hardcode_direct=yes
|
||||||
|
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||||
|
hardcode_libdir_separator=:
|
||||||
|
;;
|
||||||
|
openbsd*)
|
||||||
|
hardcode_direct=yes
|
||||||
|
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||||
|
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||||
|
else
|
||||||
|
case "$host_os" in
|
||||||
|
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||||
|
hardcode_libdir_flag_spec='-R$libdir'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
os2*)
|
||||||
|
hardcode_libdir_flag_spec='-L$libdir'
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
;;
|
||||||
|
osf3*)
|
||||||
|
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||||
|
hardcode_libdir_separator=:
|
||||||
|
;;
|
||||||
|
osf4* | osf5*)
|
||||||
|
if test "$GCC" = yes; then
|
||||||
|
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||||
|
else
|
||||||
|
# Both cc and cxx compiler support -rpath directly
|
||||||
|
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||||
|
fi
|
||||||
|
hardcode_libdir_separator=:
|
||||||
|
;;
|
||||||
|
solaris*)
|
||||||
|
hardcode_libdir_flag_spec='-R$libdir'
|
||||||
|
;;
|
||||||
|
sunos4*)
|
||||||
|
hardcode_libdir_flag_spec='-L$libdir'
|
||||||
|
hardcode_direct=yes
|
||||||
|
hardcode_minus_L=yes
|
||||||
|
;;
|
||||||
|
sysv4)
|
||||||
|
case $host_vendor in
|
||||||
|
sni)
|
||||||
|
hardcode_direct=yes # is this really true???
|
||||||
|
;;
|
||||||
|
siemens)
|
||||||
|
hardcode_direct=no
|
||||||
|
;;
|
||||||
|
motorola)
|
||||||
|
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
sysv4.3*)
|
||||||
|
;;
|
||||||
|
sysv4*MP*)
|
||||||
|
if test -d /usr/nec; then
|
||||||
|
ld_shlibs=yes
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
|
||||||
|
;;
|
||||||
|
sysv5* | sco3.2v5* | sco5v6*)
|
||||||
|
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
|
||||||
|
hardcode_libdir_separator=':'
|
||||||
|
;;
|
||||||
|
uts4*)
|
||||||
|
hardcode_libdir_flag_spec='-L$libdir'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
ld_shlibs=no
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check dynamic linker characteristics
|
||||||
|
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
|
||||||
|
libname_spec='lib$name'
|
||||||
|
case "$host_os" in
|
||||||
|
aix3*)
|
||||||
|
;;
|
||||||
|
aix4* | aix5*)
|
||||||
|
;;
|
||||||
|
amigaos*)
|
||||||
|
;;
|
||||||
|
beos*)
|
||||||
|
;;
|
||||||
|
bsdi[45]*)
|
||||||
|
;;
|
||||||
|
cygwin* | mingw* | pw32*)
|
||||||
|
shrext=.dll
|
||||||
|
;;
|
||||||
|
darwin* | rhapsody*)
|
||||||
|
shrext=.dylib
|
||||||
|
;;
|
||||||
|
dgux*)
|
||||||
|
;;
|
||||||
|
freebsd1*)
|
||||||
|
;;
|
||||||
|
kfreebsd*-gnu)
|
||||||
|
;;
|
||||||
|
freebsd* | dragonfly*)
|
||||||
|
;;
|
||||||
|
gnu*)
|
||||||
|
;;
|
||||||
|
hpux9* | hpux10* | hpux11*)
|
||||||
|
case $host_cpu in
|
||||||
|
ia64*)
|
||||||
|
shrext=.so
|
||||||
|
;;
|
||||||
|
hppa*64*)
|
||||||
|
shrext=.sl
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
shrext=.sl
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
interix3*)
|
||||||
|
;;
|
||||||
|
irix5* | irix6* | nonstopux*)
|
||||||
|
case "$host_os" in
|
||||||
|
irix5* | nonstopux*)
|
||||||
|
libsuff= shlibsuff=
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
case $LD in
|
||||||
|
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
|
||||||
|
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
|
||||||
|
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
|
||||||
|
*) libsuff= shlibsuff= ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
linux*oldld* | linux*aout* | linux*coff*)
|
||||||
|
;;
|
||||||
|
linux*)
|
||||||
|
;;
|
||||||
|
knetbsd*-gnu)
|
||||||
|
;;
|
||||||
|
netbsd*)
|
||||||
|
;;
|
||||||
|
newsos6)
|
||||||
|
;;
|
||||||
|
nto-qnx*)
|
||||||
|
;;
|
||||||
|
openbsd*)
|
||||||
|
;;
|
||||||
|
os2*)
|
||||||
|
libname_spec='$name'
|
||||||
|
shrext=.dll
|
||||||
|
;;
|
||||||
|
osf3* | osf4* | osf5*)
|
||||||
|
;;
|
||||||
|
solaris*)
|
||||||
|
;;
|
||||||
|
sunos4*)
|
||||||
|
;;
|
||||||
|
sysv4 | sysv4.3*)
|
||||||
|
;;
|
||||||
|
sysv4*MP*)
|
||||||
|
;;
|
||||||
|
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||||
|
;;
|
||||||
|
uts4*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||||
|
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||||
|
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||||
|
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||||
|
|
||||||
|
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||||
|
|
||||||
|
# How to pass a linker flag through the compiler.
|
||||||
|
wl="$escaped_wl"
|
||||||
|
|
||||||
|
# Static library suffix (normally "a").
|
||||||
|
libext="$libext"
|
||||||
|
|
||||||
|
# Shared library suffix (normally "so").
|
||||||
|
shlibext="$shlibext"
|
||||||
|
|
||||||
|
# Flag to hardcode \$libdir into a binary during linking.
|
||||||
|
# This must work even if \$libdir does not exist.
|
||||||
|
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||||
|
|
||||||
|
# Whether we need a single -rpath flag with a separated argument.
|
||||||
|
hardcode_libdir_separator="$hardcode_libdir_separator"
|
||||||
|
|
||||||
|
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
|
||||||
|
# resulting binary.
|
||||||
|
hardcode_direct="$hardcode_direct"
|
||||||
|
|
||||||
|
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
|
||||||
|
# resulting binary.
|
||||||
|
hardcode_minus_L="$hardcode_minus_L"
|
||||||
|
|
||||||
|
EOF
|
||||||
1658
config.sub
vendored
Executable file
1658
config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
447
configure.ac
447
configure.ac
@@ -1,225 +1,388 @@
|
|||||||
ENV_CFLAGS=$CFLAGS
|
# -*- Autoconf -*-
|
||||||
CFLAGS=""
|
# 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
|
||||||
|
|
||||||
|
m4_define([lib_current], [3])
|
||||||
|
m4_define([lib_revision], [0])
|
||||||
|
m4_define([lib_age], [0])
|
||||||
|
|
||||||
|
m4_define([pacman_version_major], [3])
|
||||||
|
m4_define([pacman_version_minor], [2])
|
||||||
|
m4_define([pacman_version_micro], [0])
|
||||||
|
m4_define([pacman_version],
|
||||||
|
[pacman_version_major.pacman_version_minor.pacman_version_micro])
|
||||||
|
|
||||||
|
# Autoconf initialization
|
||||||
|
AC_INIT([pacman], [pacman_version], [pacman-dev@archlinux.org])
|
||||||
|
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.0, [pacman-dev@archlinux.org], [pacman])
|
|
||||||
AC_LANG([C])
|
|
||||||
AC_CONFIG_HEADERS(config.h)
|
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
AM_INIT_AUTOMAKE
|
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,
|
||||||
|
AS_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,
|
||||||
|
AS_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,
|
||||||
|
AS_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,
|
||||||
|
AS_HELP_STRING([--with-db-ext=ext], [set the file extension used by the database]),
|
||||||
|
[DBEXT=$withval], [DBEXT=.db.tar.gz])
|
||||||
|
|
||||||
|
# Help line for libdownload/libfetch
|
||||||
|
AC_ARG_ENABLE(internal-download,
|
||||||
|
AS_HELP_STRING([--disable-internal-download], [do not build with libdownload/libfetch support]),
|
||||||
|
[internaldownload=$enableval], [internaldownload=yes])
|
||||||
|
|
||||||
|
# Help line for documentation
|
||||||
|
AC_ARG_ENABLE(doc,
|
||||||
|
AS_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]),
|
||||||
|
[wantdoc=$enableval], [wantdoc=yes])
|
||||||
|
|
||||||
|
# Help line for doxygen
|
||||||
|
AC_ARG_ENABLE(doxygen,
|
||||||
|
AS_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
|
||||||
|
[wantdoxygen=$enableval], [wantdoxygen=no])
|
||||||
|
|
||||||
|
# Help line for asciidoc
|
||||||
|
AC_ARG_ENABLE(asciidoc,
|
||||||
|
AS_HELP_STRING([--enable-asciidoc], [build your own manpages with Asciidoc]),
|
||||||
|
[wantasciidoc=$enableval], [wantasciidoc=no])
|
||||||
|
|
||||||
|
# Help line for debug
|
||||||
|
AC_ARG_ENABLE(debug,
|
||||||
|
AS_HELP_STRING([--enable-debug], [enable debugging support]),
|
||||||
|
[debug=$enableval], [debug=no])
|
||||||
|
|
||||||
|
# Help line for using git version in pacman version string
|
||||||
|
AC_ARG_ENABLE(git-version,
|
||||||
|
AS_HELP_STRING([--enable-git-version],
|
||||||
|
[enable use of git version in version string if available]),
|
||||||
|
[wantgitver=$enableval], [wantgitver=no])
|
||||||
|
|
||||||
|
# Checks for programs.
|
||||||
|
AC_PROG_AWK
|
||||||
|
AC_PROG_CC_C99
|
||||||
|
AC_PROG_INSTALL
|
||||||
|
AC_PROG_LN_S
|
||||||
|
AC_PROG_MAKE_SET
|
||||||
|
AC_PROG_LIBTOOL
|
||||||
|
AC_CHECK_PROGS([PYTHON], [python2.5 python2.4 python], [false])
|
||||||
|
|
||||||
|
# find installed gettext
|
||||||
AM_GNU_GETTEXT([external])
|
AM_GNU_GETTEXT([external])
|
||||||
AM_GNU_GETTEXT_VERSION(0.13.1)
|
AM_GNU_GETTEXT_VERSION(0.13.1)
|
||||||
|
|
||||||
dnl Define the libalpm version number here
|
# Check for libarchive
|
||||||
LIB_MAJOR_VERSION=1
|
AC_CHECK_LIB([archive], [archive_read_data], ,
|
||||||
LIB_MINOR_VERSION=0
|
AC_MSG_ERROR([libarchive is needed to compile pacman!]))
|
||||||
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
|
|
||||||
|
|
||||||
dnl Set subsitution values for version stuff in Makefiles and anywhere else
|
# Enable or disable usage of libdownload/libfetch
|
||||||
AC_SUBST(LIB_VERSION)
|
# - this is a nested check- first see if we need a library, if we do then
|
||||||
AC_SUBST(LIB_VERSION_INFO)
|
# check for libdownload first, then fallback to libfetch, then die
|
||||||
|
AC_MSG_CHECKING(whether to link with download library)
|
||||||
|
if test "x$internaldownload" = "xyes" ; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE([INTERNAL_DOWNLOAD], , [Use internal download library])
|
||||||
|
# Check for a download library if it was actually requested
|
||||||
|
AC_CHECK_LIB([download], [downloadParseURL], ,
|
||||||
|
AC_CHECK_LIB([fetch], [fetchParseURL], ,
|
||||||
|
AC_MSG_ERROR([libdownload or libfetch are needed to compile with internal download support])) )
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(INTERNAL_DOWNLOAD, test "x$internaldownload" = "xyes")
|
||||||
|
|
||||||
dnl Put version number in config.h
|
# Checks for header files.
|
||||||
AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number])
|
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/param.h sys/statvfs.h sys/syslimits.h sys/time.h syslog.h wchar.h])
|
||||||
|
|
||||||
dnl Configuration files
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
dnl AC_CONFIG_FILES([etc/makepkg.conf] [etc/pacman.conf])
|
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
|
# Checks for library functions.
|
||||||
AC_HEADER_STDC
|
AC_FUNC_FORK
|
||||||
AC_PROG_INSTALL
|
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
|
||||||
AC_CHECK_FUNCS([strverscmp])
|
AC_FUNC_MKTIME
|
||||||
AM_PROG_LIBTOOL
|
AC_TYPE_SIGNAL
|
||||||
AM_CONDITIONAL(LINKSTATIC, test "$enable_static" = "yes")
|
AC_CHECK_FUNCS([geteuid realpath regcomp strcasecmp \
|
||||||
|
strndup strrchr strsep swprintf \
|
||||||
|
wcwidth uname])
|
||||||
|
|
||||||
dnl Help line for doxygen
|
# Enable large file support if available
|
||||||
AC_ARG_ENABLE(doxygen,
|
AC_SYS_LARGEFILE
|
||||||
AC_HELP_STRING([--disable-doxygen], [Build API docs via Doxygen]),
|
|
||||||
[wantdoxygen=$enableval], [wantdoxygen=yes])
|
|
||||||
|
|
||||||
dnl Help line for config file
|
# Check if we can use symbol visibility support in GCC
|
||||||
AC_ARG_WITH(config-file,
|
GCC_VISIBILITY_CC
|
||||||
AC_HELP_STRING([--with-config-file=path], [Set the location of pacman's config file]),
|
# Check if we have -fgnu89-inline flag
|
||||||
[configfile=$withval], [configfile=/etc/pacman.conf])
|
GCC_GNU89_INLINE_CC
|
||||||
|
|
||||||
dnl Help line for debug
|
# Host-dependant definitions
|
||||||
AC_ARG_ENABLE(debug,
|
case "${host_os}" in
|
||||||
AC_HELP_STRING([--enable-debug], [Enable debugging support]),
|
cygwin*)
|
||||||
[debug=$enableval], [debug=no])
|
host_os_cygwin=yes
|
||||||
|
CFLAGS="$CFLAGS -DCYGWIN"
|
||||||
dnl Help line for fakeroot
|
;;
|
||||||
AC_ARG_ENABLE(fakeroot,
|
darwin*)
|
||||||
AC_HELP_STRING([--disable-fakeroot], [Disable fakeroot proof support]),
|
host_os_darwin=yes
|
||||||
[fakeroot=$enableval], [fakeroot=yes])
|
|
||||||
|
|
||||||
dnl Host-dependant flags
|
|
||||||
case "${host}" in
|
|
||||||
*-*-cygwin*)
|
|
||||||
ENV_CFLAGS="$ENV_CFLAGS -DCYGWIN"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
dnl Check for architecture
|
AM_CONDITIONAL([CYGWIN], test "x$host_os_cygwin" = "xyes")
|
||||||
|
AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes")
|
||||||
|
|
||||||
|
# Check for architecture, used in default makepkg.conf
|
||||||
|
# (Note single space left after CARCHFLAGS)
|
||||||
case "${host}" in
|
case "${host}" in
|
||||||
i686-*)
|
i686-*)
|
||||||
CARCH="i686"
|
CARCH="i686"
|
||||||
CARCHFLAGS="i686"
|
CARCHFLAGS="-march=i686 "
|
||||||
ARCHSWITCH="march"
|
|
||||||
;;
|
;;
|
||||||
x86_64-*)
|
x86_64-*)
|
||||||
CARCH="x86_64"
|
CARCH="x86_64"
|
||||||
CARCHFLAGS="x86-64"
|
CARCHFLAGS="-march=x86-64 "
|
||||||
ARCHSWITCH="march"
|
|
||||||
;;
|
;;
|
||||||
ia64-*)
|
ia64-*)
|
||||||
CARCH="ia64"
|
CARCH="ia64"
|
||||||
CARCHFLAGS="ia64"
|
CARCHFLAGS="-march=ia64 "
|
||||||
ARCHSWITCH="march"
|
|
||||||
;;
|
;;
|
||||||
sparc-*)
|
sparc-*)
|
||||||
CARCH="sparc"
|
CARCH="sparc"
|
||||||
CARCHFLAGS="v9"
|
CARCHFLAGS="-mcpu=v9 "
|
||||||
ARCHSWITCH="mcpu"
|
|
||||||
;;
|
;;
|
||||||
ppc-* | powerpc-*)
|
ppc-* | powerpc-*)
|
||||||
CARCH="ppc"
|
CARCH="ppc"
|
||||||
CARCHFLAGS="750"
|
CARCHFLAGS="-mcpu=750 "
|
||||||
ARCHSWITCH="mcpu"
|
|
||||||
;;
|
;;
|
||||||
i386-*)
|
i386-*)
|
||||||
CARCH="i386"
|
CARCH="i386"
|
||||||
CARCHFLAGS="i386"
|
CARCHFLAGS="-march=i386 "
|
||||||
ARCHSWITCH="march"
|
;;
|
||||||
|
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
|
esac
|
||||||
|
|
||||||
dnl Now do some things common to all architectures
|
# Now do some things common to all architectures
|
||||||
CHOST="${host}"
|
CHOST="${host}"
|
||||||
AC_SUBST(CARCH)
|
AC_SUBST(CARCH)
|
||||||
AC_SUBST(CARCHFLAGS)
|
AC_SUBST(CARCHFLAGS)
|
||||||
AC_SUBST(ARCHSWITCH)
|
|
||||||
AC_SUBST(CHOST)
|
AC_SUBST(CHOST)
|
||||||
|
|
||||||
dnl Humor lowers blood pressure
|
# Check for documentation support and status
|
||||||
AC_MSG_CHECKING(your blood pressure)
|
AC_MSG_CHECKING([for building documentation])
|
||||||
AC_MSG_RESULT([a bit high, but we can proceed])
|
if test "x$wantdoc" = "xyes" ; then
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
dnl Check for doxygen support
|
wantdoc=yes
|
||||||
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
|
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_CHECK_PROGS([DOXYGEN], [doxygen])
|
||||||
|
AC_MSG_CHECKING([for doxygen])
|
||||||
|
if test "x$wantdoxygen" = "xyes" ; then
|
||||||
|
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
|
usedoxygen=no
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(HAS_DOXYGEN, test "x$usedoxygen" = "xyes")
|
AM_CONDITIONAL(USE_DOXYGEN, test "x$usedoxygen" = "xyes")
|
||||||
|
|
||||||
dnl Check for math
|
# Check for asciidoc support and status
|
||||||
AC_CHECK_LIB([m], [sqrt], [AC_CHECK_HEADER([math.h], [LIBM='-lm'])])
|
AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
|
||||||
if test -z "$LIBM"; then
|
AC_MSG_CHECKING([for asciidoc])
|
||||||
AC_MSG_ERROR("math library needed to compile pacman!");
|
if test "x$wantasciidoc" = "xyes" ; then
|
||||||
fi
|
if test $ASCIIDOC ; then
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
dnl Check for libarchive
|
useasciidoc=yes
|
||||||
AC_CHECK_LIB([archive], [archive_read_data], [AC_CHECK_HEADER([archive.h], [LIBARCHIVE='-larchive'])])
|
else
|
||||||
if test -z "$LIBARCHIVE"; then
|
AC_MSG_RESULT([no, asciidoc missing])
|
||||||
AC_MSG_ERROR("libarchive is needed to compile pacman!");
|
useasciidoc=no
|
||||||
fi
|
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"])
|
|
||||||
else
|
else
|
||||||
AC_MSG_ERROR(["pacman config file (--with-config-file is not set"])
|
AC_MSG_RESULT([no, disabled by configure])
|
||||||
|
useasciidoc=no
|
||||||
fi
|
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)
|
AC_MSG_CHECKING(for debug mode request)
|
||||||
if test "x$debug" = "xyes" ; then
|
if test "x$debug" = "xyes" ; then
|
||||||
AC_DEFINE([PACMAN_DEBUG], , [Enable debug code])
|
|
||||||
CFLAGS="$CFLAGS -g -Wall -Werror -fstack-protector -std=c99"
|
|
||||||
LDFLAGS="$LDFLAGS -lmcheck"
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
else
|
|
||||||
CFLAGS="$CFLAGS -Wall -std=c99"
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Enable or disable fakeroot code
|
|
||||||
AC_MSG_CHECKING(for fakeroot proof support)
|
|
||||||
if test "x$fakeroot" = "xyes" ; then
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE([PACMAN_DEBUG], , [Enable debug code])
|
||||||
|
# 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
|
else
|
||||||
AC_DEFINE([FAKEROOT], , [Disable fakeroot-proof code])
|
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
CFLAGS="$CFLAGS -Wall"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl Set CFLAGS to both $CFLAGS and ones from env ($ENV_CFLAGS)
|
# Enable or disable use of git version in pacman version string
|
||||||
CFLAGS="$CFLAGS $ENV_CFLAGS"
|
AC_CHECK_PROGS([GIT], [git])
|
||||||
|
AC_CHECK_FILE([.git/], hasgitdir=yes)
|
||||||
|
AC_MSG_CHECKING(whether to use git version if available)
|
||||||
|
if test "x$wantgitver" = "xyes" ; then
|
||||||
|
if test $GIT -a "x$hasgitdir" = "xyes"; then
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
usegitver=yes
|
||||||
|
AC_DEFINE([USE_GIT_VERSION], , [Use GIT version in version string])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no, git or .git dir missing])
|
||||||
|
usegitver=no
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no, disabled by configure])
|
||||||
|
usegitver=no
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(USE_GIT_VERSION, test "x$usegitver" = "xyes")
|
||||||
|
|
||||||
dnl ==========================================================================
|
# 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])
|
||||||
|
|
||||||
AC_OUTPUT([
|
# Configuration files
|
||||||
|
AC_CONFIG_FILES([
|
||||||
lib/libalpm/Makefile
|
lib/libalpm/Makefile
|
||||||
lib/libalpm/po/Makefile.in
|
lib/libalpm/po/Makefile.in
|
||||||
src/pacman/Makefile
|
src/pacman/Makefile
|
||||||
src/pacman/po/Makefile.in
|
|
||||||
src/util/Makefile
|
src/util/Makefile
|
||||||
scripts/Makefile
|
scripts/Makefile
|
||||||
doc/Makefile
|
doc/Makefile
|
||||||
etc/Makefile
|
etc/Makefile
|
||||||
etc/makepkg.conf
|
po/Makefile.in
|
||||||
etc/pacman.conf
|
|
||||||
etc/pacman.d/Makefile
|
|
||||||
etc/pacman.d/mirrorlist
|
|
||||||
etc/abs/Makefile
|
|
||||||
pactest/Makefile
|
pactest/Makefile
|
||||||
contrib/Makefile
|
contrib/Makefile
|
||||||
Makefile
|
Makefile
|
||||||
])
|
])
|
||||||
|
AC_OUTPUT
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
pacman-$VERSION:
|
${PACKAGE_NAME}:
|
||||||
|
|
||||||
prefix : ${prefix}
|
Build information:
|
||||||
source code location : ${srcdir}
|
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 : ${CC}
|
||||||
compiler flags : ${CFLAGS}
|
compiler flags : ${CFLAGS}
|
||||||
defines : ${DEFS}
|
defines : ${DEFS}
|
||||||
|
|
||||||
Architecture : ${CARCH}
|
Architecture : ${CARCH}
|
||||||
Architecture flags : -${ARCHSWITCH}=${CARCHFLAGS}
|
Architecture flags : ${CARCHFLAGS}
|
||||||
Host Type : ${CHOST}
|
Host Type : ${CHOST}
|
||||||
|
|
||||||
libalpm version : ${LIB_VERSION}
|
libalpm version : ${LIB_VERSION}
|
||||||
|
libalpm version info : ${LIB_VERSION_INFO}
|
||||||
pacman version : ${PACKAGE_VERSION}
|
pacman version : ${PACKAGE_VERSION}
|
||||||
pacman.conf location : ${configfile}
|
using git version : ${usegitver}
|
||||||
|
|
||||||
|
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}
|
||||||
|
Use download library : ${internaldownload}
|
||||||
Doxygen support : ${usedoxygen}
|
Doxygen support : ${usedoxygen}
|
||||||
|
Asciidoc support : ${useasciidoc}
|
||||||
debug support : ${debug}
|
debug support : ${debug}
|
||||||
fakeroot-proof support : ${fakeroot}
|
|
||||||
"
|
"
|
||||||
|
|
||||||
|
# vim:set ts=2 sw=2 noet:
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
@@ -1,7 +1,16 @@
|
|||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
|
PKGBUILD.vim \
|
||||||
|
bacman \
|
||||||
bash_completion \
|
bash_completion \
|
||||||
pacsearch \
|
gensync \
|
||||||
pacdiff \
|
pacdiff \
|
||||||
re-pacman \
|
paclist \
|
||||||
zsh_completion
|
pacsearch \
|
||||||
|
pactree \
|
||||||
|
updatesync \
|
||||||
|
vimprojects \
|
||||||
|
wget-xdelta.sh \
|
||||||
|
zsh_completion \
|
||||||
|
README
|
||||||
|
|
||||||
|
# vim:set ts=2 sw=2 noet:
|
||||||
|
|||||||
241
contrib/PKGBUILD.vim
Normal file
241
contrib/PKGBUILD.vim
Normal file
@@ -0,0 +1,241 @@
|
|||||||
|
" 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 region pbLicenseGroup start=/^license=(/ end=/)/ contains=pb_k_license,pbLicenseCustom,pbLicense,pbIllegalLicense
|
||||||
|
|
||||||
|
" backup
|
||||||
|
syn keyword pb_k_backup backup contained
|
||||||
|
syn match pbValidBackup /\.\?[[:alpha:]]*\/[[:alnum:]\{\}+._$-]*]*/ contained
|
||||||
|
syn region pbBackupGroup start=/^backup=(/ end=/)/ 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 region pbArchGroup start=/^arch=(/ end=/)/ contains=pb_k_arch,pbArch,pbIllegalArch
|
||||||
|
|
||||||
|
" groups
|
||||||
|
syn keyword pb_k_groups groups contained
|
||||||
|
syn match pbValidGroups /\([[:alnum:]]\|+\|-\|_\)*/ contained
|
||||||
|
syn region pbGroupsGroup start=/^groups=(/ end=/)/ contains=pb_k_groups,pbValidGroups,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
|
||||||
|
|
||||||
|
" 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
|
||||||
|
|
||||||
|
" optdepends
|
||||||
|
syn keyword pb_k_optdepends optdepends contained
|
||||||
|
syn match pbValidOptdepends /\([[:alnum:]]\|+\|-\|_\)*/ contained
|
||||||
|
syn region pbOptdependsGroup start=/^optdepends=(/ end=/)/ contains=pb_k_optdepends,pbValidOptdepends,shDoubleQuote,shSingleQuote
|
||||||
|
|
||||||
|
" 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 strange 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, fix strange 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 keepend
|
||||||
|
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 keepend
|
||||||
|
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\|zipman\|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_groups pbKeywords
|
||||||
|
hi def link pb_k_makedepends pbKeywords
|
||||||
|
hi def link pb_k_optdepends 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
|
||||||
37
contrib/README
Normal file
37
contrib/README
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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/.
|
||||||
|
|
||||||
|
paclist - list all packages installed from a given repository. Useful for
|
||||||
|
seeing which packages you may have installed from the testing repository,
|
||||||
|
for instance.
|
||||||
|
|
||||||
|
pacsearch - a colorized search combining both -Ss and -Qs output. Installed
|
||||||
|
packages are easily identified with a *** and local-only packages are also
|
||||||
|
listed.
|
||||||
|
|
||||||
|
pactree - generate a dependency tree of an installed package in textual or
|
||||||
|
graphical form (using graphviz).
|
||||||
|
|
||||||
|
bacman - regenerate a pacman package based on installed files and the pacman
|
||||||
|
database entries. Useful for reuse, or possible config file extension.
|
||||||
|
|
||||||
|
vimprojects - a project file for the vim project plugin.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
gensync, updatesync - The former repository management scripts that have since
|
||||||
|
been superseded by repo-add and repo-remove. They are here for posterity's
|
||||||
|
sake, and to show how repo-add and repo-remove can be wrapped in other scripts.
|
||||||
284
contrib/bacman
Executable file
284
contrib/bacman
Executable file
@@ -0,0 +1,284 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# bacman: recreate a package from a running system
|
||||||
|
# This script rebuilds an already installed package using metadata
|
||||||
|
# stored into the pacman database and system files
|
||||||
|
#
|
||||||
|
# (c) 2008 - locci <carlocci_at_gmail_dot_com>
|
||||||
|
#
|
||||||
|
# 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/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
readonly progname="bacman"
|
||||||
|
readonly progver="0.2.0"
|
||||||
|
|
||||||
|
#
|
||||||
|
# User Friendliness
|
||||||
|
#
|
||||||
|
function usage(){
|
||||||
|
echo "This program recreates a package using pacman's db and system files"
|
||||||
|
echo "Usage: $progname <installed package name>"
|
||||||
|
echo "Example: $progname kernel26"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# -ne 1 ] ; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "--help" -o "$1" = "-h" ] ; then
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "--version" -o "$1" = "-v" ]; then
|
||||||
|
echo "$progname version $progver"
|
||||||
|
echo "Copyright (C) 2008 locci"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Fakeroot support
|
||||||
|
#
|
||||||
|
if [ $EUID -gt 0 ]; then
|
||||||
|
if [ -f /usr/bin/fakeroot ]; then
|
||||||
|
echo "Entering fakeroot environment"
|
||||||
|
export INFAKEROOT="1"
|
||||||
|
/usr/bin/fakeroot -u -- $0 $1
|
||||||
|
exit $?
|
||||||
|
else
|
||||||
|
echo "WARNING: installing fakeroot or running ${progname} as root is required to"
|
||||||
|
echo " preserve the ownership permissions of files in some packages"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Setting environmental variables
|
||||||
|
#
|
||||||
|
if [ ! -r /etc/pacman.conf ]; then
|
||||||
|
echo "ERROR: unable to read /etc/pacman.conf"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
eval $(awk '/DBPath/ {print $1$2$3}' /etc/pacman.conf)
|
||||||
|
pac_db="${DBPath:-/var/lib/pacman/}/local"
|
||||||
|
|
||||||
|
if [ ! -r /etc/makepkg.conf ]; then
|
||||||
|
echo "ERROR: unable to read /etc/makepkg.conf"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
source "/etc/makepkg.conf"
|
||||||
|
if [ -r ~/.makepkg.conf ]; then
|
||||||
|
source ~/.makepkg.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
pkg_arch=${CARCH:-'unknown'}
|
||||||
|
pkg_dest="${PKGDEST:-$PWD}"
|
||||||
|
pkg_ext=${PKGEXT:-'.pkg.tar.gz'}
|
||||||
|
pkg_pkger=${PACKAGER:-'Unknown Packager'}
|
||||||
|
|
||||||
|
pkg_name="$1"
|
||||||
|
pkg_dir="$(echo $pac_db/$pkg_name-[0-9]*)"
|
||||||
|
pkg_namver="${pkg_dir##*/}"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Checks everything is in place
|
||||||
|
#
|
||||||
|
if [ ! -d "$pac_db" ] ; then
|
||||||
|
echo "ERROR: pacman database directory ${pac_db} not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "$pkg_dir" ] ; then
|
||||||
|
echo "ERROR: package ${pkg_name} not found in pacman database"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Begin
|
||||||
|
#
|
||||||
|
echo Package: ${pkg_namver}
|
||||||
|
work_dir=$(mktemp -d -p /tmp)
|
||||||
|
cd "$work_dir" || exit 1
|
||||||
|
|
||||||
|
#
|
||||||
|
# File copying
|
||||||
|
#
|
||||||
|
echo "Copying package files..."
|
||||||
|
|
||||||
|
cat "$pkg_dir"/files |
|
||||||
|
while read i; do
|
||||||
|
if [ -z "$i" ] ; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$i" =~ %[A-Z]*% ]] ; then
|
||||||
|
current=$i
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $current in
|
||||||
|
%FILES%)
|
||||||
|
ret=0
|
||||||
|
if [ -e "/$i" ]; then
|
||||||
|
bsdtar -cnf - "/$i" 2> /dev/null | bsdtar -xpf -
|
||||||
|
|
||||||
|
# Workaround to bsdtar not reporting a missing file as an error
|
||||||
|
if [ ! -e "$work_dir/$i" ] && [ -L "$work_dir/$i"]; then
|
||||||
|
echo ""
|
||||||
|
echo "ERROR: unable to add /$i to the package"
|
||||||
|
echo " If your user does not have permssion to read this file then"
|
||||||
|
echo " you will need to run $progname as root"
|
||||||
|
rm -rf "$work_dir"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "WARNING: package file /$i is missing"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
ret=$?
|
||||||
|
if [ $ret -ne 0 ]; then
|
||||||
|
rm -rf "$work_dir"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pkg_size=$(du -sk | awk '{print $1 * 1024}')
|
||||||
|
|
||||||
|
if [ -f "$pkg_dir/install" ] ; then
|
||||||
|
cp "$pkg_dir/install" "$work_dir/.INSTALL"
|
||||||
|
fi
|
||||||
|
if [ -f $pkg_dir/changelog ] ; then
|
||||||
|
cp "$pkg_dir/changelog" "$work_dir/.CHANGELOG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# .PKGINFO stuff
|
||||||
|
#
|
||||||
|
echo Generating .PKGINFO metadata...
|
||||||
|
echo "# Generated by $progname $progver" > .PKGINFO
|
||||||
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
|
echo "# Using $(fakeroot -v)" >> .PKGINFO
|
||||||
|
fi
|
||||||
|
echo "# $(LC_ALL=C date)" >> .PKGINFO
|
||||||
|
echo "#" >> .PKGINFO
|
||||||
|
|
||||||
|
cat "$pkg_dir"/{desc,files,depends} |
|
||||||
|
while read i; do
|
||||||
|
if [[ -z "$i" ]]; then
|
||||||
|
continue;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$i" =~ %[A-Z]*% ]] ; then
|
||||||
|
current=$i
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$current" in
|
||||||
|
# desc
|
||||||
|
%NAME%)
|
||||||
|
echo "pkgname = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%VERSION%)
|
||||||
|
echo "pkgver = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%DESC%)
|
||||||
|
echo "pkgdesc = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%URL%)
|
||||||
|
echo "url = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%LICENSE%)
|
||||||
|
echo "license = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%ARCH%)
|
||||||
|
echo "arch = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%BUILDDATE%)
|
||||||
|
echo "builddate = $(date -u "+%s")" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%PACKAGER%)
|
||||||
|
echo "packager = $pkg_pkger" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%SIZE%)
|
||||||
|
echo "size = $pkg_size" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%GROUPS%)
|
||||||
|
echo "group = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%REPLACES%)
|
||||||
|
echo "replaces = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%FORCE%)
|
||||||
|
echo "force = true" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
|
||||||
|
# files
|
||||||
|
%BACKUP%)
|
||||||
|
# strip the md5sum after the tab
|
||||||
|
echo "backup = ${i%%$'\t'*}" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
|
||||||
|
# depends
|
||||||
|
%DEPENDS%)
|
||||||
|
echo "depend = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%OPTDEPENDS%)
|
||||||
|
echo "optdepend = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%CONFLICTS%)
|
||||||
|
echo "conflict = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
%PROVIDES%)
|
||||||
|
echo "provides = $i" >> .PKGINFO
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
#
|
||||||
|
# Fixes owner:group and permissions for .PKGINFO, .CHANGELOG, .INSTALL
|
||||||
|
#
|
||||||
|
chown root:root "$work_dir"/{.PKGINFO,.CHANGELOG,.INSTALL} 2> /dev/null
|
||||||
|
chmod 644 "$work_dir"/{.PKGINFO,.CHANGELOG,.INSTALL} 2> /dev/null
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generate the package
|
||||||
|
#
|
||||||
|
echo "Generating the package..."
|
||||||
|
|
||||||
|
ret=0
|
||||||
|
bsdtar -czf "$pkg_dest/$pkg_namver-$pkg_arch$pkg_ext" $(ls -A) || ret=$?
|
||||||
|
if [ $ret -ne 0 ]; then
|
||||||
|
echo "ERROR: unable to write package to $pkg_dest"
|
||||||
|
echo " Maybe the disk is full or you do not have write access"
|
||||||
|
rm -rf "$work_dir"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf "$work_dir"
|
||||||
|
|
||||||
|
echo Done
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# vim: set ts=2 sw=2 noet:
|
||||||
|
|
||||||
@@ -7,18 +7,6 @@
|
|||||||
# Distributed under the terms of the GNU General Public License, v2 or later.
|
# 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
|
## initial functions
|
||||||
|
|
||||||
rem_selected ()
|
rem_selected ()
|
||||||
@@ -60,7 +48,7 @@ _available_pkgs ()
|
|||||||
local available_pkgs
|
local available_pkgs
|
||||||
local enabled_repos
|
local enabled_repos
|
||||||
enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
|
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 ) )
|
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 available_groups
|
||||||
local enabled_repos
|
local enabled_repos
|
||||||
enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
|
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 ) )
|
COMPREPLY=( $( compgen -W "$( for i in $available_groups; do echo ${i%-*-*}; done )" -- $cur ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,8 +93,8 @@ _makepkg ()
|
|||||||
|
|
||||||
if [[ "$cur" == -* ]]; then
|
if [[ "$cur" == -* ]]; then
|
||||||
COMPREPLY=( $( compgen -W '\
|
COMPREPLY=( $( compgen -W '\
|
||||||
|
-A --ignorearch \
|
||||||
-b --builddeps \
|
-b --builddeps \
|
||||||
-B --noccache \
|
|
||||||
-c --clean \
|
-c --clean \
|
||||||
-C --cleancache \
|
-C --cleancache \
|
||||||
-d --nodeps \
|
-d --nodeps \
|
||||||
@@ -115,14 +103,14 @@ _makepkg ()
|
|||||||
-g --geninteg \
|
-g --geninteg \
|
||||||
-h --help \
|
-h --help \
|
||||||
-i --install \
|
-i --install \
|
||||||
-j \
|
|
||||||
-L --log \
|
-L --log \
|
||||||
-m --nocolor \
|
-m --nocolor \
|
||||||
-o --nobuild \
|
-o --nobuild \
|
||||||
-p \
|
-p \
|
||||||
-r --rmdeps \
|
-r --rmdeps \
|
||||||
-s --syncdeps \
|
-s --syncdeps \
|
||||||
-S --usesudo \
|
--asroot \
|
||||||
|
--source \
|
||||||
--noconfirm \
|
--noconfirm \
|
||||||
--noprogressbar' -- $cur ) )
|
--noprogressbar' -- $cur ) )
|
||||||
fi
|
fi
|
||||||
@@ -158,17 +146,15 @@ _pacman ()
|
|||||||
toparse="${a:2}"
|
toparse="${a:2}"
|
||||||
|
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
-@(A|U|F|R|S|Q|h|V))
|
-@(U|R|S|Q|h|V))
|
||||||
op="${arg/-}"
|
op="${arg/-}"
|
||||||
mod="${mod}${a:2}"
|
mod="${mod}${a:2}"
|
||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
arg="${a:2}"
|
arg="${a:2}"
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
add) op="A" ;;
|
|
||||||
remove) op="R" ;;
|
remove) op="R" ;;
|
||||||
upgrade) op="U" ;;
|
upgrade) op="U" ;;
|
||||||
freshen) op="F" ;;
|
|
||||||
query) op="Q" ;;
|
query) op="Q" ;;
|
||||||
sync) op="S" ;;
|
sync) op="S" ;;
|
||||||
help) op="h" ;;
|
help) op="h" ;;
|
||||||
@@ -184,18 +170,23 @@ _pacman ()
|
|||||||
print-uris) mod="${mod}p" ;;
|
print-uris) mod="${mod}p" ;;
|
||||||
search) mod="${mod}s" ;;
|
search) mod="${mod}s" ;;
|
||||||
sysupgrade) mod="${mod}u" ;;
|
sysupgrade) mod="${mod}u" ;;
|
||||||
|
upgrades) mod="${mod}u" ;;
|
||||||
downloadonly) mod="${mod}w" ;;
|
downloadonly) mod="${mod}w" ;;
|
||||||
refresh) mod="${mod}y" ;;
|
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" ;;
|
foreign) mod="${mod}m" ;;
|
||||||
owns) mod="${mod}o" ;;
|
owns) mod="${mod}o" ;;
|
||||||
file) mod="${mod}p" ;;
|
file) mod="${mod}p" ;;
|
||||||
search) mod="${mod}s" ;;
|
search) mod="${mod}s" ;;
|
||||||
|
upgrades) mod="${mod}u" ;;
|
||||||
cascade) mod="${mod}c" ;;
|
cascade) mod="${mod}c" ;;
|
||||||
nodeps) mod="${mod}d" ;;
|
|
||||||
dbonly) mod="${mod}k" ;;
|
dbonly) mod="${mod}k" ;;
|
||||||
nosave) mod="${mod}n" ;;
|
nosave) mod="${mod}n" ;;
|
||||||
recursive) mod="${mod}s" ;;
|
recursive) mod="${mod}s" ;;
|
||||||
|
unneeded) mod="${mod}u" ;;
|
||||||
esac ;;
|
esac ;;
|
||||||
*) toparse="${a}" ;;
|
*) toparse="${a}" ;;
|
||||||
esac
|
esac
|
||||||
@@ -211,8 +202,6 @@ _pacman ()
|
|||||||
|
|
||||||
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
|
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
|
||||||
COMPREPLY=( $( compgen -W '\
|
COMPREPLY=( $( compgen -W '\
|
||||||
-A --add \
|
|
||||||
-F --freshen \
|
|
||||||
-h --help \
|
-h --help \
|
||||||
-Q --query \
|
-Q --query \
|
||||||
-R --remove \
|
-R --remove \
|
||||||
@@ -226,14 +215,16 @@ _pacman ()
|
|||||||
|
|
||||||
if [[ "$cur" == -* ]]; then
|
if [[ "$cur" == -* ]]; then
|
||||||
case "${op}" in
|
case "${op}" in
|
||||||
A|U|F)
|
U)
|
||||||
COMPREPLY=( $( compgen -W '\
|
COMPREPLY=( $( compgen -W '\
|
||||||
|
--asdeps \
|
||||||
|
--asexplicit \
|
||||||
-d --nodeps \
|
-d --nodeps \
|
||||||
-f --force \
|
-f --force \
|
||||||
-h --help \
|
-h --help \
|
||||||
--config \
|
--config \
|
||||||
|
--logfile \
|
||||||
--noconfirm \
|
--noconfirm \
|
||||||
--ask \
|
|
||||||
--noprogressbar \
|
--noprogressbar \
|
||||||
--noscriptlet \
|
--noscriptlet \
|
||||||
-v --verbose \
|
-v --verbose \
|
||||||
@@ -247,14 +238,14 @@ _pacman ()
|
|||||||
COMPREPLY=( $( compgen -W '\
|
COMPREPLY=( $( compgen -W '\
|
||||||
-c --cascade \
|
-c --cascade \
|
||||||
-d --nodeps \
|
-d --nodeps \
|
||||||
-f --force \
|
|
||||||
-h --help \
|
-h --help \
|
||||||
-k --dbonly \
|
-k --dbonly \
|
||||||
-n --nosave \
|
-n --nosave \
|
||||||
-s --recursive \
|
-s --recursive \
|
||||||
|
-u --unneeded \
|
||||||
--config \
|
--config \
|
||||||
|
--logfile \
|
||||||
--noconfirm \
|
--noconfirm \
|
||||||
--ask \
|
|
||||||
--noprogressbar \
|
--noprogressbar \
|
||||||
--noscriptlet \
|
--noscriptlet \
|
||||||
-v --verbose \
|
-v --verbose \
|
||||||
@@ -266,9 +257,10 @@ _pacman ()
|
|||||||
;;
|
;;
|
||||||
S)
|
S)
|
||||||
COMPREPLY=( $( compgen -W '\
|
COMPREPLY=( $( compgen -W '\
|
||||||
|
--asdeps \
|
||||||
|
--asexplicit \
|
||||||
-c --clean \
|
-c --clean \
|
||||||
-d --nodeps \
|
-d --nodeps \
|
||||||
-e --dependsonly \
|
|
||||||
-f --force \
|
-f --force \
|
||||||
-g --groups \
|
-g --groups \
|
||||||
-h --help \
|
-h --help \
|
||||||
@@ -279,10 +271,12 @@ _pacman ()
|
|||||||
-u --sysupgrade \
|
-u --sysupgrade \
|
||||||
-w --downloadonly \
|
-w --downloadonly \
|
||||||
-y --refresh \
|
-y --refresh \
|
||||||
|
--needed \
|
||||||
--ignore \
|
--ignore \
|
||||||
|
--ignoregroup \
|
||||||
--config \
|
--config \
|
||||||
|
--logfile \
|
||||||
--noconfirm \
|
--noconfirm \
|
||||||
--ask \
|
|
||||||
--noprogressbar \
|
--noprogressbar \
|
||||||
--noscriptlet \
|
--noscriptlet \
|
||||||
-v --verbose \
|
-v --verbose \
|
||||||
@@ -295,7 +289,8 @@ _pacman ()
|
|||||||
Q)
|
Q)
|
||||||
COMPREPLY=( $( compgen -W '\
|
COMPREPLY=( $( compgen -W '\
|
||||||
-c --changelog \
|
-c --changelog \
|
||||||
-e --orphans \
|
-d --deps \
|
||||||
|
-e --explicit \
|
||||||
-g --groups \
|
-g --groups \
|
||||||
-h --help \
|
-h --help \
|
||||||
-i --info \
|
-i --info \
|
||||||
@@ -304,9 +299,11 @@ _pacman ()
|
|||||||
-o --owns \
|
-o --owns \
|
||||||
-p --file \
|
-p --file \
|
||||||
-s --search \
|
-s --search \
|
||||||
|
-t --unrequired \
|
||||||
|
-u --upgrades \
|
||||||
--config \
|
--config \
|
||||||
|
--logfile \
|
||||||
--noconfirm \
|
--noconfirm \
|
||||||
--ask \
|
|
||||||
--noprogressbar \
|
--noprogressbar \
|
||||||
--noscriptlet \
|
--noscriptlet \
|
||||||
-v --verbose \
|
-v --verbose \
|
||||||
@@ -320,7 +317,7 @@ _pacman ()
|
|||||||
rem_selected
|
rem_selected
|
||||||
else
|
else
|
||||||
case "${op}" in
|
case "${op}" in
|
||||||
A|U)
|
U)
|
||||||
COMPREPLY=( $( compgen -d -- "$cur" ) \
|
COMPREPLY=( $( compgen -d -- "$cur" ) \
|
||||||
$( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
|
$( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
|
||||||
return 0
|
return 0
|
||||||
@@ -338,6 +335,9 @@ _pacman ()
|
|||||||
elif _instring $mod p; then
|
elif _instring $mod p; then
|
||||||
COMPREPLY=( $( compgen -d -- "$cur" ) \
|
COMPREPLY=( $( compgen -d -- "$cur" ) \
|
||||||
$( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
|
$( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
|
||||||
|
elif _instring $mod u; then
|
||||||
|
COMPREPLY=''
|
||||||
|
return 0
|
||||||
else
|
else
|
||||||
_installed_pkgs
|
_installed_pkgs
|
||||||
fi
|
fi
|
||||||
|
|||||||
134
contrib/gensync
Executable file
134
contrib/gensync
Executable file
@@ -0,0 +1,134 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# gensync
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (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/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
myver='3.1.1'
|
||||||
|
|
||||||
|
# functions
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
printf "gensync (pacman) %s\n\n" "$myver"
|
||||||
|
printf "Usage: %s <root> <destfile> [package_directory]\n\n" "$0"
|
||||||
|
printf "\
|
||||||
|
gensync will generate a sync database by reading all PKGBUILD files\n\
|
||||||
|
from <root>. gensync builds the database in a temporary directory\n\
|
||||||
|
and then compresses it to <destfile>.\n\n"
|
||||||
|
printf "\
|
||||||
|
gensync will calculate md5sums of packages in the same directory as\n\
|
||||||
|
<destfile>, unless an alternate [package_directory] is specified.\n\n"
|
||||||
|
printf "\
|
||||||
|
note: The <destfile> name is important. It must be of the form\n\
|
||||||
|
{treename}.db.tar.gz where {treename} is the name of the custom\n\
|
||||||
|
package repository you configured in /etc/pacman.conf. The\n\
|
||||||
|
generated database must reside in the same directory as your\n\
|
||||||
|
custom packages (also configured in /etc/pacman.conf)\n\n"
|
||||||
|
echo "Example: gensync /var/abs/local /home/mypkgs/custom.db.tar.gz"
|
||||||
|
}
|
||||||
|
|
||||||
|
version() {
|
||||||
|
printf "gensync (pacman) %s\n" "$myver"
|
||||||
|
printf "\
|
||||||
|
Copyright (C) 2002-2007 Judd Vinet <jvinet@zeroflux.org>.\n\n\
|
||||||
|
This is free software; see the source for copying conditions.\n\
|
||||||
|
There is NO WARRANTY, to the extent permitted by law.\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
error () {
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "==> ERROR: ${mesg}\n" "$@" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
die () {
|
||||||
|
error $*
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# PROGRAM START
|
||||||
|
|
||||||
|
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "-V" -o "$1" = "--version" ]; then
|
||||||
|
version
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $# -lt 2 ]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# source system and user makepkg.conf
|
||||||
|
if [ -r /etc/makepkg.conf ]; then
|
||||||
|
source /etc/makepkg.conf
|
||||||
|
else
|
||||||
|
die "/etc/makepkg.conf not found. Cannot continue."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -r ~/.makepkg.conf ]; then
|
||||||
|
source ~/.makepkg.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
d=$(dirname $1)
|
||||||
|
rootdir="$(cd $d && pwd)/$(basename $1)"
|
||||||
|
d="$(dirname $2)"
|
||||||
|
destdir="$(cd $d && pwd)"
|
||||||
|
destfile="$destdir/$(basename $2)"
|
||||||
|
pkgdir=""
|
||||||
|
if [ "$3" != "" ]; then
|
||||||
|
pkgdir="$3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ ! -d "$rootdir" ] && die "invalid root dir: $rootdir"
|
||||||
|
|
||||||
|
echo "gensync: building database entries, generating md5sums..." >&2
|
||||||
|
cd "$destdir"
|
||||||
|
|
||||||
|
pkgs=""
|
||||||
|
|
||||||
|
for file in $(find "$rootdir"/* -name "$BUILDSCRIPT"); do
|
||||||
|
unset pkgname pkgver pkgrel options
|
||||||
|
|
||||||
|
source $file || die "failed to parse $file"
|
||||||
|
if [ "$arch" = 'any' ]; then
|
||||||
|
CARCH='any'
|
||||||
|
fi
|
||||||
|
if [ "$pkgdir" != "" ]; then
|
||||||
|
pkgfile="$pkgdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}"
|
||||||
|
else
|
||||||
|
pkgfile="$destdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$pkgfile" ]; then
|
||||||
|
error "could not find %s-%s-%s-%s%s - skipping" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
|
||||||
|
else
|
||||||
|
pkgs="$pkgs $pkgfile"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "creating repo DB..."
|
||||||
|
|
||||||
|
# we'll trim the output just a tad, as gensync may be used on large repos
|
||||||
|
repo-add $destfile $pkgs \
|
||||||
|
| grep -e "package" -e "database"
|
||||||
|
|
||||||
|
# vim: set ts=2 sw=2 noet:
|
||||||
6
contrib/pacdiff
Normal file → Executable file
6
contrib/pacdiff
Normal file → Executable file
@@ -14,15 +14,13 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
# USA.
|
|
||||||
#
|
#
|
||||||
|
|
||||||
# Original http://phraktured.net/config/bin/pacdiff
|
# Original http://phraktured.net/config/bin/pacdiff
|
||||||
|
|
||||||
diffprog=${DIFFPROG:-vimdiff}
|
diffprog=${DIFFPROG:-vimdiff}
|
||||||
for x in $(find /etc/ -name *.pacnew -o -name *.pacorig -o -name *.pacsave)
|
for x in $(find /etc/ -name "*.pacnew" -o -name "*.pacorig" -o -name "*.pacsave")
|
||||||
do
|
do
|
||||||
echo "File: ${x%.pac*}"
|
echo "File: ${x%.pac*}"
|
||||||
chk="$(cmp $x ${x%.pac*})"
|
chk="$(cmp $x ${x%.pac*})"
|
||||||
|
|||||||
88
contrib/paclist
Executable file
88
contrib/paclist
Executable file
@@ -0,0 +1,88 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
# paclist - List all packages installed from a given repo
|
||||||
|
#
|
||||||
|
# Copyright (C) 2008 Dan McGee <dpmcgee@gmail.com>
|
||||||
|
#
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
my $progname = "paclist";
|
||||||
|
my $version = "1.0";
|
||||||
|
|
||||||
|
if ($#ARGV != 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
|
||||||
|
print "$progname - List all packages installed from a given repo\n";
|
||||||
|
print "Usage: $progname <repo>\n";
|
||||||
|
print "Example: $progname testing\n";
|
||||||
|
if ($#ARGV != 0) {
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $ARGV[0] eq "--version" || $ARGV[0] eq "-v") {
|
||||||
|
print "$progname version $version\n";
|
||||||
|
print "Copyright (C) 2008 Dan McGee\n";
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
# This hash table will be used to store pairs of ('name version', count) from
|
||||||
|
# the return of both pacman -Sl <repo> and pacman -Q output. We then check to
|
||||||
|
# see if a value was added twice (count = 2)- if so, we will print that package
|
||||||
|
# as it is both in the repo we queried and installed on our local system.
|
||||||
|
my %packages = ();
|
||||||
|
my $output;
|
||||||
|
|
||||||
|
$output = `pacman -Sl $ARGV[0]`;
|
||||||
|
if ($? != 0) {
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
my @sync = split(/\n/, $output);
|
||||||
|
# sample output from pacman -Sl:
|
||||||
|
# testing foobar 1.0-1
|
||||||
|
foreach $_ (@sync) {
|
||||||
|
my @info = split(/ /);
|
||||||
|
# we only want to store 'foobar 1.0-1' in our hash table
|
||||||
|
my $pkg = $info[1] . " " . $info[2];
|
||||||
|
$packages{$pkg}++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$output = `pacman -Q`;
|
||||||
|
if ($? != 0) {
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
# sample output from pacman -Q:
|
||||||
|
# foobar 1.0-1
|
||||||
|
my @local = split(/\n/, $output);
|
||||||
|
foreach $_ (@local) {
|
||||||
|
# store 'foobar 1.0-1' in our hash table
|
||||||
|
$packages{$_}++;
|
||||||
|
}
|
||||||
|
|
||||||
|
# run comparison check- if value was added twice, it was in the intersection
|
||||||
|
my @intersection;
|
||||||
|
foreach $_ (keys %packages) {
|
||||||
|
if ($packages{$_} == 2) {
|
||||||
|
push @{ \@intersection }, $_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# print our intersection, and bask in the glory and speed of perl
|
||||||
|
@intersection = sort @intersection;
|
||||||
|
foreach $_ (@intersection) {
|
||||||
|
print $_ . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
#vim: set noet:
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/perl
|
||||||
# pacsearch - Adds color and install information to a 'pacman -Ss' search
|
# pacsearch - Adds color and install information to a 'pacman -Ss' search
|
||||||
#
|
#
|
||||||
|
# Copyright (C) 2008 Dan McGee <dpmcgee@gmail.com>
|
||||||
|
#
|
||||||
|
# Based off original shell script version:
|
||||||
# Copyright (C) 2006-2007 Dan McGee <dpmcgee@gmail.com>
|
# Copyright (C) 2006-2007 Dan McGee <dpmcgee@gmail.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
@@ -14,64 +17,116 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
|
|
||||||
#TODO: colors flag on commandline
|
#TODO: colors flag on commandline
|
||||||
|
|
||||||
readonly progname="pacsearch"
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
readonly CLR1='\\\e[0;34m'
|
my $progname = "pacsearch";
|
||||||
readonly CLR2='\\\e[0;32m'
|
my $version = "2.0";
|
||||||
readonly CLR3='\\\e[0;35m'
|
|
||||||
readonly CLR4='\\\e[0;36m'
|
|
||||||
readonly CLR5='\\\e[0;31m'
|
|
||||||
readonly CLR6='\\\e[0;33m'
|
|
||||||
readonly CLR7='\\\e[1;36m'
|
|
||||||
readonly INST='\\\e[1;31m'
|
|
||||||
readonly BASE='\\\e[0m'
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if ($#ARGV lt 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
|
||||||
echo "Usage: $progname <pattern>"
|
print "$progname - Add color and install information to a pacman -Ss search\n";
|
||||||
echo "Ex: $progname ^gnome"
|
print "Usage: $progname <pattern>\n";
|
||||||
exit 0
|
print "Example: $progname ^gnome\n";
|
||||||
fi
|
if ($#ARGV lt 0) {
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
# Make two temp files and send output of commands to these files
|
if ($ARGV[0] eq "--version" || $ARGV[0] eq "-v") {
|
||||||
querydump=$(mktemp)
|
print "$progname version $version\n";
|
||||||
pacman -Qs $1 > $querydump
|
print "Copyright (C) 2006-2008 Dan McGee\n";
|
||||||
syncdump=$(mktemp)
|
exit 0;
|
||||||
pacman -Ss $1 > $syncdump
|
}
|
||||||
|
|
||||||
# Strip descriptions and 'local/' from -Qs query
|
# define our colors to use when printing
|
||||||
instpkg=$(mktemp)
|
my $CLR1 = "\e[0;34m";
|
||||||
egrep '^[^ ]' $querydump | sed -e 's@^local/@@' > $instpkg
|
my $CLR2 = "\e[0;32m";
|
||||||
|
my $CLR3 = "\e[0;35m";
|
||||||
|
my $CLR4 = "\e[0;36m";
|
||||||
|
my $CLR5 = "\e[0;31m";
|
||||||
|
my $CLR6 = "\e[0;33m";
|
||||||
|
my $CLR7 = "\e[1;36m";
|
||||||
|
my $INST = "\e[1;31m";
|
||||||
|
my $BASE = "\e[0m";
|
||||||
|
my $INSTMARK = $INST."***";
|
||||||
|
|
||||||
# Add pkgs not in sync db, mark pkgs that are installed
|
# color a "repo/pkgname pkgver" line based on the respository name
|
||||||
cat $instpkg | while read -r pkg; do
|
sub to_color {
|
||||||
if [ -z "$(grep "$pkg" $syncdump)" ]; then
|
my $line = shift;
|
||||||
# grep package name; pipe to another grep that prints at most one
|
$line =~ s/(^core\/.*)/$CLR1$1$BASE/;
|
||||||
# line starting with 'local/', allows for comments >1 line
|
$line =~ s/(^extra\/.*)/$CLR2$1$BASE/;
|
||||||
grep -A10 "$pkg" $querydump | grep -A10 -m1 "local/" >> $syncdump
|
$line =~ s/(^community\/.*)/$CLR3$1$BASE/;
|
||||||
fi
|
$line =~ s/(^testing\/.*)/$CLR4$1$BASE/;
|
||||||
sed -i "s@^\(.\+/$pkg\)@\***\1@" $syncdump
|
$line =~ s/(^unstable\/.*)/$CLR5$1$BASE/;
|
||||||
done
|
$line =~ s/(^custom\/.*)/$CLR6$1$BASE/;
|
||||||
|
$line =~ s/(^local\/.*)/$CLR7$1$BASE/;
|
||||||
|
# any other unknown repository
|
||||||
|
$line =~ s/(^[\w-]*\/.*)/$CLR6$1$BASE/;
|
||||||
|
return $line;
|
||||||
|
}
|
||||||
|
|
||||||
# Print colorized package list and descriptions to screen
|
my %allpkgs = ();
|
||||||
echo -e "$(sed -r \
|
|
||||||
-e "s@current/.*@$CLR1&$BASE@" \
|
|
||||||
-e "s@extra/.*@$CLR2&$BASE@" \
|
|
||||||
-e "s@community/.*@$CLR3&$BASE@" \
|
|
||||||
-e "s@testing/.*@$CLR4&$BASE@" \
|
|
||||||
-e "s@unstable/.*@$CLR5&$BASE@" \
|
|
||||||
-e "s@custom/.*@$CLR6&$BASE@" \
|
|
||||||
-e "s@local/.*@$CLR7&$BASE@" \
|
|
||||||
-e "s@(^|\*\*\*)([[:alnum:]]*/.* .*)@\1$CLR6\2$BASE@" \
|
|
||||||
-e "s@\*\*\*@$INST&@" \
|
|
||||||
< $syncdump )"
|
|
||||||
echo -en "\e[0m"
|
|
||||||
|
|
||||||
rm $querydump
|
my $syncout = `pacman -Ss '@ARGV'`;
|
||||||
rm $syncdump
|
# split each sync search entry into its own array entry
|
||||||
rm $instpkg
|
my @syncpkgs = split(/\n^(?=\w)/m, $syncout);
|
||||||
|
# remove the extra \n from the last desc entry
|
||||||
|
if ($#syncpkgs >= 0) {
|
||||||
|
chomp($syncpkgs[$#syncpkgs]);
|
||||||
|
}
|
||||||
|
|
||||||
|
# counter var for packages, used here and in the query loop too
|
||||||
|
my $cnt = 0;
|
||||||
|
foreach $_ (@syncpkgs) {
|
||||||
|
# we grab 3 fields here: repo, name/ver, and desc
|
||||||
|
my @pkgfields = /^(.*?)\/(.*?)\n(.*)$/s;
|
||||||
|
# add a fourth field that will indicate install status
|
||||||
|
push (@pkgfields, "");
|
||||||
|
# add a fifth field that indicates original order
|
||||||
|
push (@pkgfields, $cnt++);
|
||||||
|
# add each sync pkg by name/ver to a hash table for quick lookup
|
||||||
|
$allpkgs{$pkgfields[1]} = [ @pkgfields ];
|
||||||
|
}
|
||||||
|
|
||||||
|
my $queryout = `pacman -Qs '@ARGV'`;
|
||||||
|
# split each querysearch entry into its own array entry
|
||||||
|
my @querypkgs = split(/\n^(?=\w)/m, $queryout);
|
||||||
|
# remove the extra \n from the last desc entry
|
||||||
|
if ($#querypkgs >= 0) {
|
||||||
|
chomp ($querypkgs[$#querypkgs]);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach $_ (@querypkgs) {
|
||||||
|
# we grab 3 fields here: repo, name/ver, and desc
|
||||||
|
my @pkgfields = /^(.*?)\/(.*?)\n(.*)$/s;
|
||||||
|
# check if the package was listed in the sync out
|
||||||
|
# if it is we want to mark it with a *** marker
|
||||||
|
if (exists $allpkgs{$pkgfields[1]}) {
|
||||||
|
# mark it in our fourth field as installed
|
||||||
|
@{ $allpkgs{$pkgfields[1]} }[3] = $INSTMARK;
|
||||||
|
} else {
|
||||||
|
# add a fourth field that will indicate install status
|
||||||
|
push (@pkgfields, $INSTMARK);
|
||||||
|
# add a fifth field that indicates original order (after sync)
|
||||||
|
push (@pkgfields, $cnt++);
|
||||||
|
# add our local-only package to the hash
|
||||||
|
$allpkgs{$pkgfields[1]} = [ @pkgfields ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# sort by original order (the fifth field) and print
|
||||||
|
foreach $_ ( sort{ @{$allpkgs{$a}}[4] <=> @{$allpkgs{$b}}[4] } keys %allpkgs) {
|
||||||
|
my @v = @{$allpkgs{$_}};
|
||||||
|
my $line = "$v[0]/$v[1]";
|
||||||
|
$line = to_color($line);
|
||||||
|
# print install marker + colorized "repo/pkgname pkgver" string
|
||||||
|
print "$v[3]$line\n";
|
||||||
|
print "$v[2]\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
#vim: set noet:
|
||||||
|
|||||||
301
contrib/pactree
Executable file
301
contrib/pactree
Executable file
@@ -0,0 +1,301 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# pactree : a simple dependency tree viewer
|
||||||
|
#
|
||||||
|
# Copyright (C) 2008 Carlo "carlocci" Bersani <carlocci@gmail.com>
|
||||||
|
#
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
# Original http://carlocci.ngi.it/arch/pactree
|
||||||
|
# Credit to scj for the graphviz idea
|
||||||
|
|
||||||
|
# set the colors
|
||||||
|
branch1_color="\033[0;33m" #Brown
|
||||||
|
branch2_color="\033[0;37m" #Gray
|
||||||
|
leaf_color="\033[1;32m" #Light green
|
||||||
|
leaf2_color="\033[0;32m" #Green
|
||||||
|
|
||||||
|
# set the separators
|
||||||
|
separator=" "
|
||||||
|
branch_tip1="|--"
|
||||||
|
branch_tip2="+--"
|
||||||
|
provides="provides "
|
||||||
|
|
||||||
|
# set the graphviz options
|
||||||
|
# http://www.graphviz.org/doc/info/output.html for available output formats
|
||||||
|
# http://www.graphviz.org/doc/info/colors.html for available colors
|
||||||
|
gformat="png" #output format
|
||||||
|
start_color="red" #START color
|
||||||
|
nodes_color="green" #color of the nodes
|
||||||
|
arrow1_color="chocolate4" #color of the normal arrow
|
||||||
|
arrow2_color="grey" #color of the "provided by" headless arrow
|
||||||
|
|
||||||
|
readonly prog_name="pactree"
|
||||||
|
readonly prog_ver="0.2"
|
||||||
|
|
||||||
|
_usage(){
|
||||||
|
echo "This program generates the dependency tree of an installed package"
|
||||||
|
echo "Usage: $prog_name [OPTIONS] <installed packages>"
|
||||||
|
echo
|
||||||
|
echo " OPTIONS:"
|
||||||
|
echo " -c, --color Enable color output"
|
||||||
|
echo " -d, --depth INT Limit the shown dependencies depth"
|
||||||
|
echo " -g, --graph Use graphviz to make an image of the tree"
|
||||||
|
echo " -l, --linear Enable linear output"
|
||||||
|
echo " -s, --silent Shh, let me hear those errors!"
|
||||||
|
echo " -u, --unique Print the dependency list with no duplicates"
|
||||||
|
echo
|
||||||
|
echo " -h, --help Print this help message"
|
||||||
|
echo " -v, --version Print the program name and version"
|
||||||
|
echo
|
||||||
|
echo "Example: $prog_name -c -d 2 readline"
|
||||||
|
}
|
||||||
|
|
||||||
|
_version(){
|
||||||
|
echo "$prog_name version $prog_ver"
|
||||||
|
echo "Copyright (C) 2008 Carlo \"carlocci\" Bersani <carlocci@gmail.com>"
|
||||||
|
}
|
||||||
|
# end of the friendliness
|
||||||
|
|
||||||
|
|
||||||
|
# grab a field from the database: $1=path/to/file, $2=field to grab
|
||||||
|
_grabfield(){
|
||||||
|
for line in $(cat "$1" 2>/dev/null ); do
|
||||||
|
if [ -z "$line" ]; then
|
||||||
|
continue;
|
||||||
|
fi;
|
||||||
|
if [[ "$line" =~ %[A-Z]*% ]]; then
|
||||||
|
current="$line"
|
||||||
|
continue;
|
||||||
|
fi;
|
||||||
|
if [ "$current" = "$2" ]; then
|
||||||
|
echo "$line"
|
||||||
|
fi;
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# find a dep in the db: $1=dep, $2=field, $3=dbfile, ret=file list
|
||||||
|
_finddep(){
|
||||||
|
for line in $(awk 'BEGIN{RS=""}
|
||||||
|
{
|
||||||
|
if ($1=="'"$2"'"){
|
||||||
|
for (i=2 ; i<=NF ; ++i){
|
||||||
|
if ($i ~ /^'"$1"'([<>=]+.*|)$/ ){
|
||||||
|
print FILENAME}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}' $(find $pac_db -name $3)); do
|
||||||
|
echo "${line%/*}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Recursive function: does all of the work, pays all of the taxes #
|
||||||
|
_tree(){
|
||||||
|
pkg_name="$1"
|
||||||
|
pkg_dirs="$(echo $pac_db/$pkg_name-[0-9]*)"
|
||||||
|
|
||||||
|
# Is $pkg_name real or provided?
|
||||||
|
[ ! -d "$pkg_dirs" ] && pkg_dirs="$(_finddep $pkg_name %PROVIDES% depends)"
|
||||||
|
|
||||||
|
for pkg_dir in $pkg_dirs ; do
|
||||||
|
spaces="$2"
|
||||||
|
unset provided
|
||||||
|
branch_tip="$branch_tip1"
|
||||||
|
branch_color="$branch1_color"
|
||||||
|
pkg_name="$(_grabfield "$pkg_dir/desc" %NAME%)"
|
||||||
|
if [ ! "$pkg_name" = "$1" ]; then
|
||||||
|
provided="$leaf2_color $provides$leaf_color$1"
|
||||||
|
branch_tip="$branch_tip2"
|
||||||
|
branch_color="$branch2_color"
|
||||||
|
if [ $graphviz -eq 1 ] && [[ ! "${dep_list[@]}" =~ _$1_ ]] && [ $spaces -ne $((max_depth+1)) ]; then
|
||||||
|
echo "\"$1\" -> \"$pkg_name\" [arrowhead=none, color=$arrow2_color];"
|
||||||
|
dep_list=( "${dep_list[@]}" "_$1_" )
|
||||||
|
_tree "$pkg_name" $((spaces+1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Generate the spacer
|
||||||
|
spacer=""
|
||||||
|
for each in $(seq 1 $spaces); do
|
||||||
|
spacer="$spacer$separator"
|
||||||
|
done
|
||||||
|
spacer="$spacer$branch_tip"
|
||||||
|
|
||||||
|
[ $silent -ne 1 ] && echo -e "$branch_color$spacer$leaf_color$pkg_name$provided"
|
||||||
|
|
||||||
|
[ ! -d "$pkg_dir" ] && echo "No $pkg_name in the database (inconsistent database?)" >&2
|
||||||
|
|
||||||
|
if [[ ! " ${dep_list[@]} " =~ " $pkg_name " ]] && [ $spaces -ne $max_depth ]; then
|
||||||
|
dep_list=( "${dep_list[@]}" "$pkg_name" )
|
||||||
|
for dep_pkg in $(_grabfield "$pkg_dir/depends" %DEPENDS%); do
|
||||||
|
spaces=$2 #Bash scoping ;_;
|
||||||
|
if [ $graphviz -eq 1 ]; then
|
||||||
|
echo "\"$1\" -> \"${dep_pkg%%[<>=]*}\" [color=$arrow1_color];"
|
||||||
|
fi
|
||||||
|
_tree "${dep_pkg%%[<>=]*}" $((spaces+1))
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Main program: gets all of the money, pays none of the taxes
|
||||||
|
|
||||||
|
# Command line parameters parser
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
_usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
options=( "$@" )
|
||||||
|
len_options=${#options[@]}
|
||||||
|
for (( n=0 ; n < $len_options ; n++ )); do
|
||||||
|
if [ "${options[$n]}" = "--" ]; then
|
||||||
|
unset options[$n]
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if [ "${options[$n]}" = "-h" -o "${options[$n]}" = "--help" ]; then
|
||||||
|
_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${options[$n]}" = "-v" -o "${options[$n]}" = "--version" ]; then
|
||||||
|
_version
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${options[$n]}" = "-l" -o "${options[$n]}" = "--linear" ]; then
|
||||||
|
unset options[$n]
|
||||||
|
linear=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${options[$n]}" = "-s" -o "${options[$n]}" = "--silent" ]; then
|
||||||
|
unset options[$n]
|
||||||
|
silent=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${options[$n]}" = "-u" -o "${options[$n]}" = "--unique" ]; then
|
||||||
|
unset options[$n]
|
||||||
|
silent=1
|
||||||
|
nodup=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${options[$n]}" = "-g" -o "${options[$n]}" = "--graph" ]; then
|
||||||
|
unset options[$n]
|
||||||
|
graphviz=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${options[$n]}" = "-c" -o "${options[$n]}" = "--color" ]; then
|
||||||
|
unset options[$n]
|
||||||
|
colored=1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${options[$n]}" =~ -d[[:digit:]]* || "${options[$n]}" == "--depth" ]]; then
|
||||||
|
if [[ "${options[$n]#-d}" =~ [[:digit:]]+ ]]; then
|
||||||
|
max_depth="${options[$n]#-d}"
|
||||||
|
elif [[ ${options[$((n+1))]} =~ [[:digit:]]+ ]]; then
|
||||||
|
# if [ ${options[$((n+1))]} -eq ${options[$((n+1))]} 2>/dev/null ]; then
|
||||||
|
max_depth="${options[$((n+1))]}"
|
||||||
|
unset options[$((n+1))]
|
||||||
|
((++n))
|
||||||
|
fi
|
||||||
|
unset options[$n]
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# End of the dumb command line parser
|
||||||
|
|
||||||
|
# Env
|
||||||
|
colored=${colored:-0}
|
||||||
|
max_depth=${max_depth:--10}
|
||||||
|
linear=${linear:-0}
|
||||||
|
silent=${silent:-0}
|
||||||
|
nodup=${nodup:-0}
|
||||||
|
graphviz=${graphviz:-0}
|
||||||
|
|
||||||
|
if [ $colored -ne 1 ]; then
|
||||||
|
unset branch1_color
|
||||||
|
unset leaf_color
|
||||||
|
unset leaf2_color
|
||||||
|
unset branch2_color
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $linear -eq 1 ]; then
|
||||||
|
unset separator
|
||||||
|
unset branch_tip1
|
||||||
|
unset branch_tip2
|
||||||
|
unset provides
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $graphviz -eq 1 ]; then
|
||||||
|
silent=1
|
||||||
|
nodup=0
|
||||||
|
if [ ! -f /usr/bin/dot ]; then
|
||||||
|
echo "ERROR: package graphviz is not installed"
|
||||||
|
echo " Run pacman -S graphviz to install it"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -r /etc/pacman.conf ]; then
|
||||||
|
echo "ERROR: unable to read /etc/pacman.conf"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
eval $(awk '/DBPath/ {print $1$2$3}' /etc/pacman.conf)
|
||||||
|
fi
|
||||||
|
|
||||||
|
pac_db="${DBPath:-/var/lib/pacman}/local"
|
||||||
|
|
||||||
|
if [ ! -d "$pac_db" ] ; then
|
||||||
|
echo "ERROR: pacman database directory ${pac_db} not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Env End
|
||||||
|
|
||||||
|
|
||||||
|
# Program starts
|
||||||
|
_main(){
|
||||||
|
for pkg_name in ${options[@]} ; do
|
||||||
|
[ $graphviz -eq 1 ] && echo -e "\"START\" -> \"$pkg_name\" ;"
|
||||||
|
_tree "$pkg_name" 0
|
||||||
|
if [ $nodup -eq 1 ]; then
|
||||||
|
for pkg_tree in ${dep_list[@]} ; do
|
||||||
|
echo "$pkg_tree"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ $silent -eq 0 ]; then
|
||||||
|
echo -ne '\033[0m' # return colors to normal?
|
||||||
|
echo -ne '\033[?25h' #return cursor to normal?
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [ $graphviz -eq 1 ]; then
|
||||||
|
root_pkgs="${options[@]}"
|
||||||
|
# Uncomment for the "generated by pactree" node in graphviz
|
||||||
|
#advert="xyz [height=0.07, fontsize=8.0, label=\"GENERATED WITH PACTREE\",shape=box,color="black",style=filled,fontcolor="white"];\n"
|
||||||
|
|
||||||
|
echo -e "digraph G { START [color=$start_color, style=filled];\n node [style=filled, color=$nodes_color];\n$(_main)\n$advert}" | dot -T$gformat -o "${root_pkgs// /_}.deps.$gformat"
|
||||||
|
else _main
|
||||||
|
fi
|
||||||
|
|
||||||
|
# vim: set ts=2 sw=2 noet:
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# re-pacman: regenerate a pacman package based on installed files and the
|
|
||||||
# pacman database entries. Useful for reuse, or possible config file
|
|
||||||
# extension
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006 Aaron Griffin <aaron@archlinux.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, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
# USA.
|
|
||||||
#
|
|
||||||
|
|
||||||
#TODO
|
|
||||||
# * Check for md5 changes in backup lines and change pkgrel
|
|
||||||
|
|
||||||
pacinfo () {
|
|
||||||
[ $# -ne 2 ] && return 1
|
|
||||||
#use echo to strip spaces
|
|
||||||
echo $(pacman -Qi ${1} | grep "${2}" | cut -d: -f2-)
|
|
||||||
}
|
|
||||||
|
|
||||||
make_pkginfo () {
|
|
||||||
echo "# Generated by re-pacman 1.0.0"
|
|
||||||
echo "# On $(date)"
|
|
||||||
echo "pkgname =$(pacinfo ${1} Name)"
|
|
||||||
echo "pkgver =$(pacinfo ${1} Version)"
|
|
||||||
echo "pkgdesc =$(pacinfo ${1} Description)"
|
|
||||||
echo "url =$(pacinfo ${1} URL)"
|
|
||||||
echo "builddate =$(pacinfo ${1} 'Build Date')"
|
|
||||||
echo "packager =$(pacinfo ${1} Packager)"
|
|
||||||
echo "size =$(pacinfo ${1} Size)"
|
|
||||||
echo "arch =$(pacinfo ${1} Architecture)"
|
|
||||||
deps=$(pacinfo ${1} 'Depends On')
|
|
||||||
for d in ${deps}; do
|
|
||||||
echo "depend = ${d}"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ $# -ne 1 ]; then
|
|
||||||
echo "usage: re-pacman <installed package name>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
ver=$(pacinfo ${1} Version)
|
|
||||||
if [ "x${ver}" = "x" ]; then
|
|
||||||
echo "Package '${1}' not found, aborting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo ":: Cleaning up old files"
|
|
||||||
rm -f .PKGINFO .FILELIST "${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="${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
|
|
||||||
echo ":: Package '${1}-${ver}.pkg.tar.gz' is now ready for installation"
|
|
||||||
|
|
||||||
# vim: set ts=2 sw=2 noet:
|
|
||||||
137
contrib/updatesync
Executable file
137
contrib/updatesync
Executable file
@@ -0,0 +1,137 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# updatesync
|
||||||
|
#
|
||||||
|
# Copyright (c) 2004 by Jason Chu <jason@archlinux.org>
|
||||||
|
# Derived from gensync (c) 2002-2006 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/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
myver='3.1.1'
|
||||||
|
|
||||||
|
# functions
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
printf "updatesync (pacman) %s\n\n" "$myver"
|
||||||
|
printf "Usage: %s <action> <destfile> <option> [package_directory]\n\n" "$0"
|
||||||
|
printf "\
|
||||||
|
updatesync will update a sync database by reading a PKGBUILD and\n\
|
||||||
|
modifying the destfile. updatesync updates the database in a temporary\n\
|
||||||
|
directory and then compresses it to <destfile>.\n\n"
|
||||||
|
printf "There are two types of actions:\n\n"
|
||||||
|
printf "upd - Will update a package's entry or create it if it doesn't exist.\n It takes the package's PKGBUILD as an option.\n"
|
||||||
|
printf "del - Will remove a package's entry from the db. It takes the package's\n name as an option.\n"
|
||||||
|
echo
|
||||||
|
printf "\
|
||||||
|
updatesync will calculate md5sums of packages in the same directory as\n\
|
||||||
|
<destfile>, unless an alternate [package_directory] is specified.\n\n"
|
||||||
|
echo "Example: updatesync upd /home/mypkgs/custom.db.tar.gz PKGBUILD"
|
||||||
|
}
|
||||||
|
|
||||||
|
version() {
|
||||||
|
printf "updatesync (pacman) %s\n" "$myver"
|
||||||
|
printf "\
|
||||||
|
Copyright (C) 2004 Jason Chu <jason@archlinux.org>.\n\n\
|
||||||
|
This is free software; see the source for copying conditions.\n\
|
||||||
|
There is NO WARRANTY, to the extent permitted by law.\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
error () {
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "==> ERROR: ${mesg}\n" "$@" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
die () {
|
||||||
|
error $*
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# PROGRAM START
|
||||||
|
|
||||||
|
if [ "$1" = "-h" -o "$1" = "--help" ]; then
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "-V" -o "$1" = "--version" ]; then
|
||||||
|
version
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $# -lt 3 ]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# source system and user makepkg.conf
|
||||||
|
if [ -r /etc/makepkg.conf ]; then
|
||||||
|
source /etc/makepkg.conf
|
||||||
|
else
|
||||||
|
die "/etc/makepkg.conf not found. Cannot continue."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -r ~/.makepkg.conf ]; then
|
||||||
|
source ~/.makepkg.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" != "upd" -a "$1" != "del" ]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
action=$1
|
||||||
|
pkgdb=$2
|
||||||
|
option=$3
|
||||||
|
pkgdir="$(pwd)"
|
||||||
|
if [ "$4" != "" ]; then
|
||||||
|
pkgdir="$4"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$action" = "upd" ]; then # INSERT / UPDATE
|
||||||
|
if [ ! -f "$option" ]; then
|
||||||
|
die "$option not found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset pkgname pkgver pkgrel options
|
||||||
|
|
||||||
|
source $option || die "failed to parse $option"
|
||||||
|
if [ "$arch" = 'any' ]; then
|
||||||
|
CARCH='any'
|
||||||
|
fi
|
||||||
|
pkgfile="$pkgdir/$pkgname-$pkgver-$pkgrel-${CARCH}${PKGEXT}"
|
||||||
|
|
||||||
|
if [ ! -f "$pkgfile" ]; then
|
||||||
|
die "could not find %s-%s-%s-%s%s - aborting" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
|
||||||
|
fi
|
||||||
|
|
||||||
|
repo-add "$pkgdb" "$pkgfile"
|
||||||
|
else # DELETE
|
||||||
|
fname="$(basename $option)"
|
||||||
|
if [ "$fname" = "PKGBUILD" ]; then
|
||||||
|
if [ ! -f "$option" ]; then
|
||||||
|
die "%s not found" $option
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset pkgname pkgver pkgrel options
|
||||||
|
source $option
|
||||||
|
else
|
||||||
|
pkgname=$option
|
||||||
|
fi
|
||||||
|
|
||||||
|
repo-remove "$pkgdb" "$pkgname"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
# vim: set ts=2 sw=2 noet:
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
This is a project file for the vim-project
|
|
||||||
plugin. I like it, so decided to contribute
|
|
||||||
this to the main repo.
|
|
||||||
$ pacman -S vim-project
|
|
||||||
change the pacman= path below
|
|
||||||
$ vim
|
|
||||||
:Project vimproject
|
|
||||||
|
|
||||||
pacman=~/devel/pacman-lib CD=. flags=S {
|
|
||||||
Makefile.am
|
|
||||||
configure.ac
|
|
||||||
libalpm=lib/libalpm/ filter="*.c *.h *.am"{
|
|
||||||
add.c
|
|
||||||
alpm.c
|
|
||||||
alpm_list.c
|
|
||||||
backup.c
|
|
||||||
be_files.c
|
|
||||||
cache.c
|
|
||||||
conflict.c
|
|
||||||
db.c
|
|
||||||
deps.c
|
|
||||||
error.c
|
|
||||||
group.c
|
|
||||||
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
|
|
||||||
backup.h
|
|
||||||
cache.h
|
|
||||||
conflict.h
|
|
||||||
db.h
|
|
||||||
deps.h
|
|
||||||
error.h
|
|
||||||
group.h
|
|
||||||
handle.h
|
|
||||||
log.h
|
|
||||||
md5.h
|
|
||||||
package.h
|
|
||||||
provide.h
|
|
||||||
remove.h
|
|
||||||
server.h
|
|
||||||
sha1.h
|
|
||||||
sync.h
|
|
||||||
trans.h
|
|
||||||
util.h
|
|
||||||
versioncmp.h
|
|
||||||
Makefile.am
|
|
||||||
Makefile.in
|
|
||||||
}
|
|
||||||
pacman=src/pacman/ filter="*.c *.h *.am" {
|
|
||||||
add.c
|
|
||||||
conf.c
|
|
||||||
deptest.c
|
|
||||||
downloadprog.c
|
|
||||||
log.c
|
|
||||||
package.c
|
|
||||||
pacman.c
|
|
||||||
query.c
|
|
||||||
remove.c
|
|
||||||
sync.c
|
|
||||||
trans.c
|
|
||||||
upgrade.c
|
|
||||||
util.c
|
|
||||||
add.h
|
|
||||||
conf.h
|
|
||||||
deptest.h
|
|
||||||
downloadprog.h
|
|
||||||
log.h
|
|
||||||
package.h
|
|
||||||
query.h
|
|
||||||
remove.h
|
|
||||||
sync.h
|
|
||||||
trans.h
|
|
||||||
upgrade.h
|
|
||||||
util.h
|
|
||||||
Makefile.am
|
|
||||||
}
|
|
||||||
utils=src/util filter="*.c *.h *.am" {
|
|
||||||
testpkg.c
|
|
||||||
vercmp.c
|
|
||||||
Makefile.am
|
|
||||||
}
|
|
||||||
contrib=contrib CD=. {
|
|
||||||
bash_completion
|
|
||||||
pacsearch
|
|
||||||
vimproject
|
|
||||||
zsh_completion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
25
contrib/vimprojects
Normal file
25
contrib/vimprojects
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
This is a project file
|
||||||
|
for the vim-project plugin.
|
||||||
|
Save it as ~/.vimprojects
|
||||||
|
|
||||||
|
$ pacman -S vim-project
|
||||||
|
change the pacman path below
|
||||||
|
$ vim
|
||||||
|
:Project
|
||||||
|
|
||||||
|
Press \r in the project view
|
||||||
|
on a project name to generate
|
||||||
|
the list of files
|
||||||
|
|
||||||
|
pacman=~/devel/pacman/ CD=. filter="*.ac *.am" flags=S {
|
||||||
|
libalpm=lib/libalpm/ filter="*.c *.h *.am" {
|
||||||
|
}
|
||||||
|
pacman=src/pacman/ filter="*.c *.h *.am" {
|
||||||
|
}
|
||||||
|
scripts=scripts/ filter="*.sh.in *.py.in *.am" {
|
||||||
|
}
|
||||||
|
utils=src/util filter="*.c *.h *.am" {
|
||||||
|
}
|
||||||
|
contrib=contrib CD=. {
|
||||||
|
}
|
||||||
|
}
|
||||||
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,11 @@
|
|||||||
# file: /usr/share/zsh/site-functions/_pacman
|
#compdef pacman pacman.static=pacman
|
||||||
# use the following in your zsh config:
|
|
||||||
# compdef pacman pacman.static=pacman
|
# copy this file to /usr/share/zsh/site-functions/_pacman
|
||||||
|
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
# options for passing to _arguments: main pacman commands
|
# options for passing to _arguments: main pacman commands
|
||||||
_pacman_opts_commands=(
|
_pacman_opts_commands=(
|
||||||
'-A[Add a package to the system]'
|
|
||||||
'-F[Upgrade an installed package]'
|
|
||||||
'-Q[Query the package database]'
|
'-Q[Query the package database]'
|
||||||
'-R[Remove a package from the system]'
|
'-R[Remove a package from the system]'
|
||||||
'-S[Synchronize packages]'
|
'-S[Synchronize packages]'
|
||||||
@@ -22,11 +20,15 @@ _pacman_opts_common=(
|
|||||||
'-h[Display syntax for the given operation]'
|
'-h[Display syntax for the given operation]'
|
||||||
'-r[Set alternate installation root]:installation root:_files -/'
|
'-r[Set alternate installation root]:installation root:_files -/'
|
||||||
'-v[Be more verbose]'
|
'-v[Be more verbose]'
|
||||||
|
'--cachedir[Alternate package cache location]:cache_location:_files -/'
|
||||||
'--config[An alternate configuration file]:config file:_files'
|
'--config[An alternate configuration file]:config file:_files'
|
||||||
|
'--logfile[An alternate log file]:config file:_files'
|
||||||
'--noconfirm[Do not ask for confirmation]'
|
'--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 --upgrade commands
|
||||||
_pacman_opts_pkgfile=(
|
_pacman_opts_pkgfile=(
|
||||||
'-d[Skip dependency checks]'
|
'-d[Skip dependency checks]'
|
||||||
'-f[Overwrite conflicting files]'
|
'-f[Overwrite conflicting files]'
|
||||||
@@ -35,7 +37,6 @@ _pacman_opts_pkgfile=(
|
|||||||
|
|
||||||
# options for passing to _arguments: subactions for --query command
|
# options for passing to _arguments: subactions for --query command
|
||||||
_pacman_opts_query_actions=(
|
_pacman_opts_query_actions=(
|
||||||
'-e[List orphaned packages]:*:orphans:->query_orphans'
|
|
||||||
'-g[View all members of a package group]:*:package groups:->query_group'
|
'-g[View all members of a package group]:*:package groups:->query_group'
|
||||||
'-o[Query the package that owns a file]:file:_files'
|
'-o[Query the package that owns a file]:file:_files'
|
||||||
'-p[Package file to query]:*:package file:->query_file'
|
'-p[Package file to query]:*:package file:->query_file'
|
||||||
@@ -44,8 +45,15 @@ _pacman_opts_query_actions=(
|
|||||||
|
|
||||||
# options for passing to _arguments: options for --query and subcommands
|
# options for passing to _arguments: options for --query and subcommands
|
||||||
_pacman_opts_query_modifiers=(
|
_pacman_opts_query_modifiers=(
|
||||||
|
'-c[List package changelog]'
|
||||||
|
'-d[List packages installed as dependencies]'
|
||||||
|
'-e[List packages explicitly installed]'
|
||||||
'-i[View package information]'
|
'-i[View package information]'
|
||||||
|
'-ii[View package information including backup files]'
|
||||||
'-l[List package contents]'
|
'-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
|
# options for passing to _arguments: options for --remove command
|
||||||
@@ -61,6 +69,7 @@ _pacman_opts_remove=(
|
|||||||
# options for passing to _arguments: options for --sync command
|
# options for passing to _arguments: options for --sync command
|
||||||
_pacman_opts_sync_actions=(
|
_pacman_opts_sync_actions=(
|
||||||
'*-c[Remove old packages from cache]:*:clean:->sync_clean'
|
'*-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'
|
'-g[View all members of a package group]:*:package groups:->sync_group'
|
||||||
'-s[Search package names and descriptions]:*:search text:->sync_search'
|
'-s[Search package names and descriptions]:*:search text:->sync_search'
|
||||||
)
|
)
|
||||||
@@ -75,23 +84,14 @@ _pacman_opts_sync_modifiers=(
|
|||||||
'-u[Upgrade all out-of-date packages]'
|
'-u[Upgrade all out-of-date packages]'
|
||||||
'-w[Download packages only]'
|
'-w[Download packages only]'
|
||||||
'-y[Download fresh package databases]'
|
'-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]'
|
||||||
|
'--asexplicit[Install packages as explicitly installed]'
|
||||||
)
|
)
|
||||||
|
|
||||||
# handles --action subcommand
|
|
||||||
_pacman_action_add() {
|
|
||||||
_arguments -s : \
|
|
||||||
"$_pacman_opts_common[@]" \
|
|
||||||
"$_pacman_opts_pkgfile[@]"
|
|
||||||
}
|
|
||||||
|
|
||||||
# handles --freshen subcommand
|
|
||||||
_pacman_action_freshen() {
|
|
||||||
_arguments -s : \
|
|
||||||
"$_pacman_opts_common[@]" \
|
|
||||||
"$_pacman_opts_pkgfile[@]"
|
|
||||||
}
|
|
||||||
|
|
||||||
# handles --help subcommand
|
# handles --help subcommand
|
||||||
_pacman_action_help() {
|
_pacman_action_help() {
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
@@ -127,11 +127,6 @@ _pacman_action_query() {
|
|||||||
"$_pacman_opts_query_modifiers[@]" \
|
"$_pacman_opts_query_modifiers[@]" \
|
||||||
'*:groups:_pacman_completions_installed_groups'
|
'*:groups:_pacman_completions_installed_groups'
|
||||||
;;
|
;;
|
||||||
query_orphans)
|
|
||||||
_arguments -s : \
|
|
||||||
"$_pacman_opts_common[@]" \
|
|
||||||
"$_pacman_opts_query_modifiers[@]"
|
|
||||||
;;
|
|
||||||
query_owner)
|
query_owner)
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_opts_common[@]" \
|
"$_pacman_opts_common[@]" \
|
||||||
@@ -216,43 +211,57 @@ _pacman_action_version() {
|
|||||||
_pacman_completions_all_groups() {
|
_pacman_completions_all_groups() {
|
||||||
local -a cmd groups
|
local -a cmd groups
|
||||||
_pacman_get_command
|
_pacman_get_command
|
||||||
groups=( $(_call_program groups $cmd[@] -Sg | grep -e \^$PREFIX) )
|
groups=( $(_call_program groups $cmd[@] -Sg) )
|
||||||
compadd "$@" -a groups
|
compadd "$@" -a groups
|
||||||
}
|
}
|
||||||
|
|
||||||
# provides completions for packages available from repositories
|
# provides completions for packages available from repositories
|
||||||
|
# these can be specified as either 'package' or 'repository/package'
|
||||||
_pacman_completions_all_packages() {
|
_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) )
|
repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
|
||||||
# these can be specified as either 'package' or 'repository/package'
|
typeset -U repositories
|
||||||
if [[ "$PREFIX" == "" ]] ; then
|
packages_long=(/var/lib/pacman/sync/${^repositories}/*(/))
|
||||||
packages=( $(_call_program packages ls /var/lib/pacman/${^repositories} | grep -v "^/" | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
|
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
|
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
|
fi
|
||||||
compadd "$@" -a packages
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# provides completions for package groups
|
# provides completions for package groups
|
||||||
_pacman_completions_installed_groups() {
|
_pacman_completions_installed_groups() {
|
||||||
local -a cmd groups
|
local -a cmd groups
|
||||||
_pacman_get_command
|
_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
|
compadd "$@" -a groups
|
||||||
}
|
}
|
||||||
|
|
||||||
# provides completions for installed packages
|
# provides completions for installed packages
|
||||||
_pacman_completions_installed_packages() {
|
_pacman_completions_installed_packages() {
|
||||||
local -a cmd packages
|
local -a cmd packages packages_long
|
||||||
packages=( $(_call_program installed_packages ls /var/lib/pacman/local | grep "^$PREFIX" | sed "s,\-[^-]*\-[^-]*$,,") )
|
packages_long=(/var/lib/pacman/local/*(/))
|
||||||
|
packages=( ${${packages_long/\/var\/lib\/pacman\/local\//}%-*-*} )
|
||||||
compadd "$@" -a packages
|
compadd "$@" -a packages
|
||||||
}
|
}
|
||||||
|
|
||||||
# provides completions for repository names
|
# provides completions for repository names
|
||||||
_pacman_completions_repositories() {
|
_pacman_completions_repositories() {
|
||||||
local -a cmd 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
|
compadd "$@" -a repositories
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,21 +282,19 @@ _pacman_get_command() {
|
|||||||
# main dispatcher
|
# main dispatcher
|
||||||
_pacman() {
|
_pacman() {
|
||||||
case $words[2] in
|
case $words[2] in
|
||||||
-A*) _pacman_action_add ;;
|
-Q*g*) # ipkg groups
|
||||||
-F*) _pacman_action_freshen ;;
|
|
||||||
-Qg) # ipkg groups
|
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_opts_common[@]" \
|
"$_pacman_opts_common[@]" \
|
||||||
"$_pacman_opts_query_modifiers[@]" \
|
"$_pacman_opts_query_modifiers[@]" \
|
||||||
'*:groups:_pacman_completions_installed_groups'
|
'*:groups:_pacman_completions_installed_groups'
|
||||||
;;
|
;;
|
||||||
-Qo) # file *.pkg.tar.gz
|
-Q*o*) # file
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_opts_common[@]" \
|
"$_pacman_opts_common[@]" \
|
||||||
"$_pacman_opts_query_modifiers[@]" \
|
"$_pacman_opts_query_modifiers[@]" \
|
||||||
'*:package file:_files'
|
'*:package file:_files'
|
||||||
;;
|
;;
|
||||||
-Qp) # file *.pkg.tar.gz
|
-Q*p*) # file *.pkg.tar.gz
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_opts_common[@]" \
|
"$_pacman_opts_common[@]" \
|
||||||
"$_pacman_opts_query_modifiers[@]" \
|
"$_pacman_opts_query_modifiers[@]" \
|
||||||
@@ -295,13 +302,16 @@ _pacman() {
|
|||||||
;;
|
;;
|
||||||
-Q*) _pacman_action_query ;;
|
-Q*) _pacman_action_query ;;
|
||||||
-R*) _pacman_action_remove ;;
|
-R*) _pacman_action_remove ;;
|
||||||
-Sl) # repos
|
-S*c*) # no completion
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
-S*l*) # repos
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_opts_common[@]" \
|
"$_pacman_opts_common[@]" \
|
||||||
"$_pacman_opts_sync_modifiers[@]" \
|
"$_pacman_opts_sync_modifiers[@]" \
|
||||||
'*:package repo:_pacman_completions_repositories' \
|
'*:package repo:_pacman_completions_repositories' \
|
||||||
;;
|
;;
|
||||||
-Sg) # pkg groups
|
-S*g*) # pkg groups
|
||||||
_arguments -s : \
|
_arguments -s : \
|
||||||
"$_pacman_opts_common[@]" \
|
"$_pacman_opts_common[@]" \
|
||||||
"$_pacman_opts_sync_modifiers[@]" \
|
"$_pacman_opts_sync_modifiers[@]" \
|
||||||
|
|||||||
584
depcomp
Executable file
584
depcomp
Executable file
@@ -0,0 +1,584 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# depcomp - compile a program generating dependencies as side-effects
|
||||||
|
|
||||||
|
scriptversion=2006-10-15.18
|
||||||
|
|
||||||
|
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
|
|
||||||
|
# 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, 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, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301, USA.
|
||||||
|
|
||||||
|
# As a special exception to the GNU General Public License, if you
|
||||||
|
# distribute this file as part of a program that contains a
|
||||||
|
# configuration script generated by Autoconf, you may include it under
|
||||||
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
|
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
'')
|
||||||
|
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||||
|
exit 1;
|
||||||
|
;;
|
||||||
|
-h | --h*)
|
||||||
|
cat <<\EOF
|
||||||
|
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||||
|
|
||||||
|
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||||
|
as side-effects.
|
||||||
|
|
||||||
|
Environment variables:
|
||||||
|
depmode Dependency tracking mode.
|
||||||
|
source Source file read by `PROGRAMS ARGS'.
|
||||||
|
object Object file output by `PROGRAMS ARGS'.
|
||||||
|
DEPDIR directory where to store dependencies.
|
||||||
|
depfile Dependency file to output.
|
||||||
|
tmpdepfile Temporary file to use when outputing dependencies.
|
||||||
|
libtool Whether libtool is used (yes/no).
|
||||||
|
|
||||||
|
Report bugs to <bug-automake@gnu.org>.
|
||||||
|
EOF
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-v | --v*)
|
||||||
|
echo "depcomp $scriptversion"
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||||
|
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||||
|
depfile=${depfile-`echo "$object" |
|
||||||
|
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||||
|
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||||
|
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
|
||||||
|
# Some modes work just like other modes, but use different flags. We
|
||||||
|
# parameterize here, but still list the modes in the big case below,
|
||||||
|
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||||
|
# here, because this file can only contain one case statement.
|
||||||
|
if test "$depmode" = hp; then
|
||||||
|
# HP compiler uses -M and no extra arg.
|
||||||
|
gccflag=-M
|
||||||
|
depmode=gcc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$depmode" = dashXmstdout; then
|
||||||
|
# This is just like dashmstdout with a different argument.
|
||||||
|
dashmflag=-xM
|
||||||
|
depmode=dashmstdout
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$depmode" in
|
||||||
|
gcc3)
|
||||||
|
## gcc 3 implements dependency tracking that does exactly what
|
||||||
|
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||||
|
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||||
|
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||||
|
## the command line argument order; so add the flags where they
|
||||||
|
## appear in depend2.am. Note that the slowdown incurred here
|
||||||
|
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||||
|
*) set fnord "$@" "$arg" ;;
|
||||||
|
esac
|
||||||
|
shift # fnord
|
||||||
|
shift # $arg
|
||||||
|
done
|
||||||
|
"$@"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
mv "$tmpdepfile" "$depfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
gcc)
|
||||||
|
## There are various ways to get dependency output from gcc. Here's
|
||||||
|
## why we pick this rather obscure method:
|
||||||
|
## - Don't want to use -MD because we'd like the dependencies to end
|
||||||
|
## up in a subdir. Having to rename by hand is ugly.
|
||||||
|
## (We might end up doing this anyway to support other compilers.)
|
||||||
|
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||||
|
## -MM, not -M (despite what the docs say).
|
||||||
|
## - Using -M directly means running the compiler twice (even worse
|
||||||
|
## than renaming).
|
||||||
|
if test -z "$gccflag"; then
|
||||||
|
gccflag=-MD,
|
||||||
|
fi
|
||||||
|
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||||
|
## The second -e expression handles DOS-style file names with drive letters.
|
||||||
|
sed -e 's/^[^:]*: / /' \
|
||||||
|
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||||
|
## This next piece of magic avoids the `deleted header file' problem.
|
||||||
|
## The problem is that when a header file which appears in a .P file
|
||||||
|
## is deleted, the dependency causes make to die (because there is
|
||||||
|
## typically no way to rebuild the header). We avoid this by adding
|
||||||
|
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||||
|
## this for us directly.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" |
|
||||||
|
## Some versions of gcc put a space before the `:'. On the theory
|
||||||
|
## that the space means something, we add a space to the output as
|
||||||
|
## well.
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
hp)
|
||||||
|
# This case exists only to let depend.m4 do its work. It works by
|
||||||
|
# looking at the text of this script. This case will never be run,
|
||||||
|
# since it is checked for above.
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
sgi)
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||||
|
else
|
||||||
|
"$@" -MDupdate "$tmpdepfile"
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
|
||||||
|
# Clip off the initial element (the dependent). Don't try to be
|
||||||
|
# clever and replace this with sed code, as IRIX sed won't handle
|
||||||
|
# lines with more than a fixed number of characters (4096 in
|
||||||
|
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||||
|
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||||
|
# dependency line.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" \
|
||||||
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||||
|
tr '
|
||||||
|
' ' ' >> $depfile
|
||||||
|
echo >> $depfile
|
||||||
|
|
||||||
|
# The second pass generates a dummy entry for each header file.
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" \
|
||||||
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||||
|
>> $depfile
|
||||||
|
else
|
||||||
|
# The sourcefile does not contain any dependencies, so just
|
||||||
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
|
# "include basename.Plo" scheme.
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
aix)
|
||||||
|
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||||
|
# in a .u file. In older versions, this file always lives in the
|
||||||
|
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||||
|
# start of each line; $object doesn't have directory information.
|
||||||
|
# Version 6 uses the directory in both cases.
|
||||||
|
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||||
|
tmpdepfile="$stripped.u"
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
"$@" -Wc,-M
|
||||||
|
else
|
||||||
|
"$@" -M
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile"; then :
|
||||||
|
else
|
||||||
|
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||||
|
tmpdepfile="$stripped.u"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
outname="$stripped.o"
|
||||||
|
# Each line is of the form `foo.o: dependent.h'.
|
||||||
|
# Do two passes, one to just change these to
|
||||||
|
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||||
|
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||||
|
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
# The sourcefile does not contain any dependencies, so just
|
||||||
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
|
# "include basename.Plo" scheme.
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
icc)
|
||||||
|
# Intel's C compiler understands `-MD -MF file'. However on
|
||||||
|
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||||
|
# ICC 7.0 will fill foo.d with something like
|
||||||
|
# foo.o: sub/foo.c
|
||||||
|
# foo.o: sub/foo.h
|
||||||
|
# which is wrong. We want:
|
||||||
|
# sub/foo.o: sub/foo.c
|
||||||
|
# sub/foo.o: sub/foo.h
|
||||||
|
# sub/foo.c:
|
||||||
|
# sub/foo.h:
|
||||||
|
# ICC 7.1 will output
|
||||||
|
# foo.o: sub/foo.c sub/foo.h
|
||||||
|
# and will wrap long lines using \ :
|
||||||
|
# foo.o: sub/foo.c ... \
|
||||||
|
# sub/foo.h ... \
|
||||||
|
# ...
|
||||||
|
|
||||||
|
"$@" -MD -MF "$tmpdepfile"
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
rm -f "$depfile"
|
||||||
|
# Each line is of the form `foo.o: dependent.h',
|
||||||
|
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||||
|
# Do two passes, one to just change these to
|
||||||
|
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||||
|
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||||
|
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
# correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||||
|
sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
hp2)
|
||||||
|
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||||
|
# compilers, which have integrated preprocessors. The correct option
|
||||||
|
# to use with these is +Maked; it writes dependencies to a file named
|
||||||
|
# 'foo.d', which lands next to the object file, wherever that
|
||||||
|
# happens to be.
|
||||||
|
# Much of this is similar to the tru64 case; see comments there.
|
||||||
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
tmpdepfile1=$dir$base.d
|
||||||
|
tmpdepfile2=$dir.libs/$base.d
|
||||||
|
"$@" -Wc,+Maked
|
||||||
|
else
|
||||||
|
tmpdepfile1=$dir$base.d
|
||||||
|
tmpdepfile2=$dir$base.d
|
||||||
|
"$@" +Maked
|
||||||
|
fi
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||||
|
do
|
||||||
|
test -f "$tmpdepfile" && break
|
||||||
|
done
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||||
|
# Add `dependent.h:' lines.
|
||||||
|
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||||
|
;;
|
||||||
|
|
||||||
|
tru64)
|
||||||
|
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||||
|
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||||
|
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||||
|
# dependencies in `foo.d' instead, so we check for that too.
|
||||||
|
# Subdirectories are respected.
|
||||||
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
|
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
# With Tru64 cc, shared objects can also be used to make a
|
||||||
|
# static library. This mechanism is used in libtool 1.4 series to
|
||||||
|
# handle both shared and static libraries in a single compilation.
|
||||||
|
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||||
|
#
|
||||||
|
# With libtool 1.5 this exception was removed, and libtool now
|
||||||
|
# generates 2 separate objects for the 2 libraries. These two
|
||||||
|
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||||
|
# in $dir$base.o.d. We have to check for both files, because
|
||||||
|
# one of the two compilations can be disabled. We should prefer
|
||||||
|
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||||
|
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||||
|
# the former would cause a distcleancheck panic.
|
||||||
|
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||||
|
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||||
|
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||||
|
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||||
|
"$@" -Wc,-MD
|
||||||
|
else
|
||||||
|
tmpdepfile1=$dir$base.o.d
|
||||||
|
tmpdepfile2=$dir$base.d
|
||||||
|
tmpdepfile3=$dir$base.d
|
||||||
|
tmpdepfile4=$dir$base.d
|
||||||
|
"$@" -MD
|
||||||
|
fi
|
||||||
|
|
||||||
|
stat=$?
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
|
exit $stat
|
||||||
|
fi
|
||||||
|
|
||||||
|
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
|
do
|
||||||
|
test -f "$tmpdepfile" && break
|
||||||
|
done
|
||||||
|
if test -f "$tmpdepfile"; then
|
||||||
|
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||||
|
# That's a tab and a space in the [].
|
||||||
|
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||||
|
else
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
|
fi
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
#nosideeffect)
|
||||||
|
# This comment above is used by automake to tell side-effect
|
||||||
|
# dependency tracking mechanisms from slower ones.
|
||||||
|
|
||||||
|
dashmstdout)
|
||||||
|
# Important note: in order to support this mode, a compiler *must*
|
||||||
|
# always write the preprocessed file to stdout, regardless of -o.
|
||||||
|
"$@" || exit $?
|
||||||
|
|
||||||
|
# Remove the call to Libtool.
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
while test $1 != '--mode=compile'; do
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove `-o $object'.
|
||||||
|
IFS=" "
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
-o)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
$object)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift # fnord
|
||||||
|
shift # $arg
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
test -z "$dashmflag" && dashmflag=-M
|
||||||
|
# Require at least two characters before searching for `:'
|
||||||
|
# in the target name. This is to cope with DOS-style filenames:
|
||||||
|
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||||
|
"$@" $dashmflag |
|
||||||
|
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||||
|
rm -f "$depfile"
|
||||||
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" | \
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
dashXmstdout)
|
||||||
|
# This case only exists to satisfy depend.m4. It is never actually
|
||||||
|
# run, as this mode is specially recognized in the preamble.
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
makedepend)
|
||||||
|
"$@" || exit $?
|
||||||
|
# Remove any Libtool call
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
while test $1 != '--mode=compile'; do
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
# X makedepend
|
||||||
|
shift
|
||||||
|
cleared=no
|
||||||
|
for arg in "$@"; do
|
||||||
|
case $cleared in
|
||||||
|
no)
|
||||||
|
set ""; shift
|
||||||
|
cleared=yes ;;
|
||||||
|
esac
|
||||||
|
case "$arg" in
|
||||||
|
-D*|-I*)
|
||||||
|
set fnord "$@" "$arg"; shift ;;
|
||||||
|
# Strip any option that makedepend may not understand. Remove
|
||||||
|
# the object too, otherwise makedepend will parse it as a source file.
|
||||||
|
-*|$object)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"; shift ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||||
|
touch "$tmpdepfile"
|
||||||
|
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||||
|
rm -f "$depfile"
|
||||||
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
|
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||||
|
' | \
|
||||||
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||||
|
;;
|
||||||
|
|
||||||
|
cpp)
|
||||||
|
# Important note: in order to support this mode, a compiler *must*
|
||||||
|
# always write the preprocessed file to stdout.
|
||||||
|
"$@" || exit $?
|
||||||
|
|
||||||
|
# Remove the call to Libtool.
|
||||||
|
if test "$libtool" = yes; then
|
||||||
|
while test $1 != '--mode=compile'; do
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove `-o $object'.
|
||||||
|
IFS=" "
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
-o)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
$object)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift # fnord
|
||||||
|
shift # $arg
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
"$@" -E |
|
||||||
|
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||||
|
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||||
|
sed '$ s: \\$::' > "$tmpdepfile"
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
cat < "$tmpdepfile" >> "$depfile"
|
||||||
|
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
msvisualcpp)
|
||||||
|
# Important note: in order to support this mode, a compiler *must*
|
||||||
|
# always write the preprocessed file to stdout, regardless of -o,
|
||||||
|
# because we must use -o when running libtool.
|
||||||
|
"$@" || exit $?
|
||||||
|
IFS=" "
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
case "$arg" in
|
||||||
|
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||||
|
set fnord "$@"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
set fnord "$@" "$arg"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
"$@" -E |
|
||||||
|
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||||
|
rm -f "$depfile"
|
||||||
|
echo "$object : \\" > "$depfile"
|
||||||
|
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||||
|
echo " " >> "$depfile"
|
||||||
|
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||||
|
rm -f "$tmpdepfile"
|
||||||
|
;;
|
||||||
|
|
||||||
|
none)
|
||||||
|
exec "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Unknown depmode $depmode" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-indentation: 2
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
||||||
@@ -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.5
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Project related configuration options
|
# Project related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
DOXYFILE_ENCODING = UTF-8
|
||||||
PROJECT_NAME = libalpm
|
PROJECT_NAME = libalpm
|
||||||
PROJECT_NUMBER =
|
PROJECT_NUMBER =
|
||||||
OUTPUT_DIRECTORY =
|
OUTPUT_DIRECTORY = ./
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
USE_WINDOWS_ENCODING = NO
|
|
||||||
BRIEF_MEMBER_DESC = YES
|
BRIEF_MEMBER_DESC = YES
|
||||||
REPEAT_BRIEF = YES
|
REPEAT_BRIEF = YES
|
||||||
ABBREVIATE_BRIEF = "The $name class" \
|
ABBREVIATE_BRIEF = "The $name class" \
|
||||||
@@ -22,24 +22,30 @@ ABBREVIATE_BRIEF = "The $name class" \
|
|||||||
a \
|
a \
|
||||||
an \
|
an \
|
||||||
the
|
the
|
||||||
ALWAYS_DETAILED_SEC = NO
|
ALWAYS_DETAILED_SEC = YES
|
||||||
INLINE_INHERITED_MEMB = NO
|
INLINE_INHERITED_MEMB = NO
|
||||||
FULL_PATH_NAMES = YES
|
FULL_PATH_NAMES = NO
|
||||||
STRIP_FROM_PATH =
|
STRIP_FROM_PATH =
|
||||||
STRIP_FROM_INC_PATH =
|
STRIP_FROM_INC_PATH =
|
||||||
SHORT_NAMES = NO
|
SHORT_NAMES = NO
|
||||||
JAVADOC_AUTOBRIEF = NO
|
JAVADOC_AUTOBRIEF = YES
|
||||||
|
QT_AUTOBRIEF = NO
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
DETAILS_AT_TOP = NO
|
DETAILS_AT_TOP = NO
|
||||||
INHERIT_DOCS = YES
|
INHERIT_DOCS = YES
|
||||||
SEPARATE_MEMBER_PAGES = NO
|
SEPARATE_MEMBER_PAGES = NO
|
||||||
TAB_SIZE = 8
|
TAB_SIZE = 4
|
||||||
ALIASES =
|
ALIASES =
|
||||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||||
OPTIMIZE_OUTPUT_JAVA = NO
|
OPTIMIZE_OUTPUT_JAVA = NO
|
||||||
|
OPTIMIZE_FOR_FORTRAN = NO
|
||||||
|
OPTIMIZE_OUTPUT_VHDL = NO
|
||||||
BUILTIN_STL_SUPPORT = NO
|
BUILTIN_STL_SUPPORT = NO
|
||||||
|
CPP_CLI_SUPPORT = NO
|
||||||
|
SIP_SUPPORT = NO
|
||||||
DISTRIBUTE_GROUP_DOC = NO
|
DISTRIBUTE_GROUP_DOC = NO
|
||||||
SUBGROUPING = YES
|
SUBGROUPING = YES
|
||||||
|
TYPEDEF_HIDES_STRUCT = NO
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Build related configuration options
|
# Build related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
@@ -48,10 +54,11 @@ EXTRACT_PRIVATE = NO
|
|||||||
EXTRACT_STATIC = NO
|
EXTRACT_STATIC = NO
|
||||||
EXTRACT_LOCAL_CLASSES = YES
|
EXTRACT_LOCAL_CLASSES = YES
|
||||||
EXTRACT_LOCAL_METHODS = NO
|
EXTRACT_LOCAL_METHODS = NO
|
||||||
HIDE_UNDOC_MEMBERS = YES
|
EXTRACT_ANON_NSPACES = NO
|
||||||
HIDE_UNDOC_CLASSES = YES
|
HIDE_UNDOC_MEMBERS = NO
|
||||||
|
HIDE_UNDOC_CLASSES = NO
|
||||||
HIDE_FRIEND_COMPOUNDS = NO
|
HIDE_FRIEND_COMPOUNDS = NO
|
||||||
HIDE_IN_BODY_DOCS = NO
|
HIDE_IN_BODY_DOCS = YES
|
||||||
INTERNAL_DOCS = NO
|
INTERNAL_DOCS = NO
|
||||||
CASE_SENSE_NAMES = YES
|
CASE_SENSE_NAMES = YES
|
||||||
HIDE_SCOPE_NAMES = NO
|
HIDE_SCOPE_NAMES = NO
|
||||||
@@ -59,6 +66,7 @@ SHOW_INCLUDE_FILES = YES
|
|||||||
INLINE_INFO = YES
|
INLINE_INFO = YES
|
||||||
SORT_MEMBER_DOCS = YES
|
SORT_MEMBER_DOCS = YES
|
||||||
SORT_BRIEF_DOCS = NO
|
SORT_BRIEF_DOCS = NO
|
||||||
|
SORT_GROUP_NAMES = NO
|
||||||
SORT_BY_SCOPE_NAME = NO
|
SORT_BY_SCOPE_NAME = NO
|
||||||
GENERATE_TODOLIST = YES
|
GENERATE_TODOLIST = YES
|
||||||
GENERATE_TESTLIST = YES
|
GENERATE_TESTLIST = YES
|
||||||
@@ -67,7 +75,7 @@ GENERATE_DEPRECATEDLIST= YES
|
|||||||
ENABLED_SECTIONS =
|
ENABLED_SECTIONS =
|
||||||
MAX_INITIALIZER_LINES = 30
|
MAX_INITIALIZER_LINES = 30
|
||||||
SHOW_USED_FILES = YES
|
SHOW_USED_FILES = YES
|
||||||
SHOW_DIRECTORIES = YES
|
SHOW_DIRECTORIES = NO
|
||||||
FILE_VERSION_FILTER =
|
FILE_VERSION_FILTER =
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# configuration options related to warning and progress messages
|
# configuration options related to warning and progress messages
|
||||||
@@ -82,12 +90,14 @@ WARN_LOGFILE =
|
|||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# configuration options related to the input files
|
# configuration options related to the input files
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
INPUT =
|
INPUT = ../lib/libalpm/
|
||||||
FILE_PATTERNS = *.c
|
INPUT_ENCODING = UTF-8
|
||||||
|
FILE_PATTERNS =
|
||||||
RECURSIVE = NO
|
RECURSIVE = NO
|
||||||
EXCLUDE =
|
EXCLUDE =
|
||||||
EXCLUDE_SYMLINKS = NO
|
EXCLUDE_SYMLINKS = NO
|
||||||
EXCLUDE_PATTERNS =
|
EXCLUDE_PATTERNS =
|
||||||
|
EXCLUDE_SYMBOLS =
|
||||||
EXAMPLE_PATH =
|
EXAMPLE_PATH =
|
||||||
EXAMPLE_PATTERNS = *
|
EXAMPLE_PATTERNS = *
|
||||||
EXAMPLE_RECURSIVE = NO
|
EXAMPLE_RECURSIVE = NO
|
||||||
@@ -99,50 +109,143 @@ FILTER_SOURCE_FILES = NO
|
|||||||
# configuration options related to source browsing
|
# configuration options related to source browsing
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
SOURCE_BROWSER = NO
|
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
|
# configuration options related to the alphabetical class index
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
ALPHABETICAL_INDEX = NO
|
ALPHABETICAL_INDEX = NO
|
||||||
|
COLS_IN_ALPHA_INDEX = 5
|
||||||
|
IGNORE_PREFIX =
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# configuration options related to the HTML output
|
# configuration options related to the HTML output
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
GENERATE_HTML = NO
|
GENERATE_HTML = NO
|
||||||
|
HTML_OUTPUT = html
|
||||||
|
HTML_FILE_EXTENSION = .html
|
||||||
|
HTML_HEADER =
|
||||||
|
HTML_FOOTER =
|
||||||
|
HTML_STYLESHEET =
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
|
GENERATE_HTMLHELP = NO
|
||||||
|
GENERATE_DOCSET = NO
|
||||||
|
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||||
|
DOCSET_BUNDLE_ID = org.doxygen.Project
|
||||||
|
HTML_DYNAMIC_SECTIONS = 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
|
# configuration options related to the LaTeX output
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
GENERATE_LATEX = NO
|
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
|
# configuration options related to the RTF output
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
GENERATE_RTF = NO
|
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
|
# configuration options related to the man page output
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
GENERATE_MAN = YES
|
GENERATE_MAN = YES
|
||||||
MAN_OUTPUT = ../../doc
|
MAN_OUTPUT = .
|
||||||
MAN_EXTENSION = .3
|
MAN_EXTENSION = .3
|
||||||
MAN_LINKS = YES
|
MAN_LINKS = NO
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# configuration options related to the XML output
|
# configuration options related to the XML output
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
GENERATE_XML = NO
|
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
|
# configuration options related to the Perl module output
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
GENERATE_PERLMOD = NO
|
GENERATE_PERLMOD = NO
|
||||||
|
PERLMOD_LATEX = NO
|
||||||
|
PERLMOD_PRETTY = YES
|
||||||
|
PERLMOD_MAKEVAR_PREFIX =
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration options related to the preprocessor
|
# Configuration options related to the preprocessor
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
ENABLE_PREPROCESSING = YES
|
ENABLE_PREPROCESSING = YES
|
||||||
MACRO_EXPANSION = NO
|
MACRO_EXPANSION = YES
|
||||||
EXPAND_ONLY_PREDEF = NO
|
EXPAND_ONLY_PREDEF = YES
|
||||||
SEARCH_INCLUDES = YES
|
SEARCH_INCLUDES = YES
|
||||||
INCLUDE_PATH =
|
INCLUDE_PATH = ../..
|
||||||
INCLUDE_FILE_PATTERNS =
|
INCLUDE_FILE_PATTERNS = *.h
|
||||||
PREDEFINED =
|
PREDEFINED = HAVE_CONFIG_H= \
|
||||||
|
SYMHIDDEN= \
|
||||||
|
SYMEXPORT=
|
||||||
EXPAND_AS_DEFINED =
|
EXPAND_AS_DEFINED =
|
||||||
SKIP_FUNCTION_MACROS = YES
|
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
|
# Configuration options related to the dot tool
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
CLASS_DIAGRAMS = NO
|
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
|
||||||
|
MAX_DOT_GRAPH_DEPTH = 3
|
||||||
|
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,84 @@
|
|||||||
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 \
|
pacman.8 \
|
||||||
makepkg.8 \
|
makepkg.8 \
|
||||||
|
repo-add.8 \
|
||||||
PKGBUILD.5 \
|
PKGBUILD.5 \
|
||||||
makepkg.conf.5 \
|
makepkg.conf.5 \
|
||||||
pacman.conf.5 \
|
pacman.conf.5 \
|
||||||
libalpm.3
|
libalpm.3
|
||||||
|
|
||||||
if HAS_DOXYGEN
|
DOXYGEN_MANS = $(wildcard man3/*.3)
|
||||||
man_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)
|
||||||
|
|
||||||
|
if USE_GIT_VERSION
|
||||||
|
GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 | sed s/^v//')-dirty
|
||||||
|
REAL_PACKAGE_VERSION = $(GIT_VERSION)
|
||||||
|
else
|
||||||
|
REAL_PACKAGE_VERSION = $(PACKAGE_VERSION)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS)
|
|
||||||
|
|
||||||
clean-local:
|
man_MANS =
|
||||||
$(RM) man3/*.3
|
dist_man_MANS = $(ASCIIDOC_MANS) repo-remove.8
|
||||||
|
|
||||||
|
if USE_DOXYGEN
|
||||||
|
man_MANS += $(DOXYGEN_MANS)
|
||||||
|
|
||||||
|
all: doxygen.in
|
||||||
|
|
||||||
|
doxygen.in:
|
||||||
|
$(DOXYGEN) $(srcdir)/Doxyfile
|
||||||
|
endif
|
||||||
|
|
||||||
|
if USE_ASCIIDOC
|
||||||
|
ASCIIDOC_OPTS = \
|
||||||
|
-f asciidoc.conf \
|
||||||
|
-a pacman_version="$(REAL_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'
|
||||||
|
|
||||||
|
$(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: Joe User <joe.user@example.com>
|
||||||
|
|
||||||
|
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 $srcdir/$pkgname-$pkgver
|
||||||
|
./configure --prefix=/usr
|
||||||
|
make || return 1
|
||||||
|
make prefix=$pkgdir/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.
|
|
||||||
376
doc/PKGBUILD.5.txt
Normal file
376
doc/PKGBUILD.5.txt
Normal file
@@ -0,0 +1,376 @@
|
|||||||
|
/////
|
||||||
|
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
|
||||||
|
----------------------
|
||||||
|
The following is a list of standard options and directives available for use
|
||||||
|
in a PKGBUILD. These are all understood and interpreted by makepkg, and most
|
||||||
|
will be directly transferred to the built package.
|
||||||
|
|
||||||
|
If you need to create any custom variables for use in your build process, it is
|
||||||
|
recommended to name your custom variables with an '_' (underscore) prefix.
|
||||||
|
This will prevent any possible name clashes with internal makepkg variables.
|
||||||
|
For example, to store the base kernel version in a variable, use something
|
||||||
|
similar to `$_basekernver`.
|
||||||
|
|
||||||
|
*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.
|
||||||
|
|
||||||
|
*sha1sums, sha256sums, sha384sums, sha512sums (arrays)*::
|
||||||
|
Alternative integrity checks that makepkg supports; these all behave
|
||||||
|
similar to the md5sums option described above. To enable use and generation
|
||||||
|
of these checksums, be sure to set up the `INTEGRITY_CHECK` option in
|
||||||
|
linkman:makepkg.conf[5].
|
||||||
|
|
||||||
|
*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.
|
||||||
|
|
||||||
|
*zipman*;;
|
||||||
|
Compress man pages with gzip.
|
||||||
|
|
||||||
|
*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). See linkman:pacman[8] for
|
||||||
|
more infomation on version comparisons.
|
||||||
|
|
||||||
|
|
||||||
|
build() Function
|
||||||
|
----------------
|
||||||
|
In addition to the above directives, the build() bash function comprises the
|
||||||
|
remainder of the PKGBUILD. This is directly sourced and executed by makepkg, so
|
||||||
|
anything that bash or the system has available is available for use here. Be
|
||||||
|
sure any exotic commands used are covered by `makedepends`.
|
||||||
|
|
||||||
|
All of the above variables such as `pkgname` and `pkgver` are available for use
|
||||||
|
in the build function. In addition, makepkg defines three variables for your
|
||||||
|
use during the build and install process. These three variables are as follows:
|
||||||
|
|
||||||
|
*startdir*::
|
||||||
|
This contains the absolute path to the directory where the PKGBUILD was
|
||||||
|
located, which is usually the output of `$(pwd)` when makepkg is started.
|
||||||
|
$$startdir$$ was most often used in combination with `/src` or `/pkg`
|
||||||
|
postfixes, but use of the `srcdir` and `pkgdir` variables is preferred.
|
||||||
|
|
||||||
|
*srcdir*::
|
||||||
|
This points to the directory where makepkg extracts or copies all source
|
||||||
|
files. Although it currently is an alias for `$startdir/src`, this
|
||||||
|
assumption should not be assumed true for all future revisions of makepkg.
|
||||||
|
|
||||||
|
*pkgdir*::
|
||||||
|
This points to the directory where makepkg bundles the installed package
|
||||||
|
(this directory will become the root directory of your built package).
|
||||||
|
Although it currently is an alias for `$startdir/pkg`, this assumption
|
||||||
|
should not be assumed true for all future revisions of makepkg.
|
||||||
|
|
||||||
|
If you create any variables of your own in the build function, it is
|
||||||
|
recommended to use the bash `local` keyword to scope the variable to inside
|
||||||
|
the build function.
|
||||||
|
|
||||||
|
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[]
|
||||||
30
doc/footer.txt
Normal file
30
doc/footer.txt
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/////
|
||||||
|
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
|
||||||
|
-------
|
||||||
|
|
||||||
|
Current maintainers:
|
||||||
|
|
||||||
|
* Dan McGee <dan@archlinux.org>
|
||||||
|
* Xavier Chantry <shiningxc@gmail.com>
|
||||||
|
* Aaron Griffin <aaron@archlinux.org>
|
||||||
|
|
||||||
|
Past contributors:
|
||||||
|
|
||||||
|
* Judd Vinet <jvinet@zeroflux.org>
|
||||||
|
* Aurelien Foret <aurelien@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.
|
|
||||||
163
doc/makepkg.8.txt
Normal file
163
doc/makepkg.8.txt
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
/////
|
||||||
|
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.
|
||||||
|
|
||||||
|
*-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.
|
|
||||||
167
doc/makepkg.conf.5.txt
Normal file
167
doc/makepkg.conf.5.txt
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
/////
|
||||||
|
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.
|
||||||
|
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 to do file resumes properly.
|
||||||
|
|
||||||
|
**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 zipman**)**::
|
||||||
|
This array contains options that affect the default packaging. They 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.
|
||||||
|
|
||||||
|
*zipman*;;
|
||||||
|
Compress man pages with gzip.
|
||||||
|
|
||||||
|
**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.
|
||||||
|
|
||||||
|
**STRIP_DIRS=(**bin lib sbin usr/{bin,lib} ...**)**::
|
||||||
|
If "strip" is specified in the OPTIONS array, this variable will
|
||||||
|
instruct makepkg where to look to for files to strip. 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[]
|
||||||
267
doc/pacman.8
267
doc/pacman.8
@@ -1,267 +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 \-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 "/"). However, this should
|
|
||||||
\fInot\fP be used as a way to install software into /usr/local instead of /usr,
|
|
||||||
for example. This option should be 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 to use.
|
|
||||||
.TP
|
|
||||||
.B \-v, --verbose
|
|
||||||
Output more status messages, such as the Root and DBPath.
|
|
||||||
.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.
|
|
||||||
|
|
||||||
.SH QUERY OPTIONS
|
|
||||||
.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 \-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.
|
|
||||||
365
doc/pacman.8.txt
Normal file
365
doc/pacman.8.txt
Normal file
@@ -0,0 +1,365 @@
|
|||||||
|
/////
|
||||||
|
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
|
||||||
|
----------
|
||||||
|
*-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`. You can also specify version requirements:
|
||||||
|
`pacman -S "bash>=3.2"`. (Quotes are needed, otherwise your shell
|
||||||
|
interprets ">" as redirection to file.)
|
||||||
|
+
|
||||||
|
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. When upgrading, pacman performs version comparison
|
||||||
|
to determine which packages need upgrading. This behavior operates as follows:
|
||||||
|
|
||||||
|
Alphanumeric:
|
||||||
|
1.0a < 1.0alpha < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0
|
||||||
|
Numeric:
|
||||||
|
1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
|
||||||
|
|
||||||
|
*-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 words, 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.
|
||||||
|
|
||||||
|
*\--asexplicit*::
|
||||||
|
Install packages explicitly; in other words, fake their install reason to
|
||||||
|
be explicitly installed. This is useful if you want to mark a dependency
|
||||||
|
as explicitly installed so it will not be removed by the '\--recursive'
|
||||||
|
remove operation.
|
||||||
|
|
||||||
|
*-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.
|
||||||
|
|
||||||
|
*-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.
|
||||||
|
|
||||||
|
*\--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'.
|
||||||
|
|
||||||
|
*-q, \--quiet*::
|
||||||
|
Show less information for certain query operations. Search will only show
|
||||||
|
package names and not version, group, and description information; a bare
|
||||||
|
query will only show package names rather than names and versions.
|
||||||
|
|
||||||
|
*-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. If you want to omit condition (B), pass this option twice.
|
||||||
|
|
||||||
|
*-u, \--unneeded*::
|
||||||
|
Removes the targets that are not required by any other packages.
|
||||||
|
This is mostly useful when removing a group without using the '-c' option,
|
||||||
|
to avoid breaking any dependencies.
|
||||||
|
|
||||||
|
|
||||||
|
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.
|
||||||
|
+
|
||||||
|
If you use a network shared cache, see the 'CleanMethod' option in
|
||||||
|
linkman:pacman.conf[5].
|
||||||
|
|
||||||
|
*-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.
|
||||||
|
|
||||||
|
*-q, \--quiet*::
|
||||||
|
Show less information for certain sync operations. Search will only show
|
||||||
|
package names and not version, group, and description information; list
|
||||||
|
will only show package names and omit databases and versions.
|
||||||
|
|
||||||
|
*-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,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
|
|
||||||
.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 ProxyServer = <\fIhost\fP|\fIip\fP>[:\fIport\fP]
|
|
||||||
If set, \fBpacman\fP will use this proxy server for all ftp/http transfers.
|
|
||||||
.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.
|
|
||||||
212
doc/pacman.conf.5.txt
Normal file
212
doc/pacman.conf.5.txt
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
/////
|
||||||
|
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
|
||||||
|
--------
|
||||||
|
|
||||||
|
*NOTE*: Each directive must be in CamelCase. If the case isn't respected, the directive
|
||||||
|
won't be recognized. For example. noupgrade or NOUPGRADE will not work.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
*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.
|
||||||
|
|
||||||
|
|
||||||
|
*LogFile =* '/path/to/file'::
|
||||||
|
Overrides the default location of the pacman log file. A typical default
|
||||||
|
is ``/var/log/pacman.log''. This is an absolute path and the root directory
|
||||||
|
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'.
|
||||||
|
|
||||||
|
*SyncFirst =* package ...::
|
||||||
|
Instructs pacman to check for newer version of these packages before any
|
||||||
|
sync operation. The user will have the choice to either cancel the current
|
||||||
|
operation and upgrade these packages first or go on with the current operation.
|
||||||
|
This option is typically used with the 'pacman' package.
|
||||||
|
|
||||||
|
*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.
|
||||||
|
These files refer to files in the package archive, so do not include the
|
||||||
|
leading slash (the RootDir) when specifying them.
|
||||||
|
|
||||||
|
*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.
|
||||||
|
These files refer to files in the package archive, so do not include the
|
||||||
|
leading slash (the RootDir) when specifying them.
|
||||||
|
|
||||||
|
*CleanMethod =* KeepInstalled | KeepCurrent::
|
||||||
|
If set to `KeepInstalled` (the default), the '-Sc' operation will clean
|
||||||
|
packages that are no longer installed (not present in the local database).
|
||||||
|
If set to `KeepCurrent`, '-Sc' will clean outdated packages (not present in
|
||||||
|
any sync database).
|
||||||
|
The second behavior is useful when the package cache is shared among
|
||||||
|
multiple machines, where the local databases are usually different, but the
|
||||||
|
sync databases in use could be the same.
|
||||||
|
|
||||||
|
*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 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[]
|
||||||
48
doc/repo-add.8.txt
Normal file
48
doc/repo-add.8.txt
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/////
|
||||||
|
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 [-q] <path-to-db> <package> ...
|
||||||
|
|
||||||
|
repo-remove [-q] <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
|
||||||
|
-------
|
||||||
|
*-q, \--quiet*::
|
||||||
|
Force this program to keep quiet and run silent except for warning and
|
||||||
|
error messages.
|
||||||
|
|
||||||
|
|
||||||
|
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
|
makepkg.conf
|
||||||
pacman.conf
|
pacman.conf
|
||||||
@@ -1,4 +1,30 @@
|
|||||||
SUBDIRS = pacman.d abs
|
|
||||||
|
|
||||||
EXTRA_DIST = makepkg.conf pacman.conf
|
|
||||||
dist_sysconf_DATA = 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
|
# SOURCE ACQUISITION
|
||||||
#########################################################################
|
#########################################################################
|
||||||
#
|
#
|
||||||
#-- The FTP/HTTP download utility that makepkg should use to acquire sources
|
#-- The download utilities that makepkg should use to acquire sources
|
||||||
FTPAGENT="/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3 --no-check-certificate"
|
# Format: 'protocol::agent'
|
||||||
#FTPAGENT="/usr/bin/snarf"
|
DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u'
|
||||||
#FTPAGENT="/usr/bin/lftpget -c"
|
'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'
|
||||||
|
'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate -O %o %u'
|
||||||
|
'rsync::/usr/bin/rsync -z %u %o'
|
||||||
|
'scp::/usr/bin/scp -C %u %o')
|
||||||
|
|
||||||
|
# Other common tools:
|
||||||
|
# /usr/bin/snarf
|
||||||
|
# /usr/bin/lftpget -c
|
||||||
|
# /usr/bin/curl
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# ARCHITECTURE, COMPILE FLAGS
|
# ARCHITECTURE, COMPILE FLAGS
|
||||||
@@ -19,10 +27,10 @@ CARCH="@CARCH@"
|
|||||||
CHOST="@CHOST@"
|
CHOST="@CHOST@"
|
||||||
|
|
||||||
#-- Exclusive: will only run on @CARCHFLAGS@
|
#-- Exclusive: will only run on @CARCHFLAGS@
|
||||||
# -mtune builds exclusively for an architecture
|
# -march (or -mcpu) builds exclusively for an architecture
|
||||||
# -mcpu optimizes for an architecture, but builds for the whole processor family
|
# -mtune optimizes for an architecture, but builds for whole processor family
|
||||||
CFLAGS="-@ARCHSWITCH@=@CARCHFLAGS@ -O2 -pipe"
|
CFLAGS="@CARCHFLAGS@-mtune=generic -O2 -pipe"
|
||||||
CXXFLAGS="-@ARCHSWITCH@=@CARCHFLAGS@ -O2 -pipe"
|
CXXFLAGS="@CARCHFLAGS@-mtune=generic -O2 -pipe"
|
||||||
#-- Make Flags: change this for DistCC/SMP systems
|
#-- Make Flags: change this for DistCC/SMP systems
|
||||||
#MAKEFLAGS="-j2"
|
#MAKEFLAGS="-j2"
|
||||||
|
|
||||||
@@ -30,14 +38,16 @@ CXXFLAGS="-@ARCHSWITCH@=@CARCHFLAGS@ -O2 -pipe"
|
|||||||
# BUILD ENVIRONMENT
|
# 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
|
#-- fakeroot: Allow building packages as a non-root user
|
||||||
#-- distcc: Use the Distributed C/C++/ObjC compiler
|
#-- distcc: Use the Distributed C/C++/ObjC compiler
|
||||||
#-- color: Colorize output messages
|
#-- color: Colorize output messages
|
||||||
#-- ccache: Use ccache to cache compilation
|
#-- 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,
|
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
|
||||||
#-- specify a space-delimited list of hosts running in the DistCC cluster.
|
#-- specify a space-delimited list of hosts running in the DistCC cluster.
|
||||||
@@ -48,29 +58,48 @@ BUILDENV=(fakeroot !distcc color !ccache)
|
|||||||
# These are default values for the options=() settings
|
# These are default values for the options=() settings
|
||||||
#########################################################################
|
#########################################################################
|
||||||
#
|
#
|
||||||
# Default: OPTIONS=(strip !docs !libtool emptydirs)
|
# Default: OPTIONS=(strip docs libtool emptydirs zipman)
|
||||||
|
# A negated option will do the opposite of the comments below.
|
||||||
#
|
#
|
||||||
#-- strip: Strip symbols from binaries/libraries
|
#-- strip: Strip symbols from binaries/libraries
|
||||||
#-- docs: Save doc and info directories
|
#-- docs: Save doc and info directories
|
||||||
#-- libtool: Leave libtool (.la) files in packages
|
#-- libtool: Leave libtool (.la) files in packages
|
||||||
#-- emptydirs: Leave empty directories in packages
|
#-- emptydirs: Leave empty directories in packages
|
||||||
|
#-- zipman: Compress manpages with gzip
|
||||||
#
|
#
|
||||||
OPTIONS=(strip !docs libtool emptydirs)
|
OPTIONS=(strip docs libtool emptydirs zipman)
|
||||||
|
|
||||||
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
|
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
|
||||||
INTEGRITY_CHECK=(md5 sha1)
|
INTEGRITY_CHECK=(md5)
|
||||||
#-- Info and doc directories to remove (if option set correctly above)
|
#-- Info and doc directories to remove (if option set correctly above)
|
||||||
DOC_DIRS=(usr/{,share/}{info,doc} opt/gnome/{,share/}{info,doc,gtk-doc})
|
DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc})
|
||||||
|
#-- Directories to be searched for the strip option (if option set correctly above)
|
||||||
|
STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# PACKAGE OUTPUT
|
# PACKAGE OUTPUT
|
||||||
#########################################################################
|
#########################################################################
|
||||||
#
|
#
|
||||||
|
# Default: put built package and cached source in build directory
|
||||||
|
#
|
||||||
#-- Destination: specify a fixed directory where all packages will be placed
|
#-- Destination: specify a fixed directory where all packages will be placed
|
||||||
#PKGDEST=/home/packages
|
#PKGDEST=/home/packages
|
||||||
#-- Source cache: specify a fixed directory where source files will be cached
|
#-- Source cache: specify a fixed directory where source files will be cached
|
||||||
#SRCDEST=/var/cache/pacman/src
|
#SRCDEST=/home/sources
|
||||||
#-- Packager: name/email of the person or organization building packages
|
#-- Packager: name/email of the person or organization building packages
|
||||||
#PACKAGER="John Doe <john@doe.com>"
|
#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:
|
# vim: set ft=sh ts=2 sw=2 et:
|
||||||
|
|||||||
@@ -1,15 +1,37 @@
|
|||||||
#
|
#
|
||||||
# /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
|
# GENERAL OPTIONS
|
||||||
#
|
#
|
||||||
[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
|
HoldPkg = pacman glibc
|
||||||
|
# If upgrades are available for these packages they will be asked for first
|
||||||
|
SyncFirst = pacman
|
||||||
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
||||||
|
#CleanMethod = KeepInstalled
|
||||||
|
|
||||||
|
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
|
||||||
|
#IgnorePkg =
|
||||||
|
#IgnoreGroup =
|
||||||
|
|
||||||
|
#NoUpgrade =
|
||||||
|
#NoExtract =
|
||||||
|
|
||||||
|
# Misc options (all disabled by default)
|
||||||
|
#NoPassiveFtp
|
||||||
|
#UseSyslog
|
||||||
|
#ShowSize
|
||||||
|
#UseDelta
|
||||||
|
#TotalDownload
|
||||||
|
|
||||||
#
|
#
|
||||||
# REPOSITORIES
|
# REPOSITORIES
|
||||||
@@ -18,25 +40,25 @@ HoldPkg = pacman glibc
|
|||||||
# - local/custom mirrors can be added here or in separate files
|
# - local/custom mirrors can be added here or in separate files
|
||||||
# - repositories listed first will take precedence when packages
|
# - repositories listed first will take precedence when packages
|
||||||
# have identical names, regardless of version number
|
# 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]
|
|
||||||
#Server = ftp://ftp.archlinux.org/testing/os/@CARCH@
|
|
||||||
|
|
||||||
[current]
|
# An example of a disabled remote package repository with multiple servers
|
||||||
# Add your preferred servers here, they will be used first
|
# available. To enable, uncomment the following lines. You can add preferred
|
||||||
Include = /etc/pacman.d/current
|
# servers immediately after the header and they will be used before the
|
||||||
|
# default mirrors.
|
||||||
[extra]
|
#[core]
|
||||||
# Add your preferred servers here, they will be used first
|
#Server = ftp://ftp.example.com/foobar/$repo/os/i686/
|
||||||
Include = /etc/pacman.d/extra
|
# The file referenced here should contain a list of 'Server = ' lines.
|
||||||
|
#Include = @sysconfdir@/pacman.d/mirrorlist
|
||||||
[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 custom package repository. See the pacman manpage for
|
# An example of a custom package repository. See the pacman manpage for
|
||||||
# tips on creating your own repositories.
|
# tips on creating your own repositories.
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
community
|
|
||||||
current
|
|
||||||
extra
|
|
||||||
mirrorlist
|
|
||||||
release
|
|
||||||
unstable
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
pkgsysconfdir = ${sysconfdir}/pacman.d
|
|
||||||
dist_pkgsysconf_DATA = community current extra release unstable
|
|
||||||
|
|
||||||
$(dist_pkgsysconf_DATA): mirrorlist
|
|
||||||
sed "s|@@REPO@@|$@|g" <$< >$@
|
|
||||||
|
|
||||||
clean-local:
|
|
||||||
rm -f $(dist_pkgsysconf_DATA)
|
|
||||||
|
|
||||||
@@ -1,71 +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@
|
|
||||||
Server = http://www2.cddc.vt.edu/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@
|
|
||||||
# - 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@
|
|
||||||
# - 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@
|
|
||||||
|
|
||||||
# Asia
|
|
||||||
# - China
|
|
||||||
Server = http://mirror.vxmatrix.net/ArchLinux/@@REPO@@/os/@CARCH@
|
|
||||||
Server = http://dxmirror.vxmatrix.net/ArchLinux/@@REPO@@/os/@CARCH@
|
|
||||||
Server = http://cncmirror.vxmatrix.net/ArchLinux/@@REPO@@/os/@CARCH@
|
|
||||||
507
install-sh
Executable file
507
install-sh
Executable file
@@ -0,0 +1,507 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
|
scriptversion=2006-10-14.15
|
||||||
|
|
||||||
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
|
# following copyright and license.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1994 X Consortium
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to
|
||||||
|
# deal in the Software without restriction, including without limitation the
|
||||||
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
# sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||||
|
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
# Except as contained in this notice, the name of the X Consortium shall not
|
||||||
|
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||||
|
# ings in this Software without prior written authorization from the X Consor-
|
||||||
|
# tium.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# FSF changes to this file are in the public domain.
|
||||||
|
#
|
||||||
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
|
# `make' implicit rules from creating a file called install from it
|
||||||
|
# when there is no Makefile.
|
||||||
|
#
|
||||||
|
# This script is compatible with the BSD install script, but was written
|
||||||
|
# from scratch.
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
IFS=" "" $nl"
|
||||||
|
|
||||||
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
|
doit="${DOITPROG-}"
|
||||||
|
if test -z "$doit"; then
|
||||||
|
doit_exec=exec
|
||||||
|
else
|
||||||
|
doit_exec=$doit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Put in absolute file names if you don't have them in your path;
|
||||||
|
# or use environment vars.
|
||||||
|
|
||||||
|
mvprog="${MVPROG-mv}"
|
||||||
|
cpprog="${CPPROG-cp}"
|
||||||
|
chmodprog="${CHMODPROG-chmod}"
|
||||||
|
chownprog="${CHOWNPROG-chown}"
|
||||||
|
chgrpprog="${CHGRPPROG-chgrp}"
|
||||||
|
stripprog="${STRIPPROG-strip}"
|
||||||
|
rmprog="${RMPROG-rm}"
|
||||||
|
mkdirprog="${MKDIRPROG-mkdir}"
|
||||||
|
|
||||||
|
posix_glob=
|
||||||
|
posix_mkdir=
|
||||||
|
|
||||||
|
# Desired mode of installed file.
|
||||||
|
mode=0755
|
||||||
|
|
||||||
|
chmodcmd=$chmodprog
|
||||||
|
chowncmd=
|
||||||
|
chgrpcmd=
|
||||||
|
stripcmd=
|
||||||
|
rmcmd="$rmprog -f"
|
||||||
|
mvcmd="$mvprog"
|
||||||
|
src=
|
||||||
|
dst=
|
||||||
|
dir_arg=
|
||||||
|
dstarg=
|
||||||
|
no_target_directory=
|
||||||
|
|
||||||
|
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||||
|
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||||
|
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||||
|
or: $0 [OPTION]... -d DIRECTORIES...
|
||||||
|
|
||||||
|
In the 1st form, copy SRCFILE to DSTFILE.
|
||||||
|
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||||
|
In the 4th, create DIRECTORIES.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-c (ignored)
|
||||||
|
-d create directories instead of installing files.
|
||||||
|
-g GROUP $chgrpprog installed files to GROUP.
|
||||||
|
-m MODE $chmodprog installed files to MODE.
|
||||||
|
-o USER $chownprog installed files to USER.
|
||||||
|
-s $stripprog installed files.
|
||||||
|
-t DIRECTORY install into DIRECTORY.
|
||||||
|
-T report an error if DSTFILE is a directory.
|
||||||
|
--help display this help and exit.
|
||||||
|
--version display version info and exit.
|
||||||
|
|
||||||
|
Environment variables override the default commands:
|
||||||
|
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||||
|
"
|
||||||
|
|
||||||
|
while test $# -ne 0; do
|
||||||
|
case $1 in
|
||||||
|
-c) shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-d) dir_arg=true
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-g) chgrpcmd="$chgrpprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
--help) echo "$usage"; exit $?;;
|
||||||
|
|
||||||
|
-m) mode=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
case $mode in
|
||||||
|
*' '* | *' '* | *'
|
||||||
|
'* | *'*'* | *'?'* | *'['*)
|
||||||
|
echo "$0: invalid mode: $mode" >&2
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-o) chowncmd="$chownprog $2"
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-s) stripcmd=$stripprog
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-t) dstarg=$2
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
-T) no_target_directory=true
|
||||||
|
shift
|
||||||
|
continue;;
|
||||||
|
|
||||||
|
--version) echo "$0 $scriptversion"; exit $?;;
|
||||||
|
|
||||||
|
--) shift
|
||||||
|
break;;
|
||||||
|
|
||||||
|
-*) echo "$0: invalid option: $1" >&2
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
|
||||||
|
# When -d is used, all remaining arguments are directories to create.
|
||||||
|
# When -t is used, the destination is already specified.
|
||||||
|
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
if test -n "$dstarg"; then
|
||||||
|
# $@ is not empty: it contains at least $arg.
|
||||||
|
set fnord "$@" "$dstarg"
|
||||||
|
shift # fnord
|
||||||
|
fi
|
||||||
|
shift # arg
|
||||||
|
dstarg=$arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
echo "$0: no input file specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# It's OK to call `install-sh -d' without argument.
|
||||||
|
# This can happen when creating conditional directories.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
trap '(exit $?); exit' 1 2 13 15
|
||||||
|
|
||||||
|
# Set umask so as not to create temps with too-generous modes.
|
||||||
|
# However, 'strip' requires both read and write access to temps.
|
||||||
|
case $mode in
|
||||||
|
# Optimize common cases.
|
||||||
|
*644) cp_umask=133;;
|
||||||
|
*755) cp_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw='% 200'
|
||||||
|
fi
|
||||||
|
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||||
|
*)
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw=,u+rw
|
||||||
|
fi
|
||||||
|
cp_umask=$mode$u_plus_rw;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
for src
|
||||||
|
do
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $src in
|
||||||
|
-*) src=./$src ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
dst=$src
|
||||||
|
dstdir=$dst
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
else
|
||||||
|
|
||||||
|
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||||
|
# might cause directories to be created, which would be especially bad
|
||||||
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
|
if test ! -f "$src" && test ! -d "$src"; then
|
||||||
|
echo "$0: $src does not exist." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dstarg"; then
|
||||||
|
echo "$0: no destination specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dst=$dstarg
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $dst in
|
||||||
|
-*) dst=./$dst ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If destination is a directory, append the input filename; won't work
|
||||||
|
# if double slashes aren't ignored.
|
||||||
|
if test -d "$dst"; then
|
||||||
|
if test -n "$no_target_directory"; then
|
||||||
|
echo "$0: $dstarg: Is a directory" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
dstdir=$dst
|
||||||
|
dst=$dstdir/`basename "$src"`
|
||||||
|
dstdir_status=0
|
||||||
|
else
|
||||||
|
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||||
|
dstdir=`
|
||||||
|
(dirname "$dst") 2>/dev/null ||
|
||||||
|
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||||
|
X"$dst" : 'X\(//\)[^/]' \| \
|
||||||
|
X"$dst" : 'X\(//\)$' \| \
|
||||||
|
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||||
|
echo X"$dst" |
|
||||||
|
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)[^/].*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\).*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/.*/./; q'
|
||||||
|
`
|
||||||
|
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
obsolete_mkdir_used=false
|
||||||
|
|
||||||
|
if test $dstdir_status != 0; then
|
||||||
|
case $posix_mkdir in
|
||||||
|
'')
|
||||||
|
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||||
|
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||||
|
umask=`umask`
|
||||||
|
case $stripcmd.$umask in
|
||||||
|
# Optimize common cases.
|
||||||
|
*[2367][2367]) mkdir_umask=$umask;;
|
||||||
|
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
mkdir_umask=`expr $umask + 22 \
|
||||||
|
- $umask % 100 % 40 + $umask % 20 \
|
||||||
|
- $umask % 10 % 4 + $umask % 2
|
||||||
|
`;;
|
||||||
|
*) mkdir_umask=$umask,go-w;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# With -d, create the new directory with the user-specified mode.
|
||||||
|
# Otherwise, rely on $mkdir_umask.
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
mkdir_mode=-m$mode
|
||||||
|
else
|
||||||
|
mkdir_mode=
|
||||||
|
fi
|
||||||
|
|
||||||
|
posix_mkdir=false
|
||||||
|
case $umask in
|
||||||
|
*[123567][0-7][0-7])
|
||||||
|
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||||
|
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||||
|
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||||
|
|
||||||
|
if (umask $mkdir_umask &&
|
||||||
|
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
if test -z "$dir_arg" || {
|
||||||
|
# Check for POSIX incompatibilities with -m.
|
||||||
|
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||||
|
# other-writeable bit of parent directory when it shouldn't.
|
||||||
|
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||||
|
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||||
|
case $ls_ld_tmpdir in
|
||||||
|
d????-?r-*) different_mode=700;;
|
||||||
|
d????-?--*) different_mode=755;;
|
||||||
|
*) false;;
|
||||||
|
esac &&
|
||||||
|
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||||
|
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||||
|
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
then posix_mkdir=:
|
||||||
|
fi
|
||||||
|
rmdir "$tmpdir/d" "$tmpdir"
|
||||||
|
else
|
||||||
|
# Remove any dirs left behind by ancient mkdir implementations.
|
||||||
|
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||||
|
fi
|
||||||
|
trap '' 0;;
|
||||||
|
esac;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if
|
||||||
|
$posix_mkdir && (
|
||||||
|
umask $mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||||
|
)
|
||||||
|
then :
|
||||||
|
else
|
||||||
|
|
||||||
|
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||||
|
# or it failed possibly due to a race condition. Create the
|
||||||
|
# directory the slow way, step by step, checking for races as we go.
|
||||||
|
|
||||||
|
case $dstdir in
|
||||||
|
/*) prefix=/ ;;
|
||||||
|
-*) prefix=./ ;;
|
||||||
|
*) prefix= ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $posix_glob in
|
||||||
|
'')
|
||||||
|
if (set -f) 2>/dev/null; then
|
||||||
|
posix_glob=true
|
||||||
|
else
|
||||||
|
posix_glob=false
|
||||||
|
fi ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
oIFS=$IFS
|
||||||
|
IFS=/
|
||||||
|
$posix_glob && set -f
|
||||||
|
set fnord $dstdir
|
||||||
|
shift
|
||||||
|
$posix_glob && set +f
|
||||||
|
IFS=$oIFS
|
||||||
|
|
||||||
|
prefixes=
|
||||||
|
|
||||||
|
for d
|
||||||
|
do
|
||||||
|
test -z "$d" && continue
|
||||||
|
|
||||||
|
prefix=$prefix$d
|
||||||
|
if test -d "$prefix"; then
|
||||||
|
prefixes=
|
||||||
|
else
|
||||||
|
if $posix_mkdir; then
|
||||||
|
(umask=$mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
test -d "$prefix" || exit 1
|
||||||
|
else
|
||||||
|
case $prefix in
|
||||||
|
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||||
|
*) qprefix=$prefix;;
|
||||||
|
esac
|
||||||
|
prefixes="$prefixes '$qprefix'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
prefix=$prefix/
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -n "$prefixes"; then
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
(umask $mkdir_umask &&
|
||||||
|
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||||
|
test -d "$dstdir" || exit 1
|
||||||
|
obsolete_mkdir_used=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||||
|
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||||
|
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||||
|
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||||
|
else
|
||||||
|
|
||||||
|
# Make a couple of temp file names in the proper directory.
|
||||||
|
dsttmp=$dstdir/_inst.$$_
|
||||||
|
rmtmp=$dstdir/_rm.$$_
|
||||||
|
|
||||||
|
# Trap to clean up those temp files at exit.
|
||||||
|
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||||
|
|
||||||
|
# Copy the file name to the temp name.
|
||||||
|
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||||
|
|
||||||
|
# and set any options; do chmod last to preserve setuid bits.
|
||||||
|
#
|
||||||
|
# If any of these fail, we abort the whole thing. If we want to
|
||||||
|
# ignore errors from any of these, just make sure not to ignore
|
||||||
|
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||||
|
#
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||||
|
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||||
|
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||||
|
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||||
|
|| {
|
||||||
|
# The rename failed, perhaps because mv can't rename something else
|
||||||
|
# to itself, or perhaps because mv is so ancient that it does not
|
||||||
|
# support -f.
|
||||||
|
|
||||||
|
# Now remove or move aside any old file at destination location.
|
||||||
|
# We try this two ways since rm can't unlink itself on some
|
||||||
|
# systems and the destination file might be busy for other
|
||||||
|
# reasons. In this case, the final cleanup might fail but the new
|
||||||
|
# file should still install successfully.
|
||||||
|
{
|
||||||
|
if test -f "$dst"; then
|
||||||
|
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||||
|
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||||
|
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||||
|
|| {
|
||||||
|
echo "$0: cannot unlink or rename $dst" >&2
|
||||||
|
(exit 1); exit 1
|
||||||
|
}
|
||||||
|
else
|
||||||
|
:
|
||||||
|
fi
|
||||||
|
} &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
$doit $mvcmd "$dsttmp" "$dst"
|
||||||
|
}
|
||||||
|
} || exit 1
|
||||||
|
|
||||||
|
trap '' 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-end: "$"
|
||||||
|
# End:
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
.deps
|
.deps
|
||||||
.libs
|
.libs
|
||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
*.lo
|
*.lo
|
||||||
*.la
|
*.la
|
||||||
@@ -5,12 +5,20 @@ SUBDIRS = po
|
|||||||
lib_LTLIBRARIES = libalpm.la
|
lib_LTLIBRARIES = libalpm.la
|
||||||
include_HEADERS = alpm_list.h alpm.h
|
include_HEADERS = alpm_list.h alpm.h
|
||||||
|
|
||||||
localedir = $(datadir)/locale
|
DEFS = -DLOCALEDIR=\"@localedir@\" @DEFS@
|
||||||
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
|
||||||
|
|
||||||
AM_CFLAGS = -pedantic -D_GNU_SOURCE $(CFLAGS)
|
AM_CFLAGS = -pedantic -D_GNU_SOURCE
|
||||||
|
|
||||||
EXTRA_DIST = Doxyfile
|
if ENABLE_VISIBILITY_CC
|
||||||
|
if DARWIN
|
||||||
|
AM_CFLAGS += -fvisibility=hidden
|
||||||
|
else
|
||||||
|
AM_CFLAGS += -fvisibility=internal
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if ENABLE_GNU89_INLINE_CC
|
||||||
|
AM_CFLAGS += -fgnu89-inline
|
||||||
|
endif
|
||||||
|
|
||||||
libalpm_la_SOURCES = \
|
libalpm_la_SOURCES = \
|
||||||
add.h add.c \
|
add.h add.c \
|
||||||
@@ -18,33 +26,26 @@ libalpm_la_SOURCES = \
|
|||||||
alpm_list.h alpm_list.c \
|
alpm_list.h alpm_list.c \
|
||||||
backup.h backup.c \
|
backup.h backup.c \
|
||||||
be_files.c \
|
be_files.c \
|
||||||
|
be_package.c \
|
||||||
cache.h cache.c \
|
cache.h cache.c \
|
||||||
conflict.h conflict.c \
|
conflict.h conflict.c \
|
||||||
db.h db.c \
|
db.h db.c \
|
||||||
|
delta.h delta.c \
|
||||||
deps.h deps.c \
|
deps.h deps.c \
|
||||||
error.h error.c \
|
dload.h dload.c \
|
||||||
|
error.c \
|
||||||
|
graph.h \
|
||||||
group.h group.c \
|
group.h group.c \
|
||||||
handle.h handle.c \
|
handle.h handle.c \
|
||||||
log.h log.c \
|
log.h log.c \
|
||||||
md5.h md5.c \
|
md5.h md5.c \
|
||||||
md5driver.c \
|
|
||||||
package.h package.c \
|
package.h package.c \
|
||||||
provide.h provide.c \
|
|
||||||
remove.h remove.c \
|
remove.h remove.c \
|
||||||
server.h server.c \
|
|
||||||
sha1.h sha1.c \
|
|
||||||
sync.h sync.c \
|
sync.h sync.c \
|
||||||
trans.h trans.c \
|
trans.h trans.c \
|
||||||
util.h util.c \
|
util.h util.c
|
||||||
versioncmp.h versioncmp.c
|
|
||||||
|
|
||||||
libalpm_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_INFO)
|
libalpm_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_INFO)
|
||||||
libalpm_la_LIBADD = -larchive -ldownload -lm
|
libalpm_la_LIBADD = $(LTLIBINTL)
|
||||||
|
|
||||||
if HAS_DOXYGEN
|
# vim:set ts=2 sw=2 noet:
|
||||||
all: doxygen.in
|
|
||||||
|
|
||||||
doxygen.in:
|
|
||||||
doxygen $(srcdir)/Doxyfile
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|||||||
1437
lib/libalpm/add.c
1437
lib/libalpm/add.c
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* add.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -14,9 +14,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
#ifndef _ALPM_ADD_H
|
#ifndef _ALPM_ADD_H
|
||||||
#define _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
|
* alpm.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -17,9 +17,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
#ifndef _ALPM_H
|
#ifndef _ALPM_H
|
||||||
#define _ALPM_H
|
#define _ALPM_H
|
||||||
@@ -28,43 +26,40 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <sys/types.h> /* for off_t */
|
||||||
#include <time.h> /* for time_t */
|
#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
|
* 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
|
* Structures
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct __alpm_list_t alpm_list_t;
|
|
||||||
|
|
||||||
typedef struct __pmdb_t pmdb_t;
|
typedef struct __pmdb_t pmdb_t;
|
||||||
typedef struct __pmpkg_t pmpkg_t;
|
typedef struct __pmpkg_t pmpkg_t;
|
||||||
|
typedef struct __pmdelta_t pmdelta_t;
|
||||||
typedef struct __pmgrp_t pmgrp_t;
|
typedef struct __pmgrp_t pmgrp_t;
|
||||||
typedef struct __pmserver_t pmserver_t;
|
|
||||||
typedef struct __pmtrans_t pmtrans_t;
|
typedef struct __pmtrans_t pmtrans_t;
|
||||||
typedef struct __pmsyncpkg_t pmsyncpkg_t;
|
typedef struct __pmsyncpkg_t pmsyncpkg_t;
|
||||||
typedef struct __pmdepend_t pmdepend_t;
|
typedef struct __pmdepend_t pmdepend_t;
|
||||||
typedef struct __pmdepmissing_t pmdepmissing_t;
|
typedef struct __pmdepmissing_t pmdepmissing_t;
|
||||||
typedef struct __pmconflict_t pmconflict_t;
|
typedef struct __pmconflict_t pmconflict_t;
|
||||||
|
typedef struct __pmfileconflict_t pmfileconflict_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Library
|
* Library
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int alpm_initialize();
|
int alpm_initialize(void);
|
||||||
int alpm_release(void);
|
int alpm_release(void);
|
||||||
|
const char *alpm_version(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Logging facilities
|
* Logging facilities
|
||||||
@@ -75,83 +70,84 @@ typedef enum _pmloglevel_t {
|
|||||||
PM_LOG_ERROR = 0x01,
|
PM_LOG_ERROR = 0x01,
|
||||||
PM_LOG_WARNING = 0x02,
|
PM_LOG_WARNING = 0x02,
|
||||||
PM_LOG_DEBUG = 0x04,
|
PM_LOG_DEBUG = 0x04,
|
||||||
PM_LOG_DOWNLOAD = 0x08,
|
PM_LOG_FUNCTION = 0x08
|
||||||
PM_LOG_FUNCTION = 0x10
|
|
||||||
} pmloglevel_t;
|
} 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, ...);
|
int alpm_logaction(char *fmt, ...);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Downloading
|
* Downloading
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef void (*alpm_cb_download)(const char *filename, int xfered, int total);
|
typedef void (*alpm_cb_download)(const char *filename,
|
||||||
|
off_t xfered, off_t total);
|
||||||
|
typedef void (*alpm_cb_totaldl)(off_t total);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Options
|
* Options
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PM_DLFNM_LEN 22
|
|
||||||
|
|
||||||
alpm_cb_log alpm_option_get_logcb();
|
alpm_cb_log alpm_option_get_logcb();
|
||||||
void alpm_option_set_logcb(alpm_cb_log cb);
|
void alpm_option_set_logcb(alpm_cb_log cb);
|
||||||
|
|
||||||
alpm_cb_download alpm_option_get_dlcb();
|
alpm_cb_download alpm_option_get_dlcb();
|
||||||
void alpm_option_set_dlcb(alpm_cb_download cb);
|
void alpm_option_set_dlcb(alpm_cb_download cb);
|
||||||
|
|
||||||
unsigned short alpm_option_get_logmask();
|
alpm_cb_totaldl alpm_option_get_totaldlcb();
|
||||||
void alpm_option_set_logmask(unsigned short mask);
|
void alpm_option_set_totaldlcb(alpm_cb_totaldl cb);
|
||||||
|
|
||||||
const char *alpm_option_get_root();
|
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();
|
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();
|
alpm_list_t *alpm_option_get_cachedirs();
|
||||||
void alpm_option_set_cachedir(const char *cachedir);
|
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();
|
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();
|
unsigned short alpm_option_get_usesyslog();
|
||||||
void alpm_option_set_usesyslog(unsigned short usesyslog);
|
void alpm_option_set_usesyslog(unsigned short usesyslog);
|
||||||
|
|
||||||
alpm_list_t *alpm_option_get_noupgrades();
|
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);
|
void alpm_option_set_noupgrades(alpm_list_t *noupgrade);
|
||||||
|
int alpm_option_remove_noupgrade(const char *pkg);
|
||||||
|
|
||||||
alpm_list_t *alpm_option_get_noextracts();
|
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);
|
void alpm_option_set_noextracts(alpm_list_t *noextract);
|
||||||
|
int alpm_option_remove_noextract(const char *pkg);
|
||||||
|
|
||||||
alpm_list_t *alpm_option_get_ignorepkgs();
|
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);
|
void alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs);
|
||||||
|
int alpm_option_remove_ignorepkg(const char *pkg);
|
||||||
|
|
||||||
alpm_list_t *alpm_option_get_holdpkgs();
|
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);
|
void alpm_option_set_holdpkgs(alpm_list_t *holdpkgs);
|
||||||
|
int alpm_option_remove_holdpkg(const char *pkg);
|
||||||
|
|
||||||
time_t alpm_option_get_upgradedelay();
|
alpm_list_t *alpm_option_get_ignoregrps();
|
||||||
void alpm_option_set_upgradedelay(time_t delay);
|
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();
|
const char *alpm_option_get_xfercommand();
|
||||||
void alpm_option_set_xfercommand(const char *cmd);
|
void alpm_option_set_xfercommand(const char *cmd);
|
||||||
|
|
||||||
unsigned short alpm_option_get_nopassiveftp();
|
unsigned short alpm_option_get_nopassiveftp();
|
||||||
void alpm_option_set_nopassiveftp(unsigned short nopasv);
|
void alpm_option_set_nopassiveftp(unsigned short nopasv);
|
||||||
|
void alpm_option_set_usedelta(unsigned short usedelta);
|
||||||
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);
|
|
||||||
|
|
||||||
pmdb_t *alpm_option_get_localdb();
|
pmdb_t *alpm_option_get_localdb();
|
||||||
alpm_list_t *alpm_option_get_syncdbs();
|
alpm_list_t *alpm_option_get_syncdbs();
|
||||||
@@ -160,14 +156,14 @@ alpm_list_t *alpm_option_get_syncdbs();
|
|||||||
* Databases
|
* Databases
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Database registration callback */
|
/* Preferred interfaces db_register_local and db_register_sync */
|
||||||
typedef void (*alpm_cb_db_register)(const char *, pmdb_t *);
|
pmdb_t *alpm_db_register_local(void);
|
||||||
|
pmdb_t *alpm_db_register_sync(const char *treename);
|
||||||
pmdb_t *alpm_db_register(char *treename);
|
|
||||||
int alpm_db_unregister(pmdb_t *db);
|
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_name(const pmdb_t *db);
|
||||||
const char *alpm_db_get_url(pmdb_t *db);
|
const char *alpm_db_get_url(const pmdb_t *db);
|
||||||
|
|
||||||
int alpm_db_setserver(pmdb_t *db, const char *url);
|
int alpm_db_setserver(pmdb_t *db, const char *url);
|
||||||
|
|
||||||
@@ -175,11 +171,10 @@ int alpm_db_update(int level, pmdb_t *db);
|
|||||||
|
|
||||||
pmpkg_t *alpm_db_get_pkg(pmdb_t *db, const char *name);
|
pmpkg_t *alpm_db_get_pkg(pmdb_t *db, const char *name);
|
||||||
alpm_list_t *alpm_db_getpkgcache(pmdb_t *db);
|
alpm_list_t *alpm_db_getpkgcache(pmdb_t *db);
|
||||||
alpm_list_t *alpm_db_whatprovides(pmdb_t *db, const char *name);
|
|
||||||
|
|
||||||
pmgrp_t *alpm_db_readgrp(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_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
|
* Packages
|
||||||
@@ -193,71 +188,72 @@ typedef enum _pmpkgreason_t {
|
|||||||
PM_PKG_REASON_DEPEND = 1 /* installed as a dependency for another package */
|
PM_PKG_REASON_DEPEND = 1 /* installed as a dependency for another package */
|
||||||
} pmpkgreason_t;
|
} pmpkgreason_t;
|
||||||
|
|
||||||
/* package name formats */
|
int alpm_pkg_load(const char *filename, unsigned short full, pmpkg_t **pkg);
|
||||||
/*
|
|
||||||
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_free(pmpkg_t *pkg);
|
int alpm_pkg_free(pmpkg_t *pkg);
|
||||||
int alpm_pkg_checkmd5sum(pmpkg_t *pkg);
|
int alpm_pkg_checkmd5sum(pmpkg_t *pkg);
|
||||||
int alpm_pkg_checksha1sum(pmpkg_t *pkg);
|
char *alpm_fetch_pkgurl(const char *url);
|
||||||
char *alpm_fetch_pkgurl(char *url);
|
int alpm_pkg_vercmp(const char *a, const char *b);
|
||||||
int alpm_parse_config(char *file, alpm_cb_db_register callback,
|
alpm_list_t *alpm_pkg_compute_requiredby(pmpkg_t *pkg);
|
||||||
const char *this_section);
|
|
||||||
int alpm_pkg_vercmp(const char *ver1, const char *ver2);
|
|
||||||
char *alpm_pkg_name_hasarch(char *pkgname);
|
|
||||||
|
|
||||||
const char *alpm_pkg_get_filename(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_name(pmpkg_t *pkg);
|
||||||
const char *alpm_pkg_get_version(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_desc(pmpkg_t *pkg);
|
||||||
const char *alpm_pkg_get_url(pmpkg_t *pkg);
|
const char *alpm_pkg_get_url(pmpkg_t *pkg);
|
||||||
const char *alpm_pkg_get_builddate(pmpkg_t *pkg);
|
time_t alpm_pkg_get_builddate(pmpkg_t *pkg);
|
||||||
const char *alpm_pkg_get_buildtype(pmpkg_t *pkg);
|
time_t alpm_pkg_get_installdate(pmpkg_t *pkg);
|
||||||
const char *alpm_pkg_get_installdate(pmpkg_t *pkg);
|
|
||||||
const char *alpm_pkg_get_packager(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_md5sum(pmpkg_t *pkg);
|
||||||
const char *alpm_pkg_get_sha1sum(pmpkg_t *pkg);
|
|
||||||
const char *alpm_pkg_get_arch(pmpkg_t *pkg);
|
const char *alpm_pkg_get_arch(pmpkg_t *pkg);
|
||||||
unsigned long alpm_pkg_get_size(pmpkg_t *pkg);
|
off_t alpm_pkg_get_size(pmpkg_t *pkg);
|
||||||
unsigned long alpm_pkg_get_isize(pmpkg_t *pkg);
|
off_t alpm_pkg_get_isize(pmpkg_t *pkg);
|
||||||
pmpkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg);
|
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_licenses(pmpkg_t *pkg);
|
||||||
alpm_list_t *alpm_pkg_get_groups(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_depends(pmpkg_t *pkg);
|
||||||
alpm_list_t *alpm_pkg_get_removes(pmpkg_t *pkg);
|
alpm_list_t *alpm_pkg_get_optdepends(pmpkg_t *pkg);
|
||||||
alpm_list_t *alpm_pkg_get_requiredby(pmpkg_t *pkg);
|
|
||||||
alpm_list_t *alpm_pkg_get_conflicts(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_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_replaces(pmpkg_t *pkg);
|
||||||
alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg);
|
alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg);
|
||||||
alpm_list_t *alpm_pkg_get_backup(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 short alpm_pkg_has_scriptlet(pmpkg_t *pkg);
|
||||||
|
|
||||||
|
off_t alpm_pkg_download_size(pmpkg_t *newpkg);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Deltas
|
||||||
|
*/
|
||||||
|
|
||||||
|
const char *alpm_delta_get_from(pmdelta_t *delta);
|
||||||
|
const char *alpm_delta_get_from_md5sum(pmdelta_t *delta);
|
||||||
|
const char *alpm_delta_get_to(pmdelta_t *delta);
|
||||||
|
const char *alpm_delta_get_to_md5sum(pmdelta_t *delta);
|
||||||
|
const char *alpm_delta_get_filename(pmdelta_t *delta);
|
||||||
|
const char *alpm_delta_get_md5sum(pmdelta_t *delta);
|
||||||
|
off_t alpm_delta_get_size(pmdelta_t *delta);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Groups
|
* Groups
|
||||||
*/
|
*/
|
||||||
const char *alpm_grp_get_name(pmgrp_t *grp);
|
const char *alpm_grp_get_name(const pmgrp_t *grp);
|
||||||
alpm_list_t *alpm_grp_get_pkgs(pmgrp_t *grp);
|
alpm_list_t *alpm_grp_get_pkgs(const pmgrp_t *grp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sync
|
* Sync
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Types */
|
pmpkg_t *alpm_sync_get_pkg(const pmsyncpkg_t *sync);
|
||||||
typedef enum _pmsynctype_t {
|
alpm_list_t *alpm_sync_get_removes(const pmsyncpkg_t *sync);
|
||||||
PM_SYNC_TYPE_REPLACE = 1,
|
pmpkg_t *alpm_sync_newversion(pmpkg_t *pkg, alpm_list_t *dbs_sync);
|
||||||
PM_SYNC_TYPE_UPGRADE,
|
int alpm_sync_sysupgrade(pmdb_t *db_local,
|
||||||
PM_SYNC_TYPE_DEPEND
|
alpm_list_t *dbs_sync, alpm_list_t **syncpkgs);
|
||||||
} 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);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Transactions
|
* Transactions
|
||||||
@@ -265,9 +261,9 @@ void *alpm_sync_get_data(pmsyncpkg_t *sync);
|
|||||||
|
|
||||||
/* Types */
|
/* Types */
|
||||||
typedef enum _pmtranstype_t {
|
typedef enum _pmtranstype_t {
|
||||||
PM_TRANS_TYPE_ADD = 1,
|
PM_TRANS_TYPE_UPGRADE = 1,
|
||||||
PM_TRANS_TYPE_REMOVE,
|
PM_TRANS_TYPE_REMOVE,
|
||||||
PM_TRANS_TYPE_UPGRADE,
|
PM_TRANS_TYPE_REMOVEUPGRADE,
|
||||||
PM_TRANS_TYPE_SYNC
|
PM_TRANS_TYPE_SYNC
|
||||||
} pmtranstype_t;
|
} pmtranstype_t;
|
||||||
|
|
||||||
@@ -276,45 +272,107 @@ typedef enum _pmtransflag_t {
|
|||||||
PM_TRANS_FLAG_NODEPS = 0x01,
|
PM_TRANS_FLAG_NODEPS = 0x01,
|
||||||
PM_TRANS_FLAG_FORCE = 0x02,
|
PM_TRANS_FLAG_FORCE = 0x02,
|
||||||
PM_TRANS_FLAG_NOSAVE = 0x04,
|
PM_TRANS_FLAG_NOSAVE = 0x04,
|
||||||
PM_TRANS_FLAG_FRESHEN = 0x08,
|
/* 0x08 flag can go here */
|
||||||
PM_TRANS_FLAG_CASCADE = 0x10,
|
PM_TRANS_FLAG_CASCADE = 0x10,
|
||||||
PM_TRANS_FLAG_RECURSE = 0x20,
|
PM_TRANS_FLAG_RECURSE = 0x20,
|
||||||
PM_TRANS_FLAG_DBONLY = 0x40,
|
PM_TRANS_FLAG_DBONLY = 0x40,
|
||||||
PM_TRANS_FLAG_DEPENDSONLY = 0x80,
|
/* 0x80 flag can go here */
|
||||||
PM_TRANS_FLAG_ALLDEPS = 0x100,
|
PM_TRANS_FLAG_ALLDEPS = 0x100,
|
||||||
PM_TRANS_FLAG_DOWNLOADONLY = 0x200,
|
PM_TRANS_FLAG_DOWNLOADONLY = 0x200,
|
||||||
PM_TRANS_FLAG_NOSCRIPTLET = 0x400,
|
PM_TRANS_FLAG_NOSCRIPTLET = 0x400,
|
||||||
PM_TRANS_FLAG_NOCONFLICTS = 0x800,
|
PM_TRANS_FLAG_NOCONFLICTS = 0x800,
|
||||||
PM_TRANS_FLAG_PRINTURIS = 0x1000
|
PM_TRANS_FLAG_PRINTURIS = 0x1000,
|
||||||
|
PM_TRANS_FLAG_NEEDED = 0x2000,
|
||||||
|
PM_TRANS_FLAG_ALLEXPLICIT = 0x4000,
|
||||||
|
PM_TRANS_FLAG_UNNEEDED = 0x8000,
|
||||||
|
PM_TRANS_FLAG_RECURSEALL = 0x10000
|
||||||
} pmtransflag_t;
|
} pmtransflag_t;
|
||||||
|
|
||||||
/* Transaction Events */
|
/**
|
||||||
|
* @addtogroup alpm_trans
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @brief Transaction events.
|
||||||
|
* NULL parameters are passed to in all events unless specified otherwise.
|
||||||
|
*/
|
||||||
typedef enum _pmtransevt_t {
|
typedef enum _pmtransevt_t {
|
||||||
|
/** Dependencies will be computed for a package. */
|
||||||
PM_TRANS_EVT_CHECKDEPS_START = 1,
|
PM_TRANS_EVT_CHECKDEPS_START = 1,
|
||||||
|
/** Dependencies were computed for a package. */
|
||||||
PM_TRANS_EVT_CHECKDEPS_DONE,
|
PM_TRANS_EVT_CHECKDEPS_DONE,
|
||||||
|
/** File conflicts will be computed for a package. */
|
||||||
PM_TRANS_EVT_FILECONFLICTS_START,
|
PM_TRANS_EVT_FILECONFLICTS_START,
|
||||||
|
/** File conflicts were computed for a package. */
|
||||||
PM_TRANS_EVT_FILECONFLICTS_DONE,
|
PM_TRANS_EVT_FILECONFLICTS_DONE,
|
||||||
PM_TRANS_EVT_CLEANUP_START,
|
/** Dependencies will be resolved for target package. */
|
||||||
PM_TRANS_EVT_CLEANUP_DONE,
|
|
||||||
PM_TRANS_EVT_RESOLVEDEPS_START,
|
PM_TRANS_EVT_RESOLVEDEPS_START,
|
||||||
|
/** Dependencies were resolved for target package. */
|
||||||
PM_TRANS_EVT_RESOLVEDEPS_DONE,
|
PM_TRANS_EVT_RESOLVEDEPS_DONE,
|
||||||
|
/** Inter-conflicts will be checked for target package. */
|
||||||
PM_TRANS_EVT_INTERCONFLICTS_START,
|
PM_TRANS_EVT_INTERCONFLICTS_START,
|
||||||
|
/** Inter-conflicts were checked for target package. */
|
||||||
PM_TRANS_EVT_INTERCONFLICTS_DONE,
|
PM_TRANS_EVT_INTERCONFLICTS_DONE,
|
||||||
|
/** Package will be installed.
|
||||||
|
* A pointer to the target package is passed to the callback.
|
||||||
|
*/
|
||||||
PM_TRANS_EVT_ADD_START,
|
PM_TRANS_EVT_ADD_START,
|
||||||
|
/** Package was installed.
|
||||||
|
* A pointer to the new package is passed to the callback.
|
||||||
|
*/
|
||||||
PM_TRANS_EVT_ADD_DONE,
|
PM_TRANS_EVT_ADD_DONE,
|
||||||
|
/** Package will be removed.
|
||||||
|
* A pointer to the target package is passed to the callback.
|
||||||
|
*/
|
||||||
PM_TRANS_EVT_REMOVE_START,
|
PM_TRANS_EVT_REMOVE_START,
|
||||||
|
/** Package was removed.
|
||||||
|
* A pointer to the removed package is passed to the callback.
|
||||||
|
*/
|
||||||
PM_TRANS_EVT_REMOVE_DONE,
|
PM_TRANS_EVT_REMOVE_DONE,
|
||||||
|
/** Package will be upgraded.
|
||||||
|
* A pointer to the upgraded package is passed to the callback.
|
||||||
|
*/
|
||||||
PM_TRANS_EVT_UPGRADE_START,
|
PM_TRANS_EVT_UPGRADE_START,
|
||||||
|
/** Package was upgraded.
|
||||||
|
* A pointer to the new package, and a pointer to the old package is passed
|
||||||
|
* to the callback, respectively.
|
||||||
|
*/
|
||||||
PM_TRANS_EVT_UPGRADE_DONE,
|
PM_TRANS_EVT_UPGRADE_DONE,
|
||||||
PM_TRANS_EVT_EXTRACT_DONE,
|
/** Target package's integrity will be checked. */
|
||||||
PM_TRANS_EVT_INTEGRITY_START,
|
PM_TRANS_EVT_INTEGRITY_START,
|
||||||
|
/** Target package's integrity was checked. */
|
||||||
PM_TRANS_EVT_INTEGRITY_DONE,
|
PM_TRANS_EVT_INTEGRITY_DONE,
|
||||||
|
/** Target deltas's integrity will be checked. */
|
||||||
|
PM_TRANS_EVT_DELTA_INTEGRITY_START,
|
||||||
|
/** Target delta's integrity was checked. */
|
||||||
|
PM_TRANS_EVT_DELTA_INTEGRITY_DONE,
|
||||||
|
/** Deltas will be applied to packages. */
|
||||||
|
PM_TRANS_EVT_DELTA_PATCHES_START,
|
||||||
|
/** Deltas were applied to packages. */
|
||||||
|
PM_TRANS_EVT_DELTA_PATCHES_DONE,
|
||||||
|
/** Delta patch will be applied to target package.
|
||||||
|
* The filename of the package and the filename of the patch is passed to the
|
||||||
|
* callback.
|
||||||
|
*/
|
||||||
|
PM_TRANS_EVT_DELTA_PATCH_START,
|
||||||
|
/** Delta patch was applied to target package. */
|
||||||
|
PM_TRANS_EVT_DELTA_PATCH_DONE,
|
||||||
|
/** Delta patch failed to apply to target package. */
|
||||||
|
PM_TRANS_EVT_DELTA_PATCH_FAILED,
|
||||||
|
/** Scriptlet has printed information.
|
||||||
|
* A line of text is passed to the callback.
|
||||||
|
*/
|
||||||
PM_TRANS_EVT_SCRIPTLET_INFO,
|
PM_TRANS_EVT_SCRIPTLET_INFO,
|
||||||
PM_TRANS_EVT_SCRIPTLET_START,
|
/** Print URI.
|
||||||
PM_TRANS_EVT_SCRIPTLET_DONE,
|
* The database's URI and the package's filename are passed to the callback.
|
||||||
|
*/
|
||||||
PM_TRANS_EVT_PRINTURI,
|
PM_TRANS_EVT_PRINTURI,
|
||||||
|
/** Files will be downloaded from a repository.
|
||||||
|
* The repository's tree name is passed to the callback.
|
||||||
|
*/
|
||||||
PM_TRANS_EVT_RETRIEVE_START,
|
PM_TRANS_EVT_RETRIEVE_START,
|
||||||
} pmtransevt_t;
|
} pmtransevt_t;
|
||||||
|
/*@}*/
|
||||||
|
|
||||||
/* Transaction Conversations (ie, questions) */
|
/* Transaction Conversations (ie, questions) */
|
||||||
typedef enum _pmtransconv_t {
|
typedef enum _pmtransconv_t {
|
||||||
@@ -323,7 +381,7 @@ typedef enum _pmtransconv_t {
|
|||||||
PM_TRANS_CONV_CONFLICT_PKG = 0x04,
|
PM_TRANS_CONV_CONFLICT_PKG = 0x04,
|
||||||
PM_TRANS_CONV_CORRUPTED_PKG = 0x08,
|
PM_TRANS_CONV_CORRUPTED_PKG = 0x08,
|
||||||
PM_TRANS_CONV_LOCAL_NEWER = 0x10,
|
PM_TRANS_CONV_LOCAL_NEWER = 0x10,
|
||||||
PM_TRANS_CONV_LOCAL_UPTODATE = 0x20,
|
/* 0x20 flag can go here */
|
||||||
PM_TRANS_CONV_REMOVE_HOLDPKG = 0x40
|
PM_TRANS_CONV_REMOVE_HOLDPKG = 0x40
|
||||||
} pmtransconv_t;
|
} pmtransconv_t;
|
||||||
|
|
||||||
@@ -347,15 +405,15 @@ typedef void (*alpm_trans_cb_progress)(pmtransprog_t, const char *, int, int, in
|
|||||||
|
|
||||||
pmtranstype_t alpm_trans_get_type();
|
pmtranstype_t alpm_trans_get_type();
|
||||||
unsigned int alpm_trans_get_flags();
|
unsigned int alpm_trans_get_flags();
|
||||||
alpm_list_t * alpm_trans_get_targets();
|
|
||||||
alpm_list_t * alpm_trans_get_pkgs();
|
alpm_list_t * alpm_trans_get_pkgs();
|
||||||
int alpm_trans_init(pmtranstype_t type, unsigned int flags,
|
int alpm_trans_init(pmtranstype_t type, pmtransflag_t flags,
|
||||||
alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv,
|
alpm_trans_cb_event cb_event, alpm_trans_cb_conv conv,
|
||||||
alpm_trans_cb_progress cb_progress);
|
alpm_trans_cb_progress cb_progress);
|
||||||
int alpm_trans_sysupgrade(void);
|
int alpm_trans_sysupgrade(void);
|
||||||
int alpm_trans_addtarget(char *target);
|
int alpm_trans_addtarget(char *target);
|
||||||
int alpm_trans_prepare(alpm_list_t **data);
|
int alpm_trans_prepare(alpm_list_t **data);
|
||||||
int alpm_trans_commit(alpm_list_t **data);
|
int alpm_trans_commit(alpm_list_t **data);
|
||||||
|
int alpm_trans_interrupt(void);
|
||||||
int alpm_trans_release(void);
|
int alpm_trans_release(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -366,42 +424,50 @@ typedef enum _pmdepmod_t {
|
|||||||
PM_DEP_MOD_ANY = 1,
|
PM_DEP_MOD_ANY = 1,
|
||||||
PM_DEP_MOD_EQ,
|
PM_DEP_MOD_EQ,
|
||||||
PM_DEP_MOD_GE,
|
PM_DEP_MOD_GE,
|
||||||
PM_DEP_MOD_LE
|
PM_DEP_MOD_LE,
|
||||||
|
PM_DEP_MOD_GT,
|
||||||
|
PM_DEP_MOD_LT
|
||||||
} pmdepmod_t;
|
} pmdepmod_t;
|
||||||
|
|
||||||
typedef enum _pmdeptype_t {
|
int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
|
||||||
PM_DEP_TYPE_DEPEND = 1,
|
alpm_list_t *alpm_checkdeps(pmdb_t *db, int reversedeps,
|
||||||
PM_DEP_TYPE_REQUIRED,
|
alpm_list_t *remove, alpm_list_t *upgrade);
|
||||||
PM_DEP_TYPE_CONFLICT
|
alpm_list_t *alpm_deptest(pmdb_t *db, alpm_list_t *targets);
|
||||||
} pmdeptype_t;
|
|
||||||
|
|
||||||
const char *alpm_dep_get_target(pmdepmissing_t *miss);
|
const char *alpm_miss_get_target(const pmdepmissing_t *miss);
|
||||||
pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss);
|
pmdepend_t *alpm_miss_get_dep(pmdepmissing_t *miss);
|
||||||
pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss);
|
const char *alpm_miss_get_causingpkg(const pmdepmissing_t *miss);
|
||||||
const char *alpm_dep_get_name(pmdepmissing_t *miss);
|
|
||||||
const char *alpm_dep_get_version(pmdepmissing_t *miss);
|
alpm_list_t *alpm_checkdbconflicts(pmdb_t *db_local);
|
||||||
|
|
||||||
|
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
|
* File conflicts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef enum _pmconflicttype_t {
|
typedef enum _pmfileconflicttype_t {
|
||||||
PM_CONFLICT_TYPE_TARGET = 1,
|
PM_FILECONFLICT_TARGET = 1,
|
||||||
PM_CONFLICT_TYPE_FILE
|
PM_FILECONFLICT_FILESYSTEM
|
||||||
} pmconflicttype_t;
|
} pmfileconflicttype_t;
|
||||||
|
|
||||||
const char *alpm_conflict_get_target(pmconflict_t *conflict);
|
const char *alpm_fileconflict_get_target(pmfileconflict_t *conflict);
|
||||||
pmconflicttype_t alpm_conflict_get_type(pmconflict_t *conflict);
|
pmfileconflicttype_t alpm_fileconflict_get_type(pmfileconflict_t *conflict);
|
||||||
const char *alpm_conflict_get_file(pmconflict_t *conflict);
|
const char *alpm_fileconflict_get_file(pmfileconflict_t *conflict);
|
||||||
const char *alpm_conflict_get_ctarget(pmconflict_t *conflict);
|
const char *alpm_fileconflict_get_ctarget(pmfileconflict_t *conflict);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helpers
|
* Helpers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* md5sums */
|
/* checksums */
|
||||||
char *alpm_get_md5sum(char *name);
|
char *alpm_get_md5sum(const char *name);
|
||||||
char *alpm_get_sha1sum(char *name);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Errors
|
* Errors
|
||||||
@@ -411,6 +477,7 @@ enum _pmerrno_t {
|
|||||||
PM_ERR_SYSTEM,
|
PM_ERR_SYSTEM,
|
||||||
PM_ERR_BADPERMS,
|
PM_ERR_BADPERMS,
|
||||||
PM_ERR_NOT_A_FILE,
|
PM_ERR_NOT_A_FILE,
|
||||||
|
PM_ERR_NOT_A_DIR,
|
||||||
PM_ERR_WRONG_ARGS,
|
PM_ERR_WRONG_ARGS,
|
||||||
/* Interface */
|
/* Interface */
|
||||||
PM_ERR_HANDLE_NULL,
|
PM_ERR_HANDLE_NULL,
|
||||||
@@ -426,12 +493,6 @@ enum _pmerrno_t {
|
|||||||
PM_ERR_DB_REMOVE,
|
PM_ERR_DB_REMOVE,
|
||||||
/* Servers */
|
/* Servers */
|
||||||
PM_ERR_SERVER_BAD_URL,
|
PM_ERR_SERVER_BAD_URL,
|
||||||
/* Configuration */
|
|
||||||
PM_ERR_OPT_LOGFILE,
|
|
||||||
PM_ERR_OPT_DBPATH,
|
|
||||||
PM_ERR_OPT_LOCALDB,
|
|
||||||
PM_ERR_OPT_SYNCDB,
|
|
||||||
PM_ERR_OPT_USESYSLOG,
|
|
||||||
/* Transactions */
|
/* Transactions */
|
||||||
PM_ERR_TRANS_NOT_NULL,
|
PM_ERR_TRANS_NOT_NULL,
|
||||||
PM_ERR_TRANS_NULL,
|
PM_ERR_TRANS_NULL,
|
||||||
@@ -447,12 +508,13 @@ enum _pmerrno_t {
|
|||||||
PM_ERR_PKG_INVALID,
|
PM_ERR_PKG_INVALID,
|
||||||
PM_ERR_PKG_OPEN,
|
PM_ERR_PKG_OPEN,
|
||||||
PM_ERR_PKG_LOAD,
|
PM_ERR_PKG_LOAD,
|
||||||
PM_ERR_PKG_INSTALLED,
|
|
||||||
PM_ERR_PKG_CANT_FRESH,
|
PM_ERR_PKG_CANT_FRESH,
|
||||||
PM_ERR_PKG_CANT_REMOVE,
|
PM_ERR_PKG_CANT_REMOVE,
|
||||||
PM_ERR_PKG_INVALID_NAME,
|
PM_ERR_PKG_INVALID_NAME,
|
||||||
PM_ERR_PKG_CORRUPTED,
|
|
||||||
PM_ERR_PKG_REPO_NOT_FOUND,
|
PM_ERR_PKG_REPO_NOT_FOUND,
|
||||||
|
/* Deltas */
|
||||||
|
PM_ERR_DLT_INVALID,
|
||||||
|
PM_ERR_DLT_PATCHFAILED,
|
||||||
/* Groups */
|
/* Groups */
|
||||||
PM_ERR_GRP_NOT_FOUND,
|
PM_ERR_GRP_NOT_FOUND,
|
||||||
/* Dependencies */
|
/* Dependencies */
|
||||||
@@ -462,27 +524,20 @@ enum _pmerrno_t {
|
|||||||
/* Misc */
|
/* Misc */
|
||||||
PM_ERR_USER_ABORT,
|
PM_ERR_USER_ABORT,
|
||||||
PM_ERR_INTERNAL_ERROR,
|
PM_ERR_INTERNAL_ERROR,
|
||||||
PM_ERR_LIBARCHIVE_ERROR,
|
|
||||||
PM_ERR_DISK_FULL,
|
|
||||||
PM_ERR_DB_SYNC,
|
PM_ERR_DB_SYNC,
|
||||||
PM_ERR_RETRIEVE,
|
PM_ERR_RETRIEVE,
|
||||||
PM_ERR_PKG_HOLD,
|
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,
|
PM_ERR_INVALID_REGEX,
|
||||||
/* Downloading */
|
/* External library errors */
|
||||||
PM_ERR_CONNECT_FAILED,
|
PM_ERR_LIBARCHIVE,
|
||||||
PM_ERR_FORK_FAILED
|
PM_ERR_LIBDOWNLOAD,
|
||||||
|
PM_ERR_EXTERNAL_DOWNLOAD
|
||||||
};
|
};
|
||||||
|
|
||||||
extern enum _pmerrno_t pm_errno;
|
extern enum _pmerrno_t pm_errno;
|
||||||
|
|
||||||
char *alpm_strerror(int err);
|
const char *alpm_strerror(int err);
|
||||||
|
const char *alpm_strerrorlast(void);
|
||||||
alpm_list_t *alpm_get_upgrades();
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* alpm_list.c
|
* alpm_list.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -14,43 +14,36 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
|
/* libalpm */
|
||||||
#include "alpm_list.h"
|
#include "alpm_list.h"
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
/** \defgroup alpm_list functions */
|
/* check exported library symbols with: nm -C -D <lib> */
|
||||||
/*\@{*/
|
#define SYMEXPORT __attribute__((visibility("default")))
|
||||||
|
#define SYMHIDDEN __attribute__((visibility("internal")))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 */
|
/* Allocation */
|
||||||
|
|
||||||
/** Allocate a new alpm_list_t
|
/**
|
||||||
* @return a new alpm_list_t item, or NULL on failure
|
* @brief Free a list, but not the contained data.
|
||||||
*/
|
*
|
||||||
alpm_list_t *alpm_list_new()
|
* @param list the list to free
|
||||||
{
|
|
||||||
alpm_list_t *list = NULL;
|
|
||||||
|
|
||||||
list = (alpm_list_t *)malloc(sizeof(alpm_list_t));
|
|
||||||
if(list) {
|
|
||||||
list->data = NULL;
|
|
||||||
list->prev = NULL;
|
|
||||||
list->next = NULL;
|
|
||||||
}
|
|
||||||
return(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Free a list, but not the contained data
|
|
||||||
* @param list the list to free
|
|
||||||
*/
|
*/
|
||||||
void SYMEXPORT alpm_list_free(alpm_list_t *list)
|
void SYMEXPORT alpm_list_free(alpm_list_t *list)
|
||||||
{
|
{
|
||||||
@@ -63,9 +56,11 @@ void SYMEXPORT alpm_list_free(alpm_list_t *list)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Free the internal data of a list structure
|
/**
|
||||||
* @param list the list to free
|
* @brief Free the internal data of a list structure.
|
||||||
* @param fn a free function for the internal data
|
*
|
||||||
|
* @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)
|
void SYMEXPORT alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
|
||||||
{
|
{
|
||||||
@@ -82,54 +77,60 @@ void SYMEXPORT alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn)
|
|||||||
|
|
||||||
/* Mutators */
|
/* Mutators */
|
||||||
|
|
||||||
/** Add a new item to the list
|
/**
|
||||||
* @param list the list to add to
|
* @brief Add a new item to the end of the list.
|
||||||
* @param data the new item to be added to the list
|
*
|
||||||
* @return the resultant list, or NULL on failure
|
* @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)
|
alpm_list_t SYMEXPORT *alpm_list_add(alpm_list_t *list, void *data)
|
||||||
{
|
{
|
||||||
alpm_list_t *ptr, *lp;
|
alpm_list_t *ptr, *lp;
|
||||||
|
|
||||||
ptr = list;
|
ptr = calloc(1, sizeof(alpm_list_t));
|
||||||
if(ptr == NULL) {
|
if(ptr == NULL) {
|
||||||
ptr = alpm_list_new();
|
return(list);
|
||||||
if(ptr == NULL) {
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lp = alpm_list_last(ptr);
|
ptr->data = data;
|
||||||
if(lp == ptr && lp->data == NULL) {
|
ptr->next = NULL;
|
||||||
/* nada */
|
|
||||||
} else {
|
/* Special case: the input list is empty */
|
||||||
lp->next = alpm_list_new();
|
if(list == NULL) {
|
||||||
if(lp->next == NULL) {
|
ptr->prev = ptr;
|
||||||
return(NULL);
|
return(ptr);
|
||||||
}
|
|
||||||
lp->next->prev = lp;
|
|
||||||
lp = lp->next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lp->data = data;
|
lp = alpm_list_last(list);
|
||||||
|
lp->next = ptr;
|
||||||
|
ptr->prev = lp;
|
||||||
|
list->prev = ptr;
|
||||||
|
|
||||||
return(ptr);
|
return(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Add items to a list in sorted order.
|
/**
|
||||||
* @param list the list to add to
|
* @brief Add items to a list in sorted order.
|
||||||
* @param data the new item to be added to the list
|
*
|
||||||
* @param fn the comparison function to use to determine order
|
* @param list the list to add to
|
||||||
* @return the resultant list, or NULL on failure
|
* @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) {
|
if(!fn || !list) {
|
||||||
return alpm_list_add(list, data);
|
return(alpm_list_add(list, data));
|
||||||
} else {
|
} else {
|
||||||
alpm_list_t *add = NULL, *prev = NULL, *next = list;
|
alpm_list_t *add = NULL, *prev = NULL, *next = list;
|
||||||
|
|
||||||
add = alpm_list_new();
|
add = calloc(1, sizeof(alpm_list_t));
|
||||||
|
if(add == NULL) {
|
||||||
|
return(list);
|
||||||
|
}
|
||||||
add->data = data;
|
add->data = data;
|
||||||
|
|
||||||
/* Find insertion point. */
|
/* Find insertion point. */
|
||||||
@@ -139,34 +140,75 @@ alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cm
|
|||||||
next = next->next;
|
next = next->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert node before insertion point. */
|
/* Insert the add node to the list */
|
||||||
add->prev = prev;
|
if(prev == NULL) { /* special case: we insert add as the first element */
|
||||||
add->next = next;
|
add->prev = list->prev; /* list != NULL */
|
||||||
|
add->next = list;
|
||||||
if(next != NULL) {
|
list->prev = add;
|
||||||
next->prev = add; /* Not at end. */
|
return(add);
|
||||||
}
|
} else if(next == NULL) { /* another special case: add last element */
|
||||||
|
add->prev = prev;
|
||||||
if(prev != NULL) {
|
add->next = NULL;
|
||||||
prev->next = add; /* In middle. */
|
prev->next = add;
|
||||||
|
list->prev = add;
|
||||||
|
return(list);
|
||||||
} else {
|
} else {
|
||||||
list = add; /* At beginning, or new list */
|
add->prev = prev;
|
||||||
|
add->next = next;
|
||||||
|
next->prev = add;
|
||||||
|
prev->next = add;
|
||||||
|
return(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(list);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Merge the two sorted sublists into one sorted list
|
/**
|
||||||
* @param left the first list
|
* @brief Join two lists.
|
||||||
* @param right the second list
|
* The two lists must be independent. Do not free the original lists after
|
||||||
* @param fn comparison function for determining merge order
|
* 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;
|
alpm_list_t *newlist, *lp;
|
||||||
|
|
||||||
if (left == NULL)
|
if (left == NULL)
|
||||||
return right;
|
return right;
|
||||||
if (right == NULL)
|
if (right == NULL)
|
||||||
return left;
|
return left;
|
||||||
@@ -188,7 +230,7 @@ alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_f
|
|||||||
lp->next = left;
|
lp->next = left;
|
||||||
left->prev = lp;
|
left->prev = lp;
|
||||||
left = left->next;
|
left = left->next;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lp->next = right;
|
lp->next = right;
|
||||||
right->prev = lp;
|
right->prev = lp;
|
||||||
@@ -205,22 +247,35 @@ alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_f
|
|||||||
lp->next = right;
|
lp->next = right;
|
||||||
right->prev = lp;
|
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);
|
return(newlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sort a list of size `n` using mergesort algorithm
|
/**
|
||||||
* @param list the list to sort
|
* @brief Sort a list of size `n` using mergesort algorithm.
|
||||||
* @param n the size of the list
|
*
|
||||||
* @param fn the comparison function for determining order
|
* @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) {
|
if (n > 1) {
|
||||||
alpm_list_t *left = list;
|
alpm_list_t *left = list;
|
||||||
alpm_list_t *lastleft = alpm_list_nth(list, n/2 - 1);
|
alpm_list_t *lastleft = alpm_list_nth(list, n/2 - 1);
|
||||||
alpm_list_t *right = lastleft->next;
|
alpm_list_t *right = lastleft->next;
|
||||||
/* terminate first list */
|
/* terminate first list */
|
||||||
lastleft->next = NULL;
|
lastleft->next = NULL;
|
||||||
|
|
||||||
left = alpm_list_msort(left, n/2, fn);
|
left = alpm_list_msort(left, n/2, fn);
|
||||||
right = alpm_list_msort(right, n - (n/2), fn);
|
right = alpm_list_msort(right, n - (n/2), fn);
|
||||||
@@ -229,38 +284,60 @@ alpm_list_t* alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn)
|
|||||||
return(list);
|
return(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Remove an item from the list
|
/**
|
||||||
* @param haystack the list to remove the item from
|
* @brief Remove an item from the list.
|
||||||
* @param needle the data member of the item we're removing
|
*
|
||||||
* @param fn the comparison function for searching
|
* @param haystack the list to remove the item from
|
||||||
* @param data output parameter containing the data member of the item removed
|
* @param needle the data member of the item we're removing
|
||||||
* @return the resultant list, or NULL on failure
|
* @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)
|
alpm_list_t SYMEXPORT *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 *i = haystack, *tmp = NULL;
|
alpm_list_t *i = haystack, *tmp = NULL;
|
||||||
|
|
||||||
if(data) {
|
if(data) {
|
||||||
*data = NULL;
|
*data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(needle == NULL) {
|
||||||
|
return(haystack);
|
||||||
|
}
|
||||||
|
|
||||||
while(i) {
|
while(i) {
|
||||||
if(i->data == NULL) {
|
if(i->data == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
tmp = i->next;
|
tmp = i->next;
|
||||||
if(fn(needle, i->data) == 0) {
|
if(fn(i->data, needle) == 0) {
|
||||||
/* we found a matching item */
|
/* we found a matching item */
|
||||||
if(i->next) {
|
|
||||||
i->next->prev = i->prev;
|
|
||||||
}
|
|
||||||
if(i->prev) {
|
|
||||||
i->prev->next = i->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(i == haystack) {
|
if(i == haystack) {
|
||||||
/* The item found is the first in the chain */
|
/* Special case: removing the head node which has a back reference to
|
||||||
haystack = haystack->next;
|
* 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) {
|
if(data) {
|
||||||
@@ -268,48 +345,46 @@ alpm_list_t *alpm_list_remove(alpm_list_t *haystack, const void *needle, alpm_li
|
|||||||
}
|
}
|
||||||
i->data = NULL;
|
i->data = NULL;
|
||||||
free(i);
|
free(i);
|
||||||
|
i = NULL;
|
||||||
|
} else {
|
||||||
|
i = tmp;
|
||||||
}
|
}
|
||||||
i = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(haystack);
|
return(haystack);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Remove the passed in node from the list that it is a part of
|
/**
|
||||||
* @note this DOES NOT free the node
|
* @brief Remove a string from a list.
|
||||||
* @param node the list node we're removing
|
*
|
||||||
* @return the node which took the place of this one
|
* @param haystack the list to remove the item from
|
||||||
|
* @param needle the data member of the item we're removing
|
||||||
|
* @param data output parameter containing data of the removed item
|
||||||
|
*
|
||||||
|
* @return the resultant list
|
||||||
*/
|
*/
|
||||||
alpm_list_t *alpm_list_remove_node(alpm_list_t *node)
|
alpm_list_t SYMEXPORT *alpm_list_remove_str(alpm_list_t *haystack,
|
||||||
|
const char *needle, char **data)
|
||||||
{
|
{
|
||||||
if(!node) return(NULL);
|
return(alpm_list_remove(haystack, (const void *)needle,
|
||||||
|
(alpm_list_fn_cmp)strcmp, (void **)data));
|
||||||
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
|
* @brief Create a new list without any duplicates.
|
||||||
* @param list the list to copy
|
*
|
||||||
* @return a NEW list containing non-duplicated items
|
* This does NOT copy data members.
|
||||||
|
*
|
||||||
|
* @param list the list to copy
|
||||||
|
*
|
||||||
|
* @return a new list containing non-duplicate items
|
||||||
*/
|
*/
|
||||||
alpm_list_t SYMEXPORT *alpm_list_remove_dupes(alpm_list_t *list)
|
alpm_list_t SYMEXPORT *alpm_list_remove_dupes(const 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) {
|
while(lp) {
|
||||||
if(!alpm_list_find(newlist, lp->data)) {
|
if(!alpm_list_find_ptr(newlist, lp->data)) {
|
||||||
newlist = alpm_list_add(newlist, lp->data);
|
newlist = alpm_list_add(newlist, lp->data);
|
||||||
}
|
}
|
||||||
lp = lp->next;
|
lp = lp->next;
|
||||||
@@ -317,14 +392,17 @@ alpm_list_t SYMEXPORT *alpm_list_remove_dupes(alpm_list_t *list)
|
|||||||
return(newlist);
|
return(newlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Copy a string list, including data
|
/**
|
||||||
* @note this is gross, assumes string data members
|
* @brief Copy a string list, including data.
|
||||||
* @param list the list to copy
|
*
|
||||||
* @return a copy of the original list
|
* @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) {
|
while(lp) {
|
||||||
newlist = alpm_list_add(newlist, strdup(lp->data));
|
newlist = alpm_list_add(newlist, strdup(lp->data));
|
||||||
lp = lp->next;
|
lp = lp->next;
|
||||||
@@ -332,83 +410,167 @@ alpm_list_t *alpm_list_strdup(alpm_list_t *list)
|
|||||||
return(newlist);
|
return(newlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Create a new list in reverse order
|
/**
|
||||||
* @param list the list to copy
|
* @brief Copy a list, without copying data.
|
||||||
* @return a NEW list in reverse order of the first
|
*
|
||||||
|
* @param list the list to copy
|
||||||
|
*
|
||||||
|
* @return a copy of the original list
|
||||||
*/
|
*/
|
||||||
alpm_list_t *alpm_list_reverse(alpm_list_t *list)
|
alpm_list_t SYMEXPORT *alpm_list_copy(const alpm_list_t *list)
|
||||||
{ /* TODO any invalid free's from NOT duplicating data here? */
|
{
|
||||||
alpm_list_t *lp, *newlist = NULL;
|
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, *backup;
|
||||||
|
|
||||||
|
if(list == NULL) {
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
lp = alpm_list_last(list);
|
lp = alpm_list_last(list);
|
||||||
|
/* break our reverse circular list */
|
||||||
|
backup = list->prev;
|
||||||
|
list->prev = NULL;
|
||||||
|
|
||||||
while(lp) {
|
while(lp) {
|
||||||
newlist = alpm_list_add(newlist, lp->data);
|
newlist = alpm_list_add(newlist, lp->data);
|
||||||
lp = lp->prev;
|
lp = lp->prev;
|
||||||
}
|
}
|
||||||
|
list->prev = backup; /* restore tail pointer */
|
||||||
return(newlist);
|
return(newlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Accessors */
|
/* Accessors */
|
||||||
|
|
||||||
/** Get the first element of a list.
|
/**
|
||||||
|
* @brief Get the first element of a list.
|
||||||
|
*
|
||||||
* @param list the list
|
* @param list the list
|
||||||
|
*
|
||||||
* @return the first element in 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);
|
if(list) {
|
||||||
|
return((alpm_list_t*)list);
|
||||||
|
} else {
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return nth element from list (starting with 0)
|
/**
|
||||||
* @param list the list to access
|
* @brief Return nth element from list (starting from 0).
|
||||||
* @param n the index of the item to find
|
*
|
||||||
* @return an alpm_list_t node for index `n`
|
* @param list the list
|
||||||
|
* @param n the index of the item to find (n < alpm_list_count(list) IS needed)
|
||||||
|
*
|
||||||
|
* @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--) {
|
while(n--) {
|
||||||
i = i->next;
|
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
|
* @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);
|
if(node) {
|
||||||
}
|
return(node->next);
|
||||||
/** Get the last item in the list.
|
} else {
|
||||||
* @param list the list to operate on
|
return(NULL);
|
||||||
* @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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 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
|
* @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);
|
if(node == NULL) return(NULL);
|
||||||
return(entry->data);
|
return(node->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Misc */
|
/* Misc */
|
||||||
|
|
||||||
/** Count the list items
|
/**
|
||||||
* @param list the list to operate on
|
* @brief Get the number of items in a list.
|
||||||
* @return the number of list items
|
*
|
||||||
|
* @param list the list
|
||||||
|
*
|
||||||
|
* @return the number of list items
|
||||||
*/
|
*/
|
||||||
int SYMEXPORT alpm_list_count(const alpm_list_t *list)
|
int SYMEXPORT alpm_list_count(const alpm_list_t *list)
|
||||||
{
|
{
|
||||||
@@ -421,53 +583,82 @@ int SYMEXPORT alpm_list_count(const alpm_list_t *list)
|
|||||||
return(i);
|
return(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Is an item in the list
|
/**
|
||||||
* @param needle the data to compare to (== comparison)
|
* @brief Find an item in a list.
|
||||||
* @param haystack the list to search
|
*
|
||||||
* @return 1 if `needle` is found, 0 otherwise
|
* @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 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) {
|
while(lp) {
|
||||||
if(lp->data == needle) {
|
if(lp->data && fn(lp->data, needle) == 0) {
|
||||||
return(1);
|
return(lp->data);
|
||||||
}
|
}
|
||||||
lp = lp->next;
|
lp = lp->next;
|
||||||
}
|
}
|
||||||
return(0);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test for existence of a string in a alpm_list_t
|
/* trivial helper function for alpm_list_find_ptr */
|
||||||
*/
|
static int ptr_cmp(const void *p, const void *q)
|
||||||
/** 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 alpm_list_find_str(alpm_list_t *haystack, const char *needle)
|
|
||||||
{
|
{
|
||||||
alpm_list_t *lp = haystack;
|
return(p != q);
|
||||||
while(lp) {
|
|
||||||
if(lp->data && strcmp((const char *)lp->data, needle) == 0) {
|
|
||||||
return(1);
|
|
||||||
}
|
|
||||||
lp = lp->next;
|
|
||||||
}
|
|
||||||
return(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the items in list `lhs` that are not present in list `rhs`
|
* @brief Find an item in a list.
|
||||||
* @note Entries are not duplicated
|
*
|
||||||
|
* 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, ptr_cmp));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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 lhs the first list
|
||||||
* @param rhs the second list
|
* @param rhs the second list
|
||||||
* @param fn the comparison function
|
* @param fn the comparison function
|
||||||
* @return a list containing all items in lhs not present in rhs
|
*
|
||||||
|
* @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) {
|
for(i = lhs; i; i = i->next) {
|
||||||
int found = 0;
|
int found = 0;
|
||||||
for(j = rhs; j; j = j->next) {
|
for(j = rhs; j; j = j->next) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* alpm_alpm_list.h
|
* alpm_list.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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -14,59 +14,73 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
#ifndef _ALPM_LIST_H
|
#ifndef _ALPM_LIST_H
|
||||||
#define _ALPM_LIST_H
|
#define _ALPM_LIST_H
|
||||||
|
|
||||||
#include "alpm.h"
|
#include <stdlib.h> /* size_t */
|
||||||
|
|
||||||
/* Chained list struct */
|
#ifdef __cplusplus
|
||||||
struct __alpm_list_t {
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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;
|
void *data;
|
||||||
|
/** pointer to the previous node */
|
||||||
struct __alpm_list_t *prev;
|
struct __alpm_list_t *prev;
|
||||||
|
/** pointer to the next node */
|
||||||
struct __alpm_list_t *next;
|
struct __alpm_list_t *next;
|
||||||
};
|
} alpm_list_t;
|
||||||
|
|
||||||
/* TODO we should do away with these... they're messy*/
|
#define FREELIST(p) do { alpm_list_free_inner(p, free); alpm_list_free(p); p = NULL; } while(0)
|
||||||
#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)
|
|
||||||
|
|
||||||
typedef void (*alpm_list_fn_free)(void *); /* item deallocation callback */
|
typedef void (*alpm_list_fn_free)(void *); /* item deallocation callback */
|
||||||
typedef int (*alpm_list_fn_cmp)(const void *, const void *); /* item comparison callback */
|
typedef int (*alpm_list_fn_cmp)(const void *, const void *); /* item comparison callback */
|
||||||
|
|
||||||
/* allocation */
|
/* allocation */
|
||||||
alpm_list_t *alpm_list_new(void);
|
|
||||||
void alpm_list_free(alpm_list_t *list);
|
void alpm_list_free(alpm_list_t *list);
|
||||||
void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn);
|
void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn);
|
||||||
|
|
||||||
/* item mutators */
|
/* item mutators */
|
||||||
alpm_list_t *alpm_list_add(alpm_list_t *list, void *data);
|
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_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_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_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(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_str(alpm_list_t *haystack, const char *needle, char **data);
|
||||||
alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list);
|
alpm_list_t *alpm_list_remove_dupes(const alpm_list_t *list);
|
||||||
alpm_list_t *alpm_list_strdup(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);
|
alpm_list_t *alpm_list_reverse(alpm_list_t *list);
|
||||||
|
|
||||||
/* item accessors */
|
/* item accessors */
|
||||||
alpm_list_t *alpm_list_first(alpm_list_t *list);
|
alpm_list_t *alpm_list_first(const alpm_list_t *list);
|
||||||
alpm_list_t *alpm_list_nth(alpm_list_t *list, int n);
|
alpm_list_t *alpm_list_nth(const alpm_list_t *list, int n);
|
||||||
alpm_list_t *alpm_list_next(alpm_list_t *list);
|
alpm_list_t *alpm_list_next(const alpm_list_t *list);
|
||||||
alpm_list_t *alpm_list_last(alpm_list_t *list);
|
alpm_list_t *alpm_list_last(const alpm_list_t *list);
|
||||||
void *alpm_list_getdata(const alpm_list_t *entry);
|
void *alpm_list_getdata(const alpm_list_t *entry);
|
||||||
|
|
||||||
/* misc */
|
/* misc */
|
||||||
int alpm_list_count(const alpm_list_t *list);
|
int alpm_list_count(const alpm_list_t *list);
|
||||||
int alpm_list_find(alpm_list_t *haystack, const void *needle);
|
void *alpm_list_find(const alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn);
|
||||||
int alpm_list_find_str(alpm_list_t *haystack,const char *needle);
|
void *alpm_list_find_ptr(const alpm_list_t *haystack, const void *needle);
|
||||||
alpm_list_t *alpm_list_diff(alpm_list_t *lhs, alpm_list_t *rhs, alpm_list_fn_cmp fn);
|
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 */
|
#endif /* _ALPM_LIST_H */
|
||||||
|
|
||||||
/* vim: set ts=2 sw=2 noet: */
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
* backup.c
|
* backup.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2005 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -17,25 +17,70 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
/* pacman */
|
|
||||||
#include "log.h"
|
/* libalpm */
|
||||||
#include "backup.h"
|
#include "backup.h"
|
||||||
|
#include "alpm_list.h"
|
||||||
|
#include "log.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
/* Look for a filename in a pmpkg_t.backup list. If we find it,
|
/* split a backup string "file\thash" into two strings : file and hash */
|
||||||
* then we return the md5 or sha1 hash (parsed from the same line)
|
int _alpm_backup_split(const char *string, char **file, char **hash)
|
||||||
*/
|
|
||||||
char *_alpm_needbackup(const char *file, alpm_list_t *backup)
|
|
||||||
{
|
{
|
||||||
alpm_list_t *lp;
|
char *str = strdup(string);
|
||||||
|
char *ptr;
|
||||||
|
|
||||||
|
/* tab delimiter */
|
||||||
|
ptr = strchr(str, '\t');
|
||||||
|
if(ptr == NULL) {
|
||||||
|
if(file) {
|
||||||
|
*file = str;
|
||||||
|
} else {
|
||||||
|
/* don't need our dup as the fname wasn't requested, so free it */
|
||||||
|
FREE(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;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
@@ -43,26 +88,22 @@ char *_alpm_needbackup(const char *file, alpm_list_t *backup)
|
|||||||
return(NULL);
|
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) {
|
for(lp = backup; lp; lp = lp->next) {
|
||||||
char *str = strdup(lp->data);
|
char *filename = NULL;
|
||||||
char *ptr;
|
char *hash = NULL;
|
||||||
|
|
||||||
/* tab delimiter */
|
/* no hash found */
|
||||||
ptr = strchr(str, '\t');
|
if(!_alpm_backup_split((char *)lp->data, &filename, &hash)) {
|
||||||
if(ptr == NULL) {
|
FREE(filename);
|
||||||
FREE(str);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
*ptr = '\0';
|
if(strcmp(file, filename) == 0) {
|
||||||
ptr++;
|
FREE(filename);
|
||||||
/* 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);
|
|
||||||
return(hash);
|
return(hash);
|
||||||
}
|
}
|
||||||
FREE(str);
|
FREE(filename);
|
||||||
|
FREE(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* backup.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -14,16 +14,16 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
#ifndef _ALPM_BACKUP_H
|
#ifndef _ALPM_BACKUP_H
|
||||||
#define _ALPM_BACKUP_H
|
#define _ALPM_BACKUP_H
|
||||||
|
|
||||||
#include "alpm_list.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 */
|
#endif /* _ALPM_BACKUP_H */
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
288
lib/libalpm/be_package.c
Normal file
288
lib/libalpm/be_package.c
Normal file
@@ -0,0 +1,288 @@
|
|||||||
|
/*
|
||||||
|
* be_package.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002-2008 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 <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <locale.h> /* setlocale */
|
||||||
|
|
||||||
|
/* libarchive */
|
||||||
|
#include <archive.h>
|
||||||
|
#include <archive_entry.h>
|
||||||
|
|
||||||
|
/* libalpm */
|
||||||
|
#include "alpm_list.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "log.h"
|
||||||
|
#include "package.h"
|
||||||
|
#include "deps.h" /* _alpm_splitdep */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses the package description file for a package into a pmpkg_t struct.
|
||||||
|
* @param archive the archive to read from, pointed at the .PKGINFO entry
|
||||||
|
* @param newpkg an empty pmpkg_t struct to fill with package info
|
||||||
|
*
|
||||||
|
* @return 0 on success, 1 on error
|
||||||
|
*/
|
||||||
|
static int parse_descfile(struct archive *a, pmpkg_t *newpkg)
|
||||||
|
{
|
||||||
|
char line[PATH_MAX];
|
||||||
|
char *ptr = NULL;
|
||||||
|
char *key = NULL;
|
||||||
|
int linenum = 0;
|
||||||
|
|
||||||
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
|
/* loop until we reach EOF (where archive_fgets will return NULL) */
|
||||||
|
while(_alpm_archive_fgets(line, PATH_MAX, a) != NULL) {
|
||||||
|
linenum++;
|
||||||
|
_alpm_strtrim(line);
|
||||||
|
if(strlen(line) == 0 || line[0] == '#') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ptr = line;
|
||||||
|
key = strsep(&ptr, "=");
|
||||||
|
if(key == NULL || ptr == NULL) {
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "%s: syntax error in description file line %d\n",
|
||||||
|
newpkg->name ? newpkg->name : "error", linenum);
|
||||||
|
} else {
|
||||||
|
key = _alpm_strtrim(key);
|
||||||
|
ptr = _alpm_strtrim(ptr);
|
||||||
|
if(!strcmp(key, "pkgname")) {
|
||||||
|
STRDUP(newpkg->name, ptr, RET_ERR(PM_ERR_MEMORY, -1));
|
||||||
|
} else if(!strcmp(key, "pkgver")) {
|
||||||
|
STRDUP(newpkg->version, ptr, RET_ERR(PM_ERR_MEMORY, -1));
|
||||||
|
} else if(!strcmp(key, "pkgdesc")) {
|
||||||
|
STRDUP(newpkg->desc, ptr, RET_ERR(PM_ERR_MEMORY, -1));
|
||||||
|
} else if(!strcmp(key, "group")) {
|
||||||
|
newpkg->groups = alpm_list_add(newpkg->groups, strdup(ptr));
|
||||||
|
} else if(!strcmp(key, "url")) {
|
||||||
|
STRDUP(newpkg->url, ptr, RET_ERR(PM_ERR_MEMORY, -1));
|
||||||
|
} else if(!strcmp(key, "license")) {
|
||||||
|
newpkg->licenses = alpm_list_add(newpkg->licenses, strdup(ptr));
|
||||||
|
} else if(!strcmp(key, "builddate")) {
|
||||||
|
char first = tolower(ptr[0]);
|
||||||
|
if(first > 'a' && first < 'z') {
|
||||||
|
struct tm tmp_tm = {0}; //initialize to null in case of failure
|
||||||
|
setlocale(LC_TIME, "C");
|
||||||
|
strptime(ptr, "%a %b %e %H:%M:%S %Y", &tmp_tm);
|
||||||
|
newpkg->builddate = mktime(&tmp_tm);
|
||||||
|
setlocale(LC_TIME, "");
|
||||||
|
} else {
|
||||||
|
newpkg->builddate = atol(ptr);
|
||||||
|
}
|
||||||
|
} else if(!strcmp(key, "packager")) {
|
||||||
|
STRDUP(newpkg->packager, ptr, RET_ERR(PM_ERR_MEMORY, -1));
|
||||||
|
} else if(!strcmp(key, "arch")) {
|
||||||
|
STRDUP(newpkg->arch, ptr, RET_ERR(PM_ERR_MEMORY, -1));
|
||||||
|
} else if(!strcmp(key, "size")) {
|
||||||
|
/* size in the raw package is uncompressed (installed) size */
|
||||||
|
newpkg->isize = atol(ptr);
|
||||||
|
} else if(!strcmp(key, "depend")) {
|
||||||
|
pmdepend_t *dep = _alpm_splitdep(ptr);
|
||||||
|
newpkg->depends = alpm_list_add(newpkg->depends, dep);
|
||||||
|
} else if(!strcmp(key, "optdepend")) {
|
||||||
|
newpkg->optdepends = alpm_list_add(newpkg->optdepends, strdup(ptr));
|
||||||
|
} else if(!strcmp(key, "conflict")) {
|
||||||
|
newpkg->conflicts = alpm_list_add(newpkg->conflicts, strdup(ptr));
|
||||||
|
} else if(!strcmp(key, "replaces")) {
|
||||||
|
newpkg->replaces = alpm_list_add(newpkg->replaces, strdup(ptr));
|
||||||
|
} else if(!strcmp(key, "provides")) {
|
||||||
|
newpkg->provides = alpm_list_add(newpkg->provides, strdup(ptr));
|
||||||
|
} else if(!strcmp(key, "backup")) {
|
||||||
|
newpkg->backup = alpm_list_add(newpkg->backup, strdup(ptr));
|
||||||
|
} else {
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "%s: syntax error in description file line %d\n",
|
||||||
|
newpkg->name ? newpkg->name : "error", linenum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
line[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load a package and create the corresponding pmpkg_t struct.
|
||||||
|
* @param pkgfile path to the package file
|
||||||
|
* @param full whether to stop the load after metadata is read or continue
|
||||||
|
* through the full archive
|
||||||
|
* @return An information filled pmpkg_t struct
|
||||||
|
*/
|
||||||
|
static pmpkg_t *pkg_load(const char *pkgfile, unsigned short full)
|
||||||
|
{
|
||||||
|
int ret = ARCHIVE_OK;
|
||||||
|
int config = 0;
|
||||||
|
struct archive *archive;
|
||||||
|
struct archive_entry *entry;
|
||||||
|
pmpkg_t *newpkg = NULL;
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
|
if(pkgfile == NULL || strlen(pkgfile) == 0) {
|
||||||
|
RET_ERR(PM_ERR_WRONG_ARGS, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(stat(pkgfile, &st) != 0) {
|
||||||
|
RET_ERR(PM_ERR_PKG_OPEN, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if((archive = archive_read_new()) == NULL) {
|
||||||
|
RET_ERR(PM_ERR_LIBARCHIVE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
archive_read_support_compression_all(archive);
|
||||||
|
archive_read_support_format_all(archive);
|
||||||
|
|
||||||
|
if (archive_read_open_filename(archive, pkgfile,
|
||||||
|
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
|
||||||
|
RET_ERR(PM_ERR_PKG_OPEN, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
newpkg = _alpm_pkg_new();
|
||||||
|
if(newpkg == NULL) {
|
||||||
|
archive_read_finish(archive);
|
||||||
|
RET_ERR(PM_ERR_MEMORY, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
newpkg->filename = strdup(pkgfile);
|
||||||
|
newpkg->size = st.st_size;
|
||||||
|
|
||||||
|
/* If full is false, only read through the archive until we find our needed
|
||||||
|
* metadata. If it is true, read through the entire archive, which serves
|
||||||
|
* as a verfication of integrity and allows us to create the filelist. */
|
||||||
|
while((ret = archive_read_next_header(archive, &entry)) == ARCHIVE_OK) {
|
||||||
|
const char *entry_name = archive_entry_pathname(entry);
|
||||||
|
|
||||||
|
if(strcmp(entry_name, ".PKGINFO") == 0) {
|
||||||
|
/* parse the info file */
|
||||||
|
if(parse_descfile(archive, newpkg) != 0) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("could not parse package description file in %s\n"),
|
||||||
|
pkgfile);
|
||||||
|
goto pkg_invalid;
|
||||||
|
}
|
||||||
|
if(newpkg->name == NULL || strlen(newpkg->name) == 0) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("missing package name in %s\n"), pkgfile);
|
||||||
|
goto pkg_invalid;
|
||||||
|
}
|
||||||
|
if(newpkg->version == NULL || strlen(newpkg->version) == 0) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("missing package version in %s\n"), pkgfile);
|
||||||
|
goto pkg_invalid;
|
||||||
|
}
|
||||||
|
config = 1;
|
||||||
|
continue;
|
||||||
|
} else if(strcmp(entry_name, ".INSTALL") == 0) {
|
||||||
|
newpkg->scriptlet = 1;
|
||||||
|
} else if(*entry_name == '.') {
|
||||||
|
/* for now, ignore all files starting with '.' that haven't
|
||||||
|
* already been handled (for future possibilities) */
|
||||||
|
} else {
|
||||||
|
/* Keep track of all files for filelist generation */
|
||||||
|
newpkg->files = alpm_list_add(newpkg->files, strdup(entry_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(archive_read_data_skip(archive)) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("error while reading package %s: %s\n"),
|
||||||
|
pkgfile, archive_error_string(archive));
|
||||||
|
pm_errno = PM_ERR_LIBARCHIVE;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if we are not doing a full read, see if we have all we need */
|
||||||
|
if(!full && config) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ret != ARCHIVE_EOF && ret != ARCHIVE_OK) { /* An error occured */
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("error while reading package %s: %s\n"),
|
||||||
|
pkgfile, archive_error_string(archive));
|
||||||
|
pm_errno = PM_ERR_LIBARCHIVE;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!config) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("missing package metadata in %s\n"), pkgfile);
|
||||||
|
goto pkg_invalid;
|
||||||
|
}
|
||||||
|
|
||||||
|
archive_read_finish(archive);
|
||||||
|
|
||||||
|
/* internal fields for package struct */
|
||||||
|
newpkg->origin = PKG_FROM_FILE;
|
||||||
|
newpkg->origin_data.file = strdup(pkgfile);
|
||||||
|
|
||||||
|
if(full) {
|
||||||
|
/* "checking for conflicts" requires a sorted list, ensure that here */
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "sorting package filelist for %s\n", pkgfile);
|
||||||
|
newpkg->files = alpm_list_msort(newpkg->files, alpm_list_count(newpkg->files),
|
||||||
|
_alpm_str_cmp);
|
||||||
|
newpkg->infolevel = INFRQ_ALL;
|
||||||
|
} else {
|
||||||
|
/* get rid of any partial filelist we may have collected, it is invalid */
|
||||||
|
FREELIST(newpkg->files);
|
||||||
|
newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_DEPENDS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return(newpkg);
|
||||||
|
|
||||||
|
pkg_invalid:
|
||||||
|
pm_errno = PM_ERR_PKG_INVALID;
|
||||||
|
error:
|
||||||
|
_alpm_pkg_free(newpkg);
|
||||||
|
archive_read_finish(archive);
|
||||||
|
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Create a package from a file.
|
||||||
|
* If full is false, the archive is read only until all necessary
|
||||||
|
* metadata is found. If it is true, the entire archive is read, which
|
||||||
|
* serves as a verfication of integrity and the filelist can be created.
|
||||||
|
* @param filename location of the package tarball
|
||||||
|
* @param full whether to stop the load after metadata is read or continue
|
||||||
|
* through the full archive
|
||||||
|
* @param pkg address of the package pointer
|
||||||
|
* @return 0 on success, -1 on error (pm_errno is set accordingly)
|
||||||
|
*/
|
||||||
|
int SYMEXPORT alpm_pkg_load(const char *filename, unsigned short full,
|
||||||
|
pmpkg_t **pkg)
|
||||||
|
{
|
||||||
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
|
/* Sanity checks */
|
||||||
|
ASSERT(filename != NULL && strlen(filename) != 0,
|
||||||
|
RET_ERR(PM_ERR_WRONG_ARGS, -1));
|
||||||
|
ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
|
||||||
|
|
||||||
|
*pkg = pkg_load(filename, full);
|
||||||
|
if(*pkg == NULL) {
|
||||||
|
/* pm_errno is set by pkg_load */
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* cache.c
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -14,61 +14,47 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <libintl.h>
|
/* libalpm */
|
||||||
/* pacman */
|
#include "cache.h"
|
||||||
|
#include "alpm_list.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "alpm.h"
|
#include "alpm.h"
|
||||||
#include "alpm_list.h"
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "error.h"
|
|
||||||
#include "package.h"
|
#include "package.h"
|
||||||
#include "group.h"
|
#include "group.h"
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "cache.h"
|
|
||||||
|
|
||||||
/* Returns a new package cache from db.
|
/* Returns a new package cache from db.
|
||||||
* It frees the cache if it already exists.
|
* It frees the cache if it already exists.
|
||||||
*/
|
*/
|
||||||
int _alpm_db_load_pkgcache(pmdb_t *db)
|
int _alpm_db_load_pkgcache(pmdb_t *db)
|
||||||
{
|
{
|
||||||
pmpkg_t *info;
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
ALPM_LOG_FUNC;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
if(db == NULL) {
|
if(db == NULL) {
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
_alpm_db_free_pkgcache(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);
|
db->treename);
|
||||||
|
if(_alpm_db_populate(db) == -1) {
|
||||||
_alpm_db_rewind(db);
|
_alpm_log(PM_LOG_DEBUG,
|
||||||
while((info = _alpm_db_scan(db, NULL)) != NULL) {
|
"failed to load package cache for repository '%s'\n", db->treename);
|
||||||
_alpm_log(PM_LOG_FUNCTION, _("adding '%s' to package cache for db '%s'"),
|
return(-1);
|
||||||
alpm_pkg_get_name(info), db->treename);
|
|
||||||
info->origin = PKG_FROM_CACHE;
|
|
||||||
info->data = db;
|
|
||||||
/* add to the collection */
|
|
||||||
db->pkgcache = alpm_list_add(db->pkgcache, info);
|
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
db->pkgcache = alpm_list_msort(db->pkgcache, count, _alpm_pkg_cmp);
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,10 +66,12 @@ void _alpm_db_free_pkgcache(pmdb_t *db)
|
|||||||
return;
|
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);
|
db->treename);
|
||||||
|
|
||||||
FREELISTPKGS(db->pkgcache);
|
alpm_list_free_inner(db->pkgcache, (alpm_list_fn_free)_alpm_pkg_free);
|
||||||
|
alpm_list_free(db->pkgcache);
|
||||||
|
db->pkgcache = NULL;
|
||||||
|
|
||||||
if(db->grpcache) {
|
if(db->grpcache) {
|
||||||
_alpm_db_free_grpcache(db);
|
_alpm_db_free_grpcache(db);
|
||||||
@@ -104,12 +92,13 @@ alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db)
|
|||||||
|
|
||||||
/* hmmm, still NULL ?*/
|
/* hmmm, still NULL ?*/
|
||||||
if(!db->pkgcache) {
|
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);
|
return(db->pkgcache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* "duplicate" pkg with BASE info (to spare some memory) then add it to pkgcache */
|
||||||
int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
|
int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
|
||||||
{
|
{
|
||||||
pmpkg_t *newpkg;
|
pmpkg_t *newpkg;
|
||||||
@@ -120,11 +109,22 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
newpkg = _alpm_pkg_dup(pkg);
|
newpkg = _alpm_pkg_new();
|
||||||
if(newpkg == NULL) {
|
if(newpkg == NULL) {
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
_alpm_log(PM_LOG_DEBUG, _("adding entry '%s' in '%s' cache"),
|
newpkg->name = strdup(pkg->name);
|
||||||
|
newpkg->version = strdup(pkg->version);
|
||||||
|
if(newpkg->name == NULL || newpkg->version == NULL) {
|
||||||
|
pm_errno = PM_ERR_MEMORY;
|
||||||
|
_alpm_pkg_free(newpkg);
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
newpkg->origin = PKG_FROM_CACHE;
|
||||||
|
newpkg->origin_data.db = db;
|
||||||
|
newpkg->infolevel = INFRQ_BASE;
|
||||||
|
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "adding entry '%s' in '%s' cache\n",
|
||||||
alpm_pkg_get_name(newpkg), db->treename);
|
alpm_pkg_get_name(newpkg), db->treename);
|
||||||
db->pkgcache = alpm_list_add_sorted(db->pkgcache, newpkg, _alpm_pkg_cmp);
|
db->pkgcache = alpm_list_add_sorted(db->pkgcache, newpkg, _alpm_pkg_cmp);
|
||||||
|
|
||||||
@@ -144,19 +144,19 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg)
|
|||||||
return(-1);
|
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);
|
alpm_pkg_get_name(pkg), db->treename);
|
||||||
|
|
||||||
db->pkgcache = alpm_list_remove(db->pkgcache, pkg, _alpm_pkg_cmp, &vdata);
|
db->pkgcache = alpm_list_remove(db->pkgcache, pkg, _alpm_pkg_cmp, &vdata);
|
||||||
data = vdata;
|
data = vdata;
|
||||||
if(data == NULL) {
|
if(data == NULL) {
|
||||||
/* package not found */
|
/* 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);
|
alpm_pkg_get_name(pkg), db->treename);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
FREEPKG(data);
|
_alpm_pkg_free(data);
|
||||||
|
|
||||||
_alpm_db_free_grpcache(db);
|
_alpm_db_free_grpcache(db);
|
||||||
|
|
||||||
@@ -173,11 +173,12 @@ pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target)
|
|||||||
|
|
||||||
alpm_list_t *pkgcache = _alpm_db_get_pkgcache(db);
|
alpm_list_t *pkgcache = _alpm_db_get_pkgcache(db);
|
||||||
if(!pkgcache) {
|
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);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(_alpm_pkg_find(target, pkgcache));
|
return(_alpm_pkg_find(pkgcache, target));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns a new group cache from db.
|
/* Returns a new group cache from db.
|
||||||
@@ -196,38 +197,37 @@ int _alpm_db_load_grpcache(pmdb_t *db)
|
|||||||
_alpm_db_load_pkgcache(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) {
|
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;
|
pmpkg_t *pkg = lp->data;
|
||||||
|
|
||||||
for(i = alpm_pkg_get_groups(pkg); i; i = i->next) {
|
for(i = alpm_pkg_get_groups(pkg); i; i = i->next) {
|
||||||
if(!alpm_list_find_str(db->grpcache, i->data)) {
|
const char *grpname = i->data;
|
||||||
pmgrp_t *grp = _alpm_grp_new();
|
alpm_list_t *j;
|
||||||
|
pmgrp_t *grp = NULL;
|
||||||
|
int found = 0;
|
||||||
|
|
||||||
strncpy(grp->name, i->data, GRP_NAME_LEN);
|
/* first look through the group cache for a group with this name */
|
||||||
grp->name[GRP_NAME_LEN-1] = '\0';
|
for(j = db->grpcache; j; j = j->next) {
|
||||||
grp->packages = alpm_list_add_sorted(grp->packages,
|
grp = j->data;
|
||||||
/* gross signature forces us to
|
|
||||||
* discard const */
|
|
||||||
(void *)alpm_pkg_get_name(pkg),
|
|
||||||
_alpm_grp_cmp);
|
|
||||||
db->grpcache = alpm_list_add_sorted(db->grpcache, grp, _alpm_grp_cmp);
|
|
||||||
} else {
|
|
||||||
alpm_list_t *j;
|
|
||||||
|
|
||||||
for(j = db->grpcache; j; j = j->next) {
|
if(strcmp(grp->name, grpname) == 0
|
||||||
pmgrp_t *grp = j->data;
|
&& !alpm_list_find_ptr(grp->packages, pkg)) {
|
||||||
|
grp->packages = alpm_list_add(grp->packages, pkg);
|
||||||
if(strcmp(grp->name, i->data) == 0) {
|
found = 1;
|
||||||
const char *pkgname = alpm_pkg_get_name(pkg);
|
break;
|
||||||
if(!alpm_list_find_str(grp->packages, pkgname)) {
|
|
||||||
grp->packages = alpm_list_add_sorted(grp->packages, (void *)pkgname, _alpm_grp_cmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(found) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* we didn't find the group, so create a new one with this name */
|
||||||
|
grp = _alpm_grp_new(grpname);
|
||||||
|
grp->packages = alpm_list_add(grp->packages, pkg);
|
||||||
|
db->grpcache = alpm_list_add(db->grpcache, grp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,10 +245,8 @@ void _alpm_db_free_grpcache(pmdb_t *db)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(lg = db->grpcache; lg; lg = lg->next) {
|
for(lg = db->grpcache; lg; lg = lg->next) {
|
||||||
pmgrp_t *grp = lg->data;
|
_alpm_grp_free(lg->data);
|
||||||
|
lg->data = NULL;
|
||||||
FREELISTPTR(grp->packages);
|
|
||||||
FREEGRP(lg->data);
|
|
||||||
}
|
}
|
||||||
FREELIST(db->grpcache);
|
FREELIST(db->grpcache);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* cache.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -14,9 +14,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
#ifndef _ALPM_CACHE_H
|
#ifndef _ALPM_CACHE_H
|
||||||
#define _ALPM_CACHE_H
|
#define _ALPM_CACHE_H
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* conflict.c
|
* 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) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
||||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
* Copyright (c) 2006 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2006 by Christian Hamar <krics@linuxforum.hu>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -18,219 +18,185 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__APPLE__) || defined(__OpenBSD__)
|
|
||||||
#include <sys/syslimits.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <libintl.h>
|
|
||||||
/* pacman */
|
/* libalpm */
|
||||||
#include "handle.h"
|
#include "conflict.h"
|
||||||
#include "alpm_list.h"
|
#include "alpm_list.h"
|
||||||
|
#include "handle.h"
|
||||||
#include "trans.h"
|
#include "trans.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "error.h"
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "deps.h"
|
#include "deps.h"
|
||||||
#include "conflict.h"
|
|
||||||
|
|
||||||
|
pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2)
|
||||||
|
{
|
||||||
|
pmconflict_t *conflict;
|
||||||
|
|
||||||
/** See if potential conflict 'name' matches package 'pkg'.
|
ALPM_LOG_FUNC;
|
||||||
* @param target the name of the parent package we're checking
|
|
||||||
* @param depname the name of the dependency we're checking
|
MALLOC(conflict, sizeof(pmconflict_t), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
* @param pkg the package to check
|
|
||||||
* @param conflict the name of the possible conflict
|
STRDUP(conflict->package1, package1, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
* @return A depmissing struct indicating the conflict
|
STRDUP(conflict->package2, package2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
* @note The first two paramters are here to simplify the addition
|
|
||||||
* of new 'depmiss' objects.
|
return(conflict);
|
||||||
*
|
}
|
||||||
* TODO WTF is a 'depmissing' doing indicating a conflict??
|
|
||||||
*/
|
void _alpm_conflict_free(pmconflict_t *conflict)
|
||||||
static pmdepmissing_t *does_conflict(const char *target, const char *depname,
|
{
|
||||||
pmpkg_t *pkg, const char *conflict)
|
FREE(conflict->package2);
|
||||||
|
FREE(conflict->package1);
|
||||||
|
FREE(conflict);
|
||||||
|
}
|
||||||
|
|
||||||
|
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict)
|
||||||
|
{
|
||||||
|
pmconflict_t *newconflict;
|
||||||
|
CALLOC(newconflict, 1, sizeof(pmconflict_t), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
STRDUP(newconflict->package1, conflict->package1, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
STRDUP(newconflict->package2, conflict->package2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
return(newconflict);
|
||||||
|
}
|
||||||
|
|
||||||
|
int _alpm_conflict_isin(pmconflict_t *needle, alpm_list_t *haystack)
|
||||||
{
|
{
|
||||||
alpm_list_t *i;
|
alpm_list_t *i;
|
||||||
|
|
||||||
/* check the actual package name, easy */
|
ALPM_LOG_FUNC;
|
||||||
if(strcmp(alpm_pkg_get_name(pkg), conflict) == 0) {
|
|
||||||
_alpm_log(PM_LOG_DEBUG, _(" found conflict '%s' : package '%s'"), conflict, target);
|
for(i = haystack; i; i = i->next) {
|
||||||
return(_alpm_depmiss_new(target, PM_DEP_TYPE_CONFLICT,
|
pmconflict_t *conflict = i->data;
|
||||||
PM_DEP_MOD_ANY, depname, NULL));
|
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);
|
||||||
|
}
|
||||||
|
_alpm_dep_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 {
|
} else {
|
||||||
/* check what this package provides, harder */
|
_alpm_conflict_free(conflict);
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(NULL); /* not a conflict */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static alpm_list_t *chk_pkg_vs_db(alpm_list_t *baddeps, pmpkg_t *pkg, pmdb_t *db)
|
/** Check if packages from list1 conflict with packages from list2.
|
||||||
{
|
* This looks at the conflicts fields of all packages from list1, and sees
|
||||||
pmdepmissing_t *miss = NULL;
|
* if they match packages from list2.
|
||||||
const char *pkgname;
|
* If a conflict (pkg1, pkg2) is found, it is added to the baddeps list
|
||||||
alpm_list_t *i, *j;
|
* 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);
|
if(!baddeps) {
|
||||||
|
return;
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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,
|
for(j = alpm_pkg_get_conflicts(pkg1); j; j = j->next) {
|
||||||
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) {
|
|
||||||
const char *conflict = j->data;
|
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(strcmp(pkg1name, pkg2name) == 0) {
|
||||||
if(miss && !_alpm_depmiss_isin(miss, baddeps)) {
|
/* skip the package we're currently processing */
|
||||||
baddeps = alpm_list_add(baddeps, miss);
|
continue;
|
||||||
} else {
|
}
|
||||||
FREE(miss);
|
|
||||||
|
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);
|
return(baddeps);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns a alpm_list_t* of pmdepmissing_t pointers.
|
/* Check for target vs (db - target) conflicts
|
||||||
*
|
* In case of conflict the package1 field of pmdepconflict_t contains
|
||||||
* conflicts are always name only
|
* 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;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
@@ -238,27 +204,27 @@ alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages)
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = packages; i; i = i->next) {
|
alpm_list_t *dblist = alpm_list_diff(_alpm_db_get_pkgcache(db), packages,
|
||||||
pmpkg_t *pkg = i->data;
|
_alpm_pkg_cmp);
|
||||||
if(pkg == NULL) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* run three different conflict checks on each package */
|
/* two checks to be done here for conflicts */
|
||||||
baddeps = chk_pkg_vs_db(baddeps, pkg, db);
|
_alpm_log(PM_LOG_DEBUG, "check targets vs db\n");
|
||||||
baddeps = chk_pkg_vs_targets(baddeps, pkg, db, packages);
|
check_conflict(packages, dblist, &baddeps, 1);
|
||||||
baddeps = chk_db_vs_targets(baddeps, pkg, db, packages);
|
_alpm_log(PM_LOG_DEBUG, "check db vs targets\n");
|
||||||
}
|
check_conflict(dblist, packages, &baddeps, -1);
|
||||||
|
|
||||||
/* 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
alpm_list_free(dblist);
|
||||||
return(baddeps);
|
return(baddeps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Check the package conflicts in a database
|
||||||
|
*
|
||||||
|
* @param db_local the database to check
|
||||||
|
* @return an alpm_list_t of pmconflict_t
|
||||||
|
*/
|
||||||
|
alpm_list_t SYMEXPORT *alpm_checkdbconflicts(pmdb_t *db_local) {
|
||||||
|
return(_alpm_innerconflicts(_alpm_db_get_pkgcache(db_local)));
|
||||||
|
}
|
||||||
|
|
||||||
/* Returns a alpm_list_t* of file conflicts.
|
/* Returns a alpm_list_t* of file conflicts.
|
||||||
* Hooray for set-intersects!
|
* Hooray for set-intersects!
|
||||||
@@ -306,6 +272,7 @@ static alpm_list_t *chk_filedifference(alpm_list_t *filesA, alpm_list_t *filesB)
|
|||||||
alpm_list_t *ret = NULL;
|
alpm_list_t *ret = NULL;
|
||||||
alpm_list_t *pA = filesA, *pB = filesB;
|
alpm_list_t *pA = filesA, *pB = filesB;
|
||||||
|
|
||||||
|
/* if both filesA and filesB have entries, do this loop */
|
||||||
while(pA && pB) {
|
while(pA && pB) {
|
||||||
const char *strA = pA->data;
|
const char *strA = pA->data;
|
||||||
const char *strB = pB->data;
|
const char *strB = pB->data;
|
||||||
@@ -330,49 +297,66 @@ 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);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Adds pmconflict_t to a conflicts list. Pass the conflicts list, type (either
|
/* Adds pmfileconflict_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
|
* 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
|
* two package names or one package name and NULL. This is a wrapper for former
|
||||||
* functionality that was done inline.
|
* functionality that was done inline.
|
||||||
*/
|
*/
|
||||||
static alpm_list_t *add_fileconflict(alpm_list_t *conflicts,
|
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)
|
const char* name1, const char* name2)
|
||||||
{
|
{
|
||||||
pmconflict_t *conflict = malloc(sizeof(pmconflict_t));
|
pmfileconflict_t *conflict;
|
||||||
if(conflict == NULL) {
|
MALLOC(conflict, sizeof(pmfileconflict_t), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"),
|
|
||||||
sizeof(pmconflict_t));
|
|
||||||
return(conflicts);
|
|
||||||
}
|
|
||||||
conflict->type = type;
|
conflict->type = type;
|
||||||
STRNCPY(conflict->target, name1, PKG_NAME_LEN);
|
STRDUP(conflict->target, name1, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
STRNCPY(conflict->file, filestr, CONFLICT_FILE_LEN);
|
STRDUP(conflict->file, filestr, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
if(name2) {
|
if(name2) {
|
||||||
STRNCPY(conflict->ctarget, name2, PKG_NAME_LEN);
|
STRDUP(conflict->ctarget, name2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
} else {
|
} else {
|
||||||
conflict->ctarget[0] = '\0';
|
conflict->ctarget = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
conflicts = alpm_list_add(conflicts, conflict);
|
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)");
|
filestr, name1, name2 ? name2 : "(filesystem)");
|
||||||
|
|
||||||
return(conflicts);
|
return(conflicts);
|
||||||
}
|
}
|
||||||
|
|
||||||
alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
void _alpm_fileconflict_free(pmfileconflict_t *conflict)
|
||||||
{
|
{
|
||||||
alpm_list_t *i, *j, *k;
|
if(strlen(conflict->ctarget) > 0) {
|
||||||
alpm_list_t *conflicts = NULL;
|
FREE(conflict->ctarget);
|
||||||
alpm_list_t *tmpfiles = NULL;
|
}
|
||||||
|
FREE(conflict->file);;
|
||||||
|
FREE(conflict->target);
|
||||||
|
FREE(conflict);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 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_fileconflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
||||||
|
{
|
||||||
|
alpm_list_t *i, *conflicts = NULL;
|
||||||
alpm_list_t *targets = trans->packages;
|
alpm_list_t *targets = trans->packages;
|
||||||
int numtargs = alpm_list_count(targets);
|
int numtargs = alpm_list_count(targets);
|
||||||
double percent;
|
int current;
|
||||||
|
|
||||||
ALPM_LOG_FUNC;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
@@ -380,45 +364,49 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
|||||||
return(NULL);
|
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;
|
pmpkg_t *p1, *p2, *dbpkg;
|
||||||
char *filestr = NULL;
|
|
||||||
char path[PATH_MAX+1];
|
char path[PATH_MAX+1];
|
||||||
struct stat buf;
|
|
||||||
|
|
||||||
p1 = i->data;
|
p1 = i->data;
|
||||||
if(!p1) {
|
if(!p1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
percent = (double)(alpm_list_count(targets) - alpm_list_count(i) + 1)
|
double percent = (double)current / numtargs;
|
||||||
/ alpm_list_count(targets);
|
|
||||||
PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", (percent * 100),
|
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 */
|
/* CHECK 1: check every target against every target */
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "searching for file conflicts: %s\n",
|
||||||
|
alpm_pkg_get_name(p1));
|
||||||
for(j = i->next; j; j = j->next) {
|
for(j = i->next; j; j = j->next) {
|
||||||
p2 = j->data;
|
p2 = j->data;
|
||||||
if(!p2) {
|
if(!p2) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
_alpm_log(PM_LOG_DEBUG, "searching for file conflicts: %s and %s",
|
|
||||||
alpm_pkg_get_name(p1), alpm_pkg_get_name(p2));
|
|
||||||
tmpfiles = chk_fileconflicts(alpm_pkg_get_files(p1), alpm_pkg_get_files(p2));
|
tmpfiles = chk_fileconflicts(alpm_pkg_get_files(p1), alpm_pkg_get_files(p2));
|
||||||
|
|
||||||
if(tmpfiles) {
|
if(tmpfiles) {
|
||||||
char path[PATH_MAX];
|
|
||||||
for(k = tmpfiles; k; k = k->next) {
|
for(k = tmpfiles; k; k = k->next) {
|
||||||
snprintf(path, PATH_MAX, "%s%s", root, (char *)k->data);
|
snprintf(path, PATH_MAX, "%s%s", root, (char *)k->data);
|
||||||
conflicts = add_fileconflict(conflicts, PM_CONFLICT_TYPE_TARGET, path,
|
conflicts = add_fileconflict(conflicts, PM_FILECONFLICT_TARGET, path,
|
||||||
alpm_pkg_get_name(p1), alpm_pkg_get_name(p2));
|
alpm_pkg_get_name(p1), alpm_pkg_get_name(p2));
|
||||||
}
|
}
|
||||||
alpm_list_free_inner(tmpfiles, &free);
|
FREELIST(tmpfiles);
|
||||||
alpm_list_free(tmpfiles);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* declarations for second check */
|
||||||
|
struct stat lsbuf, sbuf;
|
||||||
|
char *filestr = NULL;
|
||||||
|
|
||||||
/* CHECK 2: check every target against the filesystem */
|
/* 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);
|
dbpkg = _alpm_db_get_pkgfromcache(db, p1->name);
|
||||||
|
|
||||||
/* Do two different checks here. f the package is currently installed,
|
/* Do two different checks here. f the package is currently installed,
|
||||||
@@ -426,7 +414,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 */
|
* is not currently installed, then simply stat the whole filelist */
|
||||||
if(dbpkg) {
|
if(dbpkg) {
|
||||||
/* older ver of package currently installed */
|
/* 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 {
|
} else {
|
||||||
/* no version of package currently installed */
|
/* no version of package currently installed */
|
||||||
tmpfiles = alpm_list_strdup(alpm_pkg_get_files(p1));
|
tmpfiles = alpm_list_strdup(alpm_pkg_get_files(p1));
|
||||||
@@ -434,13 +423,29 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
|||||||
|
|
||||||
/* loop over each file to be installed */
|
/* loop over each file to be installed */
|
||||||
for(j = tmpfiles; j; j = j->next) {
|
for(j = tmpfiles; j; j = j->next) {
|
||||||
|
int skip_conflict = 0;
|
||||||
filestr = j->data;
|
filestr = j->data;
|
||||||
|
|
||||||
snprintf(path, PATH_MAX, "%s%s", root, filestr);
|
snprintf(path, PATH_MAX, "%s%s", root, filestr);
|
||||||
|
|
||||||
/* stat the file - if it exists and is not a dir, do some checks */
|
/* stat the file - if it exists, do some checks */
|
||||||
if(lstat(path, &buf) == 0 && !S_ISDIR(buf.st_mode)) {
|
if(_alpm_lstat(path, &lsbuf) != 0) {
|
||||||
_alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s", path);
|
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);
|
||||||
|
|
||||||
/* Look at all the targets to see if file has changed hands */
|
/* Look at all the targets to see if file has changed hands */
|
||||||
int resolved_conflict = 0; /* have we acted on this conflict? */
|
int resolved_conflict = 0; /* have we acted on this conflict? */
|
||||||
@@ -459,42 +464,51 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root)
|
|||||||
|
|
||||||
if(localp2 && !alpm_list_find_str(pkgfiles, filestr)
|
if(localp2 && !alpm_list_find_str(pkgfiles, filestr)
|
||||||
&& alpm_list_find_str(localfiles, filestr)) {
|
&& alpm_list_find_str(localfiles, filestr)) {
|
||||||
/* check if the file is now in the backup array */
|
/* skip removal of file, but not add. this will prevent a second
|
||||||
if(alpm_list_find_str(alpm_pkg_get_backup(p1), filestr)) {
|
* package from removing the file when it was already installed
|
||||||
/* keep file intact if it is in backup array */
|
* by its new owner (whether the file is in backup array or not */
|
||||||
trans->skip_add = alpm_list_add(trans->skip_add, strdup(path));
|
trans->skip_remove = alpm_list_add(trans->skip_remove, strdup(path));
|
||||||
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);
|
||||||
_alpm_log(PM_LOG_DEBUG, "file in backup array, adding to add and remove skiplist: %s", filestr);
|
resolved_conflict = 1;
|
||||||
resolved_conflict = 1;
|
break;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!resolved_conflict) {
|
if(!resolved_conflict) {
|
||||||
_alpm_log(PM_LOG_DEBUG, "file found in conflict: %s", path);
|
_alpm_log(PM_LOG_DEBUG, "file found in conflict: %s\n", path);
|
||||||
conflicts = add_fileconflict(conflicts, PM_CONFLICT_TYPE_FILE,
|
conflicts = add_fileconflict(conflicts, PM_FILECONFLICT_FILESYSTEM,
|
||||||
path, p1->name, NULL);
|
path, p1->name, NULL);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
_alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
alpm_list_free_inner(tmpfiles, &free);
|
FREELIST(tmpfiles);
|
||||||
alpm_list_free(tmpfiles);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return(conflicts);
|
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;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
@@ -505,7 +519,7 @@ const char SYMEXPORT *alpm_conflict_get_target(pmconflict_t *conflict)
|
|||||||
return conflict->target;
|
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;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
@@ -516,7 +530,7 @@ pmconflicttype_t SYMEXPORT alpm_conflict_get_type(pmconflict_t *conflict)
|
|||||||
return conflict->type;
|
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;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
@@ -527,7 +541,7 @@ const char SYMEXPORT *alpm_conflict_get_file(pmconflict_t *conflict)
|
|||||||
return conflict->file;
|
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;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* conflict.h
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -14,27 +14,36 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
#ifndef _ALPM_CONFLICT_H
|
#ifndef _ALPM_CONFLICT_H
|
||||||
#define _ALPM_CONFLICT_H
|
#define _ALPM_CONFLICT_H
|
||||||
|
|
||||||
#include "db.h"
|
|
||||||
#include "alpm.h"
|
#include "alpm.h"
|
||||||
|
#include "db.h"
|
||||||
#define CONFLICT_FILE_LEN 512
|
#include "package.h"
|
||||||
|
|
||||||
struct __pmconflict_t {
|
struct __pmconflict_t {
|
||||||
char target[PKG_NAME_LEN];
|
char *package1;
|
||||||
pmconflicttype_t type;
|
char *package2;
|
||||||
char file[CONFLICT_FILE_LEN];
|
|
||||||
char ctarget[PKG_NAME_LEN];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
alpm_list_t *_alpm_checkconflicts(pmdb_t *db, alpm_list_t *packages);
|
struct __pmfileconflict_t {
|
||||||
alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root);
|
char *target;
|
||||||
|
pmfileconflicttype_t type;
|
||||||
|
char *file;
|
||||||
|
char *ctarget;
|
||||||
|
};
|
||||||
|
|
||||||
|
pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2);
|
||||||
|
pmconflict_t *_alpm_conflict_dup(const pmconflict_t *conflict);
|
||||||
|
void _alpm_conflict_free(pmconflict_t *conflict);
|
||||||
|
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_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, char *root);
|
||||||
|
|
||||||
|
void _alpm_fileconflict_free(pmfileconflict_t *conflict);
|
||||||
|
|
||||||
#endif /* _ALPM_CONFLICT_H */
|
#endif /* _ALPM_CONFLICT_H */
|
||||||
|
|
||||||
|
|||||||
481
lib/libalpm/db.c
481
lib/libalpm/db.c
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* db.c
|
* 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 Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
|
||||||
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
* Copyright (c) 2006 by David Kimpe <dnaku@frugalware.org>
|
||||||
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -18,17 +18,11 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__APPLE__) || defined(__OpenBSD__)
|
|
||||||
#include <sys/syslimits.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -36,44 +30,303 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <libintl.h>
|
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#ifdef CYGWIN
|
#include <time.h>
|
||||||
#include <limits.h> /* PATH_MAX */
|
|
||||||
#endif
|
/* libalpm */
|
||||||
/* pacman */
|
#include "db.h"
|
||||||
|
#include "alpm_list.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "error.h"
|
|
||||||
#include "server.h"
|
|
||||||
#include "db.h"
|
|
||||||
#include "handle.h"
|
#include "handle.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "alpm.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;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
db = calloc(1, sizeof(pmdb_t));
|
/* Sanity checks */
|
||||||
if(db == NULL) {
|
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||||
_alpm_log(PM_LOG_ERROR, _("malloc failed: could not allocate %d bytes"),
|
/* Do not unregister a database if a transaction is on-going */
|
||||||
sizeof(pmdb_t));
|
ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, -1));
|
||||||
RET_ERR(PM_ERR_MEMORY, NULL);
|
|
||||||
|
/* 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(!found) {
|
||||||
if(db->path == NULL) {
|
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
|
||||||
_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);
|
|
||||||
}
|
}
|
||||||
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)) {
|
||||||
|
db->servers = alpm_list_add(db->servers, strdup(url));
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "adding new server URL to database '%s': %s\n",
|
||||||
|
db->treename, url);
|
||||||
|
} else {
|
||||||
|
FREELIST(db->servers);
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "serverlist flushed for '%s'\n", db->treename);
|
||||||
|
}
|
||||||
|
|
||||||
|
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 *url;
|
||||||
|
|
||||||
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
|
/* Sanity checks */
|
||||||
|
ASSERT(handle != NULL, return(NULL));
|
||||||
|
ASSERT(db != NULL, return(NULL));
|
||||||
|
|
||||||
|
url = (char*)db->servers->data;
|
||||||
|
|
||||||
|
return(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 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 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);
|
||||||
|
STRDUP(db->treename, treename, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
return(db);
|
return(db);
|
||||||
}
|
}
|
||||||
@@ -82,22 +335,30 @@ void _alpm_db_free(pmdb_t *db)
|
|||||||
{
|
{
|
||||||
ALPM_LOG_FUNC;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
_FREELIST(db->servers, _alpm_server_free);
|
/* cleanup pkgcache */
|
||||||
|
_alpm_db_free_pkgcache(db);
|
||||||
|
/* cleanup server list */
|
||||||
|
FREELIST(db->servers);
|
||||||
FREE(db->path);
|
FREE(db->path);
|
||||||
|
FREE(db->treename);
|
||||||
FREE(db);
|
FREE(db);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _alpm_db_cmp(const void *db1, const void *db2)
|
int _alpm_db_cmp(const void *d1, const void *d2)
|
||||||
{
|
{
|
||||||
ALPM_LOG_FUNC;
|
pmdb_t *db1 = (pmdb_t *)db1;
|
||||||
return(strcmp(((pmdb_t *)db1)->treename, ((pmdb_t *)db2)->treename));
|
pmdb_t *db2 = (pmdb_t *)db2;
|
||||||
|
return(strcmp(db1->treename, 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;
|
||||||
|
/* copy the pkgcache- we will free the list var after each needle */
|
||||||
|
alpm_list_t *list = alpm_list_copy(_alpm_db_get_pkgcache(db));
|
||||||
|
|
||||||
ALPM_LOG_FUNC;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
@@ -108,24 +369,27 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles)
|
|||||||
if(i->data == NULL) {
|
if(i->data == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
ret = NULL;
|
||||||
targ = i->data;
|
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) {
|
if(regcomp(®, targ, REG_EXTENDED | REG_NOSUB | REG_ICASE | REG_NEWLINE) != 0) {
|
||||||
RET_ERR(PM_ERR_INVALID_REGEX, NULL);
|
RET_ERR(PM_ERR_INVALID_REGEX, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(j = _alpm_db_get_pkgcache(db); j; j = j->next) {
|
for(j = list; j; j = j->next) {
|
||||||
pmpkg_t *pkg = j->data;
|
pmpkg_t *pkg = j->data;
|
||||||
const char *matched = NULL;
|
const char *matched = NULL;
|
||||||
|
const char *name = alpm_pkg_get_name(pkg);
|
||||||
|
const char *desc = alpm_pkg_get_desc(pkg);
|
||||||
|
|
||||||
/* check name */
|
/* check name as regex AND as plain text */
|
||||||
if (regexec(®, alpm_pkg_get_name(pkg), 0, 0, 0) == 0) {
|
if(name && (regexec(®, name, 0, 0, 0) == 0 || strstr(name, targ))) {
|
||||||
matched = alpm_pkg_get_name(pkg);
|
matched = name;
|
||||||
}
|
}
|
||||||
/* check desc */
|
/* check desc */
|
||||||
else if (regexec(®, alpm_pkg_get_desc(pkg), 0, 0, 0) == 0) {
|
else if (desc && regexec(®, desc, 0, 0, 0) == 0) {
|
||||||
matched = alpm_pkg_get_desc(pkg);
|
matched = desc;
|
||||||
}
|
}
|
||||||
/* check provides */
|
/* check provides */
|
||||||
/* TODO: should we be doing this, and should we print something
|
/* TODO: should we be doing this, and should we print something
|
||||||
@@ -140,102 +404,123 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, alpm_list_t *needles)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(matched != NULL) {
|
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);
|
targ, matched);
|
||||||
ret = alpm_list_add(ret, pkg);
|
ret = alpm_list_add(ret, pkg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Free the existing search list, and use the returned list for the
|
||||||
|
* next needle. This allows for AND-based package searching. */
|
||||||
|
alpm_list_free(list);
|
||||||
|
list = ret;
|
||||||
regfree(®);
|
regfree(®);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(ret);
|
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;
|
struct stat buf;
|
||||||
pmdb_t *db;
|
pmdb_t *db;
|
||||||
|
const char *dbpath;
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
|
|
||||||
ALPM_LOG_FUNC;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
if(strcmp(treename, "local") == 0) {
|
if(handle->db_local != NULL) {
|
||||||
if(handle->db_local != NULL) {
|
_alpm_log(PM_LOG_WARNING, _("attempt to re-register the 'local' DB\n"));
|
||||||
_alpm_log(PM_LOG_WARNING, _("attempt to re-register the 'local' DB"));
|
RET_ERR(PM_ERR_DB_NOT_NULL, NULL);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_alpm_log(PM_LOG_DEBUG, _("registering database '%s'"), treename);
|
_alpm_log(PM_LOG_DEBUG, "registering local database\n");
|
||||||
|
|
||||||
/* make sure the database directory exists */
|
/* 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)) {
|
if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
|
||||||
_alpm_log(PM_LOG_ERROR, _("database directory '%s' does not exist, try creating it"), path);
|
_alpm_log(PM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n",
|
||||||
|
path);
|
||||||
if(_alpm_makepath(path) != 0) {
|
if(_alpm_makepath(path) != 0) {
|
||||||
RET_ERR(PM_ERR_SYSTEM, NULL);
|
RET_ERR(PM_ERR_SYSTEM, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
db = _alpm_db_new(handle->root, handle->dbpath, treename);
|
db = _alpm_db_new(dbpath, "local");
|
||||||
if(db == NULL) {
|
if(db == NULL) {
|
||||||
RET_ERR(PM_ERR_DB_CREATE, 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) {
|
if(_alpm_db_open(db) == -1) {
|
||||||
_alpm_db_free(db);
|
_alpm_db_free(db);
|
||||||
RET_ERR(PM_ERR_DB_OPEN, NULL);
|
RET_ERR(PM_ERR_DB_OPEN, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only call callback on NEW registration. */
|
handle->db_local = db;
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(db);
|
return(db);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char SYMEXPORT *alpm_db_get_name(pmdb_t *db)
|
pmdb_t *_alpm_db_register_sync(const char *treename)
|
||||||
{
|
|
||||||
ALPM_LOG_FUNC;
|
|
||||||
|
|
||||||
/* Sanity checks */
|
|
||||||
ASSERT(handle != NULL, return(NULL));
|
|
||||||
ASSERT(db != NULL, return(NULL));
|
|
||||||
|
|
||||||
return db->treename;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *alpm_db_get_url(pmdb_t *db)
|
|
||||||
{
|
{
|
||||||
|
struct stat buf;
|
||||||
|
pmdb_t *db;
|
||||||
|
const char *dbpath;
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
pmserver_t *s;
|
alpm_list_t *i;
|
||||||
|
|
||||||
ALPM_LOG_FUNC;
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
/* Sanity checks */
|
for(i = handle->dbs_sync; i; i = i->next) {
|
||||||
ASSERT(handle != NULL, return(NULL));
|
pmdb_t *sdb = i->data;
|
||||||
ASSERT(db != NULL, return(NULL));
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s = (pmserver_t*)db->servers->data;
|
_alpm_log(PM_LOG_DEBUG, "registering sync database '%s'\n", treename);
|
||||||
|
|
||||||
snprintf(path, PATH_MAX, "%s://%s%s", s->s_url->scheme, s->s_url->host, s->s_url->doc);
|
/* make sure the database directory exists */
|
||||||
return strdup(path);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim: set ts=2 sw=2 noet: */
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* db.h
|
* 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) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -16,15 +16,14 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
#ifndef _ALPM_DB_H
|
#ifndef _ALPM_DB_H
|
||||||
#define _ALPM_DB_H
|
#define _ALPM_DB_H
|
||||||
|
|
||||||
#include "alpm.h"
|
#include "alpm.h"
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
/* Database entries */
|
/* Database entries */
|
||||||
typedef enum _pmdbinfrq_t {
|
typedef enum _pmdbinfrq_t {
|
||||||
@@ -33,13 +32,15 @@ typedef enum _pmdbinfrq_t {
|
|||||||
INFRQ_DEPENDS = 0x04,
|
INFRQ_DEPENDS = 0x04,
|
||||||
INFRQ_FILES = 0x08,
|
INFRQ_FILES = 0x08,
|
||||||
INFRQ_SCRIPTLET = 0x10,
|
INFRQ_SCRIPTLET = 0x10,
|
||||||
INFRQ_ALL = 0xFF
|
INFRQ_DELTAS = 0x20,
|
||||||
|
/* ALL should be sum of all above */
|
||||||
|
INFRQ_ALL = 0x3F
|
||||||
} pmdbinfrq_t;
|
} pmdbinfrq_t;
|
||||||
|
|
||||||
/* Database */
|
/* Database */
|
||||||
struct __pmdb_t {
|
struct __pmdb_t {
|
||||||
char *path;
|
char *path;
|
||||||
char treename[PATH_MAX];
|
char *treename;
|
||||||
void *handle;
|
void *handle;
|
||||||
alpm_list_t *pkgcache;
|
alpm_list_t *pkgcache;
|
||||||
alpm_list_t *grpcache;
|
alpm_list_t *grpcache;
|
||||||
@@ -47,23 +48,20 @@ struct __pmdb_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* db.c, database general calls */
|
/* 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);
|
void _alpm_db_free(pmdb_t *db);
|
||||||
int _alpm_db_cmp(const void *db1, const void *db2);
|
int _alpm_db_cmp(const void *db1, const void *db2);
|
||||||
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);
|
||||||
pmdb_t *_alpm_db_register(const char *treename, alpm_cb_db_register callback);
|
pmdb_t *_alpm_db_register_local(void);
|
||||||
|
pmdb_t *_alpm_db_register_sync(const char *treename);
|
||||||
|
|
||||||
/* be.c, backend specific calls */
|
/* be.c, backend specific calls */
|
||||||
int _alpm_db_install(pmdb_t *db, const char *dbfile);
|
|
||||||
int _alpm_db_open(pmdb_t *db);
|
int _alpm_db_open(pmdb_t *db);
|
||||||
void _alpm_db_close(pmdb_t *db);
|
void _alpm_db_close(pmdb_t *db);
|
||||||
void _alpm_db_rewind(pmdb_t *db);
|
int _alpm_db_populate(pmdb_t *db);
|
||||||
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_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_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
|
||||||
int _alpm_db_remove(pmdb_t *db, pmpkg_t *info);
|
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);
|
|
||||||
|
|
||||||
#endif /* _ALPM_DB_H */
|
#endif /* _ALPM_DB_H */
|
||||||
|
|
||||||
|
|||||||
309
lib/libalpm/delta.c
Normal file
309
lib/libalpm/delta.c
Normal file
@@ -0,0 +1,309 @@
|
|||||||
|
/*
|
||||||
|
* delta.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2007-2008 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>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
/* libalpm */
|
||||||
|
#include "delta.h"
|
||||||
|
#include "alpm_list.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "log.h"
|
||||||
|
#include "graph.h"
|
||||||
|
|
||||||
|
/** \addtogroup alpm_deltas Delta Functions
|
||||||
|
* @brief Functions to manipulate libalpm deltas
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
const char SYMEXPORT *alpm_delta_get_from(pmdelta_t *delta)
|
||||||
|
{
|
||||||
|
ASSERT(delta != NULL, return(NULL));
|
||||||
|
return(delta->from);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char SYMEXPORT *alpm_delta_get_from_md5sum(pmdelta_t *delta)
|
||||||
|
{
|
||||||
|
ASSERT(delta != NULL, return(NULL));
|
||||||
|
return(delta->from_md5);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char SYMEXPORT *alpm_delta_get_to(pmdelta_t *delta)
|
||||||
|
{
|
||||||
|
ASSERT(delta != NULL, return(NULL));
|
||||||
|
return(delta->to);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char SYMEXPORT *alpm_delta_get_to_md5sum(pmdelta_t *delta)
|
||||||
|
{
|
||||||
|
ASSERT(delta != NULL, return(NULL));
|
||||||
|
return(delta->to_md5);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char SYMEXPORT *alpm_delta_get_filename(pmdelta_t *delta)
|
||||||
|
{
|
||||||
|
ASSERT(delta != NULL, return(NULL));
|
||||||
|
return(delta->delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char SYMEXPORT *alpm_delta_get_md5sum(pmdelta_t *delta)
|
||||||
|
{
|
||||||
|
ASSERT(delta != NULL, return(NULL));
|
||||||
|
return(delta->delta_md5);
|
||||||
|
}
|
||||||
|
|
||||||
|
off_t SYMEXPORT alpm_delta_get_size(pmdelta_t *delta)
|
||||||
|
{
|
||||||
|
ASSERT(delta != NULL, return(-1));
|
||||||
|
return(delta->delta_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
||||||
|
static alpm_list_t *delta_graph_init(alpm_list_t *deltas)
|
||||||
|
{
|
||||||
|
alpm_list_t *i, *j;
|
||||||
|
alpm_list_t *vertices = NULL;
|
||||||
|
/* create the vertices */
|
||||||
|
for(i = deltas; i; i = i->next) {
|
||||||
|
char *fpath, *md5sum;
|
||||||
|
pmgraph_t *v = _alpm_graph_new();
|
||||||
|
pmdelta_t *vdelta = i->data;
|
||||||
|
vdelta->download_size = vdelta->delta_size;
|
||||||
|
v->weight = LONG_MAX;
|
||||||
|
|
||||||
|
/* determine whether the delta file already exists */
|
||||||
|
fpath = _alpm_filecache_find(vdelta->delta);
|
||||||
|
md5sum = alpm_get_md5sum(fpath);
|
||||||
|
if(fpath && md5sum && strcmp(md5sum, vdelta->delta_md5) == 0) {
|
||||||
|
vdelta->download_size = 0;
|
||||||
|
}
|
||||||
|
FREE(fpath);
|
||||||
|
FREE(md5sum);
|
||||||
|
|
||||||
|
/* determine whether a base 'from' file exists */
|
||||||
|
fpath = _alpm_filecache_find(vdelta->from);
|
||||||
|
md5sum = alpm_get_md5sum(fpath);
|
||||||
|
if(fpath && md5sum && strcmp(md5sum, vdelta->from_md5) == 0) {
|
||||||
|
v->weight = vdelta->download_size;
|
||||||
|
}
|
||||||
|
FREE(fpath);
|
||||||
|
FREE(md5sum);
|
||||||
|
|
||||||
|
v->data = vdelta;
|
||||||
|
vertices = alpm_list_add(vertices, v);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* compute the edges */
|
||||||
|
for(i = vertices; i; i = i->next) {
|
||||||
|
pmgraph_t *v_i = i->data;
|
||||||
|
pmdelta_t *d_i = v_i->data;
|
||||||
|
/* loop a second time so we make all possible comparisons */
|
||||||
|
for(j = vertices; j; j = j->next) {
|
||||||
|
pmgraph_t *v_j = j->data;
|
||||||
|
pmdelta_t *d_j = v_j->data;
|
||||||
|
/* We want to create a delta tree like the following:
|
||||||
|
* 1_to_2
|
||||||
|
* |
|
||||||
|
* 1_to_3 2_to_3
|
||||||
|
* \ /
|
||||||
|
* 3_to_4
|
||||||
|
* If J 'from' is equal to I 'to', then J is a child of I.
|
||||||
|
* */
|
||||||
|
if(strcmp(d_j->from, d_i->to) == 0
|
||||||
|
&& strcmp(d_j->from_md5, d_i->to_md5) == 0) {
|
||||||
|
v_i->children = alpm_list_add(v_i->children, v_j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
v_i->childptr = v_i->children;
|
||||||
|
}
|
||||||
|
return(vertices);
|
||||||
|
}
|
||||||
|
|
||||||
|
static off_t delta_vert(alpm_list_t *vertices,
|
||||||
|
const char *to, const char *to_md5, alpm_list_t **path) {
|
||||||
|
alpm_list_t *i;
|
||||||
|
pmgraph_t *v;
|
||||||
|
while(1) {
|
||||||
|
v = NULL;
|
||||||
|
/* find the smallest vertice not visited yet */
|
||||||
|
for(i = vertices; i; i = i->next) {
|
||||||
|
pmgraph_t *v_i = i->data;
|
||||||
|
|
||||||
|
if(v_i->state == -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(v == NULL || v_i->weight < v->weight) {
|
||||||
|
v = v_i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(v == NULL || v->weight == LONG_MAX) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
v->state = -1;
|
||||||
|
|
||||||
|
v->childptr = v->children;
|
||||||
|
while(v->childptr) {
|
||||||
|
pmgraph_t *v_c = v->childptr->data;
|
||||||
|
pmdelta_t *d_c = v_c->data;
|
||||||
|
if(v_c->weight > v->weight + d_c->download_size) {
|
||||||
|
v_c->weight = v->weight + d_c->download_size;
|
||||||
|
v_c->parent = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
v->childptr = (v->childptr)->next;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
v = NULL;
|
||||||
|
off_t bestsize = 0;
|
||||||
|
|
||||||
|
for(i = vertices; i; i = i->next) {
|
||||||
|
pmgraph_t *v_i = i->data;
|
||||||
|
pmdelta_t *d_i = v_i->data;
|
||||||
|
|
||||||
|
if(strcmp(d_i->to, to) == 0
|
||||||
|
|| strcmp(d_i->to_md5, to_md5) == 0) {
|
||||||
|
if(v == NULL || v_i->weight < v->weight) {
|
||||||
|
v = v_i;
|
||||||
|
bestsize = v->weight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
alpm_list_t *rpath = NULL;
|
||||||
|
while(v != NULL) {
|
||||||
|
pmdelta_t *vdelta = v->data;
|
||||||
|
rpath = alpm_list_add(rpath, vdelta);
|
||||||
|
v = v->parent;
|
||||||
|
}
|
||||||
|
*path = alpm_list_reverse(rpath);
|
||||||
|
alpm_list_free(rpath);
|
||||||
|
|
||||||
|
return(bestsize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 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 file has
|
||||||
|
* @param to the file to start the search at
|
||||||
|
* @param to_md5 the md5sum of the above named file
|
||||||
|
* @param path the pointer to a list location where pmdelta_t * objects that
|
||||||
|
* have the smallest size are placed. NULL is set if there is no path
|
||||||
|
* possible with the files available.
|
||||||
|
* @return the size of the path stored, or LONG_MAX if path is unfindable
|
||||||
|
*/
|
||||||
|
off_t _alpm_shortest_delta_path(alpm_list_t *deltas,
|
||||||
|
const char *to, const char *to_md5, alpm_list_t **path)
|
||||||
|
{
|
||||||
|
alpm_list_t *bestpath = NULL;
|
||||||
|
alpm_list_t *vertices;
|
||||||
|
off_t bestsize = LONG_MAX;
|
||||||
|
|
||||||
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
|
if(deltas == NULL) {
|
||||||
|
*path = NULL;
|
||||||
|
return(bestsize);
|
||||||
|
}
|
||||||
|
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "started delta shortest-path search\n");
|
||||||
|
|
||||||
|
vertices = delta_graph_init(deltas);
|
||||||
|
|
||||||
|
bestsize = delta_vert(vertices, to, to_md5, &bestpath);
|
||||||
|
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "delta shortest-path search complete\n");
|
||||||
|
|
||||||
|
alpm_list_free_inner(vertices, _alpm_graph_free);
|
||||||
|
alpm_list_free(vertices);
|
||||||
|
|
||||||
|
*path = bestpath;
|
||||||
|
return(bestsize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Parses the string representation of a pmdelta_t object.
|
||||||
|
* This function assumes that the string is in the correct format.
|
||||||
|
* This format is as follows:
|
||||||
|
* $oldfile $oldmd5 $newfile $newmd5 $deltafile $deltamd5 $deltasize
|
||||||
|
* @param line the string to parse
|
||||||
|
* @return A pointer to the new pmdelta_t object
|
||||||
|
*/
|
||||||
|
/* TODO this does not really belong here, but in a parsing lib */
|
||||||
|
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';
|
||||||
|
STRDUP(delta->from, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
tmp2 = tmp;
|
||||||
|
tmp = strchr(tmp, ' ');
|
||||||
|
*(tmp++) = '\0';
|
||||||
|
STRDUP(delta->from_md5, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
tmp2 = tmp;
|
||||||
|
tmp = strchr(tmp, ' ');
|
||||||
|
*(tmp++) = '\0';
|
||||||
|
STRDUP(delta->to, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
tmp2 = tmp;
|
||||||
|
tmp = strchr(tmp, ' ');
|
||||||
|
*(tmp++) = '\0';
|
||||||
|
STRDUP(delta->to_md5, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
tmp2 = tmp;
|
||||||
|
tmp = strchr(tmp, ' ');
|
||||||
|
*(tmp++) = '\0';
|
||||||
|
STRDUP(delta->delta, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
tmp2 = tmp;
|
||||||
|
tmp = strchr(tmp, ' ');
|
||||||
|
*(tmp++) = '\0';
|
||||||
|
STRDUP(delta->delta_md5, tmp2, RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
|
||||||
|
delta->delta_size = atol(tmp);
|
||||||
|
|
||||||
|
return(delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _alpm_delta_free(pmdelta_t *delta)
|
||||||
|
{
|
||||||
|
FREE(delta->from);
|
||||||
|
FREE(delta->from_md5);
|
||||||
|
FREE(delta->to);
|
||||||
|
FREE(delta->to_md5);
|
||||||
|
FREE(delta->delta);
|
||||||
|
FREE(delta->delta_md5);
|
||||||
|
FREE(delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
52
lib/libalpm/delta.h
Normal file
52
lib/libalpm/delta.h
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* delta.h
|
||||||
|
*
|
||||||
|
* Copyright (c) 2007-2008 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 <sys/types.h> /* off_t */
|
||||||
|
|
||||||
|
#include "alpm.h"
|
||||||
|
|
||||||
|
struct __pmdelta_t {
|
||||||
|
/** filename of the 'before' file */
|
||||||
|
char *from;
|
||||||
|
/** md5sum of the 'before' file */
|
||||||
|
char *from_md5;
|
||||||
|
/** filename of the 'after' file */
|
||||||
|
char *to;
|
||||||
|
/** md5sum of the 'after' file */
|
||||||
|
char *to_md5;
|
||||||
|
/** filename of the delta patch */
|
||||||
|
char *delta;
|
||||||
|
/** md5sum of the delta file */
|
||||||
|
char *delta_md5;
|
||||||
|
/** filesize of the delta file */
|
||||||
|
off_t delta_size;
|
||||||
|
/** download filesize of the delta file */
|
||||||
|
off_t download_size;
|
||||||
|
};
|
||||||
|
|
||||||
|
pmdelta_t *_alpm_delta_parse(char *line);
|
||||||
|
void _alpm_delta_free(pmdelta_t *delta);
|
||||||
|
off_t _alpm_shortest_delta_path(alpm_list_t *deltas,
|
||||||
|
const char *to, const char *to_md5, alpm_list_t **path);
|
||||||
|
|
||||||
|
#endif /* _ALPM_DELTA_H */
|
||||||
|
|
||||||
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
1090
lib/libalpm/deps.c
1090
lib/libalpm/deps.c
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* deps.h
|
* 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) 2005 by Aurelien Foret <orelien@chez.com>
|
||||||
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -16,9 +16,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
#ifndef _ALPM_DEPS_H
|
#ifndef _ALPM_DEPS_H
|
||||||
#define _ALPM_DEPS_H
|
#define _ALPM_DEPS_H
|
||||||
@@ -31,29 +29,30 @@
|
|||||||
/* Dependency */
|
/* Dependency */
|
||||||
struct __pmdepend_t {
|
struct __pmdepend_t {
|
||||||
pmdepmod_t mod;
|
pmdepmod_t mod;
|
||||||
char name[PKG_NAME_LEN];
|
char *name;
|
||||||
char version[PKG_VERSION_LEN];
|
char *version;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Missing dependency */
|
/* Missing dependency */
|
||||||
struct __pmdepmissing_t {
|
struct __pmdepmissing_t {
|
||||||
char target[PKG_NAME_LEN];
|
char *target;
|
||||||
pmdeptype_t type;
|
pmdepend_t *depend;
|
||||||
pmdepend_t depend;
|
char *causingpkg; /* this is used in case of remove dependency error only */
|
||||||
};
|
};
|
||||||
|
|
||||||
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdeptype_t type,
|
void _alpm_dep_free(pmdepend_t *dep);
|
||||||
pmdepmod_t depmod, const char *depname,
|
pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep);
|
||||||
const char *depversion);
|
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdepend_t *dep,
|
||||||
int _alpm_depmiss_isin(pmdepmissing_t *needle, alpm_list_t *haystack);
|
const char *causinpkg);
|
||||||
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode);
|
void _alpm_depmiss_free(pmdepmissing_t *miss);
|
||||||
alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
|
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int reverse);
|
||||||
alpm_list_t *packages);
|
void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit);
|
||||||
|
pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *excluding, pmpkg_t *tpkg);
|
||||||
|
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, alpm_list_t *list,
|
||||||
|
alpm_list_t *remove, alpm_list_t **data);
|
||||||
|
int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2);
|
||||||
pmdepend_t *_alpm_splitdep(const char *depstring);
|
pmdepend_t *_alpm_splitdep(const char *depstring);
|
||||||
alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs);
|
pmpkg_t *_alpm_find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep);
|
||||||
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);
|
|
||||||
|
|
||||||
#endif /* _ALPM_DEPS_H */
|
#endif /* _ALPM_DEPS_H */
|
||||||
|
|
||||||
|
|||||||
463
lib/libalpm/dload.c
Normal file
463
lib/libalpm/dload.c
Normal file
@@ -0,0 +1,463 @@
|
|||||||
|
/*
|
||||||
|
* download.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2002-2008 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 <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <limits.h>
|
||||||
|
/* the following two are needed on BSD for libfetch */
|
||||||
|
#if defined(HAVE_SYS_SYSLIMITS_H)
|
||||||
|
#include <sys/syslimits.h> /* PATH_MAX */
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_SYS_PARAM_H)
|
||||||
|
#include <sys/param.h> /* MAXHOSTNAMELEN */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_LIBDOWNLOAD)
|
||||||
|
#include <download.h>
|
||||||
|
#elif defined(HAVE_LIBFETCH)
|
||||||
|
#include <fetch.h>
|
||||||
|
#define downloadFreeURL fetchFreeURL
|
||||||
|
#define downloadLastErrCode fetchLastErrCode
|
||||||
|
#define downloadLastErrString fetchLastErrString
|
||||||
|
#define downloadParseURL fetchParseURL
|
||||||
|
#define downloadTimeout fetchTimeout
|
||||||
|
#define downloadXGet fetchXGet
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* libalpm */
|
||||||
|
#include "dload.h"
|
||||||
|
#include "alpm_list.h"
|
||||||
|
#include "alpm.h"
|
||||||
|
#include "log.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "handle.h"
|
||||||
|
|
||||||
|
static char *get_filename(const char *url) {
|
||||||
|
char *filename = strrchr(url, '/');
|
||||||
|
if(filename != NULL) {
|
||||||
|
filename++;
|
||||||
|
}
|
||||||
|
return(filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *get_destfile(const char *path, const char *filename) {
|
||||||
|
char *destfile;
|
||||||
|
/* len = localpath len + filename len + null */
|
||||||
|
int len = strlen(path) + strlen(filename) + 1;
|
||||||
|
CALLOC(destfile, len, sizeof(char), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
snprintf(destfile, len, "%s%s", path, filename);
|
||||||
|
|
||||||
|
return(destfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *get_tempfile(const char *path, const char *filename) {
|
||||||
|
char *tempfile;
|
||||||
|
/* len = localpath len + filename len + '.part' len + null */
|
||||||
|
int len = strlen(path) + strlen(filename) + 6;
|
||||||
|
CALLOC(tempfile, len, sizeof(char), RET_ERR(PM_ERR_MEMORY, NULL));
|
||||||
|
snprintf(tempfile, len, "%s%s.part", path, filename);
|
||||||
|
|
||||||
|
return(tempfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(INTERNAL_DOWNLOAD)
|
||||||
|
/* Build a 'struct url' from an url. */
|
||||||
|
static struct url *url_for_string(const char *url)
|
||||||
|
{
|
||||||
|
struct url *ret = NULL;
|
||||||
|
ret = downloadParseURL(url);
|
||||||
|
if(!ret) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("url '%s' is invalid\n"), url);
|
||||||
|
RET_ERR(PM_ERR_SERVER_BAD_URL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if no URL scheme specified, assume HTTP */
|
||||||
|
if(strlen(ret->scheme) == 0) {
|
||||||
|
_alpm_log(PM_LOG_WARNING, _("url scheme not specified, assuming HTTP\n"));
|
||||||
|
strcpy(ret->scheme, SCHEME_HTTP);
|
||||||
|
}
|
||||||
|
/* add a user & password for anonymous FTP */
|
||||||
|
if(strcmp(ret->scheme,SCHEME_FTP) == 0 && strlen(ret->user) == 0) {
|
||||||
|
strcpy(ret->user, "anonymous");
|
||||||
|
strcpy(ret->pwd, "libalpm@guest");
|
||||||
|
}
|
||||||
|
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int download_internal(const char *url, const char *localpath,
|
||||||
|
time_t mtimeold, time_t *mtimenew) {
|
||||||
|
FILE *dlf, *localf = NULL;
|
||||||
|
struct url_stat ust;
|
||||||
|
struct stat st;
|
||||||
|
int chk_resume = 0;
|
||||||
|
size_t dl_thisfile = 0;
|
||||||
|
char *tempfile, *destfile, *filename;
|
||||||
|
int ret = 0;
|
||||||
|
struct url *fileurl = url_for_string(url);
|
||||||
|
|
||||||
|
if(!fileurl) {
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
filename = get_filename(url);
|
||||||
|
if(!filename) {
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
destfile = get_destfile(localpath, filename);
|
||||||
|
tempfile = get_tempfile(localpath, filename);
|
||||||
|
|
||||||
|
/* pass the raw filename for passing to the callback function */
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "using '%s' for download progress\n", filename);
|
||||||
|
|
||||||
|
if(stat(tempfile, &st) == 0 && st.st_size > 0) {
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "existing file found, using it\n");
|
||||||
|
fileurl->offset = (off_t)st.st_size;
|
||||||
|
dl_thisfile = st.st_size;
|
||||||
|
localf = fopen(tempfile, "ab");
|
||||||
|
chk_resume = 1;
|
||||||
|
} else {
|
||||||
|
fileurl->offset = (off_t)0;
|
||||||
|
dl_thisfile = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* libdownload does not reset the error code, reset it in
|
||||||
|
* the case of previous errors */
|
||||||
|
downloadLastErrCode = 0;
|
||||||
|
|
||||||
|
/* 10s timeout - TODO make a config option */
|
||||||
|
downloadTimeout = 10000;
|
||||||
|
|
||||||
|
dlf = downloadXGet(fileurl, &ust, (handle->nopassiveftp ? "" : "p"));
|
||||||
|
|
||||||
|
if(downloadLastErrCode != 0 || dlf == NULL) {
|
||||||
|
const char *host = _("disk");
|
||||||
|
if(strcmp(SCHEME_FILE, fileurl->scheme) != 0) {
|
||||||
|
host = fileurl->host;
|
||||||
|
}
|
||||||
|
pm_errno = PM_ERR_LIBDOWNLOAD;
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"),
|
||||||
|
filename, host, downloadLastErrString);
|
||||||
|
ret = -1;
|
||||||
|
goto cleanup;
|
||||||
|
} else {
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "connected to %s successfully\n", fileurl->host);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ust.mtime && mtimeold && ust.mtime == mtimeold) {
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "mtimes are identical, skipping %s\n", filename);
|
||||||
|
ret = 1;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ust.mtime && mtimenew) {
|
||||||
|
*mtimenew = ust.mtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(chk_resume && fileurl->offset == 0) {
|
||||||
|
_alpm_log(PM_LOG_WARNING, _("cannot resume download, starting over\n"));
|
||||||
|
if(localf != NULL) {
|
||||||
|
fclose(localf);
|
||||||
|
localf = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(localf == NULL) {
|
||||||
|
_alpm_rmrf(tempfile);
|
||||||
|
fileurl->offset = (off_t)0;
|
||||||
|
dl_thisfile = 0;
|
||||||
|
localf = fopen(tempfile, "wb");
|
||||||
|
if(localf == NULL) { /* still null? */
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("cannot write to file '%s'\n"), tempfile);
|
||||||
|
ret = -1;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Progress 0 - initialize */
|
||||||
|
if(handle->dlcb) {
|
||||||
|
handle->dlcb(filename, 0, ust.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t nread = 0;
|
||||||
|
char buffer[PM_DLBUF_LEN];
|
||||||
|
while((nread = fread(buffer, 1, PM_DLBUF_LEN, dlf)) > 0) {
|
||||||
|
if(ferror(dlf)) {
|
||||||
|
pm_errno = PM_ERR_LIBDOWNLOAD;
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("error downloading '%s': %s\n"),
|
||||||
|
filename, downloadLastErrString);
|
||||||
|
ret = -1;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t nwritten = 0;
|
||||||
|
while(nwritten < nread) {
|
||||||
|
nwritten += fwrite(buffer, 1, (nread - nwritten), localf);
|
||||||
|
if(ferror(localf)) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("error writing to file '%s': %s\n"),
|
||||||
|
destfile, strerror(errno));
|
||||||
|
ret = -1;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dl_thisfile += nread;
|
||||||
|
|
||||||
|
if(handle->dlcb) {
|
||||||
|
handle->dlcb(filename, dl_thisfile, ust.size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* probably safer to close the file descriptors now before renaming the file,
|
||||||
|
* for example to make sure the buffers are flushed.
|
||||||
|
*/
|
||||||
|
fclose(localf);
|
||||||
|
localf = NULL;
|
||||||
|
fclose(dlf);
|
||||||
|
dlf = NULL;
|
||||||
|
|
||||||
|
rename(tempfile, destfile);
|
||||||
|
ret = 0;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
FREE(tempfile);
|
||||||
|
FREE(destfile);
|
||||||
|
if(localf != NULL) {
|
||||||
|
fclose(localf);
|
||||||
|
}
|
||||||
|
if(dlf != NULL) {
|
||||||
|
fclose(dlf);
|
||||||
|
}
|
||||||
|
downloadFreeURL(fileurl);
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static int download_external(const char *url, const char *localpath,
|
||||||
|
time_t mtimeold, time_t *mtimenew) {
|
||||||
|
int ret = 0;
|
||||||
|
int retval;
|
||||||
|
int usepart = 0;
|
||||||
|
char *ptr1, *ptr2;
|
||||||
|
char origCmd[PATH_MAX];
|
||||||
|
char parsedCmd[PATH_MAX] = "";
|
||||||
|
char cwd[PATH_MAX];
|
||||||
|
char *destfile, *tempfile, *filename;
|
||||||
|
|
||||||
|
if(!handle->xfercommand) {
|
||||||
|
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
filename = get_filename(url);
|
||||||
|
if(!filename) {
|
||||||
|
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);
|
||||||
|
}
|
||||||
|
destfile = get_destfile(localpath, filename);
|
||||||
|
tempfile = get_tempfile(localpath, filename);
|
||||||
|
|
||||||
|
/* replace all occurrences of %o with fn.part */
|
||||||
|
strncpy(origCmd, handle->xfercommand, sizeof(origCmd));
|
||||||
|
ptr1 = origCmd;
|
||||||
|
while((ptr2 = strstr(ptr1, "%o"))) {
|
||||||
|
usepart = 1;
|
||||||
|
ptr2[0] = '\0';
|
||||||
|
strcat(parsedCmd, ptr1);
|
||||||
|
strcat(parsedCmd, tempfile);
|
||||||
|
ptr1 = ptr2 + 2;
|
||||||
|
}
|
||||||
|
strcat(parsedCmd, ptr1);
|
||||||
|
/* replace all occurrences of %u with the download URL */
|
||||||
|
strncpy(origCmd, parsedCmd, sizeof(origCmd));
|
||||||
|
parsedCmd[0] = '\0';
|
||||||
|
ptr1 = origCmd;
|
||||||
|
while((ptr2 = strstr(ptr1, "%u"))) {
|
||||||
|
ptr2[0] = '\0';
|
||||||
|
strcat(parsedCmd, ptr1);
|
||||||
|
strcat(parsedCmd, url);
|
||||||
|
ptr1 = ptr2 + 2;
|
||||||
|
}
|
||||||
|
strcat(parsedCmd, ptr1);
|
||||||
|
/* cwd to the download directory */
|
||||||
|
getcwd(cwd, PATH_MAX);
|
||||||
|
if(chdir(localpath)) {
|
||||||
|
_alpm_log(PM_LOG_WARNING, _("could not chdir to %s\n"), localpath);
|
||||||
|
pm_errno = PM_ERR_EXTERNAL_DOWNLOAD;
|
||||||
|
ret = -1;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
/* execute the parsed command via /bin/sh -c */
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "running command: %s\n", parsedCmd);
|
||||||
|
retval = system(parsedCmd);
|
||||||
|
|
||||||
|
if(retval == -1) {
|
||||||
|
_alpm_log(PM_LOG_WARNING, _("running XferCommand: fork failed!\n"));
|
||||||
|
pm_errno = PM_ERR_EXTERNAL_DOWNLOAD;
|
||||||
|
ret = -1;
|
||||||
|
} else if(retval != 0) {
|
||||||
|
/* download failed */
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "XferCommand command returned non-zero status "
|
||||||
|
"code (%d)\n", retval);
|
||||||
|
ret = -1;
|
||||||
|
} else {
|
||||||
|
/* download was successful */
|
||||||
|
if(usepart) {
|
||||||
|
rename(tempfile, destfile);
|
||||||
|
}
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
chdir(cwd);
|
||||||
|
if(ret == -1) {
|
||||||
|
/* hack to let an user the time to cancel a download */
|
||||||
|
sleep(2);
|
||||||
|
}
|
||||||
|
FREE(destfile);
|
||||||
|
FREE(tempfile);
|
||||||
|
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int download(const char *url, const char *localpath,
|
||||||
|
time_t mtimeold, time_t *mtimenew) {
|
||||||
|
int ret;
|
||||||
|
const char *proto = "file://";
|
||||||
|
int len = strlen(proto);
|
||||||
|
if(strncmp(url, proto, len) == 0) {
|
||||||
|
/* we can simply grab an absolute path from the file:// url by starting
|
||||||
|
* our path at the char following the proto (the root '/')
|
||||||
|
*/
|
||||||
|
const char *sourcefile = url + len;
|
||||||
|
const char *filename = get_filename(url);
|
||||||
|
char *destfile = get_destfile(localpath, filename);
|
||||||
|
|
||||||
|
ret = _alpm_copyfile(sourcefile, destfile);
|
||||||
|
FREE(destfile);
|
||||||
|
/* copyfile returns 1 on failure, we want to return -1 on failure */
|
||||||
|
return(ret ? -1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We have a few things to take into account here.
|
||||||
|
* 1. If we have both internal/external available, choose based on
|
||||||
|
* whether xfercommand is populated.
|
||||||
|
* 2. If we only have external available, we should first check
|
||||||
|
* if a command was provided before we drop into download_external.
|
||||||
|
*/
|
||||||
|
if(handle->xfercommand == NULL) {
|
||||||
|
#if defined(INTERNAL_DOWNLOAD)
|
||||||
|
ret = download_internal(url, localpath, mtimeold, mtimenew);
|
||||||
|
#else
|
||||||
|
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
ret = download_external(url, localpath, mtimeold, mtimenew);
|
||||||
|
}
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Download a single file
|
||||||
|
* - if mtimeold is non-NULL, then only download the file if it's different
|
||||||
|
* than mtimeold.
|
||||||
|
* - if *mtimenew is non-NULL, it will be filled with the mtime of the remote
|
||||||
|
* file.
|
||||||
|
*
|
||||||
|
* RETURN: 0 for successful download
|
||||||
|
* 1 if the mtimes are identical
|
||||||
|
* -1 on error
|
||||||
|
*/
|
||||||
|
int _alpm_download_single_file(const char *filename,
|
||||||
|
alpm_list_t *servers, const char *localpath,
|
||||||
|
time_t mtimeold, time_t *mtimenew)
|
||||||
|
{
|
||||||
|
alpm_list_t *i;
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
|
for(i = servers; i; i = i->next) {
|
||||||
|
const char *server = i->data;
|
||||||
|
char *fileurl = NULL;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
/* print server + filename into a buffer */
|
||||||
|
len = strlen(server) + strlen(filename) + 2;
|
||||||
|
CALLOC(fileurl, len, sizeof(char), RET_ERR(PM_ERR_MEMORY, -1));
|
||||||
|
snprintf(fileurl, len, "%s/%s", server, filename);
|
||||||
|
|
||||||
|
ret = download(fileurl, localpath, mtimeold, mtimenew);
|
||||||
|
FREE(fileurl);
|
||||||
|
if(ret != -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
int _alpm_download_files(alpm_list_t *files,
|
||||||
|
alpm_list_t *servers, const char *localpath)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
alpm_list_t *lp;
|
||||||
|
|
||||||
|
for(lp = files; lp; lp = lp->next) {
|
||||||
|
char *filename = lp->data;
|
||||||
|
if(_alpm_download_single_file(filename, servers,
|
||||||
|
localpath, 0, NULL) == -1) {
|
||||||
|
ret++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fetch a remote pkg.
|
||||||
|
* @param url URL of the package to download
|
||||||
|
* @return the downloaded filepath on success, NULL on error
|
||||||
|
* @addtogroup alpm_misc
|
||||||
|
*/
|
||||||
|
char SYMEXPORT *alpm_fetch_pkgurl(const char *url)
|
||||||
|
{
|
||||||
|
char *filename, *filepath;
|
||||||
|
const char *cachedir;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ALPM_LOG_FUNC;
|
||||||
|
|
||||||
|
filename = get_filename(url);
|
||||||
|
|
||||||
|
/* find a valid cache dir to download to */
|
||||||
|
cachedir = _alpm_filecache_setup();
|
||||||
|
|
||||||
|
/* download the file */
|
||||||
|
ret = download(url, cachedir, 0, NULL);
|
||||||
|
if(ret == -1) {
|
||||||
|
_alpm_log(PM_LOG_WARNING, _("failed to download %s\n"), url);
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "successfully downloaded %s\n", url);
|
||||||
|
|
||||||
|
/* we should be able to find the file the second time around */
|
||||||
|
filepath = _alpm_filecache_find(filename);
|
||||||
|
return(filepath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* provide.h
|
* dload.h
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -14,19 +14,25 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
#ifndef _ALPM_PROVIDE_H
|
#ifndef _ALPM_DLOAD_H
|
||||||
#define _ALPM_PROVIDE_H
|
#define _ALPM_DLOAD_H
|
||||||
|
|
||||||
#include "db.h"
|
|
||||||
#include "alpm_list.h"
|
#include "alpm_list.h"
|
||||||
#include "config.h"
|
#include "alpm.h"
|
||||||
|
|
||||||
alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package);
|
#include <time.h>
|
||||||
|
|
||||||
#endif /* _ALPM_PROVIDE_H */
|
#define PM_DLBUF_LEN (1024 * 10)
|
||||||
|
|
||||||
|
int _alpm_download_single_file(const char *filename,
|
||||||
|
alpm_list_t *servers, const char *localpath,
|
||||||
|
time_t mtimeold, time_t *mtimenew);
|
||||||
|
|
||||||
|
int _alpm_download_files(alpm_list_t *files,
|
||||||
|
alpm_list_t *servers, const char *localpath);
|
||||||
|
|
||||||
|
#endif /* _ALPM_DLOAD_H */
|
||||||
|
|
||||||
/* vim: set ts=2 sw=2 noet: */
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* error.c
|
* error.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
* Copyright (c) 2002-2008 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@@ -17,16 +14,39 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libintl.h>
|
#include "config.h"
|
||||||
|
|
||||||
|
/* TODO: needed for the libfetch stuff, unfortunately- we should kill it */
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <limits.h>
|
||||||
|
/* the following two are needed on BSD for libfetch */
|
||||||
|
#if defined(HAVE_SYS_SYSLIMITS_H)
|
||||||
|
#include <sys/syslimits.h> /* PATH_MAX */
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_SYS_PARAM_H)
|
||||||
|
#include <sys/param.h> /* MAXHOSTNAMELEN */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_LIBDOWNLOAD)
|
||||||
|
#include <download.h> /* downloadLastErrString */
|
||||||
|
#elif defined(HAVE_LIBFETCH)
|
||||||
|
#include <fetch.h> /* fetchLastErrString */
|
||||||
|
#define downloadLastErrString fetchLastErrString
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* libalpm */
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "alpm.h"
|
#include "alpm.h"
|
||||||
|
|
||||||
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) {
|
switch(err) {
|
||||||
/* System */
|
/* System */
|
||||||
@@ -38,6 +58,8 @@ char SYMEXPORT *alpm_strerror(int err)
|
|||||||
return _("insufficient privileges");
|
return _("insufficient privileges");
|
||||||
case PM_ERR_NOT_A_FILE:
|
case PM_ERR_NOT_A_FILE:
|
||||||
return _("could not find or read 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:
|
case PM_ERR_WRONG_ARGS:
|
||||||
return _("wrong or NULL argument passed");
|
return _("wrong or NULL argument passed");
|
||||||
/* Interface */
|
/* Interface */
|
||||||
@@ -65,13 +87,6 @@ char SYMEXPORT *alpm_strerror(int err)
|
|||||||
/* Servers */
|
/* Servers */
|
||||||
case PM_ERR_SERVER_BAD_URL:
|
case PM_ERR_SERVER_BAD_URL:
|
||||||
return _("invalid url for server");
|
return _("invalid url for server");
|
||||||
/* Configuration */
|
|
||||||
case PM_ERR_OPT_LOGFILE:
|
|
||||||
case PM_ERR_OPT_DBPATH:
|
|
||||||
case PM_ERR_OPT_LOCALDB:
|
|
||||||
case PM_ERR_OPT_SYNCDB:
|
|
||||||
case PM_ERR_OPT_USESYSLOG:
|
|
||||||
return _("could not set parameter");
|
|
||||||
/* Transactions */
|
/* Transactions */
|
||||||
case PM_ERR_TRANS_NOT_NULL:
|
case PM_ERR_TRANS_NOT_NULL:
|
||||||
return _("transaction already initialized");
|
return _("transaction already initialized");
|
||||||
@@ -100,18 +115,19 @@ char SYMEXPORT *alpm_strerror(int err)
|
|||||||
return _("cannot open package file");
|
return _("cannot open package file");
|
||||||
case PM_ERR_PKG_LOAD:
|
case PM_ERR_PKG_LOAD:
|
||||||
return _("cannot load package data");
|
return _("cannot load package data");
|
||||||
case PM_ERR_PKG_INSTALLED:
|
|
||||||
return _("package already installed");
|
|
||||||
case PM_ERR_PKG_CANT_FRESH:
|
case PM_ERR_PKG_CANT_FRESH:
|
||||||
return _("package not installed or lesser version");
|
return _("package not installed or lesser version");
|
||||||
case PM_ERR_PKG_CANT_REMOVE:
|
case PM_ERR_PKG_CANT_REMOVE:
|
||||||
return _("cannot remove all files for package");
|
return _("cannot remove all files for package");
|
||||||
case PM_ERR_PKG_INVALID_NAME:
|
case PM_ERR_PKG_INVALID_NAME:
|
||||||
return _("package name is not valid");
|
return _("package filename is not valid");
|
||||||
case PM_ERR_PKG_CORRUPTED:
|
|
||||||
return _("corrupted package");
|
|
||||||
case PM_ERR_PKG_REPO_NOT_FOUND:
|
case PM_ERR_PKG_REPO_NOT_FOUND:
|
||||||
return _("no such repository");
|
return _("no such repository");
|
||||||
|
/* Deltas */
|
||||||
|
case PM_ERR_DLT_INVALID:
|
||||||
|
return _("invalid or corrupted delta");
|
||||||
|
case PM_ERR_DLT_PATCHFAILED:
|
||||||
|
return _("delta patch failed");
|
||||||
/* Groups */
|
/* Groups */
|
||||||
case PM_ERR_GRP_NOT_FOUND:
|
case PM_ERR_GRP_NOT_FOUND:
|
||||||
return _("group not found");
|
return _("group not found");
|
||||||
@@ -127,27 +143,26 @@ char SYMEXPORT *alpm_strerror(int err)
|
|||||||
return _("user aborted the operation");
|
return _("user aborted the operation");
|
||||||
case PM_ERR_INTERNAL_ERROR:
|
case PM_ERR_INTERNAL_ERROR:
|
||||||
return _("internal error");
|
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:
|
case PM_ERR_PKG_HOLD:
|
||||||
/* TODO wow this is not descriptive at all... what does this mean? */
|
/* TODO wow this is not descriptive at all... what does this mean? */
|
||||||
return _("not confirmed");
|
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:
|
case PM_ERR_INVALID_REGEX:
|
||||||
return _("invalid regular expression");
|
return _("invalid regular expression");
|
||||||
/* Downloading */
|
/* Errors from external libraries- our own wrapper error */
|
||||||
case PM_ERR_CONNECT_FAILED:
|
case PM_ERR_LIBARCHIVE:
|
||||||
return _("connection to remote host failed");
|
/* it would be nice to use archive_error_string() here, but that
|
||||||
|
* requires the archive struct, so we can't. Just use a generic
|
||||||
|
* error string instead. */
|
||||||
|
return _("libarchive error");
|
||||||
|
case PM_ERR_LIBDOWNLOAD:
|
||||||
|
#if defined(INTERNAL_DOWNLOAD)
|
||||||
|
return downloadLastErrString;
|
||||||
|
#else
|
||||||
|
/* obviously shouldn't get here... */
|
||||||
|
return _("download library error");
|
||||||
|
#endif
|
||||||
|
case PM_ERR_EXTERNAL_DOWNLOAD:
|
||||||
|
return _("error invoking external downloader");
|
||||||
/* Unknown error! */
|
/* Unknown error! */
|
||||||
default:
|
default:
|
||||||
return _("unexpected error");
|
return _("unexpected error");
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* error.h
|
|
||||||
*
|
|
||||||
* Copyright (c) 2002-2006 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|
||||||
* USA.
|
|
||||||
*/
|
|
||||||
#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)); \
|
|
||||||
return(ret); } while(0)
|
|
||||||
|
|
||||||
#endif /* _ALPM_ERROR_H */
|
|
||||||
|
|
||||||
/* vim: set ts=2 sw=2 noet: */
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user