Skip to contentSkip to conversation

archiver.bbclass: exclude recursive symlink for diff

PATCH In review Robert Yang 2 participants 7 messages Sep 3, 2013 – Sep 4, 2013

lore
Share & tools
lore
#0 lore raw

cover archiver.bbclass: exclude recursive symlink for diff

The following changes since commit 755f7d9afaab4e7424f5f57587aa45df3807acf0:

pulseaudio: disable GTK+ by default (2013-09-02 18:04:59 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib robert/archiver
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/archiver

Robert Yang (1):
archiver.bbclass: exclude recursive symlink for diff

 meta/classes/archiver.bbclass |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 archiver.bbclass: exclude recursive symlink for diff

There would be errors if there are recursive symlinks in the ${S}:

diff: /xxx/udev/182-r8/udev-182/test/sys/block/loop0/bdi/subsystem/0:16/subsystem: recursive directory loop

We can check the recursive symlink and save it to the exclude file, then the diff's --exclude-from argument can exclude them

[YOCTO #4986]

---
 meta/classes/archiver.bbclass |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
meta/classes/archiver.bbclass +18 -0
index 66efe7d..f5ad562 100644
@@ -493,6 +493,24 @@ def create_diff_gz(d):
     for i in exclude_from:
         f.write(i)
         f.write("\n")
+
+    symlinks = []
+    directories = []
+
+    # Add symlink and root dir to the separated lists for checking whether
+    # there is recursive symlink
+    for root, dirs, files in os.walk(os.getcwd(), followlinks=True):
+        if os.path.islink(root):
+            symlinks.append(root)
+        elif os.path.isdir(root):
+            directories.append(root)
+
+    # Check if there is a recursive symlink to a dir
+    for sym in symlinks:
+        if sym in directories:
+            # write the 'sym' in the 'exclude-from' file
+            f.write(os.path.basename(sym))
+
     f.close()
 
     s=d.getVar('S', True)
Signature · 1 line
1.7.10.4
#2 lore raw

Please hold this patch for a while, seems that it didn't fix all of the things.

// Robert

Quoted 45 lines · Robert Yang

There would be errors if there are recursive symlinks in the ${S}:

diff: /xxx/udev/182-r8/udev-182/test/sys/block/loop0/bdi/subsystem/0:16/subsystem: recursive directory loop

We can check the recursive symlink and save it to the exclude file, then the diff's --exclude-from argument can exclude them

[YOCTO #4986]

---
  meta/classes/archiver.bbclass |   18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
meta/classes/archiver.bbclass +18 -0
index 66efe7d..f5ad562 100644
@@ -493,6 +493,24 @@ def create_diff_gz(d):
      for i in exclude_from:
          f.write(i)
          f.write("\n")
+
+    symlinks = []
+    directories = []
+
+    # Add symlink and root dir to the separated lists for checking whether
+    # there is recursive symlink
+    for root, dirs, files in os.walk(os.getcwd(), followlinks=True):
+        if os.path.islink(root):
+            symlinks.append(root)
+        elif os.path.isdir(root):
+            directories.append(root)
+
+    # Check if there is a recursive symlink to a dir
+    for sym in symlinks:
+        if sym in directories:
+            # write the 'sym' in the 'exclude-from' file
+            f.write(os.path.basename(sym))
+
      f.close()
 
      s=d.getVar('S', True)
#3 lore raw

Hi,

What seems to be the issue ?

BR,
Valentin

Quoted 56 lines · Robert Yang

Please hold this patch for a while, seems that it didn't fix all of the things.

// Robert

Quoted 36 lines · Robert Yang

There would be errors if there are recursive symlinks in the ${S}:

diff: /xxx/udev/182-r8/udev-182/test/sys/block/loop0/bdi/subsystem/0:16/subsystem: recursive directory loop

We can check the recursive symlink and save it to the exclude file, then the diff's --exclude-from argument can exclude them

[YOCTO #4986]

---
  meta/classes/archiver.bbclass |   18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
meta/classes/archiver.bbclass +5 -0
index 66efe7d..f5ad562 100644
@@ -493,6 +493,24 @@ def create_diff_gz(d):
      for i in exclude_from:
          f.write(i)
          f.write("\n")
+
+    symlinks = []
+    directories = []
+
+    # Add symlink and root dir to the separated lists for checking 

whether

meta/classes/archiver.bbclass +6 -0
+    # there is recursive symlink
+    for root, dirs, files in os.walk(os.getcwd(), followlinks=True):
+        if os.path.islink(root):
+            symlinks.append(root)
+        elif os.path.isdir(root):
+            directories.append(root)

meta/classes/archiver.bbclass def create_diff_gz(d): · line 516

Quoted 10 lines
meta/classes/archiver.bbclass +7 -0
+
+    # Check if there is a recursive symlink to a dir
+    for sym in symlinks:
+        if sym in directories:
+            # write the 'sym' in the 'exclude-from' file
+            f.write(os.path.basename(sym))
+
      f.close()
 
      s=d.getVar('S', True)

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw

Hi Valentin,

It hangs up when build acl (which means that I can reproduce the problem as you have told), but it worked well without this patch, maybe python version related, I will do more investigation.

// Robert

Quoted 69 lines · Vali Cobelea

Hi,

What seems to be the issue ?

BR,
Valentin

Quoted 57 lines · Robert Yang

Please hold this patch for a while, seems that it didn't fix all of the things.

// Robert

Quoted 37 lines · Robert Yang

There would be errors if there are recursive symlinks in the ${S}:

diff:
/xxx/udev/182-r8/udev-182/test/sys/block/loop0/bdi/subsystem/0:16/subsystem:
recursive directory loop

We can check the recursive symlink and save it to the exclude file, then the diff's --exclude-from argument can exclude them

[YOCTO #4986]

---
  meta/classes/archiver.bbclass |   18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
meta/classes/archiver.bbclass +11 -0
index 66efe7d..f5ad562 100644
@@ -493,6 +493,24 @@ def create_diff_gz(d):
      for i in exclude_from:
          f.write(i)
          f.write("\n")
+
+    symlinks = []
+    directories = []
+
+    # Add symlink and root dir to the separated lists for checking whether
+    # there is recursive symlink
+    for root, dirs, files in os.walk(os.getcwd(), followlinks=True):
+        if os.path.islink(root):
+            symlinks.append(root)
+        elif os.path.isdir(root):
+            directories.append(root)

meta/classes/archiver.bbclass def create_diff_gz(d): · line 516

Quoted 10 lines
meta/classes/archiver.bbclass +7 -0
+
+    # Check if there is a recursive symlink to a dir
+    for sym in symlinks:
+        if sym in directories:
+            # write the 'sym' in the 'exclude-from' file
+            f.write(os.path.basename(sym))
+
      f.close()
 
      s=d.getVar('S', True)

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#5 lore raw

Hi,

You can try even without the patch and see if you reproduce the issue.
We do have the symlinks recursivity problem as I said but on random packages, "udev" was the first we noticed.

Best regards,
Valentin

Quoted 81 lines · Robert Yang

Hi Valentin,

It hangs up when build acl (which means that I can reproduce the problem as you have told), but it worked well without this patch, maybe python version related, I will do more investigation.

// Robert

Quoted 71 lines · Vali Cobelea

Hi,

What seems to be the issue ?

BR,
Valentin

Quoted 59 lines · Robert Yang

Please hold this patch for a while, seems that it didn't fix all of the things.

// Robert

Quoted 39 lines · Robert Yang

There would be errors if there are recursive symlinks in the ${S}:

diff:
/xxx/udev/182-r8/udev-182/test/sys/block/loop0/bdi/subsystem/0:16/subsystem:

recursive directory loop

We can check the recursive symlink and save it to the exclude file, then the diff's --exclude-from argument can exclude them

[YOCTO #4986]

---
  meta/classes/archiver.bbclass |   18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
meta/classes/archiver.bbclass +5 -0
index 66efe7d..f5ad562 100644
@@ -493,6 +493,24 @@ def create_diff_gz(d):
      for i in exclude_from:
          f.write(i)
          f.write("\n")
+
+    symlinks = []
+    directories = []
+
+    # Add symlink and root dir to the separated lists for checking 

whether

meta/classes/archiver.bbclass +6 -0
+    # there is recursive symlink
+    for root, dirs, files in os.walk(os.getcwd(), followlinks=True):
+        if os.path.islink(root):
+            symlinks.append(root)
+        elif os.path.isdir(root):
+            directories.append(root)

meta/classes/archiver.bbclass def create_diff_gz(d): · line 516

Quoted 10 lines
meta/classes/archiver.bbclass +7 -0
+
+    # Check if there is a recursive symlink to a dir
+    for sym in symlinks:
+        if sym in directories:
+            # write the 'sym' in the 'exclude-from' file
+            f.write(os.path.basename(sym))
+
      f.close()
 
      s=d.getVar('S', True)

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#6 lore raw
Quoted 5 lines · Vali Cobelea

Hi,

You can try even without the patch and see if you reproduce the issue. We do have the symlinks recursivity problem as I said but on random packages, "udev" was the first we noticed.

I can't reproduce the error, but it is really a problem, I've added a patch in the bugzilla, and will send it here sooner.

// Robert

Quoted 87 lines

Best regards,
Valentin

Quoted 79 lines · Robert Yang

Hi Valentin,

It hangs up when build acl (which means that I can reproduce the problem as you have told), but it worked well without this patch, maybe python version related, I will do more investigation.

// Robert

Quoted 69 lines · Vali Cobelea

Hi,

What seems to be the issue ?

BR,
Valentin

Quoted 57 lines · Robert Yang

Please hold this patch for a while, seems that it didn't fix all of the things.

// Robert

Quoted 37 lines · Robert Yang

There would be errors if there are recursive symlinks in the ${S}:

diff:
/xxx/udev/182-r8/udev-182/test/sys/block/loop0/bdi/subsystem/0:16/subsystem:
recursive directory loop

We can check the recursive symlink and save it to the exclude file, then the diff's --exclude-from argument can exclude them

[YOCTO #4986]

---
  meta/classes/archiver.bbclass |   18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
meta/classes/archiver.bbclass +11 -0
index 66efe7d..f5ad562 100644
@@ -493,6 +493,24 @@ def create_diff_gz(d):
      for i in exclude_from:
          f.write(i)
          f.write("\n")
+
+    symlinks = []
+    directories = []
+
+    # Add symlink and root dir to the separated lists for checking whether
+    # there is recursive symlink
+    for root, dirs, files in os.walk(os.getcwd(), followlinks=True):
+        if os.path.islink(root):
+            symlinks.append(root)
+        elif os.path.isdir(root):
+            directories.append(root)

meta/classes/archiver.bbclass def create_diff_gz(d): · line 516

Quoted 10 lines
meta/classes/archiver.bbclass +7 -0
+
+    # Check if there is a recursive symlink to a dir
+    for sym in symlinks:
+        if sym in directories:
+            # write the 'sym' in the 'exclude-from' file
+            f.write(os.path.basename(sym))
+
      f.close()
 
      s=d.getVar('S', True)

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core