r25836 - in /packages/experimental/gobject-introspection/debian: changelog dh_girepository

pochu at users.alioth.debian.org pochu at users.alioth.debian.org
Sat Dec 11 11:09:19 UTC 2010


Author: pochu
Date: Sat Dec 11 11:09:18 2010
New Revision: 25836

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=25836
Log:
  - Add a -i option to look for dependencies in the specified
    directories.
  - Every extra parameter without an option is now an extra directory
    where to look for the typelibs in the package, in addition to
    usr/lib/girepository-1.0/.

Modified:
    packages/experimental/gobject-introspection/debian/changelog
    packages/experimental/gobject-introspection/debian/dh_girepository

Modified: packages/experimental/gobject-introspection/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/experimental/gobject-introspection/debian/changelog?rev=25836&op=diff
==============================================================================
--- packages/experimental/gobject-introspection/debian/changelog [utf-8] (original)
+++ packages/experimental/gobject-introspection/debian/changelog [utf-8] Sat Dec 11 11:09:18 2010
@@ -9,6 +9,11 @@
   * debian/dh_girepository:
     - Implement the above changes, aborting if the package name is not
       correct or if the dependencies don't have the same format.
+    - Add a -i option to look for dependencies in the specified
+      directories.
+    - Every extra parameter without an option is now an extra directory
+      where to look for the typelibs in the package, in addition to
+      usr/lib/girepository-1.0/.
   * debian/control.in,
     debian/gir1.*:
     - Rename the gir packages to gir1.2* to follow the new policy.

Modified: packages/experimental/gobject-introspection/debian/dh_girepository
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/experimental/gobject-introspection/debian/dh_girepository?rev=25836&op=diff
==============================================================================
--- packages/experimental/gobject-introspection/debian/dh_girepository [utf-8] (original)
+++ packages/experimental/gobject-introspection/debian/dh_girepository [utf-8] Sat Dec 11 11:09:18 2010
@@ -12,7 +12,7 @@
 
 =head1 SYNOPSIS
 
-B<dh_girepository> [I<debhelper options>] [-lI<directory>] [-X I<item> [...]]
+B<dh_girepository> [I<debhelper options>] [-lI<directory>] [-iI<directory>] [-XI<item>] [I<private [...]>]
 
 =head1 DESCRIPTION
 
@@ -32,10 +32,20 @@
 are scanned. This option is only necessary if those files are not shipped in
 another, architecture-dependent package.
 
-=item B<-X> I<item>
+=item B<-i>I<directory>
+
+Specify a directory (or a colon-separated list of directories) where to look
+for the dependencies. This is useful when a dependency ships the .typelib
+in a private directory.
+
+=item B<-X>I<item>
 
 Exclude files that contain I<item> anywhere in their filename from being
 analyzed.
+
+=item I<private [...]>
+List of directories where to look for typelibs. Useful when the package
+installs its typelibs in a private directory, such as /usr/lib/<package>.
 
 =back
 
@@ -48,10 +58,15 @@
 # Initialisation code
 init(options => {
     "l=s", => \$dh{L_PARAMS},
+    "i=s", => \$dh{I_PARAMS},
 });
 my @paths_first = ();
+my @privdirs = ();
 if ($dh{L_PARAMS}) {
     push @paths_first, split /:/, $dh{L_PARAMS};
+}
+if ($dh{I_PARAMS}) {
+    push @privdirs, split /:/, $dh{I_PARAMS};
 }
 isnative($dh{MAINPACKAGE}); # Necessary to have $dh{VERSION}
 my $bin_version = $dh{VERSION};
@@ -138,6 +153,13 @@
             return;
         }
     }
+    foreach my $privpath (@privdirs) {
+        if (-f "$privpath/$req") {
+            verbose_print ("  found in $privpath");
+            $fullpath = "$privpath/$req";
+            last;
+        }
+    }
     error("Could not find $req dependency") unless -f "$fullpath";
     my @output = (split ':', `dpkg -S $fullpath 2>/dev/null`);
     error("$fullpath does not belong to any package") unless @output;
@@ -210,13 +232,15 @@
 foreach my $package (@{$dh{DOPACKAGES}}) {
     my $tmp = tmpdir($package);
     my $ext = pkgext($package);
-    my $typelibdir = "$tmp$typelib_path";
     my @bin_files = ();
     my @c_files = ();
     my @typelib_deps = ();
-    next unless -d $typelibdir;
-    opendir(DIRHANDLE, $typelibdir);
-    while (my $typelib = readdir(DIRHANDLE)) {
+    push (@ARGV, $typelib_path);
+    foreach my $dir (@ARGV) {
+      my $typelibdir = "$tmp$dir";
+      next unless -d $typelibdir;
+      opendir(DIRHANDLE, $typelibdir);
+      while (my $typelib = readdir(DIRHANDLE)) {
         next unless $typelib =~ /\.typelib$/;
         next if excludefile ($typelib);
         my $girfile = find_gir ($typelib);
@@ -260,7 +284,9 @@
         }
         close $f;
         error("Unable to determine gir format") unless $format;
-        error("Package name $package doesn't match gir format $format") unless $package =~ /^gir$format/;
+        error("Package name $package doesn't match gir format $format")
+            unless $package =~ /^gir$format/
+            or not $typelibdir =~ /usr\/lib\/girepository/;
         verbose_print(sprintf("  %d symbols found", $#symbols+1));
         if (@libraries or @symbols) {
             my $c_file = "$typelibdir/$typelib.c";
@@ -283,6 +309,7 @@
             doit (("gcc", "-shared", "-fPIC", "-o", $bin_file, $c_file, @libraries));
             push @bin_files, $bin_file;
         }
+      }
     }
     if (@bin_files) {
         # dpkg-shlibdeps expects this directory to exist




More information about the pkg-gnome-commits mailing list