Commit 32d68275 authored by Jonathan Riddell's avatar Jonathan Riddell 🛶

prepand new versions instead of append cos now appstream wants that

parent de7408b0
......@@ -50,17 +50,18 @@ class MetaInfoUpdater
component = @doc.at_css("component")
releases = @doc.at_css("releases")
if releases and @date_off
releases.add_child("<release version='#{@version}'/>")
releases.prepend_child("<release version='#{@version}'/>")
elsif not releases and @date_off
component.add_child("<releases><release version='#{@version}'/></releases>")
elsif releases and not @date_off
releases.add_child("<release version='#{@version}' date='#{date}'/>")
releases.prepend_child("<release version='#{@version}' date='#{date}'/>")
else
component.add_child("<releases><release version='#{@version}' date='#{date}'/></releases>")
end
if releases and @releases_to_show > 0
if releases.children.length > @releases_to_show
releases.children = releases.children[-@releases_to_show,@releases_to_show]
#releases.children = releases.children[-@releases_to_show,@releases_to_show]
releases.children = releases.children[0,@releases_to_show]
end
end
end
......
......@@ -21,10 +21,10 @@
<binary>cuttlefish</binary>
</provides>
<releases>
<release version="1.0" date="2019-03-20"/>
<release version="2.0" date="2019-03-21"/>
<release version="3.0" date="2019-03-22"/>
<release version="5.0" date="2019-04-01"/>
<release version="4.0" date="2019-03-23"/>
<release version="5.0" date="2018-01-01"/>
<release version="3.0" date="2019-03-22"/>
<release version="2.0" date="2019-03-21"/>
<release version="1.0" date="2019-03-20"/>
</releases>
</component>
......@@ -21,9 +21,9 @@
<binary>cuttlefish</binary>
</provides>
<releases>
<release version="3.0" date="2019-03-22"/>
<release version="4.0" date="2019-03-23"/>
<release version="5.0" date="2018-01-01"/>
<release version="6.0" date="2018-01-01"/>
<release version="5.0" date="2019-04-01"/>
<release version="4.0" date="2019-03-23"/>
<release version="3.0" date="2019-03-22"/>
</releases>
</component>
......@@ -21,7 +21,7 @@
<binary>cuttlefish</binary>
</provides>
<releases>
<release version="1.0" date="2019-03-20"/>
<release version="2.0" date="2018-01-01"/>
<release version="1.0" date="2019-03-20"/>
</releases>
</component>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment