[Pkg-ocaml-maint-commits] [SCM] oasis2debian project branch, master, updated. 94ae27000298101188a629fbcc6b28420021fe10

Sylvain Le Gall gildor at debian.org
Sat Nov 20 00:59:08 UTC 2010


The following commit has been merged in the master branch:
commit 757de603c2065cac4d153b3356fdb1087566ff21
Author: Sylvain Le Gall <gildor at debian.org>
Date:   Sat Nov 20 01:14:05 2010 +0100

    Make a difference between OASIS name and debian name

diff --git a/src/Common.ml b/src/Common.ml
index 20e1568..cd6b6b0 100644
--- a/src/Common.ml
+++ b/src/Common.ml
@@ -16,6 +16,7 @@ type t =
     description:   string;
     homepage:      string;
     uploader:      string;
+    deb_name:      string;
 
     (** Pristine OASIS package *)
     pkg:           OASISTypes.package;
diff --git a/src/Control.ml b/src/Control.ml
index 5080471..405b434 100644
--- a/src/Control.ml
+++ b/src/Control.ml
@@ -16,7 +16,7 @@ let create t =
   in
 
   let src_name = 
-    t.pkg.OASISTypes.name
+    t.deb_name
   in
 
   let description = 
diff --git a/src/Copyright.ml b/src/Copyright.ml
index dab65f7..f70078f 100644
--- a/src/Copyright.ml
+++ b/src/Copyright.ml
@@ -161,7 +161,7 @@ let create ~ctxt t =
            output_content 
              (interpolate "\
 Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
-Name: $t.pkg.OASISTypes.name
+Name: $t.deb_name
 Maintainer: $t.uploader
 
 Files: *
diff --git a/src/DhFiles.ml b/src/DhFiles.ml
index 2b26195..6e1ee44 100644
--- a/src/DhFiles.ml
+++ b/src/DhFiles.ml
@@ -105,7 +105,7 @@ let create ~ctxt t =
     in
       print
         (interpolate "\
-Document: $t.pkg_generic.OASISTypes.name-$cs.cs_name
+Document: $t.deb_name-$cs.cs_name
 Title: $doc.doc_title
 Section: Programming/OCaml");
       begin
diff --git a/src/GenPkg.ml b/src/GenPkg.ml
index cde0dbe..abea78f 100644
--- a/src/GenPkg.ml
+++ b/src/GenPkg.ml
@@ -105,7 +105,7 @@ let set ~ctxt t =
           begin
             (* Only a binary package, name = source name *)
             let base_name = 
-              t.pkg_generic.OASISTypes.name
+              t.deb_name
             in
               add_doc 
                 (base_name^"-doc")
diff --git a/src/Main.ml b/src/Main.ml
index ed6b452..65031d2 100644
--- a/src/Main.ml
+++ b/src/Main.ml
@@ -1,5 +1,6 @@
 
 open OASISTypes
+open OASISMessage
 open FileUtil
 open Common
 
@@ -31,6 +32,12 @@ let uploader =
           with _ ->
             failwith "Unable to guess uploader"))
 
+let deb_name =
+  Conf.create 
+    ~cli:"--debian-name"
+    "Source package name in Debian (e.g. extunix become ocaml-extunix)"
+    Conf.ShortInput
+
 let itp =
   Conf.create
     ~cli:"--itp"
@@ -84,6 +91,18 @@ let () =
   in
 
   let () = 
+    let cur_dn = FilePath.dirname (pwd ()) in
+    let pkg_nm = pkg.OASISTypes.name in
+      if pkg_nm = cur_dn then
+        Conf.set deb_name cur_dn
+      else
+        warning ~ctxt 
+          "OASIS name (%s) and directory name (%s) are not the same, \
+           cannot set Debian name"
+          pkg_nm cur_dn
+  in
+
+  let () = 
     Arg.parse
       (Arg.align !Conf.all_args)
       (fun s -> 
@@ -102,6 +121,7 @@ let () =
       description   = Conf.get ~ctxt description;
       homepage      = Conf.get ~ctxt homepage;
       uploader      = Conf.get ~ctxt uploader;
+      deb_name      = Conf.get ~ctxt deb_name;
       pkg           = pkg;
       pkg_generic   = pkg_generic;
       expr          = expr;
@@ -160,7 +180,7 @@ let () =
         in
           assert_command ~ctxt  
             (interpolate 
-               "dch --create --package $pkg.OASISTypes.name --newversion $pkg_version-1 --closes $itp $opts")
+               "dch --create --package $t.deb_name --newversion $pkg_version-1 --closes $itp $opts")
       end
   in
 
diff --git a/src/Rules.ml b/src/Rules.ml
index a1c2673..4c1d115 100644
--- a/src/Rules.ml
+++ b/src/Rules.ml
@@ -5,12 +5,12 @@ open Common
 let create t = 
   let destdir = 
     match t.deb_std, t.deb_dev, t.deb_doc with
-      | Some _, None, None 
-      | _, _, Some _ ->
+      | Some deb_pkg, None, None 
+      | _, _, Some deb_pkg ->
           (* Only one package, move data directly into 
            * it
            *)
-          t.pkg.OASISTypes.name
+          deb_pkg.name
       | _, _, _ ->
           (* More than 1 package, we need to install files
            * in different packages 

-- 
oasis2debian project



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