summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-30 15:07:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-02 15:44:11 +0100
commit54b9a58c20372c95eaa88e55a1864d1bd1c11708 (patch)
treec805a2fc61c6582c22a1fbbfae336590a909fca5 /scripts
parent8b41a106e4d05f9e711557e1d2201991cc582094 (diff)
downloadpoky-54b9a58c20372c95eaa88e55a1864d1bd1c11708.tar.gz
convert-overrides: Allow script to handle patch/diffs
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. (From OE-Core rev: 21df7acc969f47d615d1701ee71f19571de94949) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/contrib/convert-overrides.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/contrib/convert-overrides.py b/scripts/contrib/convert-overrides.py
index bfdf785719..6505b18cf0 100755
--- a/scripts/contrib/convert-overrides.py
+++ b/scripts/contrib/convert-overrides.py
@@ -68,15 +68,15 @@ packagevars = packagevars + imagevars
68 68
69vars_re = {} 69vars_re = {}
70for exp in vars: 70for exp in vars:
71 vars_re[exp] = (re.compile('((^|[\'"\s])[A-Za-z0-9_\-:${}]+)_' + exp), r"\1:" + exp) 71 vars_re[exp] = (re.compile('((^|[\'"\s\-\+])[A-Za-z0-9_\-:${}]+)_' + exp), r"\1:" + exp)
72 72
73shortvars_re = {} 73shortvars_re = {}
74for exp in shortvars: 74for exp in shortvars:
75 shortvars_re[exp] = (re.compile('((^|[\'"\s])[A-Za-z0-9_\-:${}]+)_' + exp + '([\(\'"\s:])'), r"\1:" + exp + r"\3") 75 shortvars_re[exp] = (re.compile('((^|[\'"\s\-\+])[A-Za-z0-9_\-:${}]+)_' + exp + '([\(\'"\s:])'), r"\1:" + exp + r"\3")
76 76
77package_re = {} 77package_re = {}
78for exp in packagevars: 78for exp in packagevars:
79 package_re[exp] = (re.compile('(^|[\'"\s]+)' + exp + '_' + '([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2") 79 package_re[exp] = (re.compile('(^|[\'"\s\-\+]+)' + exp + '_' + '([$a-z"\'\s%\[<{\\\*].)'), r"\1" + exp + r":\2")
80 80
81# Other substitutions to make 81# Other substitutions to make
82subs = { 82subs = {
@@ -123,6 +123,10 @@ def processfile(fn):
123ourname = os.path.basename(sys.argv[0]) 123ourname = os.path.basename(sys.argv[0])
124ourversion = "0.9.1" 124ourversion = "0.9.1"
125 125
126if os.path.isfile(sys.argv[1]):
127 processfile(sys.argv[1])
128 sys.exit(0)
129
126for targetdir in sys.argv[1:]: 130for targetdir in sys.argv[1:]:
127 print("processing directory '%s'" % targetdir) 131 print("processing directory '%s'" % targetdir)
128 for root, dirs, files in os.walk(targetdir): 132 for root, dirs, files in os.walk(targetdir):