[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] How to make svnless Quarks work...



Hi all,

Here are patches as tested on a machine w/o svn.  They seem to work fine. (Please test)

But then I tried installing svn and deleting some files from the quarks directory.  svn did not update to the repository version.

So, I added a clear method to just empty out the quarks directory and links inside extensions.  That is a bit drastic but it does the job.

Any better ideas on how to deal with this ?  (Felix?)

Otherwise, we could add a note to the help file instructing people to clear before using svn for the first time.



RJK



+QuarkSVNRepository {
*new { | url, local |
// Step 1: complain that svn is not there
if(svnpath.isNil) {
Post 
<< "\tSVN not found! Quarks placed in the directory"
<< "\n\n\t\t" << Platform.userAppSupportDir << "/quarks"
<< "\n\n\t" << "will be available, but you need svn to checkout updated versions."
<< "\n\n\t" << "svn can be downloaded from:"
<< "\n\n\t\t" << "http://subversion.tigris.org/project_packages.html\n"
};
^this.newCopyArgs(url ? "https://quarks.svn.sourceforge.net/svnroot/quarks", local ?? {Quarks.local})
}

svn { | cmd ... args |
// Step 2: throw a hissy fit if user tries to update or checkout
if (svnpath.isNil) { 
Error("SVN is not installed! Quarks cannot be updated.").throw;
};
cmd = ("export LANG='' ; " + svnpath.escapeChar($ ) + cmd + args.join(" ") + "2>&1");
"".debug;
cmd.debug;
"".debug;
Platform.case(
// On OSX we run it in a terminal window to minimise the risk of people getting stuck without a certificate
\osx, {
("echo " ++ $" ++ "
--------------------------------------------------------------

  SuperCollider Quarks: accessing remote repository.

  If this is the first time, you may be asked to accept a
  security certificate. Please do so!

  The command being run is:
" ++ cmd.escapeChar($") ++ "

--------------------------------------------------------------
" ++ $" ++ cmd).runInTerminal
},
// Non-OSX platforms run it internally
{cmd.unixCmd}
);
}


checkoutDirectory {
// Step 3: you cannot checkout until svn is installed


var dir;
if (svnpath.isNil) {
"\n\tSince SVN not installed, you cannot checkout Quarks. Once installed, use cleanCheckoutDirectory".postln.halt;
};
dir = (local.path.select{|c| (c != $\\)}) ++ "/DIRECTORY" ;
this.svn("co", (this.url++"/DIRECTORY").escapeChar($ ), (local.path ++ "/DIRECTORY").escapeChar($ ));
^false
}

}

+Quarks {
// Seems like you have to reload from the repository once you get svn...

*clear { 
"Removing all quarks and links to quarks in the user extensions directory".postln;
("\\rm -rf " ++ "\"" ++ Quarks.local.path ++ "\"").unixCmd;
("\\rm -rf " ++ "\"" ++ Platform.userExtensionDir.escapeChar($ ) ++ "/" ++ Quarks.local.name ++ "\"").unixCmd
}


}