debian/0000755000000000000000000000000012256131343007166 5ustar debian/pkglab.examples0000644000000000000000000000001311645611021012155 0ustar examples/* debian/pkglab.manpages0000644000000000000000000000003111645611021012132 0ustar debian/manpages/pkglab.1 debian/examples.edos-debcheck/0000755000000000000000000000000011645611021013460 5ustar debian/examples.edos-debcheck/counting-with-breaks0000644000000000000000000000076211645611021017454 0ustar Package: p0-to-p3 Version: 1 Architecture: all Depends: p0, p1, p2, p3 Package: p0 Version: 1 Architecture: all Depends: z1 | z2 Package: p1 Version: 1 Architecture: all Depends: z1 | o2 Package: p2 Version: 1 Architecture: all Depends: o1 | z2 Package: p3 Version: 1 Architecture: all Depends: o1 | o2 Package: z1 Version: 1 Architecture: all Breaks: o1 Package: z2 Version: 1 Architecture: all Breaks: o2 Package: o1 Version: 1 Architecture: all Package: o2 Version: 1 Architecture: all debian/examples.edos-debcheck/counting0000644000000000000000000000077011645611021015235 0ustar Package: p0-to-p3 Version: 1 Architecture: all Depends: p0, p1, p2, p3 Package: p0 Version: 1 Architecture: all Depends: z1 | z2 Package: p1 Version: 1 Architecture: all Depends: z1 | o2 Package: p2 Version: 1 Architecture: all Depends: o1 | z2 Package: p3 Version: 1 Architecture: all Depends: o1 | o2 Package: z1 Version: 1 Architecture: all Conflicts: o1 Package: z2 Version: 1 Architecture: all Conflicts: o2 Package: o1 Version: 1 Architecture: all Package: o2 Version: 1 Architecture: all debian/manpages/0000755000000000000000000000000011645611021010756 5ustar debian/manpages/pkglab.10000644000000000000000000000256611645611021012311 0ustar .TH pkglab 1 "April 20, 2009" "Version 1.4" "USER COMMANDS" .SH NAME pkglab \- explore package repositories .SH SYNOPSIS .B pkglab [OPTION]... .SH DESCRIPTION Pkglab is an interactive, console-based environment to explore package repositories of package-based software distributions. A pkglab session typically starts by loading a package repository in one of the different formats understood pkglab. Then, pkglab can check given package combinations for co-installability according to inter-package relationships. .SH OPTIONS .TP .BI "\-architecture " architecture Default architecture to use when accessing packages from a package repository. By default the current host architecture is used. .TP .BI "\-history " filename Use the file .I filename to load and save command-line history. Defaults to .IR $HOME/.pkglab-history . .TP .BI "\-script " filename Execute commands from the file .IR filename . .TP .BI "\-merge " waterway Start by merging the archive found in .IR waterway . .TP .BR \-help ", " \-\-help Display basic help information. .SH SEE ALSO Pkglab can read package repositories in the dose format produced by .BR ceve (1). The non-interactive tools .BR edos-debcheck (1) and .BR rpm-debcheck (1) use the same algorithm as pkglab for checking installability of packages. .SH AUTHORS Pkglab was written by Berke Durak and Jaap Boender for the EDOS and Mancoosi projects. debian/manpages/edos-debcheck.10000644000000000000000000001070611645611021013524 0ustar .TH EDOS-DEBCHECK 1 2009-08-18 EDOS .SH NAME Edos-debcheck \- Check satisfiability of Debian package dependencies .SH SYNOPSIS \fBedos-debcheck\fR [option] ... [package] ... .SH DESCRIPTION .B edos-debcheck reads from standard input a set of Debian package descriptions, each of which is in the format of deb-control(5). For instance, the Packages files as found on a Debian mirror server, or in the directory \fI/var/lib/apt/lists/\fR of a Debian system, are suitable as input to \fBedos-debcheck\fR. Packages may appear with multiple versions in this set. We say that a package is identified in this set by the pair consisting of the .I package name and of the .I package version\fR. A package (called goal) is called \fIinstallable\fR with respect to a set of packages if there exists a subset of the packages that - contains at most one version for each package name - contains the goal package (in any version, or a specific version) - all packages of the subset have their dependencies and conflicts satisfied in this subset. Pre-depends are treated like Depends, and Breaks are treated like Conflicts. Debcheck checks whether every package given as argument is installable with respect to the input set of packages. Specific versions can be specified by following the package name with the sign '=' and the version of the package (for instance, 'xemacs21=21.4.17-1'). If no package name is given as argument then all packages of the input set are checked for satisfiability. The constraint solving algorithm is complete, that is it finds a solution whenever there exists one, even for multiple disjunctive dependencies and deep package conflicts. This problem is computationally infeasible in theory (that is, NP-complete), but can in practice be solved very efficiently for Packages files occurring actually in Debian. .SH OPTIONS .TP .B -i \fIfile\fR Specify an additional input file containing stanzas in deb-control(5) format. These packages are checked for installability the same way as packages read from standard input. .TP .B -I \fIfile\fR Specify an additional input file containing stanzas in deb-control(5) format. These packages that are not checked for installability but only used for resolving dependencies. .TP .B \-explain Explain the results .TP .B \-rules Print generated rules .TP .B \-failures Only show failures .TP .B \-successes Only show successes .TP .BI \-checkonly \ list where \fIlist\fR is a comma-separated list of package names. Check only for installability of packages with name in \fIlist\fR (of any available version). This means that if a package does not exist in the input pool then the test passes (since all available versions are in that case installable). However, a warning is issued in case a package mentionend in \fIlist\fR is not available. In the context of this option, a package of the form src:\fIp\fR expands to the list of all packages that stem from the source package \fIp\fR. .TP .B \-quiet Supress warnings and progress/timing messages .TP .B \-xml Output results in XML format .TP .B \-help, \-\-help Display this list of options .SH EXIT CODE The exit code is 0 when all packages that were asked to be checked (either explicitly with the \-checkonly option, or because they exist in the package pool file) are available and found to be installable, it is 1 when a least one of these packages is available but not installable, and it is 2 when at least one of the packages is not available but all available packages are found to be installable. Hence, the exit code 2 can occur only when the \-checkonly option is used. .SH EXAMPLE Check which packages in a particular distribution are not installable and why: edos-debcheck \-failures \-explain < Packages where Packages is the file pertaining to that distribution, as for instance found in the directory \fI /var/lib/apt/lists\fR. Check whether the xemacs21 and debhelper packages are installable in a distribution described by the file Packages: edos-debcheck \-explain \-checkonly xemacs21,debhelper < Packages Check whether the package bibtex2html, and all binary packages stemming from the ocaml source package, are installable edos-debcheck \-explain \-checkonly bibtex2html,src:ocaml < Packages .SH AUTHOR Edos-debcheck has been written by Jerome Vouillon for the EDOS project. This man-page has been compiled by Ralf Treinen. .SH SEE ALSO .BR deb-control (5) is the home page of the EDOS project. .BR edos-rpmcheck (1) is the analogous tool for rpm packages. debian/manpages/edos-pscheck.10000644000000000000000000000457411645611021013422 0ustar .TH EDOS-RPMCHECK 1 2009-05-25 EDOS .SH NAME Edos-pscheck \- Check satisfiability of pkgsrc package dependencies .SH SYNOPSIS \fBedos-pscheck\fR [option] ... pkg-summary-file .SH DESCRIPTION .B edos-pscheck reads package descriptions from a file in the pkg_summary format of NetBSD. We say that a package is identified by the pair consisting of the .I package name and of the .I package version\fR. A package (called goal) is called \fIinstallable\fR with respect to a set of packages if there exists a subset of the packages that - contains at most one version for each package name - contains the goal package (in any version, or a specific version) - all packages of the subset have their dependencies and conflicts satisfied in this subset. .B Edos-psmcheck checks whether every package in the set is installable with respect to the input set of packages. Specific versions can be specified by following the package name with the sign '=' and the version of the package (for instance, 'xemacs21=21.4.17-1'). If no package name is given as argument then all packages of the input set are checked for satisfiability. The constraint solving algorithm is complete, that is it finds a solution whenever there exists one, even for multiple disjunctive dependencies and deep package conflicts. This problem is computationally infeasible in theory (that is, NP-complete), but can in practice be solved very efficiently. .SH OPTIONS .TP .B \-explain Explain the results .TP .B \-rules Print generated rules .TP .B \-failures Only show failures .TP .B \-successes Only show successes .TP .B \-base \fIfile\fR Specifiy an additional file providing packages that are not checked but used for resolving dependencies .TP .B \-quiet Supress warnings and progress/timing messages .TP .B \-xml Output results in XML format .TP .B \-help, \-\-help Display this list of options .SH EXAMPLE Check which packages in a particular distribution are not installable and why: edos-pscheck \-failures \-explain pkg_summary where pkg_summary is the file pertaining to that distribution. .SH AUTHOR Edos-pscheck has been written by Jerome Vouillon and Jaap Boender for the EDOS and Mancoosi projects. This man-page has been compiled by Ralf Treinen. .SH SEE ALSO is the home page of the EDOS project. .BR edos-debcheck (1) and .BR edos-rpmcheck (1) are the analogous tool for debian and rpm packages. debian/manpages/edos-rpmcheck.10000644000000000000000000000517711645611021013576 0ustar .TH EDOS-RPMCHECK 1 2006-05-20 EDOS .SH NAME Edos-rpmcheck \- Check satisfiability of rpm package dependencies .SH SYNOPSIS \fBedos-rpmcheck\fR [option] ... [package] ... .SH DESCRIPTION .B edos-rpmcheck reads from standard input a set of rpm package descriptions. Packages may appear with multiple versions in this set. For instance, an uncompressed \fIhdlist.cz\fR is suitable as input. We say that a package is identified in this set by the pair consisting of the .I package name and of the .I package version\fR. A package (called goal) is called \fIinstallable\fR with respect to a set of packages if there exists a subset of the packages that - contains at most one version for each package name - contains the goal package (in any version, or a specific version) - all packages of the subset have their dependencies and conflicts satisfied in this subset. .B Edos-rpmcheck checks whether every package given as argument is installable with respect to the input set of packages. Specific versions can be specified by following the package name with the sign '=' and the version of the package (for instance, 'xemacs21=21.4.17-1'). If no package name is given as argument then all packages of the input set are checked for satisfiability. The constraint solving algorithm is complete, that is it finds a solution whenever there exists one, even for multiple disjunctive dependencies and deep package conflicts. This problem is computationally infeasible in theory (that is, NP-complete), but can in practice be solved very efficiently. .SH OPTIONS .TP .B \-explain Explain the results .TP .B \-rules Print generated rules .TP .B \-failures Only show failures .TP .B \-successes Only show successes .TP .B \-base \fIfile\fR Specifiy an additional file providing packages that are not checked but used for resolving dependencies .TP .B \-quiet Supress warnings and progress/timing messages .TP .B \-xml Output results in XML format .TP .B \-help, \-\-help Display this list of options .SH EXAMPLE Check which packages in a particular distribution are not installable and why: gunzip \-c hdlist.cz | edos-rpmcheck \-failures \-explain where hdlist.cz is the file pertaining to that distribution. Check whether version 21.4.17-1 of the xemacs21 package is installable in a distribution described by the file Packages: gunzip \-c hdlist.cz | edos-rpmcheck \-explain xemacs=21.4.17-1 .SH AUTHOR Edos-rpmcheck has been written by Jerome Vouillon for the EDOS project. This man-page has been compiled by Ralf Treinen. .SH SEE ALSO is the home page of the EDOS project. .BR edos-debcheck (1) is the analogous tool for debian packages. debian/copyright0000644000000000000000000000266311645611021011125 0ustar This package was debianized by Stefano Zacchiroli on Thu, 07 Aug 2008 17:54:39 -0300. It was downloaded from Files: * Copyright: © 2005-2008 Berke Durak © 2005-2008 Jaap Boender © 2005-2008 Inria Rocquencourt License: GPL-3+ pkglab is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. On Debian systems, the complete text of the latest GNU General Public License can be found in `/usr/share/common-licenses/GPL-3'. Files: dql/* Copyright: © 2005-2008 Berke Durak © 2005-2008 Jaap Boender © 2005-2008 Inria Rocquencourt License: LGPL-3+ dose2 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. On Debian systems, the complete text of the latest GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-3'. Files: debian/* Copyright: © 2008 Stefano Zacchiroli License: GPL-3+ The Debian packaging is copyright Stefano Zacchiroli, and licensed under the GNU General Public License, see `/usr/share/common-licenses/GPL-3' for the full text. debian/examples.edos-builddebcheck/0000755000000000000000000000000011645611021014500 5ustar debian/examples.edos-builddebcheck/Sources0000644000000000000000000000045511645611021016052 0ustar Package: sourcea Version: 1 Architecture: all Build-Depends: bina [alpha], binb [! alpha] Package: sourceb Version: 2 Architecture: any Build-Depends: bina, binb | binc Build-Conflicts: bind Package: sourcec Version: 2 Architecture: amd64 i386 Build-Depends: bina, binb | binc Build-Conflicts: bind debian/examples.edos-builddebcheck/Packages0000644000000000000000000000031611645611021016141 0ustar Package: bina Version: 3 Architecture: any Conflicts: binc Package: binb Version: 3 Architecture: any Depends: bind Package: binc Version: 3 Architecture: any Package: bind Version: 3 Architecture: any debian/edos-distcheck.links0000644000000000000000000000024411645611021013116 0ustar usr/lib/edos-distcheck/distcheck usr/bin/edos-debcheck usr/lib/edos-distcheck/distcheck usr/bin/edos-rpmcheck usr/lib/edos-distcheck/distcheck usr/bin/edos-pscheck debian/pkglab.dirs0000644000000000000000000000001011645611021011275 0ustar usr/bin debian/edos-distcheck.dirs0000644000000000000000000000011211645611021012731 0ustar usr/bin usr/lib/edos-distcheck usr/share/edos-distcheck usr/share/man etc debian/edos-distcheck.examples0000644000000000000000000000004011645611021013606 0ustar debian/examples.edos-debcheck/* debian/edos-distcheck.manpages0000644000000000000000000000020311645611021013564 0ustar debian/manpages/edos-debcheck.1 debian/manpages/edos-rpmcheck.1 debian/manpages/edos-pscheck.1 debian/contrib/edos-builddebcheck.1 debian/changelog0000644000000000000000000002142612256131343011045 0ustar pkglab (1.4.2-13build2) trusty; urgency=medium * Rebuild for ocaml-4.01. -- Matthias Klose Mon, 23 Dec 2013 22:02:11 +0000 pkglab (1.4.2-13build1) quantal; urgency=low * No-change rebuild for librpm2 -> librpm3 transition. -- Ilya Barygin Sat, 30 Jun 2012 22:46:01 +0400 pkglab (1.4.2-13) unstable; urgency=low [ Stéphane Glondu ] * add-sources.py: use debian module (from python-debian) instead of deprecated debian_bundle (Closes: #625475) [ Ralf Treinen ] * edos-distcheck: add dependency on ${python:Depends} * Fix a grammar error in the pkglab doc-base file * Standards-Version: 3.9.2 (no change) * Put changes to upstream files as quilt patches (closes: #643249) * Added debian/gbp.conf -- Ralf Treinen Thu, 13 Oct 2011 18:30:03 +0200 pkglab (1.4.2-12) unstable; urgency=low * Downgrade priority to extra, since dose2 has priority extra now. Thanks to Luca Falavigna for the hint. * Migrate to source format 3.0. * edos-builddebcheck: read the binary package file directly using the "-I" option, instead of merging it with the source packages (closes: #582951). Thanks a lot to Andi Barth for the idea! * Fix a typo in the long description of edos-distcheck (closes: #603831). * Standards-Version: 3.9.1 (no change). * Migrate packaging from cdbs to dh. * Use dh_ocaml >= 0.9 to get dependencies on ocaml stuff (closes: #599298). -- Ralf Treinen Sun, 13 Feb 2011 12:07:44 +0100 pkglab (1.4.2-11) unstable; urgency=low * Fix a bug in the handling of the options -base and -add-source reported by Andi Barth. These options are called "-i" and "-I" now, and documented in the manpage. * Removed Zack from uploaders on his request. -- Ralf Treinen Mon, 24 May 2010 21:04:59 +0200 pkglab (1.4.2-10) experimental; urgency=low * Fix logic in add-sources.py (used by edos-builddebcheck): If one of the packages in a disjunction is build-essential then the whole disjunctive clause is discarded. Thanks to Zack for the patch! (closes: #574380). * Have edos-debcheck use (via add-sources.py) the config file /etc/edos-builddebcheck.conf. Install that config file, and put into /usr/share/edos-distcheck the script to generate it. Thanks to Zack for the patch! (closes: #574721). * Added debian/source/format, current format is 1.0 (in order to facilitate backports). * Explain handling of build-essential packages by edos-builddebcheck in its manpage; add an item about its configuration file in edos-distcheck.NEWS. -- Ralf Treinen Thu, 22 Apr 2010 09:04:13 +0200 pkglab (1.4.2-9) unstable; urgency=low * Fixed formatting in manpage (closes: #571742) * Standards-Version 3.8.4 (no change) * Escape some more hyphens in edos-debcheck manpage * Do not use asterisk to start an entry in edos-distcheck.NEWS * add-soucrces.py: Print correctly stanzas containing non-ascii characters (Patch provided by Zack - thanks!) * distcheck/common.ml: escape < and > in version numbers in order to produce valid xml output even when the Packages file contains rubbish version numbers. * debian/rules: add to clean target removals of some leftover files -- Ralf Treinen Sun, 21 Mar 2010 12:36:53 +0100 pkglab (1.4.2-8) unstable; urgency=low * distcheck/common.ml: fixed function spec_string to print a dash between upstream version and release (closes: #565324). -- Ralf Treinen Fri, 15 Jan 2010 09:52:37 +0100 pkglab (1.4.2-7) unstable; urgency=low * Remove temporary file on exit (closes: #565152). -- Ralf Treinen Wed, 13 Jan 2010 21:18:19 +0100 pkglab (1.4.2-6) unstable; urgency=low [ Ralf Treinen ] * add-sources.py: drop all relations to build-essential packages * Removed mention of the "-check" option, which is no longer supported, from the manpages (closes: #556876). * Strengthen dependency of edos-distcheck on python-debian to >= 0.1.11 (closes: #564958). * Fixed a spelling error in manapge of edos-debcheck * manpages: changed - to \- for command options. [ Stéphane Glondu ] * debian/control: - update my e-mail address and remove DMUA -- Ralf Treinen Wed, 13 Jan 2010 20:15:35 +0100 pkglab (1.4.2-5) unstable; urgency=low * Standards-version 3.8.3 (no change) * Enforce dependency on version >= 1.4.2 of dose2 (which implements correctly the Breaks field), say in edos-debcheck man page that Breaks is treated like Conflicts. * Do not use xml entities when printing version constraints unless xml mode has been required (closes: #539211). * Packages to be checked can now be listed in the form "src:p", which will be expanded to the list of all packages that stem from source package p (closes: #516587). * Fix add-sources.py to separate binary and source file by blank line (closes: #538925). * Fix add-sources.py to always copy the Architecture field from the source stanza into the generated binary package stanza since the Architecture is mandatory for binary packages (closes: #538926). * Edos-builddebcheck calls edos-debcheck with the -quiet option. * Edos-builddebcheck: adapt the translation of the explanation to the new format of explanations. -- Ralf Treinen Fri, 21 Aug 2009 21:41:19 +0200 pkglab (1.4.2-4) unstable; urgency=low * debian/control: - add myself to Uploaders, and add DM-Upload-Allowed - remove dependency on non-existing package libledit-ocaml (Closes: #538208) - remove duplicate Section fields * debian/copyright: add full path to licenses -- Stephane Glondu Fri, 24 Jul 2009 17:01:43 +0200 pkglab (1.4.2-3) unstable; urgency=low * Issue a warning in case a package is mentioned in the -checkonly option but is not available (closes: #519859). * Fix clean target in distcheck/Makefile (add removal of *.cmi) * edos-builddebcheck: call python on the script add-sources.py instead of relying on executability of that script (closes: #534053) * Long description of the edos-distcheck package: - add mention of edos-pscheck and edos-builddebcheck - proper indentation of itemized list. * Produce meaningful exit code (closes: #525218). -- Ralf Treinen Sun, 21 Jun 2009 19:47:29 +0200 pkglab (1.4.2-2) unstable; urgency=low * Weaken conflict with edos-{rpm,deb}check to (<= 1.0-8) in order to allow for transitional packages for edos-{rpm,deb}check to depend on edos-distcheck. * Standards-Version 3.8.2 (no change). -- Ralf Treinen Wed, 17 Jun 2009 19:53:06 +0200 pkglab (1.4.2-1) unstable; urgency=low * New Upstream Version * Merge in dql/help.ml and doc/pkglab.ml from upstream svn to fix missing quote before version strings (closes: #532771). * This package now supersedes the edos-[reb,rpm}check packages: - Add symlinks for /usr/bin/edos-{deb,rpm}check. - Replaces, Conflicts and Provides edos-{rpm,deb}check - Add manpages for edos-{deb,rpm}check - Add edos-builddebcheck * Patch distcheck/common.ml to accept the -checkonly option. Add a note on this to debian/NEW.Debian. * Add dependency on python-debian and python (closes: #532828) -- Ralf Treinen Tue, 16 Jun 2009 20:14:37 +0200 pkglab (1.4.1-1) unstable; urgency=low * New upstream version. * debian/rules: put explicit MANDIR in install target * Create edos-distcheck package, providing at the moment only pscheck. * Build and install pkglab documentation, add build-dependency on hevea * Remove reference to dose in pkglab long description. -- Ralf Treinen Mon, 25 May 2009 21:31:55 +0200 pkglab (1.4-2) unstable; urgency=low * Removed spurious blank in dh_gencontrol invocation for non-native architectures, that should resolve a FTBFS on these architectures. -- Ralf Treinen Wed, 22 Apr 2009 09:11:18 +0900 pkglab (1.4-1) unstable; urgency=low * New upstream release. * Added myself to uploaders * Standards-Version 3.8.1 (no change) * Added build-dependency on dh-ocaml (closes: #523614), libzip-ocaml-dev. * Only suggests ceve, not recommends. * Added dependency in the bytecode case on libledit-ocaml, libzip-ocaml * debian/rules: cdbs class/ocaml.mk -> rules/ocaml.mk * Install pkglab examples directory. * Switch back to upstream's Makefile, adapt install target in debian/rules accordingly * Added debian/pkglab.dirs * Add a basic manpage. -- Ralf Treinen Mon, 20 Apr 2009 16:32:51 +0900 pkglab (1.3-1) exprerimental; urgency=low * Initial release. (Closes: #494206) -- Stefano Zacchiroli Thu, 07 Aug 2008 18:18:01 -0300 debian/compat0000644000000000000000000000000211645611021010361 0ustar 7 debian/patches/0000755000000000000000000000000011645611021010612 5ustar debian/patches/various0000644000000000000000000002346211645611021012234 0ustar Desccription: Fix XML output, add some options to distcheck Author: Ralf Treinen --- pkglab-1.4.2.orig/distcheck/Makefile +++ pkglab-1.4.2/distcheck/Makefile @@ -4,7 +4,7 @@ SRCS= common.ml OBJS= $(SRCS:.ml=.cmo) XBJS= $(SRCS:.ml=.cmx) -PACKAGES= dose2.packetology,dose2.rapids +PACKAGES= dose2.packetology,dose2.rapids,str OCAMLC= ocamlfind ocamlc -package $(PACKAGES) OCAMLOPT= ocamlfind ocamlopt -package $(PACKAGES) --- pkglab-1.4.2.orig/distcheck/common.ml +++ pkglab-1.4.2/distcheck/common.ml @@ -7,20 +7,31 @@ open Diagnosis open Napkin open Rapids open Waterway +open Str let show_successes = ref true and show_failures = ref true and explain_results = ref false and quiet = ref false and output_xml= ref false -and dist_type = ref `Debian -and source_added = ref false;; +and dist_type = ref `Debian;; +let pkgs_to_check = ref Package_set.empty;; +let units_to_check = ref [] (* units given by command line argument *) +and units_to_check_set = ref false (* indicates whether units_to check set on command line *) +and packages_are_missing = ref false;; (* indicates that some packages that were asked to be *) + (* checked are not available. *) +let checklist = ref [];; +let rpm_synthesis = ref false;; let db = create_database ();; let architecture_index = get_architecture_index db;; let unit_index = get_unit_index db;; let package_index = get_package_index db;; +let version_index = get_version_index db;; +let release_index = get_release_index db;; +let source_index = get_source_index db;; let not_to_check = ref Package_set.empty;; +let tmpfile = ref "";; (* temporary file for input *) let add_source add_to_check s = let merge x = if !quiet then @@ -28,21 +39,23 @@ let merge x = if !quiet then else Waterway.merge db x in begin - source_added := true; (* This is not very effective, but hey... *) let pkgs_old = Functions.packages db in (let s2 = if s = "-" then begin - let (n, c) = Filename.open_temp_file "distcheck" "" in + let (n, c) = Filename.open_temp_file "distcheck" + (if !rpm_synthesis then "synthesis" else "") + in begin - try - while true - do - Printf.fprintf c "%s\n" (read_line ()) - done - with End_of_file -> close_out c - end; - n + tmpfile := n; + try + while true + do + Printf.fprintf c "%s\n" (read_line ()) + done + with End_of_file -> close_out c; + end; + n end else s in match !dist_type with @@ -54,6 +67,31 @@ begin not_to_check := Package_set.union !not_to_check new_packages end;; +let add_pkg_to_check s = +begin + try + let eq = String.index s '=' in + let u = String.sub s 0 eq in + let unit_id = Unit_index.search unit_index u in + let v = String.sub s (eq+1) (String.length s-eq-1) in + let (v_id, r_id) = + try + let dash = String.rindex v '-' in + let rv = String.sub v 0 dash + and r = String.sub v (dash+1) (String.length v-dash-1) in + (Version_index.search version_index rv, + Release_index.search release_index (Some r)) + with Not_found -> (Version_index.search version_index v, + Release_index.search release_index None) in + let ps = Functions.unit_id_to_package_set db unit_id in + Package_set.iter (fun p_id -> + let pkg = Functions.get_package_from_id db p_id in + if pkg.pk_version = (v_id, r_id) then + pkgs_to_check := Package_set.add p_id !pkgs_to_check + ) ps; + with Not_found -> () +end;; + let unit_name_of u_id = Unit_index.find unit_index u_id;; @@ -67,6 +105,15 @@ let pkg_name_of p_id = | None -> "" | Some rn -> "-" ^ rn);; +let myunit_name_of p_id = + let (_, pkg) = Package_index.find package_index p_id in + Unit_index.find unit_index pkg.pk_unit + +(* gives the name of the source of a package *) +let source_name_of p_id = + let (_, pkg) = Package_index.find package_index p_id in + fst (Source_index.find source_index pkg.pk_source) + let pkg_xml_of p_id = let (_, pkg) = Package_index.find package_index p_id in let unit_name = Unit_index.find unit_index pkg.pk_unit @@ -79,23 +126,37 @@ let pkg_xml_of p_id = | None -> "" | Some rn -> "-" ^ rn);; +(* xmlesc escapes some special caracters into XML *) +let xmlesc s = + global_replace (regexp_string ">") ">" + (global_replace (regexp_string "<") "<" s) +;; + let spec_string s = -let version_string (v, r) = - let vn = Version_index.get_version v - and rn = Release_index.get_version r in - vn ^ (match rn with None -> "" | Some r -> r) in -begin - match s with + let version_string (v, r) = + let vn = Version_index.get_version v + and rn = Release_index.get_version r in + vn ^ (match rn with None -> "" | Some r -> ("-"^r)) in + if !output_xml + then + match s with | Sel_ANY -> "" - | Sel_LT v -> Printf.sprintf " (< %s)" (version_string v) - | Sel_LEQ v -> Printf.sprintf " (<= %s)" (version_string v) + | Sel_LT v -> Printf.sprintf " (< %s)" (xmlesc (version_string v)) + | Sel_LEQ v -> Printf.sprintf " (<= %s)" (xmlesc (version_string v)) + | Sel_EQ v -> Printf.sprintf " (= %s)" (xmlesc (version_string v)) + | Sel_GEQ v -> Printf.sprintf " (>= %s)" (xmlesc (version_string v)) + | Sel_GT v -> Printf.sprintf " (> %s)" (xmlesc (version_string v)) + else + match s with + | Sel_ANY -> "" + | Sel_LT v -> Printf.sprintf " (< %s)" (version_string v) + | Sel_LEQ v -> Printf.sprintf " (<= %s)" (version_string v) | Sel_EQ v -> Printf.sprintf " (= %s)" (version_string v) - | Sel_GEQ v -> Printf.sprintf " (>= %s)" (version_string v) - | Sel_GT v -> Printf.sprintf " (> %s)" (version_string v) -end;; + | Sel_GEQ v -> Printf.sprintf " (>= %s)" (version_string v) + | Sel_GT v -> Printf.sprintf " (> %s)" (version_string v) +;; let check () = -let pkgs_to_check = ref (Package_set.diff (Functions.packages db) !not_to_check) in let result_ht = Hashtbl.create (Package_set.cardinal !pkgs_to_check) in let progress = if !quiet then Progress.dummy @@ -113,6 +174,7 @@ begin end;; let show_results ht = + (* returns true when all checks successful, otherwise false *) begin if !output_xml then print_endline ""; Hashtbl.iter @@ -189,26 +251,82 @@ begin end ) ht; if !output_xml then print_endline ""; + (* we return true when all checks have been successful, otherwise false *) + Hashtbl.fold + (fun _ (result,_) accumulator -> result && accumulator) + ht + true end;; -let speclist = [ +let speclist = ref [ ("-explain", Set explain_results, "Explain the results"); ("-failures", Clear show_successes, "Only show failures"); ("-successes", Clear show_failures, "Only show successes"); - ("-base FILE", String (add_source false), "Additional binary package control file providing packages that are not checked but used for resolving dependencies"); + ("-i", String (add_source true), "Additional input file providing control stanzas of packages that are checked and used for resolving dependencies"); + ("-I", String (add_source false), "Additional input file providing control stanzas of packages that are NOT checked but used only for resolving dependencies"); + ("-checkonly", + String (fun s -> units_to_check := Util.split_at ',' s; units_to_check_set := true), + "Check only these packages"); ("-quiet", Set quiet, "Do not emit warnings nor progress/timing information"); ("-xml", Set output_xml, "Output results in XML format"); - ("-", Unit (fun () -> add_source true "-"), ""); ];; let _ = if Util.string_contains Sys.argv.(0) "debcheck" then dist_type := `Debian else if Util.string_contains Sys.argv.(0) "rpmcheck" then - dist_type := `RPM + begin + dist_type := `RPM; + speclist := ("-synthesis", Set rpm_synthesis, "Use synthesis hdlist")::!speclist + end else if Util.string_contains Sys.argv.(0) "pscheck" then dist_type := `Pkgsrc else (Printf.eprintf "Warning: unknown name '%s', behaving like debcheck\n%!" Sys.argv.(0); dist_type := `Debian); - Arg.parse speclist (add_source true) "Distcheck v1.4.1"; - if not !source_added then add_source true "-"; - show_results (check ());; + Arg.parse !speclist (fun s -> checklist := s::!checklist) "Distcheck $Revision$"; + add_source true "-"; + if !units_to_check_set + then + let rec separate_source_packages = function + [] -> [],[] + | h::r -> + let br,sr = separate_source_packages r + and h_length = String.length h + in if h_length >= 5 && String.sub h 0 4 = "src:" + then br,(String.sub h 4 (h_length-4))::sr + else h::br,sr + in let bin_units_to_check, src_units_to_check = separate_source_packages !units_to_check + in let filtered_packages = + (Package_set.filter + (fun p -> List.mem (myunit_name_of p) bin_units_to_check || List.mem (source_name_of p) src_units_to_check) + (Functions.packages db)) + in let found_package_names = + List.map myunit_name_of (Package_set.elements filtered_packages) + in let missing_package_names = + List.filter + (fun pn -> not (List.mem pn found_package_names)) + bin_units_to_check + in if missing_package_names <> [] + then begin + packages_are_missing := true; + prerr_string "Warning: some packages not found:"; + List.iter + (fun pn -> prerr_char ' '; prerr_string pn) + missing_package_names; + prerr_newline (); + flush stderr + end; + pkgs_to_check := filtered_packages + else begin + List.iter add_pkg_to_check !checklist; + if Package_set.is_empty !pkgs_to_check then + pkgs_to_check := Package_set.diff (Functions.packages db) !not_to_check; + end; + if !tmpfile <> "" then Sys.remove !tmpfile; + exit (if (show_results (check ())) + then + if !packages_are_missing + then 2 (* some packages that were asked to be checked are missing *) + else 0 (* all checks successful *) + else 1 (* some package are not installable *) +);; + debian/patches/quoted-version0000644000000000000000000000465011645611021013526 0ustar Description: Fix missing quotes before versions in documentation and help Author: Ralf Treinen Debian-Bug: #532771 --- pkglab-1.4.2.orig/doc/pkglab.tex +++ pkglab-1.4.2/doc/pkglab.tex @@ -83,10 +83,10 @@ Pkglab knows several different types of sets; used to track the contents of a distribution through times \item[Dates] (denoted: {\tt YYYY-MM-DD}) \item[Date ranges] (denoted: {\tt [YYYY-MM-DD;YYYY-MM-DD]}) - \item[Specifications] (denoted: {\tt [. kde (>= 5.2) .]}) A selector + \item[Specifications] (denoted: {\tt [. kde (>= '5.2) .]}) A selector on the versions of a unit, in this case all versions of the unit {\tt kde} greater than or equal to {\tt 5.2}. The version is optional; - {\tt [. kde .]} is a valid specification as well. + {\tt [. kde .]} is a valid specification as well. The spaces between the {\tt [.} brackets and the specification are necessary! \item[Sets] (denoted: {\tt \{a, b, \ldots\}}) \item[Diagnoses] The result of a check operation: a list of packages that are not installable with their reasons. @@ -98,7 +98,7 @@ It is possible to use variables: like in prefixed by a dollar sign ({\tt \$}). Assignment is done as follows: \codebox{ -> \$a <- select([. kde (>= 5.2) .]) +> \$a <- select([. kde (>= '5.2) .]) } Pkglab has the following operators: --- pkglab-1.4.2.orig/dql/help.ml +++ pkglab-1.4.2/dql/help.ml @@ -62,7 +62,7 @@ let help_string = Simple " $"; Red "name"; Tab; Tab; Tab; Tab; Simple "Variable"; Newline; Simple " "; Red "yyyy"; Simple "-"; Red "mm"; Simple "-"; Red "dd"; Tab; Tab; Tab; Simple "Date"; Newline; Simple " ["; Red "date1"; Simple ";"; Red "date2"; Simple "]"; Tab; Tab; Tab; Simple "Date range"; Newline; - Simple " [."; Red "unit"; Simple "("; Red "operator version"; Simple ").]"; Tab; Simple "Version specification (e.g. [.kde (>= 5.2).])"; Newline; + Simple " [."; Red "unit"; Simple "("; Red "operator version"; Simple ").]"; Tab; Simple "Version specification (e.g. [. kde (>= '5.2) .])"; Newline; Tab; Tab; Tab; Tab; Simple "(version part is optional)"; Newline; Simple " {"; Red "e1"; Simple ","; Red "e2"; Simple ","; Red "..."; Simple ","; Red "en"; Simple "}"; Tab; Tab; Simple "Set construction"; Newline; Simple " "; Red "set1"; Simple "|"; Red "set2"; Simple " "; Red "set1"; Simple "&"; Red "set2"; Simple " "; Red "set1"; Simple "\\"; Red "set2"; Tab; Simple "Set union/intersection/difference"; Newline; debian/patches/clean-cmi0000644000000000000000000000102511645611021012363 0ustar Description: "make clean" should also remove .cmi files Author: Ralf Treinen Index: pkglab/distcheck/Makefile =================================================================== --- pkglab.orig/distcheck/Makefile 2011-09-30 16:06:53.000000000 +0200 +++ pkglab/distcheck/Makefile 2011-09-30 16:07:08.000000000 +0200 @@ -37,7 +37,7 @@ cp pscheck.opt $(BINDIR) clean: - rm -f distcheck distcheck.opt *.o *.cmo *.cmx + rm -f distcheck distcheck.opt *.o *.cmo *.cmx *.cmi %.cmo: %.ml $(OCAMLC) -o $@ -c $^ debian/patches/series0000644000000000000000000000004111645611021012022 0ustar quoted-version clean-cmi various debian/control0000644000000000000000000000351211645611021010567 0ustar Source: pkglab Section: devel Priority: extra Maintainer: Debian OCaml Maintainers Uploaders: Ralf Treinen , Stéphane Glondu Build-Depends: debhelper (>= 7.0.50~), ocaml-nox (>= 3.11.1-3~), ocaml-findlib, dh-ocaml (>= 0.9), menhir, libdose2-ocaml-dev (>= 1.4.2), libledit-ocaml-dev, libzip-ocaml-dev, hevea Standards-Version: 3.9.2 Homepage: http://sodiac.gforge.inria.fr/ Vcs-Browser: http://git.debian.org/?p=pkg-ocaml-maint/packages/pkglab.git Vcs-Git: git://git.debian.org/git/pkg-ocaml-maint/packages/pkglab.git Package: pkglab Architecture: any Depends: ${ocaml:Depends}, ${shlibs:Depends}, ${misc:Depends} Suggests: ceve Description: interactive environment to explore package repositories Pkglab is an interactive, console-based environment to explore package repositories of package-based software distributions. . Using Pkglab package lists can be loaded and installability tests can be performed to check whether given package combinations are co-installable or not, according to inter-package relationships. Package: edos-distcheck Architecture: any Depends: ${ocaml:Depends}, ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-debian (>= 0.1.15~), python, perl, Conflicts: edos-debcheck (<= 1.0-8), edos-rpmcheck (<= 1.0-8) Replaces: edos-debcheck, edos-rpmcheck Provides: edos-debcheck, edos-rpmcheck Description: Checks whether dependencies of packages can be satisfied This software checks for every package of a distribution whether it is possible to satisfy its dependencies and conflicts within this distribution. It comes in several versions: - edos-debcheck for Debian packages - edos-rpmcheck for rpm packages - edos-pscheck for pkg_summary package descriptions - edos-builddebcheck for build-dependencies of Debian packages. debian/rules0000755000000000000000000000161411645611021010245 0ustar #!/usr/bin/make -f # do we have compilation of ocaml to native code? OPT = $(shell test -x /usr/bin/ocamlopt && echo true) %: dh $@ --with ocaml override_dh_auto_configure: $(MAKE) depend # dh_auto_clean calls "make clean", and our Makefile needs dql/.depend override_dh_auto_clean: touch dql/.depend && dh_auto_clean override_dh_auto_build: $(MAKE) ifeq ($(OPT),true) make pkglab.opt cd distcheck && make distcheck.opt else make pkglab cd distcheck && make distcheck endif cd doc && make pkglab.html override_dh_auto_install: ifeq ($(OPT),true) cp pkglab.opt debian/pkglab/usr/bin/pkglab cp distcheck/distcheck.opt\ debian/edos-distcheck/usr/lib/edos-distcheck/distcheck else cp pkglab debian/pkglab/usr/bin cp distcheck/distcheck\ debian/edos-distcheck/usr/lib/edos-distcheck/distcheck endif override_dh_strip: ifeq ($(OPT),true) dh_strip else dh_strip -X usr/bin/pkglab endif debian/source/0000755000000000000000000000000011645611021010463 5ustar debian/source/format0000644000000000000000000000001411645611021011671 0ustar 3.0 (quilt) debian/gbp.conf0000644000000000000000000000003611645611021010601 0ustar [DEFAULT] pristine-tar = True debian/pkglab.doc-base0000644000000000000000000000103611645611021012022 0ustar Document: pkglab Title: Pkglab documentation Author: Jaap Boender Abstract: Pkglab is a tool for exploring open-source distributions, supporting Debian-style and RPM-based distributions, as well as pkgsrc summary files. In particular it allows one to test for installability of packages by their declared inter-package relationships. This document explains how to use the pkglab interactive environment. Section: System/Package Management Format: HTML Index: /usr/share/doc/pkglab/pkglab.html Files: /usr/share/doc/pkglab/pkglab.html debian/edos-distcheck.NEWS0000644000000000000000000000176211645611021012560 0ustar pkglab (1.4.2-11) unstable; urgency=low * Options "-i" and "-I" can be used to read additional input from files. In the first case the packages read from the file are checked for installability, in the second case they are just used for solving package dependencies. -- Ralf Treinen Mon, 24 May 2010 21:04:59 +0200 pkglab (1.4.2-10) unstable; urgency=low edos-builddebcheck reads a configuration file /etc/dos-builddebcheck.conf, which allows in particular to define an architecture dependent list of build-essential packages. -- Ralf Treinen Tue, 20 Apr 2010 10:19:39 +0200 pkglab (1.4.2-1) unstable; urgency=low If you wish to restrict the check to a specific list of packages you have to use the -checkonly option now which takes as argument a comma-separated list of package names, like this: edos-debcheck -checkonly xemacs21,debhelper < Packages -- Ralf Treinen Mon, 15 Jun 2009 21:20:42 +0200 debian/watch0000644000000000000000000000011311645611021010207 0ustar version=3 http://gforge.inria.fr/frs/?group_id=929 .*/pkglab-(.*)\.tar\.gz debian/edos-distcheck.install0000644000000000000000000000030711645611021013444 0ustar debian/contrib/add-sources.py usr/share/edos-distcheck debian/contrib/edos-builddebcheck usr/bin debian/contrib/get-buildessentials usr/share/edos-distcheck debian/contrib/edos-builddebcheck.conf etcdebian/contrib/0000755000000000000000000000000011645611021010623 5ustar debian/contrib/edos-builddebcheck.conf0000644000000000000000000000265211645611021015177 0ustar [build-essentials] alpha: binutils, build-essential, dpkg-dev, libc6.1-dev, cpp, g++, gcc, make, patch, perl-modules, perl amd64: binutils, build-essential, dpkg-dev, libc6-dev, cpp, g++, gcc, make, patch, perl-modules, perl armel: binutils, build-essential, dpkg-dev, libc6-dev, cpp, g++, gcc, make, patch, perl-modules, perl hppa: binutils, build-essential, dpkg-dev, libc6-dev, cpp, g++, gcc, make, patch, perl-modules, perl hurd-i386: binutils, build-essential, dpkg-dev, libc0.3-dev, cpp, g++, gcc, make, patch, perl-modules, perl i386: binutils, build-essential, dpkg-dev, libc6-dev, cpp, g++, gcc, make, patch, perl-modules, perl ia64: binutils, build-essential, dpkg-dev, libc6.1-dev, cpp, g++, gcc, make, patch, perl-modules, perl kfreebsd-amd64: binutils, build-essential, dpkg-dev, cpp, g++, gcc, make, patch, perl-modules, perl kfreebsd-i386: binutils, build-essential, dpkg-dev, cpp, g++, gcc, make, patch, perl-modules, perl mips: binutils, build-essential, dpkg-dev, libc6-dev, cpp, g++, gcc, make, patch, perl-modules, perl mipsel: binutils, build-essential, dpkg-dev, libc6-dev, cpp, g++, gcc, make, patch, perl-modules, perl powerpc: binutils, build-essential, dpkg-dev, libc6-dev, cpp, g++, gcc, make, patch, perl-modules, perl s390: binutils, build-essential, dpkg-dev, libc6-dev, cpp, g++, gcc, make, patch, perl-modules, perl sparc: binutils, build-essential, dpkg-dev, libc6-dev, cpp, g++, gcc, make, patch, perl-modules, perl debian/contrib/add-sources.py0000755000000000000000000001314511645611021013415 0ustar #!/usr/bin/python # Given a Sources file, produces as output a new Packages file containing # fake packages which are installable if and only if the # corresponding source package has satisfiable build dependencies. # Copyright (C) 2008 Stefano Zacchiroli # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) any later # version. # $Id: add-sources.py 5957 2008-08-16 18:32:17Z zack $ # build-essential packages: all (unversioned) build-dependencies will be # ignored. This list is just the default fallback for when # /etc/edos-builddebcheck.conf is not available; when it is, per-arch # build-essential packages will be read from it buildessentials = ['apt', 'binutils', 'cpio', 'cpp', 'dpkg-dev', 'g++', 'gcc', 'libc6-dev', 'make', 'patch', 'perl', 'perl-modules'] CONFFILE = "/etc/edos-builddebcheck.conf" import os import string import sys from ConfigParser import ConfigParser from optparse import OptionParser from debian import deb822 usage = 'Usage: cat Packages | add-sources [OPTION...] Sources ARCH > Packages.new' cli = OptionParser(usage=usage) cli.add_option('-p', '--prefix', dest='prefix', default='source---', help='set the prefix for fake source packages to PREFIX (default: source---)', metavar='PREFIX') (options, args) = cli.parse_args() if len(args) != 2: cli.print_help() sys.exit(2) sources_file = args[0] architecture = args[1] if os.path.isfile(CONFFILE): conf = ConfigParser() conf.read(CONFFILE) if conf.has_option('build-essentials', architecture): # overrire default with configured per-arch build-essentials raw_b_e = conf.get('build-essentials', architecture) buildessentials = map(lambda s: s.strip(), raw_b_e.split(',')) def pkg_of_src(src): global architecture, options pkg = deb822.Packages() pkg['Package'] = options.prefix + src['Package'] def dep_for_me(dep): for_me = None if dep['arch'] is None: for_me = True elif dep['arch']: (polarity, _) = dep['arch'][0] if polarity: # list is inclusive for_me = (True, architecture) in dep['arch'] else: # list is exclusive for_me = not ((False, architecture) in dep['arch']) else: for_me = False return for_me def mk_bin_rels(fields, relations): def strip_arch(dep): dep['arch'] = None return dep def get_rels(fields, relations): rels = [] for name in fields: if relations.has_key(name): rels.extend(relations[name]) return rels def is_trivial_dep(or_deps): """checks whether a given disjunction is trivially satisfiable, e.g. because it contains an unversioned build-essential dependency """ for dep in or_deps: if dep['name'] in buildessentials \ and not (dep.has_key('version') and dep['version']): return True # unversioned build-dep on a build-essential return False src_rels = get_rels(fields, relations) bin_rels = [] for or_deps in src_rels: if not is_trivial_dep(or_deps): my_or_deps = map(strip_arch, filter(dep_for_me, or_deps)) if my_or_deps: bin_rels.append(my_or_deps) return bin_rels def str_of_relations(rels): # XXX this is cut and paste from python-debian's deb822.py, more # precisely it matches the str() method of the PkgRelation class # TODO to be removed as soon as python-debian 0.1.12 hits unstable def pp_arch(arch_spec): (excl, arch) = arch_spec if excl: return arch else: return '!' + arch def pp_atomic_dep(dep): s = dep['name'] if dep.has_key('version') and dep['version'] is not None: s += ' (%s %s)' % dep['version'] if dep.has_key('arch') and dep['arch'] is not None: s += ' [%s]' % string.join(map(pp_arch, dep['arch'])) return s pp_or_dep = lambda deps: string.join(map(pp_atomic_dep, deps), ' | ') return string.join(map(pp_or_dep, rels), ', ') for field in ['Version', 'Priority', 'Section', 'Maintainer', 'Architecture']: if src.has_key(field): pkg[field] = src[field] bin_depends = mk_bin_rels(['build-depends', 'build-depends-indep'], src.relations) if bin_depends: #pkg['Depends'] = deb822.PkgRelation.str(bin_depends) pkg['Depends'] = str_of_relations(bin_depends) bin_conflicts = mk_bin_rels(['build-conflicts', 'build-conflicts-indep'], src.relations) if bin_conflicts: #pkg['Conflicts'] = deb822.PkgRelation.str(bin_conflicts) pkg['Conflicts'] = str_of_relations(bin_conflicts) pkg['Description'] = 'dummy counterpart of "%s" source package' % \ src['Package'] pkg['Description'] += "\n I don't exist, go away." return pkg for src in deb822.Sources.iter_paragraphs(file(sources_file)): if src['Architecture'] in ['any', 'all']: pkg = pkg_of_src(src) print unicode(pkg).encode('utf-8') elif architecture in src['Architecture'].split(): pkg = pkg_of_src(src) pkg['Architecture'] = architecture print unicode(pkg).encode('utf-8') debian/contrib/edos-builddebcheck0000755000000000000000000000613411645611021014255 0ustar #!/usr/bin/perl -w # Copyright (C) 2008 Ralf Treinen # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, version 2 of the License. $debug=0; # the prefix used to encode source packages $sourceprefix="source---"; $architecture=""; $binexplain=0; $edosoptions = "-failures -explain"; while ( $arg = shift @ARGV ) { if ( $arg eq '-a' || $arg eq '--architecture' ) { if ($#ARGV == -1) { die "-a option needs a value"; } else { $architecture = shift @ARGV; } } elsif ( $arg =~ "--binexplain" || $arg =~ "-be" ) { $binexplain = 1; } elsif ( $arg =~ /^-.*/ ) { die "unrecognized option: $arg"; } else { last; } } if ($#ARGV != 0) { die "Usage: edos-debbuildcheck [options] Packages Sources" } else { $packagefile = $arg; $sourcesfile = shift(@ARGV); } if ($debug) { print "Arch: $architecture\n"; print "Packages: $packagefile\n"; print "Sources: $sourcesfile\n"; print "Edos options: $edosoptions\n"; } # check that all stanzas in the binary package file have the same # architecture. $packagearch=""; open(P,$packagefile); while (

) { next unless /^Architecture/; next if /^Architecture:\s*all/; /Architecture:\s*([^\s]*)/; if ($packagearch eq "") { $packagearch = $1; } elsif ( $packagearch ne $1) { die "Package file contains different architectures: $packagearch, $1"; } } close P; if ( $architecture eq "" ) { if ( $packagearch eq "" ) { die "No architecture option given, " . "and no non-all architecture found in the Packages file"; } else { $architecture = $packagearch; } } else { if ( $packagearch ne "" & $architecture ne $packagearch) { die "Architecture option is $architecture ". "but the package file contains architecture $packagearch"; } } open(RESULT,"python /usr/share/edos-distcheck/add-sources.py ". "--prefix \"$sourceprefix\" $sourcesfile $architecture ". "| edos-debcheck -I $packagefile $edosoptions|"); $sourcestanza=0; $explanation=""; $binpackage=""; while () { if (/^\s+/) { if ($sourcestanza) { s/^(\s*)$sourceprefix(.*)depends on/$1$2build-depends on/o; s/^(\s*)$sourceprefix(.*) and (.*) conflict/$1$2 build-conflicts with $3/o; print; if (/depends on ([^\s]*) .*\{.*\}/) { push(@binqueue,$1); } } else { $explanation .= $_; } } else { if ($binpackage ne ""){ $binfailures{$binpackage} = $explanation; $binpackage=""; } if (/^$sourceprefix.*: FAILED/o) { s/^$sourceprefix//o; print; $sourcestanza=1; } elsif (/^([^\s]*) .*: FAILED/) { $binpackage=$1; $explanation=$_; $explanation.=; $sourcestanza=0; } else { # we have someting strange here $sourcestanza=0; } } } close RESULT; if ($binexplain) { while (@binqueue) { $p=pop(@binqueue); $v=$binfailures{$p}; next unless defined $v; $binfailures{$p}=""; print "$v" if $v ne ""; if ($v=~/depends on ([^\s]*) .*\{.*\}/) { push(@binqueue,$1); } } } debian/contrib/get-buildessentials0000755000000000000000000000122611645611021014521 0ustar #!/usr/bin/perl $output = "edos-builddebcheck.conf"; $mirror="ftp://ftp.fr.debian.org/debian"; @arches=("alpha", "amd64", "armel", "hppa", "hurd-i386", "i386", "ia64", "kfreebsd-amd64", "kfreebsd-i386", "mips", "mipsel", "powerpc", "s390", "sparc"); open(OUT,">$output"); select OUT; print "[build-essentials]\n"; foreach $arch (@arches) { my($isfirst)=1; print "$arch: "; open(ESS,"wget -O - $mirror/dists/sid/main/binary-$arch/Packages.bz2 | bzcat | grep-dctrl -FBuild-Essential -ni yes -sPackage |"); while ($p=) { chop $p; print ", " unless $isfirst; print $p; $isfirst=0; } print "\n"; close ESS; } close OUT; debian/contrib/edos-builddebcheck.10000644000000000000000000000654511645611021014417 0ustar .TH EDOS-BUILDDEBCHECK 1 2010-04-22 EDOS .SH NAME Edos-builddebcheck \- Check satisfiability of Debian package build-dependencies .SH SYNOPSIS \fBedos-builddebcheck\fR [option] ... Packagefile Sourcepackagefile .SH DESCRIPTION .B edos-builddebcheck reads a set of Debian package descriptions from the file \fIPackagefile\fR, each of which is in the format of deb-control(5), and a set of source package descriptions from the file \fISourcepackagefile\fR. All packages described in the file \fIPackagefile\fR must have the same value of their \fIArchitecture\fR (if it is different from \fIall\fP). For instance, the Packages and Sources files as found on a Debian mirror server, or in the directory \fI/var/lib/apt/lists/\fR of a Debian system, are suitable as input files. .B edos-builddebcheck verifies for every of the source packages (from \fISourcepackagefile\fR) whether its build-dependencies, build-indep-dependencies and build-conflicts can be satisfied from the binary packages provided in \fIPackagefile\fR. Only build-relations that apply to the architecture (see below on how the architecture is determined) are taken into account. Note that this is not the same thing as checking whether a distribution can be rebuild from scratch, for several reasons: \fB1.\fP No actual compilation is taking place, this tool only does a static analysis of package relationships. \fB2.\fP The binary packages in \fIPackages\fR are not necessarily those that are the result of the compilation of the source packages in \fISourcepackagefile\fR. \fB3.\fP We do not check for cycles. For instance, suppose that we have source packages \fIa\fP and \fIb\fP both generating one binary package of respectively the same name, and that \fIa\fP build-depends on \fIb\fP and \fIb\fP build-depends on \fIa\fP. Then we can not rebuild the set of packages from scratch because of the cycle. However, if we already have binary packages \fIa\fP and \fIb\fP then we can recompile both of them. Consequently, \fBedos-builddebcheck\fP will not report an error in this case. \fB4.\fP The underlying logical machine does a complete analysis of alternatives, and might report satisfiability of constraints in case actual tools (like apt) fail to find a solution. Build-essential packages are ignored in unversioned build-dependencies. The (architecture dependant) list of build-essential packages is read from the configuration file. If that file is not available than an architecture independent default value is used. .SH OPTIONS .TP .B -a, --architecture \fIarchitecture\fP Check for compilation on \fIarchitecture\fP. Usually it is not necessary to specify the architecture since it can be derived from the Packages file. .TP .B -be, --binexplain Add all explanations why build-dependencies are not satisfiable. Without that option some of these explanations may be missing from the output in case a source package build-depends on a binary package that exists in \fIPackagefile\fP file but that edos-debchecks finds not to be installable inside \fIPackagefile\fP. .SH FILES .TP .B /etc/edos-builddebcheck.conf Configuration file for edos\-builddebcheck .SH AUTHOR Edos-builddebcheck has been written by Stefano Zacchiroli and Ralf Treinen . It heavily relies on edos-debcheck which has been written by Jerome Vouillon for the EDOS project. .SH SEE ALSO .BR deb-control (5), edos-debcheck (1) debian/pkglab.docs0000644000000000000000000000002011645611021011265 0ustar doc/pkglab.html