|
@@ -13,6 +13,8 @@
|
|
|
|
|
|
#include <string.h>
|
|
|
#include <grass/imagery.h>
|
|
|
+#include <grass/gis.h>
|
|
|
+#include <grass/glocale.h>
|
|
|
|
|
|
/*!
|
|
|
\brief Create signature file
|
|
@@ -37,6 +39,13 @@ FILE *I_fopen_signature_file_new(const char *group,
|
|
|
|
|
|
/* create sigset directory */
|
|
|
sprintf(element, "%s/subgroup/%s/sig", group_name, subgroup);
|
|
|
+ if (G_getenv_nofatal("OVERWRITE")) {
|
|
|
+ if (G_find_file_misc("group", element, group_name, G_mapset())) {
|
|
|
+ G_fatal_error(_("Signature file for group '%s', subgroup '%s' exists."
|
|
|
+ " To overwrite, use the --overwrite flag"), group_name, subgroup);
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+ }
|
|
|
G__make_mapset_element_misc("group", element);
|
|
|
|
|
|
sprintf(element, "subgroup/%s/sig/%s", subgroup, name);
|