# how.sh takes a package name, a version, and a path. mounts scripts for patching, configuring, building, and installing the given version of the package at the given path in read-only mode using either overlayfs or, if no package-specific scripts were found, a bind mount. dependencies: `shsort` and `vercmp`, as well as 'how-defaults' and 'how-pkgs' repositories. (see makefile.) 55 SLOC. usage: how ## package structure if a package or version is not recognized, how.sh will bind-mount the `default` directory in read-only mode at the requested path. a package and version is recognized based on the presence of a subdirectory in the `pkg` directory matching the package name with a subdirectory whose name translates to a version equal to or less than version of the package requested, or a subdirectory named `default`. the structure looks something like this: pkg/ |-- / | |-- / ... `version` is matched using `vercmp`. if `vercmp` has a format that matches the package name, then that format is used to compare versions for the package. otherwise, the default comparison function is used. the version directories are sorted using `shsort` and `vercmp` and mounted as an overlay filesystem with the lower versions being lower in the overlay and higher versions being higher. `default` package subdirectories are always one layer above the `default` directory; the `default` directory is always lowest. ## patches multiple patches may be offered in a package. by convention, patches are kept in the `patches` subdirectory of the package root. the default `patch` command looks for a single combined patch, likely constructed by concatenating or otherwise combining offered patches, under the filename `patch` in the package root.