$Idaemons: /home/cvs/pkgtools/README,v 1.26 2001/06/07 03:05:13 knu Exp $

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

	lang/ruby		- Ruby interpreter
	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 [-hcCfFPPRinprsuv] [-A command] [-B command] [-o origin]
  [-m make_args] pkgname_glob [[-o origin] [-m make_args] pkgname_glob ...]
    -h, --help               Show this message
    -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, --fetch              Only fetch distfiles, do not build anything
    -f, --force              Force upgrade (even if equal or older)
    -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, --use-packages       Use packages in the specified directory instead of
                             ports whenever available - Specified twice, use no
                             ports but packages only
    -p, --package            Build package when each port is installed
    -R, --upward-recursive   Do with all those required by the given packages
                             as well (Implies -s)
    -r, --recursive          Do with all those depending on the given packages
                             as well (Implies -s)
    -s, --sort               Sort ports in dependency order before everything
    -u, --uninstall          Uninstall before each port installation
    -v, --verbose            Be verbose
    -Y, --yield-command=CMD  Specify the command to yield root privileges
                             e.g. 'su root -c "%s"' (default: sudo)
    -y, --yield              Yield root privileges where needed

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 [..].

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]


============
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: -scC)
    -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.


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

Pkgdepfix is an interactive tool to fix /var/db/pkg's @pkgdep and
+REQUIRED_BY discrepancies.  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

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.

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