 |
Changeset 1905
- 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
| r1904 |
r1905 |
|
| 6 | 6 | chmodfiles = tango/core/Exception.di tango/core/Memory.di tango/core/Thread.di |
|---|
| 7 | 7 | rmpaths = patches/ doc/ install/windows install/snapshot lib/libphobos.a |
|---|
| | 8 | dlpath = /download/dir/ |
|---|
| r1903 |
r1905 |
|
| 17 | 17 | char[] chmodfiles; |
|---|
| 18 | 18 | char[] rmpaths; |
|---|
| | 19 | char[] dlpath; |
|---|
| 19 | 20 | |
|---|
| 20 | 21 | int main(char[][] args) |
|---|
| … | … | |
| 50 | 51 | rmpaths = value; |
|---|
| 51 | 52 | break; |
|---|
| 52 | | default: |
|---|
| | 53 | case "dlpath": |
|---|
| | 54 | dlpath = value; |
|---|
| | 55 | break; |
|---|
| | 56 | default: |
|---|
| 53 | 57 | break; |
|---|
| 54 | 58 | } |
|---|
| … | … | |
| 97 | 101 | char[] datestr; |
|---|
| 98 | 102 | 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); |
|---|
| 102 | 107 | if (pd.exists) { |
|---|
| 103 | 108 | 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); |
|---|
| 105 | 110 | rmdir.execute(); |
|---|
| 106 | 111 | auto result = rmdir.wait(); |
|---|
| … | … | |
| 111 | 116 | } |
|---|
| 112 | 117 | |
|---|
| 113 | | auto svnexp = new Process("svn export " ~ wcdir ~ " " ~ packdir, null); |
|---|
| | 118 | auto svnexp = new Process("svn export " ~ wcdir ~ " " ~ packdirdate, null); |
|---|
| 114 | 119 | svnexp.execute(); |
|---|
| 115 | 120 | auto result = svnexp.wait(); |
|---|
| … | … | |
| 121 | 126 | // enter packagedir/lib |
|---|
| 122 | 127 | Stdout("!! Generate files").newline; |
|---|
| 123 | | FileSystem.setDirectory(packdir ~ FileConst.PathSeparatorString ~ "lib"); |
|---|
| | 128 | FileSystem.setDirectory(packdirdate ~ FileConst.PathSeparatorString ~ "lib"); |
|---|
| 124 | 129 | |
|---|
| 125 | 130 | // run build-*.* |
|---|
| … | … | |
| 134 | 139 | |
|---|
| 135 | 140 | // enter package root dir |
|---|
| 136 | | FileSystem.setDirectory(workdir ~ FileConst.PathSeparatorString ~ packdir); |
|---|
| | 141 | FileSystem.setDirectory(workdir ~ FileConst.PathSeparatorString ~ packdirdate); |
|---|
| 137 | 142 | |
|---|
| 138 | 143 | // change access to generated files |
|---|
| … | … | |
| 163 | 168 | // create zip, etc |
|---|
| 164 | 169 | 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); |
|---|
| 166 | 171 | targz.execute(); |
|---|
| 167 | 172 | Stderr.conduit.copy(targz.stderr); |
|---|
| … | … | |
| 173 | 178 | |
|---|
| 174 | 179 | Stdout("!! Creating .zip").newline; |
|---|
| 175 | | auto zip = new Process("zip -r " ~ packdir ~ " " ~ packdir, null); |
|---|
| | 180 | auto zip = new Process("zip -r " ~ packdirdate ~ " " ~ packdirdate, null); |
|---|
| 176 | 181 | zip.execute(); |
|---|
| 177 | 182 | Stderr.conduit.copy(zip.stderr); |
|---|
| … | … | |
| 181 | 186 | return 1; |
|---|
| 182 | 187 | } |
|---|
| 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 | |
|---|
| 184 | 207 | return 0; |
|---|
| 185 | 208 | } |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic