overnight upgrade interrupted by questions
    RW 
    fbsd06 at mlists.homeunix.com
       
    Fri Apr 18 17:59:41 UTC 2008
    
    
  
On Tue, 15 Apr 2008 20:02:19 +0200
Mel <fbsd.questions at rachie.is-a-geek.net> wrote:
> If you wanted to script the first case, you'd do the following in
> every origin that needs updating:
I have a similar script, that works globally, recursing down from each
out-of-date port through any missing origins. 
If you call it with "-a" it runs over all installed ports - useful if
you want to clear everything and start again.
# cat /root/bin/portsconf
#!/bin/sh
IFS="
"
: ${PORTSDIR:=/usr/ports}
if [ "${1}x" = "-ax"  ] ; then
    pvflags='-oq'
else
    pvflags="-oql\<\>"
fi
visited_origins=
recurse_origins(){
    cd "${PORTSDIR}/${1}"
    # need to configure before recursing in case dependencies change
    make config-conditional
    for d in `make build-depends-list run-depends-list |  grep -Eo "[^/]+/[^/]+$"` ;do
        installed=`pkg_info -qO ${d}`
        if [ -z "$installed" ] ;then
            if ! echo "$visited_origins" | grep "$d" >/dev/null ; then
                visited_origins="$visited_origins $d"
                recurse_origins $d
            fi
        fi
    done
}
for orig in `pkg_version ${pvflags} ` ; do
    recurse_origins $orig
done
    
    
More information about the freebsd-questions
mailing list