That was good thinking.
Code:
man portupgrade
....................
-c
--config Run ``make config-conditional'' before everything
-f
--force Force the upgrade of a package even if it is to be
a downgrade or just a reinstall of the same ver-
sion, or the port is held by user using the
HOLD_PKGS variable in pkgtools.conf.
for all tasks.
-r
--recursive Act on all those packages depending on the given
packages as well.
-R
--upward-recursive Act on all those packages required by the given
packages as well. (When specified with -F, fetch
recursively, including the brand new, uninstalled
ports that an upgraded port requires)
I have had to do similar before. But only after I did a portupgrade in pieces and got dependencies all messed up.
For example you wait a year to upgrade the ports tree because you don't need to install anything, then try to install a port you probably will run into that.
# portupgrade -r gedit
will indeed upgrade gedit but may break something else that was depending on an older version of gtk, png, etc.
The way around that is to keep the ports tree and ports up to date all the time.
I don't particularly like having to do that. Not being able to simply upgrade a single app without having to upgrade the whole machine, or at least all of the apps of it's kind. It's because *.nix does not necessarily keep multiple versions of the same libraries and environments mapped to each app.
If it did though the install would be much bigger and more bloated. I can see the philosophy behind it. And it's been talked about before on this forum and others.
I will say this. You were able to find out the problem and repair it without reinstalling the whole machine. And that's because the information, tools, and resources are available to anyone to use. And you got an education in the process.
Had it been a closed source OS and apps.....there is nothing that you can do but start over.
Long live open source and open standards.