3 * Subversion based package repository and package manager
4 * a work in progress. sk, cx, lfsaw
8 // Local Quarks are those that have been checked out from the repository.
9 // and are stored in build/quarks prior to being actually installed
13 classvar >globalPath; // where the "Quarks.global" checkout is stored
16 var <parent; // the Quarks
17 var all; // contains nil, or all local quarks
19 *new { | path, parent |
20 ^super.newCopyArgs((path ?? {this.globalPath}), parent)
24 ^ globalPath ?? { globalPath = Platform.userAppSupportDir ++ "/quarks"}
28 ^PathName(path).fileName;
33 // check through each quark in repos/directory
34 paths = (path ++ "/DIRECTORY/*.quark").pathMatch;
35 quarks = Array(paths.size);
38 { var q = Quark.fromFile(p, parent); quarks add: q }
39 { |e| e.errorString.postln }
41 // check paths that do exist locally
42 all = quarks.select({ |q| (path ++ "/" ++ q.path).pathMatch.notEmpty })
46 findQuark { arg name, version;
48 matches = this.quarks.select({ |q| q.name == name });
50 matches = matches.select({ |q| q.version >= version });
52 ^matches.sort({ |a,b| a.version > b.version }).first
54 findPath { arg name, version;
56 if((q = this.findQuark(name, version)).isNil,{
57 Error("Local Quark % not Found.".format(name.quote)).throw;
59 ^path ++ "/" ++ q.path;
61 openFolder { arg name, version;
65 openOS(this.findPath(name, version))
69 /// reread local quarks directory
75 // stupid path has to be escaped above???
76 // well sometimes you need the raw path...
79 path.findAll("\\").reverseDo({ |i|