summarylogtreecommitdiffstats
path: root/0000-parallelize-makeicecat.diff
blob: 5c0bad2127f6093bd5b2ff4c2c6b67d42748ad0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--- a/makeicecat
+++ b/makeicecat
@@ -80,6 +80,11 @@ sedhelper()
     fi
 }
 
+xargs()
+{
+    /bin/xargs -d '\n' -P "$(nproc)" "$@"
+}
+
 sed()
 {
     if ! echo $@ | grep -qw '\-i'; then
@@ -645,9 +650,10 @@ s|www\\.gnu\\.org/software/gnuzilla/icecat-help|libreplanet.org/wiki/Group:IceCa
     find . -type f -not -iregex '.*changelog.*' -not -iregex '.*copyright.*' \
          -not -iregex '.*/third_party/rust/.*' -not -name Cargo.lock \
          -not -iregex '.*/\.cargo/.*' \
-         -execdir /bin/sed --follow-symlinks -i "${sed_script}" '{}' ';'
+        | xargs -I{} /bin/sed --follow-symlinks -i "${sed_script}" "{}"
 
-    find l10n -type f -execdir /bin/sed --follow-symlinks -i "s/from GNU/from Mozilla/g" '{}' ';'
+    find l10n -type f \
+        | xargs -I{} /bin/sed --follow-symlinks -i "s/from GNU/from Mozilla/g" "{}"
 
     sed_script="
 s/free and open source software/Free Software/g;
@@ -661,7 +667,8 @@ s/OpenSource/Free Software/g;
 
     local extension
     for extension in dtd ftl inc properties; do
-        find . -type f -name "*$extension" -execdir /bin/sed --follow-symlinks -i "${sed_script}" '{}' ';'
+        find . -type f -name "*$extension" \
+            | xargs -I{} /bin/sed --follow-symlinks -i "${sed_script}" "{}"
     done
 
     sed 's/which are both/which are/; s/free<\/a> and/Free Software<\/a>./; />open source</d; s/free and open source licenses/Free Software licenses/ ' -i toolkit/content/license.html