[med-svn] [vcftools] 03/07: make -p work without . on @INC

Andreas Tille tille at debian.org
Thu Dec 15 22:06:06 UTC 2016


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

tille pushed a commit to branch master
in repository vcftools.

commit f23cf4f34f730191b88062c5862b45f6d022e428
Author: Andreas Tille <tille at debian.org>
Date:   Thu Dec 15 18:20:41 2016 +0100

    make -p work without . on @INC
---
 debian/changelog                                   |  8 +++++
 ...f-fix-ploidy-make-p-work-without-.-on-INC.patch | 35 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 44 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index be18c4f..284bf85 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+vcftools (0.1.14+dfsg-4) UNRELEASED; urgency=medium
+
+  * make -p work without . on @INC (Thanks for the patch to Niko Tyni
+    <ntyni at debian.org>)
+    Closes: #842794
+
+ -- Andreas Tille <tille at debian.org>  Thu, 15 Dec 2016 18:19:32 +0100
+
 vcftools (0.1.14+dfsg-3) unstable; urgency=medium
   
   * Team upload
diff --git a/debian/patches/0001-vcf-fix-ploidy-make-p-work-without-.-on-INC.patch b/debian/patches/0001-vcf-fix-ploidy-make-p-work-without-.-on-INC.patch
new file mode 100644
index 0000000..4513d08
--- /dev/null
+++ b/debian/patches/0001-vcf-fix-ploidy-make-p-work-without-.-on-INC.patch
@@ -0,0 +1,35 @@
+From: Niko Tyni <ntyni at debian.org>
+Date: Thu, 15 Dec 2016 01:39:16 +0200
+Subject: [PATCH] vcf-fix-ploidy: make -p work without . on @INC
+
+'do $file' only looks in @INC for unqualified file names, so
+prefix those with './' in case '.' is not on @INC.
+
+While at it, add diagnostics if sourcing the file fails altogether.
+
+Bug-Debian: https://bugs.debian.org/842794
+---
+ src/perl/vcf-fix-ploidy | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+--- a/src/perl/vcf-fix-ploidy
++++ b/src/perl/vcf-fix-ploidy
+@@ -75,7 +75,17 @@ sub parse_params
+     };
+     while (defined(my $arg=shift(@ARGV)))
+     {
+-        if ( $arg eq '-p' || $arg eq '--ploidy' ) { my $file=shift(@ARGV); my $x=do $file; $$opts{ploidy}=$x; next }
++        if ( $arg eq '-p' || $arg eq '--ploidy' ) {
++            my $file=shift(@ARGV);
++            $file = "./$file" if $file !~ m{^/};
++            my $x=do $file;
++            if (!defined $x) {
++                error("problem parsing \"$file\": $@") if $@;
++                error("problem doing \"$file\": $!");
++            }
++            $$opts{ploidy}=$x;
++            next
++        }
+         if ( $arg eq '-s' || $arg eq '--samples' ) { $$opts{samples}=shift(@ARGV); next }
+         if ( $arg eq '-a' || $arg eq '--assumed-sex' ) { $$opts{assumed_sex}=shift(@ARGV); next }
+         if ( $arg eq '-l' || $arg eq '--fix-likelihoods' ) { $$opts{fix_likelihoods}=1; next }
diff --git a/debian/patches/series b/debian/patches/series
index 302b7fc..ee3cfde 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 temporary_test_fix.patch
 spelling.patch
 manpage.patch
+0001-vcf-fix-ploidy-make-p-work-without-.-on-INC.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/vcftools.git



More information about the debian-med-commit mailing list