basic/glyph-util: rename "special glyph" to just "glyph"

Admittedly, some of our glyphs _are_ special, e.g. "O=" for SPECIAL_GLYPH_TOUCH ;)
But we don't need this in the name. The very long names make some invocations
very wordy, e.g. special_glyph(SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY).
Also, I want to add GLYPH_SPACE, which is not special at all.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-03-15 14:40:39 +01:00
parent 32f66088de
commit 1ae9b0cfa8
107 changed files with 544 additions and 544 deletions
+2 -2
View File
@@ -288,8 +288,8 @@ static int download_manifest(
if (pipe2(pfd, O_CLOEXEC) < 0)
return log_error_errno(errno, "Failed to allocate pipe: %m");
log_info("%s Acquiring manifest file %s%s", special_glyph(SPECIAL_GLYPH_DOWNLOAD),
suffixed_url, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("%s Acquiring manifest file %s%s", glyph(GLYPH_DOWNLOAD),
suffixed_url, glyph(GLYPH_ELLIPSIS));
r = safe_fork_full("(sd-pull)",
(int[]) { -EBADF, pfd[1], STDERR_FILENO },
+4 -4
View File
@@ -816,7 +816,7 @@ int transfer_vacuum(
assert(oldest->resource);
log_info("%s Removing %s '%s' (%s).",
special_glyph(SPECIAL_GLYPH_RECYCLING),
glyph(GLYPH_RECYCLING),
space == UINT64_MAX ? "disabled" : "old",
oldest->path,
resource_type_to_string(oldest->resource->type));
@@ -1196,7 +1196,7 @@ int transfer_acquire_instance(Transfer *t, Instance *i, TransferProgress cb, voi
assert(where);
log_info("%s Acquiring %s %s %s...", special_glyph(SPECIAL_GLYPH_DOWNLOAD), i->path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), where);
log_info("%s Acquiring %s %s %s...", glyph(GLYPH_DOWNLOAD), i->path, glyph(GLYPH_ARROW_RIGHT), where);
if (RESOURCE_IS_URL(i->resource->type)) {
/* For URL sources we require the SHA256 sum to be known so that we can validate the
@@ -1542,11 +1542,11 @@ int transfer_install_instance(
if (r < 0)
return log_error_errno(r, "Failed to update current symlink '%s' %s '%s': %m",
link_path,
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
relative);
log_info("Updated symlink '%s' %s '%s'.",
link_path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), relative);
link_path, glyph(GLYPH_ARROW_RIGHT), relative);
}
}
+4 -4
View File
@@ -28,16 +28,16 @@ const char* update_set_flags_to_color(UpdateSetFlags flags) {
const char* update_set_flags_to_glyph(UpdateSetFlags flags) {
if (flags == 0 || (flags & UPDATE_OBSOLETE))
return special_glyph(SPECIAL_GLYPH_MULTIPLICATION_SIGN);
return glyph(GLYPH_MULTIPLICATION_SIGN);
if (FLAGS_SET(flags, UPDATE_INSTALLED|UPDATE_NEWEST))
return special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE);
return glyph(GLYPH_BLACK_CIRCLE);
if (FLAGS_SET(flags, UPDATE_INSTALLED|UPDATE_PROTECTED))
return special_glyph(SPECIAL_GLYPH_WHITE_CIRCLE);
return glyph(GLYPH_WHITE_CIRCLE);
if ((flags & (UPDATE_AVAILABLE|UPDATE_INSTALLED|UPDATE_NEWEST|UPDATE_OBSOLETE)) == (UPDATE_AVAILABLE|UPDATE_NEWEST))
return special_glyph(SPECIAL_GLYPH_CIRCLE_ARROW);
return glyph(GLYPH_CIRCLE_ARROW);
return " ";
}
+10 -10
View File
@@ -259,7 +259,7 @@ static int context_load_installed_instances(Context *c) {
assert(c);
log_info("Discovering installed instances%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Discovering installed instances%s", glyph(GLYPH_ELLIPSIS));
FOREACH_ARRAY(tr, c->transfers, c->n_transfers) {
Transfer *t = *tr;
@@ -291,7 +291,7 @@ static int context_load_available_instances(Context *c) {
assert(c);
log_info("Discovering available instances%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Discovering available instances%s", glyph(GLYPH_ELLIPSIS));
FOREACH_ARRAY(tr, c->transfers, c->n_transfers) {
Transfer *t = *tr;
@@ -497,14 +497,14 @@ static int context_discover_update_sets(Context *c) {
assert(c);
log_info("Determining installed update sets%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Determining installed update sets%s", glyph(GLYPH_ELLIPSIS));
r = context_discover_update_sets_by_flag(c, UPDATE_INSTALLED);
if (r < 0)
return r;
if (!arg_offline) {
log_info("Determining available update sets%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Determining available update sets%s", glyph(GLYPH_ELLIPSIS));
r = context_discover_update_sets_by_flag(c, UPDATE_AVAILABLE);
if (r < 0)
@@ -540,9 +540,9 @@ static int context_show_table(Context *c) {
TABLE_SET_COLOR, color,
TABLE_STRING, us->version,
TABLE_SET_COLOR, color,
TABLE_STRING, special_glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_INSTALLED)),
TABLE_STRING, glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_INSTALLED)),
TABLE_SET_COLOR, color,
TABLE_STRING, special_glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_AVAILABLE)),
TABLE_STRING, glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_AVAILABLE)),
TABLE_SET_COLOR, color,
TABLE_STRING, update_set_flags_to_string(us->flags),
TABLE_SET_COLOR, color);
@@ -847,9 +847,9 @@ static int context_vacuum(
assert(c);
if (space == 0)
log_info("Making room%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Making room%s", glyph(GLYPH_ELLIPSIS));
else
log_info("Making room for %" PRIu64 " updates%s", space, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Making room for %" PRIu64 " updates%s", space, glyph(GLYPH_ELLIPSIS));
FOREACH_ARRAY(tr, c->transfers, c->n_transfers) {
Transfer *t = *tr;
@@ -1083,7 +1083,7 @@ static int context_apply(
return r;
}
log_info("%s Successfully installed update '%s'.", special_glyph(SPECIAL_GLYPH_SPARKLES), us->version);
log_info("%s Successfully installed update '%s'.", glyph(GLYPH_SPARKLES), us->version);
if (ret_applied)
*ret_applied = us;
@@ -1473,7 +1473,7 @@ static int verb_pending_or_reboot(int argc, char **argv, void *userdata) {
if (r < 0)
return r;
log_info("Determining installed update sets%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Determining installed update sets%s", glyph(GLYPH_ELLIPSIS));
r = context_discover_update_sets_by_flag(context, UPDATE_INSTALLED);
if (r < 0)
+4 -4
View File
@@ -421,7 +421,7 @@ static int list_versions_finished(sd_bus_message *reply, void *userdata, sd_bus_
color = update_set_flags_to_color(v.flags);
if (urlify_enabled() && !strv_isempty(v.changelog)) {
version_link = strjoin(v.version, special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK));
version_link = strjoin(v.version, glyph(GLYPH_EXTERNAL_LINK));
if (!version_link)
return log_oom();
}
@@ -688,10 +688,10 @@ static int check_describe_finished(sd_bus_message *reply, void *userdata, sd_bus
return bus_log_parse_error(r);
if (urlify_enabled() && !strv_isempty(v.changelog))
lnk = special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK);
lnk = glyph(GLYPH_EXTERNAL_LINK);
update = strjoin(empty_to_dash(current), " ",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), " ",
glyph(GLYPH_ARROW_RIGHT), " ",
v.version, strempty(lnk));
if (!update)
return log_oom();
@@ -1328,7 +1328,7 @@ static int list_features(sd_bus *bus) {
return r;
if (urlify_enabled() && f.documentation) {
name_link = strjoin(f.name, special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK));
name_link = strjoin(f.name, glyph(GLYPH_EXTERNAL_LINK));
if (!name_link)
return log_oom();
}