From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-044.btinternet.com (mailomta5-sa.btinternet.com [213.120.69.11]) by sourceware.org (Postfix) with ESMTPS id 2FCA23850426 for ; Sun, 29 May 2022 15:54:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2FCA23850426 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk Received: from sa-prd-rgout-005.btmx-prd.synchronoss.net ([10.2.38.8]) by sa-prd-fep-044.btinternet.com with ESMTP id <20220529155409.DUWS3230.sa-prd-fep-044.btinternet.com@sa-prd-rgout-005.btmx-prd.synchronoss.net>; Sun, 29 May 2022 16:54:09 +0100 Authentication-Results: btinternet.com; auth=pass (LOGIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 6139452E26932AC6 X-Originating-IP: [86.139.167.41] X-OWM-Source-IP: 86.139.167.41 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvfedrkeeggdelfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeekffeviedvteekvdfhvdfhveejffevgeevtdevgfeuveeijeeivdefgfdvheejieenucffohhmrghinhepphihthhhohhnrdhorhhgnecukfhppeekiedrudefledrudeijedrgedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplhhotggrlhhhohhsthdrlhhotggrlhguohhmrghinhdpihhnvghtpeekiedrudefledrudeijedrgedupdhmrghilhhfrhhomhepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdpnhgspghrtghpthhtohepvddprhgtphhtthhopegthihgfihinhdqrghpphhssegthihgfihinhdrtghomhdprhgtphhtthhopehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhk X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from localhost.localdomain (86.139.167.41) by sa-prd-rgout-005.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as jonturney@btinternet.com) id 6139452E26932AC6; Sun, 29 May 2022 16:54:09 +0100 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH cygport] python-wheel: Make a python3-name virtual package Date: Sun, 29 May 2022 16:53:54 +0100 Message-Id: <20220529155354.18478-1-jon.turney@dronecode.org.uk> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1199.3 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin-apps@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin package maintainer discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2022 15:54:11 -0000 When making python3x-name package (where 3.x is the current default python version), also make a python3-name virtual package, which causes python3x-name to be installed. --- cygclass/python-wheel.cygclass | 18 ++++++++++++++---- lib/src_postinst.cygpart | 11 +++++++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/cygclass/python-wheel.cygclass b/cygclass/python-wheel.cygclass index 90b0faa..b6ed68b 100644 --- a/cygclass/python-wheel.cygclass +++ b/cygclass/python-wheel.cygclass @@ -86,8 +86,8 @@ inherit python.org # are already available. #**** -# when the default versions of Python change, this and the ENSUREPIP_OPTIONS -# switches need to be updated accordingly +# when the default versions of Python change, this, the python3 virtual package +# target, and the ENSUREPIP_OPTIONS switches need to be updated accordingly _tmp_wheel_v= : ${PYTHON_WHEEL_VERSIONS:=default} for ver in ${PYTHON_WHEEL_VERSIONS//:/ } @@ -124,11 +124,21 @@ then for ver in ${PYTHON_WHEEL_VERSIONS//:/ } do PKG_NAMES+=" python${ver/.}-${PYTHON_WHEEL_NAME}" - # these were 2&3 at the time of the XY-version split, + # this was 2 at the time of the XY-version split, # and MUST NOT be updated when defaults change case ${ver} in 2.7) declare -g python27_${PYTHON_WHEEL_NAME//[-\.]/_}_OBSOLETES="python-${PYTHON_WHEEL_NAME} python2-${PYTHON_WHEEL_NAME}" ;; - 3.6) declare -g python36_${PYTHON_WHEEL_NAME//[-\.]/_}_OBSOLETES="python3-${PYTHON_WHEEL_NAME}" ;; + # this is the default 3.x version + 3.9) + # If we are making a 3.x package (where x is the default), + # also make a python3-wheelname virtual package, which just + # requires python3x-wheelname + PKG_NAMES+=" python3-${PYTHON_WHEEL_NAME}" + declare -g python3_${PYTHON_WHEEL_NAME//[-\.]/_}_DESCRIPTION="The python3-${PYTHON_WHEEL_NAME} virtual package. Selecting this package for installation will cause the python${ver/.}-${PYTHON_WHEEL_NAME} package to be installed." + declare -g python3_${PYTHON_WHEEL_NAME//[-\.]/_}_CATEGORY="Python Virtual" + declare -g python3_${PYTHON_WHEEL_NAME//[-\.]/_}_REQUIRES="python${ver/.}-${PYTHON_WHEEL_NAME}" + declare -g python3_${PYTHON_WHEEL_NAME//[-\.]/_}_CONTENTS="" + ;; esac declare -g python${ver/.}_${PYTHON_WHEEL_NAME//[-\.]/_}_CONTENTS="usr/lib/python${ver}/site-packages/ usr/share/doc/python${ver/.}-${PYTHON_WHEEL_NAME}" done diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart index 4b51325..b0361b1 100644 --- a/lib/src_postinst.cygpart +++ b/lib/src_postinst.cygpart @@ -430,6 +430,7 @@ __prepdoc() { local html; local -i n=0; local p; + local pkg_contents_var; local pkg_docs_var; local pkg_hint; local default_docs="\ @@ -451,10 +452,16 @@ __prepdoc() { inform "Skipping package doc installation per request"; elif defined _CYGPORT_INTERNAL_multi_doc_ then + # install docs in a package-specific path in every non-empty + # subpackage for p in ${PKG_NAMES} do - _docinto_dir=/$p - dodoc ${default_docs} ${DOCS}; + pkg_contents_var=${p//[-\.]/_}_CONTENTS + if [ -n "${!pkg_contents_var}" ] + then + _docinto_dir=/$p + dodoc ${default_docs} ${DOCS}; + fi done unset _docinto_dir; else -- 2.36.1