[med-svn] r2444 - in trunk/packages/mafft/trunk/debian: . patches

plessy at alioth.debian.org plessy at alioth.debian.org
Mon Sep 1 12:11:45 UTC 2008


Author: plessy
Date: 2008-09-01 12:11:45 +0000 (Mon, 01 Sep 2008)
New Revision: 2444

Modified:
   trunk/packages/mafft/trunk/debian/README.Debian
   trunk/packages/mafft/trunk/debian/changelog
   trunk/packages/mafft/trunk/debian/mafft-homologs.1
   trunk/packages/mafft/trunk/debian/mafft-homologs.1.xml
   trunk/packages/mafft/trunk/debian/mafft.1
   trunk/packages/mafft/trunk/debian/mafft.1.xml
   trunk/packages/mafft/trunk/debian/patches/Securisation-by-mktemp-usage.patch
Log:
Patch reviewed and amended by Upstream.

 - Uses the Tempfile class of Ruby,
 - Corrects the `mafft' shell script as well.


Modified: trunk/packages/mafft/trunk/debian/README.Debian
===================================================================
--- trunk/packages/mafft/trunk/debian/README.Debian	2008-08-31 15:59:03 UTC (rev 2443)
+++ trunk/packages/mafft/trunk/debian/README.Debian	2008-09-01 12:11:45 UTC (rev 2444)
@@ -18,8 +18,9 @@
 % diff test.linsi sample.linsi
 
 
-The program mafft-homologs has been patched to enhance the security of
-the temporary files it creates. You can consult the patch in the Debian
-source package.
+The programs mafft and mafft-homologs have been patched to enhance the security
+of the temporary files they create. You can consult the patch in the Debian
+source package. It has been reviewed and amended by Kazutaka Katoh, the
+upstream author of MAFFT.
 
  -- Charles Plessy <charles-debian-nospam at plessy.org>  Mon, 25 Aug 2008 23:29:19 +0900

Modified: trunk/packages/mafft/trunk/debian/changelog
===================================================================
--- trunk/packages/mafft/trunk/debian/changelog	2008-08-31 15:59:03 UTC (rev 2443)
+++ trunk/packages/mafft/trunk/debian/changelog	2008-09-01 12:11:45 UTC (rev 2444)
@@ -9,7 +9,10 @@
     - debian/control: build-depend on quilt.
     - debian/rules: modified to use quilt.
     - debian/README.source: signals that the package uses quilt.
-    - debian/patches: added a patch to use mktemp (Closes: #496366).
+    - debian/patches: added a patch to use non-guessable temporary files
+      (Closes: #496366). Thanks to Dmitry E. Oboukhov for finding the bug,
+      Thijs Kinkhorst for preliminary patch and Kazutaka Katoh for the
+      final implementation.
     - debian/mafft-homologs.1*, debian/README.Debian: document that the
       program is patched.
 

Modified: trunk/packages/mafft/trunk/debian/mafft-homologs.1
===================================================================
--- trunk/packages/mafft/trunk/debian/mafft-homologs.1	2008-08-31 15:59:03 UTC (rev 2443)
+++ trunk/packages/mafft/trunk/debian/mafft-homologs.1	2008-09-01 12:11:45 UTC (rev 2444)
@@ -1,11 +1,11 @@
 .\"     Title: MAFFT-HOMOLOGS
 .\"    Author: Kazutaka Katoh <katoh_at_bioreg.kyushu-u.ac.jp.>
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 2007-06-09
+.\"      Date: 2008-09-01
 .\"    Manual: Mafft Manual
 .\"    Source: mafft-homologs 2.1
 .\"
-.TH "MAFFT\-HOMOLOGS" "1" "2007\-06\-09" "mafft-homologs 2.1" "Mafft Manual"
+.TH "MAFFT\-HOMOLOGS" "1" "2008\-09\-01" "mafft-homologs 2.1" "Mafft Manual"
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -73,9 +73,8 @@
 \fBmafft\fR(1)
 .SH "DIVERGENCE FROM UPSTREAM"
 .PP
-The program
 \fBmafft\-homologs\fR
-has been patched to enhance the security of the temporary files it creates\&. You can consult the patch in the Debian source package\&.
+has been patched to enhance the security of the temporary files it creates\&. You can consult the patch in the Debian source package\&. It has been reviewed and amended by Kazutaka Katoh, the upstream author of MAFFT\&.
 .SH "AUTHORS"
 .PP
 \fBKazutaka Katoh\fR <\&katoh_at_bioreg\&.kyushu\-u\&.ac\&.jp\&.\&>

Modified: trunk/packages/mafft/trunk/debian/mafft-homologs.1.xml
===================================================================
--- trunk/packages/mafft/trunk/debian/mafft-homologs.1.xml	2008-08-31 15:59:03 UTC (rev 2443)
+++ trunk/packages/mafft/trunk/debian/mafft-homologs.1.xml	2008-09-01 12:11:45 UTC (rev 2444)
@@ -12,7 +12,7 @@
   <!ENTITY dhemail     "charles-debian-nospam at plessy.org">
   <!ENTITY dhusername  "&dhfirstname; &dhsurname;">
   <!ENTITY dhrelease   "2.1">
-  <!ENTITY dhdate      "2007-06-09">
+  <!ENTITY dhdate      "2008-09-01">
   <!ENTITY dhtitle     "Mafft Manual">
   <!ENTITY dhucpackage "MAFFT-HOMOLOGS">
   <!ENTITY dhpackage   "mafft-homologs">
@@ -193,8 +193,9 @@
 	</refsect1>
   <refsect1>
     <title>DIVERGENCE FROM UPSTREAM</title>
-    <para>The program <command>mafft-homologs</command> has been patched to
-    enhance the security of the temporary files it creates. You can consult the
-    patch in the Debian source package.</para>
+    <para><command>mafft-homologs</command> has been patched to enhance the
+    security of the temporary files it creates. You can consult the patch in
+    the Debian source package. It has been reviewed and amended by Kazutaka
+    Katoh, the upstream author of MAFFT.</para>
   </refsect1>
 </refentry>

Modified: trunk/packages/mafft/trunk/debian/mafft.1
===================================================================
--- trunk/packages/mafft/trunk/debian/mafft.1	2008-08-31 15:59:03 UTC (rev 2443)
+++ trunk/packages/mafft/trunk/debian/mafft.1	2008-09-01 12:11:45 UTC (rev 2444)
@@ -1,17 +1,17 @@
 .\"     Title: MAFFT
 .\"    Author: Kazutaka Katoh <katoh_at_bioreg.kyushu-u.ac.jp.>
 .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 2007-06-09
+.\"      Date: 2008-09-01
 .\"    Manual: Mafft Manual
 .\"    Source: mafft 6.240
 .\"
-.TH "MAFFT" "1" "2007\-06\-09" "mafft 6.240" "Mafft Manual"
+.TH "MAFFT" "1" "2008\-09\-01" "mafft 6.240" "Mafft Manual"
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
 .ad l
 .SH "NAME"
-mafft - Multiple alignment program for amino acid or nucleotide sequences
+mafft \- Multiple alignment program for amino acid or nucleotide sequences
 .SH "SYNOPSIS"
 .HP 6
 \fBmafft\fR [\fBoptions\fR] \fIinput\fR [>\ \fIoutput\fR]
@@ -30,7 +30,7 @@
 .SH "DESCRIPTION"
 .PP
 \fBMAFFT\fR
-is a multiple sequence alignment program for unix\-like operating systems\. It offers a range of multiple alignment methods\.
+is a multiple sequence alignment program for unix\-like operating systems\&. It offers a range of multiple alignment methods\&.
 .SS "Accuracy\-oriented methods:"
 .sp
 .RS 4
@@ -60,7 +60,7 @@
 For E\-INS\-i, the
 \fB\-\-ep\fR
 \fI0\fR
-option is recommended to allow large gaps\.
+option is recommended to allow large gaps\&.
 .RE
 .SS "Speed\-oriented methods:"
 .sp
@@ -73,7 +73,7 @@
 .RE
 .sp
 .RS 4
-\h'-04'\(bu\h'+03'FFT\-NS\-i (iterative refinement method; max\. 1000 iterations):
+\h'-04'\(bu\h'+03'FFT\-NS\-i (iterative refinement method; max\&. 1000 iterations):
 .HP 6
 \fBmafft\fR \fB\-\-retree\fR\ \fI2\fR \fB\-\-maxiterate\fR\ \fI1000\fR \fIinput\fR [>\ \fIoutput\fR]
 .RE
@@ -288,19 +288,19 @@
 .SH "FILES"
 .PP
 Mafft stores the input sequences and other files in a temporary directory, which by default is located in
-\fI/tmp\fR\.
+\fI/tmp\fR\&.
 .SH "ENVIONMENT"
 .PP
 \fBMAFFT_BINARIES\fR
 .RS 4
-Indicates the location of the binary files used by mafft\. By default, they are searched in
+Indicates the location of the binary files used by mafft\&. By default, they are searched in
 \fI/usr/local/lib/mafft\fR, but on Debian systems, they are searched in
-\fI/usr/lib/mafft\fR\.
+\fI/usr/lib/mafft\fR\&.
 .RE
 .PP
 \fBFASTA_4_MAFFT\fR
 .RS 4
-This variable can be set to indicate to mafft the location to the fasta34 program if it is not in the PATH\.
+This variable can be set to indicate to mafft the location to the fasta34 program if it is not in the PATH\&.
 .RE
 .SH "SEE ALSO"
 .PP
@@ -310,15 +310,15 @@
 .SS "In English"
 .sp
 .RS 4
-\h'-04'\(bu\h'+03'Katoh and Toh (Bioinformatics 23:372\-374, 2007) PartTree: an algorithm to build an approximate tree from a large number of unaligned sequences (describes the PartTree algorithm)\.
+\h'-04'\(bu\h'+03'Katoh and Toh (Bioinformatics 23:372\-374, 2007) PartTree: an algorithm to build an approximate tree from a large number of unaligned sequences (describes the PartTree algorithm)\&.
 .RE
 .sp
 .RS 4
-\h'-04'\(bu\h'+03'Katoh, Kuma, Toh and Miyata (Nucleic Acids Res\. 33:511\-518, 2005) MAFFT version 5: improvement in accuracy of multiple sequence alignment (describes [ancestral versions of] the G\-INS\-i, L\-INS\-i and E\-INS\-i strategies)
+\h'-04'\(bu\h'+03'Katoh, Kuma, Toh and Miyata (Nucleic Acids Res\&. 33:511\-518, 2005) MAFFT version 5: improvement in accuracy of multiple sequence alignment (describes [ancestral versions of] the G\-INS\-i, L\-INS\-i and E\-INS\-i strategies)
 .RE
 .sp
 .RS 4
-\h'-04'\(bu\h'+03'Katoh, Misawa, Kuma and Miyata (Nucleic Acids Res\. 30:3059\-3066, 2002) MAFFT: a novel method for rapid multiple sequence alignment based on fast Fourier transform (describes the FFT\-NS\-1, FFT\-NS\-2 and FFT\-NS\-i strategies)
+\h'-04'\(bu\h'+03'Katoh, Misawa, Kuma and Miyata (Nucleic Acids Res\&. 30:3059\-3066, 2002) MAFFT: a novel method for rapid multiple sequence alignment based on fast Fourier transform (describes the FFT\-NS\-1, FFT\-NS\-2 and FFT\-NS\-i strategies)
 .RE
 .SS "In Japanese"
 .sp
@@ -329,19 +329,23 @@
 .RS 4
 \h'-04'\(bu\h'+03'Katoh and Kuma (????? 44:102\-108, 2006) Jissen\-teki Multiple Alignment
 .RE
+.SH "DIVERGENCE FROM UPSTREAM"
+.PP
+\fBmafft\-homologs\fR
+has been patched to enhance the security of the temporary files it creates\&. You can consult the patch in the Debian source package\&. It has been reviewed and amended by Kazutaka Katoh, the upstream author of MAFFT\&.
 .SH "AUTHORS"
 .PP
-\fBKazutaka Katoh\fR <\&katoh_at_bioreg\.kyushu\-u\.ac\.jp\.\&>
+\fBKazutaka Katoh\fR <\&katoh_at_bioreg\&.kyushu\-u\&.ac\&.jp\&.\&>
 .sp -1n
 .IP "" 4
-Wrote Mafft\.
+Wrote Mafft\&.
 .PP
-\fBCharles Plessy\fR <\&charles\-debian\-nospam at plessy\.org\&>
+\fBCharles Plessy\fR <\&charles\-debian\-nospam at plessy\&.org\&>
 .sp -1n
 .IP "" 4
-Wrote this manpage in DocBook XML for the Debian distribution, using Mafft\'s homepage as a template\.
+Wrote this manpage in DocBook XML for the Debian distribution, using Mafft\'s homepage as a template\&.
 .SH "COPYRIGHT"
-Copyright \(co 2002-2007 Kazutaka Katoh (mafft)
+Copyright \(co 2002, 2003, 2004, 2005, 2006, 2007 Kazutaka Katoh (mafft)
 .br
 Copyright \(co 2007 Charles Plessy (this manpage)
 .br
@@ -351,16 +355,16 @@
 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 .sp
 .RS 4
-\h'-04' 1.\h'+02'Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\.
+\h'-04' 1.\h'+02'Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
 .RE
 .sp
 .RS 4
-\h'-04' 2.\h'+02'Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\.
+\h'-04' 2.\h'+02'Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
 .RE
 .sp
 .RS 4
-\h'-04' 3.\h'+02'The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission\.
+\h'-04' 3.\h'+02'The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission\&.
 .RE
 .PP
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\.
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&.
 .sp

Modified: trunk/packages/mafft/trunk/debian/mafft.1.xml
===================================================================
--- trunk/packages/mafft/trunk/debian/mafft.1.xml	2008-08-31 15:59:03 UTC (rev 2443)
+++ trunk/packages/mafft/trunk/debian/mafft.1.xml	2008-09-01 12:11:45 UTC (rev 2444)
@@ -12,7 +12,7 @@
   <!ENTITY dhemail     "charles-debian-nospam at plessy.org">
   <!ENTITY dhusername  "&dhfirstname; &dhsurname;">
   <!ENTITY dhrelease   "6.240">
-  <!ENTITY dhdate      "2007-06-09">
+  <!ENTITY dhdate      "2008-09-01">
   <!ENTITY dhtitle     "Mafft Manual">
   <!ENTITY dhucpackage "MAFFT">
   <!ENTITY dhpackage   "mafft">
@@ -738,5 +738,12 @@
       </itemizedlist>
     </refsect2>
   </refsect1>
+  <refsect1>
+    <title>DIVERGENCE FROM UPSTREAM</title>
+    <para><command>mafft-homologs</command> has been patched to enhance the
+    security of the temporary files it creates. You can consult the patch in
+    the Debian source package. It has been reviewed and amended by Kazutaka
+    Katoh, the upstream author of MAFFT.</para>
+  </refsect1>
 </refentry>
 

Modified: trunk/packages/mafft/trunk/debian/patches/Securisation-by-mktemp-usage.patch
===================================================================
--- trunk/packages/mafft/trunk/debian/patches/Securisation-by-mktemp-usage.patch	2008-08-31 15:59:03 UTC (rev 2443)
+++ trunk/packages/mafft/trunk/debian/patches/Securisation-by-mktemp-usage.patch	2008-09-01 12:11:45 UTC (rev 2444)
@@ -1,4 +1,4 @@
-Author: Charles Plessy, with the kind help of Thijs Kinkhorst.
+Author: Kazutaka Katoh and Charles Plessy, with the kind help of Thijs Kinkhorst.
 Description: Securisation of the temporary files of mafft-homologs.
  Mafft-homologs uses predictable names for its temporary files. This patch
  replaces the pid-based file names by names constructed with the `mktemp'
@@ -15,166 +15,197 @@
  simple denial of service attack.  For these reasons it is suggested that
  mktemp be used instead.
 Forwarded: Kazutaka Katoh <katoh at bioreg.kyushu-u.ac.jp>
-Reviewed: Thijs Kinkhorst <thijs at debian.org>
+Reviewed: Kazutaka Katoh
 License: same as MAFFT itself.
 
 Index: mafft-6.240/src/mafft-homologs.tmpl
 ===================================================================
 --- mafft-6.240.orig/src/mafft-homologs.tmpl
 +++ mafft-6.240/src/mafft-homologs.tmpl
-@@ -13,6 +13,15 @@
- # path of blastall. 
- # if blastall is in your command path, "blastall" is ok.
+@@ -31,11 +31,22 @@
+ #   -w        entire sequences are subjected to BLAST search 
+ #             (default: well-aligned region only)
  
-+$temp_vf_file = system('mktemp _vf_XXXXXXXXXX')
-+$temp_if_file = system('mktemp _if_XXXXXXXXXX')
-+$temp_pf_file = system('mktemp _pf_XXXXXXXXXX')
-+$temp_af_file = system('mktemp _af_XXXXXXXXXX')
-+$temp_rid_file = system('mktemp _rid_XXXXXXXXXX')
-+$temp_res_file = system('mktemp _res_XXXXXXXXXX')
-+$temp_q_file = system('mktemp _q_XXXXXXXXXX')
-+$temp_bf_file = system('mktemp _bf_XXXXXXXXXX')
+-
+ require 'getopts'
++require 'tempfile'
 +
- # mafft-homologs.rb  v. 2.1 aligns sequences together with homologues 
- # automatically collected from SwissProt via NCBI BLAST.
- #
-@@ -34,8 +43,8 @@
++# mktemp
++temp_vf = Tempfile.new("_vf").path
++temp_if = Tempfile.new("_if").path
++temp_pf = Tempfile.new("_pf").path
++temp_af = Tempfile.new("_af").path
++temp_qf = Tempfile.new("_qf").path
++temp_bf = Tempfile.new("_bf").path
++temp_rid = Tempfile.new("_rid").path
++temp_res = Tempfile.new("_res").path
  
- require 'getopts'
- 
 -system( mafftpath + " --help > /tmp/_vf#{$$} 2>&1" )
 -pfp = File.open( "/tmp/_vf#{$$}", 'r' )
-+system( mafftpath + " --help > $temp_vf_file 2>&1" )
-+pfp = File.open( "$temp_vf_file", 'r' )
++
++system( mafftpath + " --help > #{temp_vf} 2>&1" )
++pfp = File.open( "#{temp_vf}", 'r' )
  while pfp.gets
  	break if $_ =~ /MAFFT v/
  end
-@@ -114,17 +123,17 @@
+@@ -114,35 +125,38 @@
  	mafftopt += " " + $OPT_o + " "
  end
  
 -system "cat " + ARGV.to_s + " > /tmp/_if#{$$}"
-+system "cat " + ARGV.to_s + " > $temp_if_file"
++system "cat " + ARGV.to_s + " > #{temp_if}"
  ar = mafftopt.split(" ")
  nar = ar.length
  for i in 0..(nar-1)
  	if ar[i] == "--seed" then
 -		system "cat #{ar[i+1]} >> /tmp/_if#{$$}"
-+		system "cat #{ar[i+1]} >> $temp_if_file"
++		system "cat #{ar[i+1]} >> #{temp_if}"
  	end
  end
  
  nseq = 0
 -ifp = File.open( "/tmp/_if#{$$}", 'r' )
-+ifp = File.open( "$temp_if_file", 'r' )
++ifp = File.open( "#{temp_if}", 'r' )
  	while ifp.gets
  		nseq += 1 if $_ =~ /^>/
  	end
-@@ -132,17 +141,17 @@
+ ifp.close
  
- STDERR.puts "Performing preliminary alignment .. "
- if nseq == 1 then
+-STDERR.puts "Performing preliminary alignment .. "
+-if nseq == 1 then
 -	system( "cp /tmp/_if#{$$}"  + " /tmp/_pf#{$$}" )
-+	system( "cp $temp_if_file"  + " $temp_pf_file" )
++if nseq >= 100 then
++	STDERR.puts "The number of input sequences must be <100."
++	exit
++elsif nseq == 1 then
++	system( "cp #{temp_if}"  + " #{temp_pf}" )
  else
++	STDERR.puts "Performing preliminary alignment .. "
  	if entiresearch == 1 then
 -#		system( mafftpath + " --maxiterate 1000 --localpair /tmp/_if#{$$} > /tmp/_pf#{$$}" )
 -		system( mafftpath + " --maxiterate 0 --retree 2 /tmp/_if#{$$} > /tmp/_pf#{$$}" )
-+#		system( mafftpath + " --maxiterate 1000 --localpair $temp_if_file > $temp_pf_file" )
-+		system( mafftpath + " --maxiterate 0 --retree 2 $temp_if_file > temp_pf_file$" )
++#		system( mafftpath + " --maxiterate 1000 --localpair #{temp_if} > #{temp_pf}" )
++		system( mafftpath + " --maxiterate 0 --retree 2 #{temp_if} > #{temp_pf}" )
  	else
 -		system( mafftpath + " --maxiterate 1000 --localpair --core --coreext --corethr #{corethr.to_s} --corewin #{corewin.to_s} /tmp/_if#{$$} > /tmp/_pf#{$$}" )
-+		system( mafftpath + " --maxiterate 1000 --localpair --core --coreext --corethr #{corethr.to_s} --corewin #{corewin.to_s} $temp_if_file > $temp_pf_file" )
++		system( mafftpath + " --maxiterate 1000 --localpair --core --coreext --corethr #{corethr.to_s} --corewin #{corewin.to_s} #{temp_if} > #{temp_pf}" )
  	end
  end
  
 -pfp = File.open( "/tmp/_pf#{$$}", 'r' )
-+pfp = File.open( "$temp_pf_file", 'r' )
++pfp = File.open( "#{temp_pf}", 'r' )
  inname = []
  inseq = []
  slen = []
-@@ -155,7 +164,7 @@
+@@ -155,7 +169,7 @@
  end
  pfp.close
  
 -pfp = File.open( "/tmp/_if#{$$}", 'r' )
-+pfp = File.open( "$temp_if_file", 'r' )
++pfp = File.open( "#{temp_if}", 'r' )
  orname = []
  orseq = []
  nin = 0
-@@ -187,8 +196,7 @@
- end
+@@ -188,7 +202,7 @@
  #p act
  
--
+ 
 -afp = File.open( "/tmp/_af#{$$}", 'w' )
-+afp = File.open( "$temp_af_file", 'w' )
++afp = File.open( "#{temp_af}", 'w' )
  
  STDERR.puts "Searching .. \n"
  ids = []
-@@ -209,10 +217,10 @@
+@@ -209,10 +223,10 @@
  	end
  
  	if local == 0 then
 -		command = "lynx -source 'http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?QUERY=" + inseq[i] + "&DATABASE=swissprot&HITLIST_SIZE=" + nadd.to_s + "&FILTER=L&EXPECT='" + eval.to_s + "'&FORMAT_TYPE=TEXT&PROGRAM=blastp&SERVICE=plain&NCBI_GI=on&PAGE=Proteins&CMD=Put' > /tmp/_rid#{$$}"
-+		command = "lynx -source 'http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?QUERY=" + inseq[i] + "&DATABASE=swissprot&HITLIST_SIZE=" + nadd.to_s + "&FILTER=L&EXPECT='" + eval.to_s + "'&FORMAT_TYPE=TEXT&PROGRAM=blastp&SERVICE=plain&NCBI_GI=on&PAGE=Proteins&CMD=Put' > $temp_rid_file"
++		command = "lynx -source 'http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?QUERY=" + inseq[i] + "&DATABASE=swissprot&HITLIST_SIZE=" + nadd.to_s + "&FILTER=L&EXPECT='" + eval.to_s + "'&FORMAT_TYPE=TEXT&PROGRAM=blastp&SERVICE=plain&NCBI_GI=on&PAGE=Proteins&CMD=Put' > #{temp_rid}"
  		system command
  	
 -		ridp = File.open( "/tmp/_rid#{$$}", 'r' )
-+		ridp = File.open( "$temp_rid_file", 'r' )
++		ridp = File.open( "#{temp_rid}", 'r' )
  		while ridp.gets
  			break if $_ =~ / RID = (.*)/
  		end
-@@ -224,9 +232,9 @@
+@@ -224,9 +238,9 @@
  		while 1 
  			STDERR.printf "."
  			sleep 10
 -			command = "lynx -source 'http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?RID=" + rid + "&DESCRIPTIONS=500&ALIGNMENTS=" + nadd.to_s + "&ALIGNMENT_TYPE=Pairwise&OVERVIEW=no&CMD=Get&FORMAT_TYPE=XML' > /tmp/_res#{$$}"
-+			command = "lynx -source 'http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?RID=" + rid + "&DESCRIPTIONS=500&ALIGNMENTS=" + nadd.to_s + "&ALIGNMENT_TYPE=Pairwise&OVERVIEW=no&CMD=Get&FORMAT_TYPE=XML' > $temp_res_file"
++			command = "lynx -source 'http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?RID=" + rid + "&DESCRIPTIONS=500&ALIGNMENTS=" + nadd.to_s + "&ALIGNMENT_TYPE=Pairwise&OVERVIEW=no&CMD=Get&FORMAT_TYPE=XML' > #{temp_res}"
  			system command
 -			resp = File.open( "/tmp/_res#{$$}", 'r' )
-+			resp = File.open( "$temp_res_file", 'r' )
++			resp = File.open( "#{temp_res}", 'r' )
  #			resp.gets
  #			if $_ =~ /WAITING/ then
  #				resp.close
-@@ -247,17 +255,17 @@
+@@ -247,17 +261,17 @@
  	else
  #		puts "Not supported"
  #		exit
 -		qfp = File.open( "/tmp/_q#{$$}", 'w' )
-+		qfp = File.open( "$temp_q_file", 'w' )
++		qfp = File.open( "#{temp_qf}", 'w' )
  			qfp.puts "> "
  			qfp.puts inseq[i]
  		qfp.close
 -		command = blastpath + "  -p blastp  -e #{eval} -b 1000 -m 7 -i /tmp/_q#{$$} -d #{localdb} > /tmp/_res#{$$}"
-+		command = blastpath + "  -p blastp  -e #{eval} -b 1000 -m 7 -i $temp_q_file -d #{localdb} > $temp_res_file"
++		command = blastpath + "  -p blastp  -e #{eval} -b 1000 -m 7 -i #{temp_qf} -d #{localdb} > #{temp_res}"
  		system command
 -		resp = File.open( "/tmp/_res#{$$}", 'r' )
-+		resp = File.open( "$temp_res_file", 'r' )
++		resp = File.open( "#{temp_res}", 'r' )
  	end
  	STDERR.puts " Done.\n\n"
  
 -	resp = File.open( "/tmp/_res#{$$}", 'r' )
-+	resp = File.open( "$temp_res_file", 'r' )
++	resp = File.open( "#{temp_res}", 'r' )
  	while 1
  		while resp.gets
  			break if $_ =~ /<Hit_id>(.*)<\/Hit_id>/ || $_ =~ /(<Iteration_stat>)/
-@@ -310,10 +318,10 @@
+@@ -310,17 +324,15 @@
  afp.close
  
  STDERR.puts "Performing alignment .. "
 -system( mafftpath + mafftopt + " /tmp/_af#{$$} > /tmp/_bf#{$$}" )
-+system( mafftpath + mafftopt + " $temp_af_file > $temp_bf_file" )
++system( mafftpath + mafftopt + " #{temp_af} > #{temp_bf}" )
  STDERR.puts "done."
  
 -bfp = File.open( "/tmp/_bf#{$$}", 'r' )
-+bfp = File.open( "$temp_bf_file", 'r' )
++bfp = File.open( "#{temp_bf}", 'r' )
  outseq = []
  outnam = []
  readfasta( bfp, outnam, outseq )
-@@ -357,4 +365,4 @@
+ bfp.close
+ 
+-
+-
+ outseq2 = []
+ outnam2 = []
+ 
+@@ -357,4 +369,5 @@
  	puts outseq2[i].gsub( /.{1,60}/, "\\0\n" )
  end
  
 -system( "rm -rf /tmp/_if#{$$} /tmp/_vf#{$$} /tmp/_af#{$$} /tmp/_bf#{$$} /tmp/_pf#{$$} /tmp/_q#{$$} /tmp/_res#{$$} /tmp/_rid#{$$}" )
-+system( "rm -rf $temp_if_file $temp_vf_file $temp_af_file $temp_bf_file $temp_pf_file $temp_q_file $temp_res_file $temp_rid_file" )
++
++#system( "rm -rf #{temp_if} #{temp_vf} #{temp_af} #{temp_bf} #{temp_pf} #{temp_qf} #{temp_res} #{temp_rid}" )
+Index: mafft-6.240/src/mafft.tmpl
+===================================================================
+--- mafft-6.240.orig/src/mafft.tmpl
++++ mafft-6.240/src/mafft.tmpl
+@@ -240,11 +240,11 @@
+ 		shift   
+ 	done;
+ 
+-#	TMPFILE=/tmp/`basename $0`.`whoami`.$$.`date +%y%m%d%H%M%S`
+-	TMPFILE=/tmp/$progname.$$
++#	TMPFILE=/tmp/$progname.$$
++	TMPFILE=`mktemp -dt $progname.XXXXXXXXXX`
+ 	umask 077
+-	mkdir  $TMPFILE  || er=1
+-	trap "rm -r $TMPFILE " 0
++#	mkdir  $TMPFILE  || er=1
++	trap "rm -rf $TMPFILE " 0
+ 	if [ $# -eq 1 ]; then
+ 		if [ -r "$1" -o "$1" = - ]; then
+ 			cat "$1" | tr "\r" "\n" > $TMPFILE/infile 




More information about the debian-med-commit mailing list