[gnome-builder] cmake: guard against absolute destination path



commit b1dd3541b51deb8592ed744fd35d536b41c842a9
Author: Günther Wagner <info gunibert de>
Date:   Mon Mar 7 07:51:01 2022 +0100

    cmake: guard against absolute destination path

 src/plugins/cmake/gbp-cmake-build-target-provider.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/cmake/gbp-cmake-build-target-provider.c 
b/src/plugins/cmake/gbp-cmake-build-target-provider.c
index 825b62727..15720868a 100644
--- a/src/plugins/cmake/gbp-cmake-build-target-provider.c
+++ b/src/plugins/cmake/gbp-cmake-build-target-provider.c
@@ -88,7 +88,11 @@ gbp_cmake_build_target_provider_create_target (GbpCmakeBuildTargetProvider  *sel
   destination_path = json_object_get_string_member (destination, "path");
 
   install_dir = g_path_get_dirname (artefacts_path);
-  install_dir_abs = g_build_path (G_DIR_SEPARATOR_S, prefix_path, destination_path, NULL);
+  if (g_str_has_prefix (destination_path, prefix_path))
+    install_dir_abs = g_strdup (destination_path);
+  else
+    install_dir_abs = g_build_path (G_DIR_SEPARATOR_S, prefix_path, destination_path, NULL);
+
   install_directory = g_file_new_for_path (install_dir_abs);
 
   name = g_path_get_basename (artefacts_path);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]