[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:43:33 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=f89e8e3

The following commit has been merged in the master branch:
commit f89e8e3e160cb25d3a14cfb7162507bddf705403
Author: Robin Mills <robin at clanmills.com>
Date:   Thu Nov 22 08:04:52 2012 +0000

    build-test.py: cygwin and windows support.
---
 test/build-test.py    | 322 +++++++++++++++++++++++++++++++-------------------
 test/functions.source |   4 +-
 2 files changed, 201 insertions(+), 125 deletions(-)

diff --git a/test/build-test.py b/test/build-test.py
index 41e941e..da4ac53 100755
--- a/test/build-test.py
+++ b/test/build-test.py
@@ -1,160 +1,234 @@
 #!/usr/bin/python
 
+##
+# build-test.py [--verbose]
+#
+# reads the output of exiv2 -v -V and inspects it for sanity
+# primary test is to inspect the loaded libraries
+# TODO: 1 report loaded libraries that we didn't expect
+#       2 mingw support
+##
+
 import os
 import sys
 import subprocess
 
 ##
+#   print error msg and terminate
 def error(msg):
-	print '***',msg,'***'
-	sys.exit(1)
+    print '***',msg,'***'
+    sys.exit(1)
 
 ##
 #   process the version information dictionary
 def platform(dict):
-	verbose=dict.has_key('verbose')
-	for k in sorted(dict.keys()):
-		v=dict[k]
-		if type(v)==type([]):
-			v='['+str(len(v))+']'
-		if verbose:
-			print "%-20s -> %s" % (k,v)
+    verbose=dict.has_key('verbose')
+    for k in sorted(dict.keys()):
+        v=dict[k]
+        if type(v)==type([]):
+            v='['+str(len(v))+']'
+        if verbose:
+            print "%-20s -> %s" % (k,v)
 
 ##
-#
+#   search dict for an array of libraries
 def expect(dict,expects):
-	libs=dict['library']
- 	E={};
- 	for e in expects:
-		e=e.split('.')[0]
- 		E[e]=0
- 	for lib in libs:
- 		lib=os.path.basename(lib).split('.')[0]
- 		if E.has_key(lib):
- 			E[lib]=E[lib]+1
- 	for e in E.keys():
- 		if E[e]==0:
- 			error( "expected library '%s' not found" % e )
+    verbose=dict.has_key('verbose')
+    libs=dict['library']
+    E={};
+    for e in expects:
+        e=e.lower().replace('-','.') # cygwin uses - in versioning
+        e=e.split('.')[0]
+        if verbose:
+            print 'expect library',e
+        E[e]=0
+        
+    for lib in libs:
+        lib=lib.lower().replace('\','/') # cygwin uses \ in pathnames
+        lib=lib.replace('-','.')
+        lib=os.path.basename(lib).split('.')[0]
+        if E.has_key(lib):
+            E[lib]=E[lib]+1
+            if verbose:
+                print 'found  library',lib
+    for e in E.keys():
+        if E[e]==0:
+            error( "expected library '%s' not found" % e )
 
 ## 
-#
 def apple(dict):
-	platform(dict)
-
-	os_major=int(os.uname()[2].split('.')[0])
-	os_minor=int(os.uname()[2].split('.')[1])
-	NC=13;ML=12;LION=11;SL=10;LEO=9;
-
- 	if dict['bits'] != 64:
- 		print '*** expected 64 bit build ***'
-
-	expects= [ 'libSystem.B.dylib'
-			 , 'libexpat.1.dylib'			 
-			 , 'libz.1.dylib'
-			 , 'libiconv.2.dylib'
-			 , 'libstdc++.6.dylib'
-			 , 'libdyld.dylib'
-			 , 'libc++.1.dylib'
-			 ] ;
-	if dict['dll']:
-		expects=[ 'libexiv2.12.dylib'
-				];
-		expect(dict,expects)
-
-	if os_major == ML and dict['dll']==1:
-		expects= [ 'libexiv2.12.dylib'
-			 , 'libSystem.B.dylib'
-			 , 'libexpat.1.dylib'			 
-			 , 'libz.1.dylib'
-			 , 'libiconv.2.dylib'
-			 , 'libstdc++.6.dylib'
-			 , 'libdyld.dylib'
-			 , 'libc++.1.dylib'
-			 ] ;
-		expect(dict,expects)
+    platform(dict)
+
+    # which version of MacOS-X ?
+    os_major=int(os.uname()[2].split('.')[0])
+    os_minor=int(os.uname()[2].split('.')[1])
+    NC=13;ML=12;LION=11;SL=10;LEO=9;
+
+    if dict['bits'] != 64:
+        print '*** expected 64 bit build ***'
+
+    expects= [ 'libSystem.B.dylib'
+             , 'libexpat.1.dylib'            
+             , 'libz.1.dylib'
+             , 'libiconv.2.dylib'
+             , 'libstdc++.6.dylib'
+             , 'libdyld.dylib'
+             , 'libc++.1.dylib'
+             ] ;
+    if dict['dll']:
+        expects.append('libexiv2.12.dylib')
+    
+    expect(dict,expects)
+
+    ## Mountain lion dll build
+    if os_major == ML and dict['dll']==1:
+        expects= [ 'libexiv2.12.dylib'
+                 , 'libSystem.B.dylib'
+                 , 'libexpat.1.dylib'
+                 , 'libz.1.dylib'
+                 , 'libiconv.2.dylib'
+                 , 'libstdc++.6.dylib'
+                 , 'libdyld.dylib'
+                 , 'libc++.1.dylib'
+                 ] ;
+        expect(dict,expects)
 
 ##
-#  
 def linux(dict):
-	platform(dict)
-	expects = [ 'libdl.so.2'
-			, 'libexiv2.so.12'
-			, 'libstdc++.so.6'
-			, 'libm.so.6'
-			, 'libgcc_s.so.1'
-			, 'libc.so.6'
-			, 'libz.so.1'
-			, 'libexpat.so.1'
-             ]
-	expect(dict,expects)
-	
+    platform(dict)
+    expects = [ 'libdl.so.2'
+              , 'libexiv2.so.12'
+              , 'libstdc++.so.6'
+              , 'libm.so.6'
+              , 'libgcc_s.so.1'
+              , 'libc.so.6'
+              , 'libz.so.1'
+              , 'libexpat.so.1'
+              ]
+    expect(dict,expects)
+    
 ## 
 def windows(dict):
-	platform(dict)
-	error("can't test platform")
+    platform(dict)
+    expects = [ 'ntdll.dll'
+              , 'kernel32.dll'
+              , 'KERNELBASE.dll'
+              , 'PSAPI.DLL'
+              ];
+    expect(dict,expects)
+    
+    if dict['dll']==1:
+        dll='d.dll' if dict['debug']==1 else '.dll' 
+        expects = [ 'exiv2' + dll 
+                  , 'zlib1' + dll 
+                  , 'libexpat.dll'
+                  ]
+        # c run time libraries
+        v=int(float(dict['version'])) # 7,8,9,10 etc
+        if v in range(8,10):
+            expects.append('msvcr%d0%s' % (v,dll) )
+            expects.append('msvcp%d0%s' % (v,dll) )
+
+        expect(dict,expects)
+
 ## 
 def cygwin(dict):
-	platform(dict)
-	error("can't test platform")
+    platform(dict)
+    expects = [ 'ntdll.dll'
+              , 'kernel32.dll'
+              , 'KERNELBASE.dll'
+              , 'cygexiv2-12.dll'
+              , 'cygwin1.dll'
+              , 'cyggcc_s-1.dll'
+              , 'cygstdc++-6.dll'
+              , 'PSAPI.DLL'
+              , 'cygexpat-1.dll'
+              , 'cygiconv-2.dll'
+              , 'cygintl-8.dll'
+              ];
+    expect(dict,expects)
+
 ## 
 def mingw(dict):
-	platform(dict)
-	error("can't test platform")
+    platform(dict)
+    error("can't test platform mingw")
+
 ## 
 def unknown(dict):
-	platform(dict)
-	error("can't test platform")
+    platform(dict)
+    error("can't test platform unknown")
+
+##
+def runCommand(command):
+    ##
+    # don't use       check_output 
+    # this is 2.7 feature.
+    # Not available cygwin's default python 2.6.8 interpreter
+    # result=subprocess.check_output( command.split(' '))
+    result  =subprocess.Popen(command.split(' '), stdout=subprocess.PIPE).communicate()[0]
+    # ensure lines are 
 terminated
+    return result.replace('
', '
').replace('
', '
')
 
 ##
 def main(args):
-	this=os.path.abspath(args[0])
-
-	##
-	# find the exiv2 executable
-	exiv2='exiv2'
-	if os.environ.has_key('EXIV2_BINDIR'):
-		exiv2=os.path.abspath(os.path.join(os.environ['EXIV2_BINDIR'],exiv2))
-	else:
-		exiv2=os.path.join(os.path.dirname(this),'../bin',exiv2)
-
-	##
-	# collect the version dictionary from exiv2
-	dict={}
-	for arg in args:
-		if arg == '--verbose':
-			dict['verbose'] = True
-	
-	if os.path.exists(exiv2):
-		output = subprocess.check_output( [ exiv2, '-v', '-V' ])
-		lines = output.split('
')
-		for l in lines:
-			kv=l.split('=')
-			if len(kv)==2:
-				k=kv[0]
-				v=kv[1]
-				if not dict.has_key(k):
-					dict[k]=[]
-				dict[k].append(v)
-
-		# flatten value arrays of length 1
-		for k in dict.keys():
-			if type(dict[k])==type([]): 
-				if len(dict[k])==1:
-					dict[k]=dict[k][0]
-		# convert numeric strings to ints
-		dict['dll']=int(dict['dll'])
-		dict['debug']=int(dict['debug'])
-		dict['bits']=int(dict['bits'])
-
-		##
-		# analyse the version dictionary
-		eval(dict['platform']+"(dict)")
-	else:
-		error("exiv2 not found!")
+    this=os.path.abspath(args[0])
+
+    ##
+    # find the exiv2 executable
+    exiv2='exiv2'
+    if os.environ.has_key('EXIV2_BINDIR'):
+        exiv2=os.path.abspath(os.path.join(os.environ['EXIV2_BINDIR'],exiv2))
+    else:
+        exiv2=os.path.join(os.path.dirname(this),'../bin',exiv2)
+        
+    ##
+    # collect the version dictionary from exiv2
+    dict={}
+    verbose=False
+    for arg in args:
+        if arg == '--verbose':
+            verbose=True
+            dict['verbose']=True
+    
+    if os.path.exists(exiv2):
+        output = runCommand(exiv2 + ' -v -V')
+        if verbose: 
+            print output
+        lines = output.split('
')
+        for l in lines:
+            kv=l.split('=')
+            if len(kv)==2:
+                k=kv[0]
+                v=kv[1]
+                if not dict.has_key(k):
+                    dict[k]=[]
+                dict[k].append(v)
+
+        # flatten value arrays of length 1
+        for k in dict.keys():
+            if type(dict[k])==type([]): 
+                if len(dict[k])==1:
+                    dict[k]=dict[k][0]
+        # convert numeric strings to ints
+        dict['dll'  ] = int(dict['dll'])
+        dict['debug'] = int(dict['debug'])
+        dict['bits' ] = int(dict['bits'])
+
+        ##
+        # analyse the version dictionary
+        eval(dict['platform']+'(dict)')
+
+        ##
+        # report success!
+        debug='debug';dll='dll';platform='platform';bits='bits'
+        v='Release' if dict[debug]==0 else 'Debug  '
+        d='DLL'     if dict[dll  ]==0 else '   '
+        print "build %s %dbit %s%s looks good" % (dict[platform],dict[bits],v,d)
+    else:
+        error("exiv2 not found!")
 
 if __name__ == '__main__':
-	main(sys.argv)
-	print "build looks good"
+    main(sys.argv)
 
 # That's all Folks!
-##
\ No newline at end of file
+##
diff --git a/test/functions.source b/test/functions.source
index acb142c..d0a0e35 100644
--- a/test/functions.source
+++ b/test/functions.source
@@ -384,7 +384,9 @@ prepareTest()
 				fi
 				args+=($i)
 			done
-			"$here/../msvc/diff$exe" ${args[@]}
+			DIFF=$(readlink -f "$here/../msvc/diff$exe")
+			chmod +x "$DIFF"
+			         "$DIFF" ${args[@]}
 		}
 	fi
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list