cvs commit: ports UPDATING

Stephen Montgomery-Smith stephen at missouri.edu
Fri Jul 1 05:22:10 UTC 2011


On 06/30/2011 11:18 PM, Glen Barber wrote:

> I think it would be nice to have a
> "I_KNOW_I_HAVE_THIS_PORT_INSTALLED_ALREADY_BUT_UPGRADE_IT_ANYWAY" flag
> for situations that seem to be what caused this reply, unless I
> misunderstand the cause of the UPDATING entry.  In either case, see below.

The UPDATING entry was a different issue.

> More specifically, I think it would be nice if
> 'PACKAGE_SITE=$mylocaltinderbox pkg_add<somepackage>' didn't complain
> that I already have a prerequisite packages, though lesser-versioned
> that is required for<somepackage>  installed currently, while failing to
> upgrade the prerequisite package when I know it's necessary for the
> <somepackage>  upgrade.

The trouble with this is that when you deinstall some prerequisite 
package, that other packages might also need that prerequisite package. 
  So pkg_add would have to figure out that it needs to deinstall all the 
packages needing that prerequisite package, and then reinstall them.

For example, you want to upgrade gnome2, which depends on libX11.  But 
in upgrading libX11, pkg_add has to figure out that it also needs to 
deinstall openoffice, and then reinstall it.

I would think that something like this could be done, but it would be a 
lot of work to write this program correctly.  (But you might be 
satisfied that pkg_add does what portmaster does, which is to update the 
+REQUIRED_BY entries in all the appropriate places in /var/db/pkg.  That 
probably wouldn't be too hard.)

> Maybe I've missed various flags in various manual pages - I would be
> thrilled to be proven that this is the case.

What I do is to use a script like this:

!/bin/sh
for p in /var/db/pkg/*; do
   if [ -d $p ]; then \
     p=`basename $p`
     if ! [ -e $mylocaltinderbox/All/$p.tbz ]; then
       echo $p
     fi
   fi
done

and then pipe the output of this script into

xargs pkg_delete -r


More information about the freebsd-ports mailing list