I wonder if we should have somethign like..
<package>
<shortname>firefox</shortname>
<release-date>whatever</release-date?
</package>
Or more tighter..
<package shortname="firefox" released="somedate"/>
Or just <package released="somedate">firefox</package>
Pick one and I'll go with it.
jeff
<package name="firefox" released="somedate"/>
Why short?
And I don't care about the released field; I won't be using it because it just isn't worth it (for me) so do as you wish with that.
EDIT: oh and my current PXML extraction algorithm currently works about the same way as the libpnd one, except that I limit the seek range to 32kb (because I just don't want to have the server hung for 1 minute crunching through a 100mb PND file) but we really need to find something sustainable that cannot be exploited...
The code for those who are interested; sorry for the lack of comments and the chaos:
CODE
def getPXMLFromPND(pnd: Array[Byte]): NodeSeq = try {
val reversed = pnd.projection.reverse //don't actually create new arrays here, just use a projection
val reversedStartPattern = "<PXML".getBytes.reverse
val endString = "</PXML>"
def cutEnd(pxml: String): String = {
val parts = pxml.split(endString)
if(parts.length >= 2 || (pxml endsWith "</PXML>"))
parts(0) + endString
else error("Could not find end of PXML file")
}
//yeah, yeah, this is more CPU intensive than it has to be... I don't care, it's concise
val candidates = for {
i <- 0 until Math.min(reversed.length, 32 * 1024).toInt //scan max 32 kb backwards
candidate = reversed take i
if(candidate endsWith reversedStartPattern)
} yield candidate
val uncutPXML = new String(candidates.last.reverse)
XML.loadString(cutEnd(uncutPXML))
} catch { case _ => NodeSeq.Empty }