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

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



hmm, rereading your email.  It probably is better to go ahead and make the test of the local directory a method of LocalQuarks.
I will do it that way once I know what to do about pathnames.....

RJK

On Feb 23, 2008, at 2:45 PM, felix wrote:

Thanks for doing this Ron. I'm pretty busy with other things right now (flying to NYC in the morning too).

I just checked in a much improved quarks helpfile.

I was thinking there could be a general function of PathName or something that checks if a dir is .svn (has an .svn folder in it).  

anyway when LocalQuarks is created it should check if it is .svn or not.
subsequent svn actions check that always and deny/warn.
I think that's what you are doing Ron, but you don't have LocalQuarks in the patch you are showing.  shouldn't it just be LocalQuarks who needs to be checked ?

then QuarkSVNRepository-svn :
  if(local.isSVN.not,{
     Error("The local quarks library was not acquired through SVN and cannot be updated.").throw;
})
..etc.



and if they are changing to an svn version ...
I think we should advise them to manually remove the old quarks directory.

Yes, don't have a method call .clear
that could piss off somebody bad.
it sounds inviting and like it will solve problems, and then it deletes all your shit :0




On Sat, Feb 23, 2008 at 7:26 PM, ronald kuivila <rkuivila@xxxxxxxxxxxx> wrote:
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:"
};
^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
}

}

_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel




--
chris sattinger
skype: crucialfelix
aim: crucialfelix

_______________________________________________
Sc-devel mailing list