From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E5DEF138333 for ; Fri, 25 May 2018 19:32:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F24E5E0884; Fri, 25 May 2018 19:32:23 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B459FE0884 for ; Fri, 25 May 2018 19:32:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 308E4335CA3 for ; Fri, 25 May 2018 19:32:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 600072A4 for ; Fri, 25 May 2018 19:32:20 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1526738061.dea5a0cb7e4723d554f7309043284b5c66f881f8.grobian@gentoo> Subject: [gentoo-commits] proj/portage:prefix commit in: pym/portage/package/ebuild/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/package/ebuild/doebuild.py X-VCS-Directories: pym/portage/package/ebuild/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: dea5a0cb7e4723d554f7309043284b5c66f881f8 X-VCS-Branch: prefix Date: Fri, 25 May 2018 19:32:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a3e1e8f7-8b50-4ec6-8be0-50e63e7f7540 X-Archives-Hash: ac19a7cb6561c7e56f56e048151b16a2 commit: dea5a0cb7e4723d554f7309043284b5c66f881f8 Author: Fabian Groffen gentoo org> AuthorDate: Sat May 19 13:54:21 2018 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat May 19 13:54:21 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=dea5a0cb doebuild: fix deprecation warnings This fixes: DeprecationWarning: invalid escape sequence \* pym/portage/package/ebuild/doebuild.py | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index fff03e1d4..bdf1a2e9f 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -1602,8 +1602,10 @@ def spawn(mystring, mysettings, debug=False, free=False, droppriv=False, user = "root" elif portage_build_uid == portage_uid: user = portage.data._portage_username + # PREFIX LOCAL: accept numeric uid else: user = portage_uid + # END PREFIX LOCAL if user is not None: mysettings["PORTAGE_BUILD_USER"] = user @@ -1616,8 +1618,10 @@ def spawn(mystring, mysettings, debug=False, free=False, droppriv=False, group = "root" elif portage_build_gid == portage_gid: group = portage.data._portage_grpname + # PREFIX LOCAL: accept numeric gid else: group = portage_gid + # END PREFIX LOCAL if group is not None: mysettings["PORTAGE_BUILD_GROUP"] = group @@ -1674,11 +1678,13 @@ def spawn(mystring, mysettings, debug=False, free=False, droppriv=False, rules_literal = "" rules_regex = "" - # FIXME: Allow for quoting inside the variable to allow paths with - # spaces in them? + # FIXME: Allow for quoting inside the variable + # to allow paths with spaces in them? for path in paths.split(" "): - # do a second round of token replacements to be able to - # reference settings like EPREFIX or PORTAGE_BUILDDIR. + # do a second round of token + # replacements to be able to reference + # settings like EPREFIX or + # PORTAGE_BUILDDIR. for token in path.split("@@")[1:-1:2]: if token not in mysettings: continue @@ -1686,16 +1692,19 @@ def spawn(mystring, mysettings, debug=False, free=False, droppriv=False, path = path.replace("@@%s@@" % token, mysettings[token]) if "@@" in path: - # unreplaced tokens left - silently ignore path - needed - # for PORTAGE_ACTUAL_DISTDIR which isn't always set + # unreplaced tokens left - + # silently ignore path - needed + # for PORTAGE_ACTUAL_DISTDIR + # which isn't always set pass elif path[-1] == os.sep: - # path ends in slash - make it a regex and allow access + # path ends in slash - make it a + # regex and allow access # recursively. - path = path.replace("+", "\+") - path = path.replace("*", "\*") - path = path.replace("[", "\[") - path = path.replace("[", "\[") + path = path.replace(r'+', r'\+') + path = path.replace(r'*', r'\*') + path = path.replace(r'[', r'\[') + path = path.replace(r']', r'\]') rules_regex += " #\"^%s\"\n" % path else: rules_literal += " #\"%s\"\n" % path