~nairboon/anarchnet/parannus

« back to all changes in this revision

Viewing changes to setup.js

  • Committer: nairboon
  • Date: 2012-04-01 16:15:18 UTC
  • Revision ID: git-v1:ccc09284d33f0476aa8bd4e17be9b2ae79e83f12
cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
        ppm = require('./lib/ppm.js'),
10
10
        setup = require("./lib/setup.js");
11
11
 
12
 
 
13
 
 
14
 
console.log(util.system_id);
15
 
 
16
12
var an = require("./lib/an.js");
17
13
 
18
 
/*db.store_ht("lamekey","mycontnet",function(err,data){
19
 
  console.log("calling get for:",data);
20
 
  db.get_ht("lamekey", function(err,data) {
21
 
    console.log("got:",data);
22
 
  });
23
 
});
24
 
*
25
 
db.store_with_id("lamekey",{a:"mycontnet"},function(err,data){
26
 
  console.log("calling get for:",data.id);
27
 
  db.get(data.id, function(err,data) {
28
 
    console.log("got:",data);
29
 
  });
30
 
});
31
 
*/
32
 
/*
33
 
var x = new db.obj("","hahah");
34
 
var obj = db.odb.create("abcdefg");
35
 
obj.save(function(err,res) {
36
 
        console.log("res: ",res);
37
 
});
38
 
console.log(x);
39
 
x.save(function(e,r){
40
 
console.log("x:",x,"!=0");
41
 
        var y = new db.obj();
42
 
        console.log("new x " ,r.id);
43
 
        y.load(r.id);
44
 
        console.log(r.obj,y.obj);
45
 
        r.obj = "lalalalal";
46
 
        r.save(function(e,p) {
47
 
                console.log(p);
48
 
        });
49
 
}
50
 
);
51
 
*/
52
 
 
53
14
console.log("scan packages...");
54
15
setup.ScanLocalPackages(function(err,mlid){
55
16
        console.log("packages scaned");
56
 
                console.log("storing master list...",mlid);
57
 
                /*db.store_ht(util.system_id+"masterlist",mlid, function(err){
58
 
                        if(err)
59
 
                                throw new Error("could not save masterlist");
60
 
*/
 
17
                //console.log("storing master list...",mlid);
61
18
                        setup.createDefaultRepo(mlid,function(err,res){
62
19
                                if(err)
63
20
                                        throw err;
69
26
                                */ppm.cacheApp("user",res,function(err,appres){
70
27
                                        if(err || !appres)
71
28
                                                return  next( new Error('Could not cache that app: '+err.message));
72
 
 
73
 
                                        console.log("sending",appres);
74
 
                                        //db.close();
75
 
                                        var abpath = process.cwd() + "/repo/user/img/bg.jpg";
76
 
db.put_file(abpath,function(err,res) {
77
 
        console.log("file:" , res);
78
 
        db.get_file(res.id,function(err,res) {
79
 
        console.log("file2:" , res);
80
 
        });
81
 
});
82
 
                                });/*
83
 
                                });*/
84
 
                                //db.close();
 
29
                                        db.close();
 
30
                                });
 
31
                        
85
32
                        });
86
 
                //});
87
33
});
88
34
 
89
35