Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Feb 2001 07:19:54 +0900
From:      "Akinori MUSHA" <knu@iDaemons.org>
To:        ports@FreeBSD.org
Subject:   new tool: portupgrade
Message-ID:  <86k874g4c5.wl@archon.local.idaemons.org>

next in thread | raw e-mail | index | archive | help
Hi, ports folks,

I wrote a handy tool to upgrade already installed packages with the
latest ports, called <portupgrade>.  It's still far from finished
(error handling, recursive upgrades, etc.), but it has achieved my
primary goal.

Grab the following tarball and use with care at your own risk:

	http://people.FreeBSD.org/~knu/misc/portupgrade.tar.gz


Of course :P it's written in Ruby, so please install lang/ruby in
advance and run "./install.rb" to install.


I haven't yet written any docs, but a brief help is shown as below:

Usage: portupgrade [-hcdfiu] [-o origin] [-m make_args] pkgname_glob [[-o origin] [-m make_args] pkgname_glob ...]
    -h, --help               show this message
    -c, --cleanbuild         clean before each port build
    -d, --clean              clean after each port installation
    -f, --force              force upgrade (even if equal or older)
    -i, --interactive        turn on interactive mode
    -u, --uninstall          uninstall before each port installation
    -o, --origin=ORIGIN      specify the port to upgrade the following pkg with
    -m, --make-args=ARGS     specify the arguments to pass to make(1)

pkgname_glob is one of a full pkgname, a pkgname w/o version, or a glob.
In a glob, you can use the wildcards *, ?, and [class].


For example, you can upgrade all GNOME packages by typing as follows:

	portupgrade 'gnome*'

If you want to wipe out the installed files before installation, add
-u to the command line.  By default, it doesn't uninstall the old
package and just overwrites it with the new one, keeping the package
database consistent.

In any case, portupgrade only builds and installs the specified
port(s), but does not for the dependent/depending ports.  It surely
sounds bruteforce, but it works. :)

So you will no longer bother with updating a fundamental library
package, because you don't need to deinstall, rebuild and reinstall
the dependent ports for nothing.  Even if the shared library version
is bumped, portupgrade will not kill the old version unless you
specify -u on the command line. (And you can update the dependent
ports any time you want later)

Try:

	portupgrade freetype
	portupgrade 'qt-2*'
	portupgrade librep rep-gtk sawfish-gnome

and so on.  (As for the last case, I'm going to add -r and -R to
recurse the dependency up and down to make it easier)

One more thing, portupgrade uses "origin" info to find which port to
upgrade a package with, so you'll have to specify an "-o <origin>" by
hand for each package that had been installed before "origin" was
introduced.  Perhaps I'll write a tool to add the "origin" info for
those packages that lack it, though.

Thanks to the new attribute, portupgrade doesn't need to look up
/usr/ports/INDEX at all for now, which often goes stale.


Any comments, suggestions, patches would be appreciated.  Have fun,
and be careful.  You are warned. :->

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

"We're only at home when we're on the run, on the wing, on the fly"


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86k874g4c5.wl>