#!/bin/bash # Remove files that conflict with the given package. # Useful when a package is broken up into sub-packages for dependency linearization. removeConflicts() { if [ -z "$1" ] then error "Parent package name is missing" exit 1 fi find / -maxdepth 0 -user $1 2>&1 >/dev/null || error "User $1 does not exist" for i in $(find $INSTALL_DIR -mindepth 1 -not -type d) do j=`echo $i | sed -e "s@$INSTALL_DIR@@"` k=`find $j -maxdepth 0 -user $1 2>/dev/null` if [ ! -z $k ] then rm -v -f $i fi done : }