X-Git-Url: http://andersk.mit.edu/gitweb/config-package-dev.git/blobdiff_plain/936cb21eddc84e106dc3c64f70ee49d51d4a8a16..dd49a2d50d0a03e9159ac4ac6f35fbfed8ed70b1:/divert.sh.in diff --git a/divert.sh.in b/divert.sh.in index b705812..2c3f161 100644 --- a/divert.sh.in +++ b/divert.sh.in @@ -24,7 +24,7 @@ divert_link_divert() file=$1 ourfile=$2 theirfile=$3 - if ! dpkg-divert --list "$package" | \ + if ! LC_ALL=C dpkg-divert --list "$package" | \ grep -xFq "diversion of $file to $theirfile by $package"; then dpkg-divert --divert "$theirfile" --rename --package "$package" --add "$file" fi @@ -107,3 +107,27 @@ undivert_unremove() undivert_unlink_divert "$file" } +check_undivert_unlink() +{ + prefix=$1 + suffix=$2 + + file=$prefix$suffix + ourfile=$prefix$ours$suffix + theirfile=$prefix$theirs$suffix + + if LC_ALL=C dpkg-divert --list "$package" | \ + grep -xFq "diversion of $file to $theirfile by $package"; then + undivert_unlink "$prefix" "$suffix" + fi +} + +check_undivert_unremove() +{ + file=$1 + removedfile=$2 + if LC_ALL=C dpkg-divert --list "$package" | \ + grep -xFq "diversion of $file to $removedfile by $package"; then + undivert_unremove "$file" + fi +}