Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
fix for compile
Browse files Browse the repository at this point in the history
  • Loading branch information
despiegk committed Dec 19, 2024
1 parent 17e521b commit 875b54e
Show file tree
Hide file tree
Showing 36 changed files with 51 additions and 58 deletions.
4 changes: 2 additions & 2 deletions crystallib/biz/bizmodel/play_product_revenue.v
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn (mut m BizModel) revenue_action(action Action) ! {
product.has_oneoffs = true
}

mut cogs_perc := m.sheet.row_new(
_ := m.sheet.row_new(
name: '${name}_cogs_perc'
growth: action.params.get_default('cogs_perc', '0')!
tags: 'rev name:${name}'
Expand Down Expand Up @@ -205,7 +205,7 @@ fn (mut m BizModel) revenue_action(action Action) ! {
nrmonths: nr_months_recurring
)!

nr_sold_recurring := nr_sold.recurring(
_ := nr_sold.recurring(
name: '${name}_nr_sold_recurring'
descr: 'Nr products active because of recurring for ${name2}'
nrmonths: nr_months_recurring
Expand Down
2 changes: 1 addition & 1 deletion crystallib/biz/spreadsheet/factory.v
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn sheet_new(args SheetNewArgs) !&Sheet {
pub fn sheet_get(name string) !&Sheet {
rlock sheets {
if name in sheets {
return sheets[name]
return sheets[name] or { return error('Sheet ${name} not found') }
}
}
return error("cann't find sheet:'${name}' in global sheets")
Expand Down
2 changes: 1 addition & 1 deletion crystallib/biz/spreadsheet/wiki.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import freeflowuniverse.crystallib.ui.console
pub fn (mut s Sheet) wiki(args_ RowGetArgs) !string {
mut args := args_

period_months := match args.period_type {
_ := match args.period_type {
.year { 12 }
.month { 1 }
.quarter { 3 }
Expand Down
2 changes: 1 addition & 1 deletion crystallib/builder/builder_factory.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct BuilderFactory {
}

pub fn new() !BuilderFactory {
mut c := base.context()!
_ := base.context()!
mut bf := BuilderFactory{}
return bf
}
Expand Down
1 change: 0 additions & 1 deletion crystallib/core/generator/generic/generator.v
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ fn generate_exec(path string, reset bool) ! {
// TODO: check case sensistivity for delete
mut path_readme := pathlib.get(args.path + '/readme.md')
if args.reset || !path_readme.exists() {
name := args.name
mut templ_readme := $tmpl('templates/readme.md')
pathlib.template_write(templ_readme, '${args.path}/readme.md', true)!
}
Expand Down
8 changes: 4 additions & 4 deletions crystallib/core/playcmds/play_core.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ pub fn play_core(mut plbook playbook.PlayBook) ! {

if p.exists('coderoot') {
panic('implement')
mut coderoot := p.get_path_create('coderoot')!
_ := p.get_path_create('coderoot')!

mut gs := gittools.get()!
_ := gittools.get()!
}
action.done = true
}

for mut action in plbook.find(filter: 'session.')! {
mut p := action.params
mut session := plbook.session
_ := action.params
_ := plbook.session

//!!session.env_set key:'JWT_SHARED_KEY' val:'...'

Expand Down
10 changes: 5 additions & 5 deletions crystallib/core/playcmds/play_luadns.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import freeflowuniverse.crystallib.core.playbook
import os

pub fn play_luadns(mut plbook playbook.PlayBook) ! {
mut buildroot := '${os.home_dir()}/hero/var/mdbuild'
mut publishroot := '${os.home_dir()}/hero/www/info'
mut coderoot := ''
_ := '${os.home_dir()}/hero/var/mdbuild'
_ := '${os.home_dir()}/hero/www/info'
_ := ''
// mut install := false
mut reset := false
mut pull := false
_ := false
_ := false

for mut action in plbook.find(filter: 'luadns.set_domain')! {
mut p := action.params
Expand Down
2 changes: 1 addition & 1 deletion crystallib/core/playcmds/play_mdbook.v
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn play_mdbook(mut plbook playbook.PlayBook) ! {
printbook := p.get_default_false('printbook')
foldlevel := p.get_int_default('foldlevel', 0)!
production := p.get_default_false('production')
reset3 := p.get_default_true('reset')
_ := p.get_default_true('reset')
collections := p.get_list_default('collections', [])!

if summary_url == '' && summary_path == '' {
Expand Down
2 changes: 1 addition & 1 deletion crystallib/data/doctree/process_includes.v
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn (mut tree Tree) generate_pages_graph() !map[string]map[string]bool {

fn (mut tree Tree) collection_page_graph(col &collection.Collection) !map[string]map[string]bool {
mut graph := map[string]map[string]bool{}
mut ths := []thread !GraphResponse{}
_ := []thread !GraphResponse{}
for _, page in col.pages {
resp := tree.generate_page_graph(page, col.name)!
for k, v in resp.graph {
Expand Down
2 changes: 1 addition & 1 deletion crystallib/data/doctree/scan.v
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub fn (mut tree Tree) scan_concurrent(args_ TreeScannerArgs) ! {
)
}

for i, t in threads {
for _, t in threads {
new_collection := t.wait() or { return error('Error executing thread: ${err}') }
tree.collections[new_collection.name] = &new_collection
}
Expand Down
2 changes: 1 addition & 1 deletion crystallib/data/doctree/tree.v
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn new(args_ TreeArgsGet) !&Tree {
pub fn tree_get(name string) !&Tree {
rlock doctrees {
if name in doctrees {
return doctrees[name]
return doctrees[name] or { return error('Doctree ${name} not found') }
}
}
return error("cann't doctree:'${name}'")
Expand Down
2 changes: 1 addition & 1 deletion crystallib/develop/gittools/repository.v
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ fn (mut repo GitRepo) set_sshkey(key_name string) ! {
}

private_key := key.private_key_path()!
cmd := 'git config core.sshcommand "ssh -i ~/.ssh/${private_key.path}"'
_ := 'git config core.sshcommand "ssh -i ~/.ssh/${private_key.path}"'
repo.deploysshkey = key_name
}

Expand Down
2 changes: 1 addition & 1 deletion crystallib/installers/lang/nodejs/nodejs.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub mut:
}

pub fn install(args_ InstallArgs) ! {
mut args := args_
_ := args_
pl := osal.platform()
if pl == .arch {
osal.package_install('npm')!
Expand Down
2 changes: 1 addition & 1 deletion crystallib/installers/lang/vlang/v-analyzer.v
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn v_analyzer_install(args_ InstallArgs) ! {
mut args := args_
console.print_header('install v-analyzer (reset: ${args.reset})')
version := '0.0.4'
pl := osal.platform()
_ := osal.platform()
res := os.execute('${osal.profile_path_source_and()} v-analyzer version')
if res.exit_code == 0 {
r := res.output.split_into_lines().filter(it.trim_space().starts_with('v-analyzer'))
Expand Down
2 changes: 1 addition & 1 deletion crystallib/installers/sysadmintools/garage_s3/configure.v
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub fn stop() ! {
}

fn check(args S3Config) !bool {
cmd := 'garage status'
_ := 'garage status'
res := os.execute('garage status')
if res.exit_code == 0 {
return true
Expand Down
2 changes: 1 addition & 1 deletion crystallib/installers/sysadmintools/grafana/grafana.v
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub fn install(args_ InstallArgs) ! {
return error('unsuported platform, only linux amd64 for now')
}

mut dest := osal.download(
_ := osal.download(
url: url
minsize_kb: 15000
expand_dir: '/tmp/grafana'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn install_alertmanager(args_ InstallArgs) ! {
return error('unsported platform, only linux amd64 for now')
}

mut dest := osal.download(
_ := osal.download(
url: url
minsize_kb: 28000
expand_dir: '/tmp/prometheus'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn install_blackbox_exporter(args_ InstallArgs) ! {
return error('unsuported platform, only linux amd64 for now')
}

mut dest := osal.download(
_ := osal.download(
url: url
minsize_kb: 9000
expand_dir: '/tmp/prometheus'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn install_node_exporter(args_ InstallArgs) ! {
return error('unsuported platform, only linux amd64 for now')
}

mut dest := osal.download(
_ := osal.download(
url: url
minsize_kb: 9000
expand_dir: '/tmp/prometheus'
Expand Down
2 changes: 1 addition & 1 deletion crystallib/installers/sysadmintools/prometheus/prom2json.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn install_prom2json(args_ InstallArgs) ! {
return error('unsuported platform, only linux amd64 for now')
}

mut dest := osal.download(
_ := osal.download(
url: url
minsize_kb: 3000
expand_dir: '/tmp/prometheus'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn install_prometheus(args_ InstallArgs) ! {
return error('unsported platform, only linux amd64 for now')
}

mut dest := osal.download(
_ := osal.download(
url: url
minsize_kb: 100000
expand_dir: '/tmp/prometheus'
Expand Down
4 changes: 2 additions & 2 deletions crystallib/installers/sysadmintools/rclone/rclone_actions.v
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ fn install() ! {
}

fn configure() ! {
mut cfg := get()!
_ := get()!

// THIS IS EXAMPLE CODEAND NEEDS TO BE CHANGED

mut mycode := $tmpl('templates/rclone.yaml')
_ := $tmpl('templates/rclone.yaml')
// mut path := pathlib.get_file(path: cfg.configpath, create: true)!
// path.write(mycode)!
// console.print_debug(mycode)
Expand Down
2 changes: 1 addition & 1 deletion crystallib/installers/upload.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ pub mut:
}

pub fn upload(args_ UploadArgs) ! {
mut args := args_
//_ := args_
panic('to implement')
}
2 changes: 1 addition & 1 deletion crystallib/lang/python/shell.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import freeflowuniverse.crystallib.osal
import freeflowuniverse.crystallib.core.texttools

pub fn (py PythonEnv) shell(name_ string) ! {
name := texttools.name_fix(name_)
_ := texttools.name_fix(name_)
cmd := '
cd ${py.path.path}
source bin/activate
Expand Down
4 changes: 2 additions & 2 deletions crystallib/osal/rsync/rsyncd.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn rsyncd() !RsyncD {

// add site to the rsyncd config
pub fn (mut self RsyncD) site_add(args_ RsyncSite) ! {
mut args := args_
_ := args_
// self.sites[args.name]=RsyncSite{name:args.name,}
}

Expand All @@ -48,7 +48,7 @@ pub fn (mut self RsyncD) generate() ! {
}

fn (mut self RsyncD) reload() ! {
cmd := '
_ := '
chmod 600 /etc/rsyncd.secrets
systemctl enable rsync
systemctl start rsync
Expand Down
2 changes: 1 addition & 1 deletion crystallib/threefold/grid/deployer.v
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ pub fn (mut d Deployer) batch_deploy(name_contracts []string, mut dls map[u32]&m
continue
}

mut dl := dls[data.node]
mut dl := dls[data.node] or { return error('Node ${data.node} not found in dls map') }
dl.contract_id = contract_id
threads << spawn d.handle_deploy(data.node, mut dl, hash_map[data.node])
}
Expand Down
2 changes: 1 addition & 1 deletion crystallib/threefold/grid/vm.v
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn (mut deployer Deployer) vm_deploy(args_ VMSpecs) !VMDeployed {
}
// deploymentstate_db.set(args.deployment_name,"vm_${args.name}",json.encode(VMDeployed))!

vm := models.VM{
_ := models.VM{
name: 'vm1'
env_vars: {
'SSH_KEY': 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTwULSsUubOq3VPWL6cdrDvexDmjfznGydFPyaNcn7gAL9lRxwFbCDPMj7MbhNSpxxHV2+/iJPQOTVJu4oc1N7bPP3gBCnF51rPrhTpGCt5pBbTzeyNweanhedkKDsCO2mIEh/92Od5Hg512dX4j7Zw6ipRWYSaepapfyoRnNSriW/s3DH/uewezVtL5EuypMdfNngV/u2KZYWoeiwhrY/yEUykQVUwDysW/xUJNP5o+KSTAvNSJatr3FbuCFuCjBSvageOLHePTeUwu6qjqe+Xs4piF1ByO/6cOJ8bt5Vcx0bAtI8/MPApplUU/JWevsPNApvnA/ntffI+u8DCwgP'
Expand Down
2 changes: 1 addition & 1 deletion crystallib/threefold/grid4/farmingsimulator/factory.v
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn new(args_ SimulatorArgs) !Simulator {
pub fn simulator_get(name string) !&Simulator {
rlock farmingsimulators {
if name in farmingsimulators {
return farmingsimulators[name]
return farmingsimulators[name] or { return error('Farming simulator ${name} not found') }
}
}
return error("cann't find tfgrid gridsimulator:'${name}' in global farmingsimulators")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn (mut nb NodesBatch) calc(month int) !NBCalc {

power_kwh := nb.node_template.capacity.power * 24 * 30 / 1000 * nb.nrnodes
rackspace := nb.node_template.capacity.rackspace * nb.nrnodes
params := ri.simulator.params
_ := ri.simulator.params
tokens_farmed := ri.token_farming(nb.node_template, month)!

if month < nb.start_month {
Expand Down
2 changes: 1 addition & 1 deletion crystallib/threefold/grid4/farmingsimulator/play.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn play(mut plbook PlayBook) ! {
return
}

mut name := ''
_ := ''
// console.print_header("AAAA")
// console.print_debug(plbook)
// console.print_header("BBBB")
Expand Down
2 changes: 1 addition & 1 deletion crystallib/threefold/grid4/gridsimulator/factory.v
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub fn new(args_ SimulatorArgs) !Simulator {
pub fn simulator_get(name string) !&Simulator {
rlock grid_simulators {
if name in grid_simulators {
return grid_simulators[name]
return grid_simulators[name] or { return error('Grid simulator ${name} not found') }
}
}
return error("cann't find tfgrid gridsimulator:'${name}' in global grid_simulators")
Expand Down
6 changes: 2 additions & 4 deletions crystallib/threefold/tfrobot/deploy.v
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub mut:
node_group string
cpu int = 4 @[required]
mem int = 4 @[required] // in GB
public_ip4 bool = false
public_ip6 bool = false
public_ip4 bool
public_ip6 bool
ygg_ip bool = true
mycelium_ip bool = true
flist string @[required]
Expand All @@ -53,8 +53,6 @@ pub mut:
env_vars map[string]string
}

// pub struct SSHKey

pub struct DeployResult {
pub:
ok map[string][]VMOutput
Expand Down
Loading

0 comments on commit 875b54e

Please sign in to comment.