#! /bin/sh /usr/share/dpatch/dpatch-run ## 20-homedir.dpatch by Andreas Putzo ## ## DP: Do not overwrite ~/.gpsdrive/osm.xml when gpsdrive is started. @DPATCH@ diff -urNad gpsdrive-2.10~pre4~/src/mapnik.cpp gpsdrive-2.10~pre4/src/mapnik.cpp --- gpsdrive-2.10~pre4~/src/mapnik.cpp 2007-09-17 07:48:41.000000000 +0000 +++ gpsdrive-2.10~pre4/src/mapnik.cpp 2007-09-17 07:50:02.000000000 +0000 @@ -165,20 +165,21 @@ } // load files - - ifstream InputXML (mapnik_config_file.c_str()); - ofstream DestXML (Dest); + if ( ! boost:: filesystem::exists(Dest) ) { + ifstream InputXML (mapnik_config_file.c_str()); + ofstream DestXML (Dest); - if (InputXML && DestXML) { - if (InputXML.is_open()) { - string s ; - while (getline(InputXML, s)) { - DestXML << ReplaceString("@USER@", Username, s) << endl; - } - } - } - InputXML.close(); - DestXML.close(); + if (InputXML && DestXML) { + if (InputXML.is_open()) { + string s ; + while (getline(InputXML, s)) { + DestXML << ReplaceString("@USER@", Username, s) << endl; + } + } + } + InputXML.close(); + DestXML.close(); + } return -1; }