drush_delete_dir() function deletes symlinked files. I think it isn't normal behavior for directory deletion function. Deleting symlinked files is very rare case and potentially dangerous operation.

I think that drush_delete_dir() should simply unlink symbolic links by default and delete symlinked files only if special argument provided.

Files: 

Comments

Title:drush_delete_dir() deletes symlinked filesHere is a patch
Status:Active» Needs review
StatusFileSize
new1.25 KB

Here is a patch

Title:Here is a patchdrush_delete_dir() function deletes symlinked files

fixing title...

Version:» 8.x-6.x-dev
Status:Needs review» Reviewed & tested by the community

This seems right to me. Works with all of our test cases, and should do the right thing for most normal uses. I can't think of an instance where someone might be depending on the current behavior -- although it certainly is possible that someone might be, I tend to think that the behavior is better (less surprising) with the patch in #1 applied.

As implemented, there is no way to tell Drush that it should destructively, recursively follow symlinks. I don't know if there's a usecase for that (c.f. instances where someone might be depending on the current behavior).

Assigned:Unassigned» jonhattan

hopefully jonhattan can take a quick look. if he is not available, greg can commit this in a couple days.

Status:Reviewed & tested by the community» Fixed

It seems right. Indeed the behaviour without this patch is a bug to me.

Committed to 6.x and 5.x

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.