Source

SCons / test / packaging / rpm / multipackage.py

Diff from to

File test/packaging/rpm/multipackage.py

 """
 
 import os
-import glob
+import SCons.Tool.rpmutils
 import TestSCons
 
 _python_ = TestSCons._python_
 test.run(arguments='', stderr = None)
 
 src_rpm      = 'foo-1.2.3-0.src.rpm'
-machine_rpm  = 'foo-1.2.3-0.*.rpm'
+machine_rpm  = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
 src_rpm2     = 'foo2-1.2.3-0.src.rpm'
-machine_rpm2 = 'foo2-1.2.3-0.*.rpm'
+machine_rpm2 = 'foo2-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
 
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
 test.must_exist( src_rpm )
 
-test.must_exist_one_of( [machine_rpm2] )
+test.must_exist( machine_rpm2 )
 test.must_exist( src_rpm2 )
 
 test.must_not_exist( 'bin/main' )
-test.fail_test( not os.popen('rpm -qpl %s' % glob.glob(machine_rpm)[0].lstrip('./')).read()=='/bin/main\n')
+test.fail_test( not os.popen('rpm -qpl %s' % machine_rpm).read()=='/bin/main\n')
 test.fail_test( not os.popen('rpm -qpl %s' % src_rpm).read()=='foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n')
 
 test.pass_test()