Index: branches/locker-dev/locker/deploy/bin/mediawiki
===================================================================
--- branches/locker-dev/locker/deploy/bin/mediawiki	(revision 1223)
+++ branches/locker-dev/locker/deploy/bin/mediawiki	(revision 1224)
@@ -6,7 +6,4 @@
 
 setup();
-
-`cp skins/common/images/mediawiki.png skins/common/images/wiki.png`;
-`patch -s -p1 < /mit/scripts/deploy/mediawiki.patch`;
 
 print "\nPlease decide upon a title for your wiki and enter it below.\n";
Index: branches/locker-dev/locker/deploy/bin/onathena
===================================================================
--- branches/locker-dev/locker/deploy/bin/onathena	(revision 1223)
+++ branches/locker-dev/locker/deploy/bin/onathena	(revision 1224)
@@ -235,22 +235,7 @@
 fi
 
-# 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"
 
-vsshrun "deploy$scriptsdev/bin/$deploy" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration"
+vsshrun "deploy$scriptsdev/bin/$deploy" "$lname" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration"
 rm -f "$lroot/web_scripts/$addrend/.scripts-tmp"
 checkfailed
Index: branches/locker-dev/locker/deploy/bin/onserver.pm
===================================================================
--- branches/locker-dev/locker/deploy/bin/onserver.pm	(revision 1223)
+++ branches/locker-dev/locker/deploy/bin/onserver.pm	(revision 1224)
@@ -5,8 +5,10 @@
 use File::Spec::Functions;
 use File::Basename;
+use File::Copy;
 use Socket;
 use Cwd qw(abs_path);
 use POSIX qw(strftime);
 use LWP::UserAgent;
+use IPC::Open2;
 use URI;
 our @ISA = qw(Exporter);
@@ -15,5 +17,5 @@
 our $server = "scripts.mit.edu";
 
-our ($tmp, $USER, $HOME, $sname, $deploy, $addrend, $base_uri, $ua, $admin_username, $requires_sql, $addrlast, $sqlhost, $sqluser, $sqlpass, $sqldb, $admin_password, $scriptsdev, $human, $email);
+our ($tmp, $USER, $HOME, $lname, $sname, $deploy, $addrend, $base_uri, $ua, $admin_username, $requires_sql, $addrlast, $sqlhost, $sqluser, $sqlpass, $sqldb, $admin_password, $scriptsdev, $human, $email);
 
 $tmp = ".scripts-tmp";
@@ -78,5 +80,5 @@
   $HOME = $ENV{HOME};
   
-  ($sname, $deploy, $addrend, $admin_username, $requires_sql, $scriptsdev, $human) = @ARGV;
+  ($lname, $sname, $deploy, $addrend, $admin_username, $requires_sql, $scriptsdev, $human) = @ARGV;
   chdir "$HOME/web_scripts/$addrend";
   $email = "$human\@mit.edu";
@@ -122,4 +124,53 @@
   } 
 
+  # This code was originally in onathena
+  my $repo = "/mit/scripts/wizard$scriptsdev/srv/$deploy.git";
+  if(-e $repo) {
+    # Much of this can be replaced with
+    # system("git", "clone", "--shared", $repo, ".");
+    # but only once we complete the FC11 transition and are running
+    # a version of Git more recent than 1.6.1 on all servers.
+    `git init`;
+    open HTACCESS, '>', '.git/.htaccess' or die $!;
+    print HTACCESS "Deny from all";
+    close HTACCESS;
+    open ALTERNATES, '>', '.git/objects/info/alternates' or die $!;
+    print ALTERNATES "$repo/objects";
+    close ALTERNATES;
+    system("git", "remote", "add", "origin", $repo);
+    `git config branch.master.remote origin`;
+    `git config branch.master.merge refs/heads/master`;
+    `git fetch origin`;
+    `git branch --track master origin/master`;
+    system("git checkout master"); # to get output
+  } else {
+    system("tar", "zxpf", "/mit/scripts/deploy$scriptsdev/$deploy.tar.gz");
+    my @files = glob("* .*"); # You /don't/ want to match dotfiles
+    if (@files == 3) {
+      chdir $files[0] or die $!;
+      for (glob("{,.??}*")) {
+        move($_, catfile("..", $_)) || die $!;
+      }
+      chdir ".."
+    }
+    rmdir $files[0];
+  }
+  if(-f "/mit/scripts/deploy$scriptsdev/php.ini/$deploy") {
+    # Copy in PHP file,  perform substitutions, and make symlinks
+    # to php.ini in all subdirectories
+    my $nodot = $lname; $nodot =~ s/\.//;
+    open(PHPIN, "/mit/scripts/deploy$scriptsdev/php.ini/$deploy") || die $!;
+    open(PHPOUT, ">", "php.ini") || die $!;
+    while(<PHPIN>) {
+      s/SCRIPTS_USER/$lname/;
+      s/SCRIPTS_NODOT/$nodot/;
+      print PHPOUT $_ or die $!;
+    }
+    close(PHPOUT) || die $!;
+    close(PHPIN) || die $!;
+    # athrun doesn't exist on scripts.  But find exists!  Use alternate script
+    system("/mit/scripts/bin/fix-php-ini-scripts");
+  }
+
   print "\nConfiguring $sname...\n";
   if($requires_sql) {
@@ -127,12 +178,25 @@
   }
   
-  open(VERSION, ">.scripts-version") or die "Can't write scripts-version file: $!\n";
-  print VERSION strftime("%F %T %z\n", localtime);
-  print VERSION $ENV{'USER'}, '@', getclienthostname(), "\n";
-  my $tarball = abs_path("/mit/scripts/deploy$scriptsdev/$deploy.tar.gz");
-  print VERSION $tarball, "\n";
-  $tarball =~ s|/deploydev/|/deploy/|;
-  print VERSION dirname($tarball), "\n";
-  close(VERSION);
+  if(-e "/mit/scripts/wizard$scriptsdev/srv/$deploy.git") {
+    # fake an empty commit to get version info
+    my $pid = open2(\*GIT_OUT, \*GIT_IN, "git commit-tree HEAD: -p HEAD") or die "Can't execute git process";
+    print GIT_IN "User autoinstalled application\n";
+    print GIT_IN "Installed-by: ", $ENV{'USER'}, '@', getclienthostname(), "\n";
+    close(GIT_IN);
+    my $hash=<GIT_OUT>;
+    chomp($hash);
+    close(GIT_OUT);
+    waitpid $pid, 0; # reap zombies
+    system("git reset $hash");
+  } else {
+    open(VERSION, ">.scripts-version") or die "Can't write scripts-version file: $!\n";
+    print VERSION strftime("%F %T %z\n", localtime);
+    print VERSION $ENV{'USER'}, '@', getclienthostname(), "\n";
+    my $tarball = abs_path("/mit/scripts/deploy$scriptsdev/$deploy.tar.gz");
+    print VERSION $tarball, "\n";
+    $tarball =~ s|/deploydev/|/deploy/|;
+    print VERSION dirname($tarball), "\n";
+    close(VERSION);
+  }
 
   select STDOUT;
