Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 640058 - sys-apps/portage: failure to remove sys-kernel/gentoo-sources directory symlinks in /usr/src/linux-{PV}-gentoo/scripts/dtc/include-prefixes
Summary: sys-apps/portage: failure to remove sys-kernel/gentoo-sources directory symli...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 659322
  Show dependency tree
 
Reported: 2017-12-06 14:55 UTC by Daniel Harding
Modified: 2018-10-12 19:27 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Harding 2017-12-06 14:55:40 UTC
If I install gentoo-sources and immediately remove it without touching anything in the /usr/src/linux-*-gentoo directory, I get a message like the following on uninstall:

 * Note: Even though you have successfully unmerged 
 * your kernel package, directories in kernel source location: 
 * /usr/src/linux-4.14.2-gentoo
 * with modified files will remain behind. By design, package managers
 * will not remove these modified files and the directories they reside in.
 * For more detailed kernel removal instructions, please see: 
 * https://wiki.gentoo.org/wiki/Kernel/Removal

If I use find to show the contents, I get the following output:

$ find /usr/src/linux-4.14.2-gentoo/ 
/usr/src/linux-4.14.2-gentoo/
/usr/src/linux-4.14.2-gentoo/scripts
/usr/src/linux-4.14.2-gentoo/scripts/dtc
/usr/src/linux-4.14.2-gentoo/scripts/dtc/include-prefixes

I would expect that these directories would be uninstalled with the rest of the package.
Comment 1 Arisu Tachibana Gentoo Infrastructure gentoo-dev 2017-12-07 07:20:05 UTC
oh I see.
looking on it
Comment 2 Hector Martin 2018-07-12 23:30:20 UTC
Ping? This is pretty messy on buildboxes, where the packages get updated all the time. It winds up leaving junk in /usr/src for every version.
Comment 3 kuzetsa CatSwarm (kuza for short) 2018-07-13 03:11:34 UTC
the message which you referenced (In reply to Daniel Harding from comment #0)
> If I install gentoo-sources and immediately remove it without touching
> anything in the /usr/src/linux-*-gentoo directory, I get a message like the
> following on uninstall:
> 
>  * Note: Even though you have successfully unmerged 
>  * your kernel package, directories in kernel source location: 
>  * /usr/src/linux-4.14.2-gentoo
>  * with modified files will remain behind. By design, package managers
>  * will not remove these modified files and the directories they reside in.
>  * For more detailed kernel removal instructions, please see: 
>  * https://wiki.gentoo.org/wiki/Kernel/Removal
> 

^ the ewarn message is from /usr/portage/eclass/kernel-2.eclass

specifically, the section: kernel-2_pkg_postrm()

is this bug a request to change the design?

https://wiki.gentoo.org/wiki/Kernel/Removal

^ these instructions works as-expected for me.
Comment 5 Larry the Git Cow gentoo-dev 2018-07-14 23:58:37 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=3a25c3fa13d7c62ba8c00d6c7a75eb907d34b568

commit 3a25c3fa13d7c62ba8c00d6c7a75eb907d34b568
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-07-13 03:58:04 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-07-14 23:54:29 +0000

    _unmerge_dirs: revisit parents of removed symlinks (bug 640058)
    
    When removal of a symlink is triggered by removal of the directory
    that it points to, revisit the parent directories of the symlink.
    
    Bug: https://bugs.gentoo.org/640058
    Reviewed-by: Brian Dolbec <dolsen@gentoo.org>

 pym/portage/dbapi/vartree.py | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
Comment 6 kuzetsa CatSwarm (kuza for short) 2018-07-29 21:06:47 UTC
I apologize for the hasty conclusion / misunderstanding (2-ish weeks ago)

It's not limited to sys-kernel/gentoo-sources

while testing on the 4.14.x branch for
sys-kernel/ck-sources, I found lingering:

/usr/src/linux-{PV}-ck/scripts/dtc/include-prefixes

(non-removal during emerge --unmerge)