[GRASS-SVN] r63226 - in grass/trunk: general/g.list general/g.remove general/g.rename lib/manage raster/r.reclass

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 28 01:30:10 PST 2014


Author: martinl
Date: 2014-11-28 01:30:10 -0800 (Fri, 28 Nov 2014)
New Revision: 63226

Modified:
   grass/trunk/general/g.list/main.c
   grass/trunk/general/g.remove/main.c
   grass/trunk/general/g.rename/main.c
   grass/trunk/lib/manage/do_copy.c
   grass/trunk/lib/manage/do_remove.c
   grass/trunk/lib/manage/do_rename.c
   grass/trunk/lib/manage/option.c
   grass/trunk/raster/r.reclass/reclass.c
Log:
fix managelib and modules to understand new element names


Modified: grass/trunk/general/g.list/main.c
===================================================================
--- grass/trunk/general/g.list/main.c	2014-11-28 09:19:18 UTC (rev 63225)
+++ grass/trunk/general/g.list/main.c	2014-11-28 09:30:10 UTC (rev 63226)
@@ -385,11 +385,11 @@
     if ((list = G__ls(path, &count)) == NULL)
 	return;
 
-    if (strcmp(alias, "rast") == 0)
+    if (strcmp(alias, "raster") == 0)
 	type = TYPE_RAST;
-    else if (strcmp(alias, "rast3d") == 0)
+    else if (strcmp(alias, "3draster") == 0)
 	type = TYPE_RAST3D;
-    else if (strcmp(alias, "vect") == 0)
+    else if (strcmp(alias, "vector") == 0)
 	type = TYPE_VECT;
     else
 	type = TYPE_OTHERS;

Modified: grass/trunk/general/g.remove/main.c
===================================================================
--- grass/trunk/general/g.remove/main.c	2014-11-28 09:19:18 UTC (rev 63225)
+++ grass/trunk/general/g.remove/main.c	2014-11-28 09:30:10 UTC (rev 63226)
@@ -235,7 +235,7 @@
 	if (access(path, 0) != 0)
 	    continue;
 
-	rast = !G_strcasecmp(elem->alias, "rast");
+	rast = !G_strcasecmp(elem->alias, "raster");
 	files = G__ls(path, &num_files);
 
 	for (j = 0; j < num_files; j++) {

Modified: grass/trunk/general/g.rename/main.c
===================================================================
--- grass/trunk/general/g.rename/main.c	2014-11-28 09:19:18 UTC (rev 63225)
+++ grass/trunk/general/g.rename/main.c	2014-11-28 09:30:10 UTC (rev 63226)
@@ -93,7 +93,7 @@
 		result = EXIT_FAILURE;
 	    }
 
-	    if (!renamed && strcmp(parm[n]->key, "rast") == 0 &&
+	    if (!renamed && strcmp(parm[n]->key, "raster") == 0 &&
 		Rast_is_reclassed_to(old, mapset, &nrmaps, &rmaps) > 0) {
 		int ptr, l;
 		char buf1[256], buf2[256], buf3[256], *str;

Modified: grass/trunk/lib/manage/do_copy.c
===================================================================
--- grass/trunk/lib/manage/do_copy.c	2014-11-28 09:19:18 UTC (rev 63225)
+++ grass/trunk/lib/manage/do_copy.c	2014-11-28 09:30:10 UTC (rev 63226)
@@ -34,7 +34,7 @@
 */
 int M_do_copy(int n, const char *old, const char *mapset, const char *new)
 {
-    int i, ret, len;
+    int i, ret;
     char path[GPATH_MAX], path2[GPATH_MAX];
     int result = 0;
 
@@ -43,10 +43,8 @@
     G_message(_("Copy %s <%s> to current mapset as <%s>"),
 	      list[n].maindesc, G_fully_qualified_name(old, mapset), new);
 
-    len = M__get_description_len(n);
-
     M__hold_signals(1);
-    if (G_strcasecmp(list[n].alias, "vect") == 0) {
+    if (G_strcasecmp(list[n].alias, "vector") == 0) {
 	ret = Vect_copy(old, mapset, new);
 	if (ret == -1) {
 	    G_warning(_("Unable to copy <%s> to current mapset as <%s>"),

Modified: grass/trunk/lib/manage/do_remove.c
===================================================================
--- grass/trunk/lib/manage/do_remove.c	2014-11-28 09:19:18 UTC (rev 63225)
+++ grass/trunk/lib/manage/do_remove.c	2014-11-28 09:30:10 UTC (rev 63226)
@@ -52,7 +52,7 @@
 	old = xname;
     }
 
-    if (G_strcasecmp(list[n].alias, "vect") == 0) {
+    if (G_strcasecmp(list[n].alias, "vector") == 0) {
 	if ((mapset = G_find_vector2(old, "")) == NULL) {
 	    G_warning(_("Vector map <%s> not found"), old);
 	}
@@ -68,12 +68,12 @@
 	}
     }
     else {
-	if (G_strcasecmp(list[n].alias, "rast") == 0) {
+	if (G_strcasecmp(list[n].alias, "raster") == 0) {
 	    if ((mapset = G_find_raster2(old, "")) == NULL)
 		G_warning(_("Raster map <%s> not found"), old);
 	}
 
-	if (G_strcasecmp(list[n].alias, "rast3d") == 0) {
+	if (G_strcasecmp(list[n].alias, "3draster") == 0) {
 	    if ((mapset = G_find_raster3d(old, "")) == NULL)
 		G_warning(_("3D raster map <%s> not found"), old);
 	}

Modified: grass/trunk/lib/manage/do_rename.c
===================================================================
--- grass/trunk/lib/manage/do_rename.c	2014-11-28 09:19:18 UTC (rev 63225)
+++ grass/trunk/lib/manage/do_rename.c	2014-11-28 09:30:10 UTC (rev 63226)
@@ -49,7 +49,7 @@
 
     M__hold_signals(1);
 
-    if (G_strcasecmp(list[n].alias, "vect") == 0) {
+    if (G_strcasecmp(list[n].alias, "vector") == 0) {
 	if ((mapset = G_find_vector2(old, "")) == NULL) {
 	    G_warning(_("Vector map <%s> not found"), old);
 	}
@@ -66,12 +66,12 @@
 	}
     }
     else {
-	if (G_strcasecmp(list[n].alias, "rast") == 0) {
+	if (G_strcasecmp(list[n].alias, "raster") == 0) {
 	    if ((mapset = G_find_raster2(old, "")) == NULL)
 		G_warning(_("Raster map <%s> not found"), old);
 	}
 
-	if (G_strcasecmp(list[n].alias, "rast3d") == 0) {
+	if (G_strcasecmp(list[n].alias, "3draster") == 0) {
 	    if ((mapset = G_find_raster3d(old, "")) == NULL)
 		G_warning(_("3D raster map <%s> not found"), old);
 	}

Modified: grass/trunk/lib/manage/option.c
===================================================================
--- grass/trunk/lib/manage/option.c	2014-11-28 09:19:18 UTC (rev 63225)
+++ grass/trunk/lib/manage/option.c	2014-11-28 09:30:10 UTC (rev 63226)
@@ -47,10 +47,11 @@
     G_asprintf(&str, _("%s to be %s"),
 	       list[n].text, desc);
     p->description = str;
-    if (strcmp(p->key, "rast") == 0 || strcmp(p->key, "rast3d") == 0)
+    if (strcmp(p->key, "raster") == 0 || strcmp(p->key, "3draster") == 0)
 	p->guisection = _("Raster");
-    else if (strcmp(p->key, "vect") == 0 || strcmp(p->key, "oldvect") == 0 ||
-	     strcmp(p->key, "asciivect") == 0)
+    else if (strcmp(p->key, "vector") == 0 ||
+             strcmp(p->key, "oldvector") == 0 ||
+	     strcmp(p->key, "asciivector") == 0)
 	p->guisection = _("Vector");
     else if (strcmp(p->key, "region") == 0 || strcmp(p->key, "region3d") == 0)
 	p->guisection = _("Region");

Modified: grass/trunk/raster/r.reclass/reclass.c
===================================================================
--- grass/trunk/raster/r.reclass/reclass.c	2014-11-28 09:19:18 UTC (rev 63225)
+++ grass/trunk/raster/r.reclass/reclass.c	2014-11-28 09:30:10 UTC (rev 63226)
@@ -230,7 +230,7 @@
     if (G_find_file2("cell", new_name, G_mapset()) &&
 	Rast_map_type(new_name, G_mapset()) != CELL_TYPE) {
 	M_read_list(FALSE, NULL);
-        if (M_do_remove(M_get_element("rast"), new_name) == 1)
+        if (M_do_remove(M_get_element("raster"), new_name) == 1)
 	    G_fatal_error(_("Cannot overwrite existing raster map <%s>"),
 			  new_name);
     }



More information about the grass-commit mailing list