--- a/nbbuild/antsrc/org/netbeans/nbbuild/MakeUpdateDesc.java Mon Mar 02 15:11:25 2009 -0500 +++ a/nbbuild/antsrc/org/netbeans/nbbuild/MakeUpdateDesc.java Tue Mar 03 18:13:38 2009 +0300 @@ -51,6 +51,7 @@ import org.apache.tools.ant.DirectoryScanner; import java.io.File; import java.io.FileOutputStream; +import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -317,7 +318,25 @@ pw.println (); Map licenses = new HashMap(); Set licenseNames = new HashSet(); - + + String prefix = null; + if (dist_base != null) { + // fix/enforce distribution URL base + if (dist_base.equals(".")) { + prefix = ""; + } else { + prefix = dist_base + "/"; + } + } + final File licensesDir = new File(desc.getParentFile(), "licenses"); + if(licensesDir.exists()) { + for(File f : licensesDir.listFiles()) { + f.delete(); + } + } else { + licensesDir.mkdir(); + } + for (Map.Entry> entry : modulesByGroup.entrySet()) { String groupName = entry.getKey(); // Don't indent; embedded descriptions would get indented otherwise. @@ -335,20 +354,24 @@ String name = manifest.getAttribute("OpenIDE-Module-Name"); if (name.length() > 0) { log(" Adding module " + name + " (" + m.nbm.getAbsolutePath() + ")"); - } - if (dist_base != null) { - // fix/enforce distribution URL base - String prefix; - if (dist_base.equals(".")) { - prefix = ""; - } else { - prefix = dist_base + "/"; - } + } + if(prefix!=null) { module.setAttribute("distribution", prefix + m.relativePath); } NodeList licenseList = module.getElementsByTagName("license"); if (licenseList.getLength() > 0) { Element license = (Element) licenseList.item(0); + String relativePath = "licenses/" + license.getAttribute("name") + ".license"; + String path = relativePath; + if(prefix!=null) { + path = prefix + relativePath; + } + license.setAttribute("url", path); + String licenseText = license.getTextContent(); + license.setTextContent(""); + FileWriter fw = new FileWriter(new File(desc.getParentFile(), relativePath)); + fw.write(licenseText); + fw.close(); // XXX ideally would compare the license texts to make sure they actually match up licenses.put(license.getAttribute("name"), license); module.removeChild(license);