Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
Version 1.0.5
~~~~~~~~~~~~~
Released: 2025-04-24

Features:
* qt: Expose markup conversion utils
* desktop-styles: Add android and iOS
* validator: Check for xml:lang="en" being used on description template elements
* validator: Flag cases of raw text in "description" elements
* metadata: Add more known extensions into as_metadata_file_guess_style()

Specification:
* docs: Clarify that the style segment of a screenshot environment is optional
* docs: Explain consequences of defining an icon for desktop-app metainfo
* docs: Clarify that description content must be in p/li elements

Bugfixes:
* validator: mark as_validator_issue_tag_list static
* docs: Add workaround for gi-docgen misnaming devhelp files
* compose: Do not permit SVG images as screenshots
* compose: Don't "forget" to scan remaining paths when re-encountering a dir
* pool: Try explicit singular term match if we only have low-quality tokens
* utils: Provide compatibility with Fedora icon tarballs when installing them
* utils: Remove leftover g_chmod()
* zstd-decompressor: Pass output/written data when decompression finished
* utils: Expect a dash in icons file name
* utils: Recognize .yml* and .yaml* file extension variants, and .zst extension
* utils: Rename the appstream file when re-saving it on install

Contributors:
Alyssa Ross, Ismael Asensio, Kolja, Matthias Klumpp, Milan Crha

Version 1.0.4
~~~~~~~~~~~~~
Released: 2024-12-08

Features:
* bundle: Add AS_BUNDLE_KIND_SYSUPDATE
* desktop-style-ids: Add dark support for Plasma
* desktop-style-ids: add pantheon:dark
* qt: Expose branding color
* sysinfo: Add memory size detection support for Illumos and Solaris
* sysinfo: Add memory size detection support for GNU/Hurd
* validator: Don't fail validation if a snapshot release is missing a time

Specification:
* docs: Note that support for some legacy path was dropped in 1.0
* docs: Update fd.o spec URLs
* docs: Better explain desktop applications
* Update ESRA website URL

Bugfixes:
* validator: Make sure we read an initialised variable
* qt: Specify utc as the dates' timezone
* tests: Ignore some tests on Windows
* sysinfo: make uname() usage POSIX compliant
* Only emit legacy compat tag developer_name for catalog data
* compose: Allow file discovery even in symlinked directories
* Avoid a race condition when loading GResource data
* validator: Mention length limit in summary length warning message
* utils: Explicitly set permissions on installed metadata files
* as-vercmp: Fix gtkdoc to not start with '>'

Miscellaneous:
* desktop-style-ids: Remove Endless
* ci: Fix FreeBSD build (update `py-gi-docgen`)
* ci: Update to Ubuntu 24.04 for Debian Testing builds
* utils: Assume 64px as size when installing an icon tarball of unknown size

Contributors:
Adrien Plazas, Airat Makhmutov, Aleix Pol, Carl Schwan,
Cassidy James Blaede, Danielle Foré, Elliott Sales de Andrade,
James Addison, Marcel Telka, Matthias Klumpp, Roke Julian Lockhart,
Pino Toscano, sid

Version 1.0.3
~~~~~~~~~~~~~~
Released: 2024-04-24
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ To help with the latter we provide the `autoformat.py` helper script to format c
* libyaml
* libcurl (>= 7.62)
* libxmlb (>= 0.3.6)
* xsltproc & docbook-style-xsl

Optional:
* Vala Compiler (vapigen) (for Vala VAPI file)
Expand Down
8 changes: 4 additions & 4 deletions RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ AppStream Release Notes

1. Set variables

OLD_VERSION="1.0.2"
NEW_VERSION="1.0.3"
OLD_VERSION="1.0.4"
NEW_VERSION="1.0.5"

2. Write NEWS entries for AppStream in the same format as usual.

git shortlog v$OLD_VERSION.. | grep -i -v -E '^\s*(trivial:|l10n:)' | grep -v Merge > NEWS.new

--------------------------------------------------------------------------------
Version 1.0.3
Version 1.0.5
~~~~~~~~~~~~~~
Released: 2024-xx-xx

Expand Down Expand Up @@ -53,7 +53,7 @@ git push
10. Send an email to appstream@lists.freedesktop.org

=================================================
AppStream 1.0.3 released!
AppStream 1.0.5 released!

Tarballs available here: https://www.freedesktop.org/software/appstream/releases/

Expand Down
14 changes: 6 additions & 8 deletions compose/asc-compose.c
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ asc_compose_process_task_cb (AscComposeTask *ctask, AscCompose *compose)
} /* end launch entry loop */
}
} /* end of desktop-entry support */
} /* end of metadata parsing loop */
} /* end of metadata parsing loop */

/* process the remaining .desktop files */
if (as_flags_contains (priv->flags, ASC_COMPOSE_FLAG_PROCESS_UNPAIRED_DESKTOP)) {
Expand Down Expand Up @@ -2182,10 +2182,11 @@ asc_compose_run (AscCompose *compose, GCancellable *cancellable, GError **error)

if (as_flags_contains (priv->flags, ASC_COMPOSE_FLAG_NO_PARTIAL_URLS) &&
priv->media_baseurl == NULL) {
g_set_error_literal (error,
ASC_COMPOSE_ERROR,
ASC_COMPOSE_ERROR_FAILED,
_("Partial URLs are not allowed, but no base URL is set to create full URLs."));
g_set_error_literal (
error,
ASC_COMPOSE_ERROR,
ASC_COMPOSE_ERROR_FAILED,
_("Partial URLs are not allowed, but no base URL is set to create full URLs."));
return NULL;
}

Expand Down Expand Up @@ -2232,9 +2233,6 @@ asc_compose_run (AscCompose *compose, GCancellable *cancellable, GError **error)
temp_dir_created = TRUE;
}

/* sanity check to ensure resources can be loaded */
as_utils_ensure_resources ();

tasks = g_ptr_array_new_with_free_func ((GDestroyNotify) asc_compose_task_free);

for (guint i = 0; i < priv->units->len; i++) {
Expand Down
72 changes: 59 additions & 13 deletions compose/asc-directory-unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ asc_directory_unit_class_init (AscDirectoryUnitClass *klass)
}

static gboolean
asc_directory_unit_find_files_recursive (GPtrArray *files,
const gchar *path_orig,
guint path_orig_len,
const gchar *path,
GError **error)
asc_directory_unit_find_files_recursive_internal (GPtrArray *files,
const gchar *path_orig,
guint path_orig_len,
const gchar *path,
GHashTable *visited_dirs,
GError **error)
{
const gchar *tmp;
g_autoptr(GDir) dir = NULL;
Expand All @@ -104,14 +105,38 @@ asc_directory_unit_find_files_recursive (GPtrArray *files,
g_autofree gchar *path_new = NULL;
path_new = g_build_filename (path, tmp, NULL);

/* search recursively, don't follow symlinks */
if (g_file_test (path_new, G_FILE_TEST_IS_DIR) &&
!g_file_test (path_new, G_FILE_TEST_IS_SYMLINK)) {
if (!asc_directory_unit_find_files_recursive (files,
path_orig,
path_orig_len,
path_new,
error))
/* search recursively */
if (g_file_test (path_new, G_FILE_TEST_IS_DIR)) {
if (g_file_test (path_new, G_FILE_TEST_IS_SYMLINK)) {
g_autofree gchar *real_path = realpath (path_new, NULL);

if (!real_path) {
/* error if realpath fails (like memory allocation error or invalid path) */
g_set_error (error,
G_FILE_ERROR,
g_file_error_from_errno (errno),
"Failed to resolve real path");
return FALSE;
}

/* don't visit paths twice to avoid loops */
if (g_hash_table_contains (visited_dirs, real_path))
continue;

g_hash_table_add (visited_dirs, g_steal_pointer (&real_path));
} else {
if (g_hash_table_contains (visited_dirs, path_new))
continue;

g_hash_table_add (visited_dirs, g_strdup (path_new));
}

if (!asc_directory_unit_find_files_recursive_internal (files,
path_orig,
path_orig_len,
path_new,
visited_dirs,
error))
return FALSE;
} else {
g_ptr_array_add (files, g_strdup (path_new + path_orig_len));
Expand All @@ -121,6 +146,27 @@ asc_directory_unit_find_files_recursive (GPtrArray *files,
return TRUE;
}

static gboolean
asc_directory_unit_find_files_recursive (GPtrArray *files,
const gchar *path_orig,
guint path_orig_len,
const gchar *path,
GError **error)
{
g_autoptr(GHashTable) visited_dirs = NULL;
g_autofree gchar *absolute_lookup_path = NULL;
visited_dirs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);

absolute_lookup_path = g_build_filename (path_orig, path, NULL);
g_debug ("Indexing location: %s\n", absolute_lookup_path);
return asc_directory_unit_find_files_recursive_internal (files,
path_orig,
path_orig_len,
path,
visited_dirs,
error);
}

static gboolean
asc_directory_unit_open (AscUnit *unit, GError **error)
{
Expand Down
20 changes: 19 additions & 1 deletion compose/asc-globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ G_DEFINE_TYPE_WITH_PRIVATE (AscGlobals, asc_globals, G_TYPE_OBJECT)
static AscGlobals *g_globals = NULL;
static GMutex g_globals_mutex;

/**
* asc_get_resource_safe:
*
* A threadsafe variant to obtain the buit-in #GResource.
*/
static GResource *
asc_get_resource_safe (void)
{
static GResource *resource = NULL;

if (g_once_init_enter (&resource)) {
GResource *res = asc_get_resource ();
g_once_init_leave (&resource, res);
}

return resource;
}

/**
* asc_compose_error_quark:
*
Expand Down Expand Up @@ -306,7 +324,7 @@ asc_globals_get_pangrams_for (const gchar *lang)
return priv->pangrams_en;

/* load array from resources */
data = g_resource_lookup_data (asc_get_resource (),
data = g_resource_lookup_data (asc_get_resource_safe (),
"/org/freedesktop/appstream-compose/pangrams/en.txt",
G_RESOURCE_LOOKUP_FLAGS_NONE,
NULL);
Expand Down
17 changes: 11 additions & 6 deletions compose/asc-hint-tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ AscHintTagStatic asc_hint_tag_list[] = {
{ "ancient-metadata",
AS_ISSUE_SEVERITY_WARNING,
"The AppStream metadata should be updated to follow a more recent version of the specification.<br/>"
"Please consult <a href=\"http://freedesktop.org/software/appstream/docs/chap-Quickstart.html\">the XML quickstart guide</a> for "
"Please consult the <a href=\"https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html\">MetaInfo quickstart guides</a> for "
"more information."
},

Expand All @@ -83,7 +83,7 @@ AscHintTagStatic asc_hint_tag_list[] = {
AS_ISSUE_SEVERITY_ERROR,
"Component does not contain a short summary. Ensure that the components MetaInfo file has a <code>summary</code> tag, or that its .desktop file "
"has a <code>Comment=</code> field set.<br/>"
"More information can be found in the <a href=\"http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html\">Desktop Entry specification</a> "
"More information can be found in the <a href=\"https://specifications.freedesktop.org/desktop-entry-spec/latest/localized-keys.html\">Desktop Entry specification</a> "
"and the <a href=\"https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Application.html#tag-dapp-summary\">MetaInfo specification</a>."
},

Expand Down Expand Up @@ -128,14 +128,14 @@ AscHintTagStatic asc_hint_tag_list[] = {
AS_ISSUE_SEVERITY_WARNING,
"The desktop-entry file `{{location}}` has the 'Hidden' property set. This is wrong for vendor-installed .desktop files, and "
"nullifies all effects this .desktop file has (including MIME associations), which most certainly is not intentional. "
"See <a href=\"https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html\">the specification</a> for details."
"See <a href=\"https://specifications.freedesktop.org/desktop-entry-spec/latest/recognized-keys.html\">the specification</a> for details."
},

{ "desktop-entry-empty-onlyshowin",
AS_ISSUE_SEVERITY_WARNING,
"The desktop-entry file `{{location}}` has the 'OnlyShowIn' property set with an empty value. This might not be intended, as this will hide "
"the application from all desktops. If you do want to hide the application from all desktops, using 'NoDisplay=true' is more explicit. "
"See <a href=\"https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html\">the specification</a> for details."
"See <a href=\"https://specifications.freedesktop.org/desktop-entry-spec/latest/recognized-keys.html\">the specification</a> for details."
},

{ "missing-launchable-desktop-file",
Expand Down Expand Up @@ -193,6 +193,11 @@ AscHintTagStatic asc_hint_tag_list[] = {
"This might be a temporary server issue, or the screenshot is no longer available."
},

{ "screenshot-image-is-svg",
AS_ISSUE_SEVERITY_WARNING,
"The screenshot image at '{{url}}' is a vector graphic. Vector graphics are not allowed as screenshot images."
},

{ "screenshot-save-error",
AS_ISSUE_SEVERITY_WARNING,
"Unable to store screenshot for '{{url}}': {{error}}"
Expand Down Expand Up @@ -289,14 +294,14 @@ AscHintTagStatic asc_hint_tag_list[] = {

{ "no-metainfo",
AS_ISSUE_SEVERITY_WARNING,
"This software component is missing a <a href=\"https://freedesktop.org/software/appstream/docs/chap-Metadata.html#sect-Metadata-GenericComponent\">MetaInfo file</a> "
"This software component is missing a <a href=\"https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#sect-Metadata-GenericComponent\">MetaInfo file</a> "
"as metadata source.<br/>"
"To synthesize suitable metadata anyway, we took some data from its desktop-entry file.<br/>"
"This has many disadvantages, like low-quality and incomplete metadata. Therefore clients may ignore this component entirely due to poor metadata.<br/>"
"Additionally, a lot of software from desktop-entry files should either not be installable and searchable via the software catalog "
"(like desktop-specific settings applications) or be tagged accordingly via MetaInfo files.<br/>"
"Please consider to either hide this .desktop file from AppStream by adding a <code>X-AppStream-Ignore=true</code> field to it, or to write a MetaInfo file for this component.<br/>"
"You can consult the <a href=\"http://freedesktop.org/software/appstream/docs/chap-Quickstart.html\">MetaInfo quickstart guides</a> for more information "
"You can consult the <a href=\"https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html\">MetaInfo quickstart guides</a> for more information "
"on how to write a MetaInfo file, or file a bug with the upstream author of this software component."
},

Expand Down
2 changes: 1 addition & 1 deletion compose/asc-hint-tags.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ typedef struct {

extern AscHintTagStatic asc_hint_tag_list[];

#pragma GCC visibility pop
#pragma GCC visibility pop
G_END_DECLS
6 changes: 3 additions & 3 deletions compose/asc-utils-fonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ struct {
gint width;
gint height;
} font_screenshot_sizes[] = {
{1024, 78},
{ 640, 48},
{ 0, 0 }
{ 1024, 78 },
{ 640, 48 },
{ 0, 0 }
};

/**
Expand Down
Loading
Loading