Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Aug 2007 01:33:57 -0700
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        Rakhesh Sasidharan <rakhesh@rakhesh.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: How did upgrading applications happen before portupgrade etc?
Message-ID:  <20070811083357.GA34007@eos.sc1.parodius.com>
In-Reply-To: <20070811115642.L34115@obelix.home.rakhesh.com>
References:  <20070811115642.L34115@obelix.home.rakhesh.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 11, 2007 at 12:03:33PM +0400, Rakhesh Sasidharan wrote:
> Just a question that struck me today. Before there were the portupgrade and 
> other tools for upgrading installed applications to their newer versions, 
> how did things work out?
>
> Did one upgrade applications through a series of "make deinstall reinstall" 
> commands (I wonder if these commands take care of dependencies too) or was 
> there any other way?

Along those lines, yes.  I'm one of those administrators who does not
want something like portupgrade on his systems; I do not believe in
having two separate databases maintaining dependencies and what's
installed (portupgrade vs. base system pkg_* tools).  Lots of people
love portupgrade, and that's great.  But the number of times I have seen
reports of database corruption or "database sync mismatches"
(portupgrade thinks A, while pkg_* thinks B) is astounding.

There are script-based tools now such as Doug Barton's portmaster which
I haven't used or looked into yet, but the fact that they rely on the
stock base pkg_* tools is fantastic.  Those are something I'm open to.

Anyways, opinions aside and to answer your question -- the procedure I
go through is something along these lines:

1.  Update ports tree (cd /usr/ports && make update)
2.  pkg_version -v and look for stuff that's reported outdated or
    "Comparison failed" (likely the port relocated to another section)
3.  Examine the CVS commit log for the port in question.  A lot of the
    time I'll find that the upgrade simply isn't worth it, so no harm
    done in leaving it outdated.
4.  Shut down services/daemons which might be affected by below steps.
5.  pkg_delete port
6.  cd /usr/ports/whatever && make clean
7.  make config, make && make install
8.  Make sure configuration file symlinks didn't get nuked.
9.  Restart services/daemons.
10. Pay close attention to /var/log/all.log for quite some time.  :-)

Every 4-6 months, I go through the below process.  I'll also do this
when there's something "major" in the dependency tree which gets updated
that lots of things depend upon.  The most common examples are gettext,
libiconv, libtool, and the automake/autoconf tools.

1.  Do all of above steps
2.  Make a backup of /usr/local (usually using rsync)
3.  pkg_version or pkg_info and save a list of what's installed.
4.  pkg_delete -a -f
5.  rm -fr /usr/local/*
6.  rm -fr /var/db/ports/*
7.  Go through the process of manually:
      cd /usr/ports/whatever
      make clean
      make config
      Select applicable options pertaining to our setup
      make && make install
    Or for things I don't want to build (like perl and python):
      pkg_add -r perl  (or whatever)
8.  Re-add symlinks for applicable configuration files, etc.
9.  Restart services/daemons.
10. Pay close attention to /var/log/all.log for quite some time.  :-)

...I think I got those right.  I might be missing a step or two.

Note that we keep all of our configuration files in a directory called
/conf/ME and in /usr/local simply use symlinks.  (Matt Dillon might be
grinning over /conf/ME, since it's a Best Internet-ism :) ).  I don't
trust that all ports will "play nice" with existing configuration files
in /usr/local, and I have seen much evidence of this in the past (nuking
files without your knowledge, mainly.  "Oh crap! It nuked our entire
configuration for the apache/mail/whatever server!!!").

In the case that I can't, I might ask on #bsdports, or mailing lists.

Hope this gives you some insight into the mind of one admin who prefers
to do things "the old way" rather than let automated tools try and
emulate my brain.

-- 
| Jeremy Chadwick                                    jdc at parodius.com |
| Parodius Networking                           http://www.parodius.com/ |
| UNIX Systems Administrator                      Mountain View, CA, USA |
| Making life hard for others since 1977.                  PGP: 4BD6C0CB |




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