dskvr / opkg

Automatically exported from code.google.com/p/opkg
0 stars 0 forks source link

opkg-cl remove will not remove symlinks from filesystem #91

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install a package with "opkg-cl install" that contains symlinks to 
directories which will be created.
2. Remove the very same package with "opkg-cl remove".

What is the expected output? What do you see instead?
I expect all files/directories to be deleted, even the symlinks.
Instead, all files/directories are deleted except for the symlinks.

What version of the product are you using? On what operating system?
~$ uname -a
Linux openpkg 3.2.0-23-virtual #36-Ubuntu SMP Tue Apr 10 22:29:03 UTC 2012 
x86_64 x86_64 x86_64 GNU/Linux

~$ opkg-cl --version
opkg version 0.1.8 (compiled svn r635)

Please provide any additional information below.
An strace shows that the symlinks will not be deleted, because opkg does a 
"stat" instead of an "lstat":

stat("/opt/opkg/var/www/includes/symlink", {st_mode=S_IFDIR|0775, st_size=4096, 
...}) = 0
rmdir("/opt/opkg/var/www/includes/symlink") = -1 ENOTDIR (Not a directory)

Original issue reported on code.google.com by boris.bi...@gmail.com on 17 Aug 2012 at 8:15

GoogleCodeExporter commented 8 years ago
I've created a test for this (tests/regress/issue91.py) and fixed the 
underlying bug by adding a function file_is_symlink() and checking that before 
treating the path in question as directory during a remove. Both changes made 
to the master branch, let me know if anyone wants this backporting to the 
opkg-0.2.x branch.

Original comment by paul.betafive on 16 Feb 2014 at 11:37