completely removes -I

This commit is contained in:
Joe Bryan 2018-10-10 02:08:43 -04:00
parent f76f8b5363
commit 4bcfcf0b3a
3 changed files with 9 additions and 27 deletions

View File

@ -581,7 +581,6 @@
typedef struct _u3_opts { typedef struct _u3_opts {
c3_c* arv_c; // -A, initial sync from c3_c* arv_c; // -A, initial sync from
c3_c* gen_c; // -G, czar generator c3_c* gen_c; // -G, czar generator
c3_c* imp_c; // -I, czar name
c3_c* nam_c; // -n, unix hostname c3_c* nam_c; // -n, unix hostname
c3_c* pil_c; // -B, bootstrap from c3_c* pil_c; // -B, bootstrap from
c3_c* raf_c; // -r, raft flotilla c3_c* raf_c; // -r, raft flotilla

View File

@ -1238,6 +1238,7 @@ static u3_noun
_http_czar_host(void) _http_czar_host(void)
{ {
u3_noun dom = u3_nul; u3_noun dom = u3_nul;
return dom;
// XX revisit // XX revisit
#if 0 #if 0
@ -1275,7 +1276,6 @@ _http_czar_host(void)
} }
} }
} }
#endif
if ( u3_nul == dom ) { if ( u3_nul == dom ) {
return dom; return dom;
@ -1285,6 +1285,7 @@ _http_czar_host(void)
dom = u3nc(u3i_string(u3_Host.ops_u.imp_c + 1), u3kb_flop(u3k(dom))); dom = u3nc(u3i_string(u3_Host.ops_u.imp_c + 1), u3kb_flop(u3k(dom)));
return u3nt(u3_nul, c3y, u3kb_flop(u3k(dom))); return u3nt(u3_nul, c3y, u3kb_flop(u3k(dom)));
#endif
} }
/* u3_http_ef_bake(): notify %eyre that we're live /* u3_http_ef_bake(): notify %eyre that we're live

View File

@ -91,7 +91,7 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.veb = c3n; u3_Host.ops_u.veb = c3n;
u3_Host.ops_u.kno_w = DefaultKernel; u3_Host.ops_u.kno_w = DefaultKernel;
while ( (ch_i=getopt(argc, argv,"G:B:K:A:I:w:u:f:F:k:l:n:p:r:NabcdgqsvxMPDXRS")) != -1 ) { while ( (ch_i=getopt(argc, argv,"G:B:K:A:w:u:f:F:k:l:n:p:r:NabcdgqsvxMPDXRS")) != -1 ) {
switch ( ch_i ) { switch ( ch_i ) {
case 'M': { case 'M': {
u3_Host.ops_u.mem = c3y; u3_Host.ops_u.mem = c3y;
@ -109,11 +109,6 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.arv_c = strdup(optarg); u3_Host.ops_u.arv_c = strdup(optarg);
break; break;
} }
// XX remove in deference to -K
case 'I': {
u3_Host.ops_u.imp_c = _main_presig(optarg);
break;
}
case 'F': { case 'F': {
u3_Host.ops_u.fak_c = _main_presig(optarg); u3_Host.ops_u.fak_c = _main_presig(optarg);
break; break;
@ -143,7 +138,6 @@ _main_getopt(c3_i argc, c3_c** argv)
} }
case 'K': { case 'K': {
u3_Host.ops_u.key_c = strdup(optarg); u3_Host.ops_u.key_c = strdup(optarg);
u3_Host.ops_u.nuu = c3y;
break; break;
} }
case 'k': { case 'k': {
@ -194,18 +188,11 @@ _main_getopt(c3_i argc, c3_c** argv)
} }
} }
// XX remove -I if ( 0 != u3_Host.ops_u.fak_c ) {
if ( (0 != u3_Host.ops_u.fak_c) && (0 != u3_Host.ops_u.imp_c) ) { u3_Host.ops_u.who_c = strdup(u3_Host.ops_u.fak_c);
fprintf(stderr, "-I is redundant with -F\n");
return c3n;
} }
// set galaxy name c3_t imp_t = ( (0 != u3_Host.ops_u.who_c) && (4 == strlen(u3_Host.ops_u.who_c)) );
// XX need to do this with -K too
// -A is required when booting a galaxy
if ( (0 != u3_Host.ops_u.fak_c) && (4 == strlen(u3_Host.ops_u.fak_c)) ) {
u3_Host.ops_u.imp_c = strdup(u3_Host.ops_u.fak_c);
}
if ( (0 != u3_Host.ops_u.fak_c) && (c3n == u3_Host.ops_u.nuu) ) { if ( (0 != u3_Host.ops_u.fak_c) && (c3n == u3_Host.ops_u.nuu) ) {
fprintf(stderr, "-F only makes sense on initial boot\n"); fprintf(stderr, "-F only makes sense on initial boot\n");
@ -220,22 +207,18 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.net = c3y; /* remote networking is always on in real mode. */ u3_Host.ops_u.net = c3y; /* remote networking is always on in real mode. */
} }
if ( u3_Host.ops_u.arv_c != 0 && ( u3_Host.ops_u.imp_c == 0 || if ( u3_Host.ops_u.arv_c != 0 && !imp_t ) {
u3_Host.ops_u.nuu == c3n ) ) {
fprintf(stderr, "-A only makes sense when creating a new galaxy\n"); fprintf(stderr, "-A only makes sense when creating a new galaxy\n");
return c3n; return c3n;
} }
if ( u3_Host.ops_u.imp_c != 0 && if ( u3_Host.ops_u.arv_c == 0 && imp_t ) {
u3_Host.ops_u.arv_c == 0 &&
u3_Host.ops_u.nuu == c3y ) {
fprintf(stderr, "can't create a new galaxy without specifying " fprintf(stderr, "can't create a new galaxy without specifying "
"the initial sync path with -A\n"); "the initial sync path with -A\n");
return c3n; return c3n;
} }
if ( u3_Host.ops_u.gen_c != 0 && ( u3_Host.ops_u.imp_c == 0 || if ( u3_Host.ops_u.gen_c != 0 && ( !imp_t || u3_Host.ops_u.nuu == c3n ) ) {
u3_Host.ops_u.nuu == c3n ) ) {
fprintf(stderr, "-G only makes sense when creating a new galaxy\n"); fprintf(stderr, "-G only makes sense when creating a new galaxy\n");
return c3n; return c3n;
} }
@ -350,7 +333,6 @@ u3_ve_usage(c3_i argc, c3_c** argv)
"-F ship Fake keys; also disables networking\n", "-F ship Fake keys; also disables networking\n",
"-f Fuzz testing\n", "-f Fuzz testing\n",
"-g Set GC flag\n", "-g Set GC flag\n",
"-I galaxy Start as ~galaxy\n",
"-k stage Start at Hoon kernel version stage\n", "-k stage Start at Hoon kernel version stage\n",
"-l port Initial peer port\n", "-l port Initial peer port\n",
"-M Memory madness\n", "-M Memory madness\n",