Changeset 108
- Timestamp:
- 11/15/06 22:13:00 (2 years ago)
- Files:
-
- trunk/dsss.conf (modified) (2 diffs)
- trunk/sss/net.d (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dsss.conf
r96 r108 68 68 install winbins/bsdtar.exe $BIN_PREFIX ; \ 69 69 install winbins/bzip2.dll $BIN_PREFIX ; \ 70 install winbins/curl.exe $BIN_PREFIX ; \ 70 71 install winbins/intl3_svn.dll $BIN_PREFIX ; \ 71 72 install winbins/libapr.dll $BIN_PREFIX ; \ … … 81 82 install winbins/ssleay32.dll $BIN_PREFIX ; \ 82 83 install winbins/svn.exe $BIN_PREFIX ; \ 83 install winbins/wget.exe $BIN_PREFIX ; \84 84 install winbins/zlib1.dll $BIN_PREFIX 85 85 } trunk/sss/net.d
r107 r108 56 56 srcListUpdated = true; 57 57 58 if (!exists(srcListPrefix)) { 58 // check for cruft from pre-0.3 DSSS 59 if (exists(srcListPrefix ~ std.path.sep ~ ".svn")) { 60 rmRecursive(srcListPrefix); 61 } 62 63 if (!exists(srcListPrefix ~ std.path.sep ~ "mirror")) { 59 64 // select a source list mirror 60 65 char[][] mirrorList = std.string.split( … … 67 72 while (mirrorList[$-1] == "") mirrorList = mirrorList[0..$-1]; 68 73 69 writefln("Please choose a mirror for the source list:");70 writefln("(Note that you may choose another mirror at any time by removing the directory");71 writefln("%s)", srcListPrefix);72 writefln("");73 74 foreach (i, mirror; mirrorList) {75 writefln("%d) %s", i + 1, mirror);76 }77 78 // choose79 74 int sel = -1; 80 char[] csel; 81 while (sel < 0 || sel >= mirrorList.length) { 82 csel = din.readLine(); 83 sel = atoi(csel) - 1; 84 } 85 86 // check it out 87 saySystemDie("svn co " ~ mirrorList[sel] ~ " " ~ srcListPrefix); 75 76 if (mirrorList.length == 1) { 77 // easy choice :) 78 sel = 0; 79 } else { 80 writefln("Please choose a mirror for the source list:"); 81 writefln("(Note that you may choose another mirror at any time by removing the directory"); 82 writefln("%s)", srcListPrefix); 83 writefln(""); 84 85 foreach (i, mirror; mirrorList) { 86 writefln("%d) %s", i + 1, mirror); 87 } 88 89 // choose 90 char[] csel; 91 while (sel < 0 || sel >= mirrorList.length) { 92 csel = din.readLine(); 93 sel = atoi(csel) - 1; 94 } 95 } 96 97 // get it 98 mkdirP(srcListPrefix); 99 std.file.write(srcListPrefix ~ std.path.sep ~ "mirror", 100 mirrorList[sel]); 101 char[] mirror = cast(char[]) std.file.read( 102 srcListPrefix ~ std.path.sep ~ "mirror"); 103 saySystemDie("curl " ~ mirror ~ "/source.list " 104 "-o " ~ srcListPrefix ~ std.path.sep ~ "source.list"); 105 saySystemDie("curl " ~ mirror ~ "/pkgs.list " 106 "-o " ~ srcListPrefix ~ std.path.sep ~ "pkgs.list"); 88 107 } else { 89 // update it 90 // FIXME: this should not run every time 91 saySystemDie("svn up " ~ srcListPrefix); 108 char[] mirror = cast(char[]) std.file.read( 109 srcListPrefix ~ std.path.sep ~ "mirror"); 110 char[] srcList = srcListPrefix ~ std.path.sep ~ "source.list"; 111 char[] pkgsList = srcListPrefix ~ std.path.sep ~ "pkgs.list"; 112 113 saySystemDie("curl " ~ mirror ~ "/source.list " 114 "-o " ~ srcList ~ 115 " -z " ~ srcList); 116 saySystemDie("curl " ~ mirror ~ "/pkgs.list " 117 "-o " ~ pkgsList ~ 118 " -z " ~ pkgsList); 92 119 } 93 120 } … … 151 178 // 1) make the source directory 152 179 char[] srcDir = scratchPrefix ~ std.path.sep ~ "DSSS_" ~ args[1]; 180 char[] tmpDir = srcDir; 153 181 mkdirP(srcDir); 154 182 writefln("Working in %s", srcDir); … … 161 189 scope(exit) { 162 190 chdir(origcwd); 163 rmRecursive( srcDir);191 rmRecursive(tmpDir); 164 192 } 165 193 … … 174 202 // compress 175 203 version (Windows) { 176 system("bsdtar zcf " ~ archname ~ " " ~ std.string.join(204 system("bsdtar -zcf " ~ archname ~ " " ~ std.string.join( 177 205 listdir(".", RegExp(r"^[^\.]")), 178 206 " ")); … … 216 244 /** Net config object */ 217 245 class NetConfig { 246 /** The mirror in use */ 247 char[] mirror; 248 218 249 /** Versions of packages */ 219 250 char[][char[]] vers; … … 236 267 { 237 268 NetConfig conf = new NetConfig(); 269 270 // read in the mirror 271 conf.mirror = cast(char[]) std.file.read(srcListPrefix ~ std.path.sep ~ "mirror"); 238 272 239 273 // read in the main tool/dep/version list … … 378 412 379 413 // mango doesn't work properly for me :( 380 systemOrDie(" wget -c '" ~ conf.srcURL[pkg] ~ "' -Osrc." ~ srcFormat);414 systemOrDie("curl " ~ conf.srcURL[pkg] ~ " -o src." ~ srcFormat); 381 415 382 416 // extract it … … 437 471 438 472 chdir(dir); 439 system("patch -p0 -i " ~ srcListPrefix ~ std.path.sep ~ pfile); 473 474 // download the patch file 475 saySystemDie("curl " ~ conf.mirror ~ "/" ~ pfile ~ 476 " -o " ~ pfile); 477 478 // install the patch 479 system("patch -p0 -i " ~ pfile); 480 440 481 chdir(srcDir); 441 482 } … … 457 498 char[] mirror = mirrorsList[sel]; 458 499 459 saySystemDie("svn co " ~ mirror ~ "/" ~ pkg ~ " ."); 500 saySystemDie("curl " ~ mirror ~ "/" ~ pkg ~ ".tar.gz " ~ 501 "-o " ~ pkg ~ ".tar.gz"); 502 503 // extract 504 version (Windows) { 505 saySystemDie("bsdtar -xf " ~ pkg ~ ".tar.gz"); 506 } else { 507 saySystemDie("gunzip -c " ~ pkg ~ ".tar.gz | tar -xf -"); 508 } 460 509 } 461 510
