Index: branches/locker-dev/locker/deploy/bin/onathena
===================================================================
--- branches/locker-dev/locker/deploy/bin/onathena	(revision 1346)
+++ branches/locker-dev/locker/deploy/bin/onathena	(revision 1420)
@@ -238,10 +238,24 @@
 fi
 
+echo
+echo "Unpacking $sname... (this step might take several minutes)"
+# xavid: use p to keep the same permissions as in the file
+athrun scripts gtar zxpf "/mit/scripts/deploy$scriptsdev/$deploy.tar.gz"
+files=`athrun scripts gfind . -mindepth 1 -maxdepth 1 | grep -v .admin`
+numfiles=`echo "$files" | wc -l`
+if [ ! -z "$files" ]; then
+    if [ "$numfiles" -eq 1 ]; then
+        athrun scripts gfind . -mindepth 2 -maxdepth 2 | xargs -i mv \{} .
+        rmdir "$files"
+    fi
+fi
+if [ -f "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" ]; then
+        nodot=`echo "$lname" | sed "/\./s///"`;
+        sed -e "/SCRIPTS_USER/ s//$lname/" -e "/SCRIPTS_NODOT/ s//$nodot/" "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" > php.ini
+        athrun scripts gfind . -mindepth 1 -type d -exec sh -c 'ln -sf "`echo "$1" | sed '\''s,[^/],,g; s,/,../,g'\''`php.ini" "$1/"' -- {} \;
+fi
 cd "$origdir"
 
-echo
-echo "Unpacking $sname... (this step might take several minutes)"
-
-vsshrun "deploy$scriptsdev/bin/$deploy" "$lname" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration"
+vsshrun "deploy$scriptsdev/bin/$deploy" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration"
 rm -f "$lroot/web_scripts/$addrend/.scripts-tmp"
 checkfailed
