pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

samtools,bcftools: Use SUBST to properly patch test script



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Thu Jul 23 09:24:12 2020 -0500
Changeset:	e17c7410633b77aa4dff57012176e7bc102460bc

Modified Files:
	bcftools/Makefile
	bcftools/distinfo
	samtools/Makefile
	samtools/distinfo
Removed Files:
	bcftools/patches/patch-test_test.pl
	samtools/patches/patch-test_test.pl

Log Message:
samtools,bcftools: Use SUBST to properly patch test script

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e17c7410633b77aa4dff57012176e7bc102460bc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 bcftools/Makefile                   |  6 ++++++
 bcftools/distinfo                   |  1 -
 bcftools/patches/patch-test_test.pl | 42 -------------------------------------
 samtools/Makefile                   | 10 +++++++--
 samtools/distinfo                   |  1 -
 samtools/patches/patch-test_test.pl | 30 --------------------------
 6 files changed, 14 insertions(+), 76 deletions(-)

diffs:
diff --git a/bcftools/Makefile b/bcftools/Makefile
index ba2eef4b79..0794f984b3 100644
--- a/bcftools/Makefile
+++ b/bcftools/Makefile
@@ -17,6 +17,12 @@ SUBST_STAGE.version=	pre-configure
 SUBST_SED.version=	-e "s|m4_esyscmd_s(\[./version.sh 2>/dev/null\])|[${PKGVERSION_NOREV}]|"
 SUBST_FILES.version=	configure.ac
 
+SUBST_CLASSES+=		bash
+SUBST_STAGE.bash=	pre-configure
+SUBST_SED.bash+=	-e 's|/bin/bash|${PREFIX}/bin/bash|'
+SUBST_SED.bash+=	-e 's|\\/bin\\/bash|${PREFIX:S,/,\\\/,g}\\/bin\\/bash|'
+SUBST_FILES.bash=	test/test.pl
+
 REPLACE_PERL+=		misc/*.pl
 REPLACE_PERL+=		misc/fix-broken-GATK-Double-vs-Integer
 REPLACE_PERL+=		misc/plot-vcfstats
diff --git a/bcftools/distinfo b/bcftools/distinfo
index 3bfd9db0fd..fcd6846ef3 100644
--- a/bcftools/distinfo
+++ b/bcftools/distinfo
@@ -6,4 +6,3 @@ SHA512 (bcftools-1.10.2.tar.gz) = 12c004603db557ac69098e83ad3aaa5762b02b4718b79f
 Size (bcftools-1.10.2.tar.gz) = 2880994 bytes
 SHA1 (patch-Makefile) = 1f1397e9b0389a7b4fccc9eae87981e7ce1d7980
 SHA1 (patch-misc_run-roh.pl) = 8a29ee7b1001af6670955f174ce4dbab31f05659
-SHA1 (patch-test_test.pl) = 5fc3896d9013a6d5caa24a4d3e6798905d1243e1
diff --git a/bcftools/patches/patch-test_test.pl b/bcftools/patches/patch-test_test.pl
deleted file mode 100644
index ae6bd1a5dc..0000000000
--- a/bcftools/patches/patch-test_test.pl
+++ /dev/null
@@ -1,42 +0,0 @@
-$NetBSD$
-
-# Portable bash path
-
---- test/test.pl.orig	2020-07-21 20:47:32.977230067 +0000
-+++ test/test.pl
-@@ -610,7 +610,7 @@ sub _cmd
-     else
-     {
-         # child
--        exec('/bin/bash', '-o','pipefail','-c', $cmd) or error("Cannot execute the command [/bin/sh -o pipefail -c $cmd]: $!");
-+        exec('bash', '-o','pipefail','-c', $cmd) or error("Cannot execute the command [/bin/sh -o pipefail -c $cmd]: $!");
-     }
-     return ($? >> 8, join('',@out));
- }
-@@ -622,7 +622,7 @@ sub _cmd3
-     my $pid = fork();
-     if ( !$pid )
-     {
--        exec('/bin/bash', '-o','pipefail','-c', "($cmd) 2>$tmp.e >$tmp.o");
-+        exec('bash', '-o','pipefail','-c', "($cmd) 2>$tmp.e >$tmp.o");
-     }
-     waitpid($pid,0);
- 
-@@ -1063,7 +1063,7 @@ sub test_usage
-     my $command = $args{cmd};
-     my $commandpath = $$opts{bin}."/".$command;
-     my ($ret,$out) = _cmd("$commandpath $args{redirection} 2>&1");
--    if ( $out =~ m/\/bin\/bash.*no.*such/i ) { failed($opts,$test,"could not run $commandpath: $out"); return; }
-+    if ( $out =~ m/bash.*no.*such/i ) { failed($opts,$test,"could not run $commandpath: $out"); return; }
- 
-     my @sections = ($out =~ m/(^[A-Za-z]+.*?)(?:(?=^[A-Za-z]+:)|\z)/msg);
- 
-@@ -1118,7 +1118,7 @@ sub test_usage_subcommand
-     my $subcommand = $args{subcmd};
-     my $commandpath = $$opts{bin}."/".$command;
-     my ($ret,$out) = _cmd("$commandpath $subcommand $args{redirection} 2>&1");
--    if ( $out =~ m/\/bin\/bash.*no.*such/i ) { failed($opts,$test,"could not run $commandpath $subcommand: $out"); return; }
-+    if ( $out =~ m/bash.*no.*such/i ) { failed($opts,$test,"could not run $commandpath $subcommand: $out"); return; }
- 
-     my @sections = ($out =~ m/(^[A-Za-z]+.*?)(?:(?=^[A-Za-z]+:)|\z)/msg);
- 
diff --git a/samtools/Makefile b/samtools/Makefile
index 88b5b4d4a8..6ce10c2e42 100644
--- a/samtools/Makefile
+++ b/samtools/Makefile
@@ -14,8 +14,14 @@ GNU_CONFIGURE=	yes
 
 SUBST_CLASSES+=		version
 SUBST_STAGE.version=	pre-configure
-SUBST_SED.version=	-e "s|m4_esyscmd_s(\[./version.sh 2>/dev/null\])|[${PKGVERSION_NOREV}]|"
-SUBST_FILES.version=	configure.ac
+SUBST_SED.version+=	-e "s|m4_esyscmd_s(\[./version.sh 2>/dev/null\])|[${PKGVERSION_NOREV}]|"
+SUBST_FILES.version+=	configure.ac
+
+SUBST_CLASSES+=		bash
+SUBST_STAGE.bash=	pre-configure
+SUBST_SED.bash+=	-e "s|'bash'|'${PREFIX}/bin/bash'|"
+SUBST_SED.bash+=	-e 's|\\/bin\\/bash|${PREFIX:S,/,\\\/,g}\\/bin\\/bash|'
+SUBST_FILES.bash+=	test/test.pl
 
 REPLACE_PERL+=		misc/*.pl
 REPLACE_PERL+=		test/*.pl
diff --git a/samtools/distinfo b/samtools/distinfo
index 52cef73ca3..9376bd1e4d 100644
--- a/samtools/distinfo
+++ b/samtools/distinfo
@@ -5,4 +5,3 @@ RMD160 (samtools-1.10.tar.gz) = e8d91dfc0970a0faa85d45962f76f831af331007
 SHA512 (samtools-1.10.tar.gz) = 7760a1e8a89780ac80053b136930a8ed0cc130b72c9f66cdc9c211e93b6bcc8923140e7caae9824c81caa4a2bfab3a14280e3e7d7245abeaa6f91f0f96123fda
 Size (samtools-1.10.tar.gz) = 4457760 bytes
 SHA1 (patch-Makefile) = 409ef37ff0730257d82989d866c8cba705e3ef8a
-SHA1 (patch-test_test.pl) = 7dc29671de06bfa7adadee32538a31d34817579f
diff --git a/samtools/patches/patch-test_test.pl b/samtools/patches/patch-test_test.pl
deleted file mode 100644
index ac39ec79dd..0000000000
--- a/samtools/patches/patch-test_test.pl
+++ /dev/null
@@ -1,30 +0,0 @@
-$NetBSD$
-
-# Portable bash path
-
---- test/test.pl.orig	2019-12-06 16:40:42.000000000 +0000
-+++ test/test.pl
-@@ -1,4 +1,4 @@
--#!/usr/bin/env perl
-+#!/home/bacon/Pkgsrc/pkg/bin/perl
- #
- #    Copyright (C) 2013-2019 Genome Research Ltd.
- #
-@@ -907,7 +907,7 @@ sub test_usage
-     my $command = $args{cmd};
-     my $commandpath = $$opts{bin}."/".$command;
-     my ($ret,$out,$err) = _cmd("$commandpath $args{redirection}");
--    if ( $err =~ m/\/bin\/bash.*no.*such/i ) { failed($opts,msg=>$test,reason=>"could not run $commandpath: $out"); return; }
-+    if ( $err =~ m/bash.*no.*such/i ) { failed($opts,msg=>$test,reason=>"could not run $commandpath: $out"); return; }
- 
-     my @sections = ($err =~ m/(^[A-Za-z]+.*?)(?:(?=^[A-Za-z]+:)|\z)/msg);
- 
-@@ -965,7 +965,7 @@ sub test_usage_subcommand
-     my $commandpath = $$opts{bin}."/".$command;
-     my ($ret,$out,$err) = _cmd("$commandpath $subcommand $args{redirection}");
- 
--    if ( $err =~ m/\/bin\/bash.*no.*such/i ) { failed($opts,msg=>$test,reason=>"could not run $commandpath $subcommand: $out"); return; }
-+    if ( $err =~ m/bash.*no.*such/i ) { failed($opts,msg=>$test,reason=>"could not run $commandpath $subcommand: $out"); return; }
- 
-     if ( $err =~ m/not.*implemented/is ) { failed($opts,msg=>$test,reason=>"subcommand indicates it is not implemented",expect_fail=>1); return; }
- 


Home | Main Index | Thread Index | Old Index