c5d972
commit ea89d5bbd9e5e514b606045d909e6ab87d851c88
c5d972
Author: Arjun Shankar <arjun@redhat.com>
c5d972
Date:   Thu Feb 24 21:43:09 2022 +0100
c5d972
c5d972
    localedef: Handle symbolic links when generating locale-archive
c5d972
    
c5d972
    Whenever locale data for any locale included symbolic links, localedef
c5d972
    would throw the error "incomplete set of locale files" and exclude it
c5d972
    from the generated locale archive.  This commit fixes that.
c5d972
    
c5d972
    Co-authored-by: Florian Weimer <fweimer@redhat.com>
c5d972
    
c5d972
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
c5d972
c5d972
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
c5d972
index dec73264563bc2a0..990f7eb6830d2e57 100644
c5d972
--- a/locale/programs/locarchive.c
c5d972
+++ b/locale/programs/locarchive.c
c5d972
@@ -1391,7 +1391,7 @@ add_locales_to_archive (size_t nlist, char *list[], bool replace)
c5d972
 		    {
c5d972
 		      char fullname[fnamelen + 2 * strlen (d->d_name) + 7];
c5d972
 
c5d972
-		      if (d_type == DT_UNKNOWN)
c5d972
+		      if (d_type == DT_UNKNOWN || d_type == DT_LNK)
c5d972
 			{
c5d972
 			  strcpy (stpcpy (stpcpy (fullname, fname), "/"),
c5d972
 				  d->d_name);