Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 169457

Summary: upgrade/reinstall removes empty directories
Product: Portage Development Reporter: ic+gentoo
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description ic+gentoo 2007-03-05 14:25:49 UTC
When I install a package that has some empty directories, they are created in the filesystem. However, when the package is updated or reinstalled, those empty directories are removed. This is inconsistent.

Reproducible: Always

Steps to Reproduce:
1. emerge -C hal ; rm -rf /etc/hal
2. emerge -1 hal ; ## directory /etc/hal exists with its subdirectories
3. emerge -1 hal ; ## directory /etc/hal doesn't exist anymore



Expected Results:  
After step 3, the empty directory tree in /etc/hal should not be removed.

emerging hal is just an example, probably there are a lot other examples. I doubt there is a quick workaround, it's the ebuild philosophy with empty directories that is wrong (IMO).
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-03-05 14:34:50 UTC

*** This bug has been marked as a duplicate of bug 16162 ***
Comment 2 Zac Medico gentoo-dev 2007-03-05 17:46:23 UTC
(In reply to comment #0)
> Expected Results:  
> After step 3, the empty directory tree in /etc/hal should not be removed.

That's what keepdir is for (see `man 5 ebuild`).
Comment 3 SpanKY gentoo-dev 2007-03-06 17:11:25 UTC
keepdir should only be for keeping a directory after a package is removed completely

in the upgrade/reinstall path, portage should not be cleansing empty dirs ... but that's tracked in Bug 16162