Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jul 2009 23:35:54 -0800
From:      Mel Flynn <mel.flynn+fbsd.current@mailing.thruhere.net>
To:        freebsd-current@freebsd.org
Cc:        Doug Barton <dougb@freebsd.org>, freebsd-stable@freebsd.org, "O. Hartmann" <ohartman@mail.zedat.fu-berlin.de>, Thomas Backman <serenity@exscape.org>, Olivier SMEDTS <olivier@gid0.org>, Steve Kargl <sgk@troutmask.apl.washington.edu>, Ken Smith <kensmith@cse.buffalo.edu>
Subject:   Re: HEADS-UP: Shared Library Versions bumped...
Message-ID:  <200907232335.54973.mel.flynn%2Bfbsd.current@mailing.thruhere.net>
In-Reply-To: <200907241625.16312.doconnor@gsoft.com.au>
References:  <1248027417.14210.110.camel@neo.cse.buffalo.edu> <200907220814.38246.jhb@freebsd.org> <200907241625.16312.doconnor@gsoft.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 23 July 2009 22:55:07 Daniel O'Connor wrote:
> On Wed, 22 Jul 2009, John Baldwin wrote:
> > > How many of those 800 ports are actually necessary and used?
> > > It would be better to get generate a complete list of your
> > > installed ports, use pkg_deinstall or pkg_delete to remove
> > > all ports, and then selectively re-install ports that are
> > > actually used.
> >
> > Xorg takes up ~200 ports alone (not including dependencies like perl,
> > etc.) since the Xorg decided release engineering was too hard.  Throw
> > in things like KDE, OOo, Firefox, etc. for a desktop and you can get
> > a fairly high package count. :-/
>
> Ooh I only have 1315 on mine, but a 1.4GHz Pentium-M is pretty slow
> these days :(
>
> Perhaps there needs to be a psuedo port for 'base' (or a few) so that
> you can easily determine if you have already upgraded something against
> the new base you installed.
>
> Certainly I find it difficult to leave my laptop on for long enough to
> recompile everything when I upgrade -current (since I actually use it
> for work), and portupgrade -fa has no way to tell if it's already done
> something. If there were pseudo base ports you could tell it to force
> upgrade everything that depends on the old base port and it would DTRT.

I wrapped portmaster, since -af has the same problem when something screws the 
build (mostly plist problems and $me wanting backup packages, but also 
classics like using sudo as PM_SU_CMD and trying to reinstall it).

Basically, I made a list of all the installed ports and sorted dep order, then 
called portmaster -u for every port and if successful put an empty file 
+PM_DONE in /var/db/pkg/<pkgname>/. On a restart the ports containing a 
+PM_DONE file are skipped.

If the entire process finishes successfully, all +PM_DONE files are removed. I 
briefly looked into building it into portmaster, but that looked to take 
longer then I had time for. The main loop is at the bottom, perhaps Doug likes 
the idea and has the time to integrate it.

> I, of course, have no patches for such a thing :)
>
> I've deleted /usr/local & /var/db/pkg in the past, it can be very
> therapeutic :) However it is not so good when your mp3 collection is
> mounted on /usr/local/mp3 and you forgot to unmount it first.. :(

Or your websites in /usr/local/www, your database in /usr/local/pgsql or your 
squid conf and cache in /usr/local/squid. Especially when pkg_delete -af does 
the right thing and leaves all this in tact, I don't see the value of rm -rf 
/usr/local, other then a few minutes on a process that's likely going to be 
several hours or days.
-- 
Mel

mark_done()
{          
        local _name
        _name=$1   
        if test -d ${PKG_DBDIR}/${_name}; then
                ${SUDO} ${TOUCH} ${PKG_DBDIR}/${_name}/+PM_DONE
        else                                                   
                return 1;                                      
        fi                                                     
        return 0;                                              
}                                                              

for origin in ${LIST}; do
        pkgname=$(make -C ${PORTSDIR}/${origin} -V PKGNAME)
        if test -f ${PKG_DBDIR}/${pkgname}/+PM_DONE; then
                echo "Already done: ${pkgname} (${LOOP}/${TOTAL})"
        else
                echo "===> Building ${pkgname}"
                portmaster -u ${PORTSDIR}/${origin}
                if test $? -eq 0; then
                        mark_done ${pkgname} || safe_abort
                else
                        FAILED=$((${FAILED} + 1))
                        echo "Failed, continue? [n]"
                        read CONT
                        case "${CONT}" in
                                [yY]|[yY][eE]|[yY][eE][sS])
                                echo "===> Marking state as done"
                                mark_done ${pkgname} || safe_abort
                                ;;
                                *) break;;
                        esac
                fi
        fi
done

if test ${FAILED} -eq 0; then
        echo "===> Removing state files"
        for FILE in ${PKG_DBDIR}/*/+PM_DONE; do
                ${SUDO} /bin/rm ${FILE}
        done
        echo "===> Removing origin list"
        /bin/rm ${LISTFILE}
fi




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907232335.54973.mel.flynn%2Bfbsd.current>