Browse Source

Better check of R packages: checked all in once, raising only one error message.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@44503 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anne Ghisla 14 years ago
parent
commit
a38781b495
1 changed files with 6 additions and 3 deletions
  1. 6 3
      scripts/v.krige/v.krige.py

+ 6 - 3
scripts/v.krige/v.krige.py

@@ -408,11 +408,14 @@ def importR():
         if not haveRpy2:
             sys.exit(1)
         
-    # R packages check.
-    # @FIXME: it leaves a Rtmpxxxx folder into the make tempfolder and causes make complain. [markus]
+    # R packages check. Will create one error message after check of all packages.
+    missingPackagesList = []
     for each in ["gstat", "spgrass6", "maptools"]:
         if not robjects.r.require(each, quietly = True)[0]:
-            sys.exit(_("R package '%s' is missing. Install it and re-run v.krige.") % each)
+            missingPackagesList.append(each)
+    if missingPackagesList:
+        errorString = "R package(s) " + " ".join(["%s" % e for e in missingPackagesList] +  "missing. Install it/them and re-run v.krige.")
+        sys.exit(_(errorString))
     
 if __name__ == '__main__':
     if len(sys.argv) > 1: