Commit 5630b75c authored by Łukasz Nowak's avatar Łukasz Nowak

- rpath is becoming obsolete and can be treated optional, so on system which

   set runpath use it, but protect file from wrong different setting of rpath
   and runpath in case when both are set


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40289 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3c5c0581
...@@ -51,9 +51,12 @@ def readElfAsDict(f): ...@@ -51,9 +51,12 @@ def readElfAsDict(f):
rpath_list = [q.rstrip('/') for q in l.split(':',1)[1].strip(' []').split(':')] rpath_list = [q.rstrip('/') for q in l.split(':',1)[1].strip(' []').split(':')]
elif '(RUNPATH)' in l: elif '(RUNPATH)' in l:
runpath_list = [q.rstrip('/') for q in l.split(':',1)[1].strip(' []').split(':')] runpath_list = [q.rstrip('/') for q in l.split(':',1)[1].strip(' []').split(':')]
if len(runpath_list) == 0:
runpath_list = rpath_list
elif len(rpath_list) != 0:
raise ValueError(rpath_list != runpath_list)
return dict( return dict(
library_list=sorted(library_list), library_list=sorted(library_list),
rpath_list=sorted(rpath_list),
runpath_list=sorted(runpath_list) runpath_list=sorted(runpath_list)
) )
...@@ -122,7 +125,6 @@ class AssertMysql50Tritonn(unittest.TestCase): ...@@ -122,7 +125,6 @@ class AssertMysql50Tritonn(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['ncurses', 'zlib', 'senna', 'readline', 'openssl']] software in ['ncurses', 'zlib', 'senna', 'readline', 'openssl']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_mysqlmanager(self): def test_ld_mysqlmanager(self):
...@@ -133,7 +135,6 @@ class AssertMysql50Tritonn(unittest.TestCase): ...@@ -133,7 +135,6 @@ class AssertMysql50Tritonn(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['ncurses', 'zlib', 'readline', 'openssl']] software in ['ncurses', 'zlib', 'readline', 'openssl']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_libmysqlclient_r(self): def test_ld_libmysqlclient_r(self):
...@@ -144,7 +145,6 @@ class AssertMysql50Tritonn(unittest.TestCase): ...@@ -144,7 +145,6 @@ class AssertMysql50Tritonn(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['ncurses', 'zlib', 'readline', 'openssl']] software in ['ncurses', 'zlib', 'readline', 'openssl']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_libmysqlclient(self): def test_ld_libmysqlclient(self):
...@@ -155,7 +155,6 @@ class AssertMysql50Tritonn(unittest.TestCase): ...@@ -155,7 +155,6 @@ class AssertMysql50Tritonn(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['ncurses', 'zlib', 'readline', 'openssl']] software in ['ncurses', 'zlib', 'readline', 'openssl']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_sphinx(self): def test_ld_sphinx(self):
...@@ -166,7 +165,6 @@ class AssertMysql50Tritonn(unittest.TestCase): ...@@ -166,7 +165,6 @@ class AssertMysql50Tritonn(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['ncurses', 'zlib', 'readline', 'openssl']] software in ['ncurses', 'zlib', 'readline', 'openssl']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_mysql(self): def test_ld_mysql(self):
...@@ -179,7 +177,6 @@ class AssertMysql50Tritonn(unittest.TestCase): ...@@ -179,7 +177,6 @@ class AssertMysql50Tritonn(unittest.TestCase):
software in ['ncurses', 'zlib', 'readline', 'openssl']] software in ['ncurses', 'zlib', 'readline', 'openssl']]
expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir),
'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')) 'parts', 'mysql-tritonn-5.0', 'lib', 'mysql'))
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_mysqladmin(self): def test_ld_mysqladmin(self):
...@@ -191,7 +188,6 @@ class AssertMysql50Tritonn(unittest.TestCase): ...@@ -191,7 +188,6 @@ class AssertMysql50Tritonn(unittest.TestCase):
software in ['ncurses', 'zlib', 'readline', 'openssl']] software in ['ncurses', 'zlib', 'readline', 'openssl']]
expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir),
'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')) 'parts', 'mysql-tritonn-5.0', 'lib', 'mysql'))
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_mysqldump(self): def test_ld_mysqldump(self):
...@@ -203,7 +199,6 @@ class AssertMysql50Tritonn(unittest.TestCase): ...@@ -203,7 +199,6 @@ class AssertMysql50Tritonn(unittest.TestCase):
software in ['ncurses', 'zlib', 'readline', 'openssl']] software in ['ncurses', 'zlib', 'readline', 'openssl']]
expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir),
'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')) 'parts', 'mysql-tritonn-5.0', 'lib', 'mysql'))
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
class AssertMysql51(unittest.TestCase): class AssertMysql51(unittest.TestCase):
...@@ -214,7 +209,6 @@ class AssertMysql51(unittest.TestCase): ...@@ -214,7 +209,6 @@ class AssertMysql51(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['ncurses', 'zlib', 'readline']] software in ['ncurses', 'zlib', 'readline']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_mysqlmanager(self): def test_ld_mysqlmanager(self):
...@@ -224,7 +218,6 @@ class AssertMysql51(unittest.TestCase): ...@@ -224,7 +218,6 @@ class AssertMysql51(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['ncurses', 'zlib', 'readline']] software in ['ncurses', 'zlib', 'readline']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_libmysqlclient_r(self): def test_ld_libmysqlclient_r(self):
...@@ -234,7 +227,6 @@ class AssertMysql51(unittest.TestCase): ...@@ -234,7 +227,6 @@ class AssertMysql51(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['ncurses', 'zlib', 'readline']] software in ['ncurses', 'zlib', 'readline']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_libmysqlclient(self): def test_ld_libmysqlclient(self):
...@@ -244,7 +236,6 @@ class AssertMysql51(unittest.TestCase): ...@@ -244,7 +236,6 @@ class AssertMysql51(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['ncurses', 'readline', 'zlib']] software in ['ncurses', 'readline', 'zlib']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_mysql(self): def test_ld_mysql(self):
...@@ -257,7 +248,6 @@ class AssertMysql51(unittest.TestCase): ...@@ -257,7 +248,6 @@ class AssertMysql51(unittest.TestCase):
software in ['ncurses', 'zlib', 'readline']] software in ['ncurses', 'zlib', 'readline']]
expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir),
'parts', 'mysql-5.1', 'lib', 'mysql')) 'parts', 'mysql-5.1', 'lib', 'mysql'))
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_mysqladmin(self): def test_ld_mysqladmin(self):
...@@ -270,7 +260,6 @@ class AssertMysql51(unittest.TestCase): ...@@ -270,7 +260,6 @@ class AssertMysql51(unittest.TestCase):
software in ['ncurses', 'zlib', 'readline']] software in ['ncurses', 'zlib', 'readline']]
expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir),
'parts', 'mysql-5.1', 'lib', 'mysql')) 'parts', 'mysql-5.1', 'lib', 'mysql'))
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_mysqldump(self): def test_ld_mysqldump(self):
...@@ -282,7 +271,6 @@ class AssertMysql51(unittest.TestCase): ...@@ -282,7 +271,6 @@ class AssertMysql51(unittest.TestCase):
software in ['ncurses', 'zlib', 'readline']] software in ['ncurses', 'zlib', 'readline']]
expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir),
'parts', 'mysql-5.1', 'lib', 'mysql')) 'parts', 'mysql-5.1', 'lib', 'mysql'))
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
class AssertMemcached(unittest.TestCase): class AssertMemcached(unittest.TestCase):
...@@ -296,7 +284,6 @@ class AssertMemcached(unittest.TestCase): ...@@ -296,7 +284,6 @@ class AssertMemcached(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['libevent']] software in ['libevent']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
class AssertPythonMysql(unittest.TestCase): class AssertPythonMysql(unittest.TestCase):
...@@ -312,7 +299,6 @@ class AssertPythonMysql(unittest.TestCase): ...@@ -312,7 +299,6 @@ class AssertPythonMysql(unittest.TestCase):
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['zlib', 'openssl']] software in ['zlib', 'openssl']]
expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), 'parts', 'mysql-tritonn-5.0', 'lib', 'mysql')) expected_rpath_list.append(os.path.join(os.path.abspath(os.curdir), 'parts', 'mysql-tritonn-5.0', 'lib', 'mysql'))
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
class AssertApache(unittest.TestCase): class AssertApache(unittest.TestCase):
...@@ -326,7 +312,6 @@ class AssertApache(unittest.TestCase): ...@@ -326,7 +312,6 @@ class AssertApache(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['apache', 'zlib', 'openssl', 'libuuid']] software in ['apache', 'zlib', 'openssl', 'libuuid']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_libapr1(self): def test_ld_libapr1(self):
...@@ -337,7 +322,6 @@ class AssertApache(unittest.TestCase): ...@@ -337,7 +322,6 @@ class AssertApache(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['zlib', 'openssl', 'libuuid']] software in ['zlib', 'openssl', 'libuuid']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_ld_libexpat(self): def test_ld_libexpat(self):
...@@ -347,7 +331,6 @@ class AssertApache(unittest.TestCase): ...@@ -347,7 +331,6 @@ class AssertApache(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['zlib', 'openssl']] software in ['zlib', 'openssl']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
def test_modules(self): def test_modules(self):
...@@ -438,7 +421,6 @@ class AssertItools(unittest.TestCase): ...@@ -438,7 +421,6 @@ class AssertItools(unittest.TestCase):
soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts') soft_dir = os.path.join(os.path.abspath(os.curdir), 'parts')
expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for expected_rpath_list = [os.path.join(soft_dir, software, 'lib') for
software in ['glib']] software in ['glib']]
self.assertEqual(sorted(expected_rpath_list), elf_dict['rpath_list'])
self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list']) self.assertEqual(sorted(expected_rpath_list), elf_dict['runpath_list'])
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment