Subject: pkgsrc tools
To: None <tech-pkg@netbsd.org>
From: pancake <pancake@phreaker.net>
List: tech-pkg
Date: 10/23/2003 16:11:49
Since 1 month +o- I was concerned on a simple tool to manage in a easy way some features of pkgsrc. And thinking how to 'upgrade' some features.

From my fingers born 2 apps.. pkgmng and pkgdb.

The first one is a shellscript that allows to download/install/deinstall from cvs and pkgsrc tree showing first-step dependencies and allowing listing and searching of packages.

http://pancake.host.sk/altres/src/pkgmng

an example:
pancake@pl2:~$ pkgmng 
Usage /usr/bin/pkgmng method [options]
  whereis [pkgnames]     - find where is a package.
  show [pkgnames]        - show pkg description.
  fetch [pkgsrc [?]|wip] - fetch all official and/or wip tree.
  get [cat/pkgnames]     - get one package and shows it dependencies.
  install [pkgnames]     - install packages.
  delete  [pkgnames]     - remove packages
  list                   - list all pkg installed ordened by name.

pancake@pl2:~$ pkgmng w wo 
wo (1) editors/           abiword
wo (4) games/     powwow tileworld wormz xworm
wo (1) lang/      wonka
wo (2) misc/      kdeartwork2 kdeartwork3
wo (4) net/       kdenetwork kdenetwork2 kdenetwork3 wol
wo (2) wip/       words xfce4-artwork

pancake@pl2:~$ pkgmng show editors/abiword
Direct depends for editors/abiword: 
ERR editors/abiword/Makefile.common
.include "../../converters/libiconv/buildlink2.mk"
.include "../../converters/psiconv/buildlink2.mk"
.include "../../graphics/png/buildlink2.mk"
.include "../../textproc/expat/buildlink2.mk"
.include "../../graphics/xpm/buildlink2.mk"
.include "../../x11/gtk/buildlink2.mk"
DEPENDS+=       ispell-base-[0-9]*:../../textproc/ispell-base
--
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE:=abiword/}
HOMEPAGE=       http://www.abisource.com/
COMMENT=        Open Source cross-platform word processor

AbiWord is a small and simple word processor, that is fast and complete.
Abiword's features include it's "look & feel", the ability to format pages
and paragraphs, a spell checker, an interactive ruler, the integration of
styles, the unlimited capacity to undo/redo , a find and replace function
and the image insertion.  It is also able to import documents from Microsoft
Word 97 and rtf (Rich Text Format) and to save documents using Internet HTML
format.  Several other features are planned for future releases, these
include tables, lists and a Microsoft Word exporter.


==


Well. now about pkgdb...pkgdb is in short the second version of pkgmng but using a database. It's written in perl. This allows the user to use this command and forget on download 100MB of pkgsrc-tree, Only needs a 100KB file (pkgsrc database). And pkgdb generates it's dependencies and downloads whathever is necessary.

Let's see:

pancake@pl2:~/prg$ perl pkgdb 
PKGSRC database implementation.  -pancake@phreaker.net-
Usage: "pkg_db" [options] [args]
 [options]
  gendb     - Generates a pkgsrc database on stdout.
  getdb     - Download the pkgsrc database.
  show      - Show information of certain packet.
  search    - Search a package.
  install   - Download deps and install.
  deinstall - Deinstall target packages. (TODO)
  update    - List all not updated packages.
**autoclean*- Allways remove not old packages.

pancake@pl2:~/prg$ perl pkgdb gendb|head
PKG: libiconv
VER: 1.9.1
CAT: converters
COM: Character set conversion library
--
PKG: abook
VER: 0.5.0
CAT: databases
COM: Text-based addressbook program
DEP: ncurses readline 
pancake@pl2:~/prg$ 

pancake@pl2:~/prg$ perl pkgdb show abook # this takes info from database

PKG: abook
VER: 0.5.0
CAT: databases
COM: Text-based addressbook program
DEP: devel/ncurses devel/readline 

pancake@pl2:~/prg$ perl pkgdb search apple
quicklist       - Simple database like AppleWorks & MS Works.
xworm   - Classic game with apples and hungry worm.
ooqstart        - OpenOffice quickstart applet for GNOME.
airport2basestationconfig       - Configuration program for Apple's Airport Base Station.
airportbasestationconfig        - Configuration program for Apple's Airport Base Station.
airportmodemutility     - Modem (dis)connection utility for Apple's Airport Base Station.
netatalk        - Netatalk appletalk file and print services.
netatalk-asun   - Netatalk appletalk file and print services, enhanced by Adrian Sun.
netatalk-umich  - University of Michigan's netatalk; AppleTalk interworking.


Well, Now I haven't got enought time to follow writting this apps :(, but I think that this kind of concepts could be interesting to create a new pkgsrc tool. This cmds, are just for fun. The second one generate all the db perfectly :( (some pkg, like xmms, have complex structures in the Makefile, and make them difficult to trace), But it's only a time problem not, technichal.

If anybody is interested. just download the tool and play with it :) 

pkgdb is also in the same path: http://pancake.host.sk/altres/src/pkgdb

bye

-- 
Software is like violence. Is better if it's free.
--