Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 1905

Show
Ignore:
Timestamp:
03/15/07 11:20:17 (2 years ago)
Author:
larsivi
Message:

Now creates snapshot named current and moves to download dir

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/install/snapshot/snapshot.conf

    r1904 r1905  
    66chmodfiles = tango/core/Exception.di tango/core/Memory.di tango/core/Thread.di 
    77rmpaths = patches/ doc/ install/windows install/snapshot lib/libphobos.a 
     8dlpath = /download/dir/ 
  • trunk/install/snapshot/srcsnapshot.d

    r1903 r1905  
    1717char[] chmodfiles; 
    1818char[] rmpaths; 
     19char[] dlpath; 
    1920 
    2021int main(char[][] args) 
     
    5051             rmpaths = value; 
    5152             break; 
    52           default: 
     53        case "dlpath": 
     54             dlpath = value; 
     55             break; 
     56           default: 
    5357            break; 
    5458        } 
     
    97101    char[] datestr;  
    98102    datestr = Stdout.layout.sprint(new char[10], "{}{:2}{:2}", date.year, date.month, date.day); 
    99     char[] packdir = projname ~ "-src-SNAPSHOT-" ~ datestr; 
    100  
    101     auto pd = new FilePath(packdir, true); 
     103    char[] packdirdate = projname ~ "-src-SNAPSHOT-" ~ datestr; 
     104    char[] packdircurrent = projname ~ "-src-SNAPSHOT-CURRENT";  
     105 
     106    auto pd = new FilePath(packdirdate, true); 
    102107    if (pd.exists) { 
    103108        Stdout("!! Packaging dir already exists, removing before recreating").newline; 
    104         auto rmdir = new Process("rm -rf " ~ packdir, null); 
     109        auto rmdir = new Process("rm -rf " ~ packdirdate, null); 
    105110        rmdir.execute(); 
    106111        auto result = rmdir.wait(); 
     
    111116    } 
    112117 
    113     auto svnexp = new Process("svn export " ~ wcdir ~ " " ~ packdir, null); 
     118    auto svnexp = new Process("svn export " ~ wcdir ~ " " ~ packdirdate, null); 
    114119    svnexp.execute(); 
    115120    auto result = svnexp.wait(); 
     
    121126    // enter packagedir/lib 
    122127    Stdout("!! Generate files").newline; 
    123     FileSystem.setDirectory(packdir ~ FileConst.PathSeparatorString ~ "lib"); 
     128    FileSystem.setDirectory(packdirdate ~ FileConst.PathSeparatorString ~ "lib"); 
    124129 
    125130    // run build-*.* 
     
    134139  
    135140    // enter package root dir 
    136     FileSystem.setDirectory(workdir ~ FileConst.PathSeparatorString ~ packdir); 
     141    FileSystem.setDirectory(workdir ~ FileConst.PathSeparatorString ~ packdirdate); 
    137142 
    138143    // change access to generated files 
     
    163168    // create zip, etc 
    164169    Stdout("!! Creating .tar.gz").newline; 
    165     auto targz = new Process("tar czf " ~ packdir ~ ".tar.gz " ~ packdir, null); 
     170    auto targz = new Process("tar czf " ~ packdirdate ~ ".tar.gz " ~ packdirdate, null); 
    166171    targz.execute(); 
    167172    Stderr.conduit.copy(targz.stderr); 
     
    173178 
    174179    Stdout("!! Creating .zip").newline; 
    175     auto zip = new Process("zip -r " ~ packdir ~ " " ~ packdir, null); 
     180    auto zip = new Process("zip -r " ~ packdirdate ~ " " ~ packdirdate, null); 
    176181    zip.execute(); 
    177182    Stderr.conduit.copy(zip.stderr); 
     
    181186        return 1; 
    182187    } 
    183   
     188 
     189    auto dldir = new FilePath(dlpath, true); 
     190    if (!dldir.exists) 
     191        dldir.createFolder(); 
     192 
     193    auto datetgz = new FilePath(packdirdate ~ ".tar.gz"); 
     194    auto dltgz = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ datetgz.toUtf8); 
     195    datetgz.rename(dltgz); 
     196     
     197    auto datezip = new FilePath(packdirdate ~ ".zip"); 
     198    auto dlzip = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ datezip.toUtf8); 
     199    datezip.rename(dlzip); 
     200  
     201    auto currenttgz = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ packdircurrent ~ ".tar.gz"); 
     202    currenttgz.copy(datetgz.toUtf8); 
     203  
     204    auto currentzip = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ packdircurrent ~ ".zip"); 
     205    currentzip.copy(datezip.toUtf8); 
     206 
    184207    return 0; 
    185208}