Re: HEADS-UP: Shared Library Versions bumped...

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mel Flynn
Date: Friday, July 24, 2009 - 12:35 am

On Thursday 23 July 2009 22:55:07 Daniel O'Connor wrote:

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.


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

_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
HEADS-UP: Shared Library Versions bumped..., Ken Smith, (Sun Jul 19, 11:16 am)
Re: HEADS-UP: Shared Library Versions bumped..., Thomas Backman, (Sun Jul 19, 11:26 am)
Re: HEADS-UP: Shared Library Versions bumped..., Ken Smith, (Sun Jul 19, 11:33 am)
Re: HEADS-UP: Shared Library Versions bumped..., Byung-Hee HWANG, (Sun Jul 19, 4:46 pm)
Re: HEADS-UP: Shared Library Versions bumped..., Ivan Voras, (Mon Jul 20, 2:18 am)
Re: HEADS-UP: Shared Library Versions bumped..., Olivier SMEDTS, (Mon Jul 20, 7:29 am)
Re: HEADS-UP: Shared Library Versions bumped..., Kostik Belousov, (Mon Jul 20, 7:34 am)
Re: HEADS-UP: Shared Library Versions bumped... , Kevin Oberman, (Mon Jul 20, 11:13 am)
Re: HEADS-UP: Shared Library Versions bumped..., Chris Dillon, (Mon Jul 20, 12:11 pm)
Re: HEADS-UP: Shared Library Versions bumped..., O. Hartmann, (Tue Jul 21, 1:45 pm)
Re: HEADS-UP: Shared Library Versions bumped..., Steve Kargl, (Tue Jul 21, 2:52 pm)
Re: HEADS-UP: Shared Library Versions bumped..., John Baldwin, (Wed Jul 22, 5:14 am)
Re: HEADS-UP: Shared Library Versions bumped..., Vladimir Grebenschikov, (Wed Jul 22, 8:43 am)
Re: HEADS-UP: Shared Library Versions bumped..., David Schultz, (Wed Jul 22, 12:30 pm)
Re: HEADS-UP: Shared Library Versions bumped..., Alexandre "Sunny" Ko ..., (Wed Jul 22, 12:52 pm)
Re: HEADS-UP: Shared Library Versions bumped..., Andrew Reilly, (Wed Jul 22, 5:26 pm)
Re: HEADS-UP: Shared Library Versions bumped..., Daniel O'Connor, (Thu Jul 23, 11:55 pm)
Re: HEADS-UP: Shared Library Versions bumped..., Mel Flynn, (Fri Jul 24, 12:35 am)
Re: HEADS-UP: Shared Library Versions bumped..., Doug Barton, (Wed Jul 29, 12:10 am)
Re: HEADS-UP: Shared Library Versions bumped..., Mel Flynn, (Wed Jul 29, 12:42 am)
Re: HEADS-UP: Shared Library Versions bumped..., Doug Barton, (Wed Jul 29, 9:13 am)
Re: HEADS-UP: Shared Library Versions bumped..., Alson van der Meulen, (Wed Jul 29, 10:06 am)
Re: portmaster -R (Was: Re: HEADS-UP: Shared Library Versi ..., Alson van der Meulen, (Wed Jul 29, 1:35 pm)
HEAD newfs/sysinstall issues , Barrett Lyon, (Wed Jul 29, 3:26 pm)
Re: HEAD newfs/sysinstall issues, Kamigishi Rei, (Wed Jul 29, 4:43 pm)
Re: HEAD newfs/sysinstall issues, Gary Jennejohn, (Thu Jul 30, 1:41 am)
Re: HEAD newfs/sysinstall issues, Randi Harper, (Thu Jul 30, 11:23 am)