summarylogtreecommitdiffstats
path: root/arch-friendly-installer.patch
blob: 4a73a9617970ccff2f28093d13bccdf38da191f6 (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
38
39
40
41
42
43
44
45
46
47
48
@@ -246,7 +246,7 @@
 else
   # Linux
   if [[ "system" == "$installpath" ]]; then
-    font_dir="/usr/local/share/fonts"
+    font_dir="${pkgdir}/usr/share/fonts"
   else
     font_dir="$HOME/.local/share/fonts"
   fi
@@ -275,8 +275,17 @@
     [ "$quiet" = true ] && mkdir -p "$font_dir"
     case $mode in
       copy)
-        [ "$quiet" = false ] && cp -fv "${files[@]}" "$font_dir"
-        [ "$quiet" = true ] && cp -f "${files[@]}" "$font_dir"
+        for font in "${files[@]}"; do
+          if [[ -f "${font_dir}/${font}" ]]; then
+            continue
+          else
+            if [[ "${quiet}" == true ]]; then
+              cp "${font}" "${font_dir}"
+            else
+              cp "${font}" "${font_dir}"
+            fi
+          fi
+        done
         ;;
       link)
         [ "$quiet" = false ] && ln -sfv "${files[@]}" "$font_dir"
@@ -285,18 +294,3 @@
     esac;;

 esac
-
-# Reset font cache on Linux
-if [[ -n $(which fc-cache) ]]; then
-  [ "$quiet" = false ] && fc-cache -vf "$font_dir"
-  [ "$quiet" = true ] && fc-cache -f "$font_dir"
-  case $? in
-    [0-1])
-      # Catch fc-cache returning 1 on a success
-      exit 0
-      ;;
-    *)
-      exit $?
-      ;;
-  esac
-fi