summaryrefslogtreecommitdiff
path: root/src/dh_xul-ext
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@ubuntu.com>2009-12-17 19:57:11 +0100
committerBenjamin Drung <bdrung@ubuntu.com>2009-12-17 19:57:11 +0100
commite9c6fc7700efcea66d90a82762475a05aa732a10 (patch)
treecb90402d09e3ff3d9ceb2c5d7ae22eb92bab50dc /src/dh_xul-ext
parent219e0a074702900f9c954f462ecace9b3a5c7149 (diff)
Follow symlinks, when searching for install.rdf files.
Diffstat (limited to 'src/dh_xul-ext')
-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