From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E97B1CCA47B for ; Sat, 2 Jul 2022 10:11:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232246AbiGBKLj (ORCPT ); Sat, 2 Jul 2022 06:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231897AbiGBKLh (ORCPT ); Sat, 2 Jul 2022 06:11:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D88718B2A; Sat, 2 Jul 2022 03:11:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B65060C14; Sat, 2 Jul 2022 10:11:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF254C341CD; Sat, 2 Jul 2022 10:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656756694; bh=tyjiB6KXIb2t/OE4/soCi8nyF//+2DvXcvBFmclJruU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tqHiiJ6Jne5DcQX2ahkE0KDPkGEHznmWfh365Q4dkbNYGNCo/gpwQiU3beWEo+rx3 abIMoF1s7y/kn5tRTBc6BCklWV5LKwnfgs3arjHnR1GBBsamccMkd+N+7tAsSVWCTu Bd2LSLLrZiJzuIJE22MVmfTx4pETQ2Hb8Weyv39tDiIz+0GygFrkDkvosFJ+Bj414P t1s4ds/YzCFgFXdo7BAZK/iX+YvgBSw+5+oheRt4bAP1XUFMypX2E/VL999NCMvkoM sgCju8OdJofs+8px3zJ8neSf9J0tukSooajV8UqvIi8sRZpA9g/faZHWfyAi/VPek4 InQwEYqiIdmpA== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1o7a67-007cMg-MX; Sat, 02 Jul 2022 11:11:31 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , "Jonathan Corbet" , "Mauro Carvalho Chehab" , ksummit-discuss@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] scripts: sphinx-pre-install: report broken venv Date: Sat, 2 Jul 2022 11:11:26 +0100 Message-Id: X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org After distro upgrades, the directory names for python may change. On such case, the previously-created venv will be broken, and sphinx-build won't run. Add a logic to report it. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH v2 0/5] at: https://lore.kernel.org/all/cover.1656756450.git.mchehab@kernel.org/ scripts/sphinx-pre-install | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install index ae8c49734899..18537e5af692 100755 --- a/scripts/sphinx-pre-install +++ b/scripts/sphinx-pre-install @@ -720,6 +720,12 @@ sub get_virtenv() next if (! -f $sphinx_cmd); my $ver = get_sphinx_version($sphinx_cmd); + + if (!$ver) { + $f =~ s#/bin/activate##; + print("Warning: virtual envionment $f is not working.\nPython version upgrade? Remove it with:\n\n\trm -rf $f\n\n"); + } + if ($need_sphinx && ($ver ge $min_version)) { return ($f, $ver); } elsif ($ver gt $cur_version) { -- 2.36.1