forked from Mirrors/flatpak-builder
Merge pull request #904 from chergert/wip/term-titles
Update terminal title with build progresstingping/wmclass
commit
d1189d6d79
|
@ -27,6 +27,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <sys/statfs.h>
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gio/gio.h>
|
||||
#include "libglnx/libglnx.h"
|
||||
|
||||
|
@ -895,6 +896,8 @@ builder_module_download_sources (BuilderModule *self,
|
|||
if (!builder_source_is_enabled (source, context))
|
||||
continue;
|
||||
|
||||
builder_set_term_title (_("Downloading %s"), self->name);
|
||||
|
||||
if (!builder_source_download (source, update_vcs, context, error))
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
|
@ -1265,6 +1268,8 @@ builder_module_build (BuilderModule *self,
|
|||
g_print ("Building module %s in %s\n", self->name, source_dir_path);
|
||||
g_print ("========================================================================\n");
|
||||
|
||||
builder_set_term_title (_("Building %s"), self->name);
|
||||
|
||||
if (!builder_module_extract_sources (self, source_dir, context, error))
|
||||
return FALSE;
|
||||
|
||||
|
@ -1540,6 +1545,8 @@ builder_module_build (BuilderModule *self,
|
|||
|
||||
/* Build and install */
|
||||
|
||||
builder_set_term_title (_("Installing %s"), self->name);
|
||||
|
||||
if (meson || cmake_ninja)
|
||||
make_cmd = "ninja";
|
||||
else if (simple)
|
||||
|
@ -1572,6 +1579,8 @@ builder_module_build (BuilderModule *self,
|
|||
|
||||
/* Post installation scripts */
|
||||
|
||||
builder_set_term_title (_("Post-Install %s"), self->name);
|
||||
|
||||
if (builder_context_get_separate_locales (context))
|
||||
{
|
||||
g_autoptr(GFile) root_dir = NULL;
|
||||
|
@ -1617,6 +1626,8 @@ builder_module_build (BuilderModule *self,
|
|||
|
||||
/* Clean up build dir */
|
||||
|
||||
builder_set_term_title (_("Cleanup %s"), self->name);
|
||||
|
||||
if (!builder_context_get_keep_build_dirs (context))
|
||||
{
|
||||
if (!g_file_delete (build_link, NULL, error))
|
||||
|
@ -1649,6 +1660,8 @@ builder_module_update (BuilderModule *self,
|
|||
if (!builder_source_is_enabled (source, context))
|
||||
continue;
|
||||
|
||||
builder_set_term_title (_("Updating %s"), self->name);
|
||||
|
||||
if (!builder_source_update (source, context, error))
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <gelf.h>
|
||||
#include <dwarf.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/uio.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string.h>
|
||||
|
@ -1705,3 +1706,20 @@ builder_serializable_find_property_with_error (JsonSerializable *serializable,
|
|||
g_warning ("Unknown property %s for type %s\n", name, g_type_name_from_instance ((GTypeInstance *)serializable));
|
||||
return pspec;
|
||||
}
|
||||
|
||||
void
|
||||
builder_set_term_title (const gchar *format,
|
||||
...)
|
||||
{
|
||||
g_autofree gchar *message = NULL;
|
||||
va_list args;
|
||||
|
||||
if (isatty (STDOUT_FILENO) != 1)
|
||||
return;
|
||||
|
||||
va_start (args, format);
|
||||
message = g_strdup_vprintf (format, args);
|
||||
va_end (args);
|
||||
|
||||
g_print ("\033]2;flatpak-builder: %s\007", message);
|
||||
}
|
||||
|
|
|
@ -72,6 +72,9 @@ gboolean builder_download_uri (const char *url,
|
|||
GParamSpec * builder_serializable_find_property_with_error (JsonSerializable *serializable,
|
||||
const char *name);
|
||||
|
||||
void builder_set_term_title (const gchar *format,
|
||||
...) G_GNUC_PRINTF (1, 2);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BUILDER_UTILS_H__ */
|
||||
|
|
Loading…
Reference in New Issue