[Pkg-octave-commit] [octave-pkg-dev] 02/03: octave-pkg-helper: Only parse the DESCRIPTION file when it exists

Rafael Laboissière rlaboiss-guest at moszumanska.debian.org
Sun Jun 5 14:48:01 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 1715b67a05640bd6738157ca6250b785a08d0a3e
Author: Rafael Laboissiere <rafael at laboissiere.net>
Date:   Sun Jun 5 11:19:49 2016 -0300

    octave-pkg-helper: Only parse the DESCRIPTION file when it exists
    
    Closes: #826390
---
 octave-pkg-helper | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/octave-pkg-helper b/octave-pkg-helper
index 5954435..f8daa45 100755
--- a/octave-pkg-helper
+++ b/octave-pkg-helper
@@ -29,24 +29,28 @@ use MIME::Head;
 init ();
 
 my %depends = ();
+my $desc = "";
 
 my $octave_version = qx {/usr/bin/octave-config --print VERSION};
 $octave_version =~ s/-rc/~rc/;
 
-my $fields = MIME::Head->new->from_file ("DESCRIPTION");
+if (-f "DESCRIPTION") {
 
-my $deps = $fields->get ('depends');
-map {
-    if (/([^ ]+) \((.*)\)/) {
-	$depends {"octave-$1"} = $2;
-    } else {
-	$depends {"octave-$_"} = "";
-    }
-} grep {not /^octave/i} split (", ", $deps);
+    my $fields = MIME::Head->new->from_file ("DESCRIPTION");
+
+    my $deps = $fields->get ('depends');
+    map {
+	if (/([^ ]+) \((.*)\)/) {
+	    $depends {"octave-$1"} = $2;
+	} else {
+	    $depends {"octave-$_"} = "";
+	}
+    } grep {not /^octave/i} split (", ", $deps);
 
-my $desc = $fields->get ('description');
-$desc =~ s/\n */\n/g;
-$desc =~ s/\n/\${Newline}/g;
+    $desc = $fields->get ('description');
+    $desc =~ s/\n */\n/g;
+    $desc =~ s/\n/\${Newline}/g;
+}
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
     delsubstvar ($package, 'octave:Depends');

-- 
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