git makefile, trouble fetching sizzle - use submodules?

git makefile, trouble fetching sizzle - use submodules?

I was trying to build jquery from git, under Ubuntu 9.10. I had
checked out git://github.com/jquery/jquery.git, but there were a
couple of problems:
(1) 'make init' was failing to fetch 'sizzle'
(2) The fetching was done as a background job, after make had returned
to the shell!
brian@ubuntu:~/git/jquery$ make init
Grabbing external dependencies...
brian@ubuntu:~/git/jquery$ From git://github.com/jquery/qunit
* branch master -> FETCH_HEAD
Already up-to-date.
From git://github.com/jquery/jquery
* branch master -> FETCH_HEAD
Already up-to-date.
brian@ubuntu:~/git/jquery$ make jquery
Grabbing external dependencies...
Building selector code from Sizzle
sed: can't read src/sizzle/sizzle.js: No such file or directory
make: *** [selector] Error 2
brian@ubuntu:~/git/jquery$ From git://github.com/jquery/qunit
* branch master -> FETCH_HEAD
Already up-to-date.
From git://github.com/jquery/jquery
* branch master -> FETCH_HEAD
Already up-to-date.
Looking through the Makefile, I found out the reasons for this:
firstly there was an existing, empty src/sizzle directory which was
preventing the fetch from taking place. And secondly, there were
spurious '&' which were causing the fetches to be done in the
background.
The following patch fixed both of these for me:
diff --git a/Makefile b/Makefile
index a0dbd8b..4b25239 100644
--- a/Makefile
+++ b/Makefile
@@ -41,10 +41,12 @@ ${DIST_DIR}:
init:
    @@echo "Grabbing external dependencies..."
+    @@rmdir test/qunit 2> /dev/null || true
+    @@rmdir src/sizzle 2> /dev/null || true
    @@if test ! -d test/qunit; then git clone git://github.com/jquery/qunit.git
test/qunit; fi
    @@if test ! -d src/sizzle; then git clone git://github.com/jeresig/sizzle.git
src/sizzle; fi
-    @@cd src/sizzle && git pull origin master &> /dev/null
-    @@cd test/qunit && git pull origin master &> /dev/null
+    @@cd src/sizzle && git pull origin master 2> /dev/null
+    @@cd test/qunit && git pull origin master 2> /dev/null
jquery: ${DIST_DIR} selector ${JQ}
However I suggest it would be much better to use git submodules for
qunit and sizzle, because then 'git submodule update' will do all the
magic for you, and would be able to update existing checkouts too.
Regards,
Brian.
--