try fix
[gitlive] / gen.php
1 <?php
2
3 $ar = explode("\n", 
4 "app.Builder.js
5 app.MailArchiver
6 app.Mailer
7 app.MailfortTools
8 etc.FlexySpam
9 etc.Texon
10 gitlive
11 netsuite.bloomgrow
12 pear
13 Pman.Admin
14 Pman.Base
15 Pman.Builder
16 Pman.Cash
17 Pman.Cms
18 Pman.Core
19 Pman.Dav
20 Pman.Documents
21 Pman.Fax
22 Pman.Ftp
23 Pman.Git
24 Pman.Mail
25 Pman.MTrack
26 Pman.Signup
27 Pman.Timesheet
28 roojs1
29 txt.MailfortNotes
30 web.annerley
31 web.aspencart
32 web.aspengbic
33 web.Aviation
34 web.bloomandgrowasia.com
35 web.Builder
36 web.Dealflow
37 web.facebook1
38 web.FlexyShop
39 web.FlexyShop2
40 web.FlexySpam
41 web.greenpeace.skype
42 web.hex
43 web.hex.new
44 web.hhyc_membership_system
45 web.Iconstruction
46 web.intimateplay.com
47 web.iris
48 web.MediaOutreach
49 web.mtrack
50 web.Netsuite
51 web.oxfam_translators
52 web.Pman
53 web.Ris
54 web.roojsolutions
55 web.seedling
56 web.storkboxes
57 web.Texon
58 ");
59
60
61
62
63 $dir = '/home/alan/gitlive';
64 foreach($ar as $a) {
65         $a = trim($a);
66         if (!file_exists($dir.'/'. $a)) {
67
68                 $cmd = 'git clone http://git.roojs.com:8081/'. $a;
69 echo $cmd ."\n";
70                 `$cmd`;
71         }
72         if (file_exists($dir. '/'. $a.'.komodoproject')) {
73                 continue;
74         }
75         $m = md5(rand());
76         $mm = array();
77         $b = array(8,4,4,4,12);
78         $bl = 0;
79         foreach($b as $bb) {
80                 $mm[] = substr($m, $bl,$bb);
81                 $bl+=$bb;
82         }
83         $mm = implode('-', $mm);
84
85 file_put_contents($dir. '/'. $a.'.komodoproject',
86 '<?xml version="1.0" encoding="UTF-8"?>
87 <!-- Komodo Project File - DO NOT EDIT -->
88 <project id="'.$mm.'" kpf_version="5" name="'.$a.'.komodoproject">
89 <preference-set idref="'.$mm.'">
90   <string relative="path" id="import_dirname">'.$a.'</string>
91   <string id="import_exclude_matches">*.*~;*.bak;*.tmp;CVS;.#*;*.pyo;*.pyc;.svn;.git;.hg;.bzr;*%*;tmp*.html;.DS_Store;*.swp;*.kpf;*.komodoproject;*.komodoto
92 ols</string>
93   <string id="import_include_matches"></string>
94   <string relative="path" id="last_local_directory">'.$a.'</string>
95 </preference-set>
96 </project>');
97  
98 }
99