summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/dh_xul-ext19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/dh_xul-ext b/src/dh_xul-ext
index 17c8b68..c2a9980 100755
--- a/src/dh_xul-ext
+++ b/src/dh_xul-ext
@@ -178,16 +178,21 @@ def get_provided_package_names(package, supported_apps):
return list(provides)
-def find_install_rdfs(package):
- install_rdfs = list()
- for root, dirs, files in os.walk("debian/" + package):
- if "install.rdf" in files:
- install_rdfs.append(os.path.join(root, "install.rdf"))
- dirs = filter(lambda d: not os.path.islink(os.path.join(root, d)), dirs)
+def find_install_rdfs(path):
+ install_rdfs = set()
+
+ if os.path.isfile(path) and os.path.basename(path) == "install.rdf":
+ install_rdfs.add(os.path.realpath(path))
+
+ if os.path.isdir(path):
+ # recursive walk
+ content = map(lambda d: os.path.join(path, d), os.listdir(path))
+ install_rdfs = reduce(lambda x, d: x.union(find_install_rdfs(d)), content, install_rdfs)
+
return install_rdfs
def generate_substvars(xul_apps, package, verbose=False):
- install_rdfs = find_install_rdfs(package)
+ install_rdfs = find_install_rdfs("debian/" + package)
if len(install_rdfs) == 0:
# this package does not contain a xul extension
return