localedef: Handle symbolic links when generating locale-archive
authorArjun Shankar <arjun@redhat.com>
Thu, 24 Feb 2022 20:43:09 +0000 (21:43 +0100)
committerArjun Shankar <arjun@redhat.com>
Thu, 24 Feb 2022 21:45:05 +0000 (22:45 +0100)
Whenever locale data for any locale included symbolic links, localedef
would throw the error "incomplete set of locale files" and exclude it
from the generated locale archive.  This commit fixes that.

Co-authored-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
locale/programs/locarchive.c

index 45408c2..eeb2fa6 100644 (file)
@@ -1397,7 +1397,7 @@ add_locales_to_archive (size_t nlist, char *list[], bool replace)
                    {
                      char fullname[fnamelen + 2 * strlen (d->d_name) + 7];
 
-                     if (d_type == DT_UNKNOWN)
+                     if (d_type == DT_UNKNOWN || d_type == DT_LNK)
                        {
                          strcpy (stpcpy (stpcpy (fullname, fname), "/"),
                                  d->d_name);