summaryrefslogtreecommitdiff
path: root/buildstream
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-02-13 12:42:42 +0000
committerJürg Billeter <j@bitron.ch>2019-02-13 12:42:42 +0000
commitae0ee361350b13a6c0f2fb24d3a24579305a021b (patch)
treee7e23696c4fd32bf2c5038faef8bbc048b3e908e /buildstream
parent8c6baf2360a756562291a9b3f398aaa6d5f06491 (diff)
parent353745a492102c96d7b2ca465c360836966f46ce (diff)
downloadbuildstream-ae0ee361350b13a6c0f2fb24d3a24579305a021b.tar.gz
Merge branch 'juerg/list-all-directories' into 'master'
Return all directories in list_relative_paths() See merge request BuildStream/buildstream!1139
Diffstat (limited to 'buildstream')
-rw-r--r--buildstream/data/projectconfig.yaml6
-rw-r--r--buildstream/storage/_casbaseddirectory.py8
-rw-r--r--buildstream/utils.py11
3 files changed, 13 insertions, 12 deletions
diff --git a/buildstream/data/projectconfig.yaml b/buildstream/data/projectconfig.yaml
index 2a6b09a15..ee4055cf5 100644
--- a/buildstream/data/projectconfig.yaml
+++ b/buildstream/data/projectconfig.yaml
@@ -91,10 +91,16 @@ split-rules:
# and shared libraries by default.
runtime:
- |
+ %{bindir}
+ - |
%{bindir}/*
- |
+ %{sbindir}
+ - |
%{sbindir}/*
- |
+ %{libexecdir}
+ - |
%{libexecdir}/*
- |
%{libdir}/lib*.so*
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index 09c8c9875..b6a39b83d 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -800,11 +800,11 @@ class CasBasedDirectory(Directory):
directory_list = filter(lambda i: isinstance(i[1].buildstream_object, CasBasedDirectory),
self.index.items())
- if file_list == [] and relpath != "":
+ if relpath != "":
yield relpath
- else:
- for (k, v) in sorted(file_list):
- yield os.path.join(relpath, k)
+
+ for (k, v) in sorted(file_list):
+ yield os.path.join(relpath, k)
for (k, v) in sorted(directory_list):
yield from v.buildstream_object.list_relative_paths(relpath=os.path.join(relpath, k))
diff --git a/buildstream/utils.py b/buildstream/utils.py
index b739ca658..12407ba30 100644
--- a/buildstream/utils.py
+++ b/buildstream/utils.py
@@ -117,9 +117,6 @@ def list_relative_paths(directory):
This generator is useful for checking the full manifest of
a directory.
- Note that directories will be yielded only if they are
- empty.
-
Symbolic links will not be followed, but will be included
in the manifest.
@@ -156,11 +153,9 @@ def list_relative_paths(directory):
# `directory`, prefer to have no prefix in that case.
basepath = relpath if relpath != '.' and dirpath != directory else ''
- # We've decended into an empty directory, in this case we
- # want to include the directory itself, but not in any other
- # case.
- if not filenames:
- yield relpath
+ # First yield the walked directory itself, except for the root
+ if basepath != '':
+ yield basepath
# List the filenames in the walked directory
for f in filenames: