[Pkg-ocaml-maint-commits] r1611 - trunk/tools/build-dep-graph

Stefano Zacchiroli zack at costa.debian.org
Mon Aug 15 18:07:24 UTC 2005


Author: zack
Date: 2005-08-15 18:07:24 +0000 (Mon, 15 Aug 2005)
New Revision: 1611

Modified:
   trunk/tools/build-dep-graph/build-dep-graph.pl
Log:
added exception handling


Modified: trunk/tools/build-dep-graph/build-dep-graph.pl
===================================================================
--- trunk/tools/build-dep-graph/build-dep-graph.pl	2005-08-15 16:47:26 UTC (rev 1610)
+++ trunk/tools/build-dep-graph/build-dep-graph.pl	2005-08-15 18:07:24 UTC (rev 1611)
@@ -40,11 +40,20 @@
 my $aptSrc = AptPkg::Source->new();
 my $aptCache = AptPkg::Cache->new();
 
+sub exception($) {
+  my $name = shift;
+  if ($name eq "ocaml-nox-3.08") {
+    return "ocaml-nox-3.08.3";
+  } else {
+    die "Nothing known about $name :-(";
+  }
+}
+
 # return the first package which Provides the given package name. If no Provides
 # are found return 0
 sub provides($) {
   my $name = shift;
-  my $info = $aptCache->{$name} || die "Can't get cache info for $name\n";
+  my $info = $aptCache->{$name} || return exception($name);
   my @pkgs;
   if (exists $info->{"ProvidesList"}) {
     foreach my $p (@{$info->{"ProvidesList"}}) {




More information about the Pkg-ocaml-maint-commits mailing list