Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 373E9C6379F for ; Fri, 24 Feb 2023 01:21:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4714685B47; Fri, 24 Feb 2023 02:20:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="AUX9Akcn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B929385AE9; Fri, 24 Feb 2023 02:19:15 +0100 (CET) Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 527F085A21 for ; Fri, 24 Feb 2023 02:19:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x129.google.com with SMTP id 4so2101267ilz.6 for ; Thu, 23 Feb 2023 17:19:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XQ/03Vi98mx89w8fi/gg9DNVx6MpqtbU+vft0vWBKI8=; b=AUX9AkcnZbqyT3q3SyvJt5QL4zz+0xwF+F40uDtlBaj7oyc+43+jPc4fUhILd+wjYz /ePvqaUfF7PiFf9M5EYUeuvtXVWNXaQI1TvTE8dAqhmLkfB/o2JiORHHjSjdh71EWSBc L/4WdqEOnwLyX9HyiZKFWh1ATrFyCwEbjSHiA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XQ/03Vi98mx89w8fi/gg9DNVx6MpqtbU+vft0vWBKI8=; b=UROgomhJqMrG6FP/vhpCOpymnCHeBpYqyGCEb1jwvKXFLKtnoEGwYMSAtVtV3oL0HM IkcKZokmr4LpfjBtv58E4gZYPR7nOiFoJsj7VLHc7n80xfAbwB1w3he4ywN6Mx/TQW4k 3ACnaL6TIZr6+xmJ5XxVrk/m7P6YTR3KPI1AA3S/aExwQBePKXuWGvyGbcLvcH+tZdmv g4u3WDkcXa7OhCAsv3PKo6UvwXrqLa2Npv6UnHNPSZHFa4NRpiS1vquhJl5kJx13W/HD /kV8HOl5MLAdDoB0gOTvE1je2vx8kijlTDXSkffGgQUYtJSjkAk2WG/7Izt9MQr9clEN Vwig== X-Gm-Message-State: AO0yUKXWSHubWUTltXrmbTq4zNRzX7b4cd7CmWwCvardvGv6SxNC2uqb /nBMBjRb+4LMVoSdJDD5B9h5nTQAZe0pJuEu X-Google-Smtp-Source: AK7set+1rMr0czCINQbZvD5BlGDl+si7cxOLxSKe5844xZdSCR59r5PUaNmLssuf3zakAQJkXI6xFQ== X-Received: by 2002:a05:6e02:1d99:b0:315:7004:3e69 with SMTP id h25-20020a056e021d9900b0031570043e69mr11934435ila.13.1677201534871; Thu, 23 Feb 2023 17:18:54 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id q3-20020a92d403000000b003127b668eafsm2677214ilm.19.2023.02.23.17.18.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 17:18:54 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Alper Nebi Yasak , Neha Malcom Francis , Stefan Herbrechtsmeier , Philippe Reynes , Peng Fan , Heinrich Schuchardt , Simon Glass Subject: [PATCH v2 12/24] buildman: Use importlib to find the help Date: Thu, 23 Feb 2023 18:18:12 -0700 Message-Id: <20230224011824.2111976-13-sjg@chromium.org> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog In-Reply-To: <20230224011824.2111976-1-sjg@chromium.org> References: <20230224011824.2111976-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Use this function so that the help can be found even when buildman is running from a package. Signed-off-by: Simon Glass --- Changes in v2: - Add new patch to use importlib to find the help tools/buildman/control.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/buildman/control.py b/tools/buildman/control.py index fe3b6fa335d..07251b52179 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -3,6 +3,7 @@ # import multiprocessing +import importlib.resources import os import shutil import subprocess @@ -152,9 +153,8 @@ def DoBuildman(options, args, toolchains=None, make_func=None, brds=None, global builder if options.full_help: - tools.print_full_help( - os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), - 'README.rst')) + with importlib.resources.path('buildman', 'README.rst') as readme: + tools.print_full_help(str(readme)) return 0 gitutil.setup() -- 2.39.2.637.g21b0678d19-goog