Name resolution scope with 'apply from'

I am not clear on the resolution of repositories within an ‘apply from’. (Assuming Gradle 2.0)

Say I have the following project layout

+ build.gradle
+ gradle \
          + foo.gradle
+ project1 \
            + build.gradle

My ‘project1/build.gradle’ contains

apply from: '../gradle/foo.gradle'

and finally ‘foo.gradle’ contains

apply plugin: 'a.b.c'

It seems that ‘a.b.c’ is not found irrespective whether I place the ‘buildscript’ section in ‘gradle/foo.gradle’ or ‘build.gradle’

buildscript {
    repositories {
      dependencies {
        classpath 'foo:bar:1.-'

However, if I place the same ‘buildscript’ section in ‘project1/build.gradle’ just before the ‘apply from’ (OR equivalently in ‘buld.gradle’ in ‘subprojects’) then it all works.

For certain (more expanded) cases, I have also found that ‘buildscript’ needs to be both in ‘gradle/foo.gradle’ and in ‘project1/build.gradle’

I have always considered ‘apply from’ to be no more than the equivalent of an ‘include’ statement found in some programming languages. Obviously I’m wrong, so I would be grateful if someone can explain the name & dependency resolution that applies when ‘apply from’ is used.

The ‘buildscript’ block is very special, and where to put it depends (I think) on the Gradle version. It shouldn’t be necessary to have a ‘buildscript’ block both in the applying and applied script.