Changeset 108

Show
Ignore:
Timestamp:
11/15/06 22:13:00 (2 years ago)
Author:
Gregor
Message:

dsss.conf, sss/net.d: Swap wget for curl, since curl has better timestamping support.

sss/net.d: Use HTTP for mirrors instead of Subversion.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dsss.conf

    r96 r108  
    6868        install winbins/bsdtar.exe $BIN_PREFIX ; \ 
    6969        install winbins/bzip2.dll $BIN_PREFIX ; \ 
     70        install winbins/curl.exe $BIN_PREFIX ; \ 
    7071        install winbins/intl3_svn.dll $BIN_PREFIX ; \ 
    7172        install winbins/libapr.dll $BIN_PREFIX ; \ 
     
    8182        install winbins/ssleay32.dll $BIN_PREFIX ; \ 
    8283        install winbins/svn.exe $BIN_PREFIX ; \ 
    83         install winbins/wget.exe $BIN_PREFIX ; \ 
    8484        install winbins/zlib1.dll $BIN_PREFIX 
    8585} 
  • trunk/sss/net.d

    r107 r108  
    5656        srcListUpdated = true; 
    5757         
    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")) { 
    5964            // select a source list mirror 
    6065            char[][] mirrorList = std.string.split( 
     
    6772            while (mirrorList[$-1] == "") mirrorList = mirrorList[0..$-1]; 
    6873             
    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             // choose 
    7974            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"); 
    88107        } 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); 
    92119        } 
    93120    } 
     
    151178            // 1) make the source directory 
    152179            char[] srcDir = scratchPrefix ~ std.path.sep ~ "DSSS_" ~ args[1]; 
     180            char[] tmpDir = srcDir; 
    153181            mkdirP(srcDir); 
    154182            writefln("Working in %s", srcDir); 
     
    161189            scope(exit) { 
    162190                chdir(origcwd); 
    163                 rmRecursive(srcDir); 
     191                rmRecursive(tmpDir); 
    164192            } 
    165193             
     
    174202                // compress 
    175203                version (Windows) { 
    176                     system("bsdtar zcf " ~ archname ~ " " ~ std.string.join( 
     204                    system("bsdtar -zcf " ~ archname ~ " " ~ std.string.join( 
    177205                        listdir(".", RegExp(r"^[^\.]")), 
    178206                        " ")); 
     
    216244/** Net config object */ 
    217245class NetConfig { 
     246    /** The mirror in use */ 
     247    char[] mirror; 
     248     
    218249    /** Versions of packages */ 
    219250    char[][char[]] vers; 
     
    236267{ 
    237268    NetConfig conf = new NetConfig(); 
     269     
     270    // read in the mirror 
     271    conf.mirror = cast(char[]) std.file.read(srcListPrefix ~ std.path.sep ~ "mirror"); 
    238272     
    239273    // read in the main tool/dep/version list 
     
    378412                 
    379413                // mango doesn't work properly for me :( 
    380                 systemOrDie("wget -c '" ~ conf.srcURL[pkg] ~ "' -O src." ~ srcFormat); 
     414                systemOrDie("curl " ~ conf.srcURL[pkg] ~ " -o src." ~ srcFormat); 
    381415                 
    382416                // extract it 
     
    437471             
    438472            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             
    440481            chdir(srcDir); 
    441482        } 
     
    457498        char[] mirror = mirrorsList[sel]; 
    458499         
    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        } 
    460509    } 
    461510