spped_up.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --- scripts/checkelf.old 2014-06-19 18:50:10.499728066 +0200
  2. +++ scripts/checkelf 2014-06-19 18:47:59.408732856 +0200
  3. @@ -26,6 +26,7 @@
  4. import itertools
  5. import subprocess
  6. +FILESDB = pisi.db.filesldb.FilesLDB()
  7. INSTALLDB = pisi.db.installdb.InstallDB()
  8. CONSTANTS = pisi.constants.Constants()
  9. CMPFILTR = re.compile("(.*?)(\s*\((base|devel)\)\s*)$")
  10. @@ -73,6 +74,7 @@
  11. # result_undefined = undefined symbol errors
  12. return (result_needed, result_broken, result_unused, result_undefined)
  13. +found_objdump = []
  14. def check_objdump(processed_needed, package_elf_files, package_name):
  15. '''check the objdump needed libraries with the ldd libraries
  16. the libraries that are needed can be used for dependencies'''
  17. @@ -86,14 +88,18 @@
  18. else:
  19. # search for the package name (i.e: pisi sf /usr/lib/*.so )
  20. # the library may not exist, thus adding an exception is welcome
  21. + if objdump_needed.startswith("/"): objdump_needed = objdump_needed[1:]
  22. + if objdump_needed in found_objdump: continue
  23. try:
  24. - dependency_name = pisi.api.search_file(objdump_needed)[0][0]
  25. + dependency_name = FILESDB.search_file(objdump_needed)[0][0]
  26. + found_objdump.extend([x.path for x in INSTALLDB.get_files(dependency_name).list])
  27. except IndexError:
  28. dependency_name = "broken"
  29. #print "%s (probably broken dependency)" % needed
  30. result_needed.append((objdump_needed, dependency_name))
  31. return result_needed
  32. +found_pc_files = []
  33. def check_pc_files(pc_file):
  34. '''check for .pc files created by pkgconfig and shipped with the package
  35. these .pc files have requirements tags that can be used for dependencies'''
  36. @@ -102,12 +108,14 @@
  37. os.path.basename(pc_file).replace(".pc", "")).read().split("\n")[:-1])
  38. for require in requires:
  39. - require_file = "/usr/share/pkgconfig/%s.pc" % require
  40. + require_file = "usr/share/pkgconfig/%s.pc" % require
  41. - if not os.path.exists(require_file):
  42. - require_file = "/usr/lib/pkgconfig/%s.pc" % require
  43. + if not os.path.exists("/%s" % require_file):
  44. + require_file = "usr/lib/pkgconfig/%s.pc" % require
  45. + if require_file in found_pc_files: continue
  46. try:
  47. - dependency_name = pisi.api.search_file(require_file)[0][0]
  48. + dependency_name = FILESDB.search_file(require_file)[0][0]
  49. + found_pc_files.extend([x.path for x in INSTALLDB.get_files(dependency_name).list])
  50. except IndexError:
  51. dependency_name = "broken"