Skip to content

Commit

Permalink
Completely rework shell scripts
Browse files Browse the repository at this point in the history
This fixes multiple issues with shell scripts:
- current shell code is hardly readable because of too much unoptimized
  code
- some bugs (like openzfs#9168)
- inconsistent coding style
- very much missing documentation
- use of eva... evil() where it is not needed at all, e.g.:
  `eval export FSTAB_dev_$i="$fs"`
- duplicated functionality: in_mtab vs. is_mounted
- inconsistent use of mount and cat/read /proc/self/mounts (which both
  return the same results. the only differene is that mount does some
  formatting (insert on and type, put options in brackets, omitting
  freq and pass)
- caching of fstab and mtab in env makes everything very, very
  complicated and is not needed at all; (as far as I looked at the
  code; MAYBE this is really needed and I did not get this far, yet.
  we'll see)
  IMHO it really does not matter if we call grep multiple times... the
  difference is negligible and should be in the range of some 10s or
  100s of milliseconds...

This PR does a complete rework of all existing shell scripts to fix all
those problems while keeping backwards compatibility.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
  • Loading branch information
c0d3z3r0 committed Aug 19, 2019
1 parent ff4b68e commit f6b4f73
Show file tree
Hide file tree
Showing 2 changed files with 376 additions and 260 deletions.
Loading

0 comments on commit f6b4f73

Please sign in to comment.