From patchwork Thu Oct 3 07:58:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 175054 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1855056ill; Thu, 3 Oct 2019 00:59:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxYaXp0DD/q93/NvobS7Q3As2XQ/0EC84BV60upcIRyF60lNyrDYSP25h1VX3zjKvB1rQb X-Received: by 2002:aa7:dd8e:: with SMTP id g14mr8036124edv.233.1570089559123; Thu, 03 Oct 2019 00:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570089559; cv=none; d=google.com; s=arc-20160816; b=kaDNKkiZ3RNRBRXjs00QOSYj3GXvYh4vsMOBOrHwBonEll8oyr8t947hQkSvmGm6hW mesVsAC3uXHuDW8r9tk81a0pEVwZLy8/lxIWgQaw9q5hpMrPDUj5/Y5ZrZQaWdaJq5ni /zM+PvVrYlCxrAztEaaLMW57YQv6w0mn/xs0XIlP5Hxvf8KLFwV1SnPYchnuoW6HWgCw JtNV4gogNfTasJaGuYiCFO5ylsounUJOnN/EUpvt69X4O42mjtsWfkAxq0Vtw1nYYczO PFP/TKnNvNp7aRnTlw8vZ3IVLDsKzdrYqL1L7Kc426raaauRGetFtfDw/vquMrEGfshU WVdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=59eE/rGcp2OFwwXp+ofMwhXaVSnXW6C8LJ8vAqEhBT8=; b=UNse/iiVfvVQ5bLKfKVUYGlClV4NN3K7M/cUB5nwKMDIx7pX9HX0PvWX5qe0Lhz1P0 AGpSTQQjfM2cYfuZ/Gu0pFIZNoIkfvwXqju5kmhFknLKX8tWqHDNMh62AXGGqT89CFzu k07LCUHk78yOmnxd+k8eyTqwMNTm4630gb3JOYukEK0HVmVUZzaTZqeMvGdfUvCzmq+6 K6x2Ur7qyc6sE/qiG6U5EeTHaLN+Qbe6VmkLCwPHX15Tpu4ZzsfD3IdEn7+nphIc/yVi 4WEyU3w5YZPeQbt6LEKUPYbT+Up/dGqWHbciMF2Log3/YjRS8geEhkf8sSskTZdEp4UX hqgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JkW9JFD3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si786588eju.269.2019.10.03.00.59.18; Thu, 03 Oct 2019 00:59:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JkW9JFD3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728496AbfJCH7S (ORCPT + 27 others); Thu, 3 Oct 2019 03:59:18 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:59222 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728178AbfJCH7R (ORCPT ); Thu, 3 Oct 2019 03:59:17 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x937wTkY007720; Thu, 3 Oct 2019 16:58:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x937wTkY007720 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1570089514; bh=59eE/rGcp2OFwwXp+ofMwhXaVSnXW6C8LJ8vAqEhBT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JkW9JFD3WiK28/HG0qiHqAjyVx6xAYXVsr8kJZ1Brp9fIgb20YDB1nxm4XHsG7CzU H9I9whiVaS6vOFtE3y28YTYHxAPWBiyGtdvm6wjPNRr0ZwdZr5tWSsFRZMjZpSXNq9 UJWoUtH+w0F8ip47kjVGCQHmeVk5mn85mbal0ToUwgv8fuwUhF/OldGknyTOC3IH+p 91LewO4WtqsNVD+w7P5Ps6qkXtnofeJ1q7QSJKU2SmhpdL6/7tJwN1Cg9TUX2ovVRH +i5SZARSaLDGDXJo+PoTcI5eJJMUl3r7bP3+EXpCUXnXLUW3PLfByk0gmEt/5jxFtf /n5BF/hn6X18g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Jessica Yu Cc: Matthias Maennich , Greg Kroah-Hartman , Shaun Ruffell , linux-kbuild@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] nsdeps: make generated patches independent of locale Date: Thu, 3 Oct 2019 16:58:26 +0900 Message-Id: <20191003075826.7478-7-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191003075826.7478-1-yamada.masahiro@socionext.com> References: <20191003075826.7478-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org scripts/nsdeps automatically generates a patch to add MODULE_IMPORT_NS tags, and what is nicer, it sorts the lines alphabetically with the 'sort' command. However, the output from the 'sort' command depends on locale. For example, I got this: $ { echo usbstorage; echo usb_storage; } | LANG=en_US.UTF-8 sort usbstorage usb_storage $ { echo usbstorage; echo usb_storage; } | LANG=C sort usb_storage usbstorage So, this means people might potentially send different patches. This kind of issue was reported in the past, for example, commit f55f2328bb28 ("kbuild: make sorting initramfs contents independent of locale"). Adding 'LANG=C' is a conventional way of fixing when a deterministic result is desirable. I added 'LANG=C' very close to the 'sort' command since changing locale affects the language of error messages etc. We should respect users' choice as much as possible. Signed-off-by: Masahiro Yamada Reviewed-by: Matthias Maennich --- Changes in v2: - Add more commit log about the locale impact scripts/nsdeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/scripts/nsdeps b/scripts/nsdeps index 964b7fb8c546..3754dac13b31 100644 --- a/scripts/nsdeps +++ b/scripts/nsdeps @@ -41,7 +41,7 @@ generate_deps() { for source_file in $mod_source_files; do sed '/MODULE_IMPORT_NS/Q' $source_file > ${source_file}.tmp offset=$(wc -l ${source_file}.tmp | awk '{print $1;}') - cat $source_file | grep MODULE_IMPORT_NS | sort -u >> ${source_file}.tmp + cat $source_file | grep MODULE_IMPORT_NS | LANG=C sort -u >> ${source_file}.tmp tail -n +$((offset +1)) ${source_file} | grep -v MODULE_IMPORT_NS >> ${source_file}.tmp if ! diff -q ${source_file} ${source_file}.tmp; then mv ${source_file}.tmp ${source_file}