--- edos-debcheck-1.0.orig/debian/changelog +++ edos-debcheck-1.0/debian/changelog @@ -0,0 +1,99 @@ +edos-debcheck (1.0-8) unstable; urgency=low + + [ Stefano Zacchiroli ] + * add-sources.py: add support for specifying an alternative prefix for + dummy source packages + + [ Ralf Treinen ] + * Fix spelling in edos-debcheck manpage (closes: Bug#495393). + * Extend edos-builddebcheck manpage: explain difference to compilation + from scratch. + * Edos-builddebcheck: call add-sources with --prefix option. + * Make sure add-sources.py gets installed with mode 755 (closes: Bug#498113). + + -- Ralf Treinen Sun, 07 Sep 2008 17:09:06 +0200 + +edos-debcheck (1.0-7) unstable; urgency=low + + [ Ralf Treinen ] + * debian/control: add Homepage field + * fix spelling of Debian in package description, as suggested by + Raphael Geissert (closes: Bug#480961). + * Standards-Version 3.8.0 (no change) + * Added edos-builddebcheck wrapper to check for satisfiability of + build-dependencies (closes: Bug#494600). This neccessitates a + Recommends: python-debian. + + [ Stefano Zacchiroli ] + * fix vcs-svn field to point just above the debian/ dir + * add myself as an Uploader + * debian/patches/ + - add 00dpatch.conf to ease usage of dpatch-edit-patch + - 04quiet_option: new patch adding support for a -quiet command line + option, when given extra messages such as timing are suppressed + * add contributed script debian/contrib/add-sources.py, used to mangle + Packages/Sources to detect unbuildable packages + + -- Ralf Treinen Fri, 15 Aug 2008 03:38:45 +0200 + +edos-debcheck (1.0-6) unstable; urgency=low + + * Build-dependency on ocaml >= 3.10 to force autobuilders to use the + right ocaml version. + + -- Ralf Treinen Wed, 05 Sep 2007 09:39:45 +0200 + +edos-debcheck (1.0-5) unstable; urgency=low + + * Upload to unstable. + + -- Ralf Treinen Thu, 30 Aug 2007 21:08:21 +0200 + +edos-debcheck (1.0-4) experimental; urgency=low + + * Rebuild against ocaml 3.10 + * Fix debian/watch + * Relax build-dependency to ocaml-nox (>= 3.07) + + -- Ralf Treinen Wed, 04 Jul 2007 20:24:16 +0200 + +edos-debcheck (1.0-3) unstable; urgency=low + + * Do not crash on version numbers that contain non-alphanumeric characters + (closes: Bug#428603). Patch by Julien Cristau - thanks! + + -- Ralf Treinen Wed, 13 Jun 2007 18:50:37 +0200 + +edos-debcheck (1.0-2) unstable; urgency=low + + * Add a debian/watch file. + * Patch 02tilde_in_version: allow tilde character in version numbers. Thanks + to Julien Cristau for the patch (closes: Bug#386646). + * Don't depend on ocaml-nox when compiling to native code. + * Better factorization of debian/rule (inspired by the approx package). + + -- Ralf Treinen Sat, 9 Sep 2006 20:47:39 +0200 + +edos-debcheck (1.0-1) unstable; urgency=low + + * New upstream release. + * Adapt patch 01Makefile to new upstream version. + + -- Ralf Treinen Thu, 6 Jul 2006 14:18:55 +0200 + +edos-debcheck (0.0.2006.03.19-2) unstable; urgency=low + + * Improved short and long description (closes: Bug#375209, Bug#375287) + * Don't code the ocaml version number into the build-dependency. + * Compile into bytecode on architectures where no native code compiler + is available (closes: Bug#376156) + + -- Ralf Treinen Mon, 3 Jul 2006 22:24:06 +0200 + +edos-debcheck (0.0.2006.03.19-1) unstable; urgency=low + + * Initial Release (closes: Bug#365087). + + -- Ralf Treinen Mon, 22 May 2006 22:47:52 +0200 + + --- edos-debcheck-1.0.orig/debian/svn-deblayout +++ edos-debcheck-1.0/debian/svn-deblayout @@ -0,0 +1 @@ +tagsUrl=svn+ssh://svn.debian.org/svn/pkg-ocaml-maint/tags/packages/edos-debcheck --- edos-debcheck-1.0.orig/debian/rules +++ edos-debcheck-1.0/debian/rules @@ -0,0 +1,64 @@ +#!/usr/bin/make -f +# debian/rules for debcheck + +include /usr/share/dpatch/dpatch.make + +# export DH_VERBOSE=1 + +OCAMLABI := $(shell ocamlc -version) +BYTECODE = $(shell [ -x /usr/bin/ocamlopt ] || echo yes) +OCAMLRUN = $(if $(BYTECODE),ocaml-base-nox-$(OCAMLABI)) + +build: buildstamp +buildstamp: patch + dh_testdir + $(MAKE) depend + $(MAKE) $(if $(BYTECODE),byte,all) + touch buildstamp + +clean: unpatch + dh_testdir + dh_testroot + touch .depend + $(MAKE) clean + -rm debcheck rpmcheck + -rm buildstamp + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs -A /usr/bin /usr/share/man/man1 + dh_installdirs /usr/share/edos-debcheck + cp debcheck$(if $(BYTECODE),.byte) \ + debian/edos-debcheck/usr/bin/edos-debcheck + cp debian/contrib/edos-builddebcheck debian/edos-debcheck/usr/bin + cp debian/contrib/add-sources.py \ + debian/edos-debcheck/usr/share/edos-debcheck/ + chmod 755 debian/edos-debcheck/usr/share/edos-debcheck/add-sources.py + cp rpmcheck$(if $(BYTECODE),.byte) \ + debian/edos-rpmcheck/usr/bin/edos-rpmcheck + dh_installman -pedos-debcheck \ + debian/edos-debcheck.1 debian/contrib/edos-builddebcheck.1 + dh_installman -pedos-rpmcheck debian/edos-rpmcheck.1 + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installchangelogs + dh_link + dh_compress + dh_strip + dh_shlibdeps + dh_fixperms + dh_installdeb + dh_gencontrol -- -VF:OCamlABI="$(OCAMLABI)" -VF:OCamlRun="$(OCAMLRUN)" + dh_md5sums + dh_builddeb + +binary-indep: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install debian/control patch unpatch --- edos-debcheck-1.0.orig/debian/watch +++ edos-debcheck-1.0/debian/watch @@ -0,0 +1,4 @@ +version=3 + +http://www.edos-project.org/xwiki/bin/view/Main/debcheck_home/index.html \ + http://www.edos-project.org/xwiki/bin/download/Main/debcheck_home/debrpmcheck-([\d\.]*)\.tar\.gz \ No newline at end of file --- edos-debcheck-1.0.orig/debian/copyright +++ edos-debcheck-1.0/debian/copyright @@ -0,0 +1,23 @@ +This package was debianized by Ralf Treinen on +Mon Apr 17 20:19:35 UTC 2006 + +It was downloaded from +https://protactinium.pps.jussieu.fr:12345/svn/edos/users/vouillon + +Upstream Authors: +Jerome Vouillon +Stefano Zacchiroli +Ralf Treinen + +Copyright (C) 2005 Jerome Vouillon, 2008 Stefano Zachiroli, 2008 Ralf Treinen + +These programs are free software; you can redistribute them and/or +modify them under the terms of the GNU General Public License as +published by the Free Software Foundation. License, or (at your +option) any later version. + +These programs are distributed in the hope that they will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. On Debian +systems, the complete text of the GNU General Public License can be +found in the /usr/share/common-licenses/GPL file. --- edos-debcheck-1.0.orig/debian/edos-debcheck.1 +++ edos-debcheck-1.0/debian/edos-debcheck.1 @@ -0,0 +1,87 @@ +.TH EDOS-DEBCHECK 1 2006-05-20 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. + +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 -check +Double-check the results +.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 -help, --help +Display this list of options + +.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 version 21.4.17-1 of the xemacs21 package is installable in a +distribution described by the file Packages: + + edos-debcheck -explain xemacs=21.4.17-1 < 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. --- edos-debcheck-1.0.orig/debian/compat +++ edos-debcheck-1.0/debian/compat @@ -0,0 +1 @@ +4 --- edos-debcheck-1.0.orig/debian/control +++ edos-debcheck-1.0/debian/control @@ -0,0 +1,27 @@ +Source: edos-debcheck +Section: devel +Priority: optional +Maintainer: Ralf Treinen +Uploaders: Stefano Zacchiroli +Standards-Version: 3.8.0 +Build-Depends: ocaml-nox (>= 3.10), debhelper (>= 4.0), dpatch +Vcs-Svn: svn://svn.debian.org/svn/pkg-ocaml-maint/trunk/packages/edos-debcheck/trunk +Vcs-Browser: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/edos-debcheck/trunk/ +Homepage: http://www.edos-project.org/xwiki/bin/view/Main/debcheck_home + +Package: edos-debcheck +Architecture: any +Depends: ${shlibs:Depends}, ${F:OCamlRun}, perl +Recommends: python-debian +Description: Checks whether dependencies of Debian packages can be satisfied + This software checks for every package of a distribution (in the + Debian format .deb) whether it is possible to satisfy its + dependencies and conflicts within this distribution. + +Package: edos-rpmcheck +Architecture: any +Depends: ${shlibs:Depends}, ${F:OCamlRun} +Description: Checks whether dependencies of RPM packages can be satisfied + This software checks for every package of a distribution (in the + format RPM) whether it is possible to satisfy its dependencies and + conflicts within this distribution. --- edos-debcheck-1.0.orig/debian/edos-rpmcheck.1 +++ edos-debcheck-1.0/debian/edos-rpmcheck.1 @@ -0,0 +1,81 @@ +.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 -check +Double-check the results +.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 -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 fro 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. --- edos-debcheck-1.0.orig/debian/edos-future/upclose.ml +++ edos-debcheck-1.0/debian/edos-future/upclose.ml @@ -0,0 +1,69 @@ +open Napkin;; +open Ocamldeb;; +open Arg;; + +let inputfile = ref "";; + +let options = + [ ( "-i", + Set_string(inputfile), + "path of the input Packages file" + ) + ] +in + parse + options + (function _ -> raise (Bad "Argument not allowed")) + "uplose -i ";; + +if (!inputfile = "") then + raise (Bad "Missing input file");; + +(* the data from the Packages file *) +let packages = read_pool_file !inputfile;; + +(* associates to package names the list of versions with which the package is *) +(* mentioned in conflicts and depends relations. *) +let versions = Hashtbl.create 10000;; + +(* extract a pure version number from a napkin versioned *) +let number_of_versionend (pn,vs) = + match vs with + | Sel_ANY -> "" + | Sel_LEQ v -> v + | Sel_LT v -> v + | Sel_GEQ v -> v + | Sel_GT v -> v + | Sel_EQ v -> v +;; + +(* c is a pair (packagename,version). Add it to the hashtable versions *) +(* if it isn't already there. *) +let process_relation c = + let package = fst c + and version = number_of_versionend c + in + try + let oldversions = Hashtbl.find versions package + in + if not (List.mem version oldversions) + then Hashtbl.replace versions package (version::oldversions) + with + Not_found -> Hashtbl.add versions package [version] +;; + +List.iter + (function p -> + List.iter process_relation p.pk_conflicts; + List.iter (List.iter process_relation) p.pk_depends) + packages +;; + +Hashtbl.iter + (fun package versionlist -> + print_string package; + print_string ": "; + List.iter print_string versionlist; + print_newline()) + versions + --- edos-debcheck-1.0.orig/debian/edos-future/Makefile +++ edos-debcheck-1.0/debian/edos-future/Makefile @@ -0,0 +1,16 @@ +OCAMLC=ocamlc +OCAMLOPT=ocamlopt +FLAVOUR=native +MAIN=upclose + +$(MAIN): $(MAIN).$(FLAVOUR) + ln -sf $(MAIN).$(FLAVOUR) $(MAIN) + +$(MAIN).byte: $(MAIN).ml + $(OCAMLC) -I +dose2 -o $(MAIN).byte nums.cma unix.cma zip/zip.cma str.cma dose2/util.cma ocamldeb.cma dose2/io.cma napkin.cma upclose.ml + +$(MAIN).native: $(MAIN).ml + $(OCAMLOPT) -I +dose2 -I +zip -o $(MAIN).native nums.cmxa unix.cmxa zip/zip.cmxa str.cmxa dose2/util.cmxa ocamldeb.cmxa dose2/io.cmxa napkin.cmxa upclose.ml + +clean: + -rm -f *.{cmo,cmi,cmx,o} $(MAIN).{byte,native} $(MAIN) --- edos-debcheck-1.0.orig/debian/contrib/edos-builddebcheck +++ edos-debcheck-1.0/debian/contrib/edos-builddebcheck @@ -0,0 +1,137 @@ +#!/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. + +open(D,"dpkg-query -W python-debian|"); +die "The package 'python-debian' is necessary to run this program" + unless =~ /^python-debian\s/; +close D; + +$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"; +} + +$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,"/usr/share/edos-debcheck/add-sources.py ". + "--prefix \"$sourceprefix\" < $packagefile $sourcesfile $architecture ". + "| edos-debcheck $edosoptions|"); + +$sourcestanza=0; +$explanation=""; +$binpackage=""; + +while () { + if (/^\s+/) { + if ($sourcestanza) { + s/^(\s*)$sourceprefix(.*)(depends on|conflicts with)/$1$2build-$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; + + $_=; + 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); + } + } +} + --- edos-debcheck-1.0.orig/debian/contrib/add-sources.py +++ edos-debcheck-1.0/debian/contrib/add-sources.py @@ -0,0 +1,120 @@ +#!/usr/bin/python + +# Given as input a Packages and a Sources file, produces as output a new +# Packages 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 $ + +import string +import sys + +from optparse import OptionParser +from debian_bundle 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] + +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 + + src_rels = get_rels(fields, relations) + bin_rels = [] + for or_deps in src_rels: + 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']: + 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 pkg in deb822.Packages.iter_paragraphs(sys.stdin): +for line in sys.stdin: + print line, +for src in deb822.Sources.iter_paragraphs(file(sources_file)): + if src['Architecture'] in ['any', 'all'] \ + or architecture in src['Architecture'].split(): + pkg = pkg_of_src(src) + print pkg + --- edos-debcheck-1.0.orig/debian/contrib/edos-builddebcheck.1 +++ edos-debcheck-1.0/debian/contrib/edos-builddebcheck.1 @@ -0,0 +1,72 @@ +.TH EDOS-BUILDDEBCHECK 1 2008-08-17 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. + +.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 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) --- edos-debcheck-1.0.orig/debian/patches/03nonalphanumerics.dpatch +++ edos-debcheck-1.0/debian/patches/03nonalphanumerics.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03nonalphanumerics.dpatch by Ralf Treinen +## +## DP: Do not crash on version numbes containing non-alphanumeics. +## DP: Patch by Julien Cristau (thanks!) + +@DPATCH@ +diff -urNad trunk~/deb.ml trunk/deb.ml +--- trunk~/deb.ml 2006-07-02 18:39:30.000000000 +0200 ++++ trunk/deb.ml 2007-06-13 18:46:08.000000000 +0200 +@@ -144,7 +144,7 @@ + ("[ \t]+\\|\\(" ^ + String.concat "\\|" + [","; "|"; "("; ")"; "<<"; "<="; "="; ">="; ">>"; "<"; ">"; +- "[A-Za-z0-9.:_+~-]+"] ^ ++ "[A-Za-z0-9.:_+~\127-\255-]+"] ^ + "\\)") + + let rec next_token s p = +@@ -183,7 +183,7 @@ + | _ -> failwith (Format.sprintf "Bad relation '%s'" (cur s)) + in + next s; +- let version = split_version (cur s) in ++ let version = try split_version (cur s) with _ -> (0, "0", None) in + next s; + expect s ")"; + (name, Some (comp, version)) --- edos-debcheck-1.0.orig/debian/patches/00dpatch.conf +++ edos-debcheck-1.0/debian/patches/00dpatch.conf @@ -0,0 +1,2 @@ +conf_debianonly=1 +conf_origtargzpath=../tarballs --- edos-debcheck-1.0.orig/debian/patches/02tilde_in_version.dpatch +++ edos-debcheck-1.0/debian/patches/02tilde_in_version.dpatch @@ -0,0 +1,84 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02tilde_in_version.dpatch based on a patch by Julien Cristau +## +## +## DP: Allow the tilde character in version numbers + +@DPATCH@ +diff -urNad trunk~/deb.ml trunk/deb.ml +--- trunk~/deb.ml 2006-07-02 18:39:30.000000000 +0200 ++++ trunk/deb.ml 2006-09-09 20:32:55.000000000 +0200 +@@ -103,19 +103,19 @@ + let strict_version_re_1 = + Str.regexp + ("^\\(\\([0-9]+\\):\\)?" ^ +- "\\([0-9][A-Za-z0-9.:+-]*\\)" ^ +- "-\\([A-Za-z0-9.+]+\\)$") ++ "\\([0-9][A-Za-z0-9.:+~-]*\\)" ^ ++ "-\\([A-Za-z0-9.+~]+\\)$") + let strict_version_re_2 = + Str.regexp + ("^\\(\\([0-9]+\\):\\)?" ^ +- "\\([0-9][A-Za-z0-9.:+]*\\)\\( \\)?$") ++ "\\([0-9][A-Za-z0-9.:+~]*\\)\\( \\)?$") + (* Some upstream version do not start with a digit *) + let version_re_1 = + Str.regexp +- "^\\(\\([0-9]+\\):\\)?\\([A-Za-z0-9._:+-]+\\)-\\([A-Za-z0-9.+]+\\)$" ++ "^\\(\\([0-9]+\\):\\)?\\([A-Za-z0-9._:+~-]+\\)-\\([A-Za-z0-9.+~]+\\)$" + let version_re_2 = + Str.regexp +- "^\\(\\([0-9]+\\):\\)?\\([A-Za-z0-9._:+]+\\)\\( \\)?$" ++ "^\\(\\([0-9]+\\):\\)?\\([A-Za-z0-9._:+~]+\\)\\( \\)?$" + + let split_version s = + if not (Str.string_match strict_version_re_1 s 0 || +@@ -144,7 +144,7 @@ + ("[ \t]+\\|\\(" ^ + String.concat "\\|" + [","; "|"; "("; ")"; "<<"; "<="; "="; ">="; ">>"; "<"; ">"; +- "[A-Za-z0-9.:_+-]+"] ^ ++ "[A-Za-z0-9.:_+~-]+"] ^ + "\\)") + + let rec next_token s p = +@@ -344,7 +344,11 @@ + let is_num c = c >= '0' && c <= '9' + + let char_map = +- Array.init 256 (fun c -> if is_letter (Char.chr c) then c else c + 256) ++ Array.init 256 ++ (fun c -> ++ if Char.chr c = '~' then c - 256 else ++ if is_letter (Char.chr c) then c else ++ c + 256) + + let compare_ver_char c1 c2 = + compare (char_map.(Char.code c1)) (char_map.(Char.code c2)) +@@ -357,12 +361,20 @@ + while !p1 < l1 && !p2 < l2 && s1.[!p1] = s2.[!p2] do + incr p1; incr p2 + done; +- if !p1 = l1 then begin +- if !p2 = l2 then 0 else -1 +- end else if !p2 = l2 then +- 1 +- else +- compare_ver_char s1.[!p1] s2.[!p2] ++ if !p1 = l1 ++ then ++ if !p2 = l2 ++ then ++ 0 ++ else ++ if s2.[!p2] = '~' then 1 else -1 ++ else ++ if !p2 = l2 ++ then ++ if s1.[!p1] = '~' then -1 else 1 ++ else ++ compare_ver_char s1.[!p1] s2.[!p2] ++ + + let first_num s p l = + let p = ref p in --- edos-debcheck-1.0.orig/debian/patches/01Makefile.dpatch +++ edos-debcheck-1.0/debian/patches/01Makefile.dpatch @@ -0,0 +1,44 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01Makefile.dpatch by Ralf Treinen +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add target fro byte code compilation + +@DPATCH@ +diff -urNad trunk~/Makefile trunk/Makefile +--- trunk~/Makefile 2006-07-02 18:41:29.000000000 +0200 ++++ trunk/Makefile 2006-07-05 18:32:53.000000000 +0200 +@@ -5,9 +5,13 @@ + + OBJS = util.cmx common.cmx solver.cmx + OPTLINKFLAGS=unix.cmxa str.cmxa ++BYTEOBJS=${OBJS:%.cmx=%.cmo} ++BYTELINKFLAGS=${OPTLINKFLAGS:%.cmxa=%.cma} + + all: debcheck rpmcheck + ++byte: debcheck.byte rpmcheck.byte ++ + rpmcheck: $(OBJS) rpm.cmx + $(OCAMLOPT) -o $@ $(OPTLINKFLAGS) $^ $(LINKFLAGS) + +@@ -17,6 +21,13 @@ + + ##### + ++rpmcheck.byte: $(BYTEOBJS) rpm.cmo ++ $(OCAMLC) -o $@ $(BYTELINKFLAGS) $^ $(LINKFLAGS) ++ ++debcheck.byte: $(BYTEOBJS) deb.cmo ++ $(OCAMLC) -o $@ $(BYTELINKFLAGS) $^ $(LINKFLAGS) ++ ++ + clean:: + find . -regex ".*\\.\(cm[oix]\|o\)" | xargs rm -f + +@@ -51,4 +62,4 @@ + $(OCAMLDEP) $(DEPFLAGS) $$i \ + > .depend + +-include .depend ++-include .depend --- edos-debcheck-1.0.orig/debian/patches/04quiet_option.dpatch +++ edos-debcheck-1.0/debian/patches/04quiet_option.dpatch @@ -0,0 +1,138 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 04quiet_option.dpatch by Stefano Zacchiroli +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: add support for a -quiet option which suppresses extra messages (timing, +## DP: warnings, progress percentages) + +@DPATCH@ +diff -urNad trunk~/common.ml trunk/common.ml +--- trunk~/common.ml 2006-07-02 18:39:30.000000000 +0200 ++++ trunk/common.ml 2008-07-15 16:35:22.711326075 +0200 +@@ -32,8 +32,9 @@ + + let stop_parsing st = + Util.set_msg ""; +- Format.eprintf "Parsing package file... %.1f seconds %6d packages@." +- (Unix.gettimeofday () -. st.time) st.count ++ if not !Util.quiet then ++ Format.eprintf "Parsing package file... %.1f seconds %6d packages@." ++ (Unix.gettimeofday () -. st.time) st.count + + (****) + +@@ -57,5 +58,6 @@ + + let stop_generate st = + Util.set_msg ""; +- Format.eprintf "Generating constraints... %.1f seconds@." ++ if not !Util.quiet then ++ Format.eprintf "Generating constraints... %.1f seconds@." + (Unix.gettimeofday () -. st.time); +diff -urNad trunk~/deb.ml trunk/deb.ml +--- trunk~/deb.ml 2008-07-15 16:32:58.252325215 +0200 ++++ trunk/deb.ml 2008-07-15 16:33:28.439326474 +0200 +@@ -741,6 +741,8 @@ + " Explain the results"; + "-rules", Arg.Unit (fun () -> print_rules := true), + " Print generated rules"; ++ "-quiet", Arg.Set Util.quiet, ++ "do not emit warnings nor progress/timing info"; + "-failures", + Arg.Unit (fun () -> show_success := false), + " Only show failures"; +@@ -813,8 +815,9 @@ + end + done; + Util.set_msg ""; +-Format.eprintf "Checking packages... %.1f seconds@." +-(Unix.gettimeofday () -. t); ++if not !Util.quiet then ++ Format.eprintf "Checking packages... %.1f seconds@." ++ (Unix.gettimeofday () -. t); + + + (* +diff -urNad trunk~/rpm.ml trunk/rpm.ml +--- trunk~/rpm.ml 2006-07-02 18:39:30.000000000 +0200 ++++ trunk/rpm.ml 2008-07-15 16:33:51.491355724 +0200 +@@ -885,6 +885,8 @@ + "-rules", Arg.Unit (fun () -> print_rules := true), + " Print generated rules"; + *) ++ "-quiet", Arg.Set Util.quiet, ++ "do not emit warnings nor progress/timing info"; + "-failures", + Arg.Unit (fun () -> show_success := false), + " Only show failures"; +@@ -970,5 +972,6 @@ + end + done; + Util.set_msg ""; +-Format.eprintf "Checking packages... %.1f seconds@." +-(Unix.gettimeofday () -. t); ++if not !Util.quiet then ++ Format.eprintf "Checking packages... %.1f seconds@." ++ (Unix.gettimeofday () -. t); +diff -urNad trunk~/util.ml trunk/util.ml +--- trunk~/util.ml 2006-07-02 18:39:30.000000000 +0200 ++++ trunk/util.ml 2008-07-15 16:32:58.432364246 +0200 +@@ -1,11 +1,12 @@ + + let enable_msgs = (* isatty is not available...*) + (Unix.fstat Unix.stderr).Unix.st_kind = Unix.S_CHR ++let quiet = ref false + + let cur_msg = ref "" + + let hide_msg () = +- if !cur_msg <> "" then begin ++ if not !quiet && !cur_msg <> "" then begin + prerr_string "\r"; + prerr_string (String.make (String.length !cur_msg) ' '); + prerr_string "\r"; +@@ -13,10 +14,11 @@ + end + + let show_msg () = +- if !cur_msg <> "" then begin prerr_string !cur_msg; flush stderr end ++ if not !quiet && !cur_msg <> "" then ++ begin prerr_string !cur_msg; flush stderr end + + let set_msg s = +- if enable_msgs && s <> !cur_msg then begin ++ if enable_msgs && not !quiet && s <> !cur_msg then begin + hide_msg (); cur_msg := s; show_msg () + end + +@@ -28,12 +30,14 @@ + let reset_warning_location () = warn_loc := None + + let print_warning s = +- hide_msg (); +- begin match !warn_loc with +- None -> Format.eprintf "Warning: %s@." s +- | Some s' -> Format.eprintf "Warning (%s): %s@." s' s +- end; +- show_msg () ++ if not !quiet then begin ++ hide_msg (); ++ begin match !warn_loc with ++ None -> Format.eprintf "Warning: %s@." s ++ | Some s' -> Format.eprintf "Warning (%s): %s@." s' s ++ end; ++ show_msg () ++ end + + let fail s = + hide_msg (); +diff -urNad trunk~/util.mli trunk/util.mli +--- trunk~/util.mli 2006-07-02 18:39:30.000000000 +0200 ++++ trunk/util.mli 2008-07-15 16:32:58.432364246 +0200 +@@ -6,5 +6,6 @@ + val set_warning_location : string -> unit + val reset_warning_location : unit -> unit + val print_warning : string -> unit ++val quiet : bool ref + + val fail : string -> 'a --- edos-debcheck-1.0.orig/debian/patches/00list +++ edos-debcheck-1.0/debian/patches/00list @@ -0,0 +1,4 @@ +01Makefile +02tilde_in_version +03nonalphanumerics.dpatch +04quiet_option.dpatch