From patchwork Thu Feb 24 21:07:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 51373 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD1D43858434 for ; Thu, 24 Feb 2022 21:07:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD1D43858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1645736867; bh=x5IDN9hJnGV0TxmWl9xIkYxN5QiorxnTSYcr8nTIL5o=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=iEZe4wCvPo4mZehRGOMzENVCsDRa64Z5lBTQVY8iBoh+tag3WiOt+/2oK9cQesGVc za0ygoForEnQANITUdAyoct5T1kwgCQ/lTn6B7q/KhQt8DHai0h0z133x7WF6r1BjS 8CHGFJ9gKCORELAoDuOdbgOgF7Fp6T9LQq7Pb8II= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from anamika.lostca.se (anamika.lostca.se [65.21.75.227]) by sourceware.org (Postfix) with ESMTPS id 3644F385841F for ; Thu, 24 Feb 2022 21:07:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3644F385841F Received: from localhost (mail.lostca.se [65.21.75.227]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: spectre) by anamika.lostca.se (Postfix) with ESMTPSA id B87DD215B4; Thu, 24 Feb 2022 21:07:25 +0000 (UTC) Date: Thu, 24 Feb 2022 21:07:25 +0000 To: libc-alpha@sourceware.org, Carlos O'Donell Subject: [PATCH] localedef: Handle symbolic links when generating locale-archive Message-ID: <20220224210725.GA3999@lostca.se> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Arjun Shankar via Libc-alpha From: Arjun Shankar Reply-To: Arjun Shankar Cc: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" From: Arjun Shankar 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 Reviewed-by: Carlos O'Donell --- We ran into this in Fedora when we recently switched to packaging LC_CTYPE as symbolic links (when content was identical) to save space. --- locale/programs/locarchive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c index 45408c26c1..eeb2fa6ffe 100644 --- a/locale/programs/locarchive.c +++ b/locale/programs/locarchive.c @@ -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);