diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-30 15:07:45 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-02 15:44:11 +0100 |
| commit | 54b9a58c20372c95eaa88e55a1864d1bd1c11708 (patch) | |
| tree | c805a2fc61c6582c22a1fbbfae336590a909fca5 /scripts/contrib | |
| parent | 8b41a106e4d05f9e711557e1d2201991cc582094 (diff) | |
| download | poky-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/contrib')
| -rwxr-xr-x | scripts/contrib/convert-overrides.py | 10 |
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 | ||
| 69 | vars_re = {} | 69 | vars_re = {} |
| 70 | for exp in vars: | 70 | for 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 | ||
| 73 | shortvars_re = {} | 73 | shortvars_re = {} |
| 74 | for exp in shortvars: | 74 | for 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 | ||
| 77 | package_re = {} | 77 | package_re = {} |
| 78 | for exp in packagevars: | 78 | for 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 |
| 82 | subs = { | 82 | subs = { |
| @@ -123,6 +123,10 @@ def processfile(fn): | |||
| 123 | ourname = os.path.basename(sys.argv[0]) | 123 | ourname = os.path.basename(sys.argv[0]) |
| 124 | ourversion = "0.9.1" | 124 | ourversion = "0.9.1" |
| 125 | 125 | ||
| 126 | if os.path.isfile(sys.argv[1]): | ||
| 127 | processfile(sys.argv[1]) | ||
| 128 | sys.exit(0) | ||
| 129 | |||
| 126 | for targetdir in sys.argv[1:]: | 130 | for 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): |
