From: Michael Tremer Date: Sat, 16 Dec 2023 11:53:47 +0000 (+0000) Subject: util: Fix creating symlinks X-Git-Tag: 0.9.30~1285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbc2e5e25521b549dd16d726d42a3166efc233f6;p=pakfire.git util: Fix creating symlinks Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/util.c b/src/libpakfire/util.c index 6bb22195a..a3b9f2661 100644 --- a/src/libpakfire/util.c +++ b/src/libpakfire/util.c @@ -555,21 +555,21 @@ int pakfire_symlink(struct pakfire_ctx* ctx, const char* target, const char* lin int r; // Find the dirname of the target - r = pakfire_path_dirname(path, target); + r = pakfire_path_dirname(path, linkpath); if (r) return r; // Make the symlink relative - r = pakfire_path_relative(path, path, linkpath); + r = pakfire_path_relative(path, path, target); if (r) return r; CTX_DEBUG(ctx, "Creating symlink %s -> %s (%s)\n", target, linkpath, path); // Create the symlink - r = symlink(target, path); + r = symlink(path, linkpath); if (r) { - CTX_ERROR(ctx, "Could not create symlink %s (%s)\n", target, path); + CTX_ERROR(ctx, "Could not create symlink %s (%s): %m\n", linkpath, path); return r; }