PAKFIRE_EXPORT int pakfire_repo_compose(struct pakfire* pakfire, const char* path,
int flags, const char** files) {
struct pakfire_repo* repo = NULL;
+ const char* abspath = NULL;
+ char baseurl[PATH_MAX];
int r;
// path cannot be NULL
num_files++;
}
- char baseurl[PATH_MAX];
+ // Make path absolute
+ abspath = pakfire_path_abspath(path);
+ if (!abspath)
+ return 1;
// Prefix path with file:// to form baseurl
- r = pakfire_string_format(baseurl, "file://%s", path);
+ r = pakfire_string_format(baseurl, "file://%s", abspath);
if (r)
return 1;
const char* filename = pakfire_package_get_string(package, PAKFIRE_PKG_FILENAME);
// Make new path
- r = pakfire_path_join(destination_path, path, filename);
+ r = pakfire_path_join(destination_path, abspath, filename);
if (r)
goto OUT;
// Copying archive to destination
- r = pakfire_archive_copy(archive, destination_path);
+ r = pakfire_archive_link_or_copy(archive, destination_path);
if (r) {
ERROR(pakfire, "Could not copy archive to %s: %m\n", destination_path);
goto OUT;