Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 635290 - app-portage/gentoolkit: eclean does not rm symlinks
Summary: app-portage/gentoolkit: eclean does not rm symlinks
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
Depends on:
Reported: 2017-10-24 12:50 UTC by Joakim Tjernlund
Modified: 2020-04-24 08:53 UTC (History)
0 users

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

Simple symlink rm patch (clean_symlinks.patch,541 bytes, patch)
2020-04-24 08:53 UTC, Joakim Tjernlund
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2017-10-24 12:50:14 UTC
We have alot of symlinks in distfiles, like:
ls -l xorg-server-1.1*
lrwxrwxrwx 1 root root 56 Dec 17  2016 xorg-server-1.18.4.tar.bz2 -> /net/devsrv/portage/distfiles/xorg-server-1.18.4.tar.bz2
lrwxrwxrwx 1 root root 56 Sep 30 09:50 xorg-server-1.19.1.tar.bz2 -> /net/devsrv/portage/distfiles/xorg-server-1.19.1.tar.bz2
lrwxrwxrwx 1 root root 56 Mar  3  2017 xorg-server-1.19.2.tar.bz2 -> /net/devsrv/portage/distfiles/xorg-server-1.19.2.tar.bz2
lrwxrwxrwx 1 root root 56 Oct  5 16:39 xorg-server-1.19.4.tar.bz2 -> /net/devsrv/portage/distfiles/xorg-server-1.19.4.tar.bz2
lrwxrwxrwx 1 root root 56 Oct 13 17:01 xorg-server-1.19.5.tar.bz2 -> /net/devsrv/portage/distfiles/xorg-server-1.19.5.tar.bz2

eclean-dist -d will not rm old symlinks(or broken symlinks)
Comment 1 Joakim Tjernlund 2017-10-25 12:28:12 UTC
Extending _isreg_check(in with LNK test seems to do the trick:
def _isreg_check_(file_stat, file):
	"""check if file is a regular file."""
	is_reg_file = stat.S_ISREG(file_stat[stat.ST_MODE])
	is_lnk_file = stat.S_ISLNK(file_stat[stat.ST_MODE])
	return  not (is_reg_file or is_lnk_file), is_reg_file or is_lnk_file
Comment 2 Joakim Tjernlund 2017-11-04 10:48:57 UTC
Comment 3 Brian Dolbec gentoo-dev 2017-11-06 05:01:35 UTC
Sorry, I've been really busy, not had much time for any bugs.

Thanks, I will try to get it applied soon.
Comment 4 Joakim Tjernlund 2017-12-29 16:31:15 UTC
ping ?
Comment 5 Joakim Tjernlund 2018-01-18 18:47:29 UTC
gentle ping ?
Comment 6 Joakim Tjernlund 2018-03-01 18:57:32 UTC
... ping ...
Comment 7 Brian Dolbec gentoo-dev 2018-03-03 04:31:15 UTC
Same answer as last time... super busy, I don't have much time at all and way behind on other partially finished things.

If you can please have a look at the code, make a patch, submit it.  One of us will make the time to review/test it.
Comment 8 Joakim Tjernlund 2020-04-24 08:53:28 UTC
Created attachment 634346 [details, diff]
Simple symlink rm patch

This is my hack to get the jobs done.
I don't really do python so this is the best I can do.