Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Apr 2008 20:02:19 +0200
From:      Mel <fbsd.questions@rachie.is-a-geek.net>
To:        freebsd-questions@freebsd.org
Cc:        Manolis Kiagias <sonicy@otenet.gr>, Edward Ruggeri <smallhand@crawblog.com>, Pollywog <lists-fbsd@shadypond.com>
Subject:   Re: overnight upgrade interrupted by questions
Message-ID:  <200804152002.20097.fbsd.questions@rachie.is-a-geek.net>
In-Reply-To: <919383240804150626xe343795l84d99cfaad68435@mail.gmail.com>
References:  <200804151245.03033.lists-fbsd@shadypond.com> <4804A46B.20307@otenet.gr> <919383240804150626xe343795l84d99cfaad68435@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 15 April 2008 15:26:42 Edward Ruggeri wrote:
> A lot of people would reply that they'd like to configure the ports
> themselves before launching the installation, leading people to
> suggest scripts such as:
>
> #!/bin/sh
> plist=`pkg_version -ovl'<' |awk '{ print $1 }'`
> for porg in $plist ; do
>     cd  /usr/ports/${porg} && make config-recursive
> done

Sorry to disappoint you, but that wont work for two reasons:
1) make config-recursive is flawed by design, because it makes a dependency 
list based on current settings and if you alter dependencies during your 
recursive configuring, it will not update the list.

2) If you hit an interactive configure (not config, configure) target, then 
you will still end up with a dialog. Prime example: print/ghostscript-gpl.

If you wanted to script the first case, you'd do the following in every origin 
that needs updating:
#!/bin/sh

VISITED=

config_port() {
        local ldeps rdeps bdeps
        ldeps=`make -V LIB_DEPENDS`
        rdeps=`make -V RUN_DEPENDS`
        bdeps=`make -V BUILD_DEPENDS`

        make config-conditional
        for dep in ${ldeps} ${rdeps} ${bdeps}; do
                dir=${dep##*:}
                case ${VISITED} in
                        *" ${dir}"*)
                        ;;
                        *)
                        echo "---> $dir"
                        VISITED="${VISITED} ${dir}"
                        cd ${dir}
                        config_port
                esac
        done
}

config_port

-- 
Mel

Problem with today's modular software: they start with the modules
    and never get to the software part.



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