Grep for removed package references before removal.

Use 'grep' to catch references to removed packages within other Sunrise
ebuilds (*DEPEND) and package.mask.
This commit is contained in:
Michał Górny 2010-08-12 23:01:43 +02:00
parent 5249ec662b
commit 6fbc0a0042

View File

@ -145,11 +145,11 @@ find_ebuilds() {
# Replace with the filtered version # Replace with the filtered version
SC_CHANGE_LIST=${SC_REMOVED_PACKAGE_LIST} SC_CHANGE_LIST=${SC_REMOVED_PACKAGE_LIST}
local root sdir local sdir
root=${category:+../} SC_ROOT=${category:+../}
for sdir in eclass licenses profiles; do for sdir in eclass licenses profiles; do
check_for_changes ${root}${sdir} >/dev/null && SC_CHANGE_LIST="${SC_CHANGE_LIST} ${root}${sdir}" check_for_changes ${SC_ROOT}${sdir} >/dev/null && SC_CHANGE_LIST="${SC_CHANGE_LIST} ${SC_ROOT}${sdir}"
done done
SC_SCENARIO=package-removal SC_SCENARIO=package-removal
sayv "We're removing ${SC_CP}." sayv "We're removing ${SC_CP}."
@ -444,6 +444,22 @@ main() {
package-removal) package-removal)
vcs_status ${SC_CHANGE_LIST} vcs_status ${SC_CHANGE_LIST}
echo echo
local pkg regex
regex=
for pkg in ${SC_REMOVED_PACKAGE_LIST}; do
regex="${regex:+${regex}\|}${pkg}"
done
say "${GREEN}Grepping for package references...${RESET}"
# -n is for line numbers, -C would be non-POSIX
if grep -n "${regex}" ${SC_ROOT}*/*/*.ebuild ${SC_ROOT}profiles/package.mask; then
echo
[ -n "${force}" ] || die 'Please remove the removed package references or use --force.'
else
echo
fi
say "Ready to commit ${WHITE}$(echo ${SC_REMOVED_PACKAGE_LIST} | wc -w)${RESET} package removal(s), with commit message:" say "Ready to commit ${WHITE}$(echo ${SC_REMOVED_PACKAGE_LIST} | wc -w)${RESET} package removal(s), with commit message:"
say "${BGREEN}${SC_CP}: ${commitmsg}${RESET}" say "${BGREEN}${SC_CP}: ${commitmsg}${RESET}"
confirm confirm
@ -453,8 +469,6 @@ main() {
vcs_update ${SC_CHANGE_LIST} vcs_update ${SC_CHANGE_LIST}
fi fi
# XXX: a consistency check on *DEPENDs, package.mask
vcs_commit "${noprepend-${SC_CP}: }${commitmsg}" ${SC_CHANGE_LIST} vcs_commit "${noprepend-${SC_CP}: }${commitmsg}" ${SC_CHANGE_LIST}
;; ;;
esac esac