From patchwork Fri Sep 27 09:36:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 174621 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3245668ill; Fri, 27 Sep 2019 02:37:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrbs5sYBMbUNthiVVZYnhy9wVhStR+yoT2kGqZ9RGdrrbb9Ra8A8DHVb5W6xEWF7Umu43I X-Received: by 2002:a17:906:7e56:: with SMTP id z22mr6615273ejr.294.1569577040018; Fri, 27 Sep 2019 02:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569577040; cv=none; d=google.com; s=arc-20160816; b=GR7o7X43zTdwW+W6/QrrD/ZTyH0cfaqRi8Z/K1FHz0wedOpeTaQx28Bq6mkz/EWDtD eu3DD+bedEV6VaF6+0cWhN6o5LMfUP88BRhlasZ+YcDrvDTB/2EI1sIiuuL08p8Sayyr z7a25SFLzJFAAtBBkkQeyengTfZ5xA3G4ocgfCtuB32vJvQ0kvIKsWKs2Bn2n8X3W4X7 K7NOVj+EH/1ePqv9qImZERbVv8elruyY9a6u/gUnIM6jeqIXg/AYpjjXdgUH/6f3up7j 6+sg6tNdsYcrm3J4AvsTjFpnCroPoW6Eb6NeQtNdUG4jJEY5hCbhr12q5E/0ebL42Hdk 2lRw== 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 a23si1314162edj.201.2019.09.27.02.37.19; Fri, 27 Sep 2019 02:37:20 -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 S1727135AbfI0JhT (ORCPT + 26 others); Fri, 27 Sep 2019 05:37:19 -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(-) -- 2.17.1 Reviewed-by: Matthias Maennich 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}