]> git.mxchange.org Git - flightgear.git/blobdiff - utils/TerraSync/terrasync.cxx
add a header eference for bzero()
[flightgear.git] / utils / TerraSync / terrasync.cxx
index 60d875faa4f02cb2c10d3532b496b441414c11cc..c5b648e516defe45c083f7a87bbde137a058d7dc 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Written by Curtis Olson, started November 2002.
 //
-// Copyright (C) 2002  Curtis L. Olson  - curt@flightgear.org
+// Copyright (C) 2002  Curtis L. Olson  - http://www.flightgear.org/~curt
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
@@ -38,7 +38,7 @@ SG_USING_STD(cout);
 SG_USING_STD(endl);
 
 static string server = "scenery.flightgear.org";
-static string source_module = "Scenery-0.9.5";
+static string source_module = "Scenery";
 static string source_base = server + (string)"::" + source_module;
 static string dest_base = "/dest/scenery/dir";
 
@@ -131,17 +131,34 @@ static void sync_area( int lat, int lon ) {
     }
 
     char command[512];
-
-    // make container directory
     char container_dir[512];
-    snprintf( container_dir, 512, "%s/%c%03d%c%02d",
+    char dir[512];
+
+    // Sync Terrain
+    snprintf( container_dir, 512, "%s/Terrain/%c%03d%c%02d",
               dest_base.c_str(), EW, abs(baselon), NS, abs(baselat) );
     snprintf( command, 512, "mkdir -p %s", container_dir );
     cout << command << endl;
     system( command );
 
-    char dir[512];
-    snprintf( dir, 512, "%c%03d%c%02d/%c%03d%c%02d",
+    snprintf( dir, 512, "Terrain/%c%03d%c%02d/%c%03d%c%02d",
+              EW, abs(baselon), NS, abs(baselat),
+              EW, abs(lon), NS, abs(lat) );
+
+    snprintf( command, 512,
+              "rsync --verbose --archive --delete --perms --owner --group %s/%s/ %s/%s",
+              source_base.c_str(), dir, dest_base.c_str(), dir );
+    cout << command << endl;
+    system( command );
+
+    // Sync Objects
+    snprintf( container_dir, 512, "%s/Objects/%c%03d%c%02d",
+              dest_base.c_str(), EW, abs(baselon), NS, abs(baselat) );
+    snprintf( command, 512, "mkdir -p %s", container_dir );
+    cout << command << endl;
+    system( command );
+
+    snprintf( dir, 512, "Objects/%c%03d%c%02d/%c%03d%c%02d",
               EW, abs(baselon), NS, abs(baselat),
               EW, abs(lon), NS, abs(lat) );