}
INFO(build->pakfire, "Building package '%s'...\n", name);
+ DEBUG(build->pakfire, " buildroot = %s\n", buildroot);
// Fetch build architecture
const char* arch = pakfire_get_arch(build->pakfire);
return r;
}
+static int __pakfire_build_unpackaged_file(struct pakfire* pakfire,
+ struct pakfire_file* file, void* p) {
+ char* s = pakfire_file_dump(file);
+ if (s)
+ ERROR(pakfire, "%s\n", s);
+
+ return 0;
+}
+
+static int pakfire_build_check_unpackaged_files(struct pakfire_build* build) {
+ struct pakfire_filelist* filelist = NULL;
+ int r;
+
+ // Create a new filelist
+ r = pakfire_filelist_create(&filelist, build->pakfire);
+ if (r)
+ goto ERROR;
+
+ // Scan for all files in BUILDROOT
+ r = pakfire_filelist_scan(filelist, build->buildroot, NULL, NULL);
+ if (r)
+ goto ERROR;
+
+ const size_t length = pakfire_filelist_size(filelist);
+
+ if (length) {
+ ERROR(build->pakfire, "Unpackaged files found:\n");
+
+ r = pakfire_filelist_walk(filelist, __pakfire_build_unpackaged_file, NULL);
+ if (r)
+ goto ERROR;
+
+ // Report an error
+ r = 1;
+ }
+
+ERROR:
+ if (filelist)
+ pakfire_filelist_unref(filelist);
+
+ return r;
+}
+
+static int pakfire_build_post_check(struct pakfire_build* build) {
+ int r;
+
+ // Check for unpackaged files
+ r = pakfire_build_check_unpackaged_files(build);
+ if (r)
+ return r;
+
+ return 0;
+}
+
PAKFIRE_EXPORT int pakfire_build_exec(struct pakfire_build* build, const char* path) {
struct pakfire_archive* archive = NULL;
struct pakfire_package* package = NULL;
goto ERROR;
}
+ // Perform post build checks
+ r = pakfire_build_post_check(build);
+ if (r)
+ goto ERROR;
+
ERROR:
if (makefile)
pakfire_parser_unref(makefile);