mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2026-04-04 20:34:17 +02:00
Compare commits
1212 Commits
v2.3.4
...
e2e-tech-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c04d1f1f69 | ||
|
|
f8d805d78b | ||
|
|
d85c2bf025 | ||
|
|
296f46356e | ||
|
|
dcc9ac7d2e | ||
|
|
d24a1e542e | ||
|
|
f4a50e88f5 | ||
|
|
682bb2ad43 | ||
|
|
d38e5e1529 | ||
|
|
7b123650da | ||
|
|
0c94142c97 | ||
|
|
e8849a2cf9 | ||
|
|
11946d9ef8 | ||
|
|
3c084bb6eb | ||
|
|
e9a7a56359 | ||
|
|
a003d216a5 | ||
|
|
32eaaa0601 | ||
|
|
be817748f8 | ||
|
|
b909bb6977 | ||
|
|
040507fce6 | ||
|
|
e2e99da446 | ||
|
|
bcb9553925 | ||
|
|
aa7e47f525 | ||
|
|
48bce4c6b0 | ||
|
|
84b26e0d4d | ||
|
|
3d162745af | ||
|
|
7a69e19e4d | ||
|
|
02988229b1 | ||
|
|
4892b0ec43 | ||
|
|
21d55c3321 | ||
|
|
72b9beb79c | ||
|
|
883080b557 | ||
|
|
ebfac84c69 | ||
|
|
3c2622d2de | ||
|
|
982c591ec9 | ||
|
|
1782ae3c08 | ||
|
|
7ce009ef49 | ||
|
|
72363155d8 | ||
|
|
f254ee3211 | ||
|
|
59f2e0634e | ||
|
|
32bb1e6763 | ||
|
|
497b327d43 | ||
|
|
d831369f86 | ||
|
|
a2b8724adf | ||
|
|
bb85e2ab2c | ||
|
|
c1a1e55207 | ||
|
|
c3dbb20ce3 | ||
|
|
33beb7aade | ||
|
|
cae6bbc853 | ||
|
|
e2b89c5afe | ||
|
|
ba4712c922 | ||
|
|
cf2fa2ea35 | ||
|
|
5d6817e165 | ||
|
|
261cedce3f | ||
|
|
2d872f2a8d | ||
|
|
009562da1e | ||
|
|
d5a76ea70d | ||
|
|
4a2d0ab9e9 | ||
|
|
a19eb59461 | ||
|
|
484ec95596 | ||
|
|
5a97ddde5a | ||
|
|
b8539eb329 | ||
|
|
b9c7aa8df3 | ||
|
|
6f5b3eb4d7 | ||
|
|
6d613fb4d5 | ||
|
|
127e675838 | ||
|
|
c1b5412c16 | ||
|
|
217c6bbcaf | ||
|
|
a32b3e565b | ||
|
|
926609bd74 | ||
|
|
486ccaff56 | ||
|
|
e0cc93c047 | ||
|
|
4337e8532e | ||
|
|
a8a6f82270 | ||
|
|
4895b848c8 | ||
|
|
fe3c68b9dd | ||
|
|
24d6fda360 | ||
|
|
4e7c033ae5 | ||
|
|
d4106b9a88 | ||
|
|
2a14ba5582 | ||
|
|
2a842a5745 | ||
|
|
cfe9909560 | ||
|
|
8331f04b5b | ||
|
|
cd36f73f6b | ||
|
|
d0713d018c | ||
|
|
5722d29e42 | ||
|
|
a33fc2a0db | ||
|
|
ca200e788e | ||
|
|
7839c4d4e1 | ||
|
|
c454d626b6 | ||
|
|
969d90d15b | ||
|
|
d8a279c671 | ||
|
|
6d56f30d9b | ||
|
|
86ea5876cd | ||
|
|
bb8468c627 | ||
|
|
fc62e9e9d9 | ||
|
|
15967b1219 | ||
|
|
0656c77da8 | ||
|
|
81c20352e1 | ||
|
|
4e52ee9ebd | ||
|
|
6ee87a77cc | ||
|
|
539d6fd92e | ||
|
|
da98e2aa28 | ||
|
|
1f9763eda9 | ||
|
|
cbf470f17b | ||
|
|
1f12d6344b | ||
|
|
437d45981e | ||
|
|
3ae327ea8e | ||
|
|
1c721e9422 | ||
|
|
5d0aa5f039 | ||
|
|
41798cef18 | ||
|
|
1c11778693 | ||
|
|
3ddd4b6f16 | ||
|
|
d948ed11a1 | ||
|
|
257d8142b1 | ||
|
|
48c55b7d29 | ||
|
|
776bbbf7b1 | ||
|
|
f326bf371d | ||
|
|
4cf7ca4162 | ||
|
|
99aebf292c | ||
|
|
01f3b82ea5 | ||
|
|
d1c84fd859 | ||
|
|
c22e3aaa4b | ||
|
|
dbf15fb8dc | ||
|
|
a253129fd6 | ||
|
|
a8ba3ee9e1 | ||
|
|
9613f6437d | ||
|
|
9dc765142c | ||
|
|
7d70f1becb | ||
|
|
a476c5420a | ||
|
|
cdd8d10940 | ||
|
|
883deb1c5d | ||
|
|
e389fcaecb | ||
|
|
585d2b20bd | ||
|
|
9078d9cfab | ||
|
|
a7ee1a95a6 | ||
|
|
3abbbab6a0 | ||
|
|
51b662fdfe | ||
|
|
b6d74ad753 | ||
|
|
5656323434 | ||
|
|
81baebf113 | ||
|
|
f7c884d4d1 | ||
|
|
d0e7f61db6 | ||
|
|
0f8790d993 | ||
|
|
86377aa37a | ||
|
|
3988f3ad77 | ||
|
|
7aa9af08c3 | ||
|
|
15803d1837 | ||
|
|
ab9d6285c6 | ||
|
|
c0c10fd5f1 | ||
|
|
e2d4a38639 | ||
|
|
f89676d4bb | ||
|
|
b9c167fc13 | ||
|
|
3bac06d6e5 | ||
|
|
504e11b5bb | ||
|
|
e2c895e61f | ||
|
|
ca92c46970 | ||
|
|
50916bcda5 | ||
|
|
c6491d50bb | ||
|
|
fdc96d3a4f | ||
|
|
e06e04ee93 | ||
|
|
7d68fa17e7 | ||
|
|
b80ba97154 | ||
|
|
a63d34f870 | ||
|
|
c772857054 | ||
|
|
c963259bfb | ||
|
|
e3e38f3eac | ||
|
|
6e445033c7 | ||
|
|
93c9f4316b | ||
|
|
47a7000121 | ||
|
|
6c9026e330 | ||
|
|
efc039863b | ||
|
|
da9f1c412d | ||
|
|
06c34ed617 | ||
|
|
d59c609a73 | ||
|
|
6ee48c8f15 | ||
|
|
60ef722b60 | ||
|
|
e70bf44aaf | ||
|
|
124a7253a4 | ||
|
|
6af823b36a | ||
|
|
a642d99d4b | ||
|
|
65dfc47ac7 | ||
|
|
0dc7831336 | ||
|
|
8c7ea61623 | ||
|
|
b72113a53d | ||
|
|
df5fd3fbe6 | ||
|
|
7be5f0a736 | ||
|
|
d87648c99a | ||
|
|
25d58ccd58 | ||
|
|
dd0528037d | ||
|
|
7e83f0591b | ||
|
|
3760b86e07 | ||
|
|
20198c5c7b | ||
|
|
3c301a8282 | ||
|
|
74bc9213c5 | ||
|
|
679bb1f18e | ||
|
|
14b18b146d | ||
|
|
5e23ca9658 | ||
|
|
b9f094cd94 | ||
|
|
c35b57cfba | ||
|
|
1e899f4172 | ||
|
|
0347cf4e9e | ||
|
|
fc73ad7476 | ||
|
|
067508c082 | ||
|
|
b924ad7282 | ||
|
|
4551bbe0e0 | ||
|
|
a48a3e0acc | ||
|
|
ee281963fe | ||
|
|
79065ba5c6 | ||
|
|
ab89231ca2 | ||
|
|
d26ade1870 | ||
|
|
a1e6901ecc | ||
|
|
494ae31de9 | ||
|
|
a02246dc65 | ||
|
|
5609a1dbe8 | ||
|
|
3fbd156c83 | ||
|
|
8fb191afcf | ||
|
|
aa36cc4a5c | ||
|
|
b9cdc8e922 | ||
|
|
23f832caf4 | ||
|
|
7ef2489f1d | ||
|
|
ab37856a91 | ||
|
|
844e03d000 | ||
|
|
69e81e8f65 | ||
|
|
46e796303e | ||
|
|
ce41e3e42f | ||
|
|
1940c2f9bf | ||
|
|
83e94c3ec7 | ||
|
|
a7c0cfc8eb | ||
|
|
7ae8ba35de | ||
|
|
8eebc53728 | ||
|
|
2e516dfc67 | ||
|
|
250c8ff1bf | ||
|
|
ee366df58f | ||
|
|
482ee875a1 | ||
|
|
5607e27f20 | ||
|
|
b10edfecfc | ||
|
|
43332d3ac7 | ||
|
|
8c178bd035 | ||
|
|
49a16ffb4b | ||
|
|
3b96097cf6 | ||
|
|
298f1ab570 | ||
|
|
79dd8e9074 | ||
|
|
99b4381591 | ||
|
|
69a201a62d | ||
|
|
56028759d5 | ||
|
|
8d5afff0a4 | ||
|
|
be3afd1291 | ||
|
|
ac524d8e85 | ||
|
|
82c07236c1 | ||
|
|
76b8d2536b | ||
|
|
4dc49ff3b0 | ||
|
|
4369853ddb | ||
|
|
de4492a2fd | ||
|
|
d870729709 | ||
|
|
1cedb1919f | ||
|
|
09fa5966da | ||
|
|
fe4bb52a6d | ||
|
|
f40cceaf04 | ||
|
|
b357003a95 | ||
|
|
042816bd0d | ||
|
|
c592871f94 | ||
|
|
5cc3b526e8 | ||
|
|
1b2a8ba6b0 | ||
|
|
8a963a67f2 | ||
|
|
586fd346ea | ||
|
|
e5ed8fc90a | ||
|
|
75676f8830 | ||
|
|
530853c988 | ||
|
|
9916583ffa | ||
|
|
25734afd39 | ||
|
|
ea3558faf6 | ||
|
|
159c0e138f | ||
|
|
aca298ca64 | ||
|
|
2127b2629d | ||
|
|
c26d986dbf | ||
|
|
e55518f820 | ||
|
|
44854beefb | ||
|
|
7e41a811dd | ||
|
|
d2e159c385 | ||
|
|
f6f078d1ee | ||
|
|
ce37235cc4 | ||
|
|
0a58ea76e5 | ||
|
|
02283fc686 | ||
|
|
e6f835d138 | ||
|
|
33b1fcfe66 | ||
|
|
dcf0baa9de | ||
|
|
cd2057fc04 | ||
|
|
3e294d5339 | ||
|
|
bae00358b9 | ||
|
|
36573a5c6f | ||
|
|
9a835af7ce | ||
|
|
ca48ff793c | ||
|
|
58e8a25869 | ||
|
|
d517d92f6c | ||
|
|
71dcf7fc37 | ||
|
|
0a59faf03d | ||
|
|
7bd48b1327 | ||
|
|
8c652e061d | ||
|
|
a4816d6a8c | ||
|
|
1a503d54f6 | ||
|
|
263668b1cb | ||
|
|
3df65460f5 | ||
|
|
74672d493d | ||
|
|
0a83d3e743 | ||
|
|
a08a32ceca | ||
|
|
6745777ca3 | ||
|
|
f1b7d506ae | ||
|
|
fc8c88be41 | ||
|
|
70d562668c | ||
|
|
ccd8cff4db | ||
|
|
9f678652f8 | ||
|
|
76916b6c48 | ||
|
|
4878e824e5 | ||
|
|
893ca66af8 | ||
|
|
19120fde9f | ||
|
|
7fe4dd2163 | ||
|
|
4581d708ff | ||
|
|
e0a14cac5b | ||
|
|
ac844a2a45 | ||
|
|
7230fa6b4f | ||
|
|
e25af4f0dc | ||
|
|
863e86138f | ||
|
|
287670c9d6 | ||
|
|
994f3bb644 | ||
|
|
e5c780ee19 | ||
|
|
1c3d5ab158 | ||
|
|
5d668eca40 | ||
|
|
7ab127ad53 | ||
|
|
dd91f4a86e | ||
|
|
3485109125 | ||
|
|
a1136e7695 | ||
|
|
32f38dc5f8 | ||
|
|
ceac18c554 | ||
|
|
99f32dcb99 | ||
|
|
79fe71db58 | ||
|
|
ac937030f0 | ||
|
|
ed5385faa3 | ||
|
|
fe234499dd | ||
|
|
67d77dd6ce | ||
|
|
66aecb9626 | ||
|
|
6f35cbff6b | ||
|
|
387737d908 | ||
|
|
755ef0119a | ||
|
|
1a1ab92ed9 | ||
|
|
b29e9b931d | ||
|
|
0479322c1d | ||
|
|
0be7b6fe1f | ||
|
|
ee98daf9ea | ||
|
|
f2beaba3e9 | ||
|
|
8c4928d9f6 | ||
|
|
823c7469e1 | ||
|
|
10efe1faee | ||
|
|
e0954b0999 | ||
|
|
5ff3e448f5 | ||
|
|
58bcbba841 | ||
|
|
18b456ea2c | ||
|
|
529442e0f8 | ||
|
|
30e3932af8 | ||
|
|
e86937e2e2 | ||
|
|
35eb071874 | ||
|
|
a64bd6059b | ||
|
|
a623b14209 | ||
|
|
f609336bfc | ||
|
|
2cacf2547e | ||
|
|
6276d9290d | ||
|
|
0f60deb043 | ||
|
|
cde6589af8 | ||
|
|
482d538559 | ||
|
|
c4d3d0987d | ||
|
|
47b5cd0fbb | ||
|
|
dd903d447f | ||
|
|
d2d2df4c75 | ||
|
|
8c411b32f7 | ||
|
|
ccd050455a | ||
|
|
ffb9f69cf6 | ||
|
|
74c4d27ea0 | ||
|
|
e3050f7456 | ||
|
|
6cc5ce7a66 | ||
|
|
7a80fe4939 | ||
|
|
9cbe795045 | ||
|
|
b8444053b8 | ||
|
|
0ee0243595 | ||
|
|
b6e986bb1b | ||
|
|
e0fbdfe175 | ||
|
|
753d7addb4 | ||
|
|
632570a13b | ||
|
|
e6be710cdb | ||
|
|
0b00ab8a15 | ||
|
|
c0ae96e7a8 | ||
|
|
12adff76e2 | ||
|
|
6d145a676b | ||
|
|
5279e2fb37 | ||
|
|
51e355e403 | ||
|
|
e99d64011e | ||
|
|
45d9323653 | ||
|
|
57e0d7abcb | ||
|
|
72809ef5b1 | ||
|
|
7a790c88e8 | ||
|
|
01377f6ea9 | ||
|
|
8c94601ef2 | ||
|
|
f27ceb7fab | ||
|
|
60bde048c6 | ||
|
|
3b961204e1 | ||
|
|
e9907bc8ae | ||
|
|
6b9b5252de | ||
|
|
84a093e450 | ||
|
|
be8b99bf3a | ||
|
|
d949ec6877 | ||
|
|
96dede4e84 | ||
|
|
e7b7b8923f | ||
|
|
a118419f0c | ||
|
|
407d71b305 | ||
|
|
d63e18aa9d | ||
|
|
26ba89c2a8 | ||
|
|
7c5150421c | ||
|
|
462353d0ee | ||
|
|
72783aa068 | ||
|
|
d31aa7836a | ||
|
|
0abe7a77fb | ||
|
|
ad408c5717 | ||
|
|
34e6534813 | ||
|
|
6d464d9dc6 | ||
|
|
2236d05d25 | ||
|
|
f0537b20d1 | ||
|
|
9878559002 | ||
|
|
658a8c0609 | ||
|
|
e7a91a1169 | ||
|
|
6b3006b325 | ||
|
|
5dc73ffd8b | ||
|
|
b835bdc55b | ||
|
|
725be9ff54 | ||
|
|
14a51458ab | ||
|
|
aafe7c4732 | ||
|
|
86c2e9e825 | ||
|
|
480932a58a | ||
|
|
529bcab009 | ||
|
|
9a4871abeb | ||
|
|
40665c05ac | ||
|
|
d832312acc | ||
|
|
63cf0e347b | ||
|
|
2192386d86 | ||
|
|
e694ffcd03 | ||
|
|
eff401d418 | ||
|
|
9394fe6e84 | ||
|
|
7049ccd7ab | ||
|
|
8fb2167fca | ||
|
|
d0b8528022 | ||
|
|
13d80beb83 | ||
|
|
06ce8dd8bd | ||
|
|
9a1ea67a35 | ||
|
|
e616f904b6 | ||
|
|
bff24ffd2f | ||
|
|
2cdc969cc5 | ||
|
|
b13fd786b6 | ||
|
|
89d55d0af8 | ||
|
|
d46335aba1 | ||
|
|
e417a4b159 | ||
|
|
b0f986c740 | ||
|
|
18091f99d4 | ||
|
|
3ae2071129 | ||
|
|
820ebf4b6e | ||
|
|
161f6baba6 | ||
|
|
14aeb6921b | ||
|
|
8adfc28de7 | ||
|
|
a0f0e5617a | ||
|
|
6351c01ee7 | ||
|
|
e32fd58578 | ||
|
|
22a2ab8999 | ||
|
|
89d7dbf2cf | ||
|
|
4755b8c8a3 | ||
|
|
19d64e6308 | ||
|
|
b1972e56fa | ||
|
|
05d826a954 | ||
|
|
685ceacace | ||
|
|
7d10f9829e | ||
|
|
d2723bc0ac | ||
|
|
a0d43f8ba6 | ||
|
|
37c5612aee | ||
|
|
f2e73c0887 | ||
|
|
aca36cc1ac | ||
|
|
ee4a848d9a | ||
|
|
7290cf2813 | ||
|
|
9af6e29f42 | ||
|
|
d6db77cce8 | ||
|
|
71d2e3de74 | ||
|
|
a7e07239e3 | ||
|
|
131fd4e483 | ||
|
|
be9cd358d4 | ||
|
|
6ad6852045 | ||
|
|
832cbef8e7 | ||
|
|
5514f14e88 | ||
|
|
ea9e2135a1 | ||
|
|
b53003792f | ||
|
|
6facd29663 | ||
|
|
3b157caf09 | ||
|
|
d7e05c9b05 | ||
|
|
3608114ec1 | ||
|
|
c9d5a9cea2 | ||
|
|
354cdfdbc1 | ||
|
|
d903afc4bf | ||
|
|
4dbe9d4113 | ||
|
|
8e3e3a4575 | ||
|
|
c743cc171a | ||
|
|
7963a8322d | ||
|
|
8d537fdd3c | ||
|
|
4a66cf11d2 | ||
|
|
2698759525 | ||
|
|
1b1add5ead | ||
|
|
6ac44f05cd | ||
|
|
e5fdcd2f38 | ||
|
|
ef2529ca44 | ||
|
|
64a84fda38 | ||
|
|
1a891423e5 | ||
|
|
41ebcd0b7e | ||
|
|
77ec3b086d | ||
|
|
88d87bf0ca | ||
|
|
8eec79680c | ||
|
|
eb43fa1459 | ||
|
|
8793fdbc69 | ||
|
|
4bb7ebb6aa | ||
|
|
3628f3739d | ||
|
|
b28b4705de | ||
|
|
560ce958de | ||
|
|
69d73162aa | ||
|
|
69dc099b17 | ||
|
|
c7d9abbea3 | ||
|
|
a986532442 | ||
|
|
cf56d58241 | ||
|
|
edb04c137c | ||
|
|
c695c50c33 | ||
|
|
5420741edb | ||
|
|
0968d74dad | ||
|
|
876a1c5140 | ||
|
|
1455636169 | ||
|
|
7ea9a5ca4e | ||
|
|
05c1bfb6cf | ||
|
|
2d2ec2a576 | ||
|
|
17126de5c7 | ||
|
|
e4612ca5d4 | ||
|
|
15af5878b6 | ||
|
|
d9f6468310 | ||
|
|
10c6951438 | ||
|
|
56e38e6f80 | ||
|
|
238f0b3610 | ||
|
|
817baf292d | ||
|
|
ca6fa7b341 | ||
|
|
bacbf337d2 | ||
|
|
c36043a175 | ||
|
|
ee63b36ed3 | ||
|
|
35d28294cd | ||
|
|
c6bd3ab31a | ||
|
|
9c7ee6ef85 | ||
|
|
e85a339d94 | ||
|
|
66f0ce6616 | ||
|
|
fb2d31c9ce | ||
|
|
8865405a32 | ||
|
|
f3ea375083 | ||
|
|
15b02547e8 | ||
|
|
476fe66043 | ||
|
|
bb53c2586f | ||
|
|
23f5bb7ed9 | ||
|
|
13b1f8b33e | ||
|
|
ccd32c04a9 | ||
|
|
df19b20d07 | ||
|
|
f41c9fbb7f | ||
|
|
a0e50670de | ||
|
|
984631d807 | ||
|
|
a9761a8976 | ||
|
|
84d8624e03 | ||
|
|
1a47052aa3 | ||
|
|
e0988f482c | ||
|
|
d83e8819ce | ||
|
|
623eb29845 | ||
|
|
1436d5bac1 | ||
|
|
0b50afe915 | ||
|
|
cfb6e3be8c | ||
|
|
78136a10b0 | ||
|
|
08dfe86f37 | ||
|
|
0f1480728e | ||
|
|
ba3d2a61d5 | ||
|
|
e0d368cbb3 | ||
|
|
4f7265c04f | ||
|
|
6b53b4f257 | ||
|
|
77c0309e02 | ||
|
|
5395fc56b1 | ||
|
|
fd00e180f5 | ||
|
|
60729f1fc4 | ||
|
|
418401a33c | ||
|
|
2111aeaac1 | ||
|
|
69c709714d | ||
|
|
090336c928 | ||
|
|
307dfd195c | ||
|
|
304231811d | ||
|
|
ecb05020a9 | ||
|
|
d2992d92ba | ||
|
|
c358980448 | ||
|
|
42a3098595 | ||
|
|
58e2e6b30b | ||
|
|
8c342cb1dd | ||
|
|
17693a75e5 | ||
|
|
f4bbec1019 | ||
|
|
29b64640fa | ||
|
|
3f4d915a17 | ||
|
|
7e2085375f | ||
|
|
1c85f94b00 | ||
|
|
920047fa70 | ||
|
|
f7e74f520b | ||
|
|
5b51346e83 | ||
|
|
e2091bb0a3 | ||
|
|
9870f39dcb | ||
|
|
9318c487b9 | ||
|
|
1c32f6bb2e | ||
|
|
f9b1c724d6 | ||
|
|
4946848d08 | ||
|
|
f56e1d167d | ||
|
|
bc7e65b395 | ||
|
|
9866010b4c | ||
|
|
a3c1052cae | ||
|
|
726cbc160c | ||
|
|
bf39343920 | ||
|
|
af24b4132d | ||
|
|
d339b68715 | ||
|
|
7f51803d04 | ||
|
|
eadc791795 | ||
|
|
408cf11b2b | ||
|
|
e3ba8d3209 | ||
|
|
17b1c83ae5 | ||
|
|
b2a8ffc577 | ||
|
|
e2711224ed | ||
|
|
2ac7e0200a | ||
|
|
e6b971b316 | ||
|
|
111bb485ec | ||
|
|
e10775d34f | ||
|
|
30957479a3 | ||
|
|
b4ab53dd32 | ||
|
|
a314eeb892 | ||
|
|
644ddf318c | ||
|
|
f598ac89ac | ||
|
|
3f7b3ca962 | ||
|
|
104c6edcde | ||
|
|
94b673dc8e | ||
|
|
096cd348f0 | ||
|
|
01c2ffe2ae | ||
|
|
0a4370236d | ||
|
|
fe8d2b397e | ||
|
|
92e90f9c55 | ||
|
|
9eabd2a32a | ||
|
|
3eb2642b11 | ||
|
|
99192a6dec | ||
|
|
cffc1fd1c4 | ||
|
|
b8f7c6daae | ||
|
|
cd07865da6 | ||
|
|
315e38e814 | ||
|
|
95b90271b6 | ||
|
|
19c6757a0f | ||
|
|
3636a59830 | ||
|
|
548302c367 | ||
|
|
a64a33c589 | ||
|
|
01bbbb7d08 | ||
|
|
f609ea3bef | ||
|
|
91223b1a3d | ||
|
|
ca0f9825ce | ||
|
|
f202593ce4 | ||
|
|
d8ed9e5bde | ||
|
|
c436b36b89 | ||
|
|
980bab422a | ||
|
|
6fbd3cf61a | ||
|
|
e6e1f765bd | ||
|
|
b2fe501706 | ||
|
|
2bfd85e3c7 | ||
|
|
e1eb374ac3 | ||
|
|
ea2c3828cb | ||
|
|
c1e2bdc3d2 | ||
|
|
09c3043c85 | ||
|
|
0a8c394ee9 | ||
|
|
cd44d8ed77 | ||
|
|
cfc38753b4 | ||
|
|
c424dec7d4 | ||
|
|
78078b714e | ||
|
|
36117336e7 | ||
|
|
d59c146488 | ||
|
|
6583ebdcd9 | ||
|
|
917e2e43c6 | ||
|
|
bdd3dc743b | ||
|
|
9143ddd0ad | ||
|
|
f46440eb67 | ||
|
|
96a6d64500 | ||
|
|
08bc21937b | ||
|
|
f64519bfbd | ||
|
|
494df32ee4 | ||
|
|
bbbd2319ed | ||
|
|
79c775bcd8 | ||
|
|
a3b1597d17 | ||
|
|
ecb4e96794 | ||
|
|
185cb2e39a | ||
|
|
c6610f6fbf | ||
|
|
d76ecf015c | ||
|
|
312f3a9bf3 | ||
|
|
fd9662b803 | ||
|
|
37810c0a19 | ||
|
|
38a76ac5bf | ||
|
|
d100f9ac67 | ||
|
|
5fc864adb6 | ||
|
|
2738d5d9ab | ||
|
|
0936cfee5d | ||
|
|
38962ca694 | ||
|
|
7e677516ae | ||
|
|
cabf7a79d5 | ||
|
|
2b12990f19 | ||
|
|
3184d4bb32 | ||
|
|
0cbbea9796 | ||
|
|
b19677ea97 | ||
|
|
dc0a0841fa | ||
|
|
351e65309c | ||
|
|
e36c8678d9 | ||
|
|
f793de4629 | ||
|
|
cd4908ac6a | ||
|
|
0ad05aee0d | ||
|
|
190f821d93 | ||
|
|
7aca2352be | ||
|
|
3143b32aa5 | ||
|
|
e8a76859c1 | ||
|
|
c219ceea52 | ||
|
|
608f5034ef | ||
|
|
78458662a5 | ||
|
|
800dd485ef | ||
|
|
f4ca43293b | ||
|
|
6161b5519b | ||
|
|
2cac928810 | ||
|
|
05927b68a8 | ||
|
|
b3f90111e2 | ||
|
|
254f6291df | ||
|
|
faa7fd1b32 | ||
|
|
76d95f8b87 | ||
|
|
4e90bd7a5a | ||
|
|
81e32e1a08 | ||
|
|
98ef3050d8 | ||
|
|
4c2e078eac | ||
|
|
dc3c3195b5 | ||
|
|
cda72effe2 | ||
|
|
0f21ed6a5b | ||
|
|
85a93efe51 | ||
|
|
82dd1775eb | ||
|
|
3bc1f63b0a | ||
|
|
2276df1eec | ||
|
|
ec52807e29 | ||
|
|
7f88a3e1cd | ||
|
|
74049e3e92 | ||
|
|
d01c7dc7db | ||
|
|
b92de38c31 | ||
|
|
78b082a23c | ||
|
|
1aa1e7f833 | ||
|
|
4d2261420d | ||
|
|
23153a4866 | ||
|
|
7f75a533d1 | ||
|
|
e47b8ffaca | ||
|
|
a79b0a3791 | ||
|
|
ce51ea34b9 | ||
|
|
0e8ce9c3db | ||
|
|
76faf4937b | ||
|
|
df05042e7f | ||
|
|
e8f17f5b0b | ||
|
|
7d1285d313 | ||
|
|
72131ff4ce | ||
|
|
c03d53e1dd | ||
|
|
bc5a6527f9 | ||
|
|
7ca1107ea0 | ||
|
|
4acb70e79d | ||
|
|
755b18db61 | ||
|
|
bf8151a8ad | ||
|
|
b810ce7768 | ||
|
|
1c0d80c20d | ||
|
|
ed9977a2b3 | ||
|
|
546c7c420a | ||
|
|
bdf3f1e271 | ||
|
|
4e90179065 | ||
|
|
43f85a787b | ||
|
|
a8c33885bb | ||
|
|
3591849279 | ||
|
|
8a094d2b0e | ||
|
|
deb123b80d | ||
|
|
7a97dc1783 | ||
|
|
41f215fd8d | ||
|
|
e0fa5723eb | ||
|
|
4947dc22ab | ||
|
|
157e933ae5 | ||
|
|
7fad474863 | ||
|
|
26dde9b543 | ||
|
|
b43e948167 | ||
|
|
9da3822305 | ||
|
|
61d949730b | ||
|
|
bfc7ea562d | ||
|
|
6d8c98f6b4 | ||
|
|
4aca1b9697 | ||
|
|
f96990b489 | ||
|
|
7280359c66 | ||
|
|
b30c3202f0 | ||
|
|
ac4be17192 | ||
|
|
39e9938cad | ||
|
|
f897a91354 | ||
|
|
5948f26884 | ||
|
|
95579b3de1 | ||
|
|
90befac901 | ||
|
|
22f71ce17e | ||
|
|
0931f25747 | ||
|
|
971f2391cf | ||
|
|
43a26eb50a | ||
|
|
99d406072f | ||
|
|
3a1a56c7ad | ||
|
|
57cbba81e7 | ||
|
|
e48d55d126 | ||
|
|
1c03fa8642 | ||
|
|
670ff36024 | ||
|
|
6b3f6d9860 | ||
|
|
ac5876e94e | ||
|
|
b13f44023d | ||
|
|
2f15d8aef5 | ||
|
|
ecaa37efbe | ||
|
|
33e421473c | ||
|
|
eb1a96c164 | ||
|
|
2afcac763d | ||
|
|
28fe903aee | ||
|
|
253d197ccb | ||
|
|
0ceb806f1a | ||
|
|
800b9cf167 | ||
|
|
1da398e6c6 | ||
|
|
074cb132bb | ||
|
|
2df74fd9d7 | ||
|
|
cba78eb11f | ||
|
|
cc7cb6b650 | ||
|
|
8eb466c9c5 | ||
|
|
d68b07dfc7 | ||
|
|
a52dff713b | ||
|
|
041c5e6d44 | ||
|
|
a2ce739192 | ||
|
|
ca4ad58a06 | ||
|
|
89df8fb692 | ||
|
|
9a021d2279 | ||
|
|
82e87805c3 | ||
|
|
844bfc5f25 | ||
|
|
706c68f69c | ||
|
|
13e0cc6b50 | ||
|
|
7af81f7665 | ||
|
|
278129b286 | ||
|
|
54c522c861 | ||
|
|
a034ee894c | ||
|
|
6f46764daa | ||
|
|
e1d482ea7c | ||
|
|
c34ec00d3a | ||
|
|
090abdee87 | ||
|
|
ce04a76b17 | ||
|
|
2953eed729 | ||
|
|
bf2b089c5c | ||
|
|
3107e63040 | ||
|
|
2ec8194d01 | ||
|
|
d113498c7b | ||
|
|
d8206ccbc7 | ||
|
|
fbd8de1c24 | ||
|
|
81d9f94a29 | ||
|
|
382cc444f0 | ||
|
|
0cec6f08ca | ||
|
|
2112e16cca | ||
|
|
35f80bd439 | ||
|
|
1dc44c0f62 | ||
|
|
eae3f7ce0a | ||
|
|
aa322d41aa | ||
|
|
95d23b1914 | ||
|
|
0464cdb43f | ||
|
|
35e4fe061d | ||
|
|
02924ad83e | ||
|
|
ff4213b59f | ||
|
|
c4e51247d8 | ||
|
|
1218a38f2c | ||
|
|
797f8087bc | ||
|
|
bf77ac6ba5 | ||
|
|
eafb006649 | ||
|
|
a9bf7a90ed | ||
|
|
ee7593bbe3 | ||
|
|
30843cd368 | ||
|
|
53195b064a | ||
|
|
dca2664707 | ||
|
|
e1dfc38a90 | ||
|
|
2e90e9c35b | ||
|
|
8f5110900c | ||
|
|
5e332983e2 | ||
|
|
6e240a3e9c | ||
|
|
a1f1775d15 | ||
|
|
5fbed0d1cd | ||
|
|
bd25225045 | ||
|
|
013eba0e79 | ||
|
|
78212e03d6 | ||
|
|
a8ea7b0858 | ||
|
|
0e97770c47 | ||
|
|
3d7bd7583b | ||
|
|
bfacac8683 | ||
|
|
d66c2b5fae | ||
|
|
72e44ce3d7 | ||
|
|
0806e0466c | ||
|
|
c05ca51238 | ||
|
|
1a4a5bfc57 | ||
|
|
be5d5aea6d | ||
|
|
8635b8ac84 | ||
|
|
d1b8370a4a | ||
|
|
1f57fd0407 | ||
|
|
671599c8b2 | ||
|
|
0b4fd52d63 | ||
|
|
e05f5fc50d | ||
|
|
da6250fc1f | ||
|
|
7d075cdcb7 | ||
|
|
3a55ff2119 | ||
|
|
b5b055e1ae | ||
|
|
0c99673581 | ||
|
|
709aa27031 | ||
|
|
5b01d63491 | ||
|
|
46b3d41b20 | ||
|
|
0b7ad2c804 | ||
|
|
8392d6c136 | ||
|
|
4ced7e9c80 | ||
|
|
3d120983da | ||
|
|
70aafd74a8 | ||
|
|
66415831ea | ||
|
|
2b7919fb3a | ||
|
|
09173fb727 | ||
|
|
de5de6284c | ||
|
|
de8ab35cb3 | ||
|
|
237b597e19 | ||
|
|
2d7a4bdb06 | ||
|
|
6f270a3648 | ||
|
|
8be2aaa751 | ||
|
|
5ede5ab4ce | ||
|
|
506f7c0764 | ||
|
|
4b686a4394 | ||
|
|
a18a601291 | ||
|
|
92fc50d4b0 | ||
|
|
57c812bc00 | ||
|
|
715b8c4683 | ||
|
|
b1bb7ec1a8 | ||
|
|
f6136dd036 | ||
|
|
cb49635231 | ||
|
|
e8f7adc7ca | ||
|
|
ab8061a57f | ||
|
|
f414355680 | ||
|
|
6dd043659c | ||
|
|
704ca366b3 | ||
|
|
cf15cbf0b3 | ||
|
|
de7c301654 | ||
|
|
48d2fc1599 | ||
|
|
839361594d | ||
|
|
40abe3f370 | ||
|
|
cacba220f9 | ||
|
|
cdc5c1db43 | ||
|
|
7a5a706397 | ||
|
|
59ea79d9e6 | ||
|
|
4e5898efd7 | ||
|
|
a512586140 | ||
|
|
28a0971cdf | ||
|
|
5c9827a33c | ||
|
|
f0362b2332 | ||
|
|
5bf48bc68f | ||
|
|
6e47d9a2e5 | ||
|
|
a480a318fd | ||
|
|
251f1d0047 | ||
|
|
1c3127e43b | ||
|
|
63d99f3e30 | ||
|
|
067c174e61 | ||
|
|
993e1eb89c | ||
|
|
6cb4131024 | ||
|
|
20a979173f | ||
|
|
4aad318446 | ||
|
|
13a5653c4e | ||
|
|
ceccc661f1 | ||
|
|
53087ac803 | ||
|
|
119ecb4259 | ||
|
|
8bd047174a | ||
|
|
416393a794 | ||
|
|
9e36cabcbf | ||
|
|
3731eba9b6 | ||
|
|
f707a43b3c | ||
|
|
7a96e8a292 | ||
|
|
90cce0ab56 | ||
|
|
41ed603abf | ||
|
|
cdce7f2044 | ||
|
|
6ae88514d8 | ||
|
|
c043840cb1 | ||
|
|
a831164d65 | ||
|
|
a41dc00160 | ||
|
|
5a1bf7d8fe | ||
|
|
075c423c62 | ||
|
|
d9813dbc90 | ||
|
|
50874eecfa | ||
|
|
3cea550d08 | ||
|
|
5e9d6f1cbd | ||
|
|
b1363d1a79 | ||
|
|
520923b5a7 | ||
|
|
2ba46e05ee | ||
|
|
90ed57f478 | ||
|
|
ab580103c7 | ||
|
|
1c6a83d0dd | ||
|
|
06f3a70f9a | ||
|
|
1fb68e8711 | ||
|
|
bd107e133f | ||
|
|
1c2d5f16c8 | ||
|
|
5738110cb6 | ||
|
|
6be122edc4 | ||
|
|
7979342edf | ||
|
|
2cdf5517cb | ||
|
|
7adcb76f68 | ||
|
|
acf65b4c23 | ||
|
|
d099c2a8db | ||
|
|
20f1257e88 | ||
|
|
fe0de111fd | ||
|
|
e7a0c1b6d0 | ||
|
|
da54b3d7e5 | ||
|
|
971abaea80 | ||
|
|
a76670f3b8 | ||
|
|
e13b618a65 | ||
|
|
cd1b89475c | ||
|
|
5d90b48790 | ||
|
|
c3cb186952 | ||
|
|
5ca743dd25 | ||
|
|
d34dbbdb0b | ||
|
|
1c9b51c330 | ||
|
|
122854af77 | ||
|
|
a5ace5e71d | ||
|
|
af4f1083b7 | ||
|
|
186f16e688 | ||
|
|
99b1f69271 | ||
|
|
e54be1c4ee | ||
|
|
411621bf03 | ||
|
|
ca2ffd4fb3 | ||
|
|
3b20684dc7 | ||
|
|
b6db9789ee | ||
|
|
7a4daf799a | ||
|
|
389499d639 | ||
|
|
7b58a82840 | ||
|
|
9d818066a7 | ||
|
|
0238a29c7c | ||
|
|
d01065b9a1 | ||
|
|
607287a9d6 | ||
|
|
ce8341ca1f | ||
|
|
9493e8f42e | ||
|
|
b1aaf055b1 | ||
|
|
34e75f80bc | ||
|
|
0db095e02a | ||
|
|
30095a0c3f | ||
|
|
946c6967e9 | ||
|
|
d1e00099dc | ||
|
|
d018d460e3 | ||
|
|
851a3128e4 | ||
|
|
bdb8a4a0cb | ||
|
|
0f70bd7913 | ||
|
|
d810c13304 | ||
|
|
3d2f5b6af1 | ||
|
|
e240904a32 | ||
|
|
58e0c6c630 | ||
|
|
501394ec6f | ||
|
|
59bbbd5e66 | ||
|
|
1e98ba27c6 | ||
|
|
2244b35a6d | ||
|
|
15ee7b39ac | ||
|
|
cb7d74a063 | ||
|
|
bfe095b065 | ||
|
|
30bcd45a14 | ||
|
|
f44d3914ef | ||
|
|
5d24a2dc0f | ||
|
|
8160963110 | ||
|
|
d50d8b86cf | ||
|
|
b28e06608c | ||
|
|
cd411e5fb1 | ||
|
|
9daef50ce6 | ||
|
|
fae178f70b | ||
|
|
744208f701 | ||
|
|
85d8ae6b93 | ||
|
|
5100a2daf1 | ||
|
|
6e57b0219e | ||
|
|
3a002a1ddf | ||
|
|
4b0d956b3d | ||
|
|
85408961ba | ||
|
|
04b6794318 | ||
|
|
3314a472c3 | ||
|
|
aeeb408c74 | ||
|
|
63c40b45e4 | ||
|
|
c17a678385 | ||
|
|
e2e56f45af | ||
|
|
05c1dcef9b | ||
|
|
cc5fe558ba | ||
|
|
3d93527a8e | ||
|
|
8a19f2ac65 | ||
|
|
b7fa50be4c | ||
|
|
42751f87d9 | ||
|
|
f88431adbf | ||
|
|
03aa7e3044 | ||
|
|
91f6cae168 | ||
|
|
ddd584077c | ||
|
|
8201f0b6ea | ||
|
|
f2b5fcd706 | ||
|
|
950439e5b8 | ||
|
|
f24cdf5a05 | ||
|
|
d3b00532b1 | ||
|
|
b7ed0fce2a | ||
|
|
57d965aeba | ||
|
|
5eaae83a01 | ||
|
|
c50136d675 | ||
|
|
494ea5c78c | ||
|
|
c8d0f788e0 | ||
|
|
ae263d60bd | ||
|
|
df3fe25702 | ||
|
|
566e6c813e | ||
|
|
ee4892e345 | ||
|
|
7fd2f292e7 | ||
|
|
b68d982619 | ||
|
|
cf058bc537 | ||
|
|
cc9680c1e8 | ||
|
|
b7553d5bdf | ||
|
|
4ad190a558 | ||
|
|
3a193655b3 | ||
|
|
e10a08f64d | ||
|
|
cc94c772cd | ||
|
|
4b6edaa01a | ||
|
|
8da7919a43 | ||
|
|
f52d66a954 | ||
|
|
4d3212b31f | ||
|
|
973dc9e1e2 | ||
|
|
881641f0b7 | ||
|
|
d1b1da3414 | ||
|
|
48a359b69e | ||
|
|
2a8f9a7c04 | ||
|
|
3da1e9a4b9 | ||
|
|
f1b42cedda | ||
|
|
2598579d84 | ||
|
|
c5b6ec209a | ||
|
|
13705999f7 | ||
|
|
fbe812b9bc | ||
|
|
4697f0274f | ||
|
|
aff8008baf | ||
|
|
c922015521 | ||
|
|
4ed9edb104 | ||
|
|
bb244d527c | ||
|
|
7f1d13dfbf | ||
|
|
3185b0940b | ||
|
|
d709a47b93 | ||
|
|
013a0e25d5 | ||
|
|
3db8d3dfb6 | ||
|
|
72a3e08907 | ||
|
|
4202387c52 | ||
|
|
cd4e647816 | ||
|
|
3a31694147 | ||
|
|
05236f0a7a | ||
|
|
a475526805 | ||
|
|
3c1a2cde33 | ||
|
|
a1f7168d2a | ||
|
|
1e1c2f8de2 | ||
|
|
76e67db04b | ||
|
|
70c3514996 | ||
|
|
9aeb587d6c | ||
|
|
51041d0f15 | ||
|
|
ada2be94f2 | ||
|
|
8cb3a77022 | ||
|
|
1ed4eb46f2 | ||
|
|
7c31da5a95 | ||
|
|
1f245b3791 | ||
|
|
554d1b88fc | ||
|
|
2841714817 | ||
|
|
35af03b2e5 | ||
|
|
ae018eab42 | ||
|
|
68f0f1b404 | ||
|
|
96f152d57c | ||
|
|
53c5f03c32 | ||
|
|
e86499d990 | ||
|
|
88e0f97798 | ||
|
|
e2cda2dc65 | ||
|
|
090d02a65f | ||
|
|
a0e88477c1 | ||
|
|
da45d99b8f | ||
|
|
f67989afea | ||
|
|
14fef4a0d3 | ||
|
|
d3439d5526 | ||
|
|
4597201560 | ||
|
|
574435687d | ||
|
|
fce194ce08 | ||
|
|
5204524691 | ||
|
|
9af7e8cff0 | ||
|
|
5e33898a08 | ||
|
|
1a98b49f1b | ||
|
|
0e8f0481d4 | ||
|
|
6580af65c1 | ||
|
|
cdf16dd905 | ||
|
|
d30ed7fb8a | ||
|
|
13df7fcee0 | ||
|
|
6e4ecd11a1 | ||
|
|
793a994ce6 | ||
|
|
19bf5e2ff1 | ||
|
|
16ad3d5c88 | ||
|
|
ff2d98596f | ||
|
|
072698d606 | ||
|
|
0b098045f1 | ||
|
|
ddb6b3b262 | ||
|
|
7f2470f1f6 | ||
|
|
488b964c52 | ||
|
|
b4d3f696bf | ||
|
|
9cc4d363b2 | ||
|
|
b646caffd0 | ||
|
|
b9bc3e36b8 | ||
|
|
24aaf7a034 | ||
|
|
80f2e40e67 | ||
|
|
e95b73dfac | ||
|
|
c00e3e8c0a | ||
|
|
2a12610a46 | ||
|
|
d466a05915 | ||
|
|
e05d6bfcdc | ||
|
|
b49dd02e3d |
63
.clang-format
Normal file
63
.clang-format
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
|
||||||
|
#
|
||||||
|
# You may use this file under the terms of the 3-clause BSD license.
|
||||||
|
# See the file LICENSE from this package for details.
|
||||||
|
|
||||||
|
# This is the clang-format configuration style to be used by Qt,
|
||||||
|
# based on the rules from https://wiki.qt.io/Qt_Coding_Style and
|
||||||
|
# https://wiki.qt.io/Coding_Conventions
|
||||||
|
|
||||||
|
---
|
||||||
|
# Webkit style was loosely based on the Qt style
|
||||||
|
BasedOnStyle: WebKit
|
||||||
|
|
||||||
|
Standard: Cpp11
|
||||||
|
ColumnLimit: 0
|
||||||
|
|
||||||
|
# Disable reflow of qdoc comments: indentation rules are different.
|
||||||
|
# Translation comments are also excluded
|
||||||
|
CommentPragmas: "^!|^:"
|
||||||
|
|
||||||
|
# We want a space between the type and the star for pointer types
|
||||||
|
PointerBindsToType: false
|
||||||
|
|
||||||
|
# We want to break before the operators, but not before a '='
|
||||||
|
BreakBeforeBinaryOperators: NonAssignment
|
||||||
|
|
||||||
|
# Braces are usually attached, but not after functions or classes declaration
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BraceWrapping:
|
||||||
|
AfterClass: true
|
||||||
|
AfterControlStatement: false
|
||||||
|
AfterEnum: false
|
||||||
|
AfterFunction: true
|
||||||
|
AfterNamespace: false
|
||||||
|
AfterObjCDeclaration: false
|
||||||
|
AfterStruct: true
|
||||||
|
AfterUnion: false
|
||||||
|
BeforeCatch: false
|
||||||
|
BeforeElse: false
|
||||||
|
IndentBraces: false
|
||||||
|
|
||||||
|
# The coding style does not specify the following, but this is what gives
|
||||||
|
# results closest to the existing code.
|
||||||
|
AlignAfterOpenBracket: DontAlign
|
||||||
|
AlwaysBreakTemplateDeclarations: true
|
||||||
|
|
||||||
|
# Ideally we should also allow less short function in a single line, but
|
||||||
|
# clang-format does not handle that
|
||||||
|
AllowShortFunctionsOnASingleLine: Inline
|
||||||
|
|
||||||
|
# The coding style specifies some include order categories, but also tells to
|
||||||
|
# separate categories with an empty line. It does not specify the order within
|
||||||
|
# the categories. Since the SortInclude feature of clang-format does not
|
||||||
|
# re-order includes separated by empty lines, the feature is not used.
|
||||||
|
SortIncludes: false
|
||||||
|
|
||||||
|
# macros for which the opening brace stays attached
|
||||||
|
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
|
||||||
|
|
||||||
|
# Allow two empty lines for structuring
|
||||||
|
MaxEmptyLinesToKeep: 2
|
||||||
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
|
|
||||||
97
.drone.yml
Normal file
97
.drone.yml
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
clone:
|
||||||
|
git:
|
||||||
|
image: plugins/git
|
||||||
|
depth: 1
|
||||||
|
|
||||||
|
pipeline:
|
||||||
|
qt-5.7:
|
||||||
|
image: nextcloudci/client-5.7:client-5.7-2
|
||||||
|
commands:
|
||||||
|
# Install QtKeyChain
|
||||||
|
- /bin/bash -c "
|
||||||
|
source /opt/qt57/bin/qt57-env.sh &&
|
||||||
|
cd /tmp &&
|
||||||
|
git clone https://github.com/frankosterfeld/qtkeychain.git &&
|
||||||
|
cd qtkeychain &&
|
||||||
|
git checkout v0.8.0 &&
|
||||||
|
mkdir build &&
|
||||||
|
cd build &&
|
||||||
|
cmake ../ &&
|
||||||
|
make &&
|
||||||
|
make install"
|
||||||
|
# Build client
|
||||||
|
- /bin/bash -c "
|
||||||
|
source /opt/qt57/bin/qt57-env.sh &&
|
||||||
|
mkdir build &&
|
||||||
|
cd build &&
|
||||||
|
cmake -D NO_SHIBBOLETH=1 ../ &&
|
||||||
|
make"
|
||||||
|
when:
|
||||||
|
matrix:
|
||||||
|
TESTS: qt-5.7
|
||||||
|
qt-5.8:
|
||||||
|
image: nextcloudci/client-5.8:client-5.8-2
|
||||||
|
commands:
|
||||||
|
# Install QtKeyChain
|
||||||
|
- /bin/bash -c "
|
||||||
|
source /opt/qt58/bin/qt58-env.sh &&
|
||||||
|
cd /tmp &&
|
||||||
|
git clone https://github.com/frankosterfeld/qtkeychain.git &&
|
||||||
|
cd qtkeychain &&
|
||||||
|
git checkout v0.8.0 &&
|
||||||
|
mkdir build &&
|
||||||
|
cd build &&
|
||||||
|
cmake ../ &&
|
||||||
|
make &&
|
||||||
|
make install"
|
||||||
|
# Build client
|
||||||
|
- /bin/bash -c "
|
||||||
|
source /opt/qt58/bin/qt58-env.sh &&
|
||||||
|
mkdir build &&
|
||||||
|
cd build &&
|
||||||
|
cmake -D NO_SHIBBOLETH=1 ../ &&
|
||||||
|
make"
|
||||||
|
when:
|
||||||
|
matrix:
|
||||||
|
TESTS: qt-5.8
|
||||||
|
qt-5.9:
|
||||||
|
image: nextcloudci/client-5.9:client-5.9-3
|
||||||
|
commands:
|
||||||
|
# Install QtKeyChain
|
||||||
|
- /bin/bash -c "
|
||||||
|
source /opt/qt59/bin/qt59-env.sh &&
|
||||||
|
cd /tmp &&
|
||||||
|
git clone https://github.com/frankosterfeld/qtkeychain.git &&
|
||||||
|
cd qtkeychain &&
|
||||||
|
git checkout v0.8.0 &&
|
||||||
|
mkdir build &&
|
||||||
|
cd build &&
|
||||||
|
cmake ../ &&
|
||||||
|
make &&
|
||||||
|
make install"
|
||||||
|
# Build client
|
||||||
|
- /bin/bash -c "
|
||||||
|
source /opt/qt59/bin/qt59-env.sh &&
|
||||||
|
mkdir build &&
|
||||||
|
cd build &&
|
||||||
|
cmake -D NO_SHIBBOLETH=1 ../ &&
|
||||||
|
make"
|
||||||
|
when:
|
||||||
|
matrix:
|
||||||
|
TESTS: qt-5.9
|
||||||
|
AppImage-5.9:
|
||||||
|
image: nextcloudci/client-appimage-ci:client-appimage-ci-8
|
||||||
|
commands:
|
||||||
|
- /bin/bash -c "./admin/linux/build-appimage.sh"
|
||||||
|
when:
|
||||||
|
matrix:
|
||||||
|
BUILD: AppImage
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- TESTS: qt-5.7
|
||||||
|
- TESTS: qt-5.8
|
||||||
|
- TESTS: qt-5.9
|
||||||
|
- BUILD: AppImage
|
||||||
|
|
||||||
|
branches: [ master, 2.* ]
|
||||||
1
.git-blame-ignore-revs
Normal file
1
.git-blame-ignore-revs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
c8d0f788e00bdae125a26d9159ce9efdd6325cd2 # Initial application of clang-format
|
||||||
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,6 +1,3 @@
|
|||||||
[submodule "doc/ocdoc"]
|
|
||||||
path = doc/ocdoc
|
|
||||||
url = https://github.com/owncloud/documentation
|
|
||||||
[submodule "src/3rdparty/qtmacgoodies"]
|
[submodule "src/3rdparty/qtmacgoodies"]
|
||||||
path = src/3rdparty/qtmacgoodies
|
path = src/3rdparty/qtmacgoodies
|
||||||
url = https://github.com/guruz/qtmacgoodies.git
|
url = https://github.com/guruz/qtmacgoodies.git
|
||||||
@@ -10,6 +7,3 @@
|
|||||||
[submodule "src/3rdparty/libcrashreporter-qt"]
|
[submodule "src/3rdparty/libcrashreporter-qt"]
|
||||||
path = src/3rdparty/libcrashreporter-qt
|
path = src/3rdparty/libcrashreporter-qt
|
||||||
url = git://github.com/dschmidt/libcrashreporter-qt.git
|
url = git://github.com/dschmidt/libcrashreporter-qt.git
|
||||||
[submodule "src/3rdparty/qtkeychain"]
|
|
||||||
path = src/3rdparty/qtkeychain
|
|
||||||
url = https://github.com/frankosterfeld/qtkeychain.git
|
|
||||||
|
|||||||
57
.travis.yml
57
.travis.yml
@@ -1,37 +1,38 @@
|
|||||||
|
os: linux
|
||||||
|
dist: trusty
|
||||||
sudo: required
|
sudo: required
|
||||||
|
language: generic
|
||||||
language: cpp
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
branches:
|
env:
|
||||||
only:
|
matrix:
|
||||||
- coverity_scan
|
- BUILD_TYPE=debian
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud-client.list"
|
- admin/linux/travis-build.sh before_install
|
||||||
- sudo sh -c "echo 'deb-src http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud-client.list"
|
|
||||||
- wget http://download.opensuse.org/repositories/isv:ownCloud:desktop/Ubuntu_14.04/Release.key
|
|
||||||
- sudo apt-key add - < Release.key
|
|
||||||
- sudo apt-get update
|
|
||||||
- sudo apt-get -y build-dep owncloud-client
|
|
||||||
- checkout=$(git show-ref --head --hash head)
|
|
||||||
- cd ../
|
|
||||||
- wget https://scan.coverity.com/download/linux-64 --post-data "token=$token&project=owncloud%2Fmirall" -O coverity_tool.tgz
|
|
||||||
- mkdir coverity
|
|
||||||
- tar -xvf coverity_tool.tgz -C coverity --strip-components=1
|
|
||||||
- export PATH=$PATH:$PWD/coverity/bin/
|
|
||||||
- cd $TRAVIS_BUILD_DIR
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- cd ../
|
- admin/linux/travis-build.sh install
|
||||||
- mkdir client-build
|
|
||||||
- cd client-build
|
|
||||||
- cmake -DCMAKE_BUILD_TYPE="Debug" $TRAVIS_BUILD_DIR
|
|
||||||
- cov-build --dir cov-int make
|
|
||||||
- tar czvf client.tgz cov-int
|
|
||||||
- curl --form token=$token --form email=lukas@statuscode.ch --form file=@$PWD/client.tgz --form version="$checkout" --form description="$checkout" https://scan.coverity.com/builds?project=owncloud%2Fmirall
|
|
||||||
|
|
||||||
# Hack to stop processing
|
before_script:
|
||||||
script: true
|
- admin/linux/travis-build.sh before_script
|
||||||
|
|
||||||
|
script:
|
||||||
|
- admin/linux/travis-build.sh script
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- admin/linux/travis-build.sh after_success
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
- provider: script
|
||||||
|
skip_cleanup: true
|
||||||
|
script: admin/linux/travis-build.sh ppa_deploy
|
||||||
|
on:
|
||||||
|
condition: ($BUILD_TYPE = debian)
|
||||||
|
|
||||||
|
branches:
|
||||||
|
except:
|
||||||
|
- # Do not build tags that we create when we upload to GitHub Releases
|
||||||
|
- /^(?i:continuous)$/
|
||||||
|
|||||||
143
CMakeLists.txt
143
CMakeLists.txt
@@ -1,9 +1,5 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.2)
|
||||||
cmake_minimum_required(VERSION 2.6)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
cmake_policy(VERSION 2.8.0)
|
|
||||||
if(POLICY CMP0020)
|
|
||||||
cmake_policy(SET CMP0020 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
project(client)
|
project(client)
|
||||||
|
|
||||||
@@ -13,7 +9,7 @@ set(OEM_THEME_DIR "" CACHE STRING "Define directory containing a custom theme")
|
|||||||
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
|
if ( EXISTS ${OEM_THEME_DIR}/OEM.cmake )
|
||||||
include ( ${OEM_THEME_DIR}/OEM.cmake )
|
include ( ${OEM_THEME_DIR}/OEM.cmake )
|
||||||
else ()
|
else ()
|
||||||
include ( ${CMAKE_SOURCE_DIR}/OWNCLOUD.cmake )
|
include ( ${CMAKE_SOURCE_DIR}/NEXTCLOUD.cmake )
|
||||||
endif()
|
endif()
|
||||||
# need this logic to not mess with re/uninstallations via macosx.pkgproj
|
# need this logic to not mess with re/uninstallations via macosx.pkgproj
|
||||||
if(${APPLICATION_REV_DOMAIN} STREQUAL "com.owncloud.desktopclient")
|
if(${APPLICATION_REV_DOMAIN} STREQUAL "com.owncloud.desktopclient")
|
||||||
@@ -22,16 +18,19 @@ else()
|
|||||||
set(APPLICATION_REV_DOMAIN_INSTALLER ${APPLICATION_REV_DOMAIN})
|
set(APPLICATION_REV_DOMAIN_INSTALLER ${APPLICATION_REV_DOMAIN})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED APPLICATION_SHORTNAME)
|
|
||||||
set ( APPLICATION_SHORTNAME ${APPLICATION_NAME} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# For usage in XML files we preprocess
|
# For usage in XML files we preprocess
|
||||||
string(REPLACE "&" "&" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME}")
|
string(REPLACE "&" "&" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME}")
|
||||||
string(REPLACE "<" "<" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
|
string(REPLACE "<" "<" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
|
||||||
string(REPLACE ">" ">" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
|
string(REPLACE ">" ">" APPLICATION_NAME_XML_ESCAPED "${APPLICATION_NAME_XML_ESCAPED}")
|
||||||
|
|
||||||
set(PACKAGE "${APPLICATION_SHORTNAME}-client")
|
if (NOT DEFINED LINUX_PACKAGE_SHORTNAME)
|
||||||
|
set(LINUX_PACKAGE_SHORTNAME "${APPLICATION_SHORTNAME}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT DEFINED PACKAGE)
|
||||||
|
set(PACKAGE "${LINUX_PACKAGE_SHORTNAME}-client")
|
||||||
|
endif()
|
||||||
|
|
||||||
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
|
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
|
||||||
|
|
||||||
if(NOT CRASHREPORTER_EXECUTABLE)
|
if(NOT CRASHREPORTER_EXECUTABLE)
|
||||||
@@ -41,7 +40,13 @@ endif()
|
|||||||
include(Warnings)
|
include(Warnings)
|
||||||
|
|
||||||
include(${CMAKE_SOURCE_DIR}/VERSION.cmake)
|
include(${CMAKE_SOURCE_DIR}/VERSION.cmake)
|
||||||
|
# For config.h
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
# Allows includes based on src/ like #include "common/utility.h" or #include "csync/csync.h"
|
||||||
|
include_directories(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
# disable the crashreporter if libcrashreporter-qt is not available or we're building for ARM
|
# disable the crashreporter if libcrashreporter-qt is not available or we're building for ARM
|
||||||
if( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/libcrashreporter-qt/CMakeLists.txt")
|
if( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/libcrashreporter-qt/CMakeLists.txt")
|
||||||
@@ -52,14 +57,6 @@ if(NOT WITH_CRASHREPORTER)
|
|||||||
message(STATUS "Build of crashreporter disabled.")
|
message(STATUS "Build of crashreporter disabled.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#####
|
|
||||||
## handle DBUS for Fdo notifications
|
|
||||||
if( UNIX AND NOT APPLE )
|
|
||||||
add_definitions( -DUSE_FDO_NOTIFICATIONS)
|
|
||||||
set(WITH_DBUS ON)
|
|
||||||
endif()
|
|
||||||
####
|
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
include(DefineInstallationPaths)
|
include(DefineInstallationPaths)
|
||||||
include(GenerateExportHeader)
|
include(GenerateExportHeader)
|
||||||
@@ -68,6 +65,12 @@ include(GetGitRevisionDescription)
|
|||||||
|
|
||||||
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
|
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
|
||||||
|
|
||||||
|
add_definitions(
|
||||||
|
-DQT_USE_QSTRINGBUILDER
|
||||||
|
-DQT_MESSAGELOGCONTEXT #enable function name and line number in debug output
|
||||||
|
-DQT_DEPRECATED_WARNINGS
|
||||||
|
)
|
||||||
|
|
||||||
# if we cannot get it from git, directly try .tag (packages)
|
# if we cannot get it from git, directly try .tag (packages)
|
||||||
# this will work if the tar balls have been properly created
|
# this will work if the tar balls have been properly created
|
||||||
# via git-archive.
|
# via git-archive.
|
||||||
@@ -120,7 +123,22 @@ if(NO_MSG_HANDLER)
|
|||||||
add_definitions(-DNO_MSG_HANDLER=1)
|
add_definitions(-DNO_MSG_HANDLER=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# this option creates only libocsync and libowncloudsync
|
# this option builds the shell integration
|
||||||
|
option(BUILD_SHELL_INTEGRATION "BUILD_SHELL_INTEGRATION" ON)
|
||||||
|
|
||||||
|
# this option builds/installs the generic shell integration icons
|
||||||
|
option(BUILD_SHELL_INTEGRATION_ICONS "BUILD_SHELL_INTEGRATION_ICONS" ON)
|
||||||
|
|
||||||
|
# this options builds the dolphin integration plugin
|
||||||
|
option(BUILD_SHELL_INTEGRATION_DOLPHIN "BUILD_SHELL_INTEGRATION_DOLPHIN" ON)
|
||||||
|
|
||||||
|
# this options builds the nautilus (like) integration plugins
|
||||||
|
option(BUILD_SHELL_INTEGRATION_NAUTILUS "BUILD_SHELL_INTEGRATION_NAUTILUS" ON)
|
||||||
|
|
||||||
|
# this option builds the client
|
||||||
|
option(BUILD_CLIENT "BUILD_CLIENT" ON)
|
||||||
|
|
||||||
|
# this option creates only libocsync and libowncloudsync (NOTE: BUILD_CLIENT needs to be on)
|
||||||
option(BUILD_LIBRARIES_ONLY "BUILD_LIBRARIES_ONLY" OFF)
|
option(BUILD_LIBRARIES_ONLY "BUILD_LIBRARIES_ONLY" OFF)
|
||||||
|
|
||||||
# When this option is enabled, 5xx errors are not added to the blacklist
|
# When this option is enabled, 5xx errors are not added to the blacklist
|
||||||
@@ -153,56 +171,68 @@ if(APPLE)
|
|||||||
set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
|
set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(OpenSSL 1.0.0 REQUIRED)
|
if(BUILD_CLIENT)
|
||||||
|
if(APPLE)
|
||||||
|
find_package(Sparkle)
|
||||||
|
endif(APPLE)
|
||||||
|
|
||||||
if(APPLE)
|
if(UNIX)
|
||||||
find_package(Sparkle)
|
find_package(INotify REQUIRED)
|
||||||
endif(APPLE)
|
else()
|
||||||
|
find_package(INotify)
|
||||||
if(UNIX)
|
|
||||||
find_package(INotify REQUIRED)
|
|
||||||
else()
|
|
||||||
find_package(INotify)
|
|
||||||
endif()
|
|
||||||
find_package(Sphinx)
|
|
||||||
find_package(PdfLatex)
|
|
||||||
|
|
||||||
find_package(SQLite3 3.8.0 REQUIRED)
|
|
||||||
# On some OS, we want to use our own, not the system sqlite
|
|
||||||
if (USE_OUR_OWN_SQLITE3)
|
|
||||||
include_directories(BEFORE ${SQLITE3_INCLUDE_DIR})
|
|
||||||
if (WIN32)
|
|
||||||
add_definitions(-DSQLITE_API=__declspec\(dllimport\))
|
|
||||||
endif()
|
endif()
|
||||||
|
find_package(Sphinx)
|
||||||
|
find_package(PdfLatex)
|
||||||
|
find_package(OpenSSL REQUIRED VERSION 1.0)
|
||||||
|
|
||||||
|
find_package(ZLIB REQUIRED)
|
||||||
|
find_package(GLib2)
|
||||||
|
find_package(Gio)
|
||||||
|
find_package(Libcloudproviders)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(ZLIB REQUIRED)
|
if (NOT DEFINED APPLICATION_ICON_NAME)
|
||||||
|
set(APPLICATION_ICON_NAME ${APPLICATION_SHORTNAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
include(NextcloudCPack.cmake)
|
||||||
|
|
||||||
configure_file(test/test_journal.db "${CMAKE_BINARY_DIR}/test/test_journal.db" COPYONLY)
|
|
||||||
|
|
||||||
include(OwnCloudCPack.cmake)
|
|
||||||
|
|
||||||
add_definitions(-DUNICODE)
|
add_definitions(-DUNICODE)
|
||||||
add_definitions(-D_UNICODE)
|
add_definitions(-D_UNICODE)
|
||||||
if( WIN32 )
|
if( WIN32 )
|
||||||
add_definitions( -D__USE_MINGW_ANSI_STDIO=1 )
|
add_definitions( -D__USE_MINGW_ANSI_STDIO=1 )
|
||||||
add_definitions( -DNOMINMAX )
|
add_definitions( -DNOMINMAX )
|
||||||
|
# Get APIs from from Vista onwards.
|
||||||
|
add_definitions( -D_WIN32_WINNT=0x0600)
|
||||||
|
add_definitions( -DWINVER=0x0600)
|
||||||
endif( WIN32 )
|
endif( WIN32 )
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Handle Translations, pick all client_* files from trans directory.
|
# Handle Translations, pick all client_* files from trans directory.
|
||||||
file( GLOB TRANS_FILES ${CMAKE_SOURCE_DIR}/translations/client_*.ts)
|
file( GLOB TRANS_FILES ${CMAKE_SOURCE_DIR}/translations/client_*.ts)
|
||||||
set(TRANSLATIONS ${TRANS_FILES})
|
set(TRANSLATIONS ${TRANS_FILES})
|
||||||
|
|
||||||
add_subdirectory(csync)
|
# Make sure we set this before recursing into child folders.
|
||||||
add_subdirectory(src)
|
set(WITH_TESTING ${UNIT_TESTING})
|
||||||
if(NOT BUILD_LIBRARIES_ONLY)
|
|
||||||
add_subdirectory(shell_integration)
|
if(BUILD_CLIENT)
|
||||||
add_subdirectory(doc)
|
add_subdirectory(src)
|
||||||
add_subdirectory(doc/dev)
|
if(NOT BUILD_LIBRARIES_ONLY)
|
||||||
add_subdirectory(admin)
|
add_subdirectory(man)
|
||||||
endif(NOT BUILD_LIBRARIES_ONLY)
|
add_subdirectory(doc)
|
||||||
|
add_subdirectory(doc/dev)
|
||||||
|
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/admin)
|
||||||
|
add_subdirectory(admin)
|
||||||
|
endif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/admin)
|
||||||
|
endif(NOT BUILD_LIBRARIES_ONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_SHELL_INTEGRATION)
|
||||||
|
add_subdirectory(shell_integration)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(UNIT_TESTING)
|
if(UNIT_TESTING)
|
||||||
include(CTest)
|
include(CTest)
|
||||||
@@ -210,10 +240,13 @@ if(UNIT_TESTING)
|
|||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif(UNIT_TESTING)
|
endif(UNIT_TESTING)
|
||||||
|
|
||||||
|
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
configure_file(version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||||
|
|
||||||
if(BUILD_OWNCLOUD_OSX_BUNDLE)
|
if(BUILD_OWNCLOUD_OSX_BUNDLE)
|
||||||
install(FILES sync-exclude.lst DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/)
|
install(FILES sync-exclude.lst DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/)
|
||||||
configure_file(sync-exclude.lst bin/${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
|
configure_file(sync-exclude.lst bin/${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
|
||||||
else()
|
elseif(BUILD_CLIENT)
|
||||||
install( FILES sync-exclude.lst DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME} )
|
install( FILES sync-exclude.lst DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME} )
|
||||||
configure_file(sync-exclude.lst bin/sync-exclude.lst COPYONLY)
|
configure_file(sync-exclude.lst bin/sync-exclude.lst COPYONLY)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1,20 +1,18 @@
|
|||||||
## Submitting Desktop Client issues
|
## Submitting Desktop Client issues
|
||||||
|
|
||||||
If you have questions about how to use the ownCloud Desktop Client, please
|
If you have questions about how to use the Nextcloud Desktop Client, please
|
||||||
direct these to the [mailing list][mailinglist] or our [forum][forum].
|
visit our [support site][support] or our [forum][forum].
|
||||||
We are also available on [IRC][irc].
|
We are also available on [IRC][irc].
|
||||||
|
|
||||||
### Bug Reporting Guidelines
|
### Bug Reporting Guidelines
|
||||||
* __Important__: Report the issue using our [template][template], it includes all the
|
* __Important__: Report the issue using our [template][template], it includes all the
|
||||||
information we need to track down the issue.
|
information we need to track down the issue.
|
||||||
* __SECURITY__: Report any potential security bug to security@owncloud.com following our [security policy](https://owncloud.org/security/) instead of filing an issue in our bug tracker
|
* __SECURITY__: Report any potential security bug by following our [security policy](https://nextcloud.com/security/) instead of filing an issue in our bug tracker
|
||||||
* This repository is *only* for issues within the ownCloud desktop client.
|
* This repository is *only* for issues within the Nextcloud desktop client.
|
||||||
Issues in other components should be reported in their own repositores:
|
Issues in other components should be reported in their own repositores:
|
||||||
- [ownCloud server](https://github.com/owncloud/core/issues)
|
- [Nextcloud server](https://github.com/nextcloud/server/issues)
|
||||||
- [ownCloud apps](https://github.com/owncloud/apps/issues) (e.g. Calendar,
|
- [Android client](https://github.com/nextcloud/android/issues)
|
||||||
Contacts...)
|
- [iOS client](https://github.com/nextcloud/ios/issues)
|
||||||
- [Android client](https://github.com/owncloud/android/issues)
|
|
||||||
- [iOS client](https://github.com/owncloud/ios-issues/issues)
|
|
||||||
* Search the existing issues first, it's likely that your issue was already
|
* Search the existing issues first, it's likely that your issue was already
|
||||||
reported.
|
reported.
|
||||||
|
|
||||||
@@ -23,27 +21,20 @@ If your issue appears to be a bug, and hasn't been reported, open a new issue.
|
|||||||
Help us to maximize the effort we can spend fixing issues and adding new
|
Help us to maximize the effort we can spend fixing issues and adding new
|
||||||
features, by not reporting duplicate issues.
|
features, by not reporting duplicate issues.
|
||||||
|
|
||||||
[template]: https://raw.github.com/owncloud/client/master/issue_template.md
|
[template]: https://raw.githubusercontent.com/nextcloud/appstore/master/.github/issue_template.md
|
||||||
[mailinglist]: https://mail.kde.org/mailman/listinfo/owncloud
|
[support]: https://nextcloud.com/support/
|
||||||
[forum]: http://forum.owncloud.org/
|
[forum]: https://help.nextcloud.com/categories
|
||||||
[irc]: http://webchat.freenode.net/?channels=owncloud&uio=d4
|
[irc]: https://webchat.freenode.net/?channels=nextcloud
|
||||||
|
|
||||||
## Contributing to Source Code
|
## Contributing to Source Code
|
||||||
|
|
||||||
Thanks for wanting to contribute source code to ownCloud. That's great!
|
Thanks for wanting to contribute source code to Nextcloud. That's great!
|
||||||
|
|
||||||
Before we're able to merge your code to ownCloud Desktop Client, you need to sign
|
You do not need to sign a Contributor Agreement, but we ask that you follow our
|
||||||
our [Contributor Agreement][agreement].
|
[Code of Conduct](https://nextcloud.com/code-of-conduct/).
|
||||||
|
|
||||||
Please read the [Desktop Client Manual][desktopman] and the [Developer
|
Please read the [Contribution Guide](https://nextcloud.com/contribute/) to get
|
||||||
Manuals][devmanual] to get useful info like how to create your first
|
started.
|
||||||
application or how to test the ownCloud code with phpunit.
|
|
||||||
|
|
||||||
[agreement]: http://owncloud.org/about/contributor-agreement/
|
|
||||||
[devmanual]: http://owncloud.org/dev
|
|
||||||
[desktopman]: http://doc.owncloud.org/desktop
|
|
||||||
|
|
||||||
## Translations
|
## Translations
|
||||||
Please submit translations via [Transifex][transifex].
|
Please submit translations via [Transifex](https://www.transifex.com/nextcloud/nextcloud/).
|
||||||
|
|
||||||
[transifex]: https://www.transifex.com/projects/p/owncloud/
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ set( OEM_THEME_DIR @OEM_THEME_DIR@ )
|
|||||||
if ( DEFINED OEM_THEME_DIR AND EXISTS ${OEM_THEME_DIR}/OEM.cmake )
|
if ( DEFINED OEM_THEME_DIR AND EXISTS ${OEM_THEME_DIR}/OEM.cmake )
|
||||||
include ( ${OEM_THEME_DIR}/OEM.cmake )
|
include ( ${OEM_THEME_DIR}/OEM.cmake )
|
||||||
else ()
|
else ()
|
||||||
include ( "${CMAKE_SOURCE_DIR}/OWNCLOUD.cmake" )
|
include ( "${CMAKE_SOURCE_DIR}/NEXTCLOUD.cmake" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set( CRASHREPORTER_EXECUTABLE @CRASHREPORTER_EXECUTABLE@)
|
set( CRASHREPORTER_EXECUTABLE @CRASHREPORTER_EXECUTABLE@)
|
||||||
|
|||||||
107
ChangeLog
107
ChangeLog
@@ -1,8 +1,106 @@
|
|||||||
ChangeLog
|
ChangeLog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
version 2.4.0 (2017-12-XX)
|
||||||
|
* If you're using 2.4.0 alpha1, please upgrade as previous alphas/rcs had an issue with hidden files and renames!
|
||||||
|
* OAuth2 authentication support by opening external browser (#5668)
|
||||||
|
* Shibboleth: Change to use OAuth2 if supported (#6198)
|
||||||
|
* Sharing: Add support for multiple public link shares (#5655)
|
||||||
|
* Sharing: Add option to copy/email private links (#5023, #5627)
|
||||||
|
* Sharing: Add option "show file listing" (#5837)
|
||||||
|
* Sharing: Show warning that links are public (#5747)
|
||||||
|
* Sharing: Sharing dialog redesign: multiple share links support (#5695)
|
||||||
|
* Sharing: Make "can edit" partially checked sometimes (#5642)
|
||||||
|
* Sharing: Trigger a sync for folder affected by a change of sharing (#6098)
|
||||||
|
* Wizard: Never propose an existing folder for syncing (#5597)
|
||||||
|
* Wizard: Don't show last page anymore, go to settings directly (#5726)
|
||||||
|
* Wizard: Handle url-shortener redirects (#5954)
|
||||||
|
* Wizard: Resolve url/ redirects only if url/status.php not found (#5954)
|
||||||
|
* Wizard: Add explanation text when server error is shown (#6157)
|
||||||
|
* Wizard: Update the window size on high dpi screen (#6156)
|
||||||
|
* Wizard: Don't report confusing error message (#6116)
|
||||||
|
* Gui: Display the user server avatar (#5482)
|
||||||
|
* Gui: Use display name of user, not internal name
|
||||||
|
* Server URL: Update configuration in case of permanent redirection (#5972)
|
||||||
|
* Gui: Allow to add multiple sync folder connection of the same folder (#6032)
|
||||||
|
* Tray Menu: More detailed status messages
|
||||||
|
* Tray Menu: Shibboleth: raise the browser when clicking on the tray (#6105)
|
||||||
|
* Activity: Link errors from the account tab, allow filtering by account/folder (#5861)
|
||||||
|
* Activity: Present conflicts more prominently (#5894)
|
||||||
|
* Activity: Allow sorting the columns in issues and protocol tabs (#6093, #6086)
|
||||||
|
* Selective Sync: Open sub folder context menu (#5596)
|
||||||
|
* Selective Sync: Skip excluded folders when reading db (#5772)
|
||||||
|
* Selective Sync: Remove local files of unselected folder despite other modified files (#5783)
|
||||||
|
* Excludes: Remove .htaccess form list of excluded files (#5701)
|
||||||
|
* Excludes: Hardcode desktop.ini
|
||||||
|
* Excludes: Allow escaping "#" (#6012)
|
||||||
|
* Excludes: Use faster matching via QRegularExpression (#6063)
|
||||||
|
* Discovery: Increase the MAX_DEPTH and show deep folders as ignored (#1067)
|
||||||
|
* Discovery: General speed improvements
|
||||||
|
* Downloads: Remove empty temporary if disk space full (#5746)
|
||||||
|
* Downloads: Read Content-MD5 header for object store setups
|
||||||
|
* Checksums: Add global disable environment variable (#5017)
|
||||||
|
* Quota: PropagateUpload: Model of remote quota, avoid some uploads (#5537)
|
||||||
|
* Create favorite also in folder wizard (#455)
|
||||||
|
* Windows: Use the application icon for the Windows 8 sidebar favorite (#2446, #5690)
|
||||||
|
* macOS: Finder sidebar icon (#296)
|
||||||
|
* Overlay Icons: Consider also the "shared by me" as shared (#4788)
|
||||||
|
* Overlay Icons: Update right after sharing (#6115)
|
||||||
|
* Overlay Icons: Fix different case paths not matching (#5257)
|
||||||
|
* Overlay Icons: Detect changes in the shared flag (#6098)
|
||||||
|
* Windows Overlay Icons: Potential hang fixes
|
||||||
|
* Linux Overlay Icons: fix branded nemo and caja shell integration (#5966)
|
||||||
|
* Credentials: Fix behavior for bad password (#5989)
|
||||||
|
* Credentials: Don't create empty client cert keychain entries (#5752)
|
||||||
|
* Credentials: Namespace windows cred keys (#6125)
|
||||||
|
* Credentials: Use per-account keychain entries (#5830, #6126)
|
||||||
|
* AccountSettings: Triggering log in re-ask about previously rejected certificates (#5819)
|
||||||
|
* owncloudcmd: Added bandwidth limit parameter (#5707)
|
||||||
|
* owncloudcmd: Fix timestamps, Fix --logdebug
|
||||||
|
* AccountSettings: Sync with clean discovery on Ctrl-F6 (#5666)
|
||||||
|
* Sync: Dynamic sizing of chunks in chunked uploads for improved big file upload performance (#5852)
|
||||||
|
* Sync: Introduce overall errors that are not tied to a file (#5746)
|
||||||
|
* Sync: Better messaging for 507 Insufficient Storage (#5537)
|
||||||
|
* Sync: Create conflicts by comparing the hash of files with identical mtime/size (#5589)
|
||||||
|
* Sync: Avoid downloads by comparing the hash of files with identical mtime/size (#6153)
|
||||||
|
* Sync: Upload conflict files if OWNCLOUD_UPLOAD_CONFLICT_FILES environment variable is set (#6038)
|
||||||
|
* Sync: Blacklist: Don't let errors become warnings (#5516)
|
||||||
|
* Sync: Check etag again after active sync (#4116)
|
||||||
|
* Sync: Rename handling fixes: duplicate file ids (#6096, #6212)
|
||||||
|
* Sync: Rename handling fixes: File size must be equal
|
||||||
|
* Sync: Rename handling: Fix duplicate files on abort/resume sync (#5949)
|
||||||
|
* Sync: Add capability for invalid filename regexes (#6092)
|
||||||
|
* SyncJournalDB: Fall back to DELETE journal mode if WAL mode does not seem to work (#5723)
|
||||||
|
* SyncJournalDB: Don't crash if the db file is readonly (#6050)
|
||||||
|
* SyncJournalDB: DB close error is not fatal
|
||||||
|
* Fix at least one memory leak
|
||||||
|
* Documentation improvements
|
||||||
|
* Logging improvements (With Qt logging categories) (#5671)
|
||||||
|
* Logging filtering per account (#5672)
|
||||||
|
* Crash fixes
|
||||||
|
* Test improvements
|
||||||
|
* Small UI layout fixes
|
||||||
|
* Performance improvements
|
||||||
|
* Maintenance Mode: Detect maintenance mode (#4485)
|
||||||
|
* Maintenance Mode: Add a 1 to 5 min reconnection delay (#5872)
|
||||||
|
* HTTP: Send a unique X-Request-ID with each request (#5853)
|
||||||
|
* HTTP: Support HTTP2 when built and running with Qt 5.9.x (Official packages still on Qt 5.6.x) (#5659)
|
||||||
|
* owncloudcmd: Don't start if connection or auth fails (#5692)
|
||||||
|
* csync: Switch build from C to C++ (#6033)
|
||||||
|
* csync: Refactor a lot to use common data structures to save memory and memory copying
|
||||||
|
* csync: Switch some data structures to Qt data structures
|
||||||
|
* csync: Switch to using upper layer SyncJournalDB (#6087)
|
||||||
|
* Switch 3rdparty/json usage to Qt5's QJson (#5710)
|
||||||
|
* OpenSSL: Don't require directly, only via Qt (#5833)
|
||||||
|
* Remove iconv dependency, use Qt for file system locale encoding/decoding (emoji filename support on macOS) (#5875)
|
||||||
|
* Compilation: Remove Qt 4 code (#6025, #5702, #5505)
|
||||||
|
* Harmonize source code style with clang-format (#5732)
|
||||||
|
* Switch over to Qt 5 function pointer signal/slot syntax (#6041)
|
||||||
|
* Compile with stack-smashing protection
|
||||||
|
* Updater: Rudimentary support for beta channel (#6048)
|
||||||
|
|
||||||
version 2.3.4 (2017-11-02)
|
version 2.3.4 (2017-11-02)
|
||||||
* Checksums: Use addData function
|
* Checksums: Use addData function to avoid endless loop CPU load issues with Office files
|
||||||
* Packaging: Require ZLIB
|
* Packaging: Require ZLIB
|
||||||
|
|
||||||
version 2.3.3 (2017-08-29)
|
version 2.3.3 (2017-08-29)
|
||||||
@@ -11,17 +109,16 @@ version 2.3.3 (2017-08-29)
|
|||||||
* Settings: Make window bigger so Qt version is always visible (#5760)
|
* Settings: Make window bigger so Qt version is always visible (#5760)
|
||||||
* Share links: Show warning that public link shares are public (#5786)
|
* Share links: Show warning that public link shares are public (#5786)
|
||||||
* Downloads: Re-trigger folder discovery on HTTP 404 (#5799)
|
* Downloads: Re-trigger folder discovery on HTTP 404 (#5799)
|
||||||
* Notifications: Propagate "Dismiss" as DELETE to server (#5922)
|
|
||||||
* Overlay Icons: Fix potential hangs on Windows
|
* Overlay Icons: Fix potential hangs on Windows
|
||||||
* SyncJournalDB: Don't use ._ as filename pattern if that does not work because of SMB storage settings (#5844)
|
* SyncJournalDB: Don't use ._ as filename pattern if that does not work because of SMB storage settings (#5844)
|
||||||
* SyncJournalDB: Log reason for sqlite3 opening errors
|
* SyncJournalDB: Log reason for sqlite3 opening errors
|
||||||
* Windows: Fix a memory leak in FileSystem::longWinPath
|
* Notifications: Proapgate "Dismiss" button action to server (#5922)
|
||||||
* Switch Linux build also to Qt 5.6.2 (#5470)
|
* Switch Linux build also to Qt 5.6.2 (#5470)
|
||||||
* Stopped maintaining Qt 4 buildability
|
* Stopped maintaining Qt 4 buildability
|
||||||
|
|
||||||
version 2.3.2 (2017-05-08)
|
version 2.3.2 (2017-05-08)
|
||||||
* Fix more crashes (thanks to everyone submitting to our crash reporter!)
|
* Fix more crashes (thanks to everyone submitting to our crash reporter!)
|
||||||
* Improve compatibility with server 10.0 (#5691, OC-Total-Length)
|
* Improve compatibility with server 10.0 (#5691, X-OC-Total-Size)
|
||||||
* Share dialog: UI improvements, Bring to front on tray click
|
* Share dialog: UI improvements, Bring to front on tray click
|
||||||
* owncloudcmd: Align process return value with sync return value (#3936)
|
* owncloudcmd: Align process return value with sync return value (#3936)
|
||||||
* Fix disk free check on Windows when opening the local DB
|
* Fix disk free check on Windows when opening the local DB
|
||||||
@@ -133,7 +230,6 @@ version 2.2.0 (release 2016-05-12)
|
|||||||
* Documentation Improvements, ie. about overlay icons
|
* Documentation Improvements, ie. about overlay icons
|
||||||
* Translation fixes
|
* Translation fixes
|
||||||
* Countless other bugfixes
|
* Countless other bugfixes
|
||||||
* Sqlite Update to recent version
|
|
||||||
* Update of QtKeyChain to support Windows credential store
|
* Update of QtKeyChain to support Windows credential store
|
||||||
* Packaging of dolphin overlay icon module for bleeding edge distros
|
* Packaging of dolphin overlay icon module for bleeding edge distros
|
||||||
|
|
||||||
@@ -204,7 +300,6 @@ version 2.1 (release 2015-12-03)
|
|||||||
* Fixed getting size for selective sync (#3986)
|
* Fixed getting size for selective sync (#3986)
|
||||||
* Re-added close button in the settings window (#3713)
|
* Re-added close button in the settings window (#3713)
|
||||||
* Added abililty to handle storage limitations gracefully (#3736)
|
* Added abililty to handle storage limitations gracefully (#3736)
|
||||||
* Updated 3rdparty dependencies: sqlite version 3.9.1
|
|
||||||
* Organized patches to our base Qt version into admin/qt/patches
|
* Organized patches to our base Qt version into admin/qt/patches
|
||||||
* Plus: A lot of unmentioned improvements and fixes
|
* Plus: A lot of unmentioned improvements and fixes
|
||||||
|
|
||||||
|
|||||||
42
Jenkinsfile
vendored
42
Jenkinsfile
vendored
@@ -1,42 +0,0 @@
|
|||||||
#!groovy
|
|
||||||
|
|
||||||
node('CLIENT') {
|
|
||||||
stage 'Checkout'
|
|
||||||
checkout scm
|
|
||||||
sh '''git submodule update --init'''
|
|
||||||
|
|
||||||
stage 'Qt5'
|
|
||||||
sh '''rm -rf build
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake -DCMAKE_BUILD_TYPE="Debug" -DUNIT_TESTING=1 -DWITH_TESTING=1 -DBUILD_WITH_QT4=OFF ..
|
|
||||||
make -j4
|
|
||||||
ctest --output-on-failure'''
|
|
||||||
|
|
||||||
stage 'Qt5 - clang'
|
|
||||||
sh '''rm -rf build
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DUNIT_TESTING=1 -DWITH_TESTING=1 -DBUILD_WITH_QT4=OFF ..
|
|
||||||
make -j4
|
|
||||||
ctest --output-on-failure'''
|
|
||||||
|
|
||||||
|
|
||||||
stage 'Win32'
|
|
||||||
def win32 = docker.image('guruz/docker-owncloud-client-win32:latest')
|
|
||||||
win32.pull() // make sure we have the latest available from Docker Hub
|
|
||||||
win32.inside {
|
|
||||||
sh '''
|
|
||||||
rm -rf build-win32
|
|
||||||
mkdir build-win32
|
|
||||||
cd build-win32
|
|
||||||
../admin/win/download_runtimes.sh
|
|
||||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../admin/win/Toolchain-mingw32-openSUSE.cmake -DWITH_CRASHREPORTER=ON
|
|
||||||
make -j4
|
|
||||||
make package
|
|
||||||
ctest .
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
22
NEXTCLOUD.cmake
Normal file
22
NEXTCLOUD.cmake
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
set( APPLICATION_NAME "Nextcloud-e2e" )
|
||||||
|
set( APPLICATION_SHORTNAME "Nextcloud-e2e" )
|
||||||
|
set( APPLICATION_EXECUTABLE "nextcloud" )
|
||||||
|
set( APPLICATION_DOMAIN "nextcloud.com" )
|
||||||
|
set( APPLICATION_VENDOR "Nextcloud GmbH" )
|
||||||
|
set( APPLICATION_UPDATE_URL "https://updates.nextcloud.org/client/" CACHE string "URL for updater" )
|
||||||
|
set( APPLICATION_ICON_NAME "Nextcloud" )
|
||||||
|
|
||||||
|
set( LINUX_PACKAGE_SHORTNAME "nextcloud" )
|
||||||
|
|
||||||
|
set( THEME_CLASS "NextcloudTheme" )
|
||||||
|
set( APPLICATION_REV_DOMAIN "com.nextcloud.desktopclient" )
|
||||||
|
set( WIN_SETUP_BITMAP_PATH "${CMAKE_SOURCE_DIR}/admin/win/nsi" )
|
||||||
|
|
||||||
|
set( MAC_INSTALLER_BACKGROUND_FILE "${CMAKE_SOURCE_DIR}/admin/osx/installer-background.png" CACHE STRING "The MacOSX installer background image")
|
||||||
|
|
||||||
|
# set( THEME_INCLUDE "${OEM_THEME_DIR}/mytheme.h" )
|
||||||
|
# set( APPLICATION_LICENSE "${OEM_THEME_DIR}/license.txt )
|
||||||
|
|
||||||
|
option( WITH_CRASHREPORTER "Build crashreporter" OFF )
|
||||||
|
#set( CRASHREPORTER_SUBMIT_URL "https://crash-reports.owncloud.com/submit" CACHE string "URL for crash reporter" )
|
||||||
|
#set( CRASHREPORTER_ICON ":/owncloud-icon.png" )
|
||||||
@@ -5,7 +5,7 @@ set( CPACK_PACKAGE_CONTACT "Dominik Schmidt <domme@tomahawk-player.org>" )
|
|||||||
if ( DEFINED OEM_THEME_DIR AND EXISTS ${OEM_THEME_DIR}/OEM.cmake )
|
if ( DEFINED OEM_THEME_DIR AND EXISTS ${OEM_THEME_DIR}/OEM.cmake )
|
||||||
include ( "${OEM_THEME_DIR}/OEM.cmake" )
|
include ( "${OEM_THEME_DIR}/OEM.cmake" )
|
||||||
else ()
|
else ()
|
||||||
include ( "${CMAKE_SOURCE_DIR}/OWNCLOUD.cmake" )
|
include ( "${CMAKE_SOURCE_DIR}/NEXTCLOUD.cmake" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include( VERSION.cmake )
|
include( VERSION.cmake )
|
||||||
@@ -48,7 +48,7 @@ if(WIN32)
|
|||||||
set( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md" ) # File used as a description of a project /path/to/project/ReadMe.txt
|
set( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md" ) # File used as a description of a project /path/to/project/ReadMe.txt
|
||||||
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "${APPLICATION_NAME} Syncing Client" ) # Description summary of a project
|
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "${APPLICATION_NAME} Syncing Client" ) # Description summary of a project
|
||||||
# CPACK_PACKAGE_EXECUTABLES List of pairs of executables and labels. Used by the NSIS generator to create Start Menu shortcuts. ccmake;CMake
|
# CPACK_PACKAGE_EXECUTABLES List of pairs of executables and labels. Used by the NSIS generator to create Start Menu shortcuts. ccmake;CMake
|
||||||
set( CPACK_PACKAGE_INSTALL_DIRECTORY ${APPLICATION_SHORTNAME} ) # Installation directory on the target system -> C:\Program Files\fellody
|
set( CPACK_PACKAGE_INSTALL_DIRECTORY ${APPLICATION_SHORTNAME} ) # Installation directory on the target system -> C:\Program Files\${APPLICATION_SHORTNAME}
|
||||||
set( CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${APPLICATION_SHORTNAME} ) # Registry key used when installing this project CMake 2.5.0
|
set( CPACK_PACKAGE_INSTALL_REGISTRY_KEY ${APPLICATION_SHORTNAME} ) # Registry key used when installing this project CMake 2.5.0
|
||||||
set( CPACK_PACKAGE_NAME ${APPLICATION_NAME} ) # Package name, defaults to the project name
|
set( CPACK_PACKAGE_NAME ${APPLICATION_NAME} ) # Package name, defaults to the project name
|
||||||
set( CPACK_PACKAGE_VENDOR "http://${APPLICATION_DOMAIN}" ) # Package vendor name
|
set( CPACK_PACKAGE_VENDOR "http://${APPLICATION_DOMAIN}" ) # Package vendor name
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
set( APPLICATION_NAME "ownCloud" )
|
|
||||||
set( APPLICATION_EXECUTABLE "owncloud" )
|
|
||||||
set( APPLICATION_DOMAIN "owncloud.com" )
|
|
||||||
set( APPLICATION_VENDOR "ownCloud" )
|
|
||||||
set( APPLICATION_UPDATE_URL "https://updates.owncloud.com/client/" CACHE string "URL for updater" )
|
|
||||||
|
|
||||||
set( THEME_CLASS "ownCloudTheme" )
|
|
||||||
set( APPLICATION_REV_DOMAIN "com.owncloud.desktopclient" )
|
|
||||||
set( WIN_SETUP_BITMAP_PATH "${CMAKE_SOURCE_DIR}/admin/win/nsi" )
|
|
||||||
|
|
||||||
set( MAC_INSTALLER_BACKGROUND_FILE "${CMAKE_SOURCE_DIR}/admin/osx/installer-background.png" CACHE STRING "The MacOSX installer background image")
|
|
||||||
|
|
||||||
# set( THEME_INCLUDE "${OEM_THEME_DIR}/mytheme.h" )
|
|
||||||
# set( APPLICATION_LICENSE "${OEM_THEME_DIR}/license.txt )
|
|
||||||
|
|
||||||
option( WITH_CRASHREPORTER "Build crashreporter" OFF )
|
|
||||||
set( CRASHREPORTER_SUBMIT_URL "https://crash-reports.owncloud.com/submit" CACHE string "URL for crash reporter" )
|
|
||||||
set( CRASHREPORTER_ICON ":/owncloud-icon.png" )
|
|
||||||
42
README.md
42
README.md
@@ -1,63 +1,37 @@
|
|||||||
# ownCloud Desktop Client
|
# Nextcloud Desktop Client
|
||||||
|
|
||||||
| Job | State |
|
|
||||||
|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| client-build-matrix | [](https://ci.owncloud.org/job/client-build-matrix-linux/) |
|
|
||||||
| client-test-matrix-linux-no-build | [](https://ci.owncloud.org/job/client-test-matrix-linux-no-build/) |
|
|
||||||
| coverity_scan | [](https://scan.coverity.com/projects/owncloud-mirall)
|
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
The ownCloud Desktop Client is a tool to synchronize files from ownCloud Server
|
The Nextcloud Desktop Client is a tool to synchronize files from Nextcloud Server
|
||||||
with your computer.
|
with your computer.
|
||||||
|
|
||||||
## Download
|
## Download
|
||||||
|
|
||||||
### Binary packages
|
### Binary packages
|
||||||
|
|
||||||
* Refer to the download page https://owncloud.org/install/#install-clients
|
* Refer to the [download page https://nextcloud.com/install/#install-clients](https://nextcloud.com/install/#install-clients)
|
||||||
|
|
||||||
### Source code
|
### Source code
|
||||||
|
|
||||||
The ownCloud Desktop Client is developed in Git. Since Git makes it easy to
|
The Nextcloud Desktop Client is developed in Git. Since Git makes it easy to
|
||||||
fork and improve the source code and to adapt it to your need, many copies
|
fork and improve the source code and to adapt it to your need, many copies
|
||||||
can be found on the Internet, in particular on GitHub. However, the
|
can be found on the Internet, in particular on GitHub. However, the
|
||||||
authoritative repository maintained by the developers is located at
|
authoritative repository maintained by the developers is located at
|
||||||
https://github.com/owncloud/client.
|
https://github.com/nextcloud/client.
|
||||||
|
|
||||||
## Building the source code
|
|
||||||
|
|
||||||
[Building the Client](http://doc.owncloud.org/desktop/2.2/building.html)
|
|
||||||
in the ownCloud Desktop Client manual.
|
|
||||||
|
|
||||||
## Maintainers and Contributors
|
|
||||||
|
|
||||||
The maintainers of this repository are:
|
|
||||||
|
|
||||||
* Klaas Freitag <freitag@owncloud.com>
|
|
||||||
* Daniel Molkentin <danimo@owncloud.com>
|
|
||||||
* Markus Goetz <guruz@owncloud.com>
|
|
||||||
* Olivier Goffart <ogoffart@owncloud.com>
|
|
||||||
|
|
||||||
ownCloud Desktop Client is developed by the ownCloud community and receives
|
|
||||||
patches from a variety of authors.
|
|
||||||
|
|
||||||
## Reporting issues and contributing
|
## Reporting issues and contributing
|
||||||
|
|
||||||
If you find any bugs or have any suggestion for improvement, please
|
If you find any bugs or have any suggestion for improvement, please
|
||||||
file an issue at https://github.com/owncloud/client/issues. Do not
|
file an issue at https://github.com/nextcloud/client/issues. Do not
|
||||||
contact the authors directly by mail, as this increases the chance
|
contact the authors directly by mail, as this increases the chance
|
||||||
of your report being lost.
|
of your report being lost.
|
||||||
|
|
||||||
If you created a patch, please submit a [Pull
|
If you created a patch, please submit a [Pull
|
||||||
Request](https://github.com/owncloud/client/pulls). For non-trivial
|
Request](https://github.com/nextcloud/client/pulls).
|
||||||
patches, we need you to sign the [Contributor
|
|
||||||
Agreement](https://owncloud.org/contribute/agreement) before
|
|
||||||
we can accept your patch.
|
|
||||||
|
|
||||||
If you want to contact us, e.g. before starting a more complex feature,
|
If you want to contact us, e.g. before starting a more complex feature,
|
||||||
you can join us at
|
you can join us at
|
||||||
[#owncloud-client-dev](irc://irc.freenode.net/#owncloud-client-dev).
|
[#nextcloud-dev](irc://irc.freenode.net/#nextcloud-dev).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
set( MIRALL_VERSION_MAJOR 2 )
|
set( MIRALL_VERSION_MAJOR 2 )
|
||||||
set( MIRALL_VERSION_MINOR 3 )
|
set( MIRALL_VERSION_MINOR 5 )
|
||||||
set( MIRALL_VERSION_PATCH 4 )
|
set( MIRALL_VERSION_PATCH 0 )
|
||||||
set( MIRALL_VERSION_YEAR 2017 )
|
set( MIRALL_VERSION_YEAR 2017 )
|
||||||
set( MIRALL_SOVERSION 0 )
|
set( MIRALL_SOVERSION 0 )
|
||||||
|
|
||||||
if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
|
if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
|
||||||
set( MIRALL_VERSION_SUFFIX "") #e.g. beta1, beta2, rc1
|
set( MIRALL_VERSION_SUFFIX "git") #e.g. beta1, beta2, rc1
|
||||||
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
|
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
|
||||||
|
|
||||||
if( NOT DEFINED MIRALL_VERSION_BUILD )
|
if( NOT DEFINED MIRALL_VERSION_BUILD )
|
||||||
|
|||||||
22
admin/linux/Dockerfile
Normal file
22
admin/linux/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# This DockerFile is used to create the image used for Jenkins, the CI system (see Jenkinsfile)
|
||||||
|
# It is not meant to be used to create the production packages.
|
||||||
|
|
||||||
|
# Distro with Qt 5.6
|
||||||
|
FROM ubuntu:yakkety
|
||||||
|
|
||||||
|
RUN apt-get update -q && DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends \
|
||||||
|
locales \
|
||||||
|
build-essential \
|
||||||
|
clang \
|
||||||
|
ninja-build \
|
||||||
|
cmake \
|
||||||
|
extra-cmake-modules \
|
||||||
|
libsqlite3-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libcmocka-dev \
|
||||||
|
qt5-default \
|
||||||
|
qttools5-dev-tools \
|
||||||
|
libqt5webkit5-dev \
|
||||||
|
qt5keychain-dev \
|
||||||
|
kio-dev \
|
||||||
|
&& apt-get clean
|
||||||
98
admin/linux/build-appimage.sh
Executable file
98
admin/linux/build-appimage.sh
Executable file
@@ -0,0 +1,98 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
mkdir /app
|
||||||
|
mkdir /build
|
||||||
|
|
||||||
|
#Set Qt-5.9
|
||||||
|
export QT_BASE_DIR=/opt/qt59
|
||||||
|
export QTDIR=$QT_BASE_DIR
|
||||||
|
export PATH=$QT_BASE_DIR/bin:$PATH
|
||||||
|
export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH
|
||||||
|
export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
|
||||||
|
|
||||||
|
#set defaults
|
||||||
|
export SUFFIX=${DRONE_PULL_REQUEST:=master}
|
||||||
|
if [ $SUFFIX != "master" ]; then
|
||||||
|
SUFFIX="PR-$SUFFIX"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#QtKeyChain 0.8.0
|
||||||
|
cd /build
|
||||||
|
git clone https://github.com/frankosterfeld/qtkeychain.git
|
||||||
|
cd qtkeychain
|
||||||
|
git checkout v0.8.0
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -D CMAKE_INSTALL_PREFIX=/usr ../
|
||||||
|
make -j4
|
||||||
|
make DESTDIR=/app install
|
||||||
|
|
||||||
|
#Build client
|
||||||
|
cd /build
|
||||||
|
mkdir build-client
|
||||||
|
cd build-client
|
||||||
|
cmake -D CMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
-D NO_SHIBBOLETH=1 \
|
||||||
|
-D QTKEYCHAIN_LIBRARY=/app/usr/lib/x86_64-linux-gnu/libqt5keychain.so \
|
||||||
|
-D QTKEYCHAIN_INCLUDE_DIR=/app/usr/include/qt5keychain/ \
|
||||||
|
-DMIRALL_VERSION_SUFFIX=PR-$DRONE_PULL_REQUEST \
|
||||||
|
-DMIRALL_VERSION_BUILD=$DRONE_BUILD_NUMBER \
|
||||||
|
$DRONE_WORKSPACE
|
||||||
|
make -j4
|
||||||
|
make DESTDIR=/app install
|
||||||
|
|
||||||
|
# Move stuff around
|
||||||
|
cd /app
|
||||||
|
|
||||||
|
mv ./usr/lib/x86_64-linux-gnu/nextcloud/* ./usr/lib/x86_64-linux-gnu/
|
||||||
|
mv ./usr/lib/x86_64-linux-gnu/* ./usr/lib/
|
||||||
|
rm -rf ./usr/lib/nextcloud
|
||||||
|
rm -rf ./usr/lib/cmake
|
||||||
|
rm -rf ./usr/include
|
||||||
|
rm -rf ./usr/mkspecs
|
||||||
|
rm -rf ./usr/lib/x86_64-linux-gnu/
|
||||||
|
|
||||||
|
# Don't bundle nextcloudcmd as we don't run it anyway
|
||||||
|
rm -rf ./usr/bin/nextcloudcmd
|
||||||
|
|
||||||
|
# Don't bundle the explorer extentions as we can't do anything with them in the AppImage
|
||||||
|
rm -rf ./usr/share/caja-python/
|
||||||
|
rm -rf ./usr/share/nautilus-python/
|
||||||
|
rm -rf ./usr/share/nemo-python/
|
||||||
|
|
||||||
|
# Move sync exlucde to right location
|
||||||
|
mv ./etc/Nextcloud/sync-exclude.lst ./usr/bin/
|
||||||
|
rm -rf ./etc
|
||||||
|
|
||||||
|
sed -i -e 's|Icon=nextcloud|Icon=Nextcloud|g' usr/share/applications/nextcloud.desktop # Bug in desktop file?
|
||||||
|
cp ./usr/share/icons/hicolor/512x512/apps/Nextcloud.png . # Workaround for linuxeployqt bug, FIXME
|
||||||
|
|
||||||
|
|
||||||
|
# Because distros need to get their shit together
|
||||||
|
cp -P /lib/x86_64-linux-gnu/libssl.so* ./usr/lib/
|
||||||
|
cp -P /lib/x86_64-linux-gnu/libcrypto.so* ./usr/lib/
|
||||||
|
|
||||||
|
# Use linuxdeployqt to deploy
|
||||||
|
cd /build
|
||||||
|
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
|
||||||
|
chmod a+x linuxdeployqt*.AppImage
|
||||||
|
./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract
|
||||||
|
rm ./linuxdeployqt-continuous-x86_64.AppImage
|
||||||
|
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
|
||||||
|
export LD_LIBRARY_PATH=/app/usr/lib/
|
||||||
|
./squashfs-root/AppRun /app/usr/share/applications/nextcloud.desktop -bundle-non-qt-libs
|
||||||
|
|
||||||
|
# Set origin
|
||||||
|
./squashfs-root/usr/bin/patchelf --set-rpath '$ORIGIN/' /app/usr/lib/libnextcloudsync.so.0
|
||||||
|
|
||||||
|
# Build AppImage
|
||||||
|
./squashfs-root/AppRun /app/usr/share/applications/nextcloud.desktop -appimage
|
||||||
|
|
||||||
|
mv Nextcloud*.AppImage Nextcloud-${SUFFIX}-${DRONE_COMMIT}-x86_64.AppImage
|
||||||
|
|
||||||
|
curl --upload-file $(readlink -f ./Nextcloud*.AppImage) https://transfer.sh/Nextcloud-${SUFFIX}-${DRONE_COMMIT}-x86_64.AppImage
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Get the AppImage at the link above!"
|
||||||
8
admin/linux/clean_tarball.sh
Executable file
8
admin/linux/clean_tarball.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
rm -vrf admin/
|
||||||
|
rm -vrf src/3rdparty/sqlite3 # FIXME: For CentOS6 we have to use our bundled sqlite
|
||||||
|
rm -vrf binary/
|
||||||
|
rm -vrf src/3rdparty/libcrashreporter-qt
|
||||||
|
rm -vrf shell_integration/windows
|
||||||
|
rm -vrf shell_integration/MacOSX
|
||||||
31
admin/linux/debian/README
Normal file
31
admin/linux/debian/README
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
- .pbuilderrc:
|
||||||
|
|
||||||
|
COMPONENTS="main restricted universe multiverse"
|
||||||
|
|
||||||
|
OTHERMIRROR="deb [trusted=yes] file:///${HOME}/pbuilder/deps ./"
|
||||||
|
HOOKDIR="${HOME}/pbuilder/hook.d"
|
||||||
|
BINDMOUNTS="${HOME}/pbuilder/deps"
|
||||||
|
|
||||||
|
EXTRAPACKAGES="apt-utils"
|
||||||
|
|
||||||
|
- pbuilder/hook.d/D70setupdeps: hook to create a Packages file for the
|
||||||
|
packages in pbuilder/deps
|
||||||
|
|
||||||
|
- pbuilder-dist trusty create --override-config --othermirror "deb [trusted=yes] file:///${HOME}/pbuilder/deps ./"
|
||||||
|
|
||||||
|
The OTHERMIRROR setting in .pbuilderrc is overridden by pbuilder-dist!
|
||||||
|
|
||||||
|
- scripts:
|
||||||
|
|
||||||
|
config.sh: basic configuration variables
|
||||||
|
|
||||||
|
create_debdir.sh <tag> <version> <distribution>:
|
||||||
|
create the Debian-conformant source directory and .orig.tar.bz2
|
||||||
|
in the build area
|
||||||
|
build.sh <tag> <version> <distribution> <debuild options...>:
|
||||||
|
call create_debdir.sh and then debuild
|
||||||
|
pbuilder.sh <distribution>:
|
||||||
|
build the existing source package with pbuilder-dist.
|
||||||
|
pbuild.sh <distribution>:
|
||||||
|
build the source packages with build.sh and then call
|
||||||
|
pbuilder.sh
|
||||||
23
admin/linux/debian/debian.artful/changelog
Normal file
23
admin/linux/debian/debian.artful/changelog
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
nextcloud-client (2.3.3-1.0~artful1) artful; urgency=medium
|
||||||
|
|
||||||
|
* Debian build support for the forked client.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Mon, 6 Nov 2017 20:20:04 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.1-1.0~artful1) artful; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 23 Mar 2017 19:07:36 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.0-1.0~artful1) artful; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 21 Mar 2017 19:34:13 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.4~artful1) artful; urgency=medium
|
||||||
|
|
||||||
|
* The locale-specific icon names are correct too
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 7 Feb 2017 19:55:40 +0100
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
usr/lib/*/libnextclouddolphinpluginhelper.so
|
||||||
|
usr/lib/*/qt5/plugins/kf5/overlayicon/nextclouddolphinoverlayplugin.so
|
||||||
|
usr/lib/*/qt5/plugins/nextclouddolphinactionplugin.so
|
||||||
|
usr/share/kservices5/nextclouddolphinactionplugin.desktop
|
||||||
48
admin/linux/debian/debian.stable/changelog
Normal file
48
admin/linux/debian/debian.stable/changelog
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
nextcloud-client (2.3.3-1.0~stable1) stable; urgency=medium
|
||||||
|
|
||||||
|
* Debian build support for the forked client.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Mon, 6 Nov 2017 20:20:04 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.1-1.0) stable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 23 Mar 2017 19:07:36 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.0-1.0) stable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 21 Mar 2017 19:34:13 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.4) stable; urgency=medium
|
||||||
|
|
||||||
|
* The locale-specific icon names are correct too
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 7 Feb 2017 19:55:40 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.3) stable; urgency=medium
|
||||||
|
|
||||||
|
* Caja syncstate plugin is built.
|
||||||
|
* The syncstate plugin has application-specific name
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Fri, 27 Jan 2017 19:34:18 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.2) stable; urgency=medium
|
||||||
|
|
||||||
|
* Fixed appname in the Nemo syncstate extension.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 19 Jan 2017 16:46:50 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.1) stable; urgency=medium
|
||||||
|
|
||||||
|
* Added Nautilus and Nemo syncstate extensions.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 17 Jan 2017 19:55:32 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.0) stable; urgency=medium
|
||||||
|
|
||||||
|
* Initial release.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Wed, 14 Dec 2016 20:07:46 +0100
|
||||||
80
admin/linux/debian/debian.stable/control
Normal file
80
admin/linux/debian/debian.stable/control
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
Source: nextcloud-client
|
||||||
|
Section: contrib/devel
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: István Váradi <ivaradi@varadiistvan.hu>
|
||||||
|
Build-Depends: cmake,
|
||||||
|
debhelper,
|
||||||
|
cdbs,
|
||||||
|
dh-python,
|
||||||
|
extra-cmake-modules (>= 5.16),
|
||||||
|
kdelibs5-dev,
|
||||||
|
kio-dev,
|
||||||
|
libcmocka-dev,
|
||||||
|
libhttp-dav-perl,
|
||||||
|
libinotify-dev [kfreebsd-any],
|
||||||
|
libqt5webkit5-dev,
|
||||||
|
libsqlite3-dev,
|
||||||
|
libssl-dev (>> 1.0.0),
|
||||||
|
zlib1g-dev,
|
||||||
|
optipng,
|
||||||
|
pkg-kde-tools,
|
||||||
|
python-sphinx | python3-sphinx,
|
||||||
|
python3-all,
|
||||||
|
qt5keychain-dev,
|
||||||
|
qtdeclarative5-dev,
|
||||||
|
qttools5-dev,
|
||||||
|
qttools5-dev-tools,
|
||||||
|
xvfb
|
||||||
|
Standards-Version: 3.9.8
|
||||||
|
Homepage: https://github.com/nextcloud/client_theming
|
||||||
|
#Vcs-Git: git://anonscm.debian.org/collab-maint/nextcloud-client.git
|
||||||
|
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/nextcloud-client.git
|
||||||
|
|
||||||
|
Package: nextcloud-client
|
||||||
|
Architecture: any
|
||||||
|
Depends: libnextcloudsync0 (=${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, nextcloud-client-l10n
|
||||||
|
Description: Nextcloud desktop sync client
|
||||||
|
Use the desktop client to keep your files synchronized
|
||||||
|
between your Nextcloud server and your desktop. Select
|
||||||
|
one or more directories on your local machine and always
|
||||||
|
have access to your latest files wherever you are.
|
||||||
|
|
||||||
|
Package: libnextcloudsync0
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Description: Nextcloud sync library
|
||||||
|
Used by the Nextcloud desktop client as the synchronization engine.
|
||||||
|
|
||||||
|
Package: libnextcloudsync-dev
|
||||||
|
Architecture: any
|
||||||
|
Section: contrib/libdevel
|
||||||
|
Depends: libnextcloudsync0 (=${binary:Version}), ${misc:Depends}
|
||||||
|
Description: Nextcloud sync library development files
|
||||||
|
The headers and development library for the Nextcloud sync library.
|
||||||
|
|
||||||
|
Package: nextcloud-client-l10n
|
||||||
|
Architecture: all
|
||||||
|
Depends: ${misc:Depends}
|
||||||
|
Description: Nextcloud client internatialization files
|
||||||
|
The translation files.
|
||||||
|
|
||||||
|
Package: nextcloud-client-nautilus
|
||||||
|
Architecture: all
|
||||||
|
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python-nautilus, nautilus, ${misc:Depends}
|
||||||
|
Description: Nautilus plugin for Nextcloud
|
||||||
|
This package contains a Nautilus plugin to display
|
||||||
|
synchronization status icons for Nextcloud files.
|
||||||
|
|
||||||
|
Package: nextcloud-client-nemo
|
||||||
|
Architecture: all
|
||||||
|
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python-nemo, nemo, ${misc:Depends}
|
||||||
|
Description: Nemo plugin for Nextcloud
|
||||||
|
This package contains a Nemo plugin to display
|
||||||
|
synchronization status icons for Nextcloud files.
|
||||||
|
|
||||||
|
Package: nextcloud-client-caja
|
||||||
|
Architecture: all
|
||||||
|
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python-caja, caja, ${misc:Depends}
|
||||||
|
Description: Caja plugin for Nextcloud
|
||||||
|
This package contains a Caja plugin to display
|
||||||
|
synchronization status icons for Nextcloud files.
|
||||||
48
admin/linux/debian/debian.yakkety/changelog
Normal file
48
admin/linux/debian/debian.yakkety/changelog
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
nextcloud-client (2.3.3-1.0~yakkety1) yakkety; urgency=medium
|
||||||
|
|
||||||
|
* Debian build support for the forked client.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Mon, 6 Nov 2017 20:20:04 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.1-1.0~yakkety1) yakkety; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 23 Mar 2017 19:07:36 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.0-1.0~yakkety1) yakkety; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 21 Mar 2017 19:34:13 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.4~yakkety1) yakkety; urgency=medium
|
||||||
|
|
||||||
|
* The locale-specific icon names are correct too
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 7 Feb 2017 19:55:40 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.3~yakkety1) yakkety; urgency=medium
|
||||||
|
|
||||||
|
* Caja syncstate plugin is built.
|
||||||
|
* The syncstate plugin has application-specific name
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Fri, 27 Jan 2017 19:34:18 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.2~yakkety1) yakkety; urgency=medium
|
||||||
|
|
||||||
|
* Fixed appname in the Nemo syncstate extension.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 19 Jan 2017 16:46:50 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.1~yakkety1) yakkety; urgency=medium
|
||||||
|
|
||||||
|
* Added Nautilus and Nemo syncstate extensions.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 17 Jan 2017 19:55:32 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.0~yakkety1) yakkety; urgency=medium
|
||||||
|
|
||||||
|
* Initial release.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Wed, 14 Dec 2016 20:07:46 +0100
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
usr/lib/*/libnextclouddolphinpluginhelper.so
|
||||||
|
usr/lib/*/qt5/plugins/kf5/overlayicon/nextclouddolphinoverlayplugin.so
|
||||||
|
usr/lib/*/qt5/plugins/nextclouddolphinactionplugin.so
|
||||||
|
usr/share/kservices5/nextclouddolphinactionplugin.desktop
|
||||||
23
admin/linux/debian/debian.zesty/changelog
Normal file
23
admin/linux/debian/debian.zesty/changelog
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
nextcloud-client (2.3.3-1.0~zesty1) zesty; urgency=medium
|
||||||
|
|
||||||
|
* Debian build support for the forked client.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Mon, 6 Nov 2017 20:20:04 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.1-1.0~zesty1) zesty; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 23 Mar 2017 19:07:36 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.0-1.0~zesty1) zesty; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 21 Mar 2017 19:34:13 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.4~zesty1) zesty; urgency=medium
|
||||||
|
|
||||||
|
* The locale-specific icon names are correct too
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 7 Feb 2017 19:55:40 +0100
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
usr/lib/*/libnextclouddolphinpluginhelper.so
|
||||||
|
usr/lib/*/qt5/plugins/kf5/overlayicon/nextclouddolphinoverlayplugin.so
|
||||||
|
usr/lib/*/qt5/plugins/nextclouddolphinactionplugin.so
|
||||||
|
usr/share/kservices5/nextclouddolphinactionplugin.desktop
|
||||||
1
admin/linux/debian/debian/101-sync-inotify.conf
Normal file
1
admin/linux/debian/debian/101-sync-inotify.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
fs.inotify.max_user_watches = 524288
|
||||||
48
admin/linux/debian/debian/changelog
Normal file
48
admin/linux/debian/debian/changelog
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
nextcloud-client (2.3.3-1.0~xenial1) xenial; urgency=medium
|
||||||
|
|
||||||
|
* Debian build support for the forked client.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Mon, 6 Nov 2017 20:20:04 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.1-1.0~xenial1) xenial; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 23 Mar 2017 19:07:36 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.3.0-1.0~xenial1) xenial; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 21 Mar 2017 19:34:13 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.4~xenial1) xenial; urgency=medium
|
||||||
|
|
||||||
|
* The locale-specific icon names are correct too
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 7 Feb 2017 19:55:40 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.3~xenial1) xenial; urgency=medium
|
||||||
|
|
||||||
|
* Caja syncstate plugin is built.
|
||||||
|
* The syncstate plugin has application-specific name
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Fri, 27 Jan 2017 19:34:18 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.2~xenial1) xenial; urgency=medium
|
||||||
|
|
||||||
|
* Fixed appname in the Nemo syncstate extension.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Thu, 19 Jan 2017 16:46:50 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.1~xenial1) xenial; urgency=medium
|
||||||
|
|
||||||
|
* Added Nautilus and Nemo syncstate extensions.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Tue, 17 Jan 2017 19:55:32 +0100
|
||||||
|
|
||||||
|
nextcloud-client (2.2.4-1.0~xenial1) xenial; urgency=medium
|
||||||
|
|
||||||
|
* Initial release.
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> Wed, 14 Dec 2016 20:07:46 +0100
|
||||||
1
admin/linux/debian/debian/compat
Normal file
1
admin/linux/debian/debian/compat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
9
|
||||||
87
admin/linux/debian/debian/control
Normal file
87
admin/linux/debian/debian/control
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
Source: nextcloud-client
|
||||||
|
Section: contrib/devel
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: István Váradi <ivaradi@varadiistvan.hu>
|
||||||
|
Build-Depends: cmake,
|
||||||
|
debhelper,
|
||||||
|
cdbs,
|
||||||
|
dh-python,
|
||||||
|
extra-cmake-modules (>= 5.16),
|
||||||
|
kdelibs5-dev,
|
||||||
|
kio-dev,
|
||||||
|
libcmocka-dev,
|
||||||
|
libhttp-dav-perl,
|
||||||
|
libinotify-dev [kfreebsd-any],
|
||||||
|
libqt5webkit5-dev,
|
||||||
|
libsqlite3-dev,
|
||||||
|
libssl-dev (>> 1.0.0),
|
||||||
|
zlib1g-dev,
|
||||||
|
optipng,
|
||||||
|
pkg-kde-tools,
|
||||||
|
python-sphinx | python3-sphinx,
|
||||||
|
python3-all,
|
||||||
|
qt5keychain-dev,
|
||||||
|
qtdeclarative5-dev,
|
||||||
|
qttools5-dev,
|
||||||
|
qttools5-dev-tools,
|
||||||
|
xvfb
|
||||||
|
Standards-Version: 3.9.8
|
||||||
|
Homepage: https://github.com/nextcloud/client_theming
|
||||||
|
#Vcs-Git: git://anonscm.debian.org/collab-maint/nextcloud-client.git
|
||||||
|
#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/nextcloud-client.git
|
||||||
|
|
||||||
|
Package: nextcloud-client
|
||||||
|
Architecture: any
|
||||||
|
Depends: libnextcloudsync0 (=${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, nextcloud-client-l10n
|
||||||
|
Description: Nextcloud desktop sync client
|
||||||
|
Use the desktop client to keep your files synchronized
|
||||||
|
between your Nextcloud server and your desktop. Select
|
||||||
|
one or more directories on your local machine and always
|
||||||
|
have access to your latest files wherever you are.
|
||||||
|
|
||||||
|
Package: libnextcloudsync0
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Description: Nextcloud sync library
|
||||||
|
Used by the Nextcloud desktop client as the synchronization engine.
|
||||||
|
|
||||||
|
Package: libnextcloudsync-dev
|
||||||
|
Architecture: any
|
||||||
|
Section: contrib/libdevel
|
||||||
|
Depends: libnextcloudsync0 (=${binary:Version}), ${misc:Depends}
|
||||||
|
Description: Nextcloud sync library development files
|
||||||
|
The headers and development library for the Nextcloud sync library.
|
||||||
|
|
||||||
|
Package: nextcloud-client-l10n
|
||||||
|
Architecture: all
|
||||||
|
Depends: ${misc:Depends}
|
||||||
|
Description: Nextcloud client internatialization files
|
||||||
|
The translation files.
|
||||||
|
|
||||||
|
Package: nextcloud-client-nautilus
|
||||||
|
Architecture: all
|
||||||
|
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python-nautilus, nautilus, ${misc:Depends}
|
||||||
|
Description: Nautilus plugin for Nextcloud
|
||||||
|
This package contains a Nautilus plugin to display
|
||||||
|
synchronization status icons for Nextcloud files.
|
||||||
|
|
||||||
|
Package: nextcloud-client-nemo
|
||||||
|
Architecture: all
|
||||||
|
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python-nemo | nemo-python, nemo, ${misc:Depends}
|
||||||
|
Description: Nemo plugin for Nextcloud
|
||||||
|
This package contains a Nemo plugin to display
|
||||||
|
synchronization status icons for Nextcloud files.
|
||||||
|
|
||||||
|
Package: nextcloud-client-caja
|
||||||
|
Architecture: all
|
||||||
|
Depends: nextcloud-client (>=${binary:Version}), libnextcloudsync0, python-caja, caja, ${misc:Depends}
|
||||||
|
Description: Caja plugin for Nextcloud
|
||||||
|
This package contains a Caja plugin to display
|
||||||
|
synchronization status icons for Nextcloud files.
|
||||||
|
|
||||||
|
Package: nextcloud-client-dolphin
|
||||||
|
Architecture: any
|
||||||
|
Depends: dolphin (>= 4:15.12.1), libnextcloudsync0 (= ${binary:Version}), nextcloud-client, ${misc:Depends}, ${shlibs:Depends}
|
||||||
|
Description: Dolphin plugin for Nextcloud
|
||||||
|
This package contains a Dolphin plugin to display
|
||||||
|
synchronization status icons for Nextcloud files.
|
||||||
3
admin/linux/debian/debian/copyright
Normal file
3
admin/linux/debian/debian/copyright
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Files: *
|
||||||
|
Copyright: 2012-2015 ownCloud, inc.; Nuernberg, Germany., 2016 Nextcloud GmbH
|
||||||
|
License: GPL-2+
|
||||||
3
admin/linux/debian/debian/libnextcloudsync-dev.install
Normal file
3
admin/linux/debian/debian/libnextcloudsync-dev.install
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
usr/include
|
||||||
|
usr/lib/*/libnextcloudsync.so
|
||||||
|
usr/lib/*/nextcloud/libocsync.so
|
||||||
3
admin/linux/debian/debian/libnextcloudsync0.install
Normal file
3
admin/linux/debian/debian/libnextcloudsync0.install
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
etc
|
||||||
|
usr/lib/*/libnextcloudsync.so.?*
|
||||||
|
usr/lib/*/nextcloud/libocsync.so.?*
|
||||||
1
admin/linux/debian/debian/nextcloud-client-caja.install
Normal file
1
admin/linux/debian/debian/nextcloud-client-caja.install
Normal file
@@ -0,0 +1 @@
|
|||||||
|
usr/share/caja-python
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
usr/lib/*/libnextclouddolphinpluginhelper.so
|
||||||
|
usr/lib/*/plugins/kf5/overlayicon/nextclouddolphinoverlayplugin.so
|
||||||
|
usr/lib/*/plugins/nextclouddolphinactionplugin.so
|
||||||
|
usr/share/kservices5/nextclouddolphinactionplugin.desktop
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
nextcloud-client-dolphin: package-name-doesnt-match-sonames
|
||||||
|
nextcloud-client-dolphin: shlib-without-versioned-soname
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
activate-noawait ldconfig
|
||||||
1
admin/linux/debian/debian/nextcloud-client-l10n.install
Normal file
1
admin/linux/debian/debian/nextcloud-client-l10n.install
Normal file
@@ -0,0 +1 @@
|
|||||||
|
usr/share/nextcloud/i18n
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
usr/share/nautilus-python
|
||||||
1
admin/linux/debian/debian/nextcloud-client-nemo.install
Normal file
1
admin/linux/debian/debian/nextcloud-client-nemo.install
Normal file
@@ -0,0 +1 @@
|
|||||||
|
usr/share/nemo-python
|
||||||
4
admin/linux/debian/debian/nextcloud-client.install
Normal file
4
admin/linux/debian/debian/nextcloud-client.install
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
usr/bin
|
||||||
|
usr/share/applications
|
||||||
|
usr/share/icons
|
||||||
|
debian/101-sync-inotify.conf etc/sysctl.d
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
nextcloud-client: binary-or-shlib-defines-rpath
|
||||||
|
nextcloud-client: binary-without-manpage
|
||||||
|
nextcloud-client: license-problem-convert-utf-code
|
||||||
12
admin/linux/debian/debian/rules
Executable file
12
admin/linux/debian/debian/rules
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
# See debhelper(7) (uncomment to enable)
|
||||||
|
# output every command that modifies files on the build system.
|
||||||
|
#export DH_VERBOSE = 1
|
||||||
|
|
||||||
|
include /usr/share/cdbs/1/rules/debhelper.mk
|
||||||
|
include /usr/share/cdbs/1/class/cmake.mk
|
||||||
|
|
||||||
|
DEB_SHLIBDEPS_INCLUDE=$(CURDIR)/$(DEB_BUILDDIR)/csync/src
|
||||||
|
|
||||||
|
DEB_SRCDIR=.
|
||||||
|
DEB_CMAKE_EXTRA_FLAGS = -DCMAKE_SKIP_RPATH=OFF -DCMAKE_SKIP_BUILD_RPATH=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
|
||||||
1
admin/linux/debian/debian/source/format
Normal file
1
admin/linux/debian/debian/source/format
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.0 (quilt)
|
||||||
9
admin/linux/debian/debian/source/lintian-overrides
Normal file
9
admin/linux/debian/debian/source/lintian-overrides
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
nextcloud-client source: source-is-missing client/doc/ocdoc/_shared_assets/themes/bootstrap/static/bootstrap.js line length is 22206 characters (>512)
|
||||||
|
nextcloud-client source: source-is-missing client/doc/ocdoc/_shared_assets/themes/bootstrap/static/jquery.js
|
||||||
|
nextcloud-client source: source-is-missing client/doc/ocdoc/_shared_assets/themes/bootstrap/static/jquery.js line length is 32412 characters (>512)
|
||||||
|
nextcloud-client source: source-is-missing client/doc/ocdoc/_shared_assets/themes/owncloud_com/static/bootstrap.js line length is 22206 characters (>512)
|
||||||
|
nextcloud-client source: source-is-missing client/doc/ocdoc/_shared_assets/themes/owncloud_com/static/jquery.js line length is 32412 characters (>512)
|
||||||
|
nextcloud-client source: source-is-missing client/doc/ocdoc/_shared_assets/themes/owncloud_release/static/bootstrap.js line length is 22206 characters (>512)
|
||||||
|
nextcloud-client source: source-is-missing client/doc/ocdoc/_shared_assets/themes/owncloud_release/static/jquery.js line length is 32412 characters (>512)
|
||||||
|
nextcloud-client source: source-is-missing client/doc/ocdoc/_shared_assets/themes/owncloud_org/static/js/jquery-1.11.0.min.js
|
||||||
|
nextcloud-client source: license-problem-convert-utf-code
|
||||||
BIN
admin/linux/debian/oscrc.enc
Normal file
BIN
admin/linux/debian/oscrc.enc
Normal file
Binary file not shown.
50
admin/linux/debian/scripts/addchange.sh
Executable file
50
admin/linux/debian/scripts/addchange.sh
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
scriptdir=`dirname $0`
|
||||||
|
|
||||||
|
DEFAULT_DIST=yakkety
|
||||||
|
|
||||||
|
package="nextcloud-client"
|
||||||
|
version="$1"
|
||||||
|
comment="$2"
|
||||||
|
distver="${3:-}"
|
||||||
|
|
||||||
|
if test -z "${distver}"; then
|
||||||
|
distver="1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
packagedir="${scriptdir}/../${package}"
|
||||||
|
|
||||||
|
now=`date -R`
|
||||||
|
|
||||||
|
tmpfile="/tmp/addchange.$$"
|
||||||
|
|
||||||
|
for subdir in "${packagedir}/debian"*; do
|
||||||
|
if test -f "${subdir}/changelog"; then
|
||||||
|
echo "${subdir}"
|
||||||
|
bname=`basename "${subdir}"`
|
||||||
|
dist=`echo "${bname}" | sed 's:debian\.\?::'`
|
||||||
|
if test -z "${dist}"; then
|
||||||
|
dist="${DEFAULT_DIST}"
|
||||||
|
fi
|
||||||
|
if test "${dist}" = "stable"; then
|
||||||
|
versuffix=""
|
||||||
|
else
|
||||||
|
versuffix="~${dist}${distver}"
|
||||||
|
fi
|
||||||
|
cat > "${tmpfile}" <<EOF
|
||||||
|
${package} (${version}${versuffix}) ${dist}; urgency=medium
|
||||||
|
|
||||||
|
* ${comment}
|
||||||
|
|
||||||
|
-- István Váradi <ivaradi@varadiistvan.hu> ${now}
|
||||||
|
|
||||||
|
EOF
|
||||||
|
cat "${subdir}/changelog" >> "${tmpfile}"
|
||||||
|
mv "${tmpfile}" "${subdir}/changelog"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -f "${tmpfile}"
|
||||||
26
admin/linux/debian/scripts/config.sh
Normal file
26
admin/linux/debian/scripts/config.sh
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# The directory where the sources are found
|
||||||
|
SOURCES="${HOME}/sources/nextcloud/client"
|
||||||
|
|
||||||
|
# The directory into which the packages should be genereated
|
||||||
|
BUILDAREA="${SOURCES}/build-area"
|
||||||
|
|
||||||
|
# The directory containing the Git repositories
|
||||||
|
GITROOTS="${SOURCES}/git"
|
||||||
|
|
||||||
|
# The pbuilder root directory
|
||||||
|
PBUILDER_ROOT="${HOME}/pbuilder"
|
||||||
|
|
||||||
|
# The dependencies directory for pbuilder
|
||||||
|
PBUILDER_DEPS="${PBUILDER_ROOT}/deps"
|
||||||
|
|
||||||
|
# The version of the nextcloud-client package
|
||||||
|
NEXTCLOUD_CLIENT_VERSION=2.4.0
|
||||||
|
|
||||||
|
# The FULL version of the nextcloud-client package
|
||||||
|
NEXTCLOUD_CLIENT_FULL_VERSION="${NEXTCLOUD_CLIENT_VERSION}-1.0~@DISTRIBUTION@1"
|
||||||
|
|
||||||
|
# The tag of the nextcloud-client package
|
||||||
|
NEXTCLOUD_CLIENT_TAG="v${NEXTCLOUD_CLIENT_VERSION}"
|
||||||
|
|
||||||
|
# The number of CPUs that can be used for paralel builds
|
||||||
|
NUMCPUS=4
|
||||||
80
admin/linux/debian/scripts/create_debdir.sh
Executable file
80
admin/linux/debian/scripts/create_debdir.sh
Executable file
@@ -0,0 +1,80 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
scriptdir=`dirname $0`
|
||||||
|
scriptdir=`cd "${scriptdir}" && pwd`
|
||||||
|
|
||||||
|
. "${scriptdir}/config.sh"
|
||||||
|
|
||||||
|
package="nextcloud-client"
|
||||||
|
tag="${1}"
|
||||||
|
version="${2}"
|
||||||
|
distribution="${3}"
|
||||||
|
|
||||||
|
gitdir="${GITROOTS}/client"
|
||||||
|
packagedir="${BUILDAREA}/${package}_${version}"
|
||||||
|
origtarname="${package}_${version}.orig.tar.bz2"
|
||||||
|
origtar="${BUILDAREA}/${origtarname}"
|
||||||
|
|
||||||
|
archive_submodules()
|
||||||
|
{
|
||||||
|
local subdir="${1}"
|
||||||
|
local treeish="${2}"
|
||||||
|
|
||||||
|
local dir="${gitdir}"
|
||||||
|
local destdir="${packagedir}"
|
||||||
|
if test "${subdir}"; then
|
||||||
|
echo " copying submodule ${subdir}"
|
||||||
|
dir="${dir}/${subdir}"
|
||||||
|
destdir="${destdir}/${subdir}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "${destdir}"
|
||||||
|
|
||||||
|
(cd "${dir}"; git archive "${treeish}" | tar xf - -C "${destdir}")
|
||||||
|
|
||||||
|
(cd "${dir}"; git ls-tree "${treeish}" -r) | while read mode type object file; do
|
||||||
|
if test "${type}" = "commit"; then
|
||||||
|
sdir="${file}"
|
||||||
|
if test "${subdir}"; then
|
||||||
|
sdir="${subdir}/${sdir}"
|
||||||
|
fi
|
||||||
|
archive_submodules "${sdir}" "${object}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
rm -rf "${packagedir}"
|
||||||
|
mkdir -p "${packagedir}"
|
||||||
|
|
||||||
|
echo "Updating submodules"
|
||||||
|
commit=`cd "${gitdir}"; git rev-parse HEAD`
|
||||||
|
(cd "${gitdir}"; git checkout "${tag}"; git submodule update --recursive --init)
|
||||||
|
|
||||||
|
echo "Copying sources"
|
||||||
|
archive_submodules "" "${tag}"
|
||||||
|
|
||||||
|
if test -f "${GITROOTS}/${origtarname}"; then
|
||||||
|
echo "Copying orig archive from ${GITROOTS}"
|
||||||
|
cp -a "${GITROOTS}/${origtarname}" "${BUILDAREA}"
|
||||||
|
else
|
||||||
|
echo "Creating orig archive"
|
||||||
|
tar cjf "${origtar}" -C "${BUILDAREA}" "${package}_${version}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Restoring Git state"
|
||||||
|
(cd "${gitdir}"; git checkout "${commit}")
|
||||||
|
cd "${scriptdir}"
|
||||||
|
|
||||||
|
echo "Copying Debian files"
|
||||||
|
mkdir -p "${packagedir}/debian"
|
||||||
|
tar cf - -C "${scriptdir}/../debian" . | tar xf - -C "${packagedir}/debian"
|
||||||
|
|
||||||
|
if test -d "${scriptdir}/../debian.${distribution}"; then
|
||||||
|
tar cf - -C "${scriptdir}/../debian.${distribution}" . | tar xf - -C "${packagedir}/debian"
|
||||||
|
fi
|
||||||
|
|
||||||
|
"${scriptdir}/git2changelog.py" /tmp/git2changelog "${distribution}"
|
||||||
|
mv "${packagedir}/debian/changelog" "${packagedir}/debian/changelog.old"
|
||||||
|
cat /tmp/git2changelog "${packagedir}/debian/changelog.old" > "${packagedir}/debian/changelog"
|
||||||
8
admin/linux/debian/scripts/git2changelog.cfg
Normal file
8
admin/linux/debian/scripts/git2changelog.cfg
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Use the configuration below with appropriate changes,
|
||||||
|
# if you want to support a new client version using
|
||||||
|
# your own fork. In such a case the tags do not come
|
||||||
|
# accross to the main repo for a pull request, so
|
||||||
|
# some hacking is needed
|
||||||
|
[versionhack]
|
||||||
|
#commit = 30986d6
|
||||||
|
#tag = v2.3.3-beta
|
||||||
106
admin/linux/debian/scripts/git2changelog.py
Executable file
106
admin/linux/debian/scripts/git2changelog.py
Executable file
@@ -0,0 +1,106 @@
|
|||||||
|
#!//usr/bin/env python2.7
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import datetime
|
||||||
|
import os
|
||||||
|
import ConfigParser
|
||||||
|
|
||||||
|
distribution="yakkety"
|
||||||
|
|
||||||
|
versionTagRE = re.compile("^v([0-9]+((\.[0-9]+)+))(-(.+))?$")
|
||||||
|
|
||||||
|
def processVersionTag(tag):
|
||||||
|
m = versionTagRE.match(tag)
|
||||||
|
if m:
|
||||||
|
return (m.group(1), "release" if m.group(4) is None else "beta")
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
def collectEntries(baseCommit, baseVersion, kind):
|
||||||
|
scriptdir = os.path.dirname(__file__)
|
||||||
|
configPath = os.path.join(scriptdir, "git2changelog.cfg")
|
||||||
|
|
||||||
|
newVersionCommit = None
|
||||||
|
newVersionTag = None
|
||||||
|
newVersionOrigTag = None
|
||||||
|
|
||||||
|
if os.path.exists(configPath):
|
||||||
|
config = ConfigParser.SafeConfigParser()
|
||||||
|
config.read(configPath)
|
||||||
|
if config.has_section("versionhack"):
|
||||||
|
if config.has_option("versionhack", "commit") and \
|
||||||
|
config.has_option("versionhack", "tag"):
|
||||||
|
newVersionCommit = config.get("versionhack", "commit")
|
||||||
|
newVersionTag = config.get("versionhack", "tag")
|
||||||
|
|
||||||
|
entries = []
|
||||||
|
|
||||||
|
args = ["git", "log",
|
||||||
|
"--format=%h%x09%an%x09%ae%x09%aD%x09%ad%x09%s",
|
||||||
|
"--date=unix", "--author-date-order", "--reverse"]
|
||||||
|
try:
|
||||||
|
output = subprocess.check_output(args + [baseCommit + ".."])
|
||||||
|
except:
|
||||||
|
output = subprocess.check_output(args)
|
||||||
|
|
||||||
|
|
||||||
|
lastVersionTag = None
|
||||||
|
for line in output.splitlines():
|
||||||
|
(commit, name, email, date, revdate, subject) = line.split("\t")
|
||||||
|
revdate = datetime.datetime.utcfromtimestamp(long(revdate)).strftime("%Y%m%d.%H%M%S")
|
||||||
|
|
||||||
|
if commit==newVersionCommit:
|
||||||
|
result = processVersionTag(newVersionTag)
|
||||||
|
if result:
|
||||||
|
newVersionOrigTag = lastVersionTag
|
||||||
|
(baseVersion, kind) = result
|
||||||
|
|
||||||
|
for tag in subprocess.check_output(["git", "tag",
|
||||||
|
"--points-at",
|
||||||
|
commit]).splitlines():
|
||||||
|
if tag!=newVersionOrigTag:
|
||||||
|
result = processVersionTag(tag)
|
||||||
|
if result:
|
||||||
|
lastVersionTag = tag
|
||||||
|
(baseVersion, kind) = result
|
||||||
|
|
||||||
|
entries.append((commit, name, email, date, revdate, subject,
|
||||||
|
baseVersion, kind))
|
||||||
|
|
||||||
|
entries.reverse()
|
||||||
|
|
||||||
|
return entries
|
||||||
|
|
||||||
|
def genChangeLogEntries(f, entries, distribution):
|
||||||
|
latestBaseVersion = None
|
||||||
|
latestKind = None
|
||||||
|
for (commit, name, email, date, revdate, subject, baseVersion, kind) in entries:
|
||||||
|
if latestBaseVersion is None:
|
||||||
|
latestBaseVersion = baseVersion
|
||||||
|
latestKind = kind
|
||||||
|
upstreamVersion = baseVersion + "-" + revdate
|
||||||
|
if distribution=="stable":
|
||||||
|
version = upstreamVersion
|
||||||
|
else:
|
||||||
|
version = upstreamVersion + "~" + distribution + "1"
|
||||||
|
print >> f, "nextcloud-client (%s) %s; urgency=medium" % (version, distribution)
|
||||||
|
print >> f
|
||||||
|
print >> f, " * " + subject
|
||||||
|
print >> f
|
||||||
|
print >> f, " -- %s <%s> %s" % (name, email, date)
|
||||||
|
print >> f
|
||||||
|
return (latestBaseVersion, latestKind)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
distribution = sys.argv[2]
|
||||||
|
|
||||||
|
#entries = collectEntries("8aade24147b5313f8241a8b42331442b7f40eef9", "2.2.4", "release")
|
||||||
|
entries = collectEntries("f9b1c724d6ab5431e0cd56b7cd834f2dd48cebb1", "2.4.0", "release")
|
||||||
|
|
||||||
|
|
||||||
|
with open(sys.argv[1], "wt") as f:
|
||||||
|
(baseVersion, kind) = genChangeLogEntries(f, entries, distribution)
|
||||||
|
print baseVersion, kind
|
||||||
17
admin/linux/debian/scripts/pbuild.sh
Executable file
17
admin/linux/debian/scripts/pbuild.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
scriptdir=`dirname $0`
|
||||||
|
scriptdir=`cd "${scriptdir}" && pwd`
|
||||||
|
|
||||||
|
. "${scriptdir}/config.sh"
|
||||||
|
|
||||||
|
distribution="${1}"
|
||||||
|
shift
|
||||||
|
|
||||||
|
pushd /
|
||||||
|
"${scriptdir}/build.sh" "${distribution}" -S "$@"
|
||||||
|
|
||||||
|
"${scriptdir}/pbuilder.sh" "${distribution}" "$@"
|
||||||
|
popd
|
||||||
21
admin/linux/debian/scripts/pbuilder.sh
Executable file
21
admin/linux/debian/scripts/pbuilder.sh
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
scriptdir=`dirname $0`
|
||||||
|
|
||||||
|
. "${scriptdir}/config.sh"
|
||||||
|
|
||||||
|
distribution="${1}"
|
||||||
|
shift
|
||||||
|
|
||||||
|
resultdir="${PBUILDER_ROOT}/${distribution}_result"
|
||||||
|
|
||||||
|
rm -f "${PBUILDER_DEPS}/"*.deb
|
||||||
|
echo -n > "${PBUILDER_DEPS}/Packages"
|
||||||
|
rm -f "${resultdir}/"*
|
||||||
|
|
||||||
|
source "${HOME}/.pbuilderrc"
|
||||||
|
|
||||||
|
dscversion=`echo ${NEXTCLOUD_CLIENT_FULL_VERSION} | sed "s:@DISTRIBUTION@:${distribution}:g"`
|
||||||
|
pbuilder-dist "${distribution}" build --othermirror "${OTHERMIRROR}" --debbuildopts "-j${NUMCPUS}" "$@" "${BUILDAREA}/nextcloud-client_${dscversion}.dsc"
|
||||||
BIN
admin/linux/debian/signing-key.txt.enc
Normal file
BIN
admin/linux/debian/signing-key.txt.enc
Normal file
Binary file not shown.
143
admin/linux/debian/travis-build.sh
Executable file
143
admin/linux/debian/travis-build.sh
Executable file
@@ -0,0 +1,143 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
shopt -s extglob
|
||||||
|
|
||||||
|
TRAVIS_BUILD_STEP="$1"
|
||||||
|
|
||||||
|
PPA=ppa:nextcloud-devs/client-alpha
|
||||||
|
PPA_BETA=ppa:nextcloud-devs/client-beta
|
||||||
|
|
||||||
|
OBS_PROJECT=home:ivaradi:alpha
|
||||||
|
OBS_PROJECT_BETA=home:ivaradi:beta
|
||||||
|
OBS_PACKAGE=nextcloud-client
|
||||||
|
|
||||||
|
if [ "$TRAVIS_BUILD_STEP" == "install" ]; then
|
||||||
|
sudo apt-get update -q
|
||||||
|
sudo apt-get install -y devscripts cdbs osc
|
||||||
|
|
||||||
|
if test "$encrypted_585e03da75ed_key" -a "$encrypted_585e03da75ed_iv"; then
|
||||||
|
openssl aes-256-cbc -K $encrypted_585e03da75ed_key -iv $encrypted_585e03da75ed_iv -in admin/linux/debian/signing-key.txt.enc -d | gpg --import
|
||||||
|
echo "DEBUILD_DPKG_BUILDPACKAGE_OPTS='-k7D14AA7B'" >> ~/.devscripts
|
||||||
|
|
||||||
|
openssl aes-256-cbc -K $encrypted_585e03da75ed_key -iv $encrypted_585e03da75ed_iv -in admin/linux/debian/oscrc.enc -out ~/.oscrc -d
|
||||||
|
|
||||||
|
touch ~/.has_ppa_keys
|
||||||
|
elif test "$encrypted_8da7a4416c7a_key" -a "$encrypted_8da7a4416c7a_iv"; then
|
||||||
|
openssl aes-256-cbc -K $encrypted_8da7a4416c7a_key -iv $encrypted_8da7a4416c7a_iv -in admin/linux/debian/oscrc.enc -out ~/.oscrc -d
|
||||||
|
PPA=ppa:ivaradi/nextcloud-client-exp
|
||||||
|
elif test "$encrypted_c5306c5c5331_key" -a "$encrypted_c5306c5c5331_key"; then
|
||||||
|
openssl aes-256-cbc -K $encrypted_c5306c5c5331_key -iv $encrypted_c5306c5c5331_iv -in admin/linux/debian/oscrc.enc -out ~/.oscrc -d
|
||||||
|
PPA=ppa:ivaradi/nextcloud-client-exp
|
||||||
|
elif test "$encrypted_5dafbd038603_key" -a "$encrypted_5dafbd038603_iv"; then
|
||||||
|
openssl aes-256-cbc -K $encrypted_5dafbd038603_key -iv $encrypted_5dafbd038603_iv -in admin/linux/debian/signing-key.txt.enc -d | gpg --import
|
||||||
|
echo "DEBUILD_DPKG_BUILDPACKAGE_OPTS='-k7D14AA7B'" >> ~/.devscripts
|
||||||
|
|
||||||
|
|
||||||
|
openssl aes-256-cbc -K $encrypted_5dafbd038603_key -iv $encrypted_5dafbd038603_iv -in admin/linux/debian/oscrc.enc -out ~/.oscrc -d
|
||||||
|
|
||||||
|
touch ~/.has_ppa_keys
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [ "$TRAVIS_BUILD_STEP" == "script" ]; then
|
||||||
|
read basever kind <<<$(admin/linux/debian/scripts/git2changelog.py /tmp/tmpchangelog stable)
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
echo "$kind" > kind
|
||||||
|
kind="release"
|
||||||
|
|
||||||
|
if test "$encrypted_5dafbd038603_key" -a "$encrypted_5dafbd038603_iv"; then
|
||||||
|
repo=ivaradi/nextcloud-client-exp
|
||||||
|
else
|
||||||
|
if test "$kind" = "beta"; then
|
||||||
|
repo=nextcloud-devs/client-beta
|
||||||
|
else
|
||||||
|
repo=nextcloud-devs/client-alpha
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if test -d nextcloud.client; then
|
||||||
|
gitdir="nextcloud.client"
|
||||||
|
else
|
||||||
|
gitdir="client"
|
||||||
|
fi
|
||||||
|
|
||||||
|
origsourceopt=""
|
||||||
|
|
||||||
|
if ! wget http://ppa.launchpad.net/${repo}/ubuntu/pool/main/n/nextcloud-client/nextcloud-client_${basever}.orig.tar.bz2; then
|
||||||
|
mv ${gitdir} nextcloud-client_${basever}
|
||||||
|
tar cjf nextcloud-client_${basever}.orig.tar.bz2 --exclude .git nextcloud-client_${basever}
|
||||||
|
mv nextcloud-client_${basever} ${gitdir}
|
||||||
|
origsourceopt="-sa"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for distribution in xenial zesty artful stable; do
|
||||||
|
rm -rf nextcloud-client_${basever}
|
||||||
|
cp -a ${gitdir} nextcloud-client_${basever}
|
||||||
|
|
||||||
|
cd nextcloud-client_${basever}
|
||||||
|
|
||||||
|
cp -a admin/linux/debian/debian .
|
||||||
|
if test -d admin/linux/debian/debian.${distribution}; then
|
||||||
|
tar cf - -C admin/linux/debian/debian.${distribution} . | tar xf - -C debian
|
||||||
|
fi
|
||||||
|
|
||||||
|
admin/linux/debian/scripts/git2changelog.py /tmp/tmpchangelog ${distribution}
|
||||||
|
cp /tmp/tmpchangelog debian/changelog
|
||||||
|
if test -f admin/linux/debian/debian.${distribution}/changelog; then
|
||||||
|
cat admin/linux/debian/debian.${distribution}/changelog >> debian/changelog
|
||||||
|
else
|
||||||
|
cat admin/linux/debian/debian/changelog >> debian/changelog
|
||||||
|
fi
|
||||||
|
|
||||||
|
EDITOR=true dpkg-source --commit . local-changes
|
||||||
|
|
||||||
|
if test -f ~/.has_ppa_keys; then
|
||||||
|
debuild -S ${origsourceopt}
|
||||||
|
else
|
||||||
|
debuild -S ${origsourceopt} -us -uc
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
|
||||||
|
elif [ "$TRAVIS_BUILD_STEP" == "ppa_deploy" ]; then
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
kind=`cat kind`
|
||||||
|
|
||||||
|
if test "$encrypted_5dafbd038603_key" -a "$encrypted_5dafbd038603_iv"; then
|
||||||
|
PPA=ppa:ivaradi/nextcloud-client-exp
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "kind: $kind"
|
||||||
|
|
||||||
|
if test "$kind" = "beta"; then
|
||||||
|
PPA=$PPA_BETA
|
||||||
|
OBS_PROJECT=$OBS_PROJECT_BETA
|
||||||
|
fi
|
||||||
|
OBS_SUBDIR="${OBS_PROJECT}/${OBS_PACKAGE}"
|
||||||
|
|
||||||
|
if test -f ~/.has_ppa_keys; then
|
||||||
|
for changes in nextcloud-client_*~+([a-z])1_source.changes; do
|
||||||
|
dput $PPA $changes > /dev/null
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir osc
|
||||||
|
cd osc
|
||||||
|
osc co ${OBS_PROJECT} ${OBS_PACKAGE}
|
||||||
|
if test "$(ls ${OBS_SUBDIR})"; then
|
||||||
|
osc delete ${OBS_SUBDIR}/*
|
||||||
|
fi
|
||||||
|
cp ../nextcloud-client*.orig.tar.* ${OBS_SUBDIR}/
|
||||||
|
cp ../nextcloud-client_*[0-9.][0-9].dsc ${OBS_SUBDIR}/
|
||||||
|
cp ../nextcloud-client_*[0-9.][0-9].debian.tar* ${OBS_SUBDIR}/
|
||||||
|
cp ../nextcloud-client_*[0-9.][0-9]_source.changes ${OBS_SUBDIR}/
|
||||||
|
osc add ${OBS_SUBDIR}/*
|
||||||
|
|
||||||
|
cd ${OBS_SUBDIR}
|
||||||
|
osc commit -m "Travis update"
|
||||||
|
fi
|
||||||
19
admin/linux/travis-build.sh
Executable file
19
admin/linux/travis-build.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Copyright (C) 2017 Marco Trevisan
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
TRAVIS_BUILD_STEP="$1"
|
||||||
|
THIS_PATH=$(dirname $0)
|
||||||
|
|
||||||
|
if [ -z "$TRAVIS_BUILD_STEP" ]; then
|
||||||
|
echo "No travis build step defined"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$BUILD_TYPE" == "debian" ]; then
|
||||||
|
admin/linux/debian/travis-build.sh "$@"
|
||||||
|
else
|
||||||
|
echo 'No $BUILD_TYPE defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
# Check if varialbe MAC_INSTALLER_BACKGROUND_FILE is defined. That might come
|
# Check if varialbe MAC_INSTALLER_BACKGROUND_FILE is defined. That might come
|
||||||
# from the OEM.cmake for branded clients or from OWNCLOUD.cmake for the non
|
# from the OEM.cmake for branded clients or from NEXTCLOUD.cmake for the non
|
||||||
# branded client.
|
# branded client.
|
||||||
# Make sure that the MAC_INSTALLER_BACKGROUND_FILE contains the full path, ie.
|
# Make sure that the MAC_INSTALLER_BACKGROUND_FILE contains the full path, ie.
|
||||||
# includes CMAKE_SOURCE_DIR or so.
|
# includes CMAKE_SOURCE_DIR or so.
|
||||||
|
|||||||
@@ -506,536 +506,6 @@
|
|||||||
<key>UUID</key>
|
<key>UUID</key>
|
||||||
<string>7D7219B7-1897-48C3-8533-842BDEC46F71</string>
|
<string>7D7219B7-1897-48C3-8533-842BDEC46F71</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
|
||||||
<key>PACKAGE_FILES</key>
|
|
||||||
<dict>
|
|
||||||
<key>DEFAULT_INSTALL_LOCATION</key>
|
|
||||||
<string>/</string>
|
|
||||||
<key>HIERARCHY</key>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>80</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Utilities</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>80</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Applications</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>509</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>80</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Application Support</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Documentation</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Filesystems</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Frameworks</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Input Methods</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Internet Plug-Ins</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>LaunchAgents</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>LaunchDaemons</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>PreferencePanes</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Preferences</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>80</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Printers</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>PrivilegedHelperTools</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>QuickLook</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>QuickTime</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Screen Savers</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Library/ScriptingAdditions/SyncStateFinder.osax/Contents</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>3</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>3</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>SyncStateFinder.osax</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>2</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>ScriptingAdditions</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>2</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Scripts</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Services</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Widgets</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Library</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Extensions</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Library</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>System</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CHILDREN</key>
|
|
||||||
<array/>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Shared</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>1023</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>80</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>Users</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>GID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PATH</key>
|
|
||||||
<string>/</string>
|
|
||||||
<key>PATH_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>PERMISSIONS</key>
|
|
||||||
<integer>493</integer>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>UID</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
<key>PAYLOAD_TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>VERSION</key>
|
|
||||||
<integer>2</integer>
|
|
||||||
</dict>
|
|
||||||
<key>PACKAGE_SCRIPTS</key>
|
|
||||||
<dict>
|
|
||||||
<key>POSTINSTALL_PATH</key>
|
|
||||||
<dict/>
|
|
||||||
<key>PREINSTALL_PATH</key>
|
|
||||||
<dict/>
|
|
||||||
<key>RESOURCES</key>
|
|
||||||
<array/>
|
|
||||||
</dict>
|
|
||||||
<key>PACKAGE_SETTINGS</key>
|
|
||||||
<dict>
|
|
||||||
<key>AUTHENTICATION</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>CONCLUSION_ACTION</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>IDENTIFIER</key>
|
|
||||||
<string>com.ownCloud.finderPlugin</string>
|
|
||||||
<key>LOCATION</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>NAME</key>
|
|
||||||
<string>Legacy Finder Plugin (OS X 10.9 or older)</string>
|
|
||||||
<key>OVERWRITE_PERMISSIONS</key>
|
|
||||||
<false/>
|
|
||||||
<key>VERSION</key>
|
|
||||||
<string>@MIRALL_VERSION_FULL@</string>
|
|
||||||
</dict>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>UUID</key>
|
|
||||||
<string>39F61FCD-6EAA-4F3A-81C6-25E3F667DFB5</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
</array>
|
||||||
<key>PROJECT</key>
|
<key>PROJECT</key>
|
||||||
<dict>
|
<dict>
|
||||||
@@ -1103,49 +573,6 @@
|
|||||||
<key>UUID</key>
|
<key>UUID</key>
|
||||||
<string>9647ADC0-BD53-4D7D-A561-73D383AACDE1</string>
|
<string>9647ADC0-BD53-4D7D-A561-73D383AACDE1</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
|
||||||
<key>DESCRIPTION</key>
|
|
||||||
<array/>
|
|
||||||
<key>OPTIONS</key>
|
|
||||||
<dict>
|
|
||||||
<key>HIDDEN</key>
|
|
||||||
<false/>
|
|
||||||
<key>STATE</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
</dict>
|
|
||||||
<key>PACKAGE_UUID</key>
|
|
||||||
<string>39F61FCD-6EAA-4F3A-81C6-25E3F667DFB5</string>
|
|
||||||
<key>REQUIREMENTS</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>BEHAVIOR</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>DICTIONARY</key>
|
|
||||||
<dict>
|
|
||||||
<key>IC_REQUIREMENT_JAVASCRIPT_FUNCTION</key>
|
|
||||||
<string>olderOsx</string>
|
|
||||||
<key>IC_REQUIREMENT_JAVASCRIPT_PARAMETERS</key>
|
|
||||||
<array/>
|
|
||||||
</dict>
|
|
||||||
<key>IDENTIFIER</key>
|
|
||||||
<string>fr.whitebox.Packages.requirement.javascript</string>
|
|
||||||
<key>MESSAGE</key>
|
|
||||||
<array/>
|
|
||||||
<key>NAME</key>
|
|
||||||
<string>JavaScript</string>
|
|
||||||
<key>STATE</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>TITLE</key>
|
|
||||||
<array/>
|
|
||||||
<key>TOOLTIP</key>
|
|
||||||
<array/>
|
|
||||||
<key>TYPE</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>UUID</key>
|
|
||||||
<string>1D2C47E0-5FD3-4623-B934-1347C66782D0</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
</array>
|
||||||
<key>REMOVED</key>
|
<key>REMOVED</key>
|
||||||
<dict/>
|
<dict/>
|
||||||
@@ -1450,18 +877,6 @@
|
|||||||
<string>@CMAKE_INSTALL_DIR@</string>
|
<string>@CMAKE_INSTALL_DIR@</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SHARED_GLOBAL_DATA</key>
|
|
||||||
<dict>
|
|
||||||
<key>IC_REQUIREMENT_JAVASCRIPT_SHARED_SOURCE_CODE</key>
|
|
||||||
<string>
|
|
||||||
function olderOsx() {
|
|
||||||
if(system.compareVersions(system.version.ProductVersion, '10.10') == -1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
</string>
|
|
||||||
</dict>
|
|
||||||
<key>TYPE</key>
|
<key>TYPE</key>
|
||||||
<integer>0</integer>
|
<integer>0</integer>
|
||||||
<key>VERSION</key>
|
<key>VERSION</key>
|
||||||
|
|||||||
@@ -3,7 +3,4 @@
|
|||||||
# kill the old version. see issue #2044
|
# kill the old version. see issue #2044
|
||||||
killall @APPLICATION_EXECUTABLE@
|
killall @APPLICATION_EXECUTABLE@
|
||||||
|
|
||||||
# Unload the Finder plugin. see issue #2105
|
|
||||||
killall Finder
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ SET(QT_MKSPECS_DIR ${CMAKE_FIND_ROOT_PATH}/share/qt5/mkspecs)
|
|||||||
SET(QT_QT_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include)
|
SET(QT_QT_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include)
|
||||||
|
|
||||||
# qt tools
|
# qt tools
|
||||||
SET(QT_QMAKE_EXECUTABLE ${MINGW_PREFIX}-qmake )
|
SET(QT_QMAKE_EXECUTABLE ${MINGW_PREFIX}-qmake-qt5)
|
||||||
SET(QT_MOC_EXECUTABLE ${MINGW_PREFIX}-moc)
|
SET(QT_MOC_EXECUTABLE ${MINGW_PREFIX}-moc-qt5)
|
||||||
SET(QT_RCC_EXECUTABLE ${MINGW_PREFIX}-rcc)
|
SET(QT_RCC_EXECUTABLE ${MINGW_PREFIX}-rcc-qt5)
|
||||||
SET(QT_UIC_EXECUTABLE ${MINGW_PREFIX}-uic)
|
SET(Qt5Widgets_UIC_EXECUTABLE ${MINGW_PREFIX}-uic-qt5)
|
||||||
SET(QT_LRELEASE_EXECUTABLE ${MINGW_PREFIX}-lrelease)
|
SET(QT_LRELEASE_EXECUTABLE ${MINGW_PREFIX}-lrelease-qt5)
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
FROM opensuse:42.1
|
FROM opensuse:42.1
|
||||||
|
|
||||||
MAINTAINER Daniel Molkentin <danimo@owncloud.com>
|
|
||||||
|
|
||||||
ENV TERM ansi
|
ENV TERM ansi
|
||||||
ENV HOME /root
|
ENV HOME /root
|
||||||
|
|
||||||
ENV REFRESHED_AT 20160421
|
ENV REFRESHED_AT 20170113
|
||||||
|
|
||||||
RUN zypper --non-interactive --gpg-auto-import-keys refresh
|
RUN zypper --non-interactive --gpg-auto-import-keys refresh
|
||||||
RUN zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/repositories/windows:/mingw/openSUSE_42.1/windows:mingw.repo
|
RUN zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/repositories/windows:/mingw/openSUSE_Leap_42.1/windows:mingw.repo
|
||||||
RUN zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/repositories/isv:ownCloud:toolchains:mingw:win32:2.3/openSUSE_Leap_42.1/isv:ownCloud:toolchains:mingw:win32:2.3.repo
|
RUN zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/repositories/isv:ownCloud:toolchains:mingw:win32:2.3/openSUSE_Leap_42.1/isv:ownCloud:toolchains:mingw:win32:2.3.repo
|
||||||
RUN zypper --non-interactive --gpg-auto-import-keys install cmake make mingw32-cross-binutils mingw32-cross-cpp mingw32-cross-gcc \
|
RUN zypper --non-interactive --gpg-auto-import-keys install cmake make mingw32-cross-binutils mingw32-cross-cpp mingw32-cross-gcc \
|
||||||
mingw32-cross-gcc-c++ mingw32-cross-pkg-config mingw32-filesystem \
|
mingw32-cross-gcc-c++ mingw32-cross-pkg-config mingw32-filesystem \
|
||||||
mingw32-headers mingw32-runtime site-config mingw32-libwebp \
|
mingw32-headers mingw32-runtime site-config mingw32-libwebp mingw32-libssp0 \
|
||||||
mingw32-cross-libqt5-qmake mingw32-cross-libqt5-qttools mingw32-libqt5* \
|
mingw32-cross-libqt5-qmake mingw32-cross-libqt5-qttools mingw32-libqt5* \
|
||||||
mingw32-qt5keychain* mingw32-angleproject* \
|
mingw32-qt5keychain* mingw32-angleproject* \
|
||||||
mingw32-cross-nsis mingw32-libopenssl* \
|
mingw32-cross-nsis mingw32-libopenssl* \
|
||||||
mingw32-sqlite* kdewin-png2ico \
|
mingw32-sqlite* png2ico \
|
||||||
osslsigncode wget
|
osslsigncode wget
|
||||||
|
|
||||||
# RPM depends on curl for installs from HTTP
|
# RPM depends on curl for installs from HTTP
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 9.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
45
appveyor.ini
Normal file
45
appveyor.ini
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
[General]
|
||||||
|
Branch = master
|
||||||
|
ShallowClone = True
|
||||||
|
Command=craft
|
||||||
|
|
||||||
|
# Variables defined here override the default value
|
||||||
|
# The variable names are casesensitive
|
||||||
|
[Variables]
|
||||||
|
#Values need to be overwritten to create a chache
|
||||||
|
UseCache = True
|
||||||
|
CreateCache = False
|
||||||
|
|
||||||
|
# Settings applicable for all Crafts matrices
|
||||||
|
# Settings are Category/key=value
|
||||||
|
# Category is case sensitive
|
||||||
|
|
||||||
|
[GeneralSettings]
|
||||||
|
General/EMERGE_PKGDSTDIR=${Variables:APPVEYOR_BUILD_FOLDER}/binaries
|
||||||
|
Paths/python = C:\Python36
|
||||||
|
Paths/python27 = C:\Python27
|
||||||
|
Paths/downloaddir = ${Variables:Root}\downloads
|
||||||
|
ShortPath/Enabled = False
|
||||||
|
ShortPath/EnableJunctions = True
|
||||||
|
ShortPath/JunctionDir = C:\CM-SP\
|
||||||
|
Packager/CacheDir = ${Variables:Root}\cache
|
||||||
|
Packager/UseCache = ${Variables:UseCache}
|
||||||
|
Packager/CreateCache = ${Variables:CreateCache}
|
||||||
|
; Packager/RepositoryUrl = https://files.kde.org/craft/
|
||||||
|
Packager/PackageType = PortablePackager
|
||||||
|
Packager/RepositoryUrl = http://ftp.acc.umu.se/mirror/kde.org/files/craft/master/
|
||||||
|
Compile/BuildType = RelWithDebInfo
|
||||||
|
ContinuousIntegration/Enabled = True
|
||||||
|
|
||||||
|
[BlueprintSettings]
|
||||||
|
# don't try to pip install on the ci
|
||||||
|
python-modules.ignored = True
|
||||||
|
|
||||||
|
libs/qt5.version = 5.9.3
|
||||||
|
craft/craft-core.version = master
|
||||||
|
|
||||||
|
[windows-msvc2017_64-cl]
|
||||||
|
General/ABI = windows-msvc2017_64-cl
|
||||||
|
|
||||||
|
[windows-msvc2017_32-cl]
|
||||||
|
General/ABI = windows-msvc2017_32-cl
|
||||||
50
appveyor.yml
Normal file
50
appveyor.yml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
version: '{build}-{branch}'
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
clone_depth: 50
|
||||||
|
|
||||||
|
|
||||||
|
init:
|
||||||
|
- ps: |
|
||||||
|
function craft($target) {
|
||||||
|
& C:\Python36\python.exe "C:\CraftMaster\CraftMaster\CraftMaster.py" --config "$env:APPVEYOR_BUILD_FOLDER\appveyor.ini" --variables "APPVEYOR_BUILD_FOLDER=$env:APPVEYOR_BUILD_FOLDER" --target $target -c $args
|
||||||
|
if($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
|
||||||
|
}
|
||||||
|
|
||||||
|
install:
|
||||||
|
- ps: |
|
||||||
|
#use cmd to silence powershell behaviour for stderr
|
||||||
|
& cmd /C "git clone -q --depth=1 git://anongit.kde.org/craftmaster.git C:\CraftMaster\CraftMaster 2>&1"
|
||||||
|
|
||||||
|
craft $env:TARGET -i craft
|
||||||
|
craft $env:TARGET --install-deps owncloud-client
|
||||||
|
|
||||||
|
build_script:
|
||||||
|
- ps: |
|
||||||
|
craft $env:TARGET --no-cache --src-dir $env:APPVEYOR_BUILD_FOLDER owncloud-client
|
||||||
|
|
||||||
|
after_build:
|
||||||
|
- ps: |
|
||||||
|
craft $env:TARGET --src-dir $env:APPVEYOR_BUILD_FOLDER --package owncloud-client
|
||||||
|
|
||||||
|
|
||||||
|
on_finish:
|
||||||
|
- ps: |
|
||||||
|
Get-ChildItem $env:USERPROFILE\.craft\* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
||||||
|
|
||||||
|
test_script:
|
||||||
|
- ps: |
|
||||||
|
craft $env:TARGET --src-dir $env:APPVEYOR_BUILD_FOLDER --test owncloud-client
|
||||||
|
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
- TARGET: windows-msvc2017_32-cl
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||||
|
- TARGET: windows-msvc2017_64-cl
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
- path: binaries/*
|
||||||
2
binary
2
binary
Submodule binary updated: 1818b48380...3425fab2c6
@@ -70,45 +70,64 @@ macro (KDE4_ADD_APP_ICON appsources pattern)
|
|||||||
endif(PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE)
|
endif(PNG2ICO_EXECUTABLE AND WINDRES_EXECUTABLE)
|
||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# first convert image to a tiff using the Mac OS X "sips" utility,
|
file(GLOB_RECURSE files "${pattern}")
|
||||||
# then use tiff2icns to convert to an icon
|
file(MAKE_DIRECTORY ${appsources}.iconset)
|
||||||
find_program(SIPS_EXECUTABLE NAMES sips)
|
|
||||||
find_program(TIFF2ICNS_EXECUTABLE NAMES tiff2icns)
|
|
||||||
if (SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
|
|
||||||
file(GLOB_RECURSE files "${pattern}")
|
|
||||||
# we can only test for the 128-icon like that - we don't use patterns anymore
|
|
||||||
foreach (it ${files})
|
|
||||||
if (it MATCHES ".*128.*" )
|
|
||||||
set (_icon ${it})
|
|
||||||
endif (it MATCHES ".*128.*")
|
|
||||||
endforeach (it)
|
|
||||||
|
|
||||||
if (_icon)
|
# List from:
|
||||||
|
# https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html#//apple_ref/doc/uid/TP40012302-CH7-SW4
|
||||||
# first, get the basename of our app icon
|
foreach (it ${files})
|
||||||
add_custom_command(OUTPUT ${_outfilename}.icns ${outfilename}.tiff
|
if (it MATCHES ".*icon-16.*")
|
||||||
COMMAND ${SIPS_EXECUTABLE} -s format tiff ${_icon} --out ${outfilename}.tiff
|
configure_file(${it} ${appsources}.iconset/icon_16x16.png COPYONLY)
|
||||||
COMMAND ${TIFF2ICNS_EXECUTABLE} ${outfilename}.tiff ${_outfilename}.icns
|
elseif (it MATCHES ".*icon-32.*")
|
||||||
DEPENDS ${_icon}
|
configure_file(${it} ${appsources}.iconset/icon_16x16@2x.png COPYONLY)
|
||||||
)
|
configure_file(${it} ${appsources}.iconset/icon_32x32.png COPYONLY)
|
||||||
|
elseif (it MATCHES ".*icon-64.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/icon_32x32@2x.png COPYONLY)
|
||||||
|
elseif (it MATCHES ".*icon-128.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/icon_128x128.png COPYONLY)
|
||||||
|
elseif (it MATCHES ".*icon-256.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/icon_128x128@2x.png COPYONLY)
|
||||||
|
configure_file(${it} ${appsources}.iconset/icon_256x256.png COPYONLY)
|
||||||
|
elseif (it MATCHES ".*icon-512.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/icon_256x256@2x.png COPYONLY)
|
||||||
|
configure_file(${it} ${appsources}.iconset/icon_512x512.png COPYONLY)
|
||||||
|
elseif (it MATCHES ".*icon-1024.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/icon_512x512@2x.png COPYONLY)
|
||||||
|
endif()
|
||||||
|
endforeach (it)
|
||||||
|
|
||||||
# This will register the icon into the bundle
|
# Copy the sidebar icons in the main app bundle for the FinderSync extension to pick.
|
||||||
set(MACOSX_BUNDLE_ICON_FILE ${appsources}.icns)
|
# https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Finder.html#//apple_ref/doc/uid/TP40014214-CH15-SW15
|
||||||
|
foreach (it ${files})
|
||||||
|
if (it MATCHES ".*sidebar-16.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/sidebar_16x16.png COPYONLY)
|
||||||
|
elseif (it MATCHES ".*sidebar-18.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/sidebar_18x18.png COPYONLY)
|
||||||
|
elseif (it MATCHES ".*sidebar-32.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/sidebar_16x16@2x.png COPYONLY)
|
||||||
|
configure_file(${it} ${appsources}.iconset/sidebar_32x32.png COPYONLY)
|
||||||
|
elseif (it MATCHES ".*sidebar-36.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/sidebar_18x18@2x.png COPYONLY)
|
||||||
|
elseif (it MATCHES ".*sidebar-64.*")
|
||||||
|
configure_file(${it} ${appsources}.iconset/sidebar_32x32@2x.png COPYONLY)
|
||||||
|
endif()
|
||||||
|
endforeach (it)
|
||||||
|
|
||||||
# Append the icns file to the sources list so it will be a dependency to the
|
add_custom_command(OUTPUT ${_outfilename}.icns
|
||||||
# main target
|
COMMAND echo === Building bundle icns with iconset:
|
||||||
list(APPEND ${appsources} ${_outfilename}.icns)
|
COMMAND ls -1 ${appsources}.iconset
|
||||||
|
COMMAND iconutil -c icns -o ${_outfilename}.icns ${appsources}.iconset
|
||||||
|
DEPENDS ${files}
|
||||||
|
)
|
||||||
|
|
||||||
# Install the icon into the Resources dir in the bundle
|
# This will register the icon into the bundle
|
||||||
set_source_files_properties(${_outfilename}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
set(MACOSX_BUNDLE_ICON_FILE ${appsources}.icns)
|
||||||
|
|
||||||
else(_icon)
|
# Append the icns file to the sources list so it will be a dependency to the
|
||||||
# TODO - try to scale a non-128 icon...? Try to convert an SVG on the fly?
|
# main target
|
||||||
message(STATUS "Unable to find an 128x128 icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
|
list(APPEND ${appsources} ${_outfilename}.icns)
|
||||||
endif(_icon)
|
|
||||||
|
|
||||||
else(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
|
# Install the icon into the Resources dir in the bundle
|
||||||
message(STATUS "Unable to find the sips and tiff2icns utilities - application will not have an application icon!")
|
set_source_files_properties(${_outfilename}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||||
endif(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
|
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
endmacro (KDE4_ADD_APP_ICON)
|
endmacro (KDE4_ADD_APP_ICON)
|
||||||
|
|||||||
332
cmake/modules/ECMAddAppIcon.cmake
Normal file
332
cmake/modules/ECMAddAppIcon.cmake
Normal file
@@ -0,0 +1,332 @@
|
|||||||
|
#.rst:
|
||||||
|
# ECMAddAppIcon
|
||||||
|
# -------------
|
||||||
|
#
|
||||||
|
# Add icons to executable files and packages.
|
||||||
|
#
|
||||||
|
# ::
|
||||||
|
#
|
||||||
|
# ecm_add_app_icon(<sources_var>
|
||||||
|
# ICONS <icon> [<icon> [...]]
|
||||||
|
# [SIDEBAR_ICONS <icon> [<icon> [...]] # Since 5.4x
|
||||||
|
# [OUTFILE_BASE <name>]) # Since 5.4x
|
||||||
|
# )
|
||||||
|
#
|
||||||
|
# The given icons, whose names must match the pattern::
|
||||||
|
#
|
||||||
|
# <size>-<other_text>.png
|
||||||
|
#
|
||||||
|
# will be added to the executable target whose sources are specified by
|
||||||
|
# ``<sources_var>`` on platforms that support it (Windows and Mac OS X).
|
||||||
|
# Other icon files are ignored but on Mac SVG files can be supported and
|
||||||
|
# it is thus possible to mix those with png files in a single macro call.
|
||||||
|
#
|
||||||
|
# ``<size>`` is a numeric pixel size (typically 16, 32, 48, 64, 128 or 256).
|
||||||
|
# ``<other_text>`` can be any other text. See the platform notes below for any
|
||||||
|
# recommendations about icon sizes.
|
||||||
|
#
|
||||||
|
# ``SIDEBAR_ICONS`` can be used to add Mac OS X sidebar
|
||||||
|
# icons to the generated iconset. They are used when a folder monitored by the
|
||||||
|
# application is dragged into Finder's sidebar. Since 5.4x.
|
||||||
|
#
|
||||||
|
# ``OUTFILE_BASE`` will be used as the basename for the icon file. If
|
||||||
|
# you specify it, the icon file will be called ``<OUTFILE_BASE>.icns`` on Mac OS X
|
||||||
|
# and ``<OUTFILE_BASE>.ico`` on Windows. If you don't specify it, it defaults
|
||||||
|
# to ``<sources_var>.<ext>``. Since 5.4x.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Windows notes
|
||||||
|
# * Icons are compiled into the executable using a resource file.
|
||||||
|
# * Icons may not show up in Windows Explorer if the executable
|
||||||
|
# target does not have the ``WIN32_EXECUTABLE`` property set.
|
||||||
|
# * The tool png2ico is required. See :find-module:`FindPng2Ico`.
|
||||||
|
# * Supported sizes: 16, 32, 48, 64, 128.
|
||||||
|
#
|
||||||
|
# Mac OS X notes
|
||||||
|
# * The executable target must have the ``MACOSX_BUNDLE`` property set.
|
||||||
|
# * Icons are added to the bundle.
|
||||||
|
# * If the ksvg2icns tool from KIconThemes is available, .svg and .svgz
|
||||||
|
# files are accepted; the first that is converted successfully to .icns
|
||||||
|
# will provide the application icon. SVG files are ignored otherwise.
|
||||||
|
# * The tool iconutil (provided by Apple) is required for bitmap icons.
|
||||||
|
# * Supported sizes: 16, 32, 64, 128, 256 (and 512, 1024 after OS X 10.9).
|
||||||
|
# * At least a 128x128px (or an SVG) icon is required.
|
||||||
|
# * Larger sizes are automatically used to substitute for smaller sizes on
|
||||||
|
# "Retina" (high-resolution) displays. For example, a 32px icon, if
|
||||||
|
# provided, will be used as a 32px icon on standard-resolution displays,
|
||||||
|
# and as a 16px-equivalent icon (with an "@2x" tag) on high-resolution
|
||||||
|
# displays. That is why you should provide 64px and 1024px icons although
|
||||||
|
# they are not supported anymore directly. Instead they will be used as
|
||||||
|
# 32px@2x and 512px@2x. ksvg2icns handles this internally.
|
||||||
|
# * This function sets the ``MACOSX_BUNDLE_ICON_FILE`` variable to the name
|
||||||
|
# of the generated icns file, so that it will be used as the
|
||||||
|
# ``MACOSX_BUNDLE_ICON_FILE`` target property when you call
|
||||||
|
# ``add_executable``.
|
||||||
|
# * Sidebar icons should typically provided in 16, 32, 64, 128 and 256px.
|
||||||
|
#
|
||||||
|
# Since 1.7.0.
|
||||||
|
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2014 Alex Merry <alex.merry@kde.org>
|
||||||
|
# Copyright 2014 Ralf Habacker <ralf.habacker@freenet.de>
|
||||||
|
# Copyright 2006-2009 Alexander Neundorf, <neundorf@kde.org>
|
||||||
|
# Copyright 2006, 2007, Laurent Montel, <montel@kde.org>
|
||||||
|
# Copyright 2007 Matthias Kretz <kretz@kde.org>
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in the
|
||||||
|
# documentation and/or other materials provided with the distribution.
|
||||||
|
# 3. The name of the author may not be used to endorse or promote products
|
||||||
|
# derived from this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
include(CMakeParseArguments)
|
||||||
|
|
||||||
|
function(ecm_add_app_icon appsources)
|
||||||
|
set(options)
|
||||||
|
set(oneValueArgs OUTFILE_BASE)
|
||||||
|
set(multiValueArgs ICONS SIDEBAR_ICONS)
|
||||||
|
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
|
if(NOT ARG_ICONS)
|
||||||
|
message(FATAL_ERROR "No ICONS argument given to ecm_add_app_icon")
|
||||||
|
endif()
|
||||||
|
if(ARG_UNPARSED_ARGUMENTS)
|
||||||
|
message(FATAL_ERROR "Unexpected arguments to ecm_add_app_icon: ${ARG_UNPARSED_ARGUMENTS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
find_program(KSVG2ICNS NAMES ksvg2icns)
|
||||||
|
foreach(icon ${ARG_ICONS})
|
||||||
|
get_filename_component(icon_full ${icon} ABSOLUTE)
|
||||||
|
get_filename_component(icon_type ${icon_full} EXT)
|
||||||
|
# do we have ksvg2icns in the path and did we receive an svg (or compressed svg) icon?
|
||||||
|
if(KSVG2ICNS AND (${icon_type} STREQUAL ".svg" OR ${icon_type} STREQUAL ".svgz"))
|
||||||
|
# convert the svg icon to an icon resource
|
||||||
|
execute_process(COMMAND ${KSVG2ICNS} "${icon_full}"
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} RESULT_VARIABLE KSVG2ICNS_ERROR)
|
||||||
|
if(${KSVG2ICNS_ERROR})
|
||||||
|
message(AUTHOR_WARNING "ksvg2icns could not generate an OS X application icon from ${icon}")
|
||||||
|
else()
|
||||||
|
# install the icns file we just created
|
||||||
|
get_filename_component(icon_name ${icon_full} NAME_WE)
|
||||||
|
set(MACOSX_BUNDLE_ICON_FILE ${icon_name}.icns PARENT_SCOPE)
|
||||||
|
set(${appsources} "${${appsources}};${CMAKE_CURRENT_BINARY_DIR}/${icon_name}.icns" PARENT_SCOPE)
|
||||||
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${icon_name}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||||
|
# we're done now
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
_ecm_add_app_icon_categorize_icons("${ARG_ICONS}" "icons" "16;32;48;64;128;256;512;1024")
|
||||||
|
if(ARG_SIDEBAR_ICONS)
|
||||||
|
_ecm_add_app_icon_categorize_icons("${ARG_SIDEBAR_ICONS}" "sidebar_icons" "16;18;32;36;64")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(mac_icons
|
||||||
|
# Icons: https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html#//apple_ref/doc/uid/TP40012302-CH7-SW4
|
||||||
|
${icons_at_16px}
|
||||||
|
${icons_at_32px}
|
||||||
|
${icons_at_64px}
|
||||||
|
${icons_at_128px}
|
||||||
|
${icons_at_256px}
|
||||||
|
${icons_at_512px}
|
||||||
|
${icons_at_1024px}
|
||||||
|
|
||||||
|
# Sidebar Icons: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Finder.html#//apple_ref/doc/uid/TP40014214-CH15-SW15
|
||||||
|
${sidebar_icons_at_16px}
|
||||||
|
${sidebar_icons_at_18px}
|
||||||
|
${sidebar_icons_at_32px}
|
||||||
|
${sidebar_icons_at_36px}
|
||||||
|
${sidebar_icons_at_64px})
|
||||||
|
if (NOT icons_at_128px)
|
||||||
|
message(AUTHOR_WARNING "No 128px icon provided; this will not work on Mac OS X")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
set(windows_icons ${icons_at_16px}
|
||||||
|
${icons_at_32px}
|
||||||
|
${icons_at_48px}
|
||||||
|
${icons_at_64px}
|
||||||
|
${icons_at_128px})
|
||||||
|
if (NOT windows_icons)
|
||||||
|
message(AUTHOR_WARNING "No icons suitable for use on Windows provided")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (ARG_OUTFILE_BASE)
|
||||||
|
set (_outfilebasename "${ARG_OUTFILE_BASE}")
|
||||||
|
else()
|
||||||
|
set (_outfilebasename "${appsources}")
|
||||||
|
endif()
|
||||||
|
set (_outfilename "${CMAKE_CURRENT_BINARY_DIR}/${_outfilebasename}")
|
||||||
|
|
||||||
|
if (WIN32 AND windows_icons)
|
||||||
|
set(saved_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}")
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_FIND_MODULE_DIR})
|
||||||
|
find_package(Png2Ico)
|
||||||
|
set(CMAKE_MODULE_PATH "${saved_CMAKE_MODULE_PATH}")
|
||||||
|
|
||||||
|
if (Png2Ico_FOUND)
|
||||||
|
if (Png2Ico_HAS_RCFILE_ARGUMENT)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${_outfilename}.rc" "${_outfilename}.ico"
|
||||||
|
COMMAND Png2Ico::Png2Ico
|
||||||
|
ARGS
|
||||||
|
--rcfile "${_outfilename}.rc"
|
||||||
|
"${_outfilename}.ico"
|
||||||
|
${windows_icons}
|
||||||
|
DEPENDS ${windows_icons}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${_outfilename}.ico"
|
||||||
|
COMMAND Png2Ico::Png2Ico
|
||||||
|
ARGS "${_outfilename}.ico" ${windows_icons}
|
||||||
|
DEPENDS ${windows_icons}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
)
|
||||||
|
# this bit's a little hacky to make the dependency stuff work
|
||||||
|
file(WRITE "${_outfilename}.rc.in" "IDI_ICON1 ICON DISCARDABLE \"${_outfilename}.ico\"\n")
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${_outfilename}.rc"
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
ARGS -E copy "${_outfilename}.rc.in" "${_outfilename}.rc"
|
||||||
|
DEPENDS "${_outfilename}.ico"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
message(WARNING "Unable to find the png2ico utility - application will not have an application icon!")
|
||||||
|
endif()
|
||||||
|
elseif (APPLE AND mac_icons)
|
||||||
|
# first generate .iconset directory structure, then convert to .icns format using the Mac OS X "iconutil" utility,
|
||||||
|
# to create retina compatible icon, you need png source files in pixel resolution 16x16, 32x32, 64x64, 128x128,
|
||||||
|
# 256x256, 512x512, 1024x1024
|
||||||
|
find_program(ICONUTIL_EXECUTABLE NAMES iconutil)
|
||||||
|
if (ICONUTIL_EXECUTABLE)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${_outfilename}.iconset"
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
ARGS -E make_directory "${_outfilename}.iconset"
|
||||||
|
)
|
||||||
|
set(iconset_icons)
|
||||||
|
macro(copy_icon filename sizename type)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${_outfilename}.iconset/${type}_${sizename}.png"
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
ARGS -E copy
|
||||||
|
"${filename}"
|
||||||
|
"${_outfilename}.iconset/${type}_${sizename}.png"
|
||||||
|
DEPENDS
|
||||||
|
"${_outfilename}.iconset"
|
||||||
|
"${filename}"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
)
|
||||||
|
list(APPEND iconset_icons
|
||||||
|
"${_outfilename}.iconset/${type}_${sizename}.png")
|
||||||
|
endmacro()
|
||||||
|
foreach(size 16 32 128 256 512)
|
||||||
|
math(EXPR double_size "2 * ${size}")
|
||||||
|
foreach(file ${icons_at_${size}px})
|
||||||
|
copy_icon("${file}" "${size}x${size}" "icon")
|
||||||
|
endforeach()
|
||||||
|
foreach(file ${icons_at_${double_size}px})
|
||||||
|
copy_icon("${file}" "${size}x${size}@2x" "icon")
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
foreach(size 16 18 32)
|
||||||
|
math(EXPR double_size "2 * ${size}")
|
||||||
|
foreach(file ${sidebar_icons_at_${size}px})
|
||||||
|
copy_icon("${file}" "${size}x${size}" "sidebar")
|
||||||
|
endforeach()
|
||||||
|
foreach(file ${sidebar_icons_at_${double_size}px})
|
||||||
|
copy_icon("${file}" "${size}x${size}@2x" "sidebar")
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# generate .icns icon file
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${_outfilename}.icns"
|
||||||
|
COMMAND ${ICONUTIL_EXECUTABLE}
|
||||||
|
ARGS
|
||||||
|
--convert icns
|
||||||
|
--output "${_outfilename}.icns"
|
||||||
|
"${_outfilename}.iconset"
|
||||||
|
DEPENDS "${iconset_icons}"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
|
)
|
||||||
|
# This will register the icon into the bundle
|
||||||
|
set(MACOSX_BUNDLE_ICON_FILE "${_outfilebasename}.icns" PARENT_SCOPE)
|
||||||
|
|
||||||
|
# Append the icns file to the sources list so it will be a dependency to the
|
||||||
|
# main target
|
||||||
|
set(${appsources} "${${appsources}};${_outfilename}.icns" PARENT_SCOPE)
|
||||||
|
|
||||||
|
# Install the icon into the Resources dir in the bundle
|
||||||
|
set_source_files_properties("${_outfilename}.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||||
|
else()
|
||||||
|
message(STATUS "Unable to find the iconutil utility - application will not have an application icon!")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
macro(_ecm_add_app_icon_categorize_icons icons type known_sizes)
|
||||||
|
set(_${type}_known_sizes)
|
||||||
|
foreach(size ${known_sizes})
|
||||||
|
set(${type}_at_${size}px)
|
||||||
|
list(APPEND _${type}_known_sizes ${size})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
|
foreach(icon ${icons})
|
||||||
|
get_filename_component(icon_full ${icon} ABSOLUTE)
|
||||||
|
if (NOT EXISTS "${icon_full}")
|
||||||
|
message(AUTHOR_WARNING "${icon_full} does not exist, ignoring")
|
||||||
|
else()
|
||||||
|
get_filename_component(icon_name ${icon} NAME)
|
||||||
|
string(REGEX MATCH "([0-9]+)\\-[^/]+\\.([a-z]+)$"
|
||||||
|
_dummy "${icon_name}")
|
||||||
|
set(size "${CMAKE_MATCH_1}")
|
||||||
|
set(ext "${CMAKE_MATCH_2}")
|
||||||
|
|
||||||
|
if (NOT (ext STREQUAL "svg" OR ext STREQUAL "svgz"))
|
||||||
|
if (NOT size)
|
||||||
|
message(AUTHOR_WARNING "${icon_full} is not named correctly for ecm_add_app_icon - ignoring")
|
||||||
|
elseif (NOT ext STREQUAL "png")
|
||||||
|
message(AUTHOR_WARNING "${icon_full} is not a png file - ignoring")
|
||||||
|
else()
|
||||||
|
list(FIND _${type}_known_sizes ${size} offset)
|
||||||
|
|
||||||
|
if (offset GREATER -1)
|
||||||
|
list(APPEND ${type}_at_${size}px "${icon_full}")
|
||||||
|
elseif()
|
||||||
|
message(STATUS "not found ${type}_at_${size}px ${icon_full}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
297
cmake/modules/ECMFindModuleHelpers.cmake
Normal file
297
cmake/modules/ECMFindModuleHelpers.cmake
Normal file
@@ -0,0 +1,297 @@
|
|||||||
|
#.rst:
|
||||||
|
# ECMFindModuleHelpers
|
||||||
|
# --------------------
|
||||||
|
#
|
||||||
|
# Helper macros for find modules: ecm_find_package_version_check(),
|
||||||
|
# ecm_find_package_parse_components() and
|
||||||
|
# ecm_find_package_handle_library_components().
|
||||||
|
#
|
||||||
|
# ::
|
||||||
|
#
|
||||||
|
# ecm_find_package_version_check(<name>)
|
||||||
|
#
|
||||||
|
# Prints warnings if the CMake version or the project's required CMake version
|
||||||
|
# is older than that required by extra-cmake-modules.
|
||||||
|
#
|
||||||
|
# ::
|
||||||
|
#
|
||||||
|
# ecm_find_package_parse_components(<name>
|
||||||
|
# RESULT_VAR <variable>
|
||||||
|
# KNOWN_COMPONENTS <component1> [<component2> [...]]
|
||||||
|
# [SKIP_DEPENDENCY_HANDLING])
|
||||||
|
#
|
||||||
|
# This macro will populate <variable> with a list of components found in
|
||||||
|
# <name>_FIND_COMPONENTS, after checking that all those components are in the
|
||||||
|
# list of KNOWN_COMPONENTS; if there are any unknown components, it will print
|
||||||
|
# an error or warning (depending on the value of <name>_FIND_REQUIRED) and call
|
||||||
|
# return().
|
||||||
|
#
|
||||||
|
# The order of components in <variable> is guaranteed to match the order they
|
||||||
|
# are listed in the KNOWN_COMPONENTS argument.
|
||||||
|
#
|
||||||
|
# If SKIP_DEPENDENCY_HANDLING is not set, for each component the variable
|
||||||
|
# <name>_<component>_component_deps will be checked for dependent components.
|
||||||
|
# If <component> is listed in <name>_FIND_COMPONENTS, then all its (transitive)
|
||||||
|
# dependencies will also be added to <variable>.
|
||||||
|
#
|
||||||
|
# ::
|
||||||
|
#
|
||||||
|
# ecm_find_package_handle_library_components(<name>
|
||||||
|
# COMPONENTS <component> [<component> [...]]
|
||||||
|
# [SKIP_DEPENDENCY_HANDLING])
|
||||||
|
# [SKIP_PKG_CONFIG])
|
||||||
|
#
|
||||||
|
# Creates an imported library target for each component. The operation of this
|
||||||
|
# macro depends on the presence of a number of CMake variables.
|
||||||
|
#
|
||||||
|
# The <name>_<component>_lib variable should contain the name of this library,
|
||||||
|
# and <name>_<component>_header variable should contain the name of a header
|
||||||
|
# file associated with it (whatever relative path is normally passed to
|
||||||
|
# '#include'). <name>_<component>_header_subdir variable can be used to specify
|
||||||
|
# which subdirectory of the include path the headers will be found in.
|
||||||
|
# ecm_find_package_components() will then search for the library
|
||||||
|
# and include directory (creating appropriate cache variables) and create an
|
||||||
|
# imported library target named <name>::<component>.
|
||||||
|
#
|
||||||
|
# Additional variables can be used to provide additional information:
|
||||||
|
#
|
||||||
|
# If SKIP_PKG_CONFIG, the <name>_<component>_pkg_config variable is set, and
|
||||||
|
# pkg-config is found, the pkg-config module given by
|
||||||
|
# <name>_<component>_pkg_config will be searched for and used to help locate the
|
||||||
|
# library and header file. It will also be used to set
|
||||||
|
# <name>_<component>_VERSION.
|
||||||
|
#
|
||||||
|
# Note that if version information is found via pkg-config,
|
||||||
|
# <name>_<component>_FIND_VERSION can be set to require a particular version
|
||||||
|
# for each component.
|
||||||
|
#
|
||||||
|
# If SKIP_DEPENDENCY_HANDLING is not set, the INTERFACE_LINK_LIBRARIES property
|
||||||
|
# of the imported target for <component> will be set to contain the imported
|
||||||
|
# targets for the components listed in <name>_<component>_component_deps.
|
||||||
|
# <component>_FOUND will also be set to false if any of the compoments in
|
||||||
|
# <name>_<component>_component_deps are not found. This requires the components
|
||||||
|
# in <name>_<component>_component_deps to be listed before <component> in the
|
||||||
|
# COMPONENTS argument.
|
||||||
|
#
|
||||||
|
# The following variables will be set:
|
||||||
|
#
|
||||||
|
# ``<name>_TARGETS``
|
||||||
|
# the imported targets
|
||||||
|
# ``<name>_LIBRARIES``
|
||||||
|
# the found libraries
|
||||||
|
# ``<name>_INCLUDE_DIRS``
|
||||||
|
# the combined required include directories for the components
|
||||||
|
# ``<name>_DEFINITIONS``
|
||||||
|
# the "other" CFLAGS provided by pkg-config, if any
|
||||||
|
# ``<name>_VERSION``
|
||||||
|
# the value of ``<name>_<component>_VERSION`` for the first component that
|
||||||
|
# has this variable set (note that components are searched for in the order
|
||||||
|
# they are passed to the macro), although if it is already set, it will not
|
||||||
|
# be altered
|
||||||
|
#
|
||||||
|
# Note that these variables are never cleared, so if
|
||||||
|
# ecm_find_package_handle_library_components() is called multiple times with
|
||||||
|
# different components (typically because of multiple find_package() calls) then
|
||||||
|
# ``<name>_TARGETS``, for example, will contain all the targets found in any
|
||||||
|
# call (although no duplicates).
|
||||||
|
#
|
||||||
|
# Since pre-1.0.0.
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2014 Alex Merry <alex.merry@kde.org>
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in the
|
||||||
|
# documentation and/or other materials provided with the distribution.
|
||||||
|
# 3. The name of the author may not be used to endorse or promote products
|
||||||
|
# derived from this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
include(CMakeParseArguments)
|
||||||
|
|
||||||
|
macro(ecm_find_package_version_check module_name)
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 2.8.12)
|
||||||
|
message(FATAL_ERROR "CMake 2.8.12 is required by Find${module_name}.cmake")
|
||||||
|
endif()
|
||||||
|
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
|
||||||
|
message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Find${module_name}.cmake")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(ecm_find_package_parse_components module_name)
|
||||||
|
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
|
||||||
|
set(ecm_fppc_oneValueArgs RESULT_VAR)
|
||||||
|
set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
|
||||||
|
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
|
if(ECM_FPPC_UNPARSED_ARGUMENTS)
|
||||||
|
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}")
|
||||||
|
endif()
|
||||||
|
if(NOT ECM_FPPC_RESULT_VAR)
|
||||||
|
message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components")
|
||||||
|
endif()
|
||||||
|
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
|
||||||
|
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
|
||||||
|
endif()
|
||||||
|
if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
|
||||||
|
set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${module_name}_FIND_COMPONENTS)
|
||||||
|
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
|
||||||
|
|
||||||
|
if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING)
|
||||||
|
# Make sure deps are included
|
||||||
|
foreach(ecm_fppc_comp ${ecm_fppc_requestedComps})
|
||||||
|
foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps})
|
||||||
|
list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index)
|
||||||
|
if("${ecm_fppc_index}" STREQUAL "-1")
|
||||||
|
if(NOT ${module_name}_FIND_QUIETLY)
|
||||||
|
message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}")
|
||||||
|
endif()
|
||||||
|
list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
else()
|
||||||
|
message(STATUS "Skipping dependency handling for ${module_name}")
|
||||||
|
endif()
|
||||||
|
list(REMOVE_DUPLICATES ecm_fppc_requestedComps)
|
||||||
|
|
||||||
|
# This makes sure components are listed in the same order as
|
||||||
|
# KNOWN_COMPONENTS (potentially important for inter-dependencies)
|
||||||
|
set(${ECM_FPPC_RESULT_VAR})
|
||||||
|
foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||||
|
list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index)
|
||||||
|
if(NOT "${ecm_fppc_index}" STREQUAL "-1")
|
||||||
|
list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}")
|
||||||
|
list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
# if there are any left, they are unknown components
|
||||||
|
if(ecm_fppc_requestedComps)
|
||||||
|
set(ecm_fppc_msgType STATUS)
|
||||||
|
if(${module_name}_FIND_REQUIRED)
|
||||||
|
set(ecm_fppc_msgType FATAL_ERROR)
|
||||||
|
endif()
|
||||||
|
if(NOT ${module_name}_FIND_QUIETLY)
|
||||||
|
message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}")
|
||||||
|
endif()
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(ecm_find_package_handle_library_components module_name)
|
||||||
|
set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING)
|
||||||
|
set(ecm_fpwc_oneValueArgs)
|
||||||
|
set(ecm_fpwc_multiValueArgs COMPONENTS)
|
||||||
|
cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
|
if(ECM_FPWC_UNPARSED_ARGUMENTS)
|
||||||
|
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}")
|
||||||
|
endif()
|
||||||
|
if(NOT ECM_FPWC_COMPONENTS)
|
||||||
|
message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package(PkgConfig)
|
||||||
|
foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS})
|
||||||
|
set(ecm_fpwc_dep_vars)
|
||||||
|
set(ecm_fpwc_dep_targets)
|
||||||
|
if(NOT SKIP_DEPENDENCY_HANDLING)
|
||||||
|
foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps})
|
||||||
|
list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND")
|
||||||
|
list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config)
|
||||||
|
pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET
|
||||||
|
${${module_name}_${ecm_fpwc_comp}_pkg_config})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||||
|
NAMES ${${module_name}_${ecm_fpwc_comp}_header}
|
||||||
|
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir}
|
||||||
|
)
|
||||||
|
find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||||
|
NAMES ${${module_name}_${ecm_fpwc_comp}_lib}
|
||||||
|
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}")
|
||||||
|
if(NOT ${module_name}_VERSION)
|
||||||
|
set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp}
|
||||||
|
FOUND_VAR
|
||||||
|
${module_name}_${ecm_fpwc_comp}_FOUND
|
||||||
|
REQUIRED_VARS
|
||||||
|
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||||
|
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||||
|
${ecm_fpwc_dep_vars}
|
||||||
|
VERSION_VAR
|
||||||
|
${module_name}_${ecm_fpwc_comp}_VERSION
|
||||||
|
)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||||
|
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if(${module_name}_${ecm_fpwc_comp}_FOUND)
|
||||||
|
list(APPEND ${module_name}_LIBRARIES
|
||||||
|
"${${module_name}_${ecm_fpwc_comp}_LIBRARY}")
|
||||||
|
list(APPEND ${module_name}_INCLUDE_DIRS
|
||||||
|
"${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}")
|
||||||
|
set(${module_name}_DEFINITIONS
|
||||||
|
${${module_name}_DEFINITIONS}
|
||||||
|
${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS})
|
||||||
|
if(NOT TARGET ${module_name}::${ecm_fpwc_comp})
|
||||||
|
add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}"
|
||||||
|
INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
|
||||||
|
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
list(APPEND ${module_name}_TARGETS
|
||||||
|
"${module_name}::${ecm_fpwc_comp}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if(${module_name}_LIBRARIES)
|
||||||
|
list(REMOVE_DUPLICATES ${module_name}_LIBRARIES)
|
||||||
|
endif()
|
||||||
|
if(${module_name}_INCLUDE_DIRS)
|
||||||
|
list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS)
|
||||||
|
endif()
|
||||||
|
if(${module_name}_DEFINITIONS)
|
||||||
|
list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS)
|
||||||
|
endif()
|
||||||
|
if(${module_name}_TARGETS)
|
||||||
|
list(REMOVE_DUPLICATES ${module_name}_TARGETS)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
1
cmake/modules/ECMFindModuleHelpersStub.cmake
Normal file
1
cmake/modules/ECMFindModuleHelpersStub.cmake
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include(${CMAKE_CURRENT_LIST_DIR}/../modules/ECMFindModuleHelpers.cmake)
|
||||||
35
cmake/modules/FindGLib2.cmake
Normal file
35
cmake/modules/FindGLib2.cmake
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# FindGLib2.cmake
|
||||||
|
|
||||||
|
# GLib2_FOUND - System has GLib2
|
||||||
|
# GLib2_INCLUDES - The GLib2 include directories
|
||||||
|
# GLib2_LIBRARIES - The libraries needed to use GLib2
|
||||||
|
# GLib2_DEFINITIONS - Compiler switches required for using GLib2
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
pkg_check_modules(GLib2 QUIET glib-2.0)
|
||||||
|
set(GLib2_DEFINITIONS ${GLib2_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
find_path(GLib2_INCLUDE_DIR
|
||||||
|
NAMES glib.h glib-object.h
|
||||||
|
HINTS ${GLib2_INCLUDEDIR} ${GLib2_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES glib-2.0)
|
||||||
|
find_path(GLIBCONFIG_INCLUDE_DIR
|
||||||
|
NAMES glibconfig.h
|
||||||
|
HINTS ${LIBDIR} ${LIBRARY_DIRS} ${_GLib2_LIBRARY_DIR}
|
||||||
|
${GLib2_INCLUDEDIR} ${GLib2_INCLUDE_DIRS}
|
||||||
|
${CMAKE_EXTRA_INCLUDES} ${CMAKE_EXTRA_LIBRARIES}
|
||||||
|
PATH_SUFFIXES glib-2.0 glib-2.0/include)
|
||||||
|
list(APPEND GLib2_INCLUDE_DIR ${GLIBCONFIG_INCLUDE_DIR})
|
||||||
|
|
||||||
|
find_library(GLib2_LIBRARY
|
||||||
|
NAMES glib-2.0 libglib-2.0
|
||||||
|
HINTS ${GLib2_LIBDIR} ${GLib2_LIBRARY_DIRS})
|
||||||
|
|
||||||
|
set(GLib2_LIBRARIES ${GLib2_LIBRARY})
|
||||||
|
set(GLib2_INCLUDE_DIRS ${GLib2_INCLUDE_DIR})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(GLib2 DEFAULT_MSG
|
||||||
|
GLib2_LIBRARY GLib2_INCLUDE_DIR)
|
||||||
|
|
||||||
|
mark_as_advanced(GLib2_INCLUDE_DIR GLib2_LIBRARY)
|
||||||
61
cmake/modules/FindGio.cmake
Normal file
61
cmake/modules/FindGio.cmake
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# - Try to find Gio
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# GIO_FOUND - system has Gio
|
||||||
|
# GIO_INCLUDE_DIR - the Gio include directory
|
||||||
|
# GIO_LIBRARIES - the libraries needed to use Gio
|
||||||
|
# GIO_DEFINITIONS - Compiler switches required for using Gio
|
||||||
|
|
||||||
|
|
||||||
|
IF (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
|
||||||
|
# in cache already
|
||||||
|
SET(Gio_FIND_QUIETLY TRUE)
|
||||||
|
ELSE (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
|
||||||
|
SET(Gio_FIND_QUIETLY FALSE)
|
||||||
|
ENDIF (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
|
||||||
|
|
||||||
|
IF (NOT WIN32)
|
||||||
|
# use pkg-config to get the directories and then use these values
|
||||||
|
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||||
|
FIND_PACKAGE(PkgConfig)
|
||||||
|
PKG_CHECK_MODULES(GIO gio-2.0)
|
||||||
|
#MESSAGE(STATUS "DEBUG: Gio include directory = ${GIO_INCLUDE_DIRS}")
|
||||||
|
#MESSAGE(STATUS "DEBUG: Gio link directory = ${GIO_LIBRARY_DIRS}")
|
||||||
|
#MESSAGE(STATUS "DEBUG: Gio CFlags = ${GIO_CFLAGS}")
|
||||||
|
SET(GIO_DEFINITIONS ${GIO_CFLAGS_OTHER})
|
||||||
|
ENDIF (NOT WIN32)
|
||||||
|
|
||||||
|
FIND_PATH(GIO_INCLUDE_DIR gio.h
|
||||||
|
PATHS
|
||||||
|
${GIO_INCLUDEDIR}
|
||||||
|
${GIO_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES glib-2.0/gio/
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(_GioLibs NAMES gio-2.0 libgio-2.0
|
||||||
|
PATHS
|
||||||
|
${GIO_LIBDIR}
|
||||||
|
${GIO_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET( GIO_LIBRARIES ${_GioLibs} )
|
||||||
|
SET( GIO_INCLUDE_DIRS ${GIO_INCLUDE_DIR} )
|
||||||
|
|
||||||
|
IF (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
|
||||||
|
SET(GIO_FOUND TRUE)
|
||||||
|
ELSE (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
|
||||||
|
SET(GIO_FOUND FALSE)
|
||||||
|
ENDIF (GIO_INCLUDE_DIR AND GIO_LIBRARIES)
|
||||||
|
|
||||||
|
IF (GIO_FOUND)
|
||||||
|
IF (NOT Gio_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Found Gio libraries: ${GIO_LIBRARIES}")
|
||||||
|
MESSAGE(STATUS "Found Gio includes : ${GIO_INCLUDE_DIR}")
|
||||||
|
ENDIF (NOT Gio_FIND_QUIETLY)
|
||||||
|
ELSE (GIO_FOUND)
|
||||||
|
IF (Gio_FIND_REQUIRED)
|
||||||
|
MESSAGE(STATUS "Could NOT find Gio")
|
||||||
|
ENDIF(Gio_FIND_REQUIRED)
|
||||||
|
ENDIF (GIO_FOUND)
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(GIO_INCLUDE_DIR _GioLibs)
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
# - Try to find Iconv
|
|
||||||
# Once done this will define
|
|
||||||
#
|
|
||||||
# ICONV_FOUND - system has Iconv
|
|
||||||
# ICONV_INCLUDE_DIRS - the Iconv include directory
|
|
||||||
# ICONV_LIBRARIES - Link these to use Iconv
|
|
||||||
# ICONV_DEFINITIONS - Compiler switches required for using Iconv
|
|
||||||
#
|
|
||||||
# Copyright (c) 2013 Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
#
|
|
||||||
# Redistribution and use is allowed according to the terms of the New
|
|
||||||
# BSD license.
|
|
||||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
||||||
#
|
|
||||||
|
|
||||||
include(CheckIncludeFile)
|
|
||||||
include(CheckFunctionExists)
|
|
||||||
include(CheckLibraryExists)
|
|
||||||
include(CheckPrototypeDefinition)
|
|
||||||
|
|
||||||
find_path(ICONV_INCLUDE_DIR
|
|
||||||
NAMES
|
|
||||||
iconv.h sys/iconv.h
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
|
|
||||||
check_include_file(iconv.h HAVE_ICONV_H)
|
|
||||||
check_include_file(sys/iconv.h HAVE_SYS_ICONV_H)
|
|
||||||
set(CMAKE_REQUIRED_INCLUDES)
|
|
||||||
|
|
||||||
find_library(ICONV_LIBRARY
|
|
||||||
NAMES
|
|
||||||
iconv
|
|
||||||
libiconv
|
|
||||||
PATHS
|
|
||||||
)
|
|
||||||
|
|
||||||
if (ICONV_LIBRARY)
|
|
||||||
get_filename_component(_ICONV_NAME ${ICONV_LIBRARY} NAME)
|
|
||||||
get_filename_component(_ICONV_PATH ${ICONV_LIBRARY} PATH)
|
|
||||||
check_library_exists(${_ICONV_NAME} iconv ${_ICONV_PATH} HAVE_ICONV)
|
|
||||||
else()
|
|
||||||
check_function_exists(iconv HAVE_ICONV)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (HAVE_ICONV_H OR HAVE_SYS_ICONV_H)
|
|
||||||
if (HAVE_ICONV_H)
|
|
||||||
set(_ICONV_PROTO_INCLUDE "iconv.h")
|
|
||||||
endif (HAVE_ICONV_H)
|
|
||||||
if (HAVE_SYS_ICONV_H)
|
|
||||||
set(_ICONV_PROTO_INCLUDE "sys/iconv.h")
|
|
||||||
endif (HAVE_SYS_ICONV_H)
|
|
||||||
|
|
||||||
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
|
|
||||||
check_prototype_definition(iconv
|
|
||||||
"size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)"
|
|
||||||
"-1"
|
|
||||||
${_ICONV_PROTO_INCLUDE}
|
|
||||||
HAVE_ICONV_CONST)
|
|
||||||
set(CMAKE_REQUIRED_INCLUDES)
|
|
||||||
endif (HAVE_ICONV_H OR HAVE_SYS_ICONV_H)
|
|
||||||
|
|
||||||
set(ICONV_INCLUDE_DIRS
|
|
||||||
${ICONV_INCLUDE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (ICONV_LIBRARY)
|
|
||||||
set(ICONV_LIBRARIES
|
|
||||||
${ICONV_LIBRARIES}
|
|
||||||
${ICONV_LIBRARY}
|
|
||||||
)
|
|
||||||
endif (ICONV_LIBRARY)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
if (ICONV_LIBRARIES)
|
|
||||||
find_package_handle_standard_args(Iconv DEFAULT_MSG ICONV_LIBRARIES ICONV_INCLUDE_DIRS)
|
|
||||||
else()
|
|
||||||
find_package_handle_standard_args(Iconv DEFAULT_MSG ICONV_INCLUDE_DIRS)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# show the ICONV_INCLUDE_DIRS and ICONV_LIBRARIES variables only in the advanced view
|
|
||||||
mark_as_advanced(ICONV_INCLUDE_DIRS ICONV_LIBRARIES)
|
|
||||||
22
cmake/modules/FindLibcloudproviders.cmake
Normal file
22
cmake/modules/FindLibcloudproviders.cmake
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# FindLibcloudproviders.cmake
|
||||||
|
|
||||||
|
find_path(LIBCLOUDPROVIDERS_INCLUDE_DIR
|
||||||
|
NAMES cloudprovidersproviderexporter.h cloudprovidersaccountexporter.h
|
||||||
|
PATH_SUFFIXES cloudproviders
|
||||||
|
)
|
||||||
|
find_library(LIBCLOUDPROVIDERS_LIBRARY
|
||||||
|
NAMES
|
||||||
|
libcloudproviders
|
||||||
|
cloudproviders
|
||||||
|
HINTS
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib/${CMAKE_ARCH_TRIPLET}
|
||||||
|
/usr/local/lib
|
||||||
|
/opt/local/lib
|
||||||
|
${CMAKE_LIBRARY_PATH}
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
message("================> ${LIBCLOUDPROVIDERS_LIBRARY}")
|
||||||
|
|
||||||
|
find_package_handle_standard_args(LIBCLOUDPROVIDERS DEFAULT_MSG LIBCLOUDPROVIDERS_INCLUDE_DIR LIBCLOUDPROVIDERS_LIBRARY)
|
||||||
@@ -1,306 +0,0 @@
|
|||||||
# - Try to find the OpenSSL encryption library
|
|
||||||
# Once done this will define
|
|
||||||
#
|
|
||||||
# OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
|
|
||||||
#
|
|
||||||
# Read-Only variables:
|
|
||||||
# OPENSSL_FOUND - system has the OpenSSL library
|
|
||||||
# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
|
|
||||||
# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
|
|
||||||
# OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
|
|
||||||
|
|
||||||
#=============================================================================
|
|
||||||
# Copyright 2006-2009 Kitware, Inc.
|
|
||||||
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
|
|
||||||
# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
|
||||||
#
|
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
|
||||||
# see accompanying file Copyright.txt for details.
|
|
||||||
#
|
|
||||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
||||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
# See the License for more information.
|
|
||||||
#=============================================================================
|
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
|
||||||
# License text for the above reference.)
|
|
||||||
|
|
||||||
if (UNIX)
|
|
||||||
find_package(PkgConfig QUIET)
|
|
||||||
pkg_check_modules(_OPENSSL QUIET openssl)
|
|
||||||
endif (UNIX)
|
|
||||||
|
|
||||||
# http://www.slproweb.com/products/Win32OpenSSL.html
|
|
||||||
SET(_OPENSSL_ROOT_HINTS
|
|
||||||
$ENV{OPENSSL_ROOT_DIR}
|
|
||||||
${OPENSSL_ROOT_DIR}
|
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
|
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
|
|
||||||
)
|
|
||||||
SET(_OPENSSL_ROOT_PATHS
|
|
||||||
"$ENV{PROGRAMFILES}/OpenSSL"
|
|
||||||
"$ENV{PROGRAMFILES}/OpenSSL-Win32"
|
|
||||||
"$ENV{PROGRAMFILES}/OpenSSL-Win64"
|
|
||||||
"C:/OpenSSL/"
|
|
||||||
"C:/OpenSSL-Win32/"
|
|
||||||
"C:/OpenSSL-Win64/"
|
|
||||||
)
|
|
||||||
SET(_OPENSSL_ROOT_HINTS_AND_PATHS
|
|
||||||
HINTS ${_OPENSSL_ROOT_HINTS}
|
|
||||||
PATHS ${_OPENSSL_ROOT_PATHS}
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_PATH(OPENSSL_INCLUDE_DIR
|
|
||||||
NAMES
|
|
||||||
openssl/ssl.h
|
|
||||||
HINTS
|
|
||||||
${_OPENSSL_INCLUDEDIR}
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
include
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(WIN32 AND NOT CYGWIN)
|
|
||||||
# MINGW should go here too
|
|
||||||
IF(MSVC)
|
|
||||||
# /MD and /MDd are the standard values - if someone wants to use
|
|
||||||
# others, the libnames have to change here too
|
|
||||||
# use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
|
|
||||||
# TODO: handle /MT and static lib
|
|
||||||
# In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
|
|
||||||
# * MD for dynamic-release
|
|
||||||
# * MDd for dynamic-debug
|
|
||||||
# * MT for static-release
|
|
||||||
# * MTd for static-debug
|
|
||||||
|
|
||||||
# Implementation details:
|
|
||||||
# We are using the libraries located in the VC subdir instead of the parent directory eventhough :
|
|
||||||
# libeay32MD.lib is identical to ../libeay32.lib, and
|
|
||||||
# ssleay32MD.lib is identical to ../ssleay32.lib
|
|
||||||
FIND_LIBRARY(LIB_EAY_DEBUG
|
|
||||||
NAMES
|
|
||||||
libeay32MDd
|
|
||||||
libeay32
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
"lib"
|
|
||||||
"VC"
|
|
||||||
"lib/VC"
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(LIB_EAY_RELEASE
|
|
||||||
NAMES
|
|
||||||
libeay32MD
|
|
||||||
libeay32
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
"lib"
|
|
||||||
"VC"
|
|
||||||
"lib/VC"
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(SSL_EAY_DEBUG
|
|
||||||
NAMES
|
|
||||||
ssleay32MDd
|
|
||||||
ssleay32
|
|
||||||
ssl
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
"lib"
|
|
||||||
"VC"
|
|
||||||
"lib/VC"
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(SSL_EAY_RELEASE
|
|
||||||
NAMES
|
|
||||||
ssleay32MD
|
|
||||||
ssleay32
|
|
||||||
ssl
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
"lib"
|
|
||||||
"VC"
|
|
||||||
"lib/VC"
|
|
||||||
)
|
|
||||||
|
|
||||||
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
|
|
||||||
set( OPENSSL_LIBRARIES
|
|
||||||
optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG}
|
|
||||||
optimized ${LIB_EAY_RELEASE} debug ${LIB_EAY_DEBUG}
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
set( OPENSSL_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} )
|
|
||||||
endif()
|
|
||||||
MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE)
|
|
||||||
MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE)
|
|
||||||
ELSEIF(MINGW)
|
|
||||||
# same player, for MingW
|
|
||||||
FIND_LIBRARY(LIB_EAY
|
|
||||||
NAMES
|
|
||||||
libeay32
|
|
||||||
crypto
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
"lib"
|
|
||||||
"lib/MinGW"
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(SSL_EAY
|
|
||||||
NAMES
|
|
||||||
ssleay32
|
|
||||||
ssl
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
"lib"
|
|
||||||
"lib/MinGW"
|
|
||||||
)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
|
|
||||||
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
|
|
||||||
ELSE(MSVC)
|
|
||||||
# Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
|
|
||||||
FIND_LIBRARY(LIB_EAY
|
|
||||||
NAMES
|
|
||||||
libeay32
|
|
||||||
HINTS
|
|
||||||
${_OPENSSL_LIBDIR}
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
lib
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(SSL_EAY
|
|
||||||
NAMES
|
|
||||||
ssleay32
|
|
||||||
HINTS
|
|
||||||
${_OPENSSL_LIBDIR}
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
lib
|
|
||||||
)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
|
|
||||||
set( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
|
|
||||||
ENDIF(MSVC)
|
|
||||||
ELSE(WIN32 AND NOT CYGWIN)
|
|
||||||
|
|
||||||
FIND_LIBRARY(OPENSSL_SSL_LIBRARY
|
|
||||||
NAMES
|
|
||||||
ssl
|
|
||||||
ssleay32
|
|
||||||
ssleay32MD
|
|
||||||
HINTS
|
|
||||||
${_OPENSSL_LIBDIR}
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
lib
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARY
|
|
||||||
NAMES
|
|
||||||
crypto
|
|
||||||
HINTS
|
|
||||||
${_OPENSSL_LIBDIR}
|
|
||||||
${_OPENSSL_ROOT_HINTS_AND_PATHS}
|
|
||||||
PATH_SUFFIXES
|
|
||||||
lib
|
|
||||||
)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARY OPENSSL_SSL_LIBRARY)
|
|
||||||
|
|
||||||
# compat defines
|
|
||||||
SET(OPENSSL_SSL_LIBRARIES ${OPENSSL_SSL_LIBRARY})
|
|
||||||
SET(OPENSSL_CRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
|
||||||
|
|
||||||
SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
|
|
||||||
|
|
||||||
ENDIF(WIN32 AND NOT CYGWIN)
|
|
||||||
|
|
||||||
function(from_hex HEX DEC)
|
|
||||||
string(TOUPPER "${HEX}" HEX)
|
|
||||||
set(_res 0)
|
|
||||||
string(LENGTH "${HEX}" _strlen)
|
|
||||||
|
|
||||||
while (_strlen GREATER 0)
|
|
||||||
math(EXPR _res "${_res} * 16")
|
|
||||||
string(SUBSTRING "${HEX}" 0 1 NIBBLE)
|
|
||||||
string(SUBSTRING "${HEX}" 1 -1 HEX)
|
|
||||||
if (NIBBLE STREQUAL "A")
|
|
||||||
math(EXPR _res "${_res} + 10")
|
|
||||||
elseif (NIBBLE STREQUAL "B")
|
|
||||||
math(EXPR _res "${_res} + 11")
|
|
||||||
elseif (NIBBLE STREQUAL "C")
|
|
||||||
math(EXPR _res "${_res} + 12")
|
|
||||||
elseif (NIBBLE STREQUAL "D")
|
|
||||||
math(EXPR _res "${_res} + 13")
|
|
||||||
elseif (NIBBLE STREQUAL "E")
|
|
||||||
math(EXPR _res "${_res} + 14")
|
|
||||||
elseif (NIBBLE STREQUAL "F")
|
|
||||||
math(EXPR _res "${_res} + 15")
|
|
||||||
else()
|
|
||||||
math(EXPR _res "${_res} + ${NIBBLE}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
string(LENGTH "${HEX}" _strlen)
|
|
||||||
endwhile()
|
|
||||||
|
|
||||||
set(${DEC} ${_res} PARENT_SCOPE)
|
|
||||||
endfunction(from_hex)
|
|
||||||
|
|
||||||
if (OPENSSL_INCLUDE_DIR)
|
|
||||||
if (_OPENSSL_VERSION)
|
|
||||||
set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
|
|
||||||
elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
|
|
||||||
file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
|
|
||||||
REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
|
|
||||||
|
|
||||||
# The version number is encoded as 0xMNNFFPPS: major minor fix patch status
|
|
||||||
# The status gives if this is a developer or prerelease and is ignored here.
|
|
||||||
# Major, minor, and fix directly translate into the version numbers shown in
|
|
||||||
# the string. The patch field translates to the single character suffix that
|
|
||||||
# indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
|
|
||||||
# on.
|
|
||||||
|
|
||||||
string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F]).*$"
|
|
||||||
"\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
|
|
||||||
list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
|
|
||||||
list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
|
|
||||||
from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
|
|
||||||
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
|
|
||||||
from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
|
|
||||||
list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
|
|
||||||
|
|
||||||
if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
|
|
||||||
from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
|
|
||||||
# 96 is the ASCII code of 'a' minus 1
|
|
||||||
math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
|
|
||||||
unset(_tmp)
|
|
||||||
# Once anyone knows how OpenSSL would call the patch versions beyond 'z'
|
|
||||||
# this should be updated to handle that, too. This has not happened yet
|
|
||||||
# so it is simply ignored here for now.
|
|
||||||
string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
|
|
||||||
endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
|
|
||||||
|
|
||||||
set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
|
|
||||||
endif (_OPENSSL_VERSION)
|
|
||||||
endif (OPENSSL_INCLUDE_DIR)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
|
|
||||||
if (OPENSSL_VERSION)
|
|
||||||
find_package_handle_standard_args(OpenSSL
|
|
||||||
REQUIRED_VARS
|
|
||||||
OPENSSL_LIBRARIES
|
|
||||||
OPENSSL_INCLUDE_DIR
|
|
||||||
VERSION_VAR
|
|
||||||
OPENSSL_VERSION
|
|
||||||
FAIL_MESSAGE
|
|
||||||
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
|
|
||||||
)
|
|
||||||
else (OPENSSL_VERSION)
|
|
||||||
find_package_handle_standard_args(OpenSSL "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
|
|
||||||
OPENSSL_LIBRARIES
|
|
||||||
OPENSSL_INCLUDE_DIR
|
|
||||||
)
|
|
||||||
endif (OPENSSL_VERSION)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
|
|
||||||
117
cmake/modules/FindPng2Ico.cmake
Normal file
117
cmake/modules/FindPng2Ico.cmake
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
#.rst:
|
||||||
|
# FindPng2Ico
|
||||||
|
# -----------
|
||||||
|
#
|
||||||
|
# Try to find png2ico.
|
||||||
|
#
|
||||||
|
# If the png2ico executable is not in your PATH, you can provide
|
||||||
|
# an alternative name or full path location with the ``Png2Ico_EXECUTABLE``
|
||||||
|
# variable.
|
||||||
|
#
|
||||||
|
# This will define the following variables:
|
||||||
|
#
|
||||||
|
# ``Png2Ico_FOUND``
|
||||||
|
# True if png2ico is available.
|
||||||
|
#
|
||||||
|
# ``Png2Ico_EXECUTABLE``
|
||||||
|
# The png2ico executable.
|
||||||
|
#
|
||||||
|
# If ``Png2Ico_FOUND`` is TRUE, it will also define the following imported
|
||||||
|
# target:
|
||||||
|
#
|
||||||
|
# ``Png2Ico::Png2Ico``
|
||||||
|
# The png2ico executable.
|
||||||
|
#
|
||||||
|
# and the following variables:
|
||||||
|
#
|
||||||
|
# ``Png2Ico_HAS_COLORS_ARGUMENT``
|
||||||
|
# Whether png2ico accepts a ``--colors`` argument. `Matthias Benkmann's
|
||||||
|
# tool <http://www.winterdrache.de/freeware/png2ico/>`_ does, while the
|
||||||
|
# version of png2ico from the `"KDE On Windows" (kdewin)
|
||||||
|
# <https://projects.kde.org/projects/kdesupport/kdewin>`_ project does not.
|
||||||
|
#
|
||||||
|
# ``Png2Ico_HAS_RCFILE_ARGUMENT``
|
||||||
|
# Whether png2ico accepts an ``--rcfile`` argument. The version of png2ico
|
||||||
|
# from the `"KDE On Windows" (kdewin)
|
||||||
|
# <https://projects.kde.org/projects/kdesupport/kdewin>`_ project does,
|
||||||
|
# while `Matthias Benkmann's tool
|
||||||
|
# <http://www.winterdrache.de/freeware/png2ico/>`_ does not.
|
||||||
|
#
|
||||||
|
# Since 1.7.0.
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2014 Alex Merry <alex.merry@kde.org>
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions
|
||||||
|
# are met:
|
||||||
|
#
|
||||||
|
# 1. Redistributions of source code must retain the copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# 2. Redistributions in binary form must reproduce the copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer in the
|
||||||
|
# documentation and/or other materials provided with the distribution.
|
||||||
|
# 3. The name of the author may not be used to endorse or promote products
|
||||||
|
# derived from this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
#=============================================================================
|
||||||
|
|
||||||
|
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
|
||||||
|
|
||||||
|
ecm_find_package_version_check(Png2Ico)
|
||||||
|
|
||||||
|
# Find png2ico
|
||||||
|
find_program(Png2Ico_EXECUTABLE NAMES png2ico)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(Png2Ico
|
||||||
|
FOUND_VAR
|
||||||
|
Png2Ico_FOUND
|
||||||
|
REQUIRED_VARS
|
||||||
|
Png2Ico_EXECUTABLE
|
||||||
|
)
|
||||||
|
|
||||||
|
mark_as_advanced(Png2Ico_EXECUTABLE)
|
||||||
|
|
||||||
|
if (Png2Ico_FOUND)
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${Png2Ico_EXECUTABLE}" --help
|
||||||
|
OUTPUT_VARIABLE _png2ico_help_text
|
||||||
|
ERROR_VARIABLE _png2ico_help_text
|
||||||
|
)
|
||||||
|
if (_png2ico_help_text MATCHES ".*--rcfile .*")
|
||||||
|
set(Png2Ico_HAS_RCFILE_ARGUMENT TRUE)
|
||||||
|
else()
|
||||||
|
set(Png2Ico_HAS_RCFILE_ARGUMENT FALSE)
|
||||||
|
endif()
|
||||||
|
if (_png2ico_help_text MATCHES ".*--colors .*")
|
||||||
|
set(Png2Ico_HAS_COLORS_ARGUMENT TRUE)
|
||||||
|
else()
|
||||||
|
set(Png2Ico_HAS_COLORS_ARGUMENT FALSE)
|
||||||
|
endif()
|
||||||
|
unset(_png2ico_help_text)
|
||||||
|
|
||||||
|
if (NOT TARGET Png2Ico::Png2Ico)
|
||||||
|
add_executable(Png2Ico::Png2Ico IMPORTED)
|
||||||
|
set_target_properties(Png2Ico::Png2Ico PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${Png2Ico_EXECUTABLE}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FeatureSummary)
|
||||||
|
set_package_properties(Png2Ico PROPERTIES
|
||||||
|
URL "http://www.winterdrache.de/freeware/png2ico/ or https://projects.kde.org/projects/kdesupport/kdewin"
|
||||||
|
DESCRIPTION "Executable that converts a collection of PNG files into a Windows icon file"
|
||||||
|
)
|
||||||
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
# - MACRO_ADD_PLUGIN(name [WITH_PREFIX] file1 .. fileN)
|
|
||||||
#
|
|
||||||
# Create a plugin from the given source files.
|
|
||||||
# If WITH_PREFIX is given, the resulting plugin will have the
|
|
||||||
# prefix "lib", otherwise it won't.
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
|
|
||||||
# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
|
|
||||||
# Copyright (c) 2006, Andreas Schneider, <asn@cryptomilk.org>
|
|
||||||
#
|
|
||||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
||||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
||||||
|
|
||||||
|
|
||||||
macro (MACRO_ADD_PLUGIN _target_NAME _with_PREFIX)
|
|
||||||
|
|
||||||
if (${_with_PREFIX} STREQUAL "WITH_PREFIX")
|
|
||||||
set(_first_SRC)
|
|
||||||
else (${_with_PREFIX} STREQUAL "WITH_PREFIX")
|
|
||||||
set(_first_SRC ${_with_PREFIX})
|
|
||||||
endif (${_with_PREFIX} STREQUAL "WITH_PREFIX")
|
|
||||||
|
|
||||||
add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
|
|
||||||
|
|
||||||
if (_first_SRC)
|
|
||||||
set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
|
|
||||||
endif (_first_SRC)
|
|
||||||
|
|
||||||
endmacro (MACRO_ADD_PLUGIN _name _sources)
|
|
||||||
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
# (c) 2014 Copyright ownCloud GmbH
|
|
||||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
||||||
# For details see the accompanying COPYING* file.
|
|
||||||
|
|
||||||
# - macro_copy_file(_src _dst)
|
|
||||||
# Copies a file to ${_dst} only if ${_src} is different (newer) than ${_dst}
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
# macro_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/icon.png ${CMAKE_CURRENT_BINARY_DIR}/.)
|
|
||||||
# Copies file icon.png to ${CMAKE_CURRENT_BINARY_DIR} directory
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006-2007 Wengo
|
|
||||||
# Copyright (c) 2006-2008 Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
#
|
|
||||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
||||||
# For details see the accompanying COPYING file.
|
|
||||||
|
|
||||||
|
|
||||||
macro (macro_copy_file _src _dst)
|
|
||||||
# Removes all path containing .svn or CVS or CMakeLists.txt during the copy
|
|
||||||
if (NOT ${_src} MATCHES ".*\\.svn|CVS|CMakeLists\\.txt.*")
|
|
||||||
|
|
||||||
if (CMAKE_VERBOSE_MAKEFILE)
|
|
||||||
message(STATUS "Copy file from ${_src} to ${_dst}")
|
|
||||||
endif (CMAKE_VERBOSE_MAKEFILE)
|
|
||||||
|
|
||||||
# Creates directory if necessary
|
|
||||||
get_filename_component(_path ${_dst} PATH)
|
|
||||||
file(MAKE_DIRECTORY ${_path})
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND
|
|
||||||
${CMAKE_COMMAND} -E copy_if_different ${_src} ${_dst}
|
|
||||||
OUTPUT_QUIET
|
|
||||||
)
|
|
||||||
endif (NOT ${_src} MATCHES ".*\\.svn|CVS|CMakeLists\\.txt.*")
|
|
||||||
endmacro (macro_copy_file)
|
|
||||||
@@ -461,6 +461,7 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
|
|||||||
File "${MING_BIN}\libgcc_s_sjlj-1.dll"
|
File "${MING_BIN}\libgcc_s_sjlj-1.dll"
|
||||||
File "${MING_BIN}\libstdc++-6.dll"
|
File "${MING_BIN}\libstdc++-6.dll"
|
||||||
File "${MING_BIN}\libwinpthread-1.dll"
|
File "${MING_BIN}\libwinpthread-1.dll"
|
||||||
|
File "${MING_BIN}\libssp-0.dll"
|
||||||
|
|
||||||
;CSync configs
|
;CSync configs
|
||||||
File "${SOURCE_PATH}/sync-exclude.lst"
|
File "${SOURCE_PATH}/sync-exclude.lst"
|
||||||
@@ -603,6 +604,35 @@ Section Uninstall
|
|||||||
Abort $UNINSTALL_ABORT
|
Abort $UNINSTALL_ABORT
|
||||||
owncloud_installed:
|
owncloud_installed:
|
||||||
|
|
||||||
|
; Delete Navigation Pane entries added for Windows 10.
|
||||||
|
; On 64bit Windows, the client will be writing to the 64bit registry.
|
||||||
|
${If} ${RunningX64}
|
||||||
|
SetRegView 64
|
||||||
|
${EndIf}
|
||||||
|
StrCpy $0 0
|
||||||
|
loop:
|
||||||
|
; Look at every registered explorer namespace for HKCU and check if it was added by our application
|
||||||
|
; (we write to a custom "ApplicationName" value there).
|
||||||
|
EnumRegKey $1 HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace" $0
|
||||||
|
StrCmp $1 "" done
|
||||||
|
|
||||||
|
ReadRegStr $R0 HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\$1" "ApplicationName"
|
||||||
|
StrCmp $R0 "${APPLICATION_NAME}" deleteClsid
|
||||||
|
; Increment the index when not deleting the enumerated key.
|
||||||
|
IntOp $0 $0 + 1
|
||||||
|
goto loop
|
||||||
|
|
||||||
|
deleteClsid:
|
||||||
|
DetailPrint "Removing Navigation Pane CLSID $1"
|
||||||
|
; Should match FolderMan::updateCloudStorageRegistry
|
||||||
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\$1"
|
||||||
|
DeleteRegKey HKCU "Software\Classes\CLSID\$1"
|
||||||
|
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" $1
|
||||||
|
goto loop
|
||||||
|
done:
|
||||||
|
; Go back to the 32bit registry.
|
||||||
|
SetRegView lastused
|
||||||
|
|
||||||
;Delete registry keys.
|
;Delete registry keys.
|
||||||
DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionBuild"
|
DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionBuild"
|
||||||
DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionMajor"
|
DeleteRegValue HKLM "Software\${APPLICATION_VENDOR}\${APPLICATION_NAME}" "VersionMajor"
|
||||||
|
|||||||
@@ -1,197 +0,0 @@
|
|||||||
# (c) 2014 Copyright ownCloud GmbH
|
|
||||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
||||||
# For details see the accompanying COPYING* file.
|
|
||||||
|
|
||||||
include (MacroOptionalFindPackage)
|
|
||||||
include (MacroLogFeature)
|
|
||||||
|
|
||||||
option(BUILD_WITH_QT4 "Build with Qt4 no matter if Qt5 was found" OFF)
|
|
||||||
|
|
||||||
if( BUILD_WITH_QT4 )
|
|
||||||
message(STATUS "Search for Qt5 was disabled by option BUILD_WITH_QT4")
|
|
||||||
else( BUILD_WITH_QT4 )
|
|
||||||
find_package(Qt5Core QUIET)
|
|
||||||
endif( BUILD_WITH_QT4 )
|
|
||||||
|
|
||||||
if( Qt5Core_FOUND )
|
|
||||||
message(STATUS "Found Qt5 core, checking for further dependencies...")
|
|
||||||
find_package(Qt5Network REQUIRED)
|
|
||||||
find_package(Qt5Xml REQUIRED)
|
|
||||||
find_package(Qt5Concurrent REQUIRED)
|
|
||||||
if(UNIT_TESTING)
|
|
||||||
find_package(Qt5Test REQUIRED)
|
|
||||||
endif()
|
|
||||||
if(NOT TOKEN_AUTH_ONLY)
|
|
||||||
find_package(Qt5Widgets REQUIRED)
|
|
||||||
if(APPLE)
|
|
||||||
find_package(Qt5MacExtras REQUIRED)
|
|
||||||
endif(APPLE)
|
|
||||||
|
|
||||||
if(NOT NO_SHIBBOLETH)
|
|
||||||
find_package(Qt5WebKitWidgets)
|
|
||||||
find_package(Qt5WebKit)
|
|
||||||
if(NOT Qt5WebKitWidgets_FOUND)
|
|
||||||
message(FATAL_ERROR "Qt5WebKit required for Shibboleth. Use -DNO_SHIBBOLETH=1 to disable it.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
else( Qt5Core_FOUND )
|
|
||||||
if(WIN32 OR APPLE)
|
|
||||||
if (NOT BUILD_WITH_QT4)
|
|
||||||
message(FATAL_ERROR "Qt 5 not found, but application depends on Qt5 on Windows and Mac OS X")
|
|
||||||
endif ()
|
|
||||||
endif(WIN32 OR APPLE)
|
|
||||||
endif( Qt5Core_FOUND )
|
|
||||||
|
|
||||||
|
|
||||||
if( Qt5Core_FOUND )
|
|
||||||
message(STATUS "Using Qt 5!")
|
|
||||||
|
|
||||||
# We need this to find the paths to qdbusxml2cpp and co
|
|
||||||
if (WITH_DBUS)
|
|
||||||
find_package(Qt5DBus REQUIRED)
|
|
||||||
include_directories(${Qt5DBus_INCLUDES})
|
|
||||||
add_definitions(${Qt5DBus_DEFINITIONS})
|
|
||||||
endif (WITH_DBUS)
|
|
||||||
include_directories(${Qt5Core_INCLUDES})
|
|
||||||
add_definitions(${Qt5Core_DEFINITIONS})
|
|
||||||
if (NOT WIN32) #implied on Win32
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
|
||||||
endif(NOT WIN32)
|
|
||||||
# set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
|
||||||
|
|
||||||
if(APPLE AND NOT TOKEN_AUTH_ONLY)
|
|
||||||
include_directories(${Qt5MacExtras_INCLUDE_DIRS})
|
|
||||||
add_definitions(${Qt5MacExtras_DEFINITIONS})
|
|
||||||
set (QT_LIBRARIES ${QT_LIBRARIES} ${Qt5MacExtras_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT BUILD_LIBRARIES_ONLY)
|
|
||||||
macro(qt_wrap_ui)
|
|
||||||
qt5_wrap_ui(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
else()
|
|
||||||
# hack
|
|
||||||
SET(QT_UIC_EXECUTABLE "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
macro(qt_add_resources)
|
|
||||||
qt5_add_resources(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
if(NOT TOKEN_AUTH_ONLY)
|
|
||||||
find_package(Qt5LinguistTools)
|
|
||||||
if(Qt5LinguistTools_FOUND)
|
|
||||||
macro(qt_add_translation)
|
|
||||||
qt5_add_translation(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
else()
|
|
||||||
macro(qt_add_translation)
|
|
||||||
endmacro()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
macro(qt_add_translation)
|
|
||||||
endmacro()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
macro(qt_add_dbus_interface)
|
|
||||||
qt5_add_dbus_interface(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt_add_dbus_adaptor)
|
|
||||||
qt5_add_dbus_adaptor(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt_wrap_cpp)
|
|
||||||
qt5_wrap_cpp(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(install_qt_executable)
|
|
||||||
install_qt5_executable(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(setup_qt)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
|
|
||||||
|
|
||||||
#Enable deprecated symbols
|
|
||||||
add_definitions("-DQT_DISABLE_DEPRECATED_BEFORE=0")
|
|
||||||
|
|
||||||
add_definitions("-DQT_USE_QSTRINGBUILDER") #optimize string concatenation
|
|
||||||
add_definitions("-DQT_MESSAGELOGCONTEXT") #enable function name and line number in debug output
|
|
||||||
endif( Qt5Core_FOUND )
|
|
||||||
|
|
||||||
if(NOT Qt5Core_FOUND)
|
|
||||||
message(STATUS "Could not find Qt5, searching for Qt4 instead...")
|
|
||||||
|
|
||||||
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork" "QtGui" "QtWebkit")
|
|
||||||
if( BUILD_TESTS )
|
|
||||||
list(APPEND NEEDED_QT4_COMPONENTS "QtTest")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS} )
|
|
||||||
macro_log_feature(QT4_FOUND "Qt" "A cross-platform application and UI framework" "http://www.qt-project.org" TRUE "" "If you see this, although libqt4-devel is installed, check whether the \n qtwebkit-devel package and whatever contains QtUiTools is installed too")
|
|
||||||
|
|
||||||
macro(qt5_use_modules)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt_wrap_ui)
|
|
||||||
qt4_wrap_ui(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt_add_resources)
|
|
||||||
qt4_add_resources(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt_add_translation)
|
|
||||||
qt4_add_translation(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt_add_dbus_interface)
|
|
||||||
qt4_add_dbus_interface(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt_add_dbus_adaptor)
|
|
||||||
qt4_add_dbus_adaptor(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(qt_wrap_cpp)
|
|
||||||
qt4_wrap_cpp(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(install_qt_executable)
|
|
||||||
install_qt4_executable(${ARGN})
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
macro(setup_qt)
|
|
||||||
set(QT_USE_QTGUI TRUE)
|
|
||||||
set(QT_USE_QTSQL TRUE)
|
|
||||||
set(QT_USE_QTNETWORK TRUE)
|
|
||||||
set(QT_USE_QTXML TRUE)
|
|
||||||
set(QT_USE_QTWEBKIT TRUE)
|
|
||||||
set(QT_USE_QTDBUS TRUE)
|
|
||||||
|
|
||||||
include( ${QT_USE_FILE} )
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCC)
|
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
|
||||||
OUTPUT_VARIABLE GCC_VERSION)
|
|
||||||
if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
|
|
||||||
add_definitions("-DQ_DECL_OVERRIDE=override")
|
|
||||||
else()
|
|
||||||
add_definitions("-DQ_DECL_OVERRIDE=")
|
|
||||||
endif()
|
|
||||||
else() #clang or others
|
|
||||||
add_definitions("-DQ_DECL_OVERRIDE=override")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( Qt5Core_DIR )
|
|
||||||
set( HAVE_QT5 TRUE )
|
|
||||||
else( Qt5Core_DIR )
|
|
||||||
set( HAVE_QT5 FALSE )
|
|
||||||
endif( Qt5Core_DIR )
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
# - macro_asciidoc2man(inputfile outputfile)
|
|
||||||
#
|
|
||||||
# Create a manpage with asciidoc.
|
|
||||||
# Example: macro_asciidoc2man(foo.txt foo.1)
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006, Andreas Schneider, <asn@cryptomilk.org>
|
|
||||||
#
|
|
||||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
||||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
||||||
|
|
||||||
include(MacroCopyFile)
|
|
||||||
|
|
||||||
macro(MACRO_ASCIIDOC2MAN _a2m_input _a2m_output)
|
|
||||||
find_program(A2X
|
|
||||||
NAMES
|
|
||||||
a2x
|
|
||||||
)
|
|
||||||
#message("+++ A2X: ${A2X}")
|
|
||||||
|
|
||||||
if (A2X)
|
|
||||||
|
|
||||||
#message("+++ ${A2X} --doctype=manpage --format=manpage --destination-dir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${_a2m_input}")
|
|
||||||
macro_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_a2m_input} ${CMAKE_CURRENT_BINARY_DIR}/${_a2m_input})
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND
|
|
||||||
${A2X} --doctype=manpage --format=manpage ${_a2m_input}
|
|
||||||
WORKING_DIRECTORY
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
RESULT_VARIABLE
|
|
||||||
A2M_MAN_GENERATED
|
|
||||||
ERROR_QUIET
|
|
||||||
)
|
|
||||||
|
|
||||||
#message("+++ A2M_MAN_GENERATED: ${A2M_MAN_GENERATED}")
|
|
||||||
if (A2M_MAN_GENERATED EQUAL 0)
|
|
||||||
find_file(A2M_MAN_FILE
|
|
||||||
NAME
|
|
||||||
${_a2m_output}
|
|
||||||
PATHS
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
if (A2M_MAN_FILE)
|
|
||||||
get_filename_component(A2M_MAN_CATEGORY ${A2M_MAN_FILE} EXT)
|
|
||||||
string(SUBSTRING ${A2M_MAN_CATEGORY} 1 1 A2M_MAN_CATEGORY)
|
|
||||||
install(
|
|
||||||
FILES
|
|
||||||
${A2M_MAN_FILE}
|
|
||||||
DESTINATION
|
|
||||||
${MAN_INSTALL_DIR}/man${A2M_MAN_CATEGORY}
|
|
||||||
)
|
|
||||||
endif (A2M_MAN_FILE)
|
|
||||||
endif (A2M_MAN_GENERATED EQUAL 0)
|
|
||||||
|
|
||||||
endif (A2X)
|
|
||||||
endmacro(MACRO_ASCIIDOC2MAN _a2m_input _a2m_file)
|
|
||||||
@@ -3,8 +3,12 @@
|
|||||||
# For details see the accompanying COPYING* file.
|
# For details see the accompanying COPYING* file.
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long -Wno-gnu-zero-variadic-macro-arguments")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
||||||
|
# Fix sqlite compilation on macOS
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types-discards-qualifiers")
|
||||||
|
# Fix sqlite compilation on MinGW
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-discarded-qualifiers")
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
||||||
|
|||||||
@@ -17,12 +17,13 @@
|
|||||||
#cmakedefine APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@"
|
#cmakedefine APPLICATION_SHORTNAME "@APPLICATION_SHORTNAME@"
|
||||||
#cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@"
|
#cmakedefine APPLICATION_EXECUTABLE "@APPLICATION_EXECUTABLE@"
|
||||||
#cmakedefine APPLICATION_UPDATE_URL "@APPLICATION_UPDATE_URL@"
|
#cmakedefine APPLICATION_UPDATE_URL "@APPLICATION_UPDATE_URL@"
|
||||||
|
#cmakedefine APPLICATION_ICON_NAME "@APPLICATION_ICON_NAME@"
|
||||||
|
|
||||||
#cmakedefine ZLIB_FOUND @ZLIB_FOUND@
|
#cmakedefine ZLIB_FOUND @ZLIB_FOUND@
|
||||||
|
|
||||||
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
|
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
|
||||||
#cmakedefine SHAREDIR "@SHAREDIR@"
|
#cmakedefine SHAREDIR "@SHAREDIR@"
|
||||||
|
|
||||||
#cmakedefine WITH_UNIT_TESTING 1
|
#cmakedefine WITH_TESTING 1
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
# global needed variables
|
|
||||||
set(APPLICATION_NAME "ocsync")
|
|
||||||
|
|
||||||
set(LIBRARY_VERSION ${MIRALL_VERSION})
|
|
||||||
set(LIBRARY_SOVERSION "0")
|
|
||||||
|
|
||||||
# add definitions
|
|
||||||
include(DefineCMakeDefaults)
|
|
||||||
include(DefinePlatformDefaults)
|
|
||||||
include(DefineCompilerFlags)
|
|
||||||
include(DefineOptions.cmake)
|
|
||||||
|
|
||||||
include(DefineInstallationPaths)
|
|
||||||
|
|
||||||
# add macros
|
|
||||||
include(MacroAddPlugin)
|
|
||||||
include(MacroCopyFile)
|
|
||||||
|
|
||||||
if (NOT WIN32)
|
|
||||||
find_package(Iconv)
|
|
||||||
endif (NOT WIN32)
|
|
||||||
|
|
||||||
find_package(SQLite3 3.8.0 REQUIRED)
|
|
||||||
|
|
||||||
include(ConfigureChecks.cmake)
|
|
||||||
|
|
||||||
|
|
||||||
set(SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
|
||||||
|
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
|
|
||||||
macro_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake)
|
|
||||||
|
|
||||||
if (MEM_NULL_TESTS)
|
|
||||||
add_definitions(-DCSYNC_MEM_NULL_TESTS)
|
|
||||||
endif (MEM_NULL_TESTS)
|
|
||||||
|
|
||||||
add_subdirectory(src)
|
|
||||||
|
|
||||||
if (UNIT_TESTING)
|
|
||||||
set(WITH_TESTING ON)
|
|
||||||
|
|
||||||
find_package(CMocka)
|
|
||||||
if (CMOCKA_FOUND)
|
|
||||||
include(AddCMockaTest)
|
|
||||||
add_subdirectory(tests)
|
|
||||||
endif (CMOCKA_FOUND)
|
|
||||||
endif (UNIT_TESTING)
|
|
||||||
|
|
||||||
configure_file(config_csync.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_csync.h)
|
|
||||||
configure_file(config_test.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_test.h)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
set(UPDATE_TYPE "true")
|
|
||||||
|
|
||||||
set(MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/tests/valgrind-csync.supp)
|
|
||||||
|
|
||||||
set(CTEST_PROJECT_NAME "csync")
|
|
||||||
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
|
|
||||||
|
|
||||||
set(CTEST_DROP_METHOD "http")
|
|
||||||
set(CTEST_DROP_SITE "mock.cryptomilk.org")
|
|
||||||
set(CTEST_DROP_LOCATION "/submit.php?project=${CTEST_PROJECT_NAME}")
|
|
||||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
set(CTEST_CUSTOM_MEMCHECK_IGNORE
|
|
||||||
${CTEST_CUSTOM_MEMCHECK_IGNORE}
|
|
||||||
check_std_c_jhash
|
|
||||||
)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
/* mind to have trailing slashes! */
|
|
||||||
|
|
||||||
#define TESTFILES_DIR "@SOURCE_DIR@/csync/tests/ownCloud/testfiles/"
|
|
||||||
|
|
||||||
#define TEST_CONFIG_DIR "@SOURCE_DIR@/csync/tests/ownCloud/"
|
|
||||||
|
|
||||||
@@ -1,144 +0,0 @@
|
|||||||
project(libcsync)
|
|
||||||
|
|
||||||
add_subdirectory(std)
|
|
||||||
|
|
||||||
# Statically include sqlite
|
|
||||||
|
|
||||||
set(CSYNC_PUBLIC_INCLUDE_DIRS
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
${CMAKE_SOURCE_DIR}
|
|
||||||
CACHE INTERNAL "csync public include directories"
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CSYNC_PRIVATE_INCLUDE_DIRS
|
|
||||||
${SQLITE3_INCLUDE_DIRS}
|
|
||||||
${CSTDLIB_PUBLIC_INCLUDE_DIRS}
|
|
||||||
${CMAKE_BINARY_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CSYNC_LIBRARY
|
|
||||||
ocsync
|
|
||||||
CACHE INTERNAL "ocsync library"
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CSYNC_LINK_LIBRARIES
|
|
||||||
${CSTDLIB_LIBRARY}
|
|
||||||
${CSYNC_REQUIRED_LIBRARIES}
|
|
||||||
${SQLITE3_LIBRARIES}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(HAVE_ICONV AND WITH_ICONV)
|
|
||||||
list(APPEND CSYNC_PRIVATE_INCLUDE_DIRS ${ICONV_INCLUDE_DIR})
|
|
||||||
list(APPEND CSYNC_LINK_LIBRARIES ${ICONV_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Specific option for builds tied to servers that do not support renaming extensions
|
|
||||||
set(NO_RENAME_EXTENSION 0 CACHE BOOL "Do not issue rename if the extension changes")
|
|
||||||
if(NO_RENAME_EXTENSION)
|
|
||||||
add_definitions(-DNO_RENAME_EXTENSION)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(csync_SRCS
|
|
||||||
csync.c
|
|
||||||
csync_exclude.c
|
|
||||||
csync_log.c
|
|
||||||
csync_statedb.c
|
|
||||||
csync_time.c
|
|
||||||
csync_util.c
|
|
||||||
csync_misc.c
|
|
||||||
|
|
||||||
csync_update.c
|
|
||||||
csync_reconcile.c
|
|
||||||
|
|
||||||
csync_rename.cc
|
|
||||||
|
|
||||||
vio/csync_vio.c
|
|
||||||
vio/csync_vio_file_stat.c
|
|
||||||
)
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
list(APPEND csync_SRCS
|
|
||||||
vio/csync_vio_local_win.c
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
list(APPEND csync_SRCS
|
|
||||||
vio/csync_vio_local_unix.c
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
configure_file(csync_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/csync_version.h)
|
|
||||||
|
|
||||||
set(csync_HDRS
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/csync_version.h
|
|
||||||
csync.h
|
|
||||||
vio/csync_vio.h
|
|
||||||
vio/csync_vio_method.h
|
|
||||||
vio/csync_vio_module.h
|
|
||||||
)
|
|
||||||
|
|
||||||
# Statically include sqlite
|
|
||||||
if (USE_OUR_OWN_SQLITE3)
|
|
||||||
list(APPEND csync_SRCS ${SQLITE3_SOURCE})
|
|
||||||
if (WIN32)
|
|
||||||
# We want to export sqlite symbols from the ocsync DLL without
|
|
||||||
# having to patch both sqlite3.h and the amalgation sqlite3.c,
|
|
||||||
# so do the import/export magic manually through the build system.
|
|
||||||
remove_definitions(-DSQLITE_API=__declspec\(dllimport\))
|
|
||||||
add_definitions(-DSQLITE_API=__declspec\(dllexport\))
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include_directories(
|
|
||||||
${CSYNC_PUBLIC_INCLUDE_DIRS}
|
|
||||||
${CSYNC_PRIVATE_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(${CSYNC_LIBRARY} SHARED ${csync_SRCS})
|
|
||||||
#add_library(${CSYNC_LIBRARY}_static STATIC ${csync_SRCS})
|
|
||||||
|
|
||||||
generate_export_header( ${CSYNC_LIBRARY}
|
|
||||||
BASE_NAME ${CSYNC_LIBRARY}
|
|
||||||
EXPORT_MACRO_NAME OCSYNC_EXPORT
|
|
||||||
EXPORT_FILE_NAME ocsynclib.h
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(${CSYNC_LIBRARY} ${CSYNC_LINK_LIBRARIES})
|
|
||||||
#target_link_libraries(${CSYNC_LIBRARY}_static ${CSYNC_LINK_LIBRARIES})
|
|
||||||
|
|
||||||
set_target_properties(
|
|
||||||
${CSYNC_LIBRARY}
|
|
||||||
PROPERTIES
|
|
||||||
VERSION
|
|
||||||
${LIBRARY_VERSION}
|
|
||||||
SOVERSION
|
|
||||||
${LIBRARY_SOVERSION}
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY
|
|
||||||
${BIN_OUTPUT_DIRECTORY}
|
|
||||||
)
|
|
||||||
if(BUILD_OWNCLOUD_OSX_BUNDLE)
|
|
||||||
INSTALL(
|
|
||||||
TARGETS
|
|
||||||
${CSYNC_LIBRARY}
|
|
||||||
LIBRARY DESTINATION
|
|
||||||
${LIB_INSTALL_DIR}
|
|
||||||
ARCHIVE DESTINATION
|
|
||||||
${LIB_INSTALL_DIR}
|
|
||||||
RUNTIME DESTINATION
|
|
||||||
${BIN_INSTALL_DIR}
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
INSTALL(
|
|
||||||
TARGETS
|
|
||||||
${CSYNC_LIBRARY}
|
|
||||||
LIBRARY DESTINATION
|
|
||||||
${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}
|
|
||||||
ARCHIVE DESTINATION
|
|
||||||
${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE}
|
|
||||||
RUNTIME DESTINATION
|
|
||||||
${BIN_INSTALL_DIR}/${APPLICATION_EXECUTABLE}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,676 +0,0 @@
|
|||||||
/*
|
|
||||||
* libcsync -- a library to sync a directory with another
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config_csync.h"
|
|
||||||
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
#define _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_ICONV_H
|
|
||||||
#include <iconv.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_ICONV_H
|
|
||||||
#include <sys/iconv.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "c_lib.h"
|
|
||||||
#include "csync_private.h"
|
|
||||||
#include "csync_exclude.h"
|
|
||||||
#include "csync_statedb.h"
|
|
||||||
#include "csync_time.h"
|
|
||||||
#include "csync_util.h"
|
|
||||||
#include "csync_misc.h"
|
|
||||||
#include "std/c_private.h"
|
|
||||||
|
|
||||||
#include "csync_update.h"
|
|
||||||
#include "csync_reconcile.h"
|
|
||||||
|
|
||||||
#include "vio/csync_vio.h"
|
|
||||||
|
|
||||||
#include "csync_log.h"
|
|
||||||
#include "csync_rename.h"
|
|
||||||
#include "c_jhash.h"
|
|
||||||
|
|
||||||
static int _key_cmp(const void *key, const void *data) {
|
|
||||||
uint64_t a;
|
|
||||||
csync_file_stat_t *b;
|
|
||||||
|
|
||||||
a = *(uint64_t *) (key);
|
|
||||||
b = (csync_file_stat_t *) data;
|
|
||||||
|
|
||||||
if (a < b->phash) {
|
|
||||||
return -1;
|
|
||||||
} else if (a > b->phash) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _data_cmp(const void *key, const void *data) {
|
|
||||||
csync_file_stat_t *a, *b;
|
|
||||||
|
|
||||||
a = (csync_file_stat_t *) key;
|
|
||||||
b = (csync_file_stat_t *) data;
|
|
||||||
|
|
||||||
if (a->phash < b->phash) {
|
|
||||||
return -1;
|
|
||||||
} else if (a->phash > b->phash) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void csync_create(CSYNC **csync, const char *local) {
|
|
||||||
CSYNC *ctx;
|
|
||||||
size_t len = 0;
|
|
||||||
|
|
||||||
ctx = c_malloc(sizeof(CSYNC));
|
|
||||||
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
|
|
||||||
/* remove trailing slashes */
|
|
||||||
len = strlen(local);
|
|
||||||
while(len > 0 && local[len - 1] == '/') --len;
|
|
||||||
|
|
||||||
ctx->local.uri = c_strndup(local, len);
|
|
||||||
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
|
|
||||||
ctx->current_fs = NULL;
|
|
||||||
|
|
||||||
ctx->abort = false;
|
|
||||||
|
|
||||||
ctx->ignore_hidden_files = true;
|
|
||||||
|
|
||||||
*csync = ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
void csync_init(CSYNC *ctx, const char *db_file) {
|
|
||||||
assert(ctx);
|
|
||||||
/* Do not initialize twice */
|
|
||||||
|
|
||||||
assert(!(ctx->status & CSYNC_STATUS_INIT));
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
|
|
||||||
ctx->local.type = LOCAL_REPLICA;
|
|
||||||
|
|
||||||
ctx->remote.type = REMOTE_REPLICA;
|
|
||||||
|
|
||||||
SAFE_FREE(ctx->statedb.file);
|
|
||||||
ctx->statedb.file = c_strdup(db_file);
|
|
||||||
|
|
||||||
c_rbtree_create(&ctx->local.tree, _key_cmp, _data_cmp);
|
|
||||||
c_rbtree_create(&ctx->remote.tree, _key_cmp, _data_cmp);
|
|
||||||
|
|
||||||
ctx->remote.root_perms = 0;
|
|
||||||
|
|
||||||
ctx->status = CSYNC_STATUS_INIT;
|
|
||||||
|
|
||||||
/* initialize random generator */
|
|
||||||
srand(time(NULL));
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_update(CSYNC *ctx) {
|
|
||||||
int rc = -1;
|
|
||||||
struct timespec start, finish;
|
|
||||||
|
|
||||||
if (ctx == NULL) {
|
|
||||||
errno = EBADF;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
|
|
||||||
/* Path of database file is set in csync_init */
|
|
||||||
if (csync_statedb_load(ctx, ctx->statedb.file, &ctx->statedb.db) < 0) {
|
|
||||||
rc = -1;
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
|
|
||||||
csync_memstat_check();
|
|
||||||
|
|
||||||
if (!ctx->excludes) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "No exclude file loaded or defined!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* update detection for local replica */
|
|
||||||
csync_gettime(&start);
|
|
||||||
ctx->current = LOCAL_REPLICA;
|
|
||||||
ctx->replica = ctx->local.type;
|
|
||||||
|
|
||||||
rc = csync_ftw(ctx, ctx->local.uri, csync_walker, MAX_DEPTH);
|
|
||||||
if (rc < 0) {
|
|
||||||
if(ctx->status_code == CSYNC_STATUS_OK) {
|
|
||||||
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_UPDATE_ERROR);
|
|
||||||
}
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
csync_gettime(&finish);
|
|
||||||
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
|
||||||
"Update detection for local replica took %.2f seconds walking %zu files.",
|
|
||||||
c_secdiff(finish, start), c_rbtree_size(ctx->local.tree));
|
|
||||||
csync_memstat_check();
|
|
||||||
|
|
||||||
/* update detection for remote replica */
|
|
||||||
csync_gettime(&start);
|
|
||||||
ctx->current = REMOTE_REPLICA;
|
|
||||||
ctx->replica = ctx->remote.type;
|
|
||||||
|
|
||||||
rc = csync_ftw(ctx, "", csync_walker, MAX_DEPTH);
|
|
||||||
if (rc < 0) {
|
|
||||||
if(ctx->status_code == CSYNC_STATUS_OK) {
|
|
||||||
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_UPDATE_ERROR);
|
|
||||||
}
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
csync_gettime(&finish);
|
|
||||||
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
|
||||||
"Update detection for remote replica took %.2f seconds "
|
|
||||||
"walking %zu files.",
|
|
||||||
c_secdiff(finish, start), c_rbtree_size(ctx->remote.tree));
|
|
||||||
csync_memstat_check();
|
|
||||||
|
|
||||||
ctx->status |= CSYNC_STATUS_UPDATE;
|
|
||||||
|
|
||||||
rc = 0;
|
|
||||||
|
|
||||||
out:
|
|
||||||
csync_statedb_close(ctx);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_reconcile(CSYNC *ctx) {
|
|
||||||
int rc = -1;
|
|
||||||
struct timespec start, finish;
|
|
||||||
|
|
||||||
if (ctx == NULL) {
|
|
||||||
errno = EBADF;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
|
|
||||||
/* Reconciliation for local replica */
|
|
||||||
csync_gettime(&start);
|
|
||||||
|
|
||||||
if (csync_statedb_load(ctx, ctx->statedb.file, &ctx->statedb.db) < 0) {
|
|
||||||
rc = -1;
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->current = LOCAL_REPLICA;
|
|
||||||
ctx->replica = ctx->local.type;
|
|
||||||
|
|
||||||
rc = csync_reconcile_updates(ctx);
|
|
||||||
|
|
||||||
csync_gettime(&finish);
|
|
||||||
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
|
||||||
"Reconciliation for local replica took %.2f seconds visiting %zu files.",
|
|
||||||
c_secdiff(finish, start), c_rbtree_size(ctx->local.tree));
|
|
||||||
|
|
||||||
if (rc < 0) {
|
|
||||||
if (!CSYNC_STATUS_IS_OK(ctx->status_code)) {
|
|
||||||
ctx->status_code = csync_errno_to_status( errno, CSYNC_STATUS_RECONCILE_ERROR );
|
|
||||||
}
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Reconciliation for remote replica */
|
|
||||||
csync_gettime(&start);
|
|
||||||
|
|
||||||
ctx->current = REMOTE_REPLICA;
|
|
||||||
ctx->replica = ctx->remote.type;
|
|
||||||
|
|
||||||
rc = csync_reconcile_updates(ctx);
|
|
||||||
|
|
||||||
csync_gettime(&finish);
|
|
||||||
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
|
||||||
"Reconciliation for remote replica took %.2f seconds visiting %zu files.",
|
|
||||||
c_secdiff(finish, start), c_rbtree_size(ctx->remote.tree));
|
|
||||||
|
|
||||||
if (rc < 0) {
|
|
||||||
if (!CSYNC_STATUS_IS_OK(ctx->status_code)) {
|
|
||||||
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_RECONCILE_ERROR );
|
|
||||||
}
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->status |= CSYNC_STATUS_RECONCILE;
|
|
||||||
|
|
||||||
rc = 0;
|
|
||||||
|
|
||||||
out:
|
|
||||||
csync_statedb_close(ctx);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* local visitor which calls the user visitor with repacked stat info.
|
|
||||||
*/
|
|
||||||
static int _csync_treewalk_visitor(void *obj, void *data) {
|
|
||||||
int rc = 0;
|
|
||||||
csync_file_stat_t *cur = NULL;
|
|
||||||
CSYNC *ctx = NULL;
|
|
||||||
c_rbtree_visit_func *visitor = NULL;
|
|
||||||
_csync_treewalk_context *twctx = NULL;
|
|
||||||
TREE_WALK_FILE trav;
|
|
||||||
c_rbtree_t *other_tree = NULL;
|
|
||||||
c_rbnode_t *other_node = NULL;
|
|
||||||
|
|
||||||
cur = (csync_file_stat_t *) obj;
|
|
||||||
ctx = (CSYNC *) data;
|
|
||||||
|
|
||||||
if (ctx == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* we need the opposite tree! */
|
|
||||||
switch (ctx->current) {
|
|
||||||
case LOCAL_REPLICA:
|
|
||||||
other_tree = ctx->remote.tree;
|
|
||||||
break;
|
|
||||||
case REMOTE_REPLICA:
|
|
||||||
other_tree = ctx->local.tree;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
other_node = c_rbtree_find(other_tree, &cur->phash);
|
|
||||||
|
|
||||||
if (!other_node) {
|
|
||||||
/* Check the renamed path as well. */
|
|
||||||
int len;
|
|
||||||
uint64_t h = 0;
|
|
||||||
char *renamed_path = csync_rename_adjust_path(ctx, cur->path);
|
|
||||||
|
|
||||||
if (!c_streq(renamed_path, cur->path)) {
|
|
||||||
len = strlen( renamed_path );
|
|
||||||
h = c_jhash64((uint8_t *) renamed_path, len, 0);
|
|
||||||
other_node = c_rbtree_find(other_tree, &h);
|
|
||||||
}
|
|
||||||
SAFE_FREE(renamed_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!other_node) {
|
|
||||||
/* Check the source path as well. */
|
|
||||||
int len;
|
|
||||||
uint64_t h = 0;
|
|
||||||
char *renamed_path = csync_rename_adjust_path_source(ctx, cur->path);
|
|
||||||
|
|
||||||
if (!c_streq(renamed_path, cur->path)) {
|
|
||||||
len = strlen( renamed_path );
|
|
||||||
h = c_jhash64((uint8_t *) renamed_path, len, 0);
|
|
||||||
other_node = c_rbtree_find(other_tree, &h);
|
|
||||||
}
|
|
||||||
SAFE_FREE(renamed_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj == NULL || data == NULL) {
|
|
||||||
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
|
|
||||||
twctx = (_csync_treewalk_context*) ctx->callbacks.userdata;
|
|
||||||
if (twctx == NULL) {
|
|
||||||
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (twctx->instruction_filter > 0 &&
|
|
||||||
!(twctx->instruction_filter & cur->instruction) ) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
visitor = (c_rbtree_visit_func*)(twctx->user_visitor);
|
|
||||||
if (visitor != NULL) {
|
|
||||||
trav.path = cur->path;
|
|
||||||
trav.size = cur->size;
|
|
||||||
trav.modtime = cur->modtime;
|
|
||||||
trav.mode = cur->mode;
|
|
||||||
trav.type = cur->type;
|
|
||||||
trav.instruction = cur->instruction;
|
|
||||||
trav.rename_path = cur->destpath;
|
|
||||||
trav.etag = cur->etag;
|
|
||||||
trav.file_id = cur->file_id;
|
|
||||||
trav.remotePerm = cur->remotePerm;
|
|
||||||
trav.directDownloadUrl = cur->directDownloadUrl;
|
|
||||||
trav.directDownloadCookies = cur->directDownloadCookies;
|
|
||||||
trav.inode = cur->inode;
|
|
||||||
|
|
||||||
trav.error_status = cur->error_status;
|
|
||||||
trav.has_ignored_files = cur->has_ignored_files;
|
|
||||||
trav.checksum = cur->checksum;
|
|
||||||
trav.checksumTypeId = cur->checksumTypeId;
|
|
||||||
|
|
||||||
if( other_node ) {
|
|
||||||
csync_file_stat_t *other_stat = (csync_file_stat_t*)other_node->data;
|
|
||||||
trav.other.etag = other_stat->etag;
|
|
||||||
trav.other.file_id = other_stat->file_id;
|
|
||||||
trav.other.instruction = other_stat->instruction;
|
|
||||||
trav.other.modtime = other_stat->modtime;
|
|
||||||
trav.other.size = other_stat->size;
|
|
||||||
} else {
|
|
||||||
trav.other.etag = 0;
|
|
||||||
trav.other.file_id = 0;
|
|
||||||
trav.other.instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
trav.other.modtime = 0;
|
|
||||||
trav.other.size = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = (*visitor)(&trav, twctx->userdata);
|
|
||||||
cur->instruction = trav.instruction;
|
|
||||||
if (trav.etag != cur->etag) { // FIXME It would be nice to have this documented
|
|
||||||
SAFE_FREE(cur->etag);
|
|
||||||
cur->etag = c_strdup(trav.etag);
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* treewalk function, called from its wrappers below.
|
|
||||||
*
|
|
||||||
* it encapsulates the user visitor function, the filter and the userdata
|
|
||||||
* into a treewalk_context structure and calls the rb treewalk function,
|
|
||||||
* which calls the local _csync_treewalk_visitor in this module.
|
|
||||||
* The user visitor is called from there.
|
|
||||||
*/
|
|
||||||
static int _csync_walk_tree(CSYNC *ctx, c_rbtree_t *tree, csync_treewalk_visit_func *visitor, int filter)
|
|
||||||
{
|
|
||||||
_csync_treewalk_context tw_ctx;
|
|
||||||
int rc = -1;
|
|
||||||
|
|
||||||
if (ctx == NULL) {
|
|
||||||
errno = EBADF;
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (visitor == NULL || tree == NULL) {
|
|
||||||
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
tw_ctx.userdata = ctx->callbacks.userdata;
|
|
||||||
tw_ctx.user_visitor = visitor;
|
|
||||||
tw_ctx.instruction_filter = filter;
|
|
||||||
|
|
||||||
ctx->callbacks.userdata = &tw_ctx;
|
|
||||||
|
|
||||||
rc = c_rbtree_walk(tree, (void*) ctx, _csync_treewalk_visitor);
|
|
||||||
if( rc < 0 ) {
|
|
||||||
if( ctx->status_code == CSYNC_STATUS_OK )
|
|
||||||
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_TREE_ERROR);
|
|
||||||
}
|
|
||||||
ctx->callbacks.userdata = tw_ctx.userdata;
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* wrapper function for treewalk on the remote tree
|
|
||||||
*/
|
|
||||||
int csync_walk_remote_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter)
|
|
||||||
{
|
|
||||||
c_rbtree_t *tree = NULL;
|
|
||||||
int rc = -1;
|
|
||||||
|
|
||||||
if(ctx != NULL) {
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
ctx->current = REMOTE_REPLICA;
|
|
||||||
tree = ctx->remote.tree;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* all error handling in the called function */
|
|
||||||
rc = _csync_walk_tree(ctx, tree, visitor, filter);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* wrapper function for treewalk on the local tree
|
|
||||||
*/
|
|
||||||
int csync_walk_local_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int filter)
|
|
||||||
{
|
|
||||||
c_rbtree_t *tree = NULL;
|
|
||||||
int rc = -1;
|
|
||||||
|
|
||||||
if (ctx != NULL) {
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
ctx->current = LOCAL_REPLICA;
|
|
||||||
tree = ctx->local.tree;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* all error handling in the called function */
|
|
||||||
rc = _csync_walk_tree(ctx, tree, visitor, filter);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _tree_destructor(void *data) {
|
|
||||||
csync_file_stat_t *freedata = NULL;
|
|
||||||
|
|
||||||
freedata = (csync_file_stat_t *) data;
|
|
||||||
csync_file_stat_free(freedata);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* reset all the list to empty.
|
|
||||||
* used by csync_commit and csync_destroy */
|
|
||||||
static void _csync_clean_ctx(CSYNC *ctx)
|
|
||||||
{
|
|
||||||
/* destroy the rbtrees */
|
|
||||||
if (c_rbtree_size(ctx->local.tree) > 0) {
|
|
||||||
c_rbtree_destroy(ctx->local.tree, _tree_destructor);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c_rbtree_size(ctx->remote.tree) > 0) {
|
|
||||||
c_rbtree_destroy(ctx->remote.tree, _tree_destructor);
|
|
||||||
}
|
|
||||||
|
|
||||||
csync_rename_destroy(ctx);
|
|
||||||
|
|
||||||
/* free memory */
|
|
||||||
c_rbtree_free(ctx->local.tree);
|
|
||||||
c_rbtree_free(ctx->remote.tree);
|
|
||||||
|
|
||||||
SAFE_FREE(ctx->remote.root_perms);
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_commit(CSYNC *ctx) {
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
if (ctx == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
|
|
||||||
if (ctx->statedb.db != NULL
|
|
||||||
&& csync_statedb_close(ctx) < 0) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "ERR: closing of statedb failed.");
|
|
||||||
rc = -1;
|
|
||||||
}
|
|
||||||
ctx->statedb.db = NULL;
|
|
||||||
|
|
||||||
_csync_clean_ctx(ctx);
|
|
||||||
|
|
||||||
ctx->remote.read_from_db = 0;
|
|
||||||
ctx->read_remote_from_db = true;
|
|
||||||
ctx->db_is_empty = false;
|
|
||||||
|
|
||||||
|
|
||||||
/* Create new trees */
|
|
||||||
c_rbtree_create(&ctx->local.tree, _key_cmp, _data_cmp);
|
|
||||||
c_rbtree_create(&ctx->remote.tree, _key_cmp, _data_cmp);
|
|
||||||
|
|
||||||
|
|
||||||
ctx->status = CSYNC_STATUS_INIT;
|
|
||||||
SAFE_FREE(ctx->error_string);
|
|
||||||
|
|
||||||
rc = 0;
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_destroy(CSYNC *ctx) {
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
if (ctx == NULL) {
|
|
||||||
errno = EBADF;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
ctx->status_code = CSYNC_STATUS_OK;
|
|
||||||
|
|
||||||
if (ctx->statedb.db != NULL
|
|
||||||
&& csync_statedb_close(ctx) < 0) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "ERR: closing of statedb failed.");
|
|
||||||
rc = -1;
|
|
||||||
}
|
|
||||||
ctx->statedb.db = NULL;
|
|
||||||
|
|
||||||
_csync_clean_ctx(ctx);
|
|
||||||
|
|
||||||
SAFE_FREE(ctx->statedb.file);
|
|
||||||
SAFE_FREE(ctx->local.uri);
|
|
||||||
SAFE_FREE(ctx->error_string);
|
|
||||||
|
|
||||||
#ifdef WITH_ICONV
|
|
||||||
c_close_iconv();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SAFE_FREE(ctx);
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *csync_get_userdata(CSYNC *ctx) {
|
|
||||||
if (ctx == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return ctx->callbacks.userdata;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_set_userdata(CSYNC *ctx, void *userdata) {
|
|
||||||
if (ctx == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->callbacks.userdata = userdata;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
csync_auth_callback csync_get_auth_callback(CSYNC *ctx) {
|
|
||||||
if (ctx == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctx->callbacks.auth_function;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_set_status(CSYNC *ctx, int status) {
|
|
||||||
if (ctx == NULL || status < 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->status = status;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
CSYNC_STATUS csync_get_status(CSYNC *ctx) {
|
|
||||||
if (ctx == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctx->status_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *csync_get_status_string(CSYNC *ctx)
|
|
||||||
{
|
|
||||||
return csync_vio_get_status_string(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef WITH_ICONV
|
|
||||||
int csync_set_iconv_codec(const char *from)
|
|
||||||
{
|
|
||||||
c_close_iconv();
|
|
||||||
|
|
||||||
if (from != NULL) {
|
|
||||||
c_setup_iconv(from);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void csync_request_abort(CSYNC *ctx)
|
|
||||||
{
|
|
||||||
if (ctx != NULL) {
|
|
||||||
ctx->abort = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void csync_resume(CSYNC *ctx)
|
|
||||||
{
|
|
||||||
if (ctx != NULL) {
|
|
||||||
ctx->abort = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_abort_requested(CSYNC *ctx)
|
|
||||||
{
|
|
||||||
if (ctx != NULL) {
|
|
||||||
return ctx->abort;
|
|
||||||
} else {
|
|
||||||
return (1 == 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void csync_file_stat_free(csync_file_stat_t *st)
|
|
||||||
{
|
|
||||||
if (st) {
|
|
||||||
SAFE_FREE(st->directDownloadUrl);
|
|
||||||
SAFE_FREE(st->directDownloadCookies);
|
|
||||||
SAFE_FREE(st->etag);
|
|
||||||
SAFE_FREE(st->destpath);
|
|
||||||
SAFE_FREE(st->checksum);
|
|
||||||
SAFE_FREE(st);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,430 +0,0 @@
|
|||||||
/*
|
|
||||||
* libcsync -- a library to sync a directory with another
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config_csync.h"
|
|
||||||
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
#define _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
#include "c_lib.h"
|
|
||||||
#include "c_private.h"
|
|
||||||
|
|
||||||
#include "csync_private.h"
|
|
||||||
#include "csync_exclude.h"
|
|
||||||
#include "csync_misc.h"
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <io.h>
|
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CSYNC_LOG_CATEGORY_NAME "csync.exclude"
|
|
||||||
#include "csync_log.h"
|
|
||||||
|
|
||||||
#ifndef WITH_TESTING
|
|
||||||
static
|
|
||||||
#endif
|
|
||||||
int _csync_exclude_add(c_strlist_t **inList, const char *string) {
|
|
||||||
size_t i = 0;
|
|
||||||
|
|
||||||
// We never want duplicates, so check whether the string is already
|
|
||||||
// in the list first.
|
|
||||||
if (*inList) {
|
|
||||||
for (i = 0; i < (*inList)->count; ++i) {
|
|
||||||
char *pattern = (*inList)->vector[i];
|
|
||||||
if (c_streq(pattern, string)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return c_strlist_add_grow(inList, string);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Expands C-like escape sequences.
|
|
||||||
*
|
|
||||||
* The returned string is heap-allocated and owned by the caller.
|
|
||||||
*/
|
|
||||||
static const char *csync_exclude_expand_escapes(const char * input)
|
|
||||||
{
|
|
||||||
size_t i_len = strlen(input) + 1;
|
|
||||||
char *out = c_malloc(i_len); // out can only be shorter
|
|
||||||
|
|
||||||
size_t i = 0;
|
|
||||||
size_t o = 0;
|
|
||||||
for (; i < i_len; ++i) {
|
|
||||||
if (input[i] == '\\') {
|
|
||||||
// at worst input[i+1] is \0
|
|
||||||
switch (input[i+1]) {
|
|
||||||
case '\'': out[o++] = '\''; break;
|
|
||||||
case '"': out[o++] = '"'; break;
|
|
||||||
case '?': out[o++] = '?'; break;
|
|
||||||
case '\\': out[o++] = '\\'; break;
|
|
||||||
case 'a': out[o++] = '\a'; break;
|
|
||||||
case 'b': out[o++] = '\b'; break;
|
|
||||||
case 'f': out[o++] = '\f'; break;
|
|
||||||
case 'n': out[o++] = '\n'; break;
|
|
||||||
case 'r': out[o++] = '\r'; break;
|
|
||||||
case 't': out[o++] = '\t'; break;
|
|
||||||
case 'v': out[o++] = '\v'; break;
|
|
||||||
default:
|
|
||||||
out[o++] = input[i];
|
|
||||||
out[o++] = input[i+1];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
++i;
|
|
||||||
} else {
|
|
||||||
out[o++] = input[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_exclude_load(const char *fname, c_strlist_t **list) {
|
|
||||||
int fd = -1;
|
|
||||||
int i = 0;
|
|
||||||
int rc = -1;
|
|
||||||
int64_t size;
|
|
||||||
char *buf = NULL;
|
|
||||||
char *entry = NULL;
|
|
||||||
mbchar_t *w_fname;
|
|
||||||
|
|
||||||
if (fname == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
_fmode = _O_BINARY;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
w_fname = c_utf8_path_to_locale(fname);
|
|
||||||
if (w_fname == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
fd = _topen(w_fname, O_RDONLY);
|
|
||||||
c_free_locale_string(w_fname);
|
|
||||||
if (fd < 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
size = lseek(fd, 0, SEEK_END);
|
|
||||||
if (size < 0) {
|
|
||||||
rc = -1;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
lseek(fd, 0, SEEK_SET);
|
|
||||||
if (size == 0) {
|
|
||||||
rc = 0;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
buf = c_malloc(size + 1);
|
|
||||||
if (read(fd, buf, size) != size) {
|
|
||||||
rc = -1;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
buf[size] = '\0';
|
|
||||||
|
|
||||||
/* FIXME: Use fgets and don't add duplicates */
|
|
||||||
entry = buf;
|
|
||||||
for (i = 0; i < size; i++) {
|
|
||||||
if (buf[i] == '\n' || buf[i] == '\r') {
|
|
||||||
if (entry != buf + i) {
|
|
||||||
buf[i] = '\0';
|
|
||||||
if (*entry != '#') {
|
|
||||||
const char *unescaped = csync_exclude_expand_escapes(entry);
|
|
||||||
rc = _csync_exclude_add(list, unescaped);
|
|
||||||
if( rc == 0 ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Adding entry: %s", unescaped);
|
|
||||||
}
|
|
||||||
SAFE_FREE(unescaped);
|
|
||||||
if (rc < 0) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
entry = buf + i + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = 0;
|
|
||||||
out:
|
|
||||||
SAFE_FREE(buf);
|
|
||||||
close(fd);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
// See http://support.microsoft.com/kb/74496 and
|
|
||||||
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
|
|
||||||
// Additionally, we ignore '$Recycle.Bin', see https://github.com/owncloud/client/issues/2955
|
|
||||||
static const char* win_reserved_words[] = {"CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5",
|
|
||||||
"COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4",
|
|
||||||
"LPT5", "LPT6", "LPT7", "LPT8", "LPT9", "CLOCK$", "$Recycle.Bin" };
|
|
||||||
|
|
||||||
bool csync_is_windows_reserved_word(const char* filename) {
|
|
||||||
|
|
||||||
size_t win_reserve_words_len = sizeof(win_reserved_words) / sizeof(char*);
|
|
||||||
size_t j;
|
|
||||||
|
|
||||||
for (j = 0; j < win_reserve_words_len; j++) {
|
|
||||||
int len_reserved_word = strlen(win_reserved_words[j]);
|
|
||||||
int len_filename = strlen(filename);
|
|
||||||
if (len_filename == 2 && filename[1] == ':') {
|
|
||||||
if (filename[0] >= 'a' && filename[0] <= 'z') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (filename[0] >= 'A' && filename[0] <= 'Z') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (c_strncasecmp(filename, win_reserved_words[j], len_reserved_word) == 0) {
|
|
||||||
if (len_filename == len_reserved_word) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if ((len_filename > len_reserved_word) && (filename[len_reserved_word] == '.')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static CSYNC_EXCLUDE_TYPE _csync_excluded_common(c_strlist_t *excludes, const char *path, int filetype, bool check_leading_dirs) {
|
|
||||||
size_t i = 0;
|
|
||||||
const char *bname = NULL;
|
|
||||||
size_t blen = 0;
|
|
||||||
char *conflict = NULL;
|
|
||||||
int rc = -1;
|
|
||||||
CSYNC_EXCLUDE_TYPE match = CSYNC_NOT_EXCLUDED;
|
|
||||||
CSYNC_EXCLUDE_TYPE type = CSYNC_NOT_EXCLUDED;
|
|
||||||
|
|
||||||
/* split up the path */
|
|
||||||
bname = strrchr(path, '/');
|
|
||||||
if (bname) {
|
|
||||||
bname += 1; // don't include the /
|
|
||||||
} else {
|
|
||||||
bname = path;
|
|
||||||
}
|
|
||||||
blen = strlen(bname);
|
|
||||||
|
|
||||||
rc = csync_fnmatch("._sync_*.db*", bname, 0);
|
|
||||||
if (rc == 0) {
|
|
||||||
match = CSYNC_FILE_SILENTLY_EXCLUDED;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
rc = csync_fnmatch(".sync_*.db*", bname, 0);
|
|
||||||
if (rc == 0) {
|
|
||||||
match = CSYNC_FILE_SILENTLY_EXCLUDED;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
rc = csync_fnmatch(".csync_journal.db*", bname, 0);
|
|
||||||
if (rc == 0) {
|
|
||||||
match = CSYNC_FILE_SILENTLY_EXCLUDED;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check the strlen and ignore the file if its name is longer than 254 chars.
|
|
||||||
// whenever changing this also check createDownloadTmpFileName
|
|
||||||
if (blen > 254) {
|
|
||||||
match = CSYNC_FILE_EXCLUDE_LONG_FILENAME;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
// Windows cannot sync files ending in spaces (#2176). It also cannot
|
|
||||||
// distinguish files ending in '.' from files without an ending,
|
|
||||||
// as '.' is a separator that is not stored internally, so let's
|
|
||||||
// not allow to sync those to avoid file loss/ambiguities (#416)
|
|
||||||
if (blen > 1) {
|
|
||||||
if (bname[blen-1]== ' ') {
|
|
||||||
match = CSYNC_FILE_EXCLUDE_TRAILING_SPACE;
|
|
||||||
goto out;
|
|
||||||
} else if (bname[blen-1]== '.' ) {
|
|
||||||
match = CSYNC_FILE_EXCLUDE_INVALID_CHAR;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (csync_is_windows_reserved_word(bname)) {
|
|
||||||
match = CSYNC_FILE_EXCLUDE_INVALID_CHAR;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter out characters not allowed in a filename on windows
|
|
||||||
const char *p = NULL;
|
|
||||||
for (p = path; *p; p++) {
|
|
||||||
switch (*p) {
|
|
||||||
case '\\':
|
|
||||||
case ':':
|
|
||||||
case '?':
|
|
||||||
case '*':
|
|
||||||
case '"':
|
|
||||||
case '>':
|
|
||||||
case '<':
|
|
||||||
case '|':
|
|
||||||
match = CSYNC_FILE_EXCLUDE_INVALID_CHAR;
|
|
||||||
goto out;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rc = csync_fnmatch(".owncloudsync.log*", bname, 0);
|
|
||||||
if (rc == 0) {
|
|
||||||
match = CSYNC_FILE_SILENTLY_EXCLUDED;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Always ignore conflict files, not only via the exclude list */
|
|
||||||
rc = csync_fnmatch("*_conflict-*", bname, 0);
|
|
||||||
if (rc == 0) {
|
|
||||||
match = CSYNC_FILE_SILENTLY_EXCLUDED;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getenv("CSYNC_CONFLICT_FILE_USERNAME")) {
|
|
||||||
rc = asprintf(&conflict, "*_conflict_%s-*", getenv("CSYNC_CONFLICT_FILE_USERNAME"));
|
|
||||||
if (rc < 0) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
rc = csync_fnmatch(conflict, path, 0);
|
|
||||||
if (rc == 0) {
|
|
||||||
match = CSYNC_FILE_SILENTLY_EXCLUDED;
|
|
||||||
SAFE_FREE(conflict);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
SAFE_FREE(conflict);
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ! excludes ) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
c_strlist_t *path_components = NULL;
|
|
||||||
if (check_leading_dirs) {
|
|
||||||
/* Build a list of path components to check. */
|
|
||||||
path_components = c_strlist_new(32);
|
|
||||||
char *path_split = strdup(path);
|
|
||||||
size_t len = strlen(path_split);
|
|
||||||
for (i = len; ; --i) {
|
|
||||||
// read backwards until a path separator is found
|
|
||||||
if (i != 0 && path_split[i-1] != '/') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check 'basename', i.e. for "/foo/bar/fi" we'd check 'fi', 'bar', 'foo'
|
|
||||||
if (path_split[i] != 0) {
|
|
||||||
c_strlist_add_grow(&path_components, path_split + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i == 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check 'dirname', i.e. for "/foo/bar/fi" we'd check '/foo/bar', '/foo'
|
|
||||||
path_split[i-1] = '\0';
|
|
||||||
c_strlist_add_grow(&path_components, path_split);
|
|
||||||
}
|
|
||||||
SAFE_FREE(path_split);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Loop over all exclude patterns and evaluate the given path */
|
|
||||||
for (i = 0; match == CSYNC_NOT_EXCLUDED && i < excludes->count; i++) {
|
|
||||||
bool match_dirs_only = false;
|
|
||||||
char *pattern = excludes->vector[i];
|
|
||||||
|
|
||||||
type = CSYNC_FILE_EXCLUDE_LIST;
|
|
||||||
if (!pattern[0]) { /* empty pattern */
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
/* Excludes starting with ']' means it can be cleanup */
|
|
||||||
if (pattern[0] == ']') {
|
|
||||||
++pattern;
|
|
||||||
if (filetype == CSYNC_FTW_TYPE_FILE) {
|
|
||||||
type = CSYNC_FILE_EXCLUDE_AND_REMOVE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Check if the pattern applies to pathes only. */
|
|
||||||
if (pattern[strlen(pattern)-1] == '/') {
|
|
||||||
if (!check_leading_dirs && filetype == CSYNC_FTW_TYPE_FILE) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
match_dirs_only = true;
|
|
||||||
pattern[strlen(pattern)-1] = '\0'; /* Cut off the slash */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check if the pattern contains a / and if, compare to the whole path */
|
|
||||||
if (strchr(pattern, '/')) {
|
|
||||||
rc = csync_fnmatch(pattern, path, FNM_PATHNAME);
|
|
||||||
if( rc == 0 ) {
|
|
||||||
match = type;
|
|
||||||
}
|
|
||||||
/* if the pattern requires a dir, but path is not, its still not excluded. */
|
|
||||||
if (match_dirs_only && filetype != CSYNC_FTW_TYPE_DIR) {
|
|
||||||
match = CSYNC_NOT_EXCLUDED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if still not excluded, check each component and leading directory of the path */
|
|
||||||
if (match == CSYNC_NOT_EXCLUDED && check_leading_dirs) {
|
|
||||||
size_t j = 0;
|
|
||||||
if (match_dirs_only && filetype == CSYNC_FTW_TYPE_FILE) {
|
|
||||||
j = 1; // skip the first entry, which is bname
|
|
||||||
}
|
|
||||||
for (; j < path_components->count; ++j) {
|
|
||||||
rc = csync_fnmatch(pattern, path_components->vector[j], 0);
|
|
||||||
if (rc == 0) {
|
|
||||||
match = type;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (match == CSYNC_NOT_EXCLUDED && !check_leading_dirs) {
|
|
||||||
rc = csync_fnmatch(pattern, bname, 0);
|
|
||||||
if (rc == 0) {
|
|
||||||
match = type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (match_dirs_only) {
|
|
||||||
/* restore the '/' */
|
|
||||||
pattern[strlen(pattern)] = '/';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
c_strlist_destroy(path_components);
|
|
||||||
|
|
||||||
out:
|
|
||||||
|
|
||||||
return match;
|
|
||||||
}
|
|
||||||
|
|
||||||
CSYNC_EXCLUDE_TYPE csync_excluded_traversal(c_strlist_t *excludes, const char *path, int filetype) {
|
|
||||||
return _csync_excluded_common(excludes, path, filetype, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path, int filetype) {
|
|
||||||
return _csync_excluded_common(excludes, path, filetype, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* libcsync -- a library to sync a directory with another
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CSYNC_EXCLUDE_H
|
|
||||||
#define _CSYNC_EXCLUDE_H
|
|
||||||
|
|
||||||
#include "ocsynclib.h"
|
|
||||||
|
|
||||||
enum csync_exclude_type_e {
|
|
||||||
CSYNC_NOT_EXCLUDED = 0,
|
|
||||||
CSYNC_FILE_SILENTLY_EXCLUDED,
|
|
||||||
CSYNC_FILE_EXCLUDE_AND_REMOVE,
|
|
||||||
CSYNC_FILE_EXCLUDE_LIST,
|
|
||||||
CSYNC_FILE_EXCLUDE_INVALID_CHAR,
|
|
||||||
CSYNC_FILE_EXCLUDE_TRAILING_SPACE,
|
|
||||||
CSYNC_FILE_EXCLUDE_LONG_FILENAME,
|
|
||||||
CSYNC_FILE_EXCLUDE_HIDDEN,
|
|
||||||
CSYNC_FILE_EXCLUDE_STAT_FAILED
|
|
||||||
};
|
|
||||||
typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
|
|
||||||
|
|
||||||
#ifdef WITH_TESTING
|
|
||||||
int OCSYNC_EXPORT _csync_exclude_add(c_strlist_t **inList, const char *string);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Load exclude list
|
|
||||||
*
|
|
||||||
* @param ctx The context of the synchronizer.
|
|
||||||
* @param fname The filename to load.
|
|
||||||
*
|
|
||||||
* @return 0 on success, -1 if an error occurred with errno set.
|
|
||||||
*/
|
|
||||||
int OCSYNC_EXPORT csync_exclude_load(const char *fname, c_strlist_t **list);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Check if the given path should be excluded in a traversal situation.
|
|
||||||
*
|
|
||||||
* It does only part of the work that csync_excluded does because it's assumed
|
|
||||||
* that all leading directories have been run through csync_excluded_traversal()
|
|
||||||
* before. This can be significantly faster.
|
|
||||||
*
|
|
||||||
* That means for '/foo/bar/file' only ('/foo/bar/file', 'file') is checked
|
|
||||||
* against the exclude patterns.
|
|
||||||
*
|
|
||||||
* @param ctx The synchronizer context.
|
|
||||||
* @param path The patch to check.
|
|
||||||
*
|
|
||||||
* @return 2 if excluded and needs cleanup, 1 if excluded, 0 if not.
|
|
||||||
*/
|
|
||||||
CSYNC_EXCLUDE_TYPE csync_excluded_traversal(c_strlist_t *excludes, const char *path, int filetype);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief csync_excluded_no_ctx
|
|
||||||
* @param excludes
|
|
||||||
* @param path
|
|
||||||
* @param filetype
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
CSYNC_EXCLUDE_TYPE OCSYNC_EXPORT csync_excluded_no_ctx(c_strlist_t *excludes, const char *path, int filetype);
|
|
||||||
#endif /* _CSYNC_EXCLUDE_H */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Checks if filename is considered reserved by Windows
|
|
||||||
* @param file_name filename
|
|
||||||
* @return true if file is reserved, false otherwise
|
|
||||||
*/
|
|
||||||
bool csync_is_windows_reserved_word(const char *file_name);
|
|
||||||
|
|
||||||
|
|
||||||
/* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
/*
|
|
||||||
* libcsync -- a library to sync a directory with another
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config_csync.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "csync_private.h"
|
|
||||||
#include "csync_log.h"
|
|
||||||
|
|
||||||
CSYNC_THREAD int csync_log_level;
|
|
||||||
CSYNC_THREAD csync_log_callback csync_log_cb;
|
|
||||||
CSYNC_THREAD void *csync_log_userdata;
|
|
||||||
|
|
||||||
static void csync_log_stderr(int verbosity,
|
|
||||||
const char *function,
|
|
||||||
const char *buffer)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "[%d] %s", verbosity, function);
|
|
||||||
fprintf(stderr, " %s\n", buffer);
|
|
||||||
}
|
|
||||||
static void csync_log_function(int verbosity,
|
|
||||||
const char *function,
|
|
||||||
const char *buffer)
|
|
||||||
{
|
|
||||||
csync_log_callback log_fn = csync_get_log_callback();
|
|
||||||
if (log_fn) {
|
|
||||||
char buf[1024];
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s: %s", function, buffer);
|
|
||||||
|
|
||||||
log_fn(verbosity,
|
|
||||||
function,
|
|
||||||
buf,
|
|
||||||
csync_get_log_userdata());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
csync_log_stderr(verbosity, function, buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void csync_log(int verbosity,
|
|
||||||
const char *function,
|
|
||||||
const char *format, ...)
|
|
||||||
{
|
|
||||||
char buffer[1024];
|
|
||||||
va_list va;
|
|
||||||
|
|
||||||
if (verbosity <= csync_get_log_level()) {
|
|
||||||
va_start(va, format);
|
|
||||||
vsnprintf(buffer, sizeof(buffer), format, va);
|
|
||||||
va_end(va);
|
|
||||||
csync_log_function(verbosity, function, buffer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_set_log_level(int level) {
|
|
||||||
if (level < 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
csync_log_level = level;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_get_log_level(void) {
|
|
||||||
return csync_log_level;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_set_log_callback(csync_log_callback cb) {
|
|
||||||
if (cb == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
csync_log_cb = cb;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
csync_log_callback csync_get_log_callback(void) {
|
|
||||||
return csync_log_cb;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *csync_get_log_userdata(void)
|
|
||||||
{
|
|
||||||
return csync_log_userdata;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_set_log_userdata(void *data)
|
|
||||||
{
|
|
||||||
csync_log_userdata = data;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
* libcsync -- a library to sync a directory with another
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file csync_log.h
|
|
||||||
*
|
|
||||||
* @brief Logging interface of csync
|
|
||||||
*
|
|
||||||
* @defgroup csyncLogInternals csync logging internals
|
|
||||||
* @ingroup csyncInternalAPI
|
|
||||||
*
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CSYNC_LOG_H
|
|
||||||
#define _CSYNC_LOG_H
|
|
||||||
|
|
||||||
/* GCC have printf type attribute check. */
|
|
||||||
#ifndef PRINTF_ATTRIBUTE
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__gnu_printf__, a, b)))
|
|
||||||
#else
|
|
||||||
#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define PRINTF_ATTRIBUTE(a,b)
|
|
||||||
#endif /* __GNUC__ */
|
|
||||||
#endif /* ndef PRINTF_ATTRIBUTE */
|
|
||||||
|
|
||||||
enum csync_log_priority_e {
|
|
||||||
CSYNC_LOG_PRIORITY_NOLOG = 0,
|
|
||||||
CSYNC_LOG_PRIORITY_FATAL,
|
|
||||||
CSYNC_LOG_PRIORITY_ALERT,
|
|
||||||
CSYNC_LOG_PRIORITY_CRIT,
|
|
||||||
CSYNC_LOG_PRIORITY_ERROR,
|
|
||||||
CSYNC_LOG_PRIORITY_WARN,
|
|
||||||
CSYNC_LOG_PRIORITY_NOTICE,
|
|
||||||
CSYNC_LOG_PRIORITY_INFO,
|
|
||||||
CSYNC_LOG_PRIORITY_DEBUG,
|
|
||||||
CSYNC_LOG_PRIORITY_TRACE,
|
|
||||||
CSYNC_LOG_PRIORITY_NOTSET,
|
|
||||||
CSYNC_LOG_PRIORITY_UNKNOWN,
|
|
||||||
};
|
|
||||||
|
|
||||||
#define CSYNC_LOG(priority, ...) \
|
|
||||||
csync_log(priority, __func__, __VA_ARGS__)
|
|
||||||
|
|
||||||
void csync_log(int verbosity,
|
|
||||||
const char *function,
|
|
||||||
const char *format, ...) PRINTF_ATTRIBUTE(3, 4);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* }@
|
|
||||||
*/
|
|
||||||
#endif /* _CSYNC_LOG_H */
|
|
||||||
|
|
||||||
/* vim: set ft=c.doxygen ts=4 sw=4 et cindent: */
|
|
||||||
@@ -1,229 +0,0 @@
|
|||||||
/*
|
|
||||||
* cynapses libc functions
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file csync_private.h
|
|
||||||
*
|
|
||||||
* @brief Private interface of csync
|
|
||||||
*
|
|
||||||
* @defgroup csyncInternalAPI csync internal API
|
|
||||||
*
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CSYNC_PRIVATE_H
|
|
||||||
#define _CSYNC_PRIVATE_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <sqlite3.h>
|
|
||||||
|
|
||||||
#include "config_csync.h"
|
|
||||||
#include "std/c_lib.h"
|
|
||||||
#include "std/c_private.h"
|
|
||||||
#include "csync.h"
|
|
||||||
#include "csync_misc.h"
|
|
||||||
|
|
||||||
#ifdef WITH_ICONV
|
|
||||||
#include <iconv.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_ICONV_H
|
|
||||||
#include <iconv.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_ICONV_H
|
|
||||||
#include <sys/iconv.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "csync_macros.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* How deep to scan directories.
|
|
||||||
*/
|
|
||||||
#define MAX_DEPTH 50
|
|
||||||
|
|
||||||
#define CSYNC_STATUS_INIT 1 << 0
|
|
||||||
#define CSYNC_STATUS_UPDATE 1 << 1
|
|
||||||
#define CSYNC_STATUS_RECONCILE 1 << 2
|
|
||||||
#define CSYNC_STATUS_PROPAGATE 1 << 3
|
|
||||||
|
|
||||||
#define CSYNC_STATUS_DONE (CSYNC_STATUS_INIT | \
|
|
||||||
CSYNC_STATUS_UPDATE | \
|
|
||||||
CSYNC_STATUS_RECONCILE | \
|
|
||||||
CSYNC_STATUS_PROPAGATE)
|
|
||||||
|
|
||||||
enum csync_replica_e {
|
|
||||||
LOCAL_REPLICA,
|
|
||||||
REMOTE_REPLICA
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct csync_file_stat_s csync_file_stat_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief csync public structure
|
|
||||||
*/
|
|
||||||
struct csync_s {
|
|
||||||
struct {
|
|
||||||
csync_auth_callback auth_function;
|
|
||||||
void *userdata;
|
|
||||||
csync_update_callback update_callback;
|
|
||||||
void *update_callback_userdata;
|
|
||||||
|
|
||||||
/* hooks for checking the white list (uses the update_callback_userdata) */
|
|
||||||
int (*checkSelectiveSyncBlackListHook)(void*, const char*);
|
|
||||||
int (*checkSelectiveSyncNewFolderHook)(void*, const char* /* path */, const char* /* remotePerm */);
|
|
||||||
|
|
||||||
|
|
||||||
csync_vio_opendir_hook remote_opendir_hook;
|
|
||||||
csync_vio_readdir_hook remote_readdir_hook;
|
|
||||||
csync_vio_closedir_hook remote_closedir_hook;
|
|
||||||
void *vio_userdata;
|
|
||||||
|
|
||||||
/* hook for comparing checksums of files during discovery */
|
|
||||||
csync_checksum_hook checksum_hook;
|
|
||||||
void *checksum_userdata;
|
|
||||||
|
|
||||||
} callbacks;
|
|
||||||
c_strlist_t *excludes;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
char *file;
|
|
||||||
sqlite3 *db;
|
|
||||||
int exists;
|
|
||||||
|
|
||||||
sqlite3_stmt* by_hash_stmt;
|
|
||||||
sqlite3_stmt* by_fileid_stmt;
|
|
||||||
sqlite3_stmt* by_inode_stmt;
|
|
||||||
|
|
||||||
int lastReturnValue;
|
|
||||||
} statedb;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
char *uri;
|
|
||||||
c_rbtree_t *tree;
|
|
||||||
enum csync_replica_e type;
|
|
||||||
} local;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
c_rbtree_t *tree;
|
|
||||||
enum csync_replica_e type;
|
|
||||||
int read_from_db;
|
|
||||||
const char *root_perms; /* Permission of the root folder. (Since the root folder is not in the db tree, we need to keep a separate entry.) */
|
|
||||||
} remote;
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_ICONV) && defined(WITH_ICONV)
|
|
||||||
struct {
|
|
||||||
iconv_t iconv_cd;
|
|
||||||
} options;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* replica we are currently walking */
|
|
||||||
enum csync_replica_e current;
|
|
||||||
|
|
||||||
/* replica we want to work on */
|
|
||||||
enum csync_replica_e replica;
|
|
||||||
|
|
||||||
/* Used in the update phase so changes in the sub directories can be notified to
|
|
||||||
parent directories */
|
|
||||||
csync_file_stat_t *current_fs;
|
|
||||||
|
|
||||||
/* csync error code */
|
|
||||||
enum csync_status_codes_e status_code;
|
|
||||||
|
|
||||||
char *error_string;
|
|
||||||
|
|
||||||
int status;
|
|
||||||
volatile int abort;
|
|
||||||
void *rename_info;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specify if it is allowed to read the remote tree from the DB (default to enabled)
|
|
||||||
*/
|
|
||||||
bool read_remote_from_db;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If true, the DB is considered empty and all reads are skipped. (default is false)
|
|
||||||
* This is useful during the initial local discovery as it speeds it up significantly.
|
|
||||||
*/
|
|
||||||
bool db_is_empty;
|
|
||||||
|
|
||||||
bool ignore_hidden_files;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma pack(1)
|
|
||||||
#endif
|
|
||||||
struct csync_file_stat_s {
|
|
||||||
uint64_t phash; /* u64 */
|
|
||||||
time_t modtime; /* u64 */
|
|
||||||
int64_t size; /* u64 */
|
|
||||||
size_t pathlen; /* u64 */
|
|
||||||
uint64_t inode; /* u64 */
|
|
||||||
mode_t mode; /* u32 */
|
|
||||||
unsigned int type : 4;
|
|
||||||
unsigned int child_modified : 1;
|
|
||||||
unsigned int has_ignored_files : 1; /* specify that a directory, or child directory contains ignored files */
|
|
||||||
|
|
||||||
char *destpath; /* for renames */
|
|
||||||
const char *etag;
|
|
||||||
char file_id[FILE_ID_BUF_SIZE+1]; /* the ownCloud file id is fixed width in ownCloud. */
|
|
||||||
char *directDownloadUrl;
|
|
||||||
char *directDownloadCookies;
|
|
||||||
char remotePerm[REMOTE_PERM_BUF_SIZE+1];
|
|
||||||
|
|
||||||
const char *checksum;
|
|
||||||
uint32_t checksumTypeId;
|
|
||||||
|
|
||||||
CSYNC_STATUS error_status;
|
|
||||||
|
|
||||||
enum csync_instructions_e instruction; /* u32 */
|
|
||||||
char path[1]; /* u8 */
|
|
||||||
}
|
|
||||||
#if !defined(__SUNPRO_C) && !defined(_MSC_VER)
|
|
||||||
__attribute__ ((packed))
|
|
||||||
#endif
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma pack()
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
OCSYNC_EXPORT void csync_file_stat_free(csync_file_stat_t *st);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* context for the treewalk function
|
|
||||||
*/
|
|
||||||
struct _csync_treewalk_context_s
|
|
||||||
{
|
|
||||||
csync_treewalk_visit_func *user_visitor;
|
|
||||||
int instruction_filter;
|
|
||||||
void *userdata;
|
|
||||||
};
|
|
||||||
typedef struct _csync_treewalk_context_s _csync_treewalk_context;
|
|
||||||
|
|
||||||
void set_errno_from_http_errcode( int err );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* }@
|
|
||||||
*/
|
|
||||||
#endif /* _CSYNC_PRIVATE_H */
|
|
||||||
/* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */
|
|
||||||
@@ -1,385 +0,0 @@
|
|||||||
/*
|
|
||||||
* libcsync -- a library to sync a directory with another
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config_csync.h"
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include "csync_private.h"
|
|
||||||
#include "csync_reconcile.h"
|
|
||||||
#include "csync_util.h"
|
|
||||||
#include "csync_statedb.h"
|
|
||||||
#include "csync_rename.h"
|
|
||||||
#include "c_jhash.h"
|
|
||||||
|
|
||||||
#define CSYNC_LOG_CATEGORY_NAME "csync.reconciler"
|
|
||||||
#include "csync_log.h"
|
|
||||||
|
|
||||||
#include "inttypes.h"
|
|
||||||
|
|
||||||
/* Check if a file is ignored because one parent is ignored.
|
|
||||||
* return the node of the ignored directoy if it's the case, or NULL if it is not ignored */
|
|
||||||
static c_rbnode_t *_csync_check_ignored(c_rbtree_t *tree, const char *path, int pathlen) {
|
|
||||||
uint64_t h = 0;
|
|
||||||
c_rbnode_t *node = NULL;
|
|
||||||
|
|
||||||
/* compute the size of the parent directory */
|
|
||||||
int parentlen = pathlen - 1;
|
|
||||||
while (parentlen > 0 && path[parentlen] != '/') {
|
|
||||||
parentlen--;
|
|
||||||
}
|
|
||||||
if (parentlen <= 0) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
h = c_jhash64((uint8_t *) path, parentlen, 0);
|
|
||||||
node = c_rbtree_find(tree, &h);
|
|
||||||
if (node) {
|
|
||||||
csync_file_stat_t *n = (csync_file_stat_t*)node->data;
|
|
||||||
if (n->instruction == CSYNC_INSTRUCTION_IGNORE) {
|
|
||||||
/* Yes, we are ignored */
|
|
||||||
return node;
|
|
||||||
} else {
|
|
||||||
/* Not ignored */
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* Try if the parent itself is ignored */
|
|
||||||
return _csync_check_ignored(tree, path, parentlen);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The main function in the reconcile pass.
|
|
||||||
*
|
|
||||||
* It's called for each entry in the local and remote rbtrees by
|
|
||||||
* csync_reconcile()
|
|
||||||
*
|
|
||||||
* Before the reconcile phase the trees already know about changes
|
|
||||||
* relative to the sync journal. This function's job is to spot conflicts
|
|
||||||
* between local and remote changes and adjust the nodes accordingly.
|
|
||||||
*
|
|
||||||
* See doc/dev/sync-algorithm.md for an overview.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Older detail comment:
|
|
||||||
*
|
|
||||||
* We merge replicas at the file level. The merged replica contains the
|
|
||||||
* superset of files that are on the local machine and server copies of
|
|
||||||
* the replica. In the case where the same file is in both the local
|
|
||||||
* and server copy, the file that was modified most recently is used.
|
|
||||||
* This means that new files are not deleted, and updated versions of
|
|
||||||
* existing files are not overwritten.
|
|
||||||
*
|
|
||||||
* When a file is updated, the merge algorithm compares the destination
|
|
||||||
* file with the the source file. If the destination file is newer
|
|
||||||
* (timestamp is newer), it is not overwritten. If both files, on the
|
|
||||||
* source and the destination, have been changed, the newer file wins.
|
|
||||||
*/
|
|
||||||
static int _csync_merge_algorithm_visitor(void *obj, void *data) {
|
|
||||||
csync_file_stat_t *cur = NULL;
|
|
||||||
csync_file_stat_t *other = NULL;
|
|
||||||
csync_file_stat_t *tmp = NULL;
|
|
||||||
uint64_t h = 0;
|
|
||||||
int len = 0;
|
|
||||||
|
|
||||||
CSYNC *ctx = NULL;
|
|
||||||
c_rbtree_t *tree = NULL;
|
|
||||||
c_rbnode_t *node = NULL;
|
|
||||||
|
|
||||||
cur = (csync_file_stat_t *) obj;
|
|
||||||
ctx = (CSYNC *) data;
|
|
||||||
|
|
||||||
/* we need the opposite tree! */
|
|
||||||
switch (ctx->current) {
|
|
||||||
case LOCAL_REPLICA:
|
|
||||||
tree = ctx->remote.tree;
|
|
||||||
break;
|
|
||||||
case REMOTE_REPLICA:
|
|
||||||
tree = ctx->local.tree;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
node = c_rbtree_find(tree, &cur->phash);
|
|
||||||
|
|
||||||
if (!node) {
|
|
||||||
/* Check the renamed path as well. */
|
|
||||||
char *renamed_path = csync_rename_adjust_path(ctx, cur->path);
|
|
||||||
if (!c_streq(renamed_path, cur->path)) {
|
|
||||||
len = strlen( renamed_path );
|
|
||||||
h = c_jhash64((uint8_t *) renamed_path, len, 0);
|
|
||||||
node = c_rbtree_find(tree, &h);
|
|
||||||
}
|
|
||||||
SAFE_FREE(renamed_path);
|
|
||||||
}
|
|
||||||
if (!node) {
|
|
||||||
/* Check if it is ignored */
|
|
||||||
node = _csync_check_ignored(tree, cur->path, cur->pathlen);
|
|
||||||
/* If it is ignored, other->instruction will be IGNORE so this one will also be ignored */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* file only found on current replica */
|
|
||||||
if (node == NULL) {
|
|
||||||
switch(cur->instruction) {
|
|
||||||
/* file has been modified */
|
|
||||||
case CSYNC_INSTRUCTION_EVAL:
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NEW;
|
|
||||||
break;
|
|
||||||
/* file has been removed on the opposite replica */
|
|
||||||
case CSYNC_INSTRUCTION_NONE:
|
|
||||||
case CSYNC_INSTRUCTION_UPDATE_METADATA:
|
|
||||||
if (cur->has_ignored_files) {
|
|
||||||
/* Do not remove a directory that has ignored files */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (cur->child_modified) {
|
|
||||||
/* re-create directory that has modified contents */
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NEW;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_REMOVE;
|
|
||||||
break;
|
|
||||||
case CSYNC_INSTRUCTION_EVAL_RENAME:
|
|
||||||
if(ctx->current == LOCAL_REPLICA ) {
|
|
||||||
/* use the old name to find the "other" node */
|
|
||||||
tmp = csync_statedb_get_stat_by_inode(ctx, cur->inode);
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Finding opposite temp through inode %" PRIu64 ": %s",
|
|
||||||
cur->inode, tmp ? "true":"false");
|
|
||||||
} else if( ctx->current == REMOTE_REPLICA ) {
|
|
||||||
tmp = csync_statedb_get_stat_by_file_id(ctx, cur->file_id);
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Finding opposite temp through file ID %s: %s",
|
|
||||||
cur->file_id, tmp ? "true":"false");
|
|
||||||
} else {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Unknown replica...");
|
|
||||||
}
|
|
||||||
|
|
||||||
if( tmp ) {
|
|
||||||
len = strlen( tmp->path );
|
|
||||||
if( len > 0 ) {
|
|
||||||
h = c_jhash64((uint8_t *) tmp->path, len, 0);
|
|
||||||
/* First, check that the file is NOT in our tree (another file with the same name was added) */
|
|
||||||
node = c_rbtree_find(ctx->current == REMOTE_REPLICA ? ctx->remote.tree : ctx->local.tree, &h);
|
|
||||||
if (node) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Origin found in our tree : %s", tmp->path);
|
|
||||||
} else {
|
|
||||||
/* Find the temporar file in the other tree. */
|
|
||||||
node = c_rbtree_find(tree, &h);
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "PHash of temporary opposite (%s): %" PRIu64 " %s",
|
|
||||||
tmp->path , h, node ? "found": "not found" );
|
|
||||||
if (node) {
|
|
||||||
other = (csync_file_stat_t*)node->data;
|
|
||||||
} else {
|
|
||||||
/* the renamed file could not be found in the opposite tree. That is because it
|
|
||||||
* is not longer existing there, maybe because it was renamed or deleted.
|
|
||||||
* The journal is cleaned up later after propagation.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!other) {
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NEW;
|
|
||||||
} else if (other->instruction == CSYNC_INSTRUCTION_NONE
|
|
||||||
|| other->instruction == CSYNC_INSTRUCTION_UPDATE_METADATA
|
|
||||||
|| cur->type == CSYNC_FTW_TYPE_DIR) {
|
|
||||||
other->instruction = CSYNC_INSTRUCTION_RENAME;
|
|
||||||
other->destpath = c_strdup( cur->path );
|
|
||||||
if( !c_streq(cur->file_id, "") ) {
|
|
||||||
csync_vio_set_file_id( other->file_id, cur->file_id );
|
|
||||||
}
|
|
||||||
other->inode = cur->inode;
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
} else if (other->instruction == CSYNC_INSTRUCTION_REMOVE) {
|
|
||||||
other->instruction = CSYNC_INSTRUCTION_RENAME;
|
|
||||||
other->destpath = c_strdup( cur->path );
|
|
||||||
|
|
||||||
if( !c_streq(cur->file_id, "") ) {
|
|
||||||
csync_vio_set_file_id( other->file_id, cur->file_id );
|
|
||||||
}
|
|
||||||
other->inode = cur->inode;
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
} else if (other->instruction == CSYNC_INSTRUCTION_NEW) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "OOOO=> NEW detected in other tree!");
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_CONFLICT;
|
|
||||||
} else {
|
|
||||||
assert(other->type != CSYNC_FTW_TYPE_DIR);
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
other->instruction = CSYNC_INSTRUCTION_SYNC;
|
|
||||||
}
|
|
||||||
csync_file_stat_free(tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
bool is_conflict = true;
|
|
||||||
/*
|
|
||||||
* file found on the other replica
|
|
||||||
*/
|
|
||||||
other = (csync_file_stat_t *) node->data;
|
|
||||||
|
|
||||||
switch (cur->instruction) {
|
|
||||||
case CSYNC_INSTRUCTION_UPDATE_METADATA:
|
|
||||||
if (other->instruction == CSYNC_INSTRUCTION_UPDATE_METADATA && ctx->current == LOCAL_REPLICA) {
|
|
||||||
// Remote wins, the SyncEngine will pick relevant local metadata since the remote tree is walked last.
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CSYNC_INSTRUCTION_EVAL_RENAME:
|
|
||||||
/* If the file already exist on the other side, we have a conflict.
|
|
||||||
Abort the rename and consider it is a new file. */
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NEW;
|
|
||||||
/* fall trough */
|
|
||||||
/* file on current replica is changed or new */
|
|
||||||
case CSYNC_INSTRUCTION_EVAL:
|
|
||||||
case CSYNC_INSTRUCTION_NEW:
|
|
||||||
// This operation is usually a no-op and will by default return false
|
|
||||||
if (csync_file_locked_or_open(ctx->local.uri, cur->path)) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "[Reconciler] IGNORING file %s/%s since it is locked / open", ctx->local.uri, cur->path);
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_ERROR;
|
|
||||||
if (cur->error_status == CSYNC_STATUS_OK) // don't overwrite error
|
|
||||||
cur->error_status = CYSNC_STATUS_FILE_LOCKED_OR_OPEN;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
//CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "[Reconciler] not ignoring file %s/%s", ctx->local.uri, cur->path);
|
|
||||||
}
|
|
||||||
switch (other->instruction) {
|
|
||||||
/* file on other replica is changed or new */
|
|
||||||
case CSYNC_INSTRUCTION_NEW:
|
|
||||||
case CSYNC_INSTRUCTION_EVAL:
|
|
||||||
if (other->type == CSYNC_FTW_TYPE_DIR &&
|
|
||||||
cur->type == CSYNC_FTW_TYPE_DIR) {
|
|
||||||
// Folders of the same path are always considered equals
|
|
||||||
is_conflict = false;
|
|
||||||
} else {
|
|
||||||
is_conflict = ((other->size != cur->size) || (other->modtime != cur->modtime));
|
|
||||||
// FIXME: do a binary comparision of the file here because of the following
|
|
||||||
// edge case:
|
|
||||||
// The files could still have different content, even though the mtime
|
|
||||||
// and size are the same.
|
|
||||||
}
|
|
||||||
if (ctx->current == REMOTE_REPLICA) {
|
|
||||||
// If the files are considered equal, only update the DB with the etag from remote
|
|
||||||
cur->instruction = is_conflict ? CSYNC_INSTRUCTION_CONFLICT : CSYNC_INSTRUCTION_UPDATE_METADATA;
|
|
||||||
other->instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
} else {
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
other->instruction = is_conflict ? CSYNC_INSTRUCTION_CONFLICT : CSYNC_INSTRUCTION_UPDATE_METADATA;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
/* file on the other replica has not been modified */
|
|
||||||
case CSYNC_INSTRUCTION_NONE:
|
|
||||||
case CSYNC_INSTRUCTION_UPDATE_METADATA:
|
|
||||||
if (cur->type != other->type) {
|
|
||||||
// If the type of the entity changed, it's like NEW, but
|
|
||||||
// needs to delete the other entity first.
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_TYPE_CHANGE;
|
|
||||||
other->instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
} else if (cur->type == CSYNC_FTW_TYPE_DIR) {
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
|
|
||||||
other->instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
} else {
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_SYNC;
|
|
||||||
other->instruction = CSYNC_INSTRUCTION_NONE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CSYNC_INSTRUCTION_IGNORE:
|
|
||||||
cur->instruction = CSYNC_INSTRUCTION_IGNORE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//hide instruction NONE messages when log level is set to debug,
|
|
||||||
//only show these messages on log level trace
|
|
||||||
const char *repo = ctx->current == REMOTE_REPLICA ? "server" : "client";
|
|
||||||
if(cur->instruction ==CSYNC_INSTRUCTION_NONE)
|
|
||||||
{
|
|
||||||
if(cur->type == CSYNC_FTW_TYPE_DIR)
|
|
||||||
{
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE,
|
|
||||||
"%-30s %s dir: %s",
|
|
||||||
csync_instruction_str(cur->instruction),
|
|
||||||
repo,
|
|
||||||
cur->path);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE,
|
|
||||||
"%-30s %s file: %s",
|
|
||||||
csync_instruction_str(cur->instruction),
|
|
||||||
repo,
|
|
||||||
cur->path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(cur->type == CSYNC_FTW_TYPE_DIR)
|
|
||||||
{
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
|
||||||
"%-30s %s dir: %s",
|
|
||||||
csync_instruction_str(cur->instruction),
|
|
||||||
repo,
|
|
||||||
cur->path);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
|
||||||
"%-30s %s file: %s",
|
|
||||||
csync_instruction_str(cur->instruction),
|
|
||||||
repo,
|
|
||||||
cur->path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_reconcile_updates(CSYNC *ctx) {
|
|
||||||
int rc;
|
|
||||||
c_rbtree_t *tree = NULL;
|
|
||||||
|
|
||||||
switch (ctx->current) {
|
|
||||||
case LOCAL_REPLICA:
|
|
||||||
tree = ctx->local.tree;
|
|
||||||
break;
|
|
||||||
case REMOTE_REPLICA:
|
|
||||||
tree = ctx->remote.tree;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = c_rbtree_walk(tree, (void *) ctx, _csync_merge_algorithm_visitor);
|
|
||||||
if( rc < 0 ) {
|
|
||||||
ctx->status_code = CSYNC_STATUS_RECONCILE_ERROR;
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* vim: set ts=8 sw=2 et cindent: */
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
/*
|
|
||||||
* libcsync -- a library to sync a directory with another
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012 by Olivier Goffart <ogoffart@woboq.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "csync_private.h"
|
|
||||||
#include "csync_rename.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
static std::string _parentDir(const std::string &path) {
|
|
||||||
int len = path.length();
|
|
||||||
while(len > 0 && path[len-1]!='/') len--;
|
|
||||||
while(len > 0 && path[len-1]=='/') len--;
|
|
||||||
return path.substr(0, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct csync_rename_s {
|
|
||||||
static csync_rename_s *get(CSYNC *ctx) {
|
|
||||||
if (!ctx->rename_info) {
|
|
||||||
ctx->rename_info = new csync_rename_s;
|
|
||||||
}
|
|
||||||
return reinterpret_cast<csync_rename_s *>(ctx->rename_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::map<std::string, std::string> folder_renamed_to; // map from->to
|
|
||||||
std::map<std::string, std::string> folder_renamed_from; // map to->from
|
|
||||||
|
|
||||||
struct renameop {
|
|
||||||
csync_file_stat_t *st;
|
|
||||||
bool operator<(const renameop &other) const {
|
|
||||||
return strlen(st->destpath) < strlen(other.st->destpath);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
std::vector<renameop> todo;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
void csync_rename_destroy(CSYNC* ctx)
|
|
||||||
{
|
|
||||||
delete reinterpret_cast<csync_rename_s *>(ctx->rename_info);
|
|
||||||
ctx->rename_info = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void csync_rename_record(CSYNC* ctx, const char* from, const char* to)
|
|
||||||
{
|
|
||||||
csync_rename_s::get(ctx)->folder_renamed_to[from] = to;
|
|
||||||
csync_rename_s::get(ctx)->folder_renamed_from[to] = from;
|
|
||||||
}
|
|
||||||
|
|
||||||
char* csync_rename_adjust_path(CSYNC* ctx, const char* path)
|
|
||||||
{
|
|
||||||
csync_rename_s* d = csync_rename_s::get(ctx);
|
|
||||||
for (std::string p = _parentDir(path); !p.empty(); p = _parentDir(p)) {
|
|
||||||
std::map< std::string, std::string >::iterator it = d->folder_renamed_to.find(p);
|
|
||||||
if (it != d->folder_renamed_to.end()) {
|
|
||||||
std::string rep = it->second + (path + p.length());
|
|
||||||
return c_strdup(rep.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return c_strdup(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
char* csync_rename_adjust_path_source(CSYNC* ctx, const char* path)
|
|
||||||
{
|
|
||||||
csync_rename_s* d = csync_rename_s::get(ctx);
|
|
||||||
for (std::string p = _parentDir(path); !p.empty(); p = _parentDir(p)) {
|
|
||||||
std::map< std::string, std::string >::iterator it = d->folder_renamed_from.find(p);
|
|
||||||
if (it != d->folder_renamed_from.end()) {
|
|
||||||
std::string rep = it->second + (path + p.length());
|
|
||||||
return c_strdup(rep.c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return c_strdup(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool csync_rename_count(CSYNC *ctx) {
|
|
||||||
csync_rename_s* d = csync_rename_s::get(ctx);
|
|
||||||
return d->folder_renamed_from.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,652 +0,0 @@
|
|||||||
/*
|
|
||||||
* libcsync -- a library to sync a directory with another
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config_csync.h"
|
|
||||||
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
#define _GNU_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sqlite3.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <inttypes.h>
|
|
||||||
|
|
||||||
#include "c_lib.h"
|
|
||||||
#include "csync_private.h"
|
|
||||||
#include "csync_statedb.h"
|
|
||||||
#include "csync_util.h"
|
|
||||||
#include "csync_misc.h"
|
|
||||||
#include "csync_exclude.h"
|
|
||||||
|
|
||||||
#include "c_string.h"
|
|
||||||
#include "c_jhash.h"
|
|
||||||
#include "csync_time.h"
|
|
||||||
|
|
||||||
#define CSYNC_LOG_CATEGORY_NAME "csync.statedb"
|
|
||||||
#include "csync_log.h"
|
|
||||||
#include "csync_rename.h"
|
|
||||||
|
|
||||||
#define BUF_SIZE 16
|
|
||||||
|
|
||||||
#define sqlite_open(A, B) sqlite3_open_v2(A,B, SQLITE_OPEN_READONLY+SQLITE_OPEN_NOMUTEX, NULL)
|
|
||||||
|
|
||||||
#define SQLTM_TIME 150
|
|
||||||
#define SQLTM_COUNT 10
|
|
||||||
|
|
||||||
#define SQLITE_BUSY_HANDLED(F) if(1) { \
|
|
||||||
int n = 0; \
|
|
||||||
do { rc = F ; \
|
|
||||||
if( (rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED) ) { \
|
|
||||||
n++; \
|
|
||||||
csync_sleep(SQLTM_TIME); \
|
|
||||||
} \
|
|
||||||
}while( (n < SQLTM_COUNT) && ((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED))); \
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void csync_set_statedb_exists(CSYNC *ctx, int val) {
|
|
||||||
ctx->statedb.exists = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_get_statedb_exists(CSYNC *ctx) {
|
|
||||||
return ctx->statedb.exists;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _csync_check_db_integrity(sqlite3 *db) {
|
|
||||||
c_strlist_t *result = NULL;
|
|
||||||
int rc = -1;
|
|
||||||
|
|
||||||
result = csync_statedb_query(db, "PRAGMA quick_check;");
|
|
||||||
if (result != NULL) {
|
|
||||||
/* There is a result */
|
|
||||||
if (result->count > 0) {
|
|
||||||
if (c_streq(result->vector[0], "ok")) {
|
|
||||||
rc = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
c_strlist_destroy(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
if( sqlite3_threadsafe() == 0 ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "* WARNING: SQLite module is not threadsafe!");
|
|
||||||
rc = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _csync_statedb_is_empty(sqlite3 *db) {
|
|
||||||
c_strlist_t *result = NULL;
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
result = csync_statedb_query(db, "SELECT COUNT(phash) FROM metadata LIMIT 1 OFFSET 0;");
|
|
||||||
if (result == NULL) {
|
|
||||||
rc = 1;
|
|
||||||
}
|
|
||||||
c_strlist_destroy(result);
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
static void sqlite_profile( void *x, const char* sql, sqlite3_uint64 time)
|
|
||||||
{
|
|
||||||
(void)x;
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
|
|
||||||
"_SQL_ %s: %llu", sql, time);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int csync_statedb_load(CSYNC *ctx, const char *statedb, sqlite3 **pdb) {
|
|
||||||
int rc = -1;
|
|
||||||
c_strlist_t *result = NULL;
|
|
||||||
sqlite3 *db = NULL;
|
|
||||||
|
|
||||||
if( !ctx ) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx->statedb.db) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "ERR: DB already open");
|
|
||||||
ctx->status_code = CSYNC_STATUS_PARAM_ERROR;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->statedb.lastReturnValue = SQLITE_OK;
|
|
||||||
|
|
||||||
/* Openthe database */
|
|
||||||
if (sqlite_open(statedb, &db) != SQLITE_OK) {
|
|
||||||
const char *errmsg= sqlite3_errmsg(ctx->statedb.db);
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "ERR: Failed to sqlite3 open statedb - bail out: %s.",
|
|
||||||
errmsg ? errmsg : "<no sqlite3 errormsg>");
|
|
||||||
|
|
||||||
rc = -1;
|
|
||||||
ctx->status_code = CSYNC_STATUS_STATEDB_LOAD_ERROR;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_csync_check_db_integrity(db) != 0) {
|
|
||||||
const char *errmsg= sqlite3_errmsg(db);
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "ERR: sqlite3 integrity check failed - bail out: %s.",
|
|
||||||
errmsg ? errmsg : "<no sqlite3 errormsg>");
|
|
||||||
rc = -1;
|
|
||||||
ctx->status_code = CSYNC_STATUS_STATEDB_CORRUPTED;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_csync_statedb_is_empty(db)) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "statedb contents doesn't exist");
|
|
||||||
csync_set_statedb_exists(ctx, 0);
|
|
||||||
} else {
|
|
||||||
csync_set_statedb_exists(ctx, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Print out the version */
|
|
||||||
//
|
|
||||||
result = csync_statedb_query(db, "SELECT sqlite_version();");
|
|
||||||
if (result && result->count >= 1) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "sqlite3 version \"%s\"", *result->vector);
|
|
||||||
}
|
|
||||||
c_strlist_destroy(result);
|
|
||||||
|
|
||||||
/* optimization for speeding up SQLite */
|
|
||||||
result = csync_statedb_query(db, "PRAGMA synchronous = NORMAL;");
|
|
||||||
c_strlist_destroy(result);
|
|
||||||
result = csync_statedb_query(db, "PRAGMA case_sensitive_like = ON;");
|
|
||||||
c_strlist_destroy(result);
|
|
||||||
|
|
||||||
/* set a busy handler with 5 seconds timeout */
|
|
||||||
sqlite3_busy_timeout(db, 5000);
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
sqlite3_profile(db, sqlite_profile, 0 );
|
|
||||||
#endif
|
|
||||||
*pdb = db;
|
|
||||||
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "Success");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
out:
|
|
||||||
sqlite3_close(db);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_statedb_close(CSYNC *ctx) {
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
if (!ctx) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* deallocate query resources */
|
|
||||||
if( ctx->statedb.by_fileid_stmt ) {
|
|
||||||
sqlite3_finalize(ctx->statedb.by_fileid_stmt);
|
|
||||||
ctx->statedb.by_fileid_stmt = NULL;
|
|
||||||
}
|
|
||||||
if( ctx->statedb.by_hash_stmt ) {
|
|
||||||
sqlite3_finalize(ctx->statedb.by_hash_stmt);
|
|
||||||
ctx->statedb.by_hash_stmt = NULL;
|
|
||||||
}
|
|
||||||
if( ctx->statedb.by_inode_stmt) {
|
|
||||||
sqlite3_finalize(ctx->statedb.by_inode_stmt);
|
|
||||||
ctx->statedb.by_inode_stmt = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->statedb.lastReturnValue = SQLITE_OK;
|
|
||||||
|
|
||||||
int sr = sqlite3_close(ctx->statedb.db);
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "sqlite3_close=%d", sr);
|
|
||||||
|
|
||||||
ctx->statedb.db = 0;
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define METADATA_COLUMNS "phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid, remotePerm, filesize, ignoredChildrenRemote, contentChecksum, contentChecksumTypeId"
|
|
||||||
|
|
||||||
// This funciton parses a line from the metadata table into the given csync_file_stat
|
|
||||||
// structure which it is also allocating.
|
|
||||||
// Note that this function calls laso sqlite3_step to actually get the info from db and
|
|
||||||
// returns the sqlite return type.
|
|
||||||
static int _csync_file_stat_from_metadata_table( csync_file_stat_t **st, sqlite3_stmt *stmt )
|
|
||||||
{
|
|
||||||
int rc = SQLITE_ERROR;
|
|
||||||
int column_count;
|
|
||||||
int len;
|
|
||||||
|
|
||||||
if( ! stmt ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Fatal: Statement is NULL.");
|
|
||||||
return SQLITE_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
column_count = sqlite3_column_count(stmt);
|
|
||||||
|
|
||||||
SQLITE_BUSY_HANDLED( sqlite3_step(stmt) );
|
|
||||||
|
|
||||||
if( rc == SQLITE_ROW ) {
|
|
||||||
if(column_count > 7) {
|
|
||||||
const char *name;
|
|
||||||
|
|
||||||
/* phash, pathlen, path, inode, uid, gid, mode, modtime */
|
|
||||||
len = sqlite3_column_int(stmt, 1);
|
|
||||||
*st = c_malloc(sizeof(csync_file_stat_t) + len + 1);
|
|
||||||
/* clear the whole structure */
|
|
||||||
ZERO_STRUCTP(*st);
|
|
||||||
|
|
||||||
/* The query suceeded so use the phash we pass to the function. */
|
|
||||||
(*st)->phash = sqlite3_column_int64(stmt, 0);
|
|
||||||
|
|
||||||
(*st)->pathlen = sqlite3_column_int(stmt, 1);
|
|
||||||
name = (const char*) sqlite3_column_text(stmt, 2);
|
|
||||||
memcpy((*st)->path, (len ? name : ""), len + 1);
|
|
||||||
(*st)->inode = sqlite3_column_int64(stmt,3);
|
|
||||||
(*st)->mode = sqlite3_column_int(stmt, 6);
|
|
||||||
(*st)->modtime = strtoul((char*)sqlite3_column_text(stmt, 7), NULL, 10);
|
|
||||||
|
|
||||||
if(*st && column_count > 8 ) {
|
|
||||||
(*st)->type = sqlite3_column_int(stmt, 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(column_count > 9 && sqlite3_column_text(stmt, 9)) {
|
|
||||||
(*st)->etag = c_strdup( (char*) sqlite3_column_text(stmt, 9) );
|
|
||||||
}
|
|
||||||
if(column_count > 10 && sqlite3_column_text(stmt,10)) {
|
|
||||||
csync_vio_set_file_id((*st)->file_id, (char*) sqlite3_column_text(stmt, 10));
|
|
||||||
}
|
|
||||||
if(column_count > 11 && sqlite3_column_text(stmt,11)) {
|
|
||||||
strncpy((*st)->remotePerm,
|
|
||||||
(char*) sqlite3_column_text(stmt, 11),
|
|
||||||
REMOTE_PERM_BUF_SIZE);
|
|
||||||
}
|
|
||||||
if(column_count > 12 && sqlite3_column_int64(stmt,12)) {
|
|
||||||
(*st)->size = sqlite3_column_int64(stmt, 12);
|
|
||||||
}
|
|
||||||
if(column_count > 13) {
|
|
||||||
(*st)->has_ignored_files = sqlite3_column_int(stmt, 13);
|
|
||||||
}
|
|
||||||
if(column_count > 15 && sqlite3_column_int(stmt, 15)) {
|
|
||||||
(*st)->checksum = c_strdup( (char*) sqlite3_column_text(stmt, 14));
|
|
||||||
(*st)->checksumTypeId = sqlite3_column_int(stmt, 15);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if( rc != SQLITE_DONE ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "WARN: Query results in %d", rc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* caller must free the memory */
|
|
||||||
csync_file_stat_t *csync_statedb_get_stat_by_hash(CSYNC *ctx,
|
|
||||||
uint64_t phash)
|
|
||||||
{
|
|
||||||
csync_file_stat_t *st = NULL;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
if( !ctx || ctx->db_is_empty ) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ctx->statedb.by_hash_stmt == NULL ) {
|
|
||||||
const char *hash_query = "SELECT " METADATA_COLUMNS " FROM metadata WHERE phash=?1";
|
|
||||||
|
|
||||||
SQLITE_BUSY_HANDLED(sqlite3_prepare_v2(ctx->statedb.db, hash_query, strlen(hash_query), &ctx->statedb.by_hash_stmt, NULL));
|
|
||||||
ctx->statedb.lastReturnValue = rc;
|
|
||||||
if( rc != SQLITE_OK ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for hash query.");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ctx->statedb.by_hash_stmt == NULL ) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
sqlite3_bind_int64(ctx->statedb.by_hash_stmt, 1, (long long signed int)phash);
|
|
||||||
|
|
||||||
rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_hash_stmt);
|
|
||||||
ctx->statedb.lastReturnValue = rc;
|
|
||||||
if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata: %d!", rc);
|
|
||||||
}
|
|
||||||
sqlite3_reset(ctx->statedb.by_hash_stmt);
|
|
||||||
|
|
||||||
return st;
|
|
||||||
}
|
|
||||||
|
|
||||||
csync_file_stat_t *csync_statedb_get_stat_by_file_id(CSYNC *ctx,
|
|
||||||
const char *file_id ) {
|
|
||||||
csync_file_stat_t *st = NULL;
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
if (!file_id) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (c_streq(file_id, "")) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !ctx || ctx->db_is_empty ) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ctx->statedb.by_fileid_stmt == NULL ) {
|
|
||||||
const char *query = "SELECT " METADATA_COLUMNS " FROM metadata WHERE fileid=?1";
|
|
||||||
|
|
||||||
SQLITE_BUSY_HANDLED(sqlite3_prepare_v2(ctx->statedb.db, query, strlen(query), &ctx->statedb.by_fileid_stmt, NULL));
|
|
||||||
ctx->statedb.lastReturnValue = rc;
|
|
||||||
if( rc != SQLITE_OK ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for file id query.");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* bind the query value */
|
|
||||||
sqlite3_bind_text(ctx->statedb.by_fileid_stmt, 1, file_id, -1, SQLITE_STATIC);
|
|
||||||
|
|
||||||
rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_fileid_stmt);
|
|
||||||
ctx->statedb.lastReturnValue = rc;
|
|
||||||
if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata: %d!", rc);
|
|
||||||
}
|
|
||||||
// clear the resources used by the statement.
|
|
||||||
sqlite3_reset(ctx->statedb.by_fileid_stmt);
|
|
||||||
|
|
||||||
return st;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* caller must free the memory */
|
|
||||||
csync_file_stat_t *csync_statedb_get_stat_by_inode(CSYNC *ctx,
|
|
||||||
uint64_t inode)
|
|
||||||
{
|
|
||||||
csync_file_stat_t *st = NULL;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
if (!inode) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !ctx || ctx->db_is_empty ) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ctx->statedb.by_inode_stmt == NULL ) {
|
|
||||||
const char *inode_query = "SELECT " METADATA_COLUMNS " FROM metadata WHERE inode=?1";
|
|
||||||
|
|
||||||
SQLITE_BUSY_HANDLED(sqlite3_prepare_v2(ctx->statedb.db, inode_query, strlen(inode_query), &ctx->statedb.by_inode_stmt, NULL));
|
|
||||||
ctx->statedb.lastReturnValue = rc;
|
|
||||||
if( rc != SQLITE_OK ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for inode query.");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ctx->statedb.by_inode_stmt == NULL ) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
sqlite3_bind_int64(ctx->statedb.by_inode_stmt, 1, (long long signed int)inode);
|
|
||||||
|
|
||||||
rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_inode_stmt);
|
|
||||||
ctx->statedb.lastReturnValue = rc;
|
|
||||||
if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata by inode: %d!", rc);
|
|
||||||
}
|
|
||||||
sqlite3_reset(ctx->statedb.by_inode_stmt);
|
|
||||||
|
|
||||||
return st;
|
|
||||||
}
|
|
||||||
|
|
||||||
int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
|
|
||||||
int rc;
|
|
||||||
sqlite3_stmt *stmt = NULL;
|
|
||||||
int64_t cnt = 0;
|
|
||||||
|
|
||||||
if( !path ) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !ctx || ctx->db_is_empty ) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Select the entries for anything that starts with (path+'/')
|
|
||||||
* In other words, anything that is between path+'/' and path+'0',
|
|
||||||
* (because '0' follows '/' in ascii)
|
|
||||||
*/
|
|
||||||
const char *below_path_query = "SELECT " METADATA_COLUMNS " FROM metadata WHERE path > (?||'/') AND path < (?||'0') ORDER BY path||'/' ASC";
|
|
||||||
SQLITE_BUSY_HANDLED(sqlite3_prepare_v2(ctx->statedb.db, below_path_query, -1, &stmt, NULL));
|
|
||||||
ctx->statedb.lastReturnValue = rc;
|
|
||||||
if( rc != SQLITE_OK ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for below path query.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stmt == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
sqlite3_bind_text(stmt, 1, path, -1, SQLITE_STATIC);
|
|
||||||
sqlite3_bind_text(stmt, 2, path, -1, SQLITE_STATIC);
|
|
||||||
|
|
||||||
cnt = 0;
|
|
||||||
|
|
||||||
ctx->statedb.lastReturnValue = rc;
|
|
||||||
do {
|
|
||||||
csync_file_stat_t *st = NULL;
|
|
||||||
|
|
||||||
rc = _csync_file_stat_from_metadata_table( &st, stmt);
|
|
||||||
if( st ) {
|
|
||||||
/* When selective sync is used, the database may have subtrees with a parent
|
|
||||||
* whose etag (md5) is _invalid_. These are ignored and shall not appear in the
|
|
||||||
* remote tree.
|
|
||||||
* Sometimes folders that are not ignored by selective sync get marked as
|
|
||||||
* _invalid_, but that is not a problem as the next discovery will retrieve
|
|
||||||
* their correct etags again and we don't run into this case.
|
|
||||||
*/
|
|
||||||
if( c_streq(st->etag, "_invalid_") ) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "%s selective sync excluded", st->path);
|
|
||||||
char *skipbase = c_strdup(st->path);
|
|
||||||
skipbase[st->pathlen] = '/';
|
|
||||||
int skiplen = st->pathlen + 1;
|
|
||||||
|
|
||||||
/* Skip over all entries with the same base path. Note that this depends
|
|
||||||
* strongly on the ordering of the retrieved items. */
|
|
||||||
do {
|
|
||||||
csync_file_stat_free(st);
|
|
||||||
rc = _csync_file_stat_from_metadata_table( &st, stmt);
|
|
||||||
if( st && strncmp(st->path, skipbase, skiplen) != 0 ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "%s selective sync excluded because the parent is", st->path);
|
|
||||||
} while( rc == SQLITE_ROW );
|
|
||||||
|
|
||||||
/* End of data? */
|
|
||||||
if( rc != SQLITE_ROW || !st ) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for exclusion from the tree.
|
|
||||||
* Note that this is only a safety net in case the ignore list changes
|
|
||||||
* without a full remote discovery being triggered. */
|
|
||||||
CSYNC_EXCLUDE_TYPE excluded = csync_excluded_traversal(ctx->excludes, st->path, st->type);
|
|
||||||
if (excluded != CSYNC_NOT_EXCLUDED) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "%s excluded (%d)", st->path, excluded);
|
|
||||||
|
|
||||||
if (excluded == CSYNC_FILE_EXCLUDE_AND_REMOVE
|
|
||||||
|| excluded == CSYNC_FILE_SILENTLY_EXCLUDED) {
|
|
||||||
csync_file_stat_free(st);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
st->instruction = CSYNC_INSTRUCTION_IGNORE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* store into result list. */
|
|
||||||
if (c_rbtree_insert(ctx->remote.tree, (void *) st) < 0) {
|
|
||||||
csync_file_stat_free(st);
|
|
||||||
ctx->status_code = CSYNC_STATUS_TREE_ERROR;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
cnt++;
|
|
||||||
}
|
|
||||||
} while( rc == SQLITE_ROW );
|
|
||||||
|
|
||||||
ctx->statedb.lastReturnValue = rc;
|
|
||||||
if( rc != SQLITE_DONE ) {
|
|
||||||
ctx->status_code = CSYNC_STATUS_TREE_ERROR;
|
|
||||||
} else {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "%" PRId64 " entries read below path %s from db.", cnt, path);
|
|
||||||
}
|
|
||||||
sqlite3_finalize(stmt);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* query the statedb, caller must free the memory */
|
|
||||||
c_strlist_t *csync_statedb_query(sqlite3 *db,
|
|
||||||
const char *statement) {
|
|
||||||
int err = SQLITE_OK;
|
|
||||||
int rc = SQLITE_OK;
|
|
||||||
size_t i = 0;
|
|
||||||
size_t busy_count = 0;
|
|
||||||
size_t retry_count = 0;
|
|
||||||
size_t column_count = 0;
|
|
||||||
sqlite3_stmt *stmt;
|
|
||||||
const char *tail = NULL;
|
|
||||||
const char *field = NULL;
|
|
||||||
c_strlist_t *result = NULL;
|
|
||||||
int row = 0;
|
|
||||||
|
|
||||||
do {
|
|
||||||
/* compile SQL program into a virtual machine, reattempteing if busy */
|
|
||||||
do {
|
|
||||||
if (busy_count) {
|
|
||||||
csync_sleep(100);
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "sqlite3_prepare: BUSY counter: %zu", busy_count);
|
|
||||||
}
|
|
||||||
err = sqlite3_prepare(db, statement, -1, &stmt, &tail);
|
|
||||||
} while (err == SQLITE_BUSY && busy_count ++ < 120);
|
|
||||||
|
|
||||||
if (err != SQLITE_OK) {
|
|
||||||
if (err == SQLITE_BUSY) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Gave up waiting for lock to clear");
|
|
||||||
}
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN,
|
|
||||||
"sqlite3_compile error: %s - on query %s",
|
|
||||||
sqlite3_errmsg(db), statement);
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
busy_count = 0;
|
|
||||||
column_count = sqlite3_column_count(stmt);
|
|
||||||
|
|
||||||
/* execute virtual machine by iterating over rows */
|
|
||||||
for(;;) {
|
|
||||||
err = sqlite3_step(stmt);
|
|
||||||
|
|
||||||
if (err == SQLITE_BUSY) {
|
|
||||||
if (busy_count++ > 120) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Busy counter has reached its maximum. Aborting this sql statement");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
csync_sleep(100);
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "sqlite3_step: BUSY counter: %zu", busy_count);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err == SQLITE_MISUSE) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "sqlite3_step: MISUSE!!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err == SQLITE_DONE) {
|
|
||||||
if (result == NULL) {
|
|
||||||
result = c_strlist_new(1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err == SQLITE_ERROR) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
row++;
|
|
||||||
if( result ) {
|
|
||||||
result = c_strlist_expand(result, row*column_count);
|
|
||||||
} else {
|
|
||||||
result = c_strlist_new(column_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == NULL) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* iterate over columns */
|
|
||||||
for (i = 0; i < column_count; i++) {
|
|
||||||
field = (const char *) sqlite3_column_text(stmt, i);
|
|
||||||
if (!field)
|
|
||||||
field = "";
|
|
||||||
// CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "sqlite3_column_text: %s", field);
|
|
||||||
if (c_strlist_add(result, field) < 0) {
|
|
||||||
c_strlist_destroy(result);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} /* end infinite for loop */
|
|
||||||
|
|
||||||
/* deallocate vm resources */
|
|
||||||
rc = sqlite3_finalize(stmt);
|
|
||||||
|
|
||||||
if (err != SQLITE_DONE && rc != SQLITE_SCHEMA) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "sqlite_step error: %s - on query: %s", sqlite3_errmsg(db), statement);
|
|
||||||
if (result != NULL) {
|
|
||||||
c_strlist_destroy(result);
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rc == SQLITE_SCHEMA) {
|
|
||||||
retry_count ++;
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "SQLITE_SCHEMA error occurred on query: %s", statement);
|
|
||||||
if (retry_count < 10) {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Retrying now.");
|
|
||||||
} else {
|
|
||||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "RETRY count has reached its maximum. Aborting statement: %s", statement);
|
|
||||||
if (result != NULL) {
|
|
||||||
c_strlist_destroy(result);
|
|
||||||
}
|
|
||||||
result = c_strlist_new(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (rc == SQLITE_SCHEMA && retry_count < 10);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* vim: set ts=8 sw=2 et cindent: */
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user