[systemd-devel] [PATCHv2] install: Assume *.wants symlinks have the same name as their target for scalability.
david at davidstrauss.net
david at davidstrauss.net
Fri Dec 13 13:03:30 PST 2013
From: David Strauss <david at davidstrauss.net>
---
src/shared/install.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/shared/install.c b/src/shared/install.c
index 17e8a75..512e3df 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -419,10 +419,15 @@ static int find_symlinks_fd(
r = q;
} else if (de->d_type == DT_LNK) {
- _cleanup_free_ char *p = NULL, *dest = NULL;
+ _cleanup_free_ char *p = NULL, *dest = NULL, *no_inst = NULL;
bool found_path, found_dest, b = false;
int q;
+ /* Skip symlinks with a different name the target unit */
+ no_inst = unit_name_replace_instance(basename(de->d_name), "");
+ if (!streq(no_inst, name))
+ continue;
+
/* Acquire symlink name */
p = path_make_absolute(de->d_name, path);
if (!p)
--
1.8.3.1
More information about the systemd-devel
mailing list