[med-svn] [Git][med-team/lastz][master] Propagate flags, Python3

Andreas Tille gitlab at salsa.debian.org
Mon Jun 15 12:31:21 BST 2020



Andreas Tille pushed to branch master at Debian Med / lastz


Commits:
0a8e7e68 by Andreas Tille at 2020-06-15T13:31:01+02:00
Propagate flags, Python3

- - - - -


4 changed files:

- + debian/patches/2to3.patch
- + debian/patches/propagate_cflags.patch
- + debian/patches/series
- debian/rules


Changes:

=====================================
debian/patches/2to3.patch
=====================================
@@ -0,0 +1,767 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Mon, 15 Jun 2020 11:47:45 +0200
+Description: 2to3 for test suite
+
+--- a/tools/any_to_qdna.py
++++ b/tools/any_to_qdna.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Convert any file to a LASTZ quantum dna file, just by appending qdna headers
+ 
+@@ -40,9 +40,9 @@ def usage(s=None):
+ 
+ def main():
+ 
+-	qdnaOldMagic = 0xF656659EL	# big endian magic number for older qdna files
+-	qdnaMagic    = 0xC4B47197L	# big endian magic number for qdna files
+-	qdnaVersion  = 0x00000200L 
++	qdnaOldMagic = 0xF656659E	# big endian magic number for older qdna files
++	qdnaMagic    = 0xC4B47197	# big endian magic number for qdna files
++	qdnaVersion  = 0x00000200 
+ 
+ 	# parse args
+ 
+--- a/tools/axt_compare.py
++++ b/tools/axt_compare.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Compare two axt files, reporting differences but ignoring some trivial ones
+ ---------------------------------------------------------------------------
+@@ -56,11 +56,11 @@ def main():
+ 		        % (axt1Filename,axt2Filename)
+ 
+ 	if (different):
+-		print >>sys.stderr,"FAILURE: %s" % message
++		print("FAILURE: %s" % message, file=sys.stderr)
+ 		sys.exit(1)
+ 
+-	print >>sys.stderr,"SUCCESS: %s and %s are equivalent" \
+-					 % (axt1Filename,axt2Filename)
++	print("SUCCESS: %s and %s are equivalent" \
++					 % (axt1Filename,axt2Filename), file=sys.stderr)
+ 
+ 
+ # compare files
+--- a/tools/build_fasta_hsx.py
++++ b/tools/build_fasta_hsx.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Build a "hashed sequence index" (hsx) file for a fasta file
+ -----------------------------------------------------------
+@@ -183,26 +183,26 @@ def main():
+ 
+ 			if (length == 0):
+ 				if (keepEmpties):
+-					print >>sys.stderr, "WARNING: keeping empty sequence %s (%s)" \
+-					                  % (name,line_reference((fileName,lineNum)))
++					print("WARNING: keeping empty sequence %s (%s)" \
++					                  % (name,line_reference((fileName,lineNum))), file=sys.stderr)
+ 				else:
+-					print >>sys.stderr, "WARNING: discarding empty sequence %s (%s)" \
+-					                  % (name,line_reference((fileName,lineNum)))
++					print("WARNING: discarding empty sequence %s (%s)" \
++					                  % (name,line_reference((fileName,lineNum))), file=sys.stderr)
+ 					continue
+ 
+ 			if (skipHeader): sequences += [(name,length,fileNum,seqOffset)]
+ 			else:            sequences += [(name,length,fileNum,headerOffset)]
+ 
+ 			if ("progress" in debug) and (progress != None) and (seqNum % progress == 0):
+-				print >>sys.stderr, "read sequence %d (%s)" % (seqNum,name)
++				print("read sequence %d (%s)" % (seqNum,name), file=sys.stderr)
+ 
+ 		if (fileName != ""): f.close()
+ 
+ 		if ("progress" in debug):
+ 			if (fileName != ""):
+-				print >>sys.stderr, "finished reading %s" % fileName
++				print("finished reading %s" % fileName, file=sys.stderr)
+ 			else:
+-				print >>sys.stderr, "finished reading input file"
++				print("finished reading input file", file=sys.stderr)
+ 
+ 	# scan collected sequence info and assign hash values
+ 
+@@ -218,12 +218,12 @@ def main():
+ 	sequences.sort()
+ 
+ 	if ("progress" in debug):
+-		print >>sys.stderr, "finished computing hashes"
++		print("finished computing hashes", file=sys.stderr)
+ 
+ 	if ("info" in debug):
+ 		for (hash,name,length,fileNum,offset) in sequences:
+-			print >>sys.stderr, "%10d==%08X %2d:%08X %s %d" \
+-			                  % (HsxFile.hash(name),hash,fileNum,offset,name,length)
++			print("%10d==%08X %2d:%08X %s %d" \
++			                  % (HsxFile.hash(name),hash,fileNum,offset,name,length), file=sys.stderr)
+ 
+ 	##########
+ 	# write the index
+@@ -277,10 +277,10 @@ def main():
+ 	seqTableOffset  = hashTableOffset + hashTableSize
+ 
+ 	if ("file" in debug):
+-		print >>sys.stderr, "fileTableOffset = %08X (%08X)" % (fileTableOffset,fileTableSize)
+-		print >>sys.stderr, "fileInfoOffset  = %08X (%08X)" % (fileInfoOffset,fileInfoSize)
+-		print >>sys.stderr, "hashTableOffset = %08X (%08X)" % (hashTableOffset,hashTableSize)
+-		print >>sys.stderr, "seqTableOffset  = %08X"        % seqTableOffset
++		print("fileTableOffset = %08X (%08X)" % (fileTableOffset,fileTableSize), file=sys.stderr)
++		print("fileInfoOffset  = %08X (%08X)" % (fileInfoOffset,fileInfoSize), file=sys.stderr)
++		print("hashTableOffset = %08X (%08X)" % (hashTableOffset,hashTableSize), file=sys.stderr)
++		print("seqTableOffset  = %08X"        % seqTableOffset, file=sys.stderr)
+ 
+ 	# determine offsets into the sequence table
+ 
+@@ -313,7 +313,7 @@ def main():
+ 	writeZeros(headerPad)
+ 
+ 	if ("progress" in debug):
+-		print >>sys.stderr, "finished writing header"
++		print("finished writing header", file=sys.stderr)
+ 
+ 	# write file table and file info
+ 
+@@ -329,7 +329,7 @@ def main():
+ 	writeZeros(fileInfoPad)
+ 
+ 	if ("progress" in debug):
+-		print >>sys.stderr, "finished writing file table"
++		print("finished writing file table", file=sys.stderr)
+ 
+ 	# write hash table
+ 
+@@ -346,14 +346,14 @@ def main():
+ 			# output previous bucket
+ 			write5(seqOffset)
+ 			if ("progress" in debug) and (progress != None) and ((hash+1) % progress == 0):
+-				print >>sys.stderr, "wrote hash bucket %d" % (hash+1)
++				print("wrote hash bucket %d" % (hash+1), file=sys.stderr)
+ 			# output intervening empty buckets
+ 			prevHash += 1
+ 			while (prevHash < hash):
+ 				write5(msBit5 + nameToOffset[name])
+ 				prevHash += 1
+ 				if ("progress" in debug) and (progress != None) and (prevHash % progress == 0):
+-					print >>sys.stderr, "wrote hash bucket %d" % (prevHash)
++					print("wrote hash bucket %d" % (prevHash), file=sys.stderr)
+ 
+ 		bucketSize = 1
+ 		seqOffset  = nameToOffset[name]
+@@ -373,7 +373,7 @@ def main():
+ 	writeZeros(hashTablePad)
+ 
+ 	if ("progress" in debug):
+-		print >>sys.stderr, "finished writing hash table"
++		print("finished writing hash table", file=sys.stderr)
+ 
+ 	# write sequence table
+ 
+@@ -383,10 +383,10 @@ def main():
+ 		write6(offset)			# offset to the sequence data
+ 		writeString(name)		# name of sequence
+ 		if ("progress" in debug) and (progress != None) and ((seqNum+1) % progress == 0):
+-			print >>sys.stderr, "wrote sequence entry %d" % (seqNum+1)
++			print("wrote sequence entry %d" % (seqNum+1), file=sys.stderr)
+ 
+ 	if ("progress" in debug):
+-		print >>sys.stderr, "finished writing index"
++		print("finished writing index", file=sys.stderr)
+ 
+ 
+ def pad_for_16(n):
+@@ -492,7 +492,8 @@ def sequence_name(s,nameParse=None):
+ 	else:         return s.split()[0]
+ 
+ 
+-def line_reference((fileName,lineNum)):
++def line_reference(xxx_todo_changeme):
++	(fileName,lineNum) = xxx_todo_changeme
+ 	if (fileName == ""): return "line %d" % lineNum
+ 	else:                return "line %s:%d" % (fileName,lineNum)
+ 
+--- a/tools/expand_scores_file.py
++++ b/tools/expand_scores_file.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Add scoring-related parameters to a lastz scores file
+ -----------------------------------------------------
+@@ -153,22 +153,22 @@ def main():
+ 	blankLine = False
+ 
+ 	for ix in range(numValueLines):
+-		print lines[ix]
++		print(lines[ix])
+ 		blankLine = (lines[ix] == "")
+ 
+ 	if (addedNames != []):
+-		if (not blankLine): print ""
+-		print "# (score parameters added by expand_scores_file)"
+-		print ""
++		if (not blankLine): print("")
++		print("# (score parameters added by expand_scores_file)")
++		print("")
+ 
+ 		for name in addedNames:
+-			print "%s=%s" % (name,nameToVal[name])
++			print("%s=%s" % (name,nameToVal[name]))
+ 
+ 		blankLine = (lines[numValueLines] == "")
+-		if (not blankLine): print ""
++		if (not blankLine): print("")
+ 
+ 	for ix in range(numValueLines,len(lines)):
+-		print lines[ix]
++		print(lines[ix])
+ 
+ 
+ def int_or_float(s):
+--- a/tools/fasta_fragments.py
++++ b/tools/fasta_fragments.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Break a fasta file into fragments.
+ 
+@@ -82,13 +82,13 @@ def main():
+ 		if (headLimit != None) and (fragNum > headLimit): break
+ 
+ 		seq = seq.upper()
+-		for ix in xrange(0,len(seq)-fragmentLength,stepLength):
++		for ix in range(0,len(seq)-fragmentLength,stepLength):
+ 			frag = seq[ix:ix+fragmentLength]
+ 			if (frag == allN): continue
+ 
+ 			fragNum += 1
+ 			if (headLimit != None) and (fragNum > headLimit):
+-				print >>stderr, "limit of %d emitted fragments reached" % headLimit
++				print("limit of %d emitted fragments reached" % headLimit, file=stderr)
+ 				break
+ 
+ 			if (origin == "zero"): header = ">%s_%d" % (name,ix)
+@@ -96,14 +96,14 @@ def main():
+ 			if (shuffleEm):
+ 				fragments += [(header,frag)]
+ 			else:
+-				print header
+-				print frag
++				print(header)
++				print(frag)
+ 
+ 	if (shuffleEm):
+ 		shuffle(fragments)
+ 		for (header,frag) in fragments:
+-			print header
+-			print frag
++			print(header)
++			print(frag)
+ 
+ 
+ # fasta_sequences--
+--- a/tools/fasta_softmask_intervals.py
++++ b/tools/fasta_softmask_intervals.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Given a list of intervals, mask those bases in the fasta sequence(s).
+ """
+@@ -130,12 +130,12 @@ def main():
+ 			prevEnd = end
+ 		if (prevEnd < len(seq)):   newSeq += [seq[prevEnd:]]
+ 
+-		print ">%s" % chrom
++		print(">%s" % chrom)
+ 		newSeq = "".join(newSeq)
+ 		assert (len(newSeq) == len(seq)), "internal error"
+ 
+ 		for i in range(0,len(newSeq),wrapLength):
+-			print "".join(newSeq[i:i+wrapLength])
++			print("".join(newSeq[i:i+wrapLength]))
+ 
+ 	# make sure all sequences were given
+ 
+--- a/tools/gfa_compare.py
++++ b/tools/gfa_compare.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Compare two gfa files, reporting differences but ignoring some trivial ones
+ ---------------------------------------------------------------------------
+@@ -43,12 +43,12 @@ def main():
+ 	else:        (different,lineNum) = compare_sorted_files  (gfa1,gfa2)
+ 
+ 	if (different):
+-		print >>sys.stderr,"FAILURE: %s and %s are different (line %d)" \
+-		                 % (gfa1Filename,gfa2Filename,lineNum)
++		print("FAILURE: %s and %s are different (line %d)" \
++		                 % (gfa1Filename,gfa2Filename,lineNum), file=sys.stderr)
+ 		sys.exit(1)
+ 
+-	print >>sys.stderr,"SUCCESS: %s and %s are equivalent" \
+-					 % (gfa1Filename,gfa2Filename)
++	print("SUCCESS: %s and %s are equivalent" \
++					 % (gfa1Filename,gfa2Filename), file=sys.stderr)
+ 
+ 
+ # compare files that we expect are in the same order
+--- a/tools/hassock_hash.py
++++ b/tools/hassock_hash.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Python implementation of the hash used for "hashed sequence index" files.
+ 
+@@ -77,8 +77,8 @@ def main():
+ 			demonstrate_hash(line,m)
+ 
+ def demonstrate_hash(s,m):
+-	if (m == None): print "%08X: %s" % (hassock_hash(s),s)
+-	else:           print "%d: %s"   % (hassock_hash(s)%m,s)
++	if (m == None): print("%08X: %s" % (hassock_hash(s),s))
++	else:           print("%d: %s"   % (hassock_hash(s)%m,s))
+ 
+ 
+ if __name__ == "__main__": main()
+--- a/tools/hsx_file.py
++++ b/tools/hsx_file.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ "Hashed sequence index" (hsx) file reader (for a fasta file)
+ -------------------------------------------------------------------
+@@ -87,9 +87,9 @@ class HsxFile(object):
+ 		else:               self.debug = debug
+ 		self.open()
+ 
+-	magicBig    = 0xD2527095L
+-	magicLittle = 0x957052D2L
+-	version     = 0x00000100L
++	magicBig    = 0xD2527095
++	magicLittle = 0x957052D2
++	version     = 0x00000100
+ 	msBit5      = 0x80 << (4*8)
+ 
+ 	def open(self):
+@@ -168,22 +168,22 @@ class HsxFile(object):
+ 
+ 	def get_sequence(self,name):
+ 		if ("fetch" in self.debug):
+-			print >>sys.stderr, "[fetching %s]" % name
++			print("[fetching %s]" % name, file=sys.stderr)
+ 		# read hash bucket for this name
+ 		bucket = HsxFile.hash(name) % self.numBuckets
+ 		if ("fetch" in self.debug):
+-			print >>sys.stderr, "[  bucket = %d (file offset %08X)]" \
+-			                  % (bucket,self.hashTableOffset+5*bucket)
++			print("[  bucket = %d (file offset %08X)]" \
++			                  % (bucket,self.hashTableOffset+5*bucket), file=sys.stderr)
+ 		self.file.seek(self.hashTableOffset + 5*bucket)
+ 		bucketOffset = self.read5()
+ 		if (bucketOffset & HsxFile.msBit5 != 0):
+ 			if ("fetch" in self.debug):
+-				print >>sys.stderr, "[  bucket is empty]"
++				print("[  bucket is empty]", file=sys.stderr)
+ 			return None
+ 		bucketEnd = self.read5() & ~HsxFile.msBit5
+ 		if ("fetch" in self.debug):
+-			print >>sys.stderr, "[  bucket offset = %010X..%010X ]" \
+-			                  % (bucketOffset,bucketEnd)
++			print("[  bucket offset = %010X..%010X ]" \
++			                  % (bucketOffset,bucketEnd), file=sys.stderr)
+ 		# scan the bucket until we find this sequence
+ 		self.file.seek(bucketOffset)
+ 		seqIx   = 1
+@@ -194,15 +194,15 @@ class HsxFile(object):
+ 			seqOffset = self.read6()
+ 			seqName   = self.readString()
+ 			if ("fetch" in self.debug):
+-				print >>sys.stderr, "[  (%010X) name %d = %s]" \
+-				                    % (bucketOffset,seqIx,seqName)
++				print("[  (%010X) name %d = %s]" \
++				                    % (bucketOffset,seqIx,seqName), file=sys.stderr)
+ 			if (seqName == name): break
+ 			if (seqName >  name): return None
+ 			bucketOffset += 1 + 6 + 5 + len(seqName) + 1
+ 			seqIx += 1
+ 		if (seqName != name):
+ 			if ("fetch" in self.debug):
+-				print >>sys.stderr, "[  %s not in bucket]" % name
++				print("[  %s not in bucket]" % name, file=sys.stderr)
+ 			return None
+ 		# open the sequence file (if it isn't already open)
+ 		assert (fileIx < len(self.fileTable)), \
+@@ -211,12 +211,12 @@ class HsxFile(object):
+ 		(seqFileName,seqFile) = self.fileTable[fileIx]
+ 		if (seqFile == None):
+ 			if ("fetch" in self.debug):
+-				print >>sys.stderr, "[  opening %s]" % seqFileName
++				print("[  opening %s]" % seqFileName, file=sys.stderr)
+ 			seqFile = file(seqFileName,"rt")
+ 			self.fileTable[fileIx] = (seqFileName,seqFile)
+ 		if ("fetch" in self.debug):
+-			print >>sys.stderr, "[  reading from %s:%012X]" \
+-			                  % (seqFileName,seqOffset)
++			print("[  reading from %s:%012X]" \
++			                  % (seqFileName,seqOffset), file=sys.stderr)
+ 		# read the sequence
+ 		seqFile.seek(seqOffset)
+ 		seqLines = []
+@@ -226,7 +226,7 @@ class HsxFile(object):
+ 			if (line == ""): break
+ 			line = line.strip()
+ 			if ("fetch" in self.debug):
+-				print >>sys.stderr, "[  read %s]" % line
++				print("[  read %s]" % line, file=sys.stderr)
+ 			if (line.startswith(">")):
+ 				if (len(seqLines) != 0): break
+ 				seqLines += [line]
+--- a/tools/install_py.py
++++ b/tools/install_py.py
+@@ -1,18 +1,18 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ 
+ import sys
+ import string
+-import commands
++import subprocess
+ true  = 1
+ false = 0
+ 
+ def do (command):
+-	print command
+-	output = commands.getoutput(command)
+-	if (len(output) > 0): print output
++	print(command)
++	output = subprocess.getoutput(command)
++	if (len(output) > 0): print(output)
+ 
+ binDir     = "~/py/bin"
+-currentDir = commands.getoutput("pwd").strip()
++currentDir = subprocess.getoutput("pwd").strip()
+ 
+ args = sys.argv[1:]
+ remove = False
+--- a/tools/lav_compare.py
++++ b/tools/lav_compare.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Compare two lav files, reporting differences but ignoring some trivial ones
+ ---------------------------------------------------------------------------
+@@ -79,12 +79,12 @@ def main():
+ 			stanzaIx = 0
+ 
+ 	if (different):
+-		print >>sys.stderr,"FAILURE: %s and %s are different (line %d)" \
+-		                 % (lav1Filename,lav2Filename,lineNum)
++		print("FAILURE: %s and %s are different (line %d)" \
++		                 % (lav1Filename,lav2Filename,lineNum), file=sys.stderr)
+ 		sys.exit(1)
+ 
+-	print >>sys.stderr,"SUCCESS: %s and %s are equivalent" \
+-					 % (lav1Filename,lav2Filename)
++	print("SUCCESS: %s and %s are equivalent" \
++					 % (lav1Filename,lav2Filename), file=sys.stderr)
+ 
+ 
+ def header_strip(s):
+--- a/tools/lav_sort.py
++++ b/tools/lav_sort.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Sort the a-stanzas in a lav file, according to the user's choice of key
+ -----------------------------------------------------------------------
+@@ -55,15 +55,15 @@ def main():
+ 			blocks.sort()
+ 			if (keyReverse): blocks.reverse()
+ 			for (key,s) in blocks:
+-				print "\n".join(s)
++				print("\n".join(s))
+ 			blocks = []
+-		print "\n".join(stanza)
++		print("\n".join(stanza))
+ 
+ 	if (len(blocks) > 0):
+ 		blocks.sort()
+ 		if (keyReverse): blocks.reverse()
+ 		for (key,s) in blocks:
+-			print "\n".join(s)
++			print("\n".join(s))
+ 
+ # read_stanzas--
+ #	Collect the lines that belong to the next stanza.  A stanza has the form
+--- a/tools/maf_sort.py
++++ b/tools/maf_sort.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Sort alignment blocks in a maf file, according to the user's choice of key
+ --------------------------------------------------------------------------
+@@ -55,9 +55,9 @@ def main():
+ 		if (keyReverse): blocks.reverse()
+ 		for (key,block,comments) in blocks:
+ 			if (comments != []):
+-				print "\n".join([line for line in comments])
+-			print "\n".join([line for line in block])
+-			print
++				print("\n".join([line for line in comments]))
++			print("\n".join([line for line in block]))
++			print()
+ 
+ 
+ # read_blocks--
+--- a/tools/merge_masking_intervals.py
++++ b/tools/merge_masking_intervals.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Given a file of masking intervals, combine overlapping intervals.
+ 
+@@ -68,14 +68,14 @@ def main():
+ 		if (start == None):
+ 			(start,end) = (s,e)
+ 		elif (s > end):
+-			print "%d\t%d" % (start+1,end)
++			print("%d\t%d" % (start+1,end))
+ 			(start,end) = (s,e)
+ 			continue
+ 		elif (e > end):
+ 			end = e
+ 
+ 	if (start != None):
+-		print "%d\t%d" % (start+1,end)
++		print("%d\t%d" % (start+1,end))
+ 
+ 
+ if __name__ == "__main__": main()
+--- a/tools/pick_from_fasta_hsx.py
++++ b/tools/pick_from_fasta_hsx.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Select a subset of sequences from a fasta file indexed by an hsx file
+ ---------------------------------------------------------------------
+@@ -75,11 +75,11 @@ def main():
+ 	for name in seqNames:
+ 		seq = hsx.get_sequence(name)
+ 		if (seq != None):
+-			print seq
++			print(seq)
+ 			if (showProgress):
+-				print >>sys.stderr, name
++				print(name, file=sys.stderr)
+ 		elif (warnOnMissing):
+-			print >>sys.stderr, "WARNING: %s not found" % name
++			print("WARNING: %s not found" % name, file=sys.stderr)
+ 	hsx.close()
+ 
+ 
+--- a/tools/probabilities_to_scores.py
++++ b/tools/probabilities_to_scores.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Convert probabilities to a LASTZ scores file (including quantum scores)
+ -----------------------------------------------------------------------
+@@ -263,16 +263,16 @@ def main():
+ 	##########
+ 
+ 	if ("debug" in debug):
+-		print "  ".join([" %s:%.5f" % (nuc,prob[nuc]) for nuc in bases])
++		print("  ".join([" %s:%.5f" % (nuc,prob[nuc]) for nuc in bases]))
+ 
+ 		for x in bases:
+-			print "  ".join(["%s:%.5f" % (x+y,prob[x+y]) for y in bases])
++			print("  ".join(["%s:%.5f" % (x+y,prob[x+y]) for y in bases]))
+ 
+-		print
++		print()
+ 		for sym in symbols:
+ 			p = symProb[sym]
+-			print "%s -> %s" \
+-			    % (sym,"  ".join([" %s:%.5f" % (nuc,p[nuc]) for nuc in bases]))
++			print("%s -> %s" \
++			    % (sym,"  ".join([" %s:%.5f" % (nuc,p[nuc]) for nuc in bases])))
+ 
+ 	##########
+ 	# write quantum code file
+@@ -282,8 +282,8 @@ def main():
+ 		codeF = file(codeName,"wt")
+ 		for sym in symbols:
+ 			p = symProb[sym]
+-			print >>codeF, "%s\t%s" \
+-			             % (sym,"\t".join(["%.6f" % p[nuc] for nuc in bases]))
++			print("%s\t%s" \
++			             % (sym,"\t".join(["%.6f" % p[nuc] for nuc in bases])), file=codeF)
+ 		codeF.close()
+ 
+ 	##########
+@@ -317,14 +317,14 @@ def main():
+ 	##########
+ 
+ 	if (creator != None):
+-		print "# created by %s" % creator
+-		print
++		print("# created by %s" % creator)
++		print()
+ 
+ 	if (settings != []):
+ 		sLen = max([len(s) for (s,val) in settings])
+ 		for (s,val) in settings:
+-			print "%-*s = %s" % (sLen,s,val)
+-		print
++			print("%-*s = %s" % (sLen,s,val))
++		print()
+ 
+ 	##########
+ 	# print the substitution matrix
+@@ -336,17 +336,17 @@ def main():
+ 			for col in colSymbols:
+ 				wSub = max(wSub,len("%d" % sub[row][col]))
+ 
+-		print "%s %s" \
+-		    % ("#","  ".join(["%*s" % (wSub,non_single(symGroup[col])) for col in colSymbols]))
++		print("%s %s" \
++		    % ("#","  ".join(["%*s" % (wSub,non_single(symGroup[col])) for col in colSymbols])))
+ 
+-		print "%s %s" \
+-		    % (" ","  ".join(["%*s" % (wSub,col) for col in colSymbols]))
++		print("%s %s" \
++		    % (" ","  ".join(["%*s" % (wSub,col) for col in colSymbols])))
+ 
+ 		for row in rowSymbols:
+-			print "%s %s%s" \
++			print("%s %s%s" \
+ 			    % (row,
+ 			       "  ".join(["%*d" % (wSub,sub[row][col]) for col in colSymbols]),
+-			       non_single_comment(symGroup[row]))
++			       non_single_comment(symGroup[row])))
+ 
+ 	else:
+ 		wSub = 4
+@@ -354,17 +354,17 @@ def main():
+ 			for col in colSymbols:
+ 				wSub = max(wSub,len("%.6f" % sub[row][col]))
+ 
+-		print "%s %s" \
+-		    % ("#","  ".join(["%*s" % (wSub,non_single(symGroup[col])) for col in colSymbols]))
++		print("%s %s" \
++		    % ("#","  ".join(["%*s" % (wSub,non_single(symGroup[col])) for col in colSymbols])))
+ 
+-		print "%s %s" \
+-		    % (" ","  ".join(["%*s" % (wSub,col) for col in colSymbols]))
++		print("%s %s" \
++		    % (" ","  ".join(["%*s" % (wSub,col) for col in colSymbols])))
+ 
+ 		for row in rowSymbols:
+-			print "%s %s%s" \
++			print("%s %s%s" \
+ 			    % (row,
+ 			       "  ".join(["%*.6f" % (wSub,sub[row][col]) for col in colSymbols]),
+-			       non_single_comment(symGroup[row]))
++			       non_single_comment(symGroup[row])))
+ 
+ 
+ def dna_event(s):
+--- a/tools/qcode_to_scores.py
++++ b/tools/qcode_to_scores.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ Convert quantum-code files to a LASTZ scores file
+ -------------------------------------------------
+@@ -288,12 +288,12 @@ def main():
+ 	##########
+ 
+ 	if ("debug" in debug):
+-		print "target" \
+-		    + "  ".join([" %s:%.5f" % (nuc,rProb[nuc]) for nuc in bases])
+-		print "query" \
+-		    + "  ".join([" %s:%.5f" % (nuc,cProb[nuc]) for nuc in bases])
++		print("target" \
++		    + "  ".join([" %s:%.5f" % (nuc,rProb[nuc]) for nuc in bases]))
++		print("query" \
++		    + "  ".join([" %s:%.5f" % (nuc,cProb[nuc]) for nuc in bases]))
+ 		for y in bases:
+-			print "  ".join(["%s:%.5f" % (y+x,rcProb[y+x]) for x in bases])
++			print("  ".join(["%s:%.5f" % (y+x,rcProb[y+x]) for x in bases]))
+ 
+ 	##########
+ 	# assign scores
+@@ -326,14 +326,14 @@ def main():
+ 	##########
+ 
+ 	if (creator != None):
+-		print "# created by %s" % creator
+-		print
++		print("# created by %s" % creator)
++		print()
+ 
+ 	if (settings != []):
+ 		sLen = max([len(s) for (s,val) in settings])
+ 		for (s,val) in settings:
+-			print "%-*s = %s" % (sLen,s,val)
+-		print
++			print("%-*s = %s" % (sLen,s,val))
++		print()
+ 
+ 	##########
+ 	# print the substitution matrix
+@@ -347,13 +347,13 @@ def main():
+ 			for col in colSymbols:
+ 				wCol = max(wCol,len("%d" % sub[row][col]))
+ 
+-		print "%-*s %s" \
+-		    % (wRow," ","  ".join(["%*s" % (wCol,col) for col in colSymbols]))
++		print("%-*s %s" \
++		    % (wRow," ","  ".join(["%*s" % (wCol,col) for col in colSymbols])))
+ 
+ 		for row in rowSymbols:
+-			print "%-*s %s" \
++			print("%-*s %s" \
+ 			    % (wRow,row,
+-			       "  ".join(["%*d" % (wCol,sub[row][col]) for col in colSymbols]))
++			       "  ".join(["%*d" % (wCol,sub[row][col]) for col in colSymbols])))
+ 
+ 	else:
+ 		wCol = 4
+@@ -361,13 +361,13 @@ def main():
+ 			for col in colSymbols:
+ 				wCol = max(wCol,len("%.6f" % sub[row][col]))
+ 
+-		print "%-*s %s" \
+-		    % (wRow," ","  ".join(["%*s" % (wCol,col) for col in colSymbols]))
++		print("%-*s %s" \
++		    % (wRow," ","  ".join(["%*s" % (wCol,col) for col in colSymbols])))
+ 
+ 		for row in rowSymbols:
+-			print "%-*s %s" \
++			print("%-*s %s" \
+ 			    % (wRow,row,
+-			       "  ".join(["%*.6f" % (wCol,sub[row][col]) for col in colSymbols]))
++			       "  ".join(["%*.6f" % (wCol,sub[row][col]) for col in colSymbols])))
+ 
+ 
+ def simple_dna_quantum_code():


=====================================
debian/patches/propagate_cflags.patch
=====================================
@@ -0,0 +1,33 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Mon, 15 Jun 2020 11:47:45 +0200
+Description: Propagate DEB_CFLAGS_MAINT_APPEND  = -Wno-stringop-truncation
+ Also LDFLAGS is added to propagate remaining hardening options
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -71,7 +71,7 @@ VERSION_FLAGS= \
+ 	-DSUBVERSION_REV="\"${SUBVERSION_REV}"\"
+ 
+ 
+-CFLAGS = -O3 ${definedForAll} ${VERSION_FLAGS}
++CFLAGS += -O3 ${definedForAll} ${VERSION_FLAGS}
+ 
+ 
+ srcFiles = lastz infer_scores \
+@@ -101,13 +101,13 @@ incFiles = lastz.h infer_scores.h \
+ 
+ 
+ lastz: $(foreach part,${srcFiles},${part}.o)
+-	${CC} $(foreach part,${srcFiles},${part}.o) -lm -o $@
++	${CC} $(foreach part,${srcFiles},${part}.o) -lm -o $@ $(LDFLAGS)
+ 
+ lastz_D: $(foreach part,${srcFiles},${part}_D.o)
+-	${CC} $(foreach part,${srcFiles},${part}_D.o) -lm -o $@
++	${CC} $(foreach part,${srcFiles},${part}_D.o) -lm -o $@ $(LDFLAGS)
+ 
+ lastz_32: $(foreach part,${srcFiles},${part}_32.o)
+-	${CC} $(foreach part,${srcFiles},${part}_32.o) -lm -o $@
++	${CC} $(foreach part,${srcFiles},${part}_32.o) -lm -o $@ $(LDFLAGS)
+ 
+ # cleanup
+ 


=====================================
debian/patches/series
=====================================
@@ -0,0 +1,2 @@
+propagate_cflags.patch
+2to3.patch


=====================================
debian/rules
=====================================
@@ -14,18 +14,16 @@ include /usr/share/dpkg/default.mk
 # SOURCE_DATE_EPOCH: the source release date as seconds since the epoch, as
 #                    specified by <https://reproducible-builds.org/specs/source-date-epoch/>
 
-# for hardening you might like to uncomment this:
-# export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+
+export DEB_CFLAGS_MAINT_APPEND  = -Wno-stringop-truncation
 
 %:
 	dh $@
 
-### When overriding auto_test make sure DEB_BUILD_OPTIONS will be respected
-#override_dh_auto_test:
-#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-#	do_stuff_for_testing
-#endif
-
-### If you **really** can not use uscan (even not with mode=git) use a debian/get-orig-script
-#get-orig-source:
-#	. debian/get-orig-source
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	$(MAKE) base_tests
+	#$(MAKE) test
+	$(MAKE) clean_test
+endif



View it on GitLab: https://salsa.debian.org/med-team/lastz/-/commit/0a8e7e68b2031dbda4c65e4413b028da6c4de33a

-- 
View it on GitLab: https://salsa.debian.org/med-team/lastz/-/commit/0a8e7e68b2031dbda4c65e4413b028da6c4de33a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200615/09533b5a/attachment-0001.html>


More information about the debian-med-commit mailing list