Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jun 2004 12:16:10 -0400
From:      Randy Pratt <rpratt1950@earthlink.net>
To:        Kent Stewart <kstewart@owt.com>
Cc:        bhunter@solisix.com
Subject:   portupgrade -c (was Re: Boot GUI / Boot data and process / Fragmentation)
Message-ID:  <20040608121610.7e5eb129.rpratt1950@earthlink.net>
In-Reply-To: <200406080059.58329.kstewart@owt.com>
References:  <1086678211.1640.13.camel@solid.solisixoffice.com> <200406080026.24396.kstewart@owt.com> <1086680219.29206.3.camel@solid.solisixoffice.com> <200406080059.58329.kstewart@owt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 8 Jun 2004 00:59:58 -0700
Kent Stewart <kstewart@owt.com> wrote:

> On Tuesday 08 June 2004 12:37 am, Bruce Hunter wrote:
> > Thanks for your help Kent
> >
> > I read something about using portversion -c with the portupgrade
> > command to upgrade installed pkgs that needed to be updated.
> >
> > When I run portversion -c  :: I get a print out of things needed to
> > be upgraded and at the end, it shows a 'if' statment.
> >
> > How do you use this command with portupgrade so it just updates them
> > instead of just showing me. Just do it dang it... just do it! ;o)

The output of "portversion -c" needs to be redirected to a file:

    portversion -c > scriptname.sh

To make it usable as a shell script, it needs to have

    #!/bin/sh

added at the top to insure that it uses the sh command interperter.
Then, the script needs to be made executable:

    chmod 744 scriptname.sh

Then it can be run as root:

    ./scriptname.sh

> I'm not the one to ask because I use the -c and do them one at a time. 
> The portupgrade option -rRa will do some of it. I just want it to do it 
> at my convience and choosing :). I also have an AMD 2400+ that sits off 
> to the side of my computer desk and I build everything on it. The 
> problem with the -c list is that it doesn't build dependancies first.

I think it will build the required dependencies first *if* they
need updated.  The synopsis of portupgrade is:

    portupgrade [ ... bunch of options ... ] pkgname-glob

A list of ports can be passed to portugrade and it will check which
needs to be built first.  This can easily be checked if you have
doubts.  Use -n for "no-execute" and -f to "force".  This is a test
case I tried where liveMedia is a dependency of mplayer:

  # portupgrade -nf mplayer-gtk-esound-0.92.1_2 liveMedia-2004.06.07,1
  --->  Session started at: Tue, 08 Jun 2004 11:06:39 -0400
  --->  Reinstallation of net/liveMedia started at: Tue, 08 Jun 2004
        11:06:40 -0400
  --->  Reinstalling 'liveMedia-2004.06.07,1' (net/liveMedia)
        OK? [no]
  --->  Reinstallation of net/liveMedia ended at: Tue, 08 Jun 2004
        11:06:40 -0400 (consumed 00:00:00)
  --->  Reinstallation of multimedia/mplayer started at: Tue, 08 Jun
        2004 11:06:41 -0400
  --->  Reinstalling 'mplayer-gtk-esound-0.92.1_2'
        (multimedia/mplayer)
        OK? [no]
  --->  Reinstallation of multimedia/mplayer ended at: Tue, 08 Jun
        2004 11:06:41 -0400 (consumed 00:00:00)
  --->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        + net/liveMedia (liveMedia-2004.06.07,1)
        + multimedia/mplayer (mplayer-gtk-esound-0.92.1_2)
  --->  Packages processed: 2 done, 0 ignored, 0 skipped and 0 failed
  --->  Session ended at: Tue, 08 Jun 2004 11:06:41 -0400 (consumed 00:00:01)
  #

Notice that liveMedia was updated first even though it was last in
the list of ports passed to portupgrade.  The portversion -c 
produces a list of ports and stores them in its variable $pkgs.
Portupgrade will take the list and build them in the correct
dependency order.

I've used this approach for several years now and it works fine.

However, caution should be used when scripting the upgrading of
ports.  After cvsupping and running portsdb -Uu, the
/usr/ports/UPDATING should be read and any items that are
applicable to the installation should be followed before running
any scripts or other portupgrade commands.

If you still prefer doing ports manually, the output of
portupgrade -c can still be useful.  By modifying the script
slightly, it will produce a list of ports to be updated in the
order they should be updated.  Just change the line:

    portupgrade "$@" $pkgs

to:

    pkg_glob $pkgs | pkg_sort

It should be noted that some ports may not work until the entire
list is updated and as usual, your mileage may vary.

I'm sure someone will correct me if I'm thinking wrong about this.

Best regards,

Randy

[ ... other topics snipped ... ]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040608121610.7e5eb129.rpratt1950>