Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3196149ybn; Fri, 27 Sep 2019 02:38:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyS1rFqMBoB0BkJSlRbULhMomC6UlfedNbbB8wRkSt20gr5XcHunJW5MUntYUxRiLDu1iet X-Received: by 2002:a05:6402:120e:: with SMTP id c14mr1046104edw.272.1569577122195; Fri, 27 Sep 2019 02:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569577122; cv=none; d=google.com; s=arc-20160816; b=tyXgP7vB8xlhEX5ppS73aLG419kcuDrM/0pfVFPr0rCUnjFTjjbKBi4k5+90GVVrXW o3JYllLkkDkd7/+EGOaOUwvuI6aL4XRhxGGJVfu7B0ZXJkrIt5WvnJReKooxqmIUUwHS HiP2QbUW3vR2U6s5+EIDCu4DEC28RIbKeck4kF3MaMVCZ0tP9dHuMNM/GfGWPEB+m/cR znAZ/oUzkDk686kz8nbJ/5sbJ76/GDcLtq10obI38SQJ+i/lkiMJMyIBwKO3o+ouH1GA xcwEjxv/RsGJDwcuGHbvHk3ylWsdjIfZP0SxtFHNLKqtoicDXPm+aapeL0I76r6QsfTa HaIw== 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=8Z1yZcx7lt82yK82hKDWaRuslS2lyBCS5/OQGziEcvs=; b=DKEaf16ssPQ8f/vjpNelPf1A05oxnFcrwrZliNJbpPtuHlMKA75vzjFXJkKW4rHL01 9BYr3qibdOfVKEPM1O11MgiI8/rS+RGoXuNmQpsIE4m1eh8p0yvpl+rRBIONuXr7hGV0 PU5uRB8Sn/VRC5HZl/8Neidr0bAdNtM6ryLeaU4WzVSmZXourUBvegsaAkg62JAwuXSt wx7TNLhCPZTKujXtID7chYpvj1RgPfKanwTWC9aKm4eBBiW2mksqUVwNXyZWLNOR5Py0 ywSOM/pZJZfSq5DGZXVbcd1/seM/NR5esGWxEOGgBNattm5OxxBrA3JMcvB4FKculylD TVKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=uoWzyLR7; 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 90si1432713edj.72.2019.09.27.02.38.17; Fri, 27 Sep 2019 02:38:42 -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=uoWzyLR7; 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 S1727124AbfI0JhS (ORCPT + 99 others); Fri, 27 Sep 2019 05:37:18 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:33055 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbfI0JhC (ORCPT ); Fri, 27 Sep 2019 05:37:02 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x8R9a5uh001372; Fri, 27 Sep 2019 18:36:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x8R9a5uh001372 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1569576973; bh=8Z1yZcx7lt82yK82hKDWaRuslS2lyBCS5/OQGziEcvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uoWzyLR7WPO97Yw+7t2zQ6Bn+mWJ4wLoAivcRWkOp71OIQ4a7nclOHfnfEZcMfLq2 gsfADMWqfz6bC+Epby+QMFO9UMLLAPmaOoQiOYb4pN843ldf5QrkWkPYAZ6B4KFLrT EHjvPttNsdP+0/CAKOdTvY3Xf4STusL1CBVtA2fcq1OK8Cg9yfWAdPAWeW/HbjcZ5n OtN0uNov4PROdyIluCGO1s+S4YLwJN+stI+hpC18A8xDmwkxfwzvczxj5ajXXyzHRu AYi7QmobHJr+rFXav0f1osZ59d0aD+l8SF0fF46Q3Cp3f7aXef+eMDSH6iHp7z5uGT ekA/bWw/6OMew== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Jessica Yu Cc: Matthias Maennich , Greg Kroah-Hartman , Joel Fernandes , Martijn Coenen , Will Deacon , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 7/7] nsdeps: make generated patches independent of locale Date: Fri, 27 Sep 2019 18:36:03 +0900 Message-Id: <20190927093603.9140-8-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190927093603.9140-1-yamada.masahiro@socionext.com> References: <20190927093603.9140-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. Especially when namespaces contain underscores, the result is different depending on the locale. For example, I got this: $ { echo usbcommon; echo usb_common; } | LANG=en_US.UTF-8 sort usbcommon usb_common $ { echo usbcommon; echo usb_common; } | LANG=C sort usb_common usbcommon 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. Signed-off-by: Masahiro Yamada --- scripts/nsdeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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} -- 2.17.1