1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-13 10:29:35 +01:00

Better checks for library metadata

See #1765
This commit is contained in:
Cristian Maglie 2014-03-16 12:44:30 +01:00
parent f50ec335fe
commit c192d689bc

View File

@ -65,7 +65,8 @@ public class Library {
// Compatibility with 1.5 rev.1 libraries:
// "email" field changed to "maintainer"
if (!properties.containsKey("maintainer"))
if (!properties.containsKey("maintainer") &&
properties.containsKey("email"))
properties.put("maintainer", properties.get("email"));
// Compatibility with 1.5 rev.1 libraries:
@ -121,8 +122,11 @@ public class Library {
String category = properties.get("category");
if (category == null)
category = "Uncategorized";
if (!CATEGORIES.contains(category))
if (!CATEGORIES.contains(category)) {
category = "Uncategorized";
System.out.println("WARNING: Category '" + category + "' in library " +
properties.get("name") + " is not valid. Setting to 'Uncategorized'");
}
String license = properties.get("license");
if (license == null)