Wolfgang Ortmann 9 жил өмнө
parent
commit
511e129a53
3 өөрчлөгдсөн 44 нэмэгдсэн , 44 устгасан
  1. BIN
      bin/kind
  2. 4 4
      src/expiretools.cpp
  3. 40 40
      src/kind.cpp

BIN
bin/kind


+ 4 - 4
src/expiretools.cpp

@@ -104,13 +104,13 @@ DateTime getExpireDate(const DateTime& imageTime, const KindConfig& conf, string
       parseRule(expireRules[k], M, D, W, h, expirePeriod);
 #if 0
       cout << expireRules[k] << endl;
-      for (auto v:M) cout << v << " ";
+      for (auto v : M) cout << v << " ";
       cout << endl;
-      for (auto v:D) cout << v << " ";
+      for (auto v : D) cout << v << " ";
       cout << endl;
-      for (auto v:W) cout << v << " ";
+      for (auto v : W) cout << v << " ";
       cout << endl;
-      for (auto v:h) cout << v << " ";
+      for (auto v : h) cout << v << " ";
       cout << endl;
       cout << imageTime.getString('m') << endl;
 #endif

+ 40 - 40
src/kind.cpp

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