[oe-commits] Patrick Ohly : package_rpm.bbclass: support packaging of symlinks to directories

git at git.openembedded.org git at git.openembedded.org
Thu Feb 19 07:52:16 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 5e6a5c5702ea3100b4ea6651dc36005775b7b30b
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=5e6a5c5702ea3100b4ea6651dc36005775b7b30b

Author: Patrick Ohly <patrick.ohly at intel.com>
Date:   Tue Feb 17 05:42:05 2015 -0800

package_rpm.bbclass: support packaging of symlinks to directories

os.walk() returns symlinks to directories in the "dirs" lists,
but then never enters them by default. As a result, the old
code applied neither the directory handling (because that
is active once a directory gets entered) nor the file handling,
and thus never packaged such symlinks.

The fix is simple: find such special directory entries and move
them to the "files" list.

Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/package_rpm.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index b87e634..4f9f813 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -197,6 +197,13 @@ python write_specfile () {
             if path.endswith("DEBIAN") or path.endswith("CONTROL"):
                 continue
 
+            # Treat all symlinks to directories as normal files.
+            # os.walk() lists them as directories.
+            for i, entry in enumerate(dirs):
+                if os.path.islink(os.path.join(rootpath, entry)):
+                    del dirs[i]
+                    files.append(entry)
+
             # Directory handling can happen in two ways, either DIRFILES is not set at all
             # in which case we fall back to the older behaviour of packages owning all their
             # directories



More information about the Openembedded-commits mailing list