459273 - Redundant license notices

+ Only showing license acknowledgement request screen
  if [FILES] section contains content that does not (yet) exist
This commit is contained in:
Joakim Erdfelt 2015-02-23 16:49:07 -07:00
parent 3e7b5f0fa9
commit 2141cc2dc3
2 changed files with 16 additions and 3 deletions

View File

@ -407,7 +407,7 @@ public class Main
if (!args.isApproveAllLicenses())
{
if (!module.acknowledgeLicense())
if (!module.hasFiles(baseHome) && !module.acknowledgeLicense())
{
StartLog.warn(EXITING_LICENSE_NOT_ACKNOWLEDGED);
System.exit(1);

View File

@ -279,7 +279,7 @@ public class Module
{
return true;
}
System.err.printf("%nModule %s:%n",getName());
System.err.printf(" + contains software not provided by the Eclipse Foundation!%n");
System.err.printf(" + contains software not covered by the Eclipse Public License!%n");
@ -361,6 +361,20 @@ public class Module
return enabled;
}
public boolean hasFiles(BaseHome baseHome)
{
for (String ref : getFiles())
{
FileArg farg = new FileArg(this,ref);
Path refPath = baseHome.getBasePath(farg.location);
if (!Files.exists(refPath))
{
return false;
}
}
return true;
}
public void process(BaseHome basehome) throws FileNotFoundException, IOException
{
Pattern section = Pattern.compile("\\s*\\[([^]]*)\\]\\s*");
@ -477,5 +491,4 @@ public class Module
str.append(']');
return str.toString();
}
}