Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Apr 2008 18:39:55 +0100
From:      RW <fbsd06@mlists.homeunix.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: overnight upgrade interrupted by questions
Message-ID:  <20080418183955.2a6ac178@gumby.homeunix.com.>
In-Reply-To: <200804152002.20097.fbsd.questions@rachie.is-a-geek.net>
References:  <200804151245.03033.lists-fbsd@shadypond.com> <4804A46B.20307@otenet.gr> <919383240804150626xe343795l84d99cfaad68435@mail.gmail.com> <200804152002.20097.fbsd.questions@rachie.is-a-geek.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 15 Apr 2008 20:02:19 +0200
Mel <fbsd.questions@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



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