Sun, 17 Dec 2023 14:25:34 +0100
[Makefile] fix missing rules preventing dry-runs
We have to support dry-runs, because many IDEs are using
dry-runs to collect build information.
Some rules have dependencies that expect certain files or
directories to be just present. We added respective build
rules which invoke the test program. This way, the behavior
when running make normally is exactly the same, but dry-runs
are also not failing now.
517
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | * Copyright 2019 Olaf Wintermann. All rights reserved. |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | * |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | * Redistribution and use in source and binary forms, with or without |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | * modification, are permitted provided that the following conditions are met: |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | * |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | * 1. Redistributions of source code must retain the above copyright |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer. |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | * |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | * 2. Redistributions in binary form must reproduce the above copyright |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | * notice, this list of conditions and the following disclaimer in the |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | * documentation and/or other materials provided with the distribution. |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | * |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | * POSSIBILITY OF SUCH DAMAGE. |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | */ |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | #ifndef FINFO_H |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | #define FINFO_H |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | #include <libidav/webdav.h> |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | #include <inttypes.h> |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | #include <sys/stat.h> |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
36 | #include <cx/string.h> |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
37 | |
608
3e4c0285a868
fix build on windows
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
526
diff
changeset
|
38 | #include "system.h" |
3e4c0285a868
fix build on windows
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
526
diff
changeset
|
39 | |
517
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
40 | #ifdef __cplusplus |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
41 | extern "C" { |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
42 | #endif |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | |
646
37a8bfae995e
change metadata config
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
618
diff
changeset
|
44 | #define FINFO_MTIME 1 |
517
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | #define FINFO_OWNER 2 |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | #define FINFO_MODE 4 |
520
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
517
diff
changeset
|
47 | #define FINFO_XATTR 8 |
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
517
diff
changeset
|
48 | |
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
517
diff
changeset
|
49 | typedef struct XAttributes { |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
50 | size_t nattr; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
51 | char **names; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
52 | cxmutstr *values; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
53 | char *hash; |
520
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
517
diff
changeset
|
54 | } XAttributes; |
517
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
55 | |
526
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
522
diff
changeset
|
56 | typedef struct FileInfo { |
747
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
57 | time_t last_modified; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
58 | mode_t mode; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
59 | uid_t uid; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
60 | gid_t gid; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
61 | DavBool date_set; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
62 | DavBool mode_set; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
63 | DavBool uid_set; |
efbd59642577
ucx 3 update, basic dav commands work, most stuff is still broken
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
646
diff
changeset
|
64 | DavBool gid_set; |
526
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
522
diff
changeset
|
65 | } FileInfo; |
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
522
diff
changeset
|
66 | |
618
4b34d12cf211
exclude tag xattr from xattribute sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
608
diff
changeset
|
67 | typedef int(*xattr_filter_func)(const char*,void*); |
4b34d12cf211
exclude tag xattr from xattribute sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
608
diff
changeset
|
68 | |
526
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
522
diff
changeset
|
69 | uint32_t parse_finfo_settings(const char *str, char **unknown); |
517
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
70 | |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
71 | int resource_set_finfo(const char *path, DavResource *res, uint32_t finfo); |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | int resource_set_finfo_s(struct stat *s, DavResource *res, uint32_t finfo); |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
73 | |
526
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
522
diff
changeset
|
74 | XAttributes* xml_get_attributes(DavXmlNode *xml); |
618
4b34d12cf211
exclude tag xattr from xattribute sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
608
diff
changeset
|
75 | XAttributes* file_get_attributes( |
4b34d12cf211
exclude tag xattr from xattribute sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
608
diff
changeset
|
76 | const char *path, |
4b34d12cf211
exclude tag xattr from xattribute sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
608
diff
changeset
|
77 | xattr_filter_func filter, |
4b34d12cf211
exclude tag xattr from xattribute sync
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
608
diff
changeset
|
78 | void *filterdata); |
520
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
517
diff
changeset
|
79 | int resource_set_xattr(DavResource *res, XAttributes *xattr); |
da2b0cc44e4f
adds xml attribute support and xattr property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
517
diff
changeset
|
80 | void xattributes_free(XAttributes *xattr); |
517
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81 | |
526
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
522
diff
changeset
|
82 | char* get_xattr_hash(DavXmlNode *finfo); |
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
522
diff
changeset
|
83 | |
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
522
diff
changeset
|
84 | void finfo_get_values(DavXmlNode *xml, FileInfo *outval); |
e3c0440bd599
adds metadata support to dav-sync pull
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
522
diff
changeset
|
85 | |
517
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86 | #ifdef __cplusplus |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87 | } |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88 | #endif |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
89 | |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 | #endif /* FINFO_H */ |
8531b63accae
adds option to store a file info property
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
91 |