Updates to the Zsh pkgtools.
authorSteve Youngs <steve@steveyoungs.com>
Thu, 18 Feb 2021 09:26:37 +0000 (19:26 +1000)
committerSteve Youngs <steve@steveyoungs.com>
Thu, 18 Feb 2021 09:26:37 +0000 (19:26 +1000)
commit27d480dd71227fadbf9b77b08feeecb9b73ed3e4
tree6203b7e8a5e519d0c6a1935ce71c0dd8ac6ead76
parente7ff1cfa1af57dbdf1795471b7d40b87e73bf046
Updates to the Zsh pkgtools.

Mostly this is to do with having groups span multiple lines in
/etc/group.  Toward that end, parsing /etc/group is not done anymore.
To get at the 'install' group members we use groupmems(8) (via sudo).

The output of Lpkg() was cleaned up.  Yup, I just discovered
column(1). :-)

Two new functions:
  dpkg() -- Print a package's short description
  Dpkg() -- Print a package's long description.

The old dpkg() to show a package's dependencies has been renamed to pkgdeps()

* etc/pkgusr/zsh/_zsh-pkgtools (_pkgtools_users): Use groupmems
instead of parsing /etc/group.

* etc/pkgusr/zsh/zsh-pkgtools: Whitespace reformat.  Tabs are 8
chars wide, but in shell-scripts I like 4 char indents.
(pkgdeps): New, renamed from 'dpkg'.
(dpkg): Now prints a package's short description.
(Dpkg): New, print a package's long description.
(pkglst): New.  Saves package list to a var, $PKGLST
(fpkg): Use $PKGLST. Add `-E' grep option.
(lpkg): Parse $PKGLST instead of /etc/group.
(Lpkg): Parse $PKGLST instead of /etc/group, use column(1) for
cleaner output.
(pkg_install): Call pkglst() to update $PKGLST
(pkgwant): Use $PKGLST instead of calling lpkg()

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
etc/pkgusr/zsh/_zsh-pkgtools
etc/pkgusr/zsh/zsh-pkgtools