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

Bug 58605

Summary: ebuild.sh - dyn_preinst - removal of /usr/share logic wrong
Product: Portage Development Reporter: Daniel Black (RETIRED) <dragonheart>
Component: Core - Ebuild SupportAssignee: Portage team <dev-portage>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Daniel Black (RETIRED) gentoo-dev 2004-07-27 18:01:34 UTC
The following code fragment in ebuild.sh (dyn_preinst function is incorrect)

# remove share dir if unnessesary
  if hasq nodoc $FEATURES -o hasq noman $FEATURES -o hasq noinfo $FEATURES; then
    rmdir  "${IMAGE}/usr/share" &> /dev/null
fi

1. Unless I'm wrong -o is an "or" when "and" seems more logical
2. /usr/share can contain files that are not related to doc, man or info. There are generally shared configation files of a particular package.

Logic shoud be (imho) if /usr/share is empty remove it.

rmdir --ignore-fail-on-non-empty "${IMAGE}/usr/share"

maybe?
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2004-07-31 19:12:55 UTC
If the directory is empty, it is removed...

The or'ing simply prevents it from attempting to
remove it without a reason. Above that code there
are conditions to remove the subcomponents.

It's not a forced unlink.