From 4cc587f6388088eb42dca3b5a5903d92ca900528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6k=C3=A7en=20Eraslan?= Date: Mon, 28 Jan 2008 12:28:44 +0000 Subject: [PATCH] fix dohtml's recursive behaviour, now it correctly includes files under subdirectories --- pisi/actionsapi/pisitools.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pisi/actionsapi/pisitools.py b/pisi/actionsapi/pisitools.py index 83a29eb4..b82f51f7 100644 --- a/pisi/actionsapi/pisitools.py +++ b/pisi/actionsapi/pisitools.py @@ -25,7 +25,7 @@ _ = __trans.ugettext # Pisi Modules import pisi.context as ctx -from pisi.util import join_path +from pisi.util import join_path, remove_prefix # ActionsAPI Modules import pisi.actionsapi @@ -71,11 +71,13 @@ def dohtml(*sourceFiles): if os.path.isfile(source) and os.path.splitext(source)[1] in allowed_extensions: system('install -m0644 "%s" %s' % (source, destionationDirectory)) if os.path.isdir(source) and os.path.basename(source) not in disallowed_directories: + eraser = os.path.split(source)[0] for root, dirs, files in os.walk(source): - for source in files: - if os.path.splitext(source)[1] in allowed_extensions: - makedirs(destionationDirectory) - system('install -m0644 %s %s' % (join_path(root, source), destionationDirectory)) + newRoot = remove_prefix(eraser, root) + for sourcename in files: + if os.path.splitext(sourcename)[1] in allowed_extensions: + makedirs(join_path(destionationDirectory, newRoot)) + system('install -m0644 %s %s' % (join_path(root, sourcename), join_path(destionationDirectory, newRoot, sourcename))) def doinfo(*sourceFiles): '''inserts the into files in the list of files into /usr/share/info'''