Преглед на файлове

Remove the half-baked ini file caching

The caching does not clean up, and is mostly unnecessary since Linux
will cache the file anyway.
Alois Mahdal преди 10 години
родител
ревизия
1a0e95f2f2
променени са 1 файла, в които са добавени 1 реда и са изтрити 18 реда
  1. 1
    18
      mkit/include/ini.sh

+ 1
- 18
mkit/include/ini.sh Целия файл

@@ -15,24 +15,7 @@ ini() {
15 15
         1value) fn=_ini_greppath; limit="tail -1" ;;
16 16
         *)      die "incorrect use of \`ini()\`"
17 17
     esac
18
-    _ini_cached | $fn $arg | $limit
19
-}
20
-
21
-_ini_cached() {
22
-    #
23
-    # Load ini file to our cache (RAM disk) and cat it
24
-    #
25
-    # User should set MKIT_INI_CACHE to a ram-based file
26
-    # if mktemp cannot be relied upon.
27
-    #
28
-    if test -z "$_MKIT_INI_CACHED";
29
-    then
30
-        MKIT_INI_CACHE=${MKIT_INI_CACHE:-$(mktemp)}
31
-        _MKIT_INI_CACHED=$MKIT_INI_CACHE
32
-        test -r $MKIT_INI || die "cannot read MKIT_INI: $MKIT_INI"
33
-        cp $MKIT_INI $_MKIT_INI_CACHED
34
-    fi
35
-    cat $_MKIT_INI_CACHED
18
+    cat $MKIT_INI | $fn $arg | $limit
36 19
 }
37 20
 
38 21
 _ini_cat() {