[Pkg-octave-commit] [octave-pkg-dev] 01/01: Add substvar for automatic inclusion of package description

Rafael Laboissière rlaboiss-guest at moszumanska.debian.org
Tue Apr 26 15:46:35 UTC 2016


This is an automated email from the git hooks/post-receive script.

rlaboiss-guest pushed a commit to branch master
in repository octave-pkg-dev.

commit 8f5df208093d1cd00b7ff4955e922d770cca6912
Author: Rafael Laboissiere <rafael at laboissiere.net>
Date:   Tue Apr 26 12:28:38 2016 -0300

    Add substvar for automatic inclusion of package description
    
    + octave-pkg-helper: Get long package description from the DESCRIPTION
      file and store it into the substvar octave:Upstream-Description.
    + make-octave-forge-debpkg.in: Use octave:Upstream-Description.in the
      template for the debian/control file
    + d/control: Build-Depends on libmime-tools-perl (for MIME::Head module)
    
    Gbp-Dch: Full
---
 debian/control              |  2 +-
 make-octave-forge-debpkg.in |  3 +--
 octave-pkg-helper           | 34 +++++++++++++++++-----------------
 3 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/debian/control b/debian/control
index 85bdba9..93f6299 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,7 @@ Vcs-Browser: https://anonscm.debian.org/gitweb/?p=pkg-octave/octave-pkg-dev.git
 Package: octave-pkg-dev
 Architecture: all
 Depends: liboctave-dev (>= 4.0.0~rc3), debhelper (>= 6), cdbs,
- dpkg-dev (>= 1.16.1~), ${misc:Depends}, ${perl:Depends}
+ libmime-tools-perl, dpkg-dev (>= 1.16.1~), ${misc:Depends}, ${perl:Depends}
 Description: infrastructure to build Octave packages
  Since version 3.0 of Octave (a numerical computation software),
  add-ons can be installed through the pkg.m system.  This package
diff --git a/make-octave-forge-debpkg.in b/make-octave-forge-debpkg.in
index a787442..903e182 100755
--- a/make-octave-forge-debpkg.in
+++ b/make-octave-forge-debpkg.in
@@ -199,8 +199,7 @@ Package: octave-$name
 Architecture: $architecture
 Depends: \${misc:Depends}, \${octave:Depends}$shlibs
 Description: $description
- #FIXME#
- .
+ \${octave:Upstream-Description}
  This Octave add-on package is part of the Octave-Forge project.
 ";
 close FID;
diff --git a/octave-pkg-helper b/octave-pkg-helper
index b394e9f..5954435 100755
--- a/octave-pkg-helper
+++ b/octave-pkg-helper
@@ -4,7 +4,7 @@
 #                    postinst/postrm scripts
 # This file is part of the octave-pkg-dev Debian package
 
-# Copyright (c) 2008, 2009, 2012  Rafael Laboissiere <rafael at laboissiere.net>
+# Copyright (c) 2008, 2009, 2012, 2016  Rafael Laboissiere <rafael at laboissiere.net>
 #
 # 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
@@ -24,6 +24,7 @@
 use strict;
 use File::Find;
 use Debian::Debhelper::Dh_Lib;
+use MIME::Head;
 
 init ();
 
@@ -32,23 +33,20 @@ my %depends = ();
 my $octave_version = qx {/usr/bin/octave-config --print VERSION};
 $octave_version =~ s/-rc/~rc/;
 
-my $deps;
-if (open (DESC, "< DESCRIPTION")) {
-    while (<DESC>) {
-        if (/Depends: (.*)/) {
-            $deps = $1;
-            last;
-        }
+my $fields = MIME::Head->new->from_file ("DESCRIPTION");
+
+my $deps = $fields->get ('depends');
+map {
+    if (/([^ ]+) \((.*)\)/) {
+	$depends {"octave-$1"} = $2;
+    } else {
+	$depends {"octave-$_"} = "";
     }
-    close DESC;
-    map {
-        if (/([^ ]+) \((.*)\)/) {
-            $depends {"octave-$1"} = $2;
-        } else {
-            $depends {"octave-$_"} = "";
-        }
-    } grep {not /^octave/i} split (", ", $deps);
-}
+} grep {not /^octave/i} split (", ", $deps);
+
+my $desc = $fields->get ('description');
+$desc =~ s/\n */\n/g;
+$desc =~ s/\n/\${Newline}/g;
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
     delsubstvar ($package, 'octave:Depends');
@@ -57,4 +55,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
         # add dependencies from the DESCRIPTION file
         addsubstvar ($package, 'octave:Depends', $pkg, $depends {$pkg});
     }
+    delsubstvar ($package, 'octave:Upstream-Description');
+    addsubstvar ($package, 'octave:Upstream-Description', $desc);
 }

-- 
Alioth's /home/groups/pkg-octave/bin/git-commit-notice on /srv/git.debian.org/git/pkg-octave/octave-pkg-dev.git



More information about the Pkg-octave-commit mailing list