1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
5 #include "generator-setup.h"
7 #include "mkdir-label.h"
10 int lookup_paths_mkdir_generator(LookupPaths
*p
) {
15 if (!p
->generator
|| !p
->generator_early
|| !p
->generator_late
)
18 r
= mkdir_p_label(p
->generator
, 0755);
20 q
= mkdir_p_label(p
->generator_early
, 0755);
24 q
= mkdir_p_label(p
->generator_late
, 0755);
31 void lookup_paths_trim_generator(LookupPaths
*p
) {
37 (void) rmdir(p
->generator
);
38 if (p
->generator_early
)
39 (void) rmdir(p
->generator_early
);
40 if (p
->generator_late
)
41 (void) rmdir(p
->generator_late
);
44 void lookup_paths_flush_generator(LookupPaths
*p
) {
47 /* Flush the generated unit files in full */
50 (void) rm_rf(p
->generator
, REMOVE_ROOT
|REMOVE_PHYSICAL
);
51 if (p
->generator_early
)
52 (void) rm_rf(p
->generator_early
, REMOVE_ROOT
|REMOVE_PHYSICAL
);
53 if (p
->generator_late
)
54 (void) rm_rf(p
->generator_late
, REMOVE_ROOT
|REMOVE_PHYSICAL
);
57 (void) rm_rf(p
->temporary_dir
, REMOVE_ROOT
|REMOVE_PHYSICAL
);