[Simple-cdd-devel] Dependency resolution
Enrico Zini
enrico at enricozini.org
Thu Jan 22 23:24:25 UTC 2015
Hello,
while investigating depdendency resolution, I studied dose-debcheck a
bit better and found that it can work as a dependency resolver:
dose-debcheck --successes --explain --coinst="mutt,iceweasel" tmp/mirror/lists/*_Packages
It outputs YAML which can be parsed easily from python:
#!/usr/bin/env python3
import sys
import subprocess
import yaml
import glob
import os
import shlex
#packagesdir = "/var/lib/apt/lists/"
packagesdir = "tmp/mirror/lists/"
# Packages files for our source distributions
packages = [x for x in glob.glob(os.path.join(packagesdir, "*Packages")) if os.stat(x).st_size > 0]
print("Packages files:")
for p in packages:
print(" ", p)
# Run dose-debcheck
cmd = ["dose-debcheck", "--successes", "--failures", "--explain"]
cmd.append("--coinst=" + ",".join(sys.argv[1:]))
cmd.extend(packages)
print("Running:", " ".join(shlex.quote(x) for x in cmd))
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
res = proc.wait()
if res != 0:
print("dose-debcheck failed:", file=sys.stderr)
print(stderr, file=sys.stderr)
sys.exit(res)
# Parse its output and print it out
parsed = yaml.load(stdout)
try:
for report in parsed["report"]:
print("Status:", report["status"])
print("Selected:", report["coinst"])
for entry in report["installationset"]:
print(" ", entry["package"], entry["version"], entry["architecture"])
except:
print("dose-debcheck output:")
print(stdout)
raise
And here is the output: in one shot we can know if all wanted packages
are installable, or even coinstallable, and what are all their
dependencies:
$ ./print-deps 0ad mutt
Packages files:
tmp/mirror/lists/default_jessie_main_amd64_Packages
tmp/mirror/lists/default-udebs_jessie_main_amd64_uPackages
tmp/mirror/lists/default-base_jessie_main_amd64_Packages
Running: dose-debcheck --successes --failures --explain --coinst=0ad,mutt tmp/mirror/lists/default_jessie_main_amd64_Packages tmp/mirror/lists/default-udebs_jessie_main_amd64_uPackages tmp/mirror/lists/default-base_jessie_main_amd64_Packages
Status: ok
Selected: 0ad (= 0.0.17-1) , mutt (= 1.5.23-3)
0ad-data-common 0.0.17-1 all
libssh2-1 1.4.3-4 amd64
libgpgme11 1.5.1-6 amd64
libustr-1.0-1 1.0.4-3+b2 amd64
libpam0g 1.1.8-3.1 amd64
libfreetype6 2.5.2-2 amd64
libxdmcp6 1:1.1.1-1+b1 amd64
libopenal-data 1:1.15.1-5 all
libxml2 2.9.1+dfsg1-4 amd64
libxcb-shm0 1.10-3+b1 amd64
libgssapi-krb5-2 1.12.1+dfsg-16 amd64
libjpeg62-turbo 1:1.3.1-11 amd64
0ad 0.0.17-1 amd64
libksba8 1.3.2-1 amd64
libreadline6 6.3-8+b3 amd64
libgcrypt20 1.6.2-4+b1 amd64
libice6 2:1.0.9-1+b1 amd64
libx11-xcb1 2:1.6.2-3 amd64
shared-mime-info 1.3-1 amd64
libasound2-data 1.0.28-1 all
libcomerr2 1.42.12-1 amd64
zlib1g 1:1.2.8.dfsg-2+b1 amd64
libsystemd0 215-8 amd64
zlib1g-udeb 1:1.2.8.dfsg-2+b1 amd64
libjbig0 2.1-3.1 amd64
libthai-data 0.1.21-1 all
libatk1.0-0 2.14.0-1 amd64
libnvtt2 2.0.8-1+dfsg-5+b1 amd64
libxcomposite1 1:0.4.4-1 amd64
libdbus-1-3 1.8.12-3 amd64
fontconfig 2.11.0-6.3 amd64
libgraphite2-3 1.2.4-3 amd64
libcap2 1:2.24-6 amd64
libcups2 1.7.5-10 amd64
debianutils 4.4+b1 amd64
librtmp1 2.4+20131018.git79459a2-5 amd64
libboost-system1.55.0 1.55.0+dfsg-3 amd64
libgtk2.0-common 2.24.25-1 all
libthai0 0.1.21-1 amd64
tex-gyre 20140520-1 all
libjson-c2 0.11-4 amd64
libasound2 1.0.28-1 amd64
libuuid1 2.25.2-4 amd64
libflac8 1.3.0-3 amd64
libgmp10 2:6.0.0+dfsg-6 amd64
libpng12-0 1.2.50-2+b2 amd64
libdatrie1 0.2.8-1 amd64
libxxf86vm1 1:1.1.3-1+b1 amd64
libattr1 1:2.4.47-2 amd64
libcairo2 1.14.0-2.1 amd64
tar 1.27.1-2+b1 amd64
libopenexr6 1.6.1-8 amd64
libc6-udeb 2.19-13 amd64
tex-common 5.03 all
libcurl3-gnutls 7.38.0-4 amd64
x11-common 1:7.7+7 all
libxdamage1 1:1.1.4-2+b1 amd64
libp11-kit0 0.20.7-1 amd64
libatk1.0-data 2.14.0-1 all
libsndfile1 1.0.25-9+b1 amd64
fonts-dejavu-core 2.34-1 all
gnupg-agent 2.0.26-4 amd64
libdirectfb-1.2-9-udeb 1.2.10.0-5.1 amd64
libaudit-common 1:2.4-1 all
libfreetype6-udeb 2.5.2-2 amd64
libkeyutils1 1.5.9-5+b1 amd64
libicu52 52.1-6 amd64
libsemanage-common 2.3-1 all
libsasl2-modules-db 2.1.26.dfsg1-12 amd64
gnupg2 2.0.26-4 amd64
libwxgtk3.0-0 3.0.2-1+b1 amd64
libvorbisenc2 1.3.4-2 amd64
libselinux1 2.3-2 amd64
libenet7 1.3.12+ds-2 amd64
coreutils 8.23-3 amd64
libxrandr2 2:1.4.2-1+b1 amd64
libasyncns0 0.8-5 amd64
mew-beta-bin 7.0.50~6.6+0.20140902-1 amd64
libhogweed2 2.7.1-5 amd64
libxrender1 1:0.9.8-1+b1 amd64
libsm6 2:1.2.2-1+b1 amd64
libglapi-mesa 10.3.2-1 amd64
fonts-freefont-ttf 20120503-4 all
libassuan0 2.1.2-2 amd64
libgdk-pixbuf2.0-common 2.31.1-2 all
libc6 2.19-13 amd64
sensible-utils 0.0.9 all
libavahi-common-data 0.6.31-4+b2 amd64
ucf 3.003 all
libvorbis0a 1.3.4-2 amd64
libxfixes3 1:5.0.1-2+b2 amd64
libsasl2-2 2.1.26.dfsg1-12 amd64
libogg0 1.3.2-1 amd64
libavahi-common3 0.6.31-4+b2 amd64
libxcursor1 1:1.1.14-1+b1 amd64
perl-base 5.20.1-4 amd64
gcc-4.9-base 4.9.1-19 amd64
libtinfo5 5.9+20140913-1+b1 amd64
libgpg-error0 1.17-3 amd64
mutt 1.5.23-3 amd64
libpulse0 5.0-13 amd64
libexpat1 2.1.0-6+b3 amd64
libsemanage1 2.3-1+b1 amd64
libdb5.3 5.3.28-7~deb8u1 amd64
libsdl1.2debian 1.2.15-10+b1 amd64
dpkg 1.17.23 amd64
libkrb5support0 1.12.1+dfsg-16 amd64
readline-common 6.3-8 all
libxi6 2:1.7.4-1+b2 amd64
libpth20 2.0.7-20 amd64
libfontconfig1 2.11.0-6.3 amd64
libxau6 1:1.0.8-1 amd64
libminiupnpc10 1.9.20140610-2 amd64
fontconfig-config 2.11.0-6.3 all
liblzma5 5.1.1alpha+20120614-2+b3 amd64
libaudit1 1:2.4-1+b1 amd64
libx11-data 2:1.6.2-3 all
libpng12-0-udeb 1.2.50-2+b2 amd64
debconf 1.5.55 all
libcaca0 0.99.beta19-2 amd64
multiarch-support 2.19-13 amd64
libsepol1 2.3-2 amd64
libgnutls-deb0-28 3.3.8-5 amd64
libpam-modules 1.1.8-3.1 amd64
libpango-1.0-0 1.36.8-3 amd64
libpangoft2-1.0-0 1.36.8-3 amd64
libtokyocabinet9 1.4.48-3 amd64
libpam-modules-bin 1.1.8-3.1 amd64
libboost-filesystem1.55.0 1.55.0+dfsg-3 amd64
libavahi-client3 0.6.31-4+b2 amd64
libpangocairo-1.0-0 1.36.8-3 amd64
libgdk-pixbuf2.0-0 2.31.1-2+b1 amd64
0ad-data 0.0.17-1 all
libvorbisfile3 1.3.4-2 amd64
lsb-base 4.1+Debian13+nmu1 all
libxinerama1 2:1.1.3-1+b1 amd64
libbz2-1.0 1.0.6-7+b2 amd64
libncursesw5 5.9+20140913-1+b1 amd64
libgcc1 1:4.9.1-19 amd64
libglib2.0-0 2.42.1-1 amd64
libtiff5 4.0.3-12 amd64
libharfbuzz0b 0.9.35-2 amd64
libxext6 2:1.3.3-1 amd64
libtasn1-6 4.2-2 amd64
libwrap0 7.6.q-25 amd64
passwd 1:4.2-3 amd64
libacl1 2.2.52-2 amd64
libmozjs-24-0 24.2.0-2 amd64
libslang2 2.3.0-2 amd64
libldap-2.4-2 2.4.40-3 amd64
libstdc++6 4.9.1-19 amd64
libpcre3 2:8.35-3.3 amd64
libnotify4 0.7.6-2 amd64
libosmesa6 10.3.2-1 amd64
libpixman-1-0 0.32.6-3 amd64
libffi6 3.1-2+b2 amd64
libgl1-mesa-swx11 10.3.2-1 amd64
libidn11 1.29-1+b2 amd64
libilmbase6 1.0.1-6.1 amd64
libjasper1 1.900.1-debian1-2.3 amd64
libgloox12 1.0.11-1 amd64
libxcb-render0 1.10-3+b1 amd64
libwxbase3.0-0 3.0.2-1+b1 amd64
libxcb1 1.10-3+b1 amd64
libkrb5-3 1.12.1+dfsg-16 amd64
libxtst6 2:1.2.2-1+b1 amd64
libgtk2.0-0 2.24.25-1 amd64
libnspr4 2:4.10.7-1 amd64
libk5crypto3 1.12.1+dfsg-16 amd64
libx11-6 2:1.6.2-3 amd64
libnettle4 2.7.1-5 amd64
libopenal1 1:1.15.1-5 amd64
Enrico
--
GPG key: 4096R/E7AD5568 2009-05-08 Enrico Zini <enrico at enricozini.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/simple-cdd-devel/attachments/20150123/6e5cda48/attachment.sig>
More information about the Simple-cdd-devel
mailing list