Files
core/system/base/baselayout/comar/pakhandler.py
T
2015-02-24 11:18:35 +02:00

34 lines
797 B
Python

# -*- coding: utf-8 -*-
def update_ld_so_cache(filepath):
import glob
import piksemel
import subprocess
libdirs = []
for config_file in glob.glob("/etc/ld.so.conf.d/*.conf"):
for line in open(config_file):
line = line.strip()
if line.startswith("/"):
libdirs.append(line[1:])
libdirs = tuple(libdirs)
doc = piksemel.parse(filepath)
for item in doc.tags("File"):
path = item.getTagData("Path")
if path.startswith(libdirs):
subprocess.call(["/sbin/ldconfig", "-X"])
return
def setupPackage(metapath, filepath):
update_ld_so_cache(filepath)
def cleanupPackage(metapath, filepath):
pass
def postCleanupPackage(metapath, filepath):
update_ld_so_cache(filepath)