On 08/17/2015 09:37 AM, Lukas Slebodnik wrote:
On (13/08/15 15:48), Nikolai Kondrashov wrote:
> On 08/13/2015 02:57 PM, Lukas Slebodnik wrote:
>> On (13/08/15 14:47), Nikolai Kondrashov wrote:
>>> +if GIT_CHECKOUT
>>> +export GIT_DIR=$(abs_top_srcdir)/.git
>>> +export GIT_WORK_TREE=$(abs_top_srcdir)
>>> +endif
>> It's not good idea to export such in general code.
>> you might greak something. I didn't try but you might break
>> something in fedpkg + local build.
>>
>> Better solution would to to export make variable abs_top_srcdir
>> as ABS_TOP_SRCDIR in TESTS_ENVIRONMENT
>>
>> and print warnig/error from test if this variable is not defined.
>
> Yeah, it's not nice. I doubt that it will break anything as it is very
> specific as to where the git repo is, but I wouldn't vouch for it.
>
But on the other hand ABS_TOP_SRCDIR is more abstract
and there is higher probability it will be used in other tests.
> We'll need to pass it both to the TESTS_ENVIRONMENT and to *srpm targets as
> well, which will make it uglier, but I'll do it.
>
You can still export GIT_DIR and GIT_WORK_TREE inside script if
ABS_TOP_SRCDIR is defined. Otherwise test can be skipped
https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-...
Alright here's another version.
I didn't change it much. Simply moved export of GIT_DIR and GIT_WORK_TREE
lower, to TESTS_ENVIRONMENT and *rpm* targets. I didn't add exporting of
ABS_TOP_SRCDIR, because that way the whitespace test would always require it,
making manual execution inconvenient, or would need additional logic with
assumptions there. This way we avoid having another variable and a way to pass
build parameters around.
BTW, Lukas, could you please describe what kind of problems you expect in
"fedpkg + local build"? Perhaps it's not a problem after all?
Nick