diff --git a/sunrise-commit b/sunrise-commit index 31bd285..a377ef2 100755 --- a/sunrise-commit +++ b/sunrise-commit @@ -145,11 +145,11 @@ find_ebuilds() { # Replace with the filtered version SC_CHANGE_LIST=${SC_REMOVED_PACKAGE_LIST} - local root sdir - root=${category:+../} + local sdir + SC_ROOT=${category:+../} 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 SC_SCENARIO=package-removal sayv "We're removing ${SC_CP}." @@ -444,6 +444,22 @@ main() { package-removal) vcs_status ${SC_CHANGE_LIST} 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 "${BGREEN}${SC_CP}: ${commitmsg}${RESET}" confirm @@ -453,8 +469,6 @@ main() { vcs_update ${SC_CHANGE_LIST} fi - # XXX: a consistency check on *DEPENDs, package.mask - vcs_commit "${noprepend-${SC_CP}: }${commitmsg}" ${SC_CHANGE_LIST} ;; esac