]> andersk Git - config-package-dev.git/blobdiff - divert.sh.in
Set LC_ALL=C when matching potentially localized dpkg output
[config-package-dev.git] / divert.sh.in
index b705812712a6906ad563292b8302a0b44b951f1e..2c3f161b4ea47d092c7899e82f3885468d883e4a 100644 (file)
@@ -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
+}
This page took 0.462118 seconds and 4 git commands to generate.