[pacman-dev] Status of "Splitting packages with makepkg"
Aaron Griffin
aaronmgriffin at gmail.com
Thu Nov 13 12:25:33 EST 2008
On Thu, Nov 13, 2008 at 11:18 AM, Allan McRae <allan at archlinux.org> wrote:
> Allan McRae wrote:
>>
>> Marc - A. Dahlhaus [ Administration | Westermann GmbH ] wrote:
>>>
>>> Hello Allen,
>>>
>>> the prototype has a little problem in case you give -L option to makepkg
>>> as it is now:
>>>
>>> As makepkg pipes the output of the build-function into tee, the
>>> build-function gets executed in a sub-shell. Any changes of variables in
>>> context of main-shell from inside build-function will not work in that
>>> case. This leads to that we have to set the values of all
>>> split-package-variables outside of the respective build-functions.
>>>
>>>
>>
>> As I said, the implementation is still a bit away... The KDEmod guys
>> override the PKGBUILD variables the same way. I will look into what they
>> for logging.
>
> Testing with this script indicates to me that everything is fine...
>
> test.sh:
> #! /bin/bash
>
> output="FOO"
>
> build() {
> output="BAR"
> echo $output
> }
>
> echo $output
> build 2>&1
> build 2>&1 | tee buildlog
>
>
>>./test.sh
> FOO
> BAR
> BAR
>
>> cat buildlog
> BAR
>
>
> So what exactly are you say is wrong?
I think the case he means is this:
test.sh:
#! /bin/bash
output="FOO"
build() {
output="BAR"
echo $output
}
echo $output
build 2>&1 | tee buildlog
echo $output
# end
./test.sh
FOO
BAR
FOO
Which, after thinking a little about it, is the way we want this to happen, yes?
More information about the pacman-dev
mailing list