portupgradeの例
OptionParser.new(banner, COLUMNSIZE) do |opts|
opts.def_option("-h", "--help",
"Show this message") {
print opts
exit 0
}
opts.def_option("-a", "--all",
"Do with all the installed packages") { |v|
$all = v
$recursive = false
$upward_recursive = false
}
opts.def_option("-A", "--afterinstall=CMD",
"Run the command after each installation") { |v|
$afterinstall = v
$afterinstall.strip!
}
:
opts.def_tail_option '
pkgname_glob is one of these: a full pkgname, a pkgname w/o version,
a shell glob pattern in which you can use wildcards *, ?, and [..],
an extended regular expression preceded by a colon (:), or a date range
specification preceded by either < or >. See pkg_glob(1) for details.
The package list is automatically sorted in dependency order.
Environment Variables [default]:
PACKAGES packages directory [$PORTSDIR/packages]
PKGTOOLS_CONF configuration file [$PREFIX/etc/pkgtools.conf]
PKG_BACKUP_DIR directory for keeping old packages [$PKG_PATH]
PKG_DBDIR packages DB directory [/var/db/pkg]
PKG_PATH packages search path [$PACKAGES/All]
PKG_TMPDIR temporary directory for backup etc. [$TMPDIR]
(Note: This must have enough free space when upgrading a big package)
PORTSDIR ports directory [/usr/ports]
PORTS_DBDIR ports db directory [$PORTSDIR]
PORTS_INDEX ports index file [$PORTSDIR/INDEX]
PORTUPGRADE default options (e.g. -v) [none]
TMPDIR temporary directory [/var/tmp]'