$Idaemons: /home/cvs/pkgtools/README,v 1.29 2001/06/10 21:05:09 knu Exp $

You need to install the following ports to use these pkgtools.

	lang/ruby		- Ruby interpreter
	devel/ruby-fnmatch	- Ruby module that provides File::fnmatch
	devel/ruby-optparse	- Ruby option parser library

	devel/ruby-unit		- (Only if you do tests)

============
portupgrade
============

Portupgrade is a tool to upgrade installed packages via the port.

It upgrades ports without reinstalling dependent packages by directly
modifying the package info recorded in the files under /var/db/pkg.

The procedures it takes is shown as below:

    1.	Build the corresponding port of the given installed package
	(or search for a new package if -PP is specified or -P is
	specified and no new package is found)

    2.	Fix the dependency info of the ones which depends on the given
	package

    3.	Save the +REQUIRED_BY list of the given package

    4.	If -u is specified,

	4-1.	Back up the current installation of the given package
		using pkg_tarup.

	4-2.	Back up the current package registry of the given package.

	4-3.	Uninstall the given package forcibly.

    5.	Install the new version via the port (built in <1>)
	(or install the new package if -P/-PP is specified and a new
	package is found in <1>)

    6.	If the installation fails,

	6-1.	Restore the old installation backed up in <4-1>.

	6-2.	Restore the old package registry backed up in <4-2>.

    7.  Restore the +REQUIRED_BY list (saved in <3>)

The usage can be shown by running it without arguments or with a -h:

usage: portupgrade [-hacCfFinpPPrRsuv] [-A command] [-B command]
  [-S command] [-x pkgname_glob] [[-o origin] [-m make_args] pkgname_glob]
  [[-o origin] [-m make_args] pkgname_glob ...]

    -h, --help               Show this message
    -a, --all                Do with all the installed packages
    -A, --afterinstall=CMD   Run the command after each installation
    -B, --beforebuild=CMD    Run the command before each build
    -c, --clean              Do "make clean" before each build, or do
                             "make distclean" when specified with -F
    -C, --cleanup            Do "make clean" after each installation
    -f, --force              Force upgrade (even if equal or older)
    -F, --fetch              Only fetch distfiles, do not build anything
    -i, --interactive        Turn on interactive mode
    -m, --make-args=ARGS     Specify the arguments to pass to make(1)
    -n, --noexecute          Do not upgrade any ports, but just show the list
    -o, --origin=ORIGIN      Specify the port to upgrade the following pkg with
    -p, --package            Build package when each port is installed
    -P, --use-packages       Use packages in the specified directory instead of
                             ports whenever available - Specified twice, use no
                             ports but packages only
    -r, --recursive          Do with all those depending on the given packages
                             as well (Implies -s)
    -R, --upward-recursive   Do with all those required by the given packages
                             as well (Implies -s)
    -s, --sudo               Run commands under sudo(8) where needed
    -S, --sudo-command=CMD   Specify the alternative to sudo(8)
                             e.g. 'su root -c "%s"' (default: sudo)
    -u, --uninstall          Uninstall before each port installation
    -v, --verbose            Be verbose
    -x, --exclude=GLOB       Exclude packages matching the specified glob
                             pattern

pkgname_glob is one of these: a full pkgname, a pkgname w/o version,
or a shell glob pattern in which you can use the wildcards *, ?, and [..].
The package list is automatically sorted in dependency order.

Environment Variables [default]:
    TMPDIR                   temporary directory (for backup etc.) [/var/tmp]
    PORTSDIR                 ports directory [/usr/ports]
    PKGREPOSITORY            packages directory [$PORTSDIR/packages]
    PKGREPOSITORYSUBDIR      packages subdirectory [All]
    PKG_DBDIR                packages DB directory [/var/db/pkg]
    PORTUPGRADE              default options (e.g. -v) [none]


============
portversion
============

Portversion is a tool to compare the versions of install packages with
the ones in the ports tree.  It is mostly compatible with
pkg_version(1) in usage, except it is cooperative with portupgrade and
its command output is optimized for portupgrade.  Also, it is faster
than pkg_version(1) since portversion runs several make(1) instances
simultaneously. (four by default)

usage: portversion [-hv] [-j max_jobs] [-l limit_chars] [-l inv_limit_chars]
         [[-o origin] [-m make_args] pkgname_glob ...]
       portversion [-v] -t ver0 ver1 [ver2 ...]
    -c, --command-output     Enable command output
    -C, --command-args=ARGS  Specify the arguments for portupgrade in command
                             output (default: -cC)
    -h, --help               Show this message
    -j, --jobs=N             Specify the maximum number of jobs that are run
                             simultaneously
    -l, --limit=CHARS        Only include the packages with the specified
                             status flags
    -L, --inv-limit=CHARS    Exclude the packages with the specified
                             status flags
    -m, --make-args=ARGS     Specify the arguments to pass to make(1)
    -o, --origin=ORIGIN      Specify the port to upgrade the following pkg with
    -t, --test=VERSION       Compare the version with the following one(s),
                             and print the result(s)
    -v, --verbose            Be verbose

pkgname_glob is one of these: a full pkgname, a pkgname w/o version,
or a shell glob pattern in which you can use the wildcards *, ?, and [..].
If none is given, all the installed packages are checked.


============
portsdb
============

Portsdb updates ports databases.  INDEX.db is a DBM database made from
INDEX, which is used by pkgdepfix's origin guesser, and other tools in
the future.  The file is automatically updated when it is accessed
through the portsdb library, if it is older than INDEX.

usage: portsdb [-huU]

    -h, --help               Show this message
    -u, --updatedb           Update INDEX.db
    -U, --update             Update INDEX


============
pkgdepfix
============

Pkgdepfix is an interactive tool to fix /var/db/pkg's @pkgdep and
+REQUIRED_BY discrepancies, and stale or missing origins, optionally.
Run this periodically so portupgrade and other pkg tools can work
effectively.

usage: pkgdepfix [-hv] [old_pkgname new_pkgname]

    -h, --help               Show this message
    -v, --verbose            Be verbose
    -o, --fix-origin         Turn on the origin fixer

When two package names are given, pkgdepfix replaces all the dependencies
recorded as old_pkgname with new_pkgname.  Otherwise pkgdepfix runs
in the interactive mode and helps you fix stale dependencies.
(And stale origins, optionally)

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp
