#endif
static int pakfire_stripper_copy_sources(
- struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) {
- struct pakfire_stripper* stripper = data;
+ struct pakfire_stripper* stripper, struct pakfire_file* file) {
const char* filename = NULL;
char basename[PATH_MAX];
Dwarf* dwarf = NULL;
goto ERROR;
default:
- ERROR(ctx, "Could not initialize DWARF context: %s\n", dwarf_errmsg(-1));
+ ERROR(stripper->ctx, "Could not initialize DWARF context: %s\n", dwarf_errmsg(-1));
r = -errno;
goto ERROR;
}
// Fetch the source files
r = dwarf_getsrcfiles(die, &files, &count);
if (r < 0) {
- ERROR(ctx, "Could not fetch the source files: %s\n", dwarf_errmsg(-1));
+ ERROR(stripper->ctx, "Could not fetch the source files: %s\n", dwarf_errmsg(-1));
r = -errno;
goto ERROR;
}
if (pakfire_string_startswith(basename, "<") && pakfire_string_endswith(basename, ">"))
continue;
- DEBUG(ctx, "Found source file: %s\n", filename);
+ DEBUG(stripper->ctx, "Found source file: %s\n", filename);
// Copy the file
r = pakfire_stripper_copy_source_file(stripper, filename);
if (r < 0) {
- ERROR(ctx, "Could not copy source file %s: %s\n", filename, strerror(-r));
+ ERROR(stripper->ctx, "Could not copy source file %s: %s\n", filename, strerror(-r));
goto ERROR;
}
}
return r;
}
-static int __pakfire_stripper_run(struct pakfire_ctx* ctx, void* data) {
+static int pakfire_stripper_strip(
+ struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) {
struct pakfire_stripper* stripper = data;
int r;
// Copy sources
- r = pakfire_filelist_walk(stripper->filelist, pakfire_stripper_copy_sources,
- stripper, PAKFIRE_FILELIST_SHOW_PROGRESS, _("Stripping Files..."));
+ r = pakfire_stripper_copy_sources(stripper, file);
if (r < 0)
return r;
return 0;
}
+static int __pakfire_stripper_run(struct pakfire_ctx* ctx, void* data) {
+ struct pakfire_stripper* stripper = data;
+
+ // Strip all files
+ return pakfire_filelist_walk(stripper->filelist, pakfire_stripper_strip,
+ stripper, PAKFIRE_FILELIST_SHOW_PROGRESS, _("Stripping Files..."));
+}
+
int pakfire_stripper_run(struct pakfire_stripper* stripper) {
int r;