[gnome-builder/wip/tintou/machine-configuration-name] Apply suggested changes



commit 56ff4ac93e354038f01f923106b71a1df1dfebfc
Author: Corentin Noël <corentin noel collabora co uk>
Date:   Thu Apr 5 11:26:09 2018 +0100

    Apply suggested changes

 src/libide/buildsystem/ide-build-pipeline.c        |  16 +--
 src/libide/buildsystem/ide-build-pipeline.h        |   2 +-
 src/libide/devices/ide-device-info.c               |  40 +++----
 src/libide/devices/ide-device-info.h               |  15 +--
 src/libide/local/ide-local-device.c                |  21 ++--
 src/libide/util/ide-triplet.c                      | 116 +++++++++++----------
 src/libide/util/ide-triplet.h                      |   6 +-
 .../autotools/ide-autotools-pipeline-addin.c       |   2 +-
 src/plugins/flatpak/gbp-flatpak-runtime-provider.c |   4 +-
 src/plugins/flatpak/gbp-flatpak-util.c             |   4 +-
 10 files changed, 116 insertions(+), 110 deletions(-)
---
diff --git a/src/libide/buildsystem/ide-build-pipeline.c b/src/libide/buildsystem/ide-build-pipeline.c
index d693114df..e48f7a4d5 100644
--- a/src/libide/buildsystem/ide-build-pipeline.c
+++ b/src/libide/buildsystem/ide-build-pipeline.c
@@ -177,7 +177,7 @@ struct _IdeBuildPipeline
    * the pipeline addins may want to use to tweak how the execute
    * the build.
    */
-  IdeTriplet *device_triplet;
+  IdeTriplet *host_triplet;
 
   /*
    * This is an array of PipelineEntry, which contain information we
@@ -1153,9 +1153,9 @@ _ide_build_pipeline_set_device_info (IdeBuildPipeline *self,
   g_assert (IDE_IS_BUILD_PIPELINE (self));
   g_assert (IDE_IS_DEVICE_INFO (info));
 
-  g_clear_pointer (&self->device_triplet, ide_triplet_unref);
+  g_clear_pointer (&self->host_triplet, ide_triplet_unref);
 
-  g_object_get (info, "triplet", &self->device_triplet, NULL);
+  g_object_get (info, "host-triplet", &self->host_triplet, NULL);
 
   IDE_EXIT;
 }
@@ -1283,7 +1283,7 @@ ide_build_pipeline_finalize (GObject *object)
   g_clear_object (&self->runtime);
   g_clear_object (&self->configuration);
   g_clear_pointer (&self->pipeline, g_array_unref);
-  g_clear_pointer (&self->device_triplet, ide_triplet_unref);
+  g_clear_pointer (&self->host_triplet, ide_triplet_unref);
   g_clear_pointer (&self->srcdir, g_free);
   g_clear_pointer (&self->builddir, g_free);
   g_clear_pointer (&self->errfmts, g_array_unref);
@@ -3732,7 +3732,7 @@ ide_build_pipeline_get_device (IdeBuildPipeline *self)
 }
 
 /**
- * ide_build_pipeline_get_device_triplet:
+ * ide_build_pipeline_get_host_triplet:
  * @self: a #IdeBuildPipeline
  *
  * Gets the architecture, kernel, and system that the pipeline is building for,
@@ -3745,11 +3745,11 @@ ide_build_pipeline_get_device (IdeBuildPipeline *self)
  */
 
 IdeTriplet *
-ide_build_pipeline_get_device_triplet (IdeBuildPipeline *self)
+ide_build_pipeline_get_host_triplet (IdeBuildPipeline *self)
 {
   g_return_val_if_fail (IDE_IS_BUILD_PIPELINE (self), NULL);
 
-  return ide_triplet_ref (self->device_triplet);
+  return ide_triplet_ref (self->host_triplet);
 }
 
 /**
@@ -3769,7 +3769,7 @@ ide_build_pipeline_is_native (IdeBuildPipeline *self)
 {
   g_return_val_if_fail (IDE_IS_BUILD_PIPELINE (self), FALSE);
 
-  return ide_triplet_is_system (self->device_triplet);
+  return ide_triplet_is_system (self->host_triplet);
 }
 
 /**
diff --git a/src/libide/buildsystem/ide-build-pipeline.h b/src/libide/buildsystem/ide-build-pipeline.h
index 53c6eff3e..09434d7fc 100644
--- a/src/libide/buildsystem/ide-build-pipeline.h
+++ b/src/libide/buildsystem/ide-build-pipeline.h
@@ -74,7 +74,7 @@ const gchar           *ide_build_pipeline_get_builddir            (IdeBuildPipel
 IDE_AVAILABLE_IN_ALL
 const gchar           *ide_build_pipeline_get_srcdir              (IdeBuildPipeline       *self);
 IDE_AVAILABLE_IN_3_30
-IdeTriplet            *ide_build_pipeline_get_device_triplet      (IdeBuildPipeline       *self);
+IdeTriplet            *ide_build_pipeline_get_host_triplet        (IdeBuildPipeline       *self);
 IDE_AVAILABLE_IN_ALL
 gchar                 *ide_build_pipeline_get_message             (IdeBuildPipeline       *self);
 IDE_AVAILABLE_IN_ALL
diff --git a/src/libide/devices/ide-device-info.c b/src/libide/devices/ide-device-info.c
index 20cf7e4ac..74f63be00 100644
--- a/src/libide/devices/ide-device-info.c
+++ b/src/libide/devices/ide-device-info.c
@@ -30,7 +30,7 @@
 struct _IdeDeviceInfo
 {
   GObject parent_instance;
-  IdeTriplet *triplet;
+  IdeTriplet *host_triplet;
   IdeDeviceKind kind;
 };
 
@@ -39,7 +39,7 @@ G_DEFINE_TYPE (IdeDeviceInfo, ide_device_info, G_TYPE_OBJECT)
 enum {
   PROP_0,
   PROP_KIND,
-  PROP_TRIPLET,
+  PROP_HOST_TRIPLET,
   N_PROPS
 };
 
@@ -50,7 +50,7 @@ ide_device_info_finalize (GObject *object)
 {
   IdeDeviceInfo *self = (IdeDeviceInfo *)object;
 
-  g_clear_pointer (&self->triplet, ide_triplet_unref);
+  g_clear_pointer (&self->host_triplet, ide_triplet_unref);
 
   G_OBJECT_CLASS (ide_device_info_parent_class)->finalize (object);
 }
@@ -69,8 +69,8 @@ ide_device_info_get_property (GObject    *object,
       g_value_set_enum (value, ide_device_info_get_kind (self));
       break;
 
-    case PROP_TRIPLET:
-      g_value_set_boxed (value, ide_device_info_get_triplet (self));
+    case PROP_HOST_TRIPLET:
+      g_value_set_boxed (value, ide_device_info_get_host_triplet (self));
       break;
 
     default:
@@ -92,8 +92,8 @@ ide_device_info_set_property (GObject      *object,
       ide_device_info_set_kind (self, g_value_get_enum (value));
       break;
 
-    case PROP_TRIPLET:
-      ide_device_info_set_triplet (self, g_value_get_boxed (value));
+    case PROP_HOST_TRIPLET:
+      ide_device_info_set_host_triplet (self, g_value_get_boxed (value));
       break;
 
     default:
@@ -119,9 +119,9 @@ ide_device_info_class_init (IdeDeviceInfoClass *klass)
                        IDE_DEVICE_KIND_COMPUTER,
                        G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
 
-  properties [PROP_TRIPLET] =
-    g_param_spec_boxed ("triplet",
-                        "Triplet",
+  properties [PROP_HOST_TRIPLET] =
+    g_param_spec_boxed ("host-triplet",
+                        "Host Triplet",
                         "The #IdeTriplet object holding all the configuration name values",
                         IDE_TYPE_TRIPLET,
                         G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
@@ -132,7 +132,7 @@ ide_device_info_class_init (IdeDeviceInfoClass *klass)
 static void
 ide_device_info_init (IdeDeviceInfo *self)
 {
-  self->triplet = ide_triplet_new_from_system ();
+  self->host_triplet = ide_triplet_new_from_system ();
 }
 
 IdeDeviceInfo *
@@ -179,7 +179,7 @@ ide_device_info_set_kind (IdeDeviceInfo *self,
 }
 
 /**
- * ide_device_info_get_triplet:
+ * ide_device_info_get_host_triplet:
  * @self: An #IdeDeviceInfo
  *
  * Get the #IdeTriplet object describing the configuration name
@@ -190,15 +190,15 @@ ide_device_info_set_kind (IdeDeviceInfo *self,
  * Since: 3.30
  */
 IdeTriplet *
-ide_device_info_get_triplet (IdeDeviceInfo *self)
+ide_device_info_get_host_triplet (IdeDeviceInfo *self)
 {
   g_return_val_if_fail (IDE_IS_DEVICE_INFO (self), NULL);
 
-  return self->triplet;
+  return self->host_triplet;
 }
 
 /**
- * ide_device_info_set_triplet:
+ * ide_device_info_set_host_triplet:
  * @self: An #IdeDeviceInfo
  *
  * Set the #IdeTriplet object describing the configuration name
@@ -206,12 +206,12 @@ ide_device_info_get_triplet (IdeDeviceInfo *self)
  * Since: 3.30
  */
 void
-ide_device_info_set_triplet (IdeDeviceInfo *self,
-                             IdeTriplet    *triplet)
+ide_device_info_set_host_triplet (IdeDeviceInfo *self,
+                                  IdeTriplet    *host_triplet)
 {
   g_return_if_fail (IDE_IS_DEVICE_INFO (self));
 
-  g_clear_pointer (&self->triplet, ide_triplet_unref);
-  self->triplet = ide_triplet_ref (triplet);
-  g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_TRIPLET]);
+  g_clear_pointer (&self->host_triplet, ide_triplet_unref);
+  self->host_triplet = ide_triplet_ref (host_triplet);
+  g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_HOST_TRIPLET]);
 }
diff --git a/src/libide/devices/ide-device-info.h b/src/libide/devices/ide-device-info.h
index 786eea8fc..698a00bb0 100644
--- a/src/libide/devices/ide-device-info.h
+++ b/src/libide/devices/ide-device-info.h
@@ -24,6 +24,7 @@
 
 #include "ide-types.h"
 #include "ide-version-macros.h"
+
 #include "util/ide-triplet.h"
 
 G_BEGIN_DECLS
@@ -42,16 +43,16 @@ IDE_AVAILABLE_IN_3_28
 G_DECLARE_FINAL_TYPE (IdeDeviceInfo, ide_device_info, IDE, DEVICE_INFO, GObject)
 
 IDE_AVAILABLE_IN_3_28
-IdeDeviceInfo *ide_device_info_new         (void);
+IdeDeviceInfo *ide_device_info_new              (void);
 IDE_AVAILABLE_IN_3_28
-IdeDeviceKind  ide_device_info_get_kind    (IdeDeviceInfo *self);
+IdeDeviceKind  ide_device_info_get_kind         (IdeDeviceInfo *self);
 IDE_AVAILABLE_IN_3_28
-void           ide_device_info_set_kind    (IdeDeviceInfo *self,
-                                            IdeDeviceKind  kind);
+void           ide_device_info_set_kind         (IdeDeviceInfo *self,
+                                                 IdeDeviceKind  kind);
 IDE_AVAILABLE_IN_3_30
-IdeTriplet    *ide_device_info_get_triplet (IdeDeviceInfo *self);
+IdeTriplet    *ide_device_info_get_host_triplet (IdeDeviceInfo *self);
 IDE_AVAILABLE_IN_3_30
-void           ide_device_info_set_triplet (IdeDeviceInfo *self,
-                                            IdeTriplet    *triplet);
+void           ide_device_info_set_host_triplet (IdeDeviceInfo *self,
+                                                 IdeTriplet    *host_triplet);
 
 G_END_DECLS
diff --git a/src/libide/local/ide-local-device.c b/src/libide/local/ide-local-device.c
index d0117556a..7b9f1be30 100644
--- a/src/libide/local/ide-local-device.c
+++ b/src/libide/local/ide-local-device.c
@@ -63,7 +63,7 @@ ide_local_device_get_info_async (IdeDevice           *device,
   ide_task_set_check_cancellable (task, FALSE);
 
   info = ide_device_info_new ();
-  ide_device_info_set_triplet (info, priv->triplet);
+  ide_device_info_set_host_triplet (info, priv->triplet);
 
   ide_task_return_pointer (task, g_steal_pointer (&info), g_object_unref);
 }
@@ -91,7 +91,7 @@ ide_local_device_get_property (GObject    *object,
   switch (prop_id)
     {
     case PROP_TRIPLET:
-      g_value_set_boxed (value, ide_triplet_ref (priv->triplet));
+      g_value_set_boxed (value, priv->triplet);
       break;
 
     default:
@@ -111,9 +111,7 @@ ide_local_device_set_property (GObject      *object,
   switch (prop_id)
     {
     case PROP_TRIPLET:
-      g_clear_pointer (&priv->triplet, ide_triplet_unref);
-      priv->triplet = ide_triplet_ref (g_value_get_boxed (value));
-
+      priv->triplet = g_value_dup_boxed (value);
       break;
 
     default:
@@ -126,7 +124,6 @@ ide_local_device_constructed (GObject *object)
 {
   IdeLocalDevice *self = (IdeLocalDevice *)object;
   IdeLocalDevicePrivate *priv = ide_local_device_get_instance_private (self);
-  g_autofree gchar *arch = NULL;
   g_autofree gchar *name = NULL;
   g_auto(GStrv) parts = NULL;
   g_autoptr(IdeTriplet) triplet = NULL;
@@ -135,14 +132,12 @@ ide_local_device_constructed (GObject *object)
 
   G_OBJECT_CLASS (ide_local_device_parent_class)->constructed (object);
 
-  arch = ide_get_system_arch ();
   triplet = ide_triplet_new_from_system ();
   if (priv->triplet == NULL)
     priv->triplet = g_steal_pointer (&triplet);
   else
     {
-      const gchar *current_cpu = ide_triplet_get_cpu (triplet);
-      g_autofree gchar *device_cpu = g_strdup (current_cpu);
+      const gchar *current_arch = ide_triplet_get_arch (triplet);
       g_autofree gchar *device_vendor = NULL;
       g_autofree gchar *device_kernel = NULL;
       g_autofree gchar *device_operating_system = NULL;
@@ -168,7 +163,7 @@ ide_local_device_constructed (GObject *object)
       else
         device_operating_system = g_strdup (ide_triplet_get_operating_system (triplet));
 
-      priv->triplet = ide_triplet_new_with_quadruplet (device_cpu,
+      priv->triplet = ide_triplet_new_with_quadruplet (current_arch,
                                                        device_vendor,
                                                        device_kernel,
                                                        device_operating_system);
@@ -183,11 +178,11 @@ ide_local_device_constructed (GObject *object)
     }
   else
     {
-      const gchar *cpu = ide_triplet_get_cpu (priv->triplet);
-      g_autofree gchar *id = g_strdup_printf ("local:%s", cpu);
+      const gchar *arch = ide_triplet_get_arch (priv->triplet);
+      g_autofree gchar *id = g_strdup_printf ("local:%s", arch);
 
       /* translators: first %s is replaced with the host name, second with CPU architecture */
-      name = g_strdup_printf (_("My Computer (%s) — %s"), g_get_host_name (), cpu);
+      name = g_strdup_printf (_("My Computer (%s) — %s"), g_get_host_name (), arch);
       ide_device_set_display_name (IDE_DEVICE (self), name);
       ide_device_set_id (IDE_DEVICE (self), id);
     }
diff --git a/src/libide/util/ide-triplet.c b/src/libide/util/ide-triplet.c
index 513df4f2b..4d302427a 100644
--- a/src/libide/util/ide-triplet.c
+++ b/src/libide/util/ide-triplet.c
@@ -31,7 +31,7 @@ struct _IdeTriplet
   volatile gint ref_count;
 
   gchar *full_name;
-  gchar *cpu;
+  gchar *arch;
   gchar *vendor;
   gchar *kernel;
   gchar *operating_system;
@@ -42,10 +42,10 @@ _ide_triplet_construct (void)
 {
   IdeTriplet *self;
 
-  self = g_new0 (IdeTriplet, 1);
+  self = g_slice_new0 (IdeTriplet);
   self->ref_count = 1;
   self->full_name = NULL;
-  self->cpu = NULL;
+  self->arch = NULL;
   self->vendor = NULL;
   self->kernel = NULL;
   self->operating_system = NULL;
@@ -58,11 +58,11 @@ _ide_triplet_construct (void)
  * @full_name: The complete identifier of the machine
  *
  * Creates a new #IdeTriplet from a given identifier. This identifier
-  * can be a simple cpu architecture name, a duet of "cpu-kernel" (like "m68k-coff"), a triplet
-  * of "cpu-kernel-os" (like "x86_64-linux-gnu") or a quadriplet of "cpu-vendor-kernel-os"
-  * (like "i686-pc-linux-gnu")
+ * can be a simple architecture name, a duet of "arch-kernel" (like "m68k-coff"), a triplet
+ * of "arch-kernel-os" (like "x86_64-linux-gnu") or a quadriplet of "arch-vendor-kernel-os"
+ * (like "i686-pc-linux-gnu")
  *
- * Returns: (transfer none): An #IdeTriplet.
+ * Returns: (transfer full): An #IdeTriplet.
  *
  * Since: 3.30
  */
@@ -73,32 +73,34 @@ ide_triplet_new (const gchar *full_name)
   g_auto (GStrv) parts = NULL;
   guint parts_length = 0;
 
+  g_return_val_if_fail (full_name != NULL, NULL);
+
   self = _ide_triplet_construct ();
   self->full_name = g_strdup (full_name);
 
-  parts = g_strsplit (full_name, "-", -1);
+  parts = g_strsplit (full_name, "-", 4);
   parts_length = g_strv_length (parts);
   /* Currently they can't have more than 4 parts */
   if (parts_length >= 4)
     {
-      self->cpu = g_strdup (parts[0]);
+      self->arch = g_strdup (parts[0]);
       self->vendor = g_strdup (parts[1]);
       self->kernel = g_strdup (parts[2]);
       self->operating_system = g_strdup (parts[3]);
     }
   else if (parts_length == 3)
     {
-      self->cpu = g_strdup (parts[0]);
+      self->arch = g_strdup (parts[0]);
       self->kernel = g_strdup (parts[1]);
       self->operating_system = g_strdup (parts[2]);
     }
   else if (parts_length == 2)
     {
-      self->cpu = g_strdup (parts[0]);
+      self->arch = g_strdup (parts[0]);
       self->kernel = g_strdup (parts[1]);
     }
   else if (parts_length == 1)
-    self->cpu = g_strdup (parts[0]);
+    self->arch = g_strdup (parts[0]);
 
   return self;
 }
@@ -108,58 +110,62 @@ ide_triplet_new (const gchar *full_name)
  *
  * Creates a new #IdeTriplet from a the current system information
  *
- * Returns: (transfer none): An #IdeTriplet.
+ * Returns: (transfer full): An #IdeTriplet.
  *
  * Since: 3.30
  */
 IdeTriplet *
-ide_triplet_new_from_system ()
+ide_triplet_new_from_system (void)
 {
   static IdeTriplet *system_triplet;
 
-  if (system_triplet != NULL)
-    return ide_triplet_ref (system_triplet);
-
-  system_triplet = ide_triplet_new (ide_get_system_type ());
+  if (g_once_init_enter (&system_triplet))
+    g_once_init_leave (&system_triplet, ide_triplet_new (ide_get_system_type ()));
 
   return ide_triplet_ref (system_triplet);
 }
 
 /**
  * ide_triplet_new_with_triplet:
- * @cpu: The name of the cpu of the machine (like "x86_64")
- * @kernel: (allow-none): The name of the kernel of the machine (like "linux")
- * @operating_system: (allow-none): The name of the cpu of the machine
+ * @arch: The name of the architecture of the machine (like "x86_64")
+ * @kernel: (nullable): The name of the kernel of the machine (like "linux")
+ * @operating_system: (nullable): The name of the os of the machine
  * (like "gnuabi64")
  *
- * Creates a new #IdeTriplet from a given triplet of "cpu-kernel-os"
+ * Creates a new #IdeTriplet from a given triplet of "arch-kernel-os"
  * (like "x86_64-linux-gnu")
  *
- * Returns: (transfer none): An #IdeTriplet.
+ * Returns: (transfer full): An #IdeTriplet.
  *
  * Since: 3.30
  */
 IdeTriplet *
-ide_triplet_new_with_triplet (const gchar *cpu,
+ide_triplet_new_with_triplet (const gchar *arch,
                               const gchar *kernel,
                               const gchar *operating_system)
 {
   IdeTriplet *self;
   g_autofree gchar *full_name = NULL;
 
-  g_return_val_if_fail (cpu != NULL, NULL);
+  g_return_val_if_fail (arch != NULL, NULL);
 
   self = _ide_triplet_construct ();
-  self->cpu = g_strdup (cpu);
+  self->arch = g_strdup (arch);
   self->kernel = g_strdup (kernel);
   self->operating_system = g_strdup (operating_system);
 
-  full_name = g_strdup (cpu);
+  full_name = g_strdup (arch);
   if (kernel != NULL)
-    full_name = g_strdup_printf ("%s-%s", full_name, kernel);
+    {
+      g_autofree gchar *start_full_name = full_name;
+      full_name = g_strdup_printf ("%s-%s", start_full_name, kernel);
+    }
 
   if (operating_system != NULL)
-    full_name = g_strdup_printf ("%s-%s", full_name, operating_system);
+    {
+      g_autofree gchar *start_full_name = full_name;
+      full_name = g_strdup_printf ("%s-%s", start_full_name, operating_system);
+    }
 
   self->full_name = g_steal_pointer (&full_name);
 
@@ -168,21 +174,20 @@ ide_triplet_new_with_triplet (const gchar *cpu,
 
 /**
  * ide_triplet_new_with_quadruplet:
- * @cpu: The name of the cpu of the machine (like "x86_64")
- * @vendor: (allow-none): The name of the vendor of the machine (like "pc")
- * @kernel: (allow-none): The name of the kernel of the machine (like "linux")
- * @operating_system: (allow-none): The name of the cpu of the machine 
- * (like "gnuabi64")
+ * @arch: The name of the architecture of the machine (like "x86_64")
+ * @vendor: (nullable): The name of the vendor of the machine (like "pc")
+ * @kernel: (nullable): The name of the kernel of the machine (like "linux")
+ * @operating_system: (nullable): The name of the os of the machine (like "gnuabi64")
  *
  * Creates a new #IdeTriplet from a given quadruplet of 
- * "cpu-vendor-kernel-os" (like "i686-pc-linux-gnu")
+ * "arch-vendor-kernel-os" (like "i686-pc-linux-gnu")
  *
- * Returns: (transfer none): An #IdeTriplet.
+ * Returns: (transfer full): An #IdeTriplet.
  *
  * Since: 3.30
  */
 IdeTriplet *
-ide_triplet_new_with_quadruplet (const gchar *cpu,
+ide_triplet_new_with_quadruplet (const gchar *arch,
                                  const gchar *vendor,
                                  const gchar *kernel,
                                  const gchar *operating_system)
@@ -190,24 +195,29 @@ ide_triplet_new_with_quadruplet (const gchar *cpu,
   IdeTriplet *self;
   g_autofree gchar *full_name = NULL;
 
-  g_return_val_if_fail (cpu != NULL, NULL);
+  g_return_val_if_fail (arch != NULL, NULL);
 
   if (vendor == NULL)
-    return ide_triplet_new_with_triplet (cpu, kernel, operating_system);
+    return ide_triplet_new_with_triplet (arch, kernel, operating_system);
 
   self = _ide_triplet_construct ();
-  self->ref_count = 1;
-  self->cpu = g_strdup (cpu);
+  self->arch = g_strdup (arch);
   self->vendor = g_strdup (vendor);
   self->kernel = g_strdup (kernel);
   self->operating_system = g_strdup (operating_system);
 
-  full_name = g_strdup_printf ("%s-%s", cpu, vendor);
+  full_name = g_strdup_printf ("%s-%s", arch, vendor);
   if (kernel != NULL)
-    full_name = g_strdup_printf ("%s-%s", full_name, kernel);
+    {
+      g_autofree gchar *start_full_name = full_name;
+      full_name = g_strdup_printf ("%s-%s", start_full_name, kernel);
+    }
 
   if (operating_system != NULL)
-    full_name = g_strdup_printf ("%s-%s", full_name, operating_system);
+    {
+      g_autofree gchar *start_full_name = full_name;
+      full_name = g_strdup_printf ("%s-%s", start_full_name, operating_system);
+    }
 
   self->full_name = g_steal_pointer (&full_name);
 
@@ -218,11 +228,11 @@ static void
 ide_triplet_finalize (IdeTriplet *self)
 {
   g_free (self->full_name);
-  g_free (self->cpu);
+  g_free (self->arch);
   g_free (self->vendor);
   g_free (self->kernel);
   g_free (self->operating_system);
-  g_free (self);
+  g_slice_free (IdeTriplet, self);
 }
 
 /**
@@ -269,7 +279,7 @@ ide_triplet_unref (IdeTriplet *self)
  * ide_triplet_get_full_name:
  * @self: An #IdeTriplet
  *
- * Gets the full name of the machine configuration name (can be a cpu name,
+ * Gets the full name of the machine configuration name (can be an architecture name,
  * a duet, a triplet or a quadruplet).
  *
  * Returns: (transfer none): The full name of the machine configuration name
@@ -285,19 +295,19 @@ ide_triplet_get_full_name (IdeTriplet *self)
 }
 
 /**
- * ide_triplet_get_cpu:
+ * ide_triplet_get_arch:
  * @self: An #IdeTriplet
  *
- * Gets the cpu name of the machine
+ * Gets the architecture name of the machine
  *
- * Returns: (transfer none): The cpu name of the machine
+ * Returns: (transfer none): The architecture name of the machine
  */
 const gchar *
-ide_triplet_get_cpu (IdeTriplet *self)
+ide_triplet_get_arch (IdeTriplet *self)
 {
   g_return_val_if_fail (self, NULL);
 
-  return self->cpu;
+  return self->arch;
 }
 
 /**
@@ -372,5 +382,5 @@ ide_triplet_is_system (IdeTriplet *self)
 
   g_return_val_if_fail (self, FALSE);
 
-  return g_strcmp0 (self->cpu, system_arch) == 0;
+  return g_strcmp0 (self->arch, system_arch) == 0;
 }
diff --git a/src/libide/util/ide-triplet.h b/src/libide/util/ide-triplet.h
index 93e3e0e89..91553019d 100644
--- a/src/libide/util/ide-triplet.h
+++ b/src/libide/util/ide-triplet.h
@@ -36,11 +36,11 @@ IdeTriplet   *ide_triplet_new                  (const gchar  *full_name);
 IDE_AVAILABLE_IN_3_30
 IdeTriplet   *ide_triplet_new_from_system      (void);
 IDE_AVAILABLE_IN_3_30
-IdeTriplet   *ide_triplet_new_with_triplet     (const gchar  *cpu,
+IdeTriplet   *ide_triplet_new_with_triplet     (const gchar  *arch,
                                                 const gchar  *kernel,
                                                 const gchar  *operating_system);
 IDE_AVAILABLE_IN_3_30
-IdeTriplet   *ide_triplet_new_with_quadruplet  (const gchar  *cpu,
+IdeTriplet   *ide_triplet_new_with_quadruplet  (const gchar  *arch,
                                                 const gchar  *vendor,
                                                 const gchar  *kernel,
                                                 const gchar  *operating_system);
@@ -51,7 +51,7 @@ void          ide_triplet_unref                (IdeTriplet   *self);
 IDE_AVAILABLE_IN_3_30
 const gchar  *ide_triplet_get_full_name        (IdeTriplet   *self);
 IDE_AVAILABLE_IN_3_30
-const gchar  *ide_triplet_get_cpu              (IdeTriplet   *self);
+const gchar  *ide_triplet_get_arch             (IdeTriplet   *self);
 IDE_AVAILABLE_IN_3_30
 const gchar  *ide_triplet_get_vendor           (IdeTriplet   *self);
 IDE_AVAILABLE_IN_3_30
diff --git a/src/plugins/autotools/ide-autotools-pipeline-addin.c 
b/src/plugins/autotools/ide-autotools-pipeline-addin.c
index cd1bae2f7..ce3853a8a 100644
--- a/src/plugins/autotools/ide-autotools-pipeline-addin.c
+++ b/src/plugins/autotools/ide-autotools-pipeline-addin.c
@@ -189,7 +189,7 @@ register_configure_stage (IdeAutotoolsPipelineAddin  *self,
 
   /* --host=triplet */
   configuration = ide_build_pipeline_get_configuration (pipeline);
-  triplet = ide_build_pipeline_get_device_triplet (pipeline);
+  triplet = ide_build_pipeline_get_host_triplet (pipeline);
   host_arg = g_strdup_printf ("--host=%s", ide_triplet_get_full_name (triplet));
   ide_subprocess_launcher_push_argv (launcher, host_arg);
 
diff --git a/src/plugins/flatpak/gbp-flatpak-runtime-provider.c 
b/src/plugins/flatpak/gbp-flatpak-runtime-provider.c
index 8d3178451..e6fd994d9 100644
--- a/src/plugins/flatpak/gbp-flatpak-runtime-provider.c
+++ b/src/plugins/flatpak/gbp-flatpak-runtime-provider.c
@@ -619,8 +619,8 @@ gbp_flatpak_runtime_provider_bootstrap_async (IdeRuntimeProvider  *provider,
   ide_task_set_source_tag (task, gbp_flatpak_runtime_provider_bootstrap_async);
   ide_task_set_priority (task, G_PRIORITY_LOW);
 
-  triplet = ide_build_pipeline_get_device_triplet (pipeline);
-  build_arch = ide_triplet_get_cpu (triplet);
+  triplet = ide_build_pipeline_get_host_triplet (pipeline);
+  build_arch = ide_triplet_get_arch (triplet);
   config = ide_build_pipeline_get_configuration (pipeline);
   runtime_id = ide_configuration_get_runtime_id (config);
 
diff --git a/src/plugins/flatpak/gbp-flatpak-util.c b/src/plugins/flatpak/gbp-flatpak-util.c
index dcf3acf52..7a25eed0e 100644
--- a/src/plugins/flatpak/gbp-flatpak-util.c
+++ b/src/plugins/flatpak/gbp-flatpak-util.c
@@ -43,8 +43,8 @@ gbp_flatpak_get_staging_dir (IdeBuildPipeline *pipeline)
   context = ide_object_get_context (IDE_OBJECT (pipeline));
   vcs = ide_context_get_vcs (context);
   branch = ide_vcs_get_branch_name (vcs);
-  triplet = ide_build_pipeline_get_device_triplet (pipeline);
-  name = g_strdup_printf ("%s-%s", ide_triplet_get_cpu (triplet), branch);
+  triplet = ide_build_pipeline_get_host_triplet (pipeline);
+  name = g_strdup_printf ("%s-%s", ide_triplet_get_arch (triplet), branch);
 
   g_strdelimit (name, G_DIR_SEPARATOR_S, '-');
 


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