diff --git a/autoconf_share/rub b/autoconf_share/rub
index 7ffd05f705c23383f5a1c496050b8506fb5a7aae..b6b65008c31d8ec71e6635986d768216b4ea7a0a 100755
--- a/autoconf_share/rub
+++ b/autoconf_share/rub
@@ -675,7 +675,7 @@ if [ $boot = 1 ]; then
     echo "" >> build.log
     echo "  bootstrapping package $pkg ..."
 
-    cd $curwd/$pkg >> $curwd/build.log 2>&1
+    pushd $curwd/$pkg >> $curwd/build.log 2>&1
     rm -rf autom4te.cache >> $curwd/build.log 2>&1
     
     # Try to set execution permissions, ignore failure.
@@ -688,6 +688,8 @@ if [ $boot = 1 ]; then
       exit 1
     fi
 
+    popd >> $curwd/build.log 2>&1
+
     echo $pkg '# bootstrapped at' `date` >> $curwd/build.result; >> $curwd/build.log 2>&1
   done
   echo "" >> build.log