Skip to content

Commit

Permalink
implement blacklisting of -dev packages
Browse files Browse the repository at this point in the history
e.g. if libcurl3 is in the package list, elbe decides to install
libcurl-openssl-dev and libcurl-gnutls-dev into the sysroot. But
the packages are conflicting, so generating the sysroot crashes.

This patch extends the XML format for blacklisting -dev packages
for the sysroot.

Signed-off-by: Manuel Traut <manut@linutronix.de>
  • Loading branch information
Manuel Traut committed Apr 12, 2016
1 parent a429fc1 commit 0d40931
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
31 changes: 31 additions & 0 deletions elbepack/dbsfed.xsd
Expand Up @@ -774,6 +774,13 @@
</documentation> </documentation>
</annotation> </annotation>
</element> </element>
<element name="pkg-blacklist" type="rfs:blacklist" minOccurs="0" maxOccurs="1">
<annotation>
<documentation>
avoid installation of packages into sysroot or target
</documentation>
</annotation>
</element>
</sequence> </sequence>
</complexType> </complexType>


Expand Down Expand Up @@ -1747,6 +1754,30 @@
</sequence> </sequence>
</complexType> </complexType>


<complexType name="blacklist">
<annotation>
<documentation>
blacklists of debian packages
</documentation>
</annotation>
<sequence>
<element name="sysroot" type="rfs:pkg-list" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>
avoid installing the specified packages into the sysroot
</documentation>
</annotation>
</element>
<element name="target" type="rfs:pkg-list" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>
avoid installing the specified packages into the target
</documentation>
</annotation>
</element>
</sequence>
</complexType>

<complexType name="fullpkg-list"> <complexType name="fullpkg-list">
<annotation> <annotation>
<documentation> <documentation>
Expand Down
8 changes: 6 additions & 2 deletions elbepack/elbeproject.py
Expand Up @@ -130,11 +130,15 @@ def build_chroottarball (self):


def build_sysroot (self): def build_sysroot (self):


debootstrap_pkgs = [p.et.text for p in self.xml.node ("debootstrappkgs")] # ignore packages from debootstrap
ignore_pkgs = [p.et.text for p in self.xml.node ("debootstrappkgs")]
ignore_dev_pkgs = []
if self.xml.has ('target/pkg-blacklist/sysroot'):
ignore_dev_pkgs = [p.et.text for p in self.xml.node ("target/pkg-blacklist/sysroot")]


with self.buildenv: with self.buildenv:
try: try:
self.get_rpcaptcache().mark_install_devpkgs(debootstrap_pkgs) self.get_rpcaptcache().mark_install_devpkgs(ignore_pkgs, ignore_dev_pkgs)
except SystemError as e: except SystemError as e:
self.log.printo( "mark install devpkgs failed: %s" % str(e) ) self.log.printo( "mark install devpkgs failed: %s" % str(e) )
try: try:
Expand Down
5 changes: 3 additions & 2 deletions elbepack/rpcaptcache.py
Expand Up @@ -92,7 +92,7 @@ def mark_install( self, pkgname, version, from_user=True, nodeps=False ):
auto_inst = not nodeps, auto_inst = not nodeps,
from_user = from_user ) from_user = from_user )


def mark_install_devpkgs( self, ignore_pkgs ): def mark_install_devpkgs( self, ignore_pkgs, ignore_dev_pkgs ):
ignore_pkgs.remove ('libc6') # we don't want to ignore libc ignore_pkgs.remove ('libc6') # we don't want to ignore libc
# we don't want to ignore libstdc++ # we don't want to ignore libstdc++
try: try:
Expand All @@ -111,7 +111,8 @@ def mark_install_devpkgs( self, ignore_pkgs ):
# '-dev' package # '-dev' package
dev_list = [s for s in self.cache if (s.candidate.source_name in src_list and s.name.endswith ('-dev'))] dev_list = [s for s in self.cache if (s.candidate.source_name in src_list and s.name.endswith ('-dev'))]
for p in dev_list: for p in dev_list:
p.mark_install () if p.name not in ignore_dev_pkgs:
p.mark_install ()
# ensure that the symlinks package will be installed (it's needed for # ensure that the symlinks package will be installed (it's needed for
# fixing links inside the sysroot # fixing links inside the sysroot
self.cache ['symlinks'].mark_install () self.cache ['symlinks'].mark_install ()
Expand Down
6 changes: 6 additions & 0 deletions examples/x86_32-pc-hdimg-minimal-grub-wheezy.xml
Expand Up @@ -43,6 +43,12 @@
<pkg-list> <pkg-list>
<pkg>linux-image-686-pae</pkg> <pkg>linux-image-686-pae</pkg>
<pkg>grub-pc</pkg> <pkg>grub-pc</pkg>
<pkg>libcurl3</pkg>
</pkg-list> </pkg-list>
<pkg-blacklist>
<sysroot>
<pkg>libcurl4-openssl-dev</pkg>
</sysroot>
</pkg-blacklist>
</target> </target>
</ns0:RootFileSystem> </ns0:RootFileSystem>

0 comments on commit 0d40931

Please sign in to comment.