--- toast-linux	2004/04/14 00:57:08	1.17
+++ toast-linux	2004/04/14 01:22:35	1.18
@@ -1340,11 +1340,6 @@
 
 --- FILE root/sbin/toast ---
 #!/bin/sh
-
-# XXX use local squid proxy to reduce bandwidth consumption for testing:
-export http_proxy=http://cli-03:3128/
-export ftp_proxy=http://cli-03:3128/
-
 [ -z "$TOAST_ARMDIR" ] && export TOAST_ARMDIR=/usr
 [ -x /mnt/root/bin/busybox ] && export TOAST_PRELOAD=false
 exec chroot /mnt/root /bin/toast "$@"
@@ -1429,7 +1424,7 @@
 
 build=1
 builddir="$verdir/$build"
-relbuilddir="$relstoredir/$name/v$version/$build"
+relbuilddir="$relstoredir/pkg/$name/v$version/$build"
 srcdir="$builddir/src"
 relsrcdir="$relbuilddir/src"
 rootdir="$builddir/root"
@@ -1497,7 +1492,7 @@
     makedir="$srcdir"
     relmakedir="$relsrcdir"
     subdir=`cd $makedir && echo *`
-    if [ -d "$subdir" ]; then
+    if [ -d "$makedir/$subdir" ]; then
       makedir="$makedir/$subdir"
       relmakedir="$relmakedir/$subdir"
     fi
@@ -1505,8 +1500,8 @@
     unconfigured=true
     for confprog in configure.gnu configure; do
       if $unconfigured && [ -x "$makedir/$confprog" ]; then
-        announce chroot "$chrootdir" sh -c "cd $makedir && ./$confprog --prefix=$relarmdir"
-        chroot "$chrootdir" sh -c "cd $makedir && ./$confprog --prefix=$relarmdir" || error
+        announce chroot "$chrootdir" sh -c "cd $relmakedir && ./$confprog --prefix=$relarmdir"
+        chroot "$chrootdir" sh -c "cd $relmakedir && ./$confprog --prefix=$relarmdir" || error
         unconfigured=false
       fi
     done
@@ -1523,13 +1518,13 @@
       # bootstrap GNU make itself; work around apparent make 3.80 build.sh bug
       announce "sed -e 's/\@REMOTE\@/stub/' < $makedir/build.sh > $makedir/build.sh.patched"
       sed -e 's/\@REMOTE\@/stub/' < "$makedir/build.sh" > "$makedir/build.sh.patched" || error
-      announce chroot "$chrootdir" sh -c "cd $makedir && sh build.sh.patched"
-      chroot "$chrootdir" sh -c "cd $makedir && sh build.sh.patched" || error
-      announce PATH="$PATH:$relmakedir" chroot "$chrootdir" make -C "$makedir" install DESTDIR="$relrootdir"
-      PATH="$PATH:$relmakedir" chroot "$chrootdir" make -C "$makedir" install DESTDIR="$relrootdir" || error
+      announce chroot "$chrootdir" sh -c "cd $relmakedir && sh build.sh.patched"
+      chroot "$chrootdir" sh -c "cd $relmakedir && sh build.sh.patched" || error
+      announce PATH="$PATH:$relmakedir" chroot "$chrootdir" make -C "$relmakedir" install DESTDIR="$relrootdir"
+      PATH="$PATH:$relmakedir" chroot "$chrootdir" make -C "$relmakedir" install DESTDIR="$relrootdir" || error
     else
-      announce chroot "$chrootdir" make -C "$makedir" all install DESTDIR="$relrootdir"
-      chroot "$chrootdir" make -C "$makedir" all install DESTDIR="$relrootdir" || error
+      announce chroot "$chrootdir" make -C "$relmakedir" all install DESTDIR="$relrootdir"
+      chroot "$chrootdir" make -C "$relmakedir" all install DESTDIR="$relrootdir" || error
     fi
 
     # fix rootdir
@@ -1580,6 +1575,10 @@
 
 --- FILE root/sbin/toaststrap ---
 #!/bin/sh -e
+
+# XXX use local squid proxy to reduce bandwidth consumption for testing:
+export http_proxy=http://cli-03:3128/
+export ftp_proxy=http://cli-03:3128/
 
 # Step 1: Download the minimum required binary packages.
 # These are all stolen from Debian testing.