~sourcemage/sorcery

8d44d25f35cb44cb912f97c05c2f31dd7fa42f02 — Ismael Luceno 8 months ago e9a1425
libgrimoire: Simplify setting size in mk_source_dir
1 files changed, 1 insertions(+), 8 deletions(-)

M var/lib/sorcery/modules/libgrimoire
M var/lib/sorcery/modules/libgrimoire => var/lib/sorcery/modules/libgrimoire +1 -8
@@ 39,22 39,15 @@ real_mk_source_dir() {
  local NEW_DIR=${NEW_DIR:=$SOURCE_DIRECTORY}

  local SIZE=$2
  # See bug 15946. Even simpler approach: Just specify no size, wich
  # also defaults to half of RAM in Linux.
  # TODO: Use given size to decide for TMPFS or not, early bail out
  # if not enough disk.
  local sizepar
  if [[ -n "$SIZE" ]]; then
    sizepar="size=$SIZE,"
  fi
  # Could also think about inode count being necessary.

  if  [  -n  "$NEW_DIR"  ];  then

    rm_source_dir  $NEW_DIR
    mkdir -p $NEW_DIR  &&
    if  [[  $TMPFS == on  ]]; then
      mount  -o "$sizepar"nr_inodes=1m  -t  tmpfs  tmpfs  $NEW_DIR
      mount -o "${SIZE:+size=$SIZE,}"nr_inodes=1m -t tmpfs tmpfs "$NEW_DIR"
    fi
  fi