[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH 2/2] convert-overrides: Allow script to handle patch/diffs
From:       "Richard Purdie" <richard.purdie () linuxfoundation ! org>
Date:       2021-07-30 14:29:18
Message-ID: 20210730142918.3364939-2-richard.purdie () linuxfoundation ! org
[Download RAW message or body]

Content-Transfer-Encoding: 8bit

It is handy to be able to have the script convert a single patch file
and it turns out to be straightforward to make it do this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/contrib/convert-overrides.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/contrib/convert-overrides.py \
b/scripts/contrib/convert-overrides.py index bfdf785719f..6505b18cf09 100755
--- a/scripts/contrib/convert-overrides.py
+++ b/scripts/contrib/convert-overrides.py
@@ -68,15 +68,15 @@ packagevars = packagevars + imagevars
 
 vars_re = {}
 for exp in vars:
-    vars_re[exp] = (re.compile('((^|[\'"\s])[A-Za-z0-9_\-:${}]+)_' + exp), r"\1:" + \
exp) +    vars_re[exp] = (re.compile('((^|[\'"\s\-\+])[A-Za-z0-9_\-:${}]+)_' + exp), \
r"\1:" + exp)  
 shortvars_re = {}
 for exp in shortvars:
-    shortvars_re[exp] = (re.compile('((^|[\'"\s])[A-Za-z0-9_\-:${}]+)_' + exp + \
'([\(\'"\s:])'), r"\1:" + exp + r"\3") +    shortvars_re[exp] = \
(re.compile('((^|[\'"\s\-\+])[A-Za-z0-9_\-:${}]+)_' + exp + '([\(\'"\s:])'), r"\1:" + \
exp + r"\3")  
 package_re = {}
 for exp in packagevars:
-    package_re[exp] = (re.compile('(^|[\'"\s]+)' + exp + '_' + \
'([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2") +    package_re[exp] = \
(re.compile('(^|[\'"\s\-\+]+)' + exp + '_' + '([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp \
+ r":\2")  
 # Other substitutions to make
 subs = {
@@ -123,6 +123,10 @@ def processfile(fn):
 ourname = os.path.basename(sys.argv[0])
 ourversion = "0.9.1"
 
+if os.path.isfile(sys.argv[1]):
+    processfile(sys.argv[1])
+    sys.exit(0)
+
 for targetdir in sys.argv[1:]:
     print("processing directory '%s'" % targetdir)
     for root, dirs, files in os.walk(targetdir):
-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154281): https://lists.openembedded.org/g/openembedded-core/message/154281
Mute This Topic: https://lists.openembedded.org/mt/84551168/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic