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

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



Hi all,

  Thanks for the .svn tip, Felix. That is much better.

.
 shouldn't it just be LocalQuarks who needs to be checked ?


  LocalQuarks may not be SVN when you are using the preloaded quarks.  So the LocalQuarks object does not care.
  Issues only arise when a checkout is performed. Then QuarksSVNRepository has to verify that the local directory
  (found at local.path) is either empty or has a .svn.  If both are false it complains and halts.

  The patch is below.  

   One question: has anyone tested this on win32?  It seems to me that Platform.pathSeparator needs to be used, so
(local.path ++ "/DIRECTORY")

would become

(local.path ++ Platform.pathSeparator ++ "DIRECTORY")

Or is there some other alchemy going on I am unaware of that takes care of this?
James, could you give me the lowdown?  Once that is resolved, I will go ahead and commit.

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:"
};
^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. ".postln.halt;
};
if ( (Quarks.local.path ++ "/*").pathMatch.size != 0 ) {
if (  (Quarks.local.path ++ "/.svn").pathMatch.size == 0 ) {
Post 
<< "\n\tCurrent Quarks are not SVN. Delete the directories \n\t\t " 
<< Quarks.local.path << "\n\tand\n\t\t"
<< Platform.userExtensionDir << "/quarks\n" 
<< "\tand recompile before checking out quarks";
nil.halt;
}
};
dir = (local.path.select{|c| (c != $\\)}) ++ "/DIRECTORY" ;
this.svn("co", (this.url++"/DIRECTORY").escapeChar($ ), (local.path ++ "/DIRECTORY").escapeChar($ ));
^false
}

}