[Pkg-ocaml-maint-commits] [SCM] dh-ocaml packaging branch, master, updated. debian/0.9.3-12-gf08c471

Mehdi Dogguy mehdi at debian.org
Thu Apr 22 22:00:03 UTC 2010


The following commit has been merged in the master branch:
commit f08c47181753c1cceea10d83cb993c0b197abc81
Author: Mehdi Dogguy <mehdi at debian.org>
Date:   Thu Apr 22 23:37:04 2010 +0200

    dh_ocamldoc: add --doc-base-generate option

diff --git a/debhelper/dh_ocamldoc b/debhelper/dh_ocamldoc
index 750e1a8..92ea5f3 100755
--- a/debhelper/dh_ocamldoc
+++ b/debhelper/dh_ocamldoc
@@ -59,6 +59,10 @@ ocamlfind options such as: -package, -predicates, etc.).
 
 Lines starting with "#" in *ocamldoc files are comments and hence ignored.
 
+If you want to install the documentation present in upstream's tarball (if
+any), you may add "--doc-base-generate" in your .ocamldoc file in order to tell
+dh_ocamldoc generate the .doc-base file only.
+
 =head1 OPTIONS
 
 =over 4
@@ -132,6 +136,7 @@ sub read_ocamldoc_file($) {
     my ($file) = @_;
     open (OCAMLDOC, "< $file");
     my $use_ocamlfind = 0;
+    my $skip_ocamldoc = 0;
     my $html_dir = "html/api";
     my $content = "";
     while (<OCAMLDOC>) {
@@ -163,12 +168,16 @@ sub read_ocamldoc_file($) {
                 }
             }
         } else {
+            if (/(^|\s+)--doc-base-generate\b/) {
+                $skip_ocamldoc = 1;
+                s/--doc-base-generate//;
+            }
             $content .= " $_ ";
         }
     }
     close OCAMLDOC;
     $html_dir = "html/api" if $html_dir eq "";
-    return ($content, $html_dir, $use_ocamlfind);
+    return ($content, $html_dir, $use_ocamlfind, $skip_ocamldoc);
 }
 
 # Generate all documentations and doc-base files for a binary package
@@ -182,7 +191,11 @@ sub do_doc_package($@) {
         # Set doc-base document id
         my $document_name = $fdoc;
         $document_name =~ s/debian\/.*(\.)?ocamldoc//g;
-        my ($ocamldoc_flags, $html_dir, $use_ocamlfind) = read_ocamldoc_file($fdoc);
+        my ($ocamldoc_flags, $html_dir, $use_ocamlfind, $skip_ocamldoc) = read_ocamldoc_file($fdoc);
+        if ($skip_ocamldoc) {
+            generate_docbase($package, $html_dir, $document_name);
+            next;
+        }
         if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
             $ocamldoc_flags .= ' -and ! \( '.$dh{EXCLUDE_FIND}.' \)';
         }
diff --git a/debian/changelog b/debian/changelog
index 2455566..cbf5728 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ dh-ocaml (0.9.4) UNRELEASED; urgency=low
     + Make different titles when a package ships several documentations.
     + Pass -sort to ocamldoc to sort the list of top-level modules before
       generating the documentation.
+    + When "--doc-base-generate" is found in a .ocamldoc file, dh_ocamldoc
+      will generate the corresponding .doc-base file only (Closes: #549930)
   * dom-git-checkout.1: Mention how to configure the username (Closes: #570363)
 
   [ Stéphane Glondu ]
@@ -17,7 +19,7 @@ dh-ocaml (0.9.4) UNRELEASED; urgency=low
   * Make dh-ocaml conflict with previous versions of ocaml
     (Closes: #569195)
 
- -- Mehdi Dogguy <mehdi at debian.org>  Thu, 22 Apr 2010 22:11:09 +0200
+ -- Mehdi Dogguy <mehdi at debian.org>  Thu, 22 Apr 2010 23:08:54 +0200
 
 dh-ocaml (0.9.3) unstable; urgency=low
 

-- 
dh-ocaml packaging



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