Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Jun 2001 16:28:07 +0900
From:      "Akinori MUSHA" <knu@iDaemons.org>
To:        ports@FreeBSD.org
Subject:   [ANN] portupgrade 20010607b
Message-ID:  <868zj47nqw.wl@archon.local.idaemons.org>
In-Reply-To: <200106070317.f573Hlc59061@freefall.freebsd.org>
References:  <200106070317.f573Hlc59061@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi, this is an introduction to portupgrade (sysutils/portupgrade).

I have rolled the latest release 20010607b today and I think it is
stable enough, fail safe and usable for popular use.

Make sure you have the latest ruby (lang/ruby) and pkg_tarup
(misc/pkg_tarup) installed, or portupgrade may not work correctly.
(If you don't have them installed yet, then leave everything to the
sysutils/portupgrade port and the latest ruby and pkg_tarup are
installed as dependency.

At Wed, 6 Jun 2001 20:17:47 -0700 (PDT),
I wrote:
>   Modified files:
>     sysutils/portupgrade Makefile distinfo 
>   Log:
>   Update to 20010607b.

Now portupgrade can do upgrading via the package in addition to via
the port.  To do that, make sure you put the packages under the
directory /usr/ports/packages/All and first try:

	portupgrade -nPP '*'

To see which and which installed packages can be upgraded.  And when
you are ready, hit:

	portupgrade -PP '*'

To perform all the upgrades.  Or you may want to specify just part of
them like:

	portupgrade -PP 'gnome-*'

Or specify -i to let portupgrade ask you for approval on each upgrade.

When everything is done, run pkgdepfix to fix up all the stale or
discrepant dependencies remained within your package
registry. (/var/db/pkg)

		*		*		*

Needless to say, portupgrade was born to be able to upgrade the
installed packages via the port on the fly.  Without -P, it tries to
upgrade packages by the latest ports.  For instance:

Mission 1)
  Upgrade everything in dependency order!

  Command:
    portupgrade -scC '*'

  Related options:

    -s, --sort               Sort ports in dependency order before everything
    -c, --clean              Do "make clean" before each build, or do
                             "make distclean" when specified with -F
    -C, --cleanup            Do "make clean" after each installation

Mission 2)
  Upgrade `screen' and `sudo', then make them packages at the same
  time!

  Command:
    portupgrade -p screen sudo

  Related options:
    -p, --package            Build package when each port is installed

Mission 3)
  Oh mess, I should really have built and installed OpenLDAP2 with
  -DWITH_SASL...  But seems it's too late since too many ports are
  depending on it by now...  Can I rebuild and reinstall it without
  messing up package dependencies?

  Command:
    portupgrade -fm -DWITH_SASL 'openldap-2*'

    -f, --force              Force upgrade (even if equal or older)
    -m, --make-args=ARGS     Specify the arguments to pass to make(1)

Mission 4)
  Rebuild and reinstall `sdl' and its all dependents!

  Command:
    portupgrade -rf sdl

  Related options:
    -r, --recursive          Do with all those depending on the given packages
                             as well (Implies -s)

Mission 5)
  Upgrade `postfix' and all those which it depends on!  Hey, you know
  you must do the upgrade in dependency order, don't you?

  Command:
    portupgrade -R postfix

  Related options:
    -R, --upward-recursive   Do with all those required by the given
                             packages as well (Implies -s)

Mission 6)
  Fetch all the distfiles that are needed to upgrade `gnome-*', NOW!

  Command:
    portupgrade -F 'gnome-*'

  Related options:
    -F, --fetch              Only fetch distfiles, do not build anything

Mission 7)
  Use /home/user/ports as ports tree, and upgrade `zsh'!  The old
  installation should be eliminated entirely, and don't forget to do
  a "cvs update" before cheking the version and building the port!  Oh
  wait, build it as a normal user and only demand root privilege using
  sudo where needed!  GOT IT?!

  Command:
    env PORTSDIR=/home/user/portsportupgrade -B 'cvs up' -uy zsh

  Related options:
    -B, --beforebuild=CMD    Run the command before each build
    -u, --uninstall          Uninstall before each port installation
    -y, --yield              Yield root privileges where needed

Mission 8)
  D'uh, this `bzip2' installation seems so old that it doesn't have an
  "origin" thing recorded...  I know where the port lies, so can I
  specify it manually?

  Command: (assuming you are using zsh :)
    portupgrade -o ar[tab]/bz[tab]2 bz[tab]

  Related options:
    -o, --origin=ORIGIN      Specify the port to upgrade the following pkg with

  Notes:
    I will NOT provide a migration tool for this.  Packages without
    origins are obsolete and should be just delete (pkg_delete -f) and
    reinstalled.  You can fix up its dependencies using pkgdepfix.

Always remember that -n/--no-execute and -i/--interactive is your
friend, and -v/--verbose is useful to trace what is going on.  And
don't be afraid, you are now armed with pkgdepfix with which you can
interactively reconstruct and fix up all the dependency registry,
though periodically backing up /var/db/pkg is recommended.

Also, give portversion a try instead of pkg_version.  It runs much
faster than pkg_version, and is meant to be cooperative with
portupgrade.  That is, portversion -c outputs a script which runs
portupgrade -scC so that all the upgrades are done in dependency
order.


Comments and suggestions are welcome, although I think I will hardly
add more features into portupgrade since I am quite satisfied with it
already.

Enjoy, at your own risk. :>

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

"Freeze this moment a little bit longer, make each impression
  a little bit stronger..  Experience slips away -- Time stand still"

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?868zj47nqw.wl>