```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
for p in ${template%/template}/patches/*; do
sed -i '
\,^[+-][+-][+-] /dev/null,b
/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
s,^[*][*][*] ,&a/,
/^--- /{
s,\(^--- \)\(./\)*,\1a/,
s,[.-][Oo][Rr][Ii][Gg]\([ /]\),\1,
s/[.-][Oo][Rr][Ii][Gg]$//
s/[.]patched[.]\([^.]\)/.\1/
h
}
/^+++ -/{
g
s/^--- a/+++ b/
b
}
s,\(^+++ \)\(./\)*,\1b/,
' "$p"
done
sed -i '/^patch_args=/d' $template
done
```
27 lines
1.1 KiB
Diff
27 lines
1.1 KiB
Diff
--- a/build/moz.configure/rust.configure 2019-10-28 12:05:04.930404603 +0700
|
|
+++ b/build/moz.configure/rust.configure 2019-10-28 12:09:42.742338957 +0700
|
|
@@ -297,11 +297,20 @@
|
|
suffix = 'hf'
|
|
else:
|
|
suffix = ''
|
|
+
|
|
+ narrowed = []
|
|
for p in prefixes:
|
|
for c in candidates:
|
|
- if c.rust_target.startswith('{}-'.format(p)) and \
|
|
- c.rust_target.endswith(suffix):
|
|
- return c.rust_target
|
|
+ if c.rust_target.startswith('{}-'.format(p)):
|
|
+ narrowed.append(c.rust_target)
|
|
+
|
|
+ for target in narrowed:
|
|
+ if target.endswith(host_or_target.raw_os):
|
|
+ return target
|
|
+
|
|
+ for target in narrowed:
|
|
+ if target.endswith(suffix):
|
|
+ return target
|
|
|
|
# See if we can narrow down on the exact alias
|
|
narrowed = [c for c in candidates if c.target.alias == host_or_target.alias]
|