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

[Sc-devel] Fwd: SF.net SVN: supercollider: [6762] trunk/build/SCClassLibrary/Common/Quarks





Begin forwarded message:

From: sc-devel-owner@xxxxxxxxxxxxxxx
Date: 5. Dezember 2007 17:31:14 MEZ
To: tboverma@xxxxxxxxxxxxxxxxxxxxx
Subject: SF.net SVN: supercollider: [6762] trunk/build/ SCClassLibrary/Common/Quarks

You are not allowed to post to this mailing list, and your message has
been automatically rejected.  If you think that your messages are
being rejected in error, contact the mailing list owner at
sc-devel-owner@xxxxxxxxxxxxxxxx
From: tboverma@xxxxxxxxxxxxxxxxxxxxx
Date: 5. Dezember 2007 17:31:12 MEZ
To: sc-dev@xxxxxxxxxxxxxxx
Subject: SF.net SVN: supercollider: [6762] trunk/build/ SCClassLibrary/Common/Quarks


Revision: 6762
          http://svn.sourceforge.net/supercollider/?rev=6762&view=rev
Author:   tboverma
Date:     2007-12-05 08:31:11 -0800 (Wed, 05 Dec 2007)

Log Message:
-----------
fixed dependency recognition for non-global quarks

Modified Paths:
--------------
    trunk/build/SCClassLibrary/Common/Quarks/LocalQuarks.sc
    trunk/build/SCClassLibrary/Common/Quarks/Quark.sc
    trunk/build/SCClassLibrary/Common/Quarks/QuarkSVNRepository.sc
    trunk/build/SCClassLibrary/Common/Quarks/Quarks.sc

Modified: trunk/build/SCClassLibrary/Common/Quarks/LocalQuarks.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Quarks/LocalQuarks.sc 2007-12-04 14:41:44 UTC (rev 6761) +++ trunk/build/SCClassLibrary/Common/Quarks/LocalQuarks.sc 2007-12-05 16:31:11 UTC (rev 6762)
@@ -12,10 +12,11 @@
 LocalQuarks
 {
 	var <path;
+	var <parent; // the Quarks
 	var all; // contains nil, or all local quarks

-	*new { | path |
- ^super.newCopyArgs((path ?? { Platform.userAppSupportDir ++ "/ quarks"}).escapeChar($ ))
+	*new { | path, parent |
+ ^super.newCopyArgs((path ?? { Platform.userAppSupportDir ++ "/ quarks"}).escapeChar($ ), parent)
 	}

 	name {
@@ -26,7 +27,7 @@
 		all.isNil.if{
 			// check through each quark in repos/directory
 			paths = (path ++ "/DIRECTORY/*.quark").pathMatch;
-			quarks = paths.collect({ |p| Quark.fromFile(p) });
+			quarks = paths.collect({ |p| Quark.fromFile(p, parent) });
 	
 			// check paths that do exist locally
all = quarks.select({ |q| (path ++ "/" ++ q.path).pathMatch.notEmpty })

Modified: trunk/build/SCClassLibrary/Common/Quarks/Quark.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Quarks/Quark.sc 2007-12-04 14:41:44 UTC (rev 6761) +++ trunk/build/SCClassLibrary/Common/Quarks/Quark.sc 2007-12-05 16:31:11 UTC (rev 6762)
@@ -21,9 +21,9 @@
 			and: {this.version  == that.version}
 		}
 	}
-	asQuark { |defaultRepos|
-		defaultRepos = defaultRepos ? Quarks.global;
- ^if(repos.isNil, {defaultRepos}, {Quarks.forUrl (repos)}).repos.findQuark(name, version);
+	asQuark { |parentQuarks|
+		parentQuarks = parentQuarks ? Quarks.global;
+ ^if(repos.isNil, {parentQuarks}, {Quarks.forUrl (repos)}).repos.findQuark(name, version);
 	}
 }

@@ -34,27 +34,30 @@

 Quark
 {
-	var <name, <summary, <version, <author, dependencies, <tags,<>path;
+	var <name, <summary, <version, <author, dependencies, <tags, <>path;
+	var <parent; // the Quarks, if available
 	var <info;
 	
-	*fromFile { | path |
+	*fromFile { | path, parent |
 		var string = { File.use(path, "r", _.readAllString) }.try;
 		if (string.isNil) {
 			Error(path + "is an invalid quark file").throw;
 		};
-		^this.fromString(string)
+		^this.fromString(string, parent)
 	}
-	*fromString { | string |
+	*fromString { | string , parent|
 		var blob = { string.interpret }.try;
 		if (blob.isNil or: { blob.isKindOf(IdentityDictionary).not }) {
 			Error("invalid quark").throw;
 		};
-		^this.new(blob)
+		^this.new(blob, parent)
 	}
-	*new { | blob |
-		^super.new.init(blob)
+	*new { | blob, parent |
+		^super.new.init(blob, parent)
 	}
-	init { | blob |
+	init { | blob , argParent |
+		parent = argParent;
+
 		name = this.getName(blob[\name]);
 		path = this.getString(blob[\path]);
 		summary = this.getString(blob[\summary]);
@@ -100,7 +103,7 @@
 						QuarkDependency(
 							spec[0].asString,
 							this.getVersion(spec[1]),
-							spec[2].asString
+							spec[2] !? {spec[2].asString}
 							);
 				} {
 					if (spec.isKindOf(Association)) {
@@ -155,7 +158,7 @@
deps = dependencies.select({|d| knownList.indexOfEqual (d).isNil}); // To avoid infinite recursion traps
 			});
 			deps.do({|dep|
-				quark = dep.asQuark;
+				quark = dep.asQuark(parent);
deps = deps ++ quark.dependencies(recursive: true, knownList: ([QuarkDependency(name, version)] ++ knownList));
 			});
 		});

Modified: trunk/build/SCClassLibrary/Common/Quarks/ QuarkSVNRepository.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Quarks/QuarkSVNRepository.sc 2007-12-04 14:41:44 UTC (rev 6761) +++ trunk/build/SCClassLibrary/Common/Quarks/QuarkSVNRepository.sc 2007-12-05 16:31:11 UTC (rev 6762)
@@ -1,7 +1,7 @@
 /**
   *
   * Subversion based package repository and package manager
-  * a work in progress.  sk & cx & ds
+  * a work in progress.  sk & cx & ds & LFSaw
   *
   */

@@ -67,7 +67,7 @@
 	quarks {
 		var paths;
 		paths = (local.path ++ "/DIRECTORY/*.quark").pathMatch;
-		^paths.collect({ |p| Quark.fromFile(p) });
+		^paths.collect({ |p| Quark.fromFile(p, this.local.parent)});
 	}
 	// search DIRECTORY quark objects to see if quark is in repository
 	findQuark { arg name, version;

Modified: trunk/build/SCClassLibrary/Common/Quarks/Quarks.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Quarks/Quarks.sc 2007-12-04 14:41:44 UTC (rev 6761) +++ trunk/build/SCClassLibrary/Common/Quarks/Quarks.sc 2007-12-05 16:31:11 UTC (rev 6762)
@@ -1,7 +1,7 @@
 /**
   *
   * Subversion based package repository and package manager
-  * a work in progress.  sk, cx, danstowell
+  * a work in progress.  sk, cx, danstowell, LFSaw
   *
   */

@@ -31,7 +31,7 @@
 		^newQ;
 	}
 	initQuarks{|reposPath, localPath|
-		local = LocalQuarks(localPath);
+		local = LocalQuarks(localPath, this);
 		repos = QuarkSVNRepository(reposPath, local);
 	}
 	


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.