goto ERROR;
}
}
+
+#if ARCHIVE_VERSION_NUMBER >= 3006000
+ // Fetch numbers of processors
+ long processors = sysconf(_SC_NPROCESSORS_ONLN);
+
+ if (processors > 1) {
+ r = pakfire_string_format(value, "%ld", processors);
+ if (r) {
+ ERROR(pakfire, "Could not format threads: %m\n");
+ goto ERROR;
+ }
+
+ // Try using multiple threads
+ r = archive_write_set_filter_option(a, NULL, "threads", threads);
+ if (r) {
+ ERROR(pakfire, "Could not enable %s threads for compression: %s\n",
+ threads, archive_error_string(a));
+ goto ERROR;
+ }
+ }
+#endif
}
// Write archive to f