-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qitoolchain: Add sub package feed parsing.
In the toolchain xml file, a 'package' tag contained in an other 'package' tag is not taken into account. This patch adds a feature that look for 'package' tags inside 'package' tags. Now, this kind of xml file is valid: <toolchain strict_metadata="false"> <package name="meta-package" ...> <package name="sub-pkg1" version="..."/> <package name="sub-pkg2" version="..."/> <package name="sub-pkg3" version="..."/> </package> </toolchain> This is needed when a package (eg. yocto-sdk) provides several sub-packages that need to appear as qitoolchain packages. The xml sub package tag should not contain 'directory' or 'url' attributes as 'directory' attribute will be set to the parent package 'directory' attribute. Change-Id: Ib7b1f22a065c30c9d9616383fbd7629f73b051e2 Reviewed-on: http://gerrit.aldebaran.lan/79917 Reviewed-by: nrubinstein <[email protected]> Tested-by: plemagourou <[email protected]>
- Loading branch information
1 parent
1c26e5a
commit c8f4c4e
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
v3.11.13 | ||
======== | ||
|
||
qitoolchain | ||
----------- | ||
|
||
* In the toolchain xml file, a 'package' tag can now contain other 'package' tags:: | ||
|
||
<toolchain strict_metadata="false"> | ||
<package name="meta-package" ...> | ||
<package name="sub-pkg1" version="..."/> | ||
<package name="sub-pkg2" version="..."/> | ||
<package name="sub-pkg3" version="..."/> | ||
</package> | ||
</toolchain> | ||
|
||
This is needed when a package (eg. yocto-sdk) provides several | ||
sub-packages that need to appear as qitoolchain packages. | ||
|
||
The xml sub package tag should not contain 'directory' or 'url' | ||
attributes as 'directory' attribute will be set to the parent package | ||
'directory' attribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
|
||
import qisys | ||
import qitoolchain.toolchain | ||
|
||
def test_subpackage_parsing(tmpdir): | ||
tmp = tmpdir.mkdir("feed") | ||
subpackage_xml = tmp.join("subpackage.xml") | ||
subpackage_xml.write(""" | ||
<toolchain> | ||
<package name="rootpkg" directory="." version="1.0"> | ||
<package name="subpkg1" version="2.3"/> | ||
<package name="subpkg2" version="0.2"/> | ||
</package> | ||
</toolchain>""") | ||
parser = qitoolchain.feed.ToolchainFeedParser("test_subpackage") | ||
parser.parse(subpackage_xml.strpath) | ||
pkgs = parser.get_packages() | ||
|
||
toolchain_path = qisys.sh.get_share_path("qi", "toolchains", parser.name, "rootpkg") | ||
assert len(pkgs)== 3 | ||
assert pkgs[0].name == "rootpkg" | ||
assert pkgs[1].name == "subpkg1" | ||
assert pkgs[2].name == "subpkg2" | ||
assert pkgs[1].directory == toolchain_path | ||
assert pkgs[2].directory == toolchain_path | ||
|