#!/usr/bin/perl
use strict;
use FindBin;
use lib $Bin;
use onserver;

setup();
my $lname = "/mit/$USER/Scripts/svn";

print "\nEnter the name of your project (the title of this Subversion instance).\n";
print "Project name: ";
my $name=<STDIN>;
chomp($name);

sub sshrun {
    system("athrun","scripts","scripts-ssh","$lname",@_);
}

if(!chdir($lname)) {
    print "Creating directories ..\n";
    system("mkdir","-p","$lname");
}

print "Setting permissions ..\n";
# sshrun("fs","sa","$lname","daemon.scripts","write");
system("fs","sa","$lname","daemon.scripts","write");
print "Creating repository ..\n";
system("svnadmin","create","--fs-type","fsfs","$lname/$name");

print "\nInstallation complete.\n";
