* packages/pkg-template.sh
  Added array variables for handling of patches applied to packages.

* lib/functions.sh
  Wrapped directory names in double-quotes in calls to cd; just in
  case a path with spaces is used ...
* packages/pkg-*.sh
  Re-generated the package scripts. Added section for patch information to
  the template file, and added patches to those packages that require them.
* lib/functions.sh
  Added initial support for retrieval and validation of patch files.