Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3177067ybi; Sun, 14 Jul 2019 08:13:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2C9QbyzOzy2sumgLBaOni1azxkD0aWvJefXNlZBVcPK+NeZ6pV20ZS8k9QSZHvMIwkiDA X-Received: by 2002:a17:902:20e9:: with SMTP id v38mr23542170plg.62.1563117202255; Sun, 14 Jul 2019 08:13:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563117202; cv=none; d=google.com; s=arc-20160816; b=dTfmvfdRTTR9exlr5zQA2XRvgbOK0C88k1Tmi0QXUGJsfjQ/GwHOpx3iM8WK9Lf1yP drIZFI3R0bPOGcdfjaMRR6002KtWKM6l64zW9CN5+F06xMf0Zj++w8opWOHh9fQkpzQF LbLDfo6wMDZ+pyFaulSd4643zuvn5v9nchEdng66sokAGdIXFEbM95K3aiE48HXyvO9L Xn8A7JQ8I8DpVUZPZHArCH0VcMcn6PCR3206i1+9pyJxeqMbi5j9jr80Wlvcivz6uLwF YlQ8MvtwtIc0GVk6eRr3DWXxBwQZuHGtK0FT0EiPkkayEf8EI2GLWV/4bUnyecdsBaoz yRAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WaTHXnanHUyA+63XriQfQq8umJVikepy1D3atlAnVJY=; b=YgDyYWGjEF+OlftI5xzBe7YudO6K1wntuzeJSsVcwImjfLejsSI6iQXm0zS66cyb1e UDaAhyxFEHRgg5zb1HE484nG1iPXbzgVOPEEO/yFnPuH+Who1HzdnTN8VxcAmf9+Olq9 PvbM9uEdZlcTJS0K1TayQiEkcg3yeH5qn8Kh20nV0UlfiCYp4kKxS8Koq0wETiVGGQYw 83F2EHTnMg1odoVNiWtDQuFYMvUxXosccS8H0RuyBOG57fCi+EvjrwtN9GMTX93WpT7d 7mP5GIbPC0g+rGgSNzUD2wrghB8NEXLoaOpCUfm/EdxZ13dCE8knWLgKC9v1yo4vRJqz 5abQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rADDdUC8; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12si13641888pfm.113.2019.07.14.08.13.05; Sun, 14 Jul 2019 08:13:22 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rADDdUC8; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728646AbfGNPKU (ORCPT + 99 others); Sun, 14 Jul 2019 11:10:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45528 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbfGNPKT (ORCPT ); Sun, 14 Jul 2019 11:10:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WaTHXnanHUyA+63XriQfQq8umJVikepy1D3atlAnVJY=; b=rADDdUC8TE1XXDn1kAFniDjW1z zQteU5ILYgbHdgJIUobdskOYjEJb3miRoZYzr+9mZBGWTy4SAlQ7/D55io1F9FIvRsBUGs5pTZ1JA Y3ElNCrDpymkZy/qdsDkfWEpWcy1bmvXFvEdq41MwcVP8NuH7AH6zYf4YQtBIjye7xAc2KYlo9AC1 5+H6CU6l2T8ESb26fE3OrFyJQu9YBH3rUdkFfeS32JEPy2zpuNOcjb/lz4kgvOXLniEXQZKDAM/fw l7uwHGHW88mdsSFRhj9ziUEzK2KO0r6KMLfJdOHVlqlfaXYsaiY0N1OOpER5TFafsCnnksCvnxrSK nv+9t0wA==; Received: from 201.86.163.160.dynamic.adsl.gvt.net.br ([201.86.163.160] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hmg8o-0004f7-Df; Sun, 14 Jul 2019 15:10:18 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92) (envelope-from ) id 1hmg8l-0007TO-3s; Sun, 14 Jul 2019 12:10:15 -0300 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH 7/8] docs: load_config.py: avoid needing a conf.py just due to LaTeX docs Date: Sun, 14 Jul 2019 12:10:12 -0300 Message-Id: <8076229480bdec3e86489d43b10a5afcfd88a75e.1563115732.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Right now, for every directory that we need to have LaTeX output, a conf.py file is required. That causes an extra overhead and it is actually a hack, as the latex_documents line there are usually a copy of the ones that are there already at the main conf.py. So, instead, re-use the global latex_documents var, just adjusting the path to be relative ones. Signed-off-by: Mauro Carvalho Chehab --- Documentation/sphinx/load_config.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Documentation/sphinx/load_config.py b/Documentation/sphinx/load_config.py index 301a21aa4f63..75f527ff4c95 100644 --- a/Documentation/sphinx/load_config.py +++ b/Documentation/sphinx/load_config.py @@ -21,6 +21,29 @@ def loadConfig(namespace): and os.path.normpath(namespace["__file__"]) != os.path.normpath(config_file) ): config_file = os.path.abspath(config_file) + # Let's avoid one conf.py file just due to latex_documents + start = config_file.find('Documentation/') + if start >= 0: + start = config_file.find('/', start + 1) + + end = config_file.rfind('/') + if start >= 0 and end > 0: + dir = config_file[start + 1:end] + + print("source directory: %s" % dir) + new_latex_docs = [] + latex_documents = namespace['latex_documents'] + + for l in latex_documents: + if l[0].find(dir) == 0: + has = True + fn = l[0][len(dir) + 1:] + new_latex_docs.append((fn, l[1], l[2], l[3], l[4])) + break + + namespace['latex_documents'] = new_latex_docs + + # If there is an extra conf.py file, load it if os.path.isfile(config_file): sys.stdout.write("load additional sphinx-config: %s\n" % config_file) config = namespace.copy() @@ -28,5 +51,3 @@ def loadConfig(namespace): execfile_(config_file, config) del config['__file__'] namespace.update(config) - else: - sys.stderr.write("WARNING: additional sphinx-config not found: %s\n" % config_file) -- 2.21.0