@@ -4,7 +4,7 @@ import os
4
4
import flag
5
5
import scripting
6
6
7
- pub fn check_v_commit_timestamp_before_self_rebuilding (v_timestamp int ) {
7
+ pub fn check_v_commit_timestamp_before_self_rebuilding (v_timestamp u64 ) {
8
8
if v_timestamp > = 1561805697 {
9
9
return
10
10
}
@@ -29,9 +29,9 @@ pub fn validate_commit_exists(commit string) {
29
29
}
30
30
}
31
31
32
- pub fn line_to_timestamp_and_commit (line string ) (int , string ) {
32
+ pub fn line_to_timestamp_and_commit (line string ) (u64 , string ) {
33
33
parts := line.split (' ' )
34
- return parts[0 ].int (), parts[1 ]
34
+ return parts[0 ].u64 (), parts[1 ]
35
35
}
36
36
37
37
pub fn normalized_workpath_for_commit (workdir string , commit string ) string {
@@ -45,7 +45,7 @@ fn get_current_folder_commit_hash() string {
45
45
return v_commithash
46
46
}
47
47
48
- pub fn prepare_vc_source (vcdir string , cdir string , commit string ) (string , string , int ) {
48
+ pub fn prepare_vc_source (vcdir string , cdir string , commit string ) (string , string , u64 ) {
49
49
scripting.chdir (cdir)
50
50
// Building a historic v with the latest vc is not always possible ...
51
51
// It is more likely, that the vc *at the time of the v commit*,
@@ -132,7 +132,7 @@ pub mut:
132
132
// these will be filled by vgitcontext.compile_oldv_if_needed()
133
133
commit_v__hash string // the git commit of the v repo that should be prepared
134
134
commit_vc_hash string // the git commit of the vc repo, corresponding to commit_v__hash
135
- commit_v__ts int // unix timestamp, that corresponds to commit_v__hash; filled by prepare_vc_source
135
+ commit_v__ts u64 // unix timestamp, that corresponds to commit_v__hash; filled by prepare_vc_source
136
136
vexename string // v or v.exe
137
137
vexepath string // the full absolute path to the prepared v/v.exe
138
138
vvlocation string // v.v or compiler/ or cmd/v, depending on v version
@@ -214,16 +214,15 @@ pub fn (mut vgit_context VGitContext) compile_oldv_if_needed() {
214
214
215
215
pub struct VGitOptions {
216
216
pub mut :
217
- workdir string // the working folder (typically /tmp), where the tool will write
217
+ workdir string = os. temp_dir () // the working folder (typically /tmp), where the tool will write
218
218
v_repo_url string // the url of the V repository. It can be a local folder path, if you want to eliminate network operations...
219
219
vc_repo_url string // the url of the vc repository. It can be a local folder path, if you want to eliminate network operations...
220
220
show_help bool // whether to show the usage screen
221
221
verbose bool // should the tool be much more verbose
222
222
}
223
223
224
224
pub fn add_common_tool_options (mut context VGitOptions, mut fp flag.FlagParser) []string {
225
- tdir := os.temp_dir ()
226
- context.workdir = os.real_path (fp.string ('workdir' , `w` , context.workdir, 'A writable base folder. Default: ${tdir} ' ))
225
+ context.workdir = os.real_path (fp.string ('workdir' , `w` , context.workdir, 'A writable base folder. Default: ${context.workdir} ' ))
227
226
context.v_repo_url = fp.string ('vrepo' , 0 , context.v_repo_url, 'The url of the V repository. You can clone it locally too. See also --vcrepo below.' )
228
227
context.vc_repo_url = fp.string ('vcrepo' , 0 , context.vc_repo_url, 'The url of the vc repository. You can clone it
229
228
${flag.space} beforehand, and then just give the local folder
0 commit comments