Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 177045 - app-portage/layman doesn't properly handle subdirectories that have been deleted in rsync overlays
Summary: app-portage/layman doesn't properly handle subdirectories that have been dele...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gunnar Wrobel (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-04 16:00 UTC by Mike Nerone
Modified: 2007-09-11 15:34 UTC (History)
0 users

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 Mike Nerone 2007-05-04 16:00:21 UTC
During an rsync sync, layman-1.0.10 currently runs a command like this:

/usr/bin/rsync -rlptDvz --progress --delete --delete-after --timeout=180 --exclude="distfiles/*" --exclude="local/*" --exclude="packages/*" "rsync://rsync.source.com/path-to-overlay/*" "/usr/portage/local/layman/overlayname"

This poses a problem: any directory that has not been deleted from the root of the overlay will fail to be deleted from the root of the local copy during the sync. Let me explain with an example: suppose the overlay has "dev-libs/somelib", and that somelib is the only package in that category. Then, at some point, somelib is no longer needed (happens all the time - either the dependency goes away, or somelib gets added to the main portage tree), so it is removed from the overlay, and the whole dev-libs category directory with it. Now, on the next layman sync, rsync won't even consider the dev-libs directory (because since it doesn't exist, it does not match the source pattern "rsync://rsync.source.com/path-to-overlay/*"), so rsync will not delete it.

At best, ebuilds within the deleted category directories will become cruft that never gets deleted from the local copy, and will continue to show up in "emerge -s" searches and the like. Worse, depending on the versioning and keywording, the stale overlay ebuild may mask out a more correct or more tested-as-stable ebuild in the main tree.

My suggestion is to simply remove the "*" at the end of the source pattern. My guess is that the original reason for the "*" was to ensure that the local copy has a root directory name of overlayname instead of copying the directory name from the source path, but per the rsync man page, the remaining trailing slash already ensures that.

Mike Nerone
Comment 1 Mike Nerone 2007-05-04 16:01:57 UTC
Apologies, there's an important typo in my report. I meant "any directory that *has* been deleted" (not "has not").
Comment 2 Gunnar Wrobel (RETIRED) gentoo-dev 2007-09-11 15:34:03 UTC
Thanks for the note. layman-1.1 is in the tree and this should be fixed.