Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | drush-deleting-symlinked-files-1787452-1.patch | 1.25 KB | danylevskyi |
Comments
Comment #1
danylevskyiHere is a patch
Comment #2
danylevskyifixing title...
Comment #3
greg.1.anderson CreditAttribution: greg.1.anderson commentedThis 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).
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedhopefully jonhattan can take a quick look. if he is not available, greg can commit this in a couple days.
Comment #5
jonhattanIt seems right. Indeed the behaviour without this patch is a bug to me.
Committed to 6.x and 5.x