Source

SCons / test / packaging / rpm / internationalization.py

Diff from to

test/packaging/rpm/internationalization.py

 """
 
 import os
+import glob
 
 import TestSCons
 
-machine = TestSCons.machine
-try:
-    # Try to get the actual machine type (like i586), since
-    # TestSCons maps all ix86 types to a i386 machine internally.
-    import os
-    machine = os.uname()[4]
-except AttributeError:
-    pass
 _python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()
 test.run(arguments='', stderr = None)
 
 src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.%s.rpm' % machine
+machine_rpm = 'foo-1.2.3-0.*.rpm'
 
 test.must_exist( src_rpm )
-test.must_exist( machine_rpm )
+test.must_exist_one_of( [machine_rpm] )
 
 test.must_not_exist( 'bin/main' )
 
+machine_rpm_path = glob.glob(machine_rpm)[0].lstrip('./')
 cmd = 'rpm -qp --queryformat \'%%{GROUP}-%%{SUMMARY}-%%{DESCRIPTION}\' %s'
 
 os.environ['LANGUAGE'] = 'de'
-out = os.popen( cmd % test.workpath(machine_rpm) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
 test.fail_test( out != 'Applikation/büro-hallo-das sollte wirklich lang sein' )
 
 os.environ['LANGUAGE'] = 'fr'
-out = os.popen( cmd % test.workpath(machine_rpm) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
 test.fail_test( out != 'Application/bureau-bonjour-ceci devrait être vraiment long' )
 
 os.environ['LANGUAGE'] = 'en'
-out = os.popen( cmd % test.workpath(machine_rpm) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
 test.fail_test( out != 'Application/office-hello-this should be really long' )
 
 os.environ['LC_ALL'] = 'ae'
-out = os.popen( cmd % test.workpath(machine_rpm) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
 test.fail_test( out != 'Application/office-hello-this should be really long' )
 
 #
 test.run(arguments='--install-sandbox=blubb install', stderr = None)
 
 test.must_exist( src_rpm )
-test.must_exist( machine_rpm )
+test.must_exist_one_of( [machine_rpm] )
 
 test.pass_test()