All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] package_rpm.bbclass: support packaging of symlinks to directories
@ 2015-02-17 13:42 Patrick Ohly
  2015-02-17 15:55 ` Christopher Larson
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Patrick Ohly @ 2015-02-17 13:42 UTC (permalink / raw)
  To: openembedded-core

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@intel.com>
---
 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 92ddf7a..6483e96 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
-- 
1.8.4.5



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-02-25 15:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-17 13:42 [PATCH] package_rpm.bbclass: support packaging of symlinks to directories Patrick Ohly
2015-02-17 15:55 ` Christopher Larson
2015-02-18  8:43   ` Patrick Ohly
2015-02-18  9:08     ` Patrick Ohly
2015-02-17 16:54 ` Mark Hatle
2015-02-17 16:57   ` Christopher Larson
2015-02-17 17:09     ` Mark Hatle
2015-02-18  3:40       ` Dan McGregor
2015-02-18  8:45         ` Patrick Ohly
2015-02-18 14:54           ` Mark Hatle
2015-02-25 14:51 ` [PATCH v2] " Patrick Ohly
2015-02-25 15:18   ` Patrick Ohly
2015-02-25 14:53 ` [PATCH v3] " Patrick Ohly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.