|
@@ -281,9 +281,9 @@ bool isValidImage(const string& imageName)
|
|
|
# 137 "kind.ag"
|
|
# 137 "kind.ag"
|
|
|
return dirExists(imageName) &&
|
|
return dirExists(imageName) &&
|
|
|
# 138 "kind.ag"
|
|
# 138 "kind.ag"
|
|
|
- !fileExists(imageName + "/error") &&
|
|
|
|
|
|
|
+ !fileExists(imageName + "/error") &&
|
|
|
# 139 "kind.ag"
|
|
# 139 "kind.ag"
|
|
|
- dirExists(imageName + "/tree");
|
|
|
|
|
|
|
+ dirExists(imageName + "/tree");
|
|
|
# 140 "kind.ag"
|
|
# 140 "kind.ag"
|
|
|
}
|
|
}
|
|
|
# 141 "kind.ag"
|
|
# 141 "kind.ag"
|
|
@@ -501,7 +501,7 @@ void backupVault(const string& vault,
|
|
|
# 247 "kind.ag"
|
|
# 247 "kind.ag"
|
|
|
string userAtHost = conf.getString("user") + "@" +
|
|
string userAtHost = conf.getString("user") + "@" +
|
|
|
# 248 "kind.ag"
|
|
# 248 "kind.ag"
|
|
|
- conf.getString("host");
|
|
|
|
|
|
|
+ conf.getString("host");
|
|
|
# 249 "kind.ag"
|
|
# 249 "kind.ag"
|
|
|
string rshCommand = remoteShell;
|
|
string rshCommand = remoteShell;
|
|
|
# 250 "kind.ag"
|
|
# 250 "kind.ag"
|
|
@@ -689,9 +689,9 @@ void backupVault(const string& vault,
|
|
|
# 341 "kind.ag"
|
|
# 341 "kind.ag"
|
|
|
if (rc == 0 ||
|
|
if (rc == 0 ||
|
|
|
# 342 "kind.ag"
|
|
# 342 "kind.ag"
|
|
|
- rc == 24 || // "no error" or "vanished source files" (ignored)
|
|
|
|
|
|
|
+ rc == 24 || // "no error" or "vanished source files" (ignored)
|
|
|
# 343 "kind.ag"
|
|
# 343 "kind.ag"
|
|
|
- rc == 6114) // workaround for wrong exit code ??!!
|
|
|
|
|
|
|
+ rc == 6114) // workaround for wrong exit code ??!!
|
|
|
# 344 "kind.ag"
|
|
# 344 "kind.ag"
|
|
|
{
|
|
{
|
|
|
# 345 "kind.ag"
|
|
# 345 "kind.ag"
|
|
@@ -1095,9 +1095,9 @@ void expireVault(const string& vault, KindConfig conf, DateTime now)
|
|
|
# 544 "kind.ag"
|
|
# 544 "kind.ag"
|
|
|
for (unsigned int i = 0;
|
|
for (unsigned int i = 0;
|
|
|
# 545 "kind.ag"
|
|
# 545 "kind.ag"
|
|
|
- i < validImages.size() - 1; // never expire latest image
|
|
|
|
|
|
|
+ i < validImages.size() - 1; // never expire latest image
|
|
|
# 546 "kind.ag"
|
|
# 546 "kind.ag"
|
|
|
- ++i)
|
|
|
|
|
|
|
+ ++i)
|
|
|
# 547 "kind.ag"
|
|
# 547 "kind.ag"
|
|
|
{
|
|
{
|
|
|
# 548 "kind.ag"
|
|
# 548 "kind.ag"
|
|
@@ -1179,15 +1179,15 @@ void usage()
|
|
|
exit(1);
|
|
exit(1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void error(const string &msg)
|
|
|
|
|
|
|
+void error(const string& msg)
|
|
|
{
|
|
{
|
|
|
cout << endl << ag_programName << " - error: " << msg << endl << endl;
|
|
cout << endl << ag_programName << " - error: " << msg << endl << endl;
|
|
|
usage();
|
|
usage();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-int ptoi(const char *para)
|
|
|
|
|
|
|
+int ptoi(const char* para)
|
|
|
{
|
|
{
|
|
|
- char *end;
|
|
|
|
|
|
|
+ char* end;
|
|
|
int res = strtol(para, &end, 10);
|
|
int res = strtol(para, &end, 10);
|
|
|
if (end == para)
|
|
if (end == para)
|
|
|
error(string("no int: ") + para);
|
|
error(string("no int: ") + para);
|
|
@@ -1196,9 +1196,9 @@ int ptoi(const char *para)
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-double ptod(const char *para)
|
|
|
|
|
|
|
+double ptod(const char* para)
|
|
|
{
|
|
{
|
|
|
- char *end;
|
|
|
|
|
|
|
+ char* end;
|
|
|
double res = strtod(para, &end);
|
|
double res = strtod(para, &end);
|
|
|
if (end == para)
|
|
if (end == para)
|
|
|
error(string("no double: ") + para);
|
|
error(string("no double: ") + para);
|
|
@@ -1207,15 +1207,15 @@ double ptod(const char *para)
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-int main(int argc, char **argv)
|
|
|
|
|
|
|
+int main(int argc, char** argv)
|
|
|
{
|
|
{
|
|
|
-bool fullImage = false;
|
|
|
|
|
-string masterConfig = "";
|
|
|
|
|
-bool backupOnly = false;
|
|
|
|
|
-bool expireOnly = false;
|
|
|
|
|
-bool listConfig = false;
|
|
|
|
|
|
|
+ bool fullImage = false;
|
|
|
|
|
+ string masterConfig = "";
|
|
|
|
|
+ bool backupOnly = false;
|
|
|
|
|
+ bool expireOnly = false;
|
|
|
|
|
+ bool listConfig = false;
|
|
|
|
|
|
|
|
-string vault = "";
|
|
|
|
|
|
|
+ string vault = "";
|
|
|
static struct option ag_long_options[] =
|
|
static struct option ag_long_options[] =
|
|
|
{
|
|
{
|
|
|
{"full", no_argument, 0, 'f' },
|
|
{"full", no_argument, 0, 'f' },
|
|
@@ -1244,44 +1244,44 @@ string vault = "";
|
|
|
error("Expecting option parameter");
|
|
error("Expecting option parameter");
|
|
|
break;
|
|
break;
|
|
|
case 'f':
|
|
case 'f':
|
|
|
- fullImage = true;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ fullImage = true;
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
case 'c':
|
|
case 'c':
|
|
|
- masterConfig = optarg;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ masterConfig = optarg;
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
case 'B':
|
|
case 'B':
|
|
|
- backupOnly = true;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ backupOnly = true;
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
case 'E':
|
|
case 'E':
|
|
|
- expireOnly = true;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ expireOnly = true;
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
case 'D':
|
|
case 'D':
|
|
|
- dryRun = true;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ dryRun = true;
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
case 'C':
|
|
case 'C':
|
|
|
- listConfig = true;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ listConfig = true;
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
case 'v':
|
|
case 'v':
|
|
|
- verbose = true;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ verbose = true;
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
case 'd':
|
|
case 'd':
|
|
|
- debug = true;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ debug = true;
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
case 'q':
|
|
case 'q':
|
|
|
- quiet = true;
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ quiet = true;
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
case 'h':
|
|
case 'h':
|
|
|
- usage();
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ usage();
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
default:
|
|
default:
|
|
|
error("error in options");
|
|
error("error in options");
|
|
@@ -1291,7 +1291,7 @@ string vault = "";
|
|
|
vault = argv[optind++];
|
|
vault = argv[optind++];
|
|
|
else error("Parameter vault_or_group needed");
|
|
else error("Parameter vault_or_group needed");
|
|
|
|
|
|
|
|
-/*AppGen:MainEnd*/
|
|
|
|
|
|
|
+ /*AppGen:MainEnd*/
|
|
|
# 578 "kind.ag"
|
|
# 578 "kind.ag"
|
|
|
|
|
|
|
|
# 579 "kind.ag"
|
|
# 579 "kind.ag"
|