samtools,bcftools: Use SUBST to properly patch test script

This commit is contained in:
Jason Bacon 2020-07-23 09:24:12 -05:00
parent 1c1c9244d6
commit e17c741063
6 changed files with 14 additions and 76 deletions

View File

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

View File

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

View File

@ -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);

View File

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

View File

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

View File

@ -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; }