HomeFreeBSD

nanobsd: enhance fill_pkg.sh

Description

nanobsd: enhance fill_pkg.sh

NanoBSD has helper script "fill_pkg.sh" which links all packages and
ther dependencies from "package dump" (like /usr/ports/packages/All) to
specified director. fill_pkg.sh has some limitations:

  1. It needs ports tree, which should have exactly same versions as "package dump".
  2. It requires full paths to needed ports, including "/usr/ports" part.
  3. It has assumptions about Nano Package Dir (it assumes, that it specified rtelative to current directory).
  4. It does not have any diagnostics (almost).

This PR enhances "fill_pkg.sh" script in several ways:

  1. Nano package dir could be absolute path.
  2. Script understands four ways to specify "root" ports/packages: (a) Absolute directory with port (old one) (b) Relative directory with port, relative to ${PORTSDIR} or /usr/ports (c) Absolute path to file with package (with .tbz suffix) (d) Name of package in dump dir, with or without .tbz suffix

    These ways can be mixed in one call. Dependencies for packages are obtained with 'pkg_info -r' call, and are searched for in same directory as "parent" package. Dependencies for ports are obtained in old way from port's Makefile.
  3. Three levels of diagnostic (and -v option, could be repeated) are added.
  4. All path variables are enclosed in quotes, to make script work with paths, containing spaces.

Note: imp merged in the changes to fill_pkg.sh since this has been a PR.

PR: 151695
Reviewed by: imp@
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D31101

Details

Provenance
levAuthored on Jul 11 2021, 3:04 PM
impCommitted on Jul 11 2021, 3:05 PM
Differential Revision
D31101: nanobsd: enhance fill_pkg.sh
Parents
rG9c1c02093b90: loader: support.4th resets the read buffer incorrectly
Branches
Unknown
Tags
Unknown