From eee3145059a22a2e0c835b0b2f675c888ba0089c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrer=20=C3=96zen?= Date: Thu, 7 Dec 2006 16:39:35 +0000 Subject: [PATCH] pythonize. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .la dosyası içeren çeşitli paketleri derledim ama bunu deneyecek paket bulamadım. Bilen varsa bir denesin. Elle hatalı .la dosyası verince düzeltiyor en azından. --- pisi/util.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pisi/util.py b/pisi/util.py index 96270415..78fece93 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -518,11 +518,12 @@ def strip_directory(top, excludelist=[]): # entries sometimes triggers compile-time errors or linkage problems. # Instead of patching all these buggy sources and maintain these patches, # PiSi removes wrong paths... - extension = os.path.splitext(frpath)[1] - if extension == ".la": - # FIXME: I'm regular expr. idiot, so one can convert this to python... - os.system("sed -i -e 's~-L%s/[[:graph:]]*~~g' %s" % (ctx.config.tmp_dir(), frpath)) - os.system("sed -i -e 's~%s/[[:graph:]]*/install/~/~g' %s" % (ctx.config.tmp_dir(), frpath)) + if frpath.endswith(".la"): + ladata = file(frpath).read() + new_ladata = re.sub("-L%s/\S*" % ctx.config.tmp_dir(), "", ladata) + new_ladata = re.sub("%s/\S*/install/" % ctx.config.tmp_dir(), "/", new_ladata) + if new_ladata != ladata: + file(frpath, "w").write(new_ladata) # real path in .pisi package p = '/' + removepathprefix(top, frpath) strip = True